From 06c0c9b068bbc94eb82dc317ffc811d1c58d3e38 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 09 May 2013 13:04:08 -0400 Subject: Merge branch 'feature/build-system-improvements'. --- (limited to 'configure') diff --git a/configure b/configure index fdce6b7..e895089 100755 --- a/configure +++ b/configure @@ -22,15 +22,19 @@ package_name='opkhelper' package_version='3.0.0-beta1' 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}' +# FIXME: libopkhelper is deprecated. Migrate code and remove this variable. +libopkhelper='${pkglibdir}' datadir='${prefix}/share' mandir='${datadir}/man' +man1dir='${mandir}/man1' localedir='${datadir}/locale' -libopkhelper='${libdir}/libopkhelper.3.0' multiarch_libdir='false' quiet='false' @@ -49,8 +53,10 @@ srcdir prefix bindir libdir +pkglibdir datadir mandir +man1dir localedir ' @@ -62,10 +68,12 @@ ${opt_dep_libs} multiarch-libdir " +# FIXME: libopkhelper is deprecated. Migrate code and remove this variable. subst_vars=" package_name package_version package_description +package_library ${long_opts_with_args} libopkhelper ${features} @@ -151,10 +159,14 @@ Installation directories: default: PREFIX/bin --libdir=LIBDIR install library scripts in LIBDIR default: PREFIX/share + --pkglibdir=PKGLIBDIR install package library scripts in PKGLIBDIR + default: LIBDIR/${package_library} --datadir=DATADIR expect to find data in DATADIR default: PREFIX/share --mandir=MANDIR install manual pages in MANDIR default: DATADIR/man + --man1dir=MAN1DIR install section 1 manual pages in MAN1DIR + default: MANDIR/man1 --localedir=LOCALEDIR install locales in LOCALEDIR default: DATADIR/locale @@ -278,7 +290,8 @@ find_dep_cmd() : ${_element=-.} if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}" - eval "${_dep}"=\"${_element}/${_dep}\" + _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')" + eval "${_var}"=\"${_element}/${_dep}\" return 0 fi done @@ -302,7 +315,8 @@ find_dep_lib() : ${_element=-.} if [ -d "${_element}/${_dep}" ]; then ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}" - eval "${_dep}"=\"${_element}/${_dep}\" + _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')" + eval "${_var}"=\"${_element}/${_dep}\" return 0 fi done @@ -315,17 +329,17 @@ find_dep_lib() 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 - - for _dir in . src lib lib/buildsystem locale man; do - mkdir -p "${_dir}" - sed "${_sed_script}" "${srcdir}/${_dir}/Makefile.in" >"${_dir}/Makefile" - done + sed "${_sed_script}" "${srcdir}/Makefile.in" >'Makefile' # New and improved kludge to generate an architecture table for testing. # TODO: Remove when no longer used. -- cgit v0.9.1