summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-02 14:40:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-02 14:40:47 +0000
commit465ac8d55b18b05a5065d2cb9ecd40e18542b555 (patch)
treeea29cb68c44b820c8749c8e2e093ac8aed86c0c5
parentf3c40f0a97898a83756b43dde1e0485b02e71c4b (diff)
downloadskalibs-465ac8d55b18b05a5065d2cb9ecd40e18542b555.tar.xz
More noob-friendly defaults for configure
-rwxr-xr-xconfigure39
1 files changed, 29 insertions, 10 deletions
diff --git a/configure b/configure
index a946138..a552e31 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,7 @@
#!/bin/sh
+. package/info
+
usage () {
cat <<EOF
Usage: $0 [OPTION]... [VAR=VALUE]... [TARGET]
@@ -18,10 +20,13 @@ Installation directories:
Fine tuning of the installation directories:
--dynlibdir=DIR shared library files [PREFIX/lib]
- --libdir=DIR static library files [PREFIX/usr/lib/skalibs]
- --includedir=DIR include files for the C compiler [PREFIX/usr/include]
+ --libdir=DIR static library files [PREFIX/lib/$package]
+ --includedir=DIR include files for the C compiler [PREFIX/include]
--datadir=DIR global configuration files [PREFIX/etc]
- --sysdepdir=DIR sysdeps directory [PREFIX/usr/lib/skalibs/sysdeps]
+ --sysdepdir=DIR sysdeps directory [PREFIX/lib/$package/sysdeps]
+
+ If no --prefix option is given, by default libdir will be /usr/lib/$package,
+ includedir will be /usr/include and sysdepdir will be /usr/lib/$package/sysdeps.
Dependencies:
--with-sysdeps=DIR use provided sysdeps in DIR [autodetected]
@@ -35,7 +40,7 @@ Optional features:
--enable-slashpackage[=ROOT] assume /package installation at ROOT [disabled]
--enable-cross=PREFIX prefix toolchain executable names with PREFIX [none]
-skalibs options:
+$package options:
--enable-libc-replacements use independent low-level primitives [disabled]
--enable-egd=PATH support an EGD daemon listening on PATH as RNG [disabled]
--disable-ipv6 do not build IPv6 support [enabled]
@@ -50,7 +55,6 @@ EOF
exit 0
}
-
# Helper functions
# If your system does not have printf, you can comment this, but it is
@@ -173,10 +177,10 @@ LDFLAGS_AUTO="$LDFLAGS"
LDFLAGS_NOSHARED=
prefix=
dynlibdir='$prefix/lib'
-libdir='$prefix/usr/lib/skalibs'
-includedir='$prefix/usr/include'
+libdir='$prefix/lib/$package'
+includedir='$prefix/include'
datadir='$prefix/etc'
-sysdepdir='$prefix/usr/lib/$package/sysdeps'
+sysdepdir='$prefix/lib/$package/sysdeps'
sysdeps=
shared=true
static=true
@@ -200,7 +204,6 @@ vpaths=''
vpathd=''
cross="$CROSS_COMPILE"
-. package/info
for arg ; do
case "$arg" in
@@ -251,12 +254,28 @@ for arg ; do
esac
done
-for i in prefix exec_prefix dynlibdir libdir includedir datadir sysdepdir sysdeps sproot ; do
+# Add /usr in the default default case
+if test -z "$prefix" ; then
+ if test "$libdir" = '$prefix/lib/$package' ; then
+ libdir=/usr/lib/$package
+ fi
+ if test "$includedir" = '$prefix/include' ; then
+ includedir=/usr/include
+ fi
+ if test "$sysdepdir" = '$prefix/lib/$package/sysdeps' ; then
+ sysdepdir=/usr/lib/$package/sysdeps
+ fi
+fi
+
+# Expand installation directories
+stripdir prefix
+for i in exec_prefix dynlibdir libdir includedir datadir sysdepdir sysdeps sproot ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
+
# Get usable temp filenames
i=0
set -C