summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure52
1 files changed, 30 insertions, 22 deletions
diff --git a/configure b/configure
index fca8b11..cb13a3e 100755
--- a/configure
+++ b/configure
@@ -4,7 +4,7 @@
# configure
# Configuration script to generate Makefile.
#
-# Copyright (C) 2012 Patrick "P. J." McDermott
+# 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
@@ -22,16 +22,19 @@
package_name='opkbuild'
package_version='3.0.0-alpha4'
package_description='OPK Build System'
+package_library='libopkbuild.1'
srcdir="$(cd "${0%/*}" && pwd)"
prefix='/usr/local'
-bindir='$(prefix)/bin'
-libdir='$(prefix)/share'
-datadir='$(prefix)/share'
-mandir='$(datadir)/man'
-localedir='$(datadir)/locale'
+bindir='${prefix}/bin'
+libdir='${prefix}/share'
+pkglibdir='${libdir}/${package_library}'
+datadir='${prefix}/share'
+mandir='${datadir}/man'
+man1dir='${mandir}/man1'
+man3dir='${mandir}/man3'
+localedir='${datadir}/locale'
sysconfdir='/etc'
-libopkbuild='$(libdir)/libopkbuild.1'
metadata='proteanos'
quiet='false'
@@ -50,8 +53,11 @@ srcdir
prefix
bindir
libdir
+pkglibdir
datadir
mandir
+man1dir
+man3dir
localedir
sysconfdir
'
@@ -68,8 +74,8 @@ subst_vars="
package_name
package_version
package_description
+package_library
${long_opts_with_args}
-libopkbuild
${features}
"
@@ -153,10 +159,16 @@ 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
+ --man3dir=MAN1DIR install section 3 manual pages in MAN3DIR
+ default: MANDIR/man3
--localedir=LOCALEDIR install locales in LOCALEDIR
default: DATADIR/locale
--sysconfdir=SYSCONFDIR install system configuration in SYSCONFDIR
@@ -182,7 +194,7 @@ print_version()
${package_name} ${package_version} configure
Not generated by GNU Autoconf
-Copyright (C) 2011-2012 Patrick "P. J." McDermott
+Copyright (C) 2011-2013 Patrick "P. J." McDermott
License: GNU GPL version 2 or later <http://www.gnu.org/licenses/gpl.html>.
This configure script is free software: you can redistribute and/or modify it.
There is NO WARRANTY, to the extent permitted by law.
@@ -283,7 +295,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
@@ -300,26 +313,24 @@ find_dep_lib()
${quiet} || printf 'checking for %s... ' "${_dep}"
- IFS=':'
-
- for _element in ${libdir}:${PATH}; do
- unset IFS
+ for _element in $(eval echo "${libdir}") ${PATH}; do
: ${_element=-.}
- if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then
+ 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
- unset IFS
-
${quiet} || printf 'not found\n'
return 1
}
write_makefiles()
{
+ mkdir -p src lib lib/package lib/metadata locale man tests
+
# Make a script to edit input makefiles.
_sed_script=''
for _var in ${subst_vars}; do
@@ -327,10 +338,7 @@ write_makefiles()
_sed_script="${_sed_script}s&@${_var}@&$(eval echo \$\{"${_var}"\})&g;"
done
- for _dir in . src lib lib/package lib/metadata locale man tests; 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 system configuration for testing.
# TODO: Remove when no longer used.