From 20c66a1eaef872dbfad4ba82d2ca1c74eb4c9818 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 01 Mar 2014 19:40:11 -0500 Subject: Merge branch 'feature/autoconf-and-automake'. --- (limited to 'configure') diff --git a/configure b/configure deleted file mode 100755 index 5687863..0000000 --- a/configure +++ /dev/null @@ -1,344 +0,0 @@ -#! /bin/sh -# -# opkhelper -# configure -# Configuration script to generate Makefile. -# -# Copyright (C) 2011-2013 Patrick "P. J." McDermott -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -package_name='opkhelper' -package_version='3.0.0-beta4' -package_description='OPK Build Helper Tools' -package_library='libopkhelper.3.0' - -srcdir="$(cd "${0%/*}" && pwd)" -prefix='/usr/local' -bindir='${prefix}/bin' -libdir='${prefix}/share' -pkglibdir='${libdir}/${package_library}' -datadir='${prefix}/share' -mandir='${datadir}/man' -man1dir='${mandir}/man1' -localedir='${datadir}/locale' -pkgdatadir='${datadir}/${package_name}' -archtabdir='${pkgdatadir}/archtab' -multiarch_libdir='true' - -quiet='false' -missing_deps='false' -dep_cmds=' -sh -make -' -dep_libs=' -' - -long_opts_with_args=' -srcdir -prefix -bindir -libdir -pkglibdir -datadir -mandir -man1dir -localedir -pkgdatadir -archtabdir -' - -features=" -${dep_cmds} -${dep_libs} -${opt_dep_cmds} -${opt_dep_libs} -multiarch-libdir -" - -subst_vars=" -package_name -package_version -package_description -package_library -${long_opts_with_args} -${features} -" - -main() -{ - parse_options "${@}" - shift ${optind} - if [ ${#} -ne 0 ]; then - print_usage - exit - fi - - for dep in ${dep_cmds}; do - dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" - dep_val="$(eval echo \$\{"${dep_name}"\})" - if [ -z "${dep_val}" ]; then - find_dep_cmd "${dep}" || missing_deps='true' - fi - done - for dep in ${dep_libs}; do - dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" - dep_val="$(eval echo \$\{"${dep_name}"\})" - if [ -z "${dep_val}" ]; then - find_dep_lib "${dep}" || missing_deps='true' - fi - done - for dep in ${opt_dep_cmds}; do - dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" - dep_val="$(eval echo \$\{"${dep_name}"\})" - if [ -z "${dep_val}" ]; then - find_dep_cmd "${dep}" - fi - done - for dep in ${opt_dep_libs}; do - dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" - dep_val="$(eval echo \$\{"${dep_name}"\})" - if [ -z "${dep_val}" ]; then - find_dep_lib "${dep}" - fi - done - - if ${missing_deps}; then - cat <. -This configure script is free software: you can redistribute and/or modify it. -There is NO WARRANTY, to the extent permitted by law. -EOF -} - -parse_options() -{ - optind=0 - - for _opt; do - - # Handle arguments of "--opt arg" options. - if [ -n "${_prev}" ]; then - eval "${_prev}"=\"\$\{_opt\}\" - _prev='' - continue - fi - - # Detect "--opt=arg" and "--opt arg" options. - case "${_opt}" in - *=*) - _optarg="${_opt#*=}" - _opt="${_opt%=*}" - _optarg_set='true' - ;; - *) - _optarg_set='false' - ;; - esac - - # Handle short and long options. - case "${_opt}" in - --) - break - ;; - -h|--help) - print_help - exit 0 - ;; - -V|--version) - print_version - exit 0 - ;; - -q|--quiet) - quiet='true' - continue - ;; - esac - - # Anything beyond this point should be a long option. - case "${_opt}" in - --with-*) - _opt="${_opt#--with-}" - _opts="${features}" - _type='package' - ;; - --*) - _opt="${_opt#--}" - _opts="${long_opts_with_args}" - _type='option' - ;; - *) - break - ;; - esac - - grep "^${_opt}\$" >/dev/null 2>&1 <&2 - continue - fi - if ${_optarg_set}; then - _opt="$(printf '%s' "${_opt}" | tr -c '[a-z0-9]' '_')" - eval "${_opt}"=\"\$\{_optarg\}\" - else - _prev="${_opt}" - fi - - optind=$(($optind + 1)) - - done -} - -find_dep_cmd() -{ - _dep="${1}" - - ${quiet} || printf 'checking for %s... ' "${_dep}" - - IFS=':' - - for _element in ${PATH}; do - unset IFS - : ${_element=-.} - if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then - ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}" - _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')" - eval "${_var}"=\"${_element}/${_dep}\" - return 0 - fi - done - - unset IFS - - ${quiet} || printf 'not found\n' - return 1 -} - -find_dep_lib() -{ - _dep="${1}" - - ${quiet} || printf 'checking for %s... ' "${_dep}" - - IFS=':' - - for _element in $(eval echo "${libdir}") ${PATH}; do - unset IFS - : ${_element=-.} - if [ -d "${_element}/${_dep}" ]; then - ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}" - _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')" - eval "${_var}"=\"${_element}/${_dep}\" - return 0 - fi - done - - unset IFS - - ${quiet} || printf 'not found\n' - return 1 -} - -write_makefiles() -{ - for _dir in src lib lib/buildsystem locale man; do - [ -d "${_dir}" ] || mkdir "${_dir}" - done - - # Make a script to edit input makefiles. - _sed_script='' - for _var in ${subst_vars}; do - _var="$(printf '%s' "${_var}" | tr -c '[a-z0-9]' '_')" - _sed_script="${_sed_script}s&@${_var}@&$(eval echo \$\{"${_var}"\})&g;" - done - sed "${_sed_script}" "${srcdir}/Makefile.in" >'Makefile' -} - -main "${@}" -- cgit v0.9.1