From 24581482d076c4b13a92568e2244bf610b21ad0e Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 29 Jun 2004 13:29:25 +0000 Subject: [PATCH] make -O2 optimisation flag configurable. --- VERSION | 2 +- WHATS_NEW | 5 +- configure | 466 +++++++++++++++++++++++++++------------------------ configure.in | 92 +++++----- make.tmpl.in | 4 +- 5 files changed, 304 insertions(+), 265 deletions(-) diff --git a/VERSION b/VERSION index a9f466bfb..da7fad523 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.00.18-cvs (2004-06-24) +2.00.19-cvs (2004-06-29) diff --git a/WHATS_NEW b/WHATS_NEW index f76afc4da..1b1fc17f9 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,8 @@ -Version 2.00.19 - +Version 2.00.19 - 29 June 2004 ============================== + Reduce severity of setlocale failure message. + Recognise argv[0] "initrd-lvm" (pld-linux). + Make -O2 configurable. Added --disable-selinux to configure script. LD_FLAGS->LDFLAGS & LD_DEPS->LDDEPS in configure script. Add init_debug to clvmd. diff --git a/configure b/configure index 4ca406fba..f5462afc0 100755 --- a/configure +++ b/configure @@ -47,6 +47,8 @@ ac_help="$ac_help --with-clvmd Build cluster LVM Daemon" ac_help="$ac_help --enable-debug Enable debugging" +ac_help="$ac_help + --with-optimisation=OPT C optimisation flag [OPT=-O2] " ac_help="$ac_help --disable-devmapper Disable device-mapper interaction" ac_help="$ac_help @@ -595,13 +597,135 @@ ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +################################################################################ + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:630: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:651: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:669: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +case "$host_os" in + linux*) + CFLAGS="$CFLAGS" + COPTIMISE_FLAG="-O2" + CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" + CLDWHOLEARCHIVE="-Wl,-whole-archive" + CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" + LDDEPS="$LDDEPS .export.sym" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + SOFLAG="-shared" + DEVMAPPER=yes + ODIRECT=yes + SELINUX=yes + CLUSTER=internal + FSADM=no ;; + darwin*) + CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" + COPTIMISE_FLAG="-O2" + CLDFLAGS="$CLDFLAGS" + CLDWHOLEARCHIVE="-all_load" + CLDNOWHOLEARCHIVE= + LDDEPS="$LDDEPS" + LDFLAGS="$LDFLAGS" + SOFLAG="-dynamiclib" + DEVMAPPER=no + ODIRECT=no + SELINUX=no + CLUSTER=none + FSADM=no ;; +esac + ################################################################################ for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:605: checking for $ac_word" >&5 +echo "configure:729: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -633,7 +757,7 @@ done # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:637: checking for $ac_word" >&5 +echo "configure:761: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -663,7 +787,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:667: checking for $ac_word" >&5 +echo "configure:791: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -714,7 +838,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:718: checking for $ac_word" >&5 +echo "configure:842: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -746,7 +870,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -757,12 +881,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 761 "configure" +#line 885 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -788,12 +912,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:916: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:797: checking whether we are using GNU C" >&5 +echo "configure:921: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -802,7 +926,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -821,7 +945,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:825: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:949: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -864,7 +988,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:868: checking for a BSD compatible install" >&5 +echo "configure:992: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -917,7 +1041,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:921: checking whether ln -s works" >&5 +echo "configure:1045: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -938,7 +1062,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:942: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1066: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -967,7 +1091,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:971: checking for $ac_word" >&5 +echo "configure:1095: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -995,138 +1119,18 @@ else fi -################################################################################ - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1028: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:1049: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1067: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -case "$host_os" in - linux*) - CFLAGS="$CFLAGS" - CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" - CLDWHOLEARCHIVE="-Wl,-whole-archive" - CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" - LDDEPS="$LDDEPS .export.sym" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - SOFLAG="-shared" - DEVMAPPER=yes - ODIRECT=yes - SELINUX=yes - CLUSTER=internal - FSADM=no ;; - darwin*) - CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" - CLDFLAGS="$CLDFLAGS" - CLDWHOLEARCHIVE="-all_load" - CLDNOWHOLEARCHIVE= - LDDEPS="$LDDEPS" - LDFLAGS="$LDFLAGS" - SOFLAG="-dynamiclib" - DEVMAPPER=no - ODIRECT=no - SELINUX=no - CLUSTER=none - FSADM=no ;; -esac - ################################################################################ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1125: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1129: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1134,7 +1138,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1159,7 +1163,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1163: checking for opendir in -ldir" >&5 +echo "configure:1167: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1167,7 +1171,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1200,7 +1204,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1204: checking for opendir in -lx" >&5 +echo "configure:1208: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1208,7 +1212,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1242,7 +1246,7 @@ fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1246: checking how to run the C preprocessor" >&5 +echo "configure:1250: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1257,13 +1261,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1274,13 +1278,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1291,13 +1295,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1322,12 +1326,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1326: checking for ANSI C header files" >&5 +echo "configure:1330: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1335,7 +1339,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1352,7 +1356,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1370,7 +1374,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1391,7 +1395,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1402,7 +1406,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1429,17 +1433,17 @@ for ac_hdr in fcntl.h malloc.h sys/ioctl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1433: checking for $ac_hdr" >&5 +echo "configure:1437: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1468,12 +1472,12 @@ done ################################################################################ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1472: checking for working const" >&5 +echo "configure:1476: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1543,21 +1547,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1547: checking for inline" >&5 +echo "configure:1551: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1583,12 +1587,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1587: checking for off_t" >&5 +echo "configure:1591: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1616,12 +1620,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1620: checking for pid_t" >&5 +echo "configure:1624: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1649,12 +1653,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1653: checking for size_t" >&5 +echo "configure:1657: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1682,12 +1686,12 @@ EOF fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:1686: checking for st_rdev in struct stat" >&5 +echo "configure:1690: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1695,7 +1699,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:1699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -1716,12 +1720,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1720: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1724: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1730,7 +1734,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1989,6 +1993,20 @@ fi echo "$ac_t""$DEBUG" 1>&6 +if test x$DEBUG = xyes; then + COPTIMISE_FLAG= +fi + +################################################################################ +echo $ac_n "checking for C optimisation flag""... $ac_c" 1>&6 +# Check whether --with-optimisation or --without-optimisation was given. +if test "${with_optimisation+set}" = set; then + withval="$with_optimisation" + COPTIMISE_FLAG="$withval" +fi + +echo "$ac_t""$COPTIMISE_FLAG" 1>&6 + ################################################################################ echo $ac_n "checking whether to use device-mapper""... $ac_c" 1>&6 # Check whether --enable-devmapper or --disable-devmapper was given. @@ -2054,13 +2072,13 @@ fi; ################################################################################ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2058: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2076: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -2078,7 +2096,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2100,12 +2118,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2104: checking return type of signal handlers" >&5 +echo "configure:2122: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2122,7 +2140,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2141,12 +2159,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2145: checking for vprintf" >&5 +echo "configure:2163: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2193,12 +2211,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2197: checking for _doprnt" >&5 +echo "configure:2215: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2248,12 +2266,12 @@ fi for ac_func in mkdir rmdir uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2252: checking for $ac_func" >&5 +echo "configure:2270: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2305,14 +2323,14 @@ done if test x$READLINE = xyes; then echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:2309: checking for library containing tgetent" >&5 +echo "configure:2327: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -2334,7 +2352,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in ncurses curses termcap termlib; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -2379,7 +2397,7 @@ fi ################################################################################ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2383: checking for dlopen in -ldl" >&5 +echo "configure:2401: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2387,7 +2405,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2439,7 +2457,7 @@ fi ################################################################################ if test x$SELINUX = xyes; then echo $ac_n "checking for is_selinux_enabled in -lselinux""... $ac_c" 1>&6 -echo "configure:2443: checking for is_selinux_enabled in -lselinux" >&5 +echo "configure:2461: checking for is_selinux_enabled in -lselinux" >&5 ac_lib_var=`echo selinux'_'is_selinux_enabled | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2447,7 +2465,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lselinux $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2493,17 +2511,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2497: checking for $ac_hdr" >&5 +echo "configure:2515: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2533,7 +2551,7 @@ done ################################################################################ if test x$READLINE = xyes; then echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:2537: checking for readline in -lreadline" >&5 +echo "configure:2555: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2541,7 +2559,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2589,12 +2607,12 @@ package as well (which may be called readline-devel or something similar). fi echo $ac_n "checking for rl_completion_matches""... $ac_c" 1>&6 -echo "configure:2593: checking for rl_completion_matches" >&5 +echo "configure:2611: checking for rl_completion_matches" >&5 if eval "test \"`echo '$''{'ac_cv_func_rl_completion_matches'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_rl_completion_matches=yes" else @@ -2657,7 +2675,7 @@ if test x$INTL = xyes; then # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2661: checking for $ac_word" >&5 +echo "configure:2679: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2764,6 +2782,7 @@ fi + ################################################################################ @@ -2935,14 +2954,6 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g -s%@AWK@%$AWK%g -s%@CC@%$CC%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LN_S@%$LN_S%g -s%@SET_MAKE@%$SET_MAKE%g -s%@RANLIB@%$RANLIB%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g @@ -2958,6 +2969,14 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g +s%@AWK@%$AWK%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@LN_S@%$LN_S%g +s%@SET_MAKE@%$SET_MAKE%g +s%@RANLIB@%$RANLIB%g s%@CPP@%$CPP%g s%@MSGFMT@%$MSGFMT%g s%@JOBS@%$JOBS%g @@ -2968,6 +2987,7 @@ s%@SNAPSHOTS@%$SNAPSHOTS%g s%@MIRRORS@%$MIRRORS%g s%@OWNER@%$OWNER%g s%@GROUP@%$GROUP%g +s%@COPTIMISE_FLAG@%$COPTIMISE_FLAG%g s%@CLDFLAGS@%$CLDFLAGS%g s%@CLDWHOLEARCHIVE@%$CLDWHOLEARCHIVE%g s%@CLDNOWHOLEARCHIVE@%$CLDNOWHOLEARCHIVE%g diff --git a/configure.in b/configure.in index bbd0f1852..cf30465ac 100644 --- a/configure.in +++ b/configure.in @@ -18,29 +18,21 @@ ################################################################################ ################################################################################ -dnl Process this file with autoconf to produce a configure script. +dnl -- Process this file with autoconf to produce a configure script. AC_INIT(lib/device/dev-cache.h) ################################################################################ -dnl setup the directory where autoconf has auxilary files +dnl -- setup the directory where autoconf has auxilary files AC_CONFIG_AUX_DIR(autoconf) ################################################################################ -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_RANLIB - -################################################################################ -dnl Get system type +dnl -- Get system type AC_CANONICAL_SYSTEM case "$host_os" in linux*) CFLAGS="$CFLAGS" + COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" CLDWHOLEARCHIVE="-Wl,-whole-archive" CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" @@ -54,6 +46,7 @@ case "$host_os" in FSADM=no ;; darwin*) CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" + COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS" CLDWHOLEARCHIVE="-all_load" CLDNOWHOLEARCHIVE= @@ -68,13 +61,22 @@ case "$host_os" in esac ################################################################################ -dnl Checks for header files. +dnl -- Checks for programs. +AC_PROG_AWK +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +################################################################################ +dnl -- Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h) ################################################################################ -dnl Checks for typedefs, structures, and compiler characteristics. +dnl -- Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T @@ -84,7 +86,7 @@ AC_STRUCT_ST_RDEV AC_HEADER_TIME ################################################################################ -dnl -- prefix is /usr by default, the exec_prefix default is setup later +dnl -- Prefix is /usr by default, the exec_prefix default is setup later AC_PREFIX_DEFAULT(/usr) ################################################################################ @@ -92,7 +94,7 @@ dnl -- Parallel make jobs? AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2) ################################################################################ -dnl -- setup the ownership of the files +dnl -- Setup the ownership of the files echo $ac_n "Setting file owner to""... $ac_c" 1>&6 OWNER="root" @@ -106,7 +108,7 @@ if test x$OWNER != x; then fi ################################################################################ -dnl -- setup the group ownership of the files +dnl -- Setup the group ownership of the files echo $ac_n "Setting group owner to""... $ac_c" 1>&6 GROUP="root" AC_ARG_WITH(group, @@ -234,14 +236,14 @@ if test x$MIRRORS = xinternal; then fi ################################################################################ -dnl Enables staticly-linked tools +dnl -- Enables staticly-linked tools echo $ac_n "checking whether to use static linking""... $ac_c" 1>&6 AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no) echo "$ac_t""$STATIC_LINK" 1>&6 ################################################################################ -dnl Enable readline +dnl -- Enable readline echo $ac_n "checking whether to enable readline""... $ac_c" 1>&6 AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \ READLINE=$enableval, READLINE=no) @@ -252,33 +254,46 @@ if test x$READLINE = xyes; then fi ################################################################################ -dnl Disable selinux +dnl -- Disable selinux echo $ac_n "checking whether to enable selinux support""... $ac_c" 1>&6 AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], \ SELINUX=$enableval) echo "$ac_t""$SELINUX" 1>&6 ################################################################################ -dnl Build cluster LVM daemon +dnl -- Build cluster LVM daemon echo $ac_n "checking whether to build cluster LVM daemon""... $ac_c" 1>&6 AC_ARG_WITH(clvmd, [ --with-clvmd Build cluster LVM Daemon], \ CLVMD=$withval, CLVMD=no) echo "$ac_t""$CLVMD" 1>&6 -dnl If clvmd enabled and not cluster locking, automgically include the locking. +dnl -- If clvmd enabled without cluster locking, automagically include it if test x$CLVMD = xyes && test x$CLUSTER = xnone; then CLUSTER=internal fi ################################################################################ -dnl Enable Debugging +dnl -- Enable debugging echo $ac_n "checking whether to enable debugging""... $ac_c" 1>&6 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \ DEBUG=yes, DEBUG=no) echo "$ac_t""$DEBUG" 1>&6 +dnl -- Normally turn off optimisation for debug builds +if test x$DEBUG = xyes; then + COPTIMISE_FLAG= +fi + ################################################################################ -dnl Disable devmapper +dnl -- Override optimisation +echo $ac_n "checking for C optimisation flag""... $ac_c" 1>&6 +AC_ARG_WITH(optimisation, + [ --with-optimisation=OPT C optimisation flag [OPT=-O2] ], + [ COPTIMISE_FLAG="$withval" ]) +echo "$ac_t""$COPTIMISE_FLAG" 1>&6 + +################################################################################ +dnl -- Disable devmapper echo $ac_n "checking whether to use device-mapper""... $ac_c" 1>&6 AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \ DEVMAPPER=no) @@ -289,7 +304,7 @@ if test x$DEVMAPPER = xyes; then fi ################################################################################ -dnl Disable O_DIRECT +dnl -- Disable O_DIRECT echo $ac_n "checking whether to enable O_DIRECT""... $ac_c" 1>&6 AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], \ ODIRECT=no) @@ -300,7 +315,7 @@ if test x$ODIRECT = xyes; then fi ################################################################################ -dnl Enable cmdlib +dnl -- Enable cmdlib echo $ac_n "checking whether to compile liblvm2cmd.so""... $ac_c" 1>&6 AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], \ CMDLIB=yes, CMDLIB=no) @@ -311,26 +326,26 @@ if test x$CMDLIB = xyes; then fi ################################################################################ -dnl Enable fsadm +dnl -- Enable fsadm echo $ac_n "checking whether to build fsadm""... $ac_c" 1>&6 AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm], FSADM=yes) echo "$ac_t""$FSADM" 1>&6 ################################################################################ -dnl Mess with default exec_prefix +dnl -- Mess with default exec_prefix if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; then exec_prefix=""; fi; ################################################################################ -dnl Checks for library functions. +dnl -- Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(mkdir rmdir uname) ################################################################################ -dnl check for termcap (Shamelessly copied from parted 1.4.17) +dnl -- Check for termcap (Shamelessly copied from parted 1.4.17) if test x$READLINE = xyes; then AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, , AC_MSG_ERROR( @@ -348,7 +363,7 @@ Note: (n)curses also seems to work as a substitute for termcap. This was fi ################################################################################ -dnl Check for dlopen +dnl -- Check for dlopen AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) if [[ "x$HAVE_LIBDL" = xyes -a "x$STATIC_LINK" = xno ]]; then @@ -359,7 +374,7 @@ else fi ################################################################################ -dnl Check for shared/static conflicts +dnl -- Check for shared/static conflicts if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ \) -a "x$STATIC_LINK" = xyes ]]; @@ -370,7 +385,7 @@ Features cannot be 'shared' when building statically fi ################################################################################ -dnl Check for is_selinux_enabled +dnl -- Check for is_selinux_enabled if test x$SELINUX = xyes; then AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no) @@ -383,11 +398,11 @@ if test x$SELINUX = xyes; then fi ################################################################################ -dnl Check for getopt +dnl -- Check for getopt AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG") ################################################################################ -dnl Check for readline (Shamelessly copied from parted 1.4.17) +dnl -- Check for readline (Shamelessly copied from parted 1.4.17) if test x$READLINE = xyes; then AC_CHECK_LIB(readline, readline, , AC_MSG_ERROR( @@ -405,8 +420,8 @@ package as well (which may be called readline-devel or something similar). fi ################################################################################ +dnl -- Internationalisation stuff echo $ac_n "checking whether to enable internationalisation""... $ac_c" 1>&6 -dnl Internationalisation stuff AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],\ INTL=yes, INTL=no) echo "$ac_t""$INTL" 1>&6 @@ -456,6 +471,7 @@ AC_SUBST(MIRRORS) AC_SUBST(OWNER) AC_SUBST(GROUP) AC_SUBST(CFLAGS) +AC_SUBST(COPTIMISE_FLAG) AC_SUBST(CLDFLAGS) AC_SUBST(CLDWHOLEARCHIVE) AC_SUBST(CLDNOWHOLEARCHIVE) @@ -481,8 +497,8 @@ AC_SUBST(CLUSTER) AC_SUBST(FSADM) ################################################################################ -dnl First and last lines should not contain files to generate in order to -dnl keep utility scripts running properly +dnl -- First and last lines should not contain files to generate in order to +dnl -- keep utility scripts running properly AC_OUTPUT( \ Makefile \ make.tmpl \ diff --git a/make.tmpl.in b/make.tmpl.in index 1732cc50f..1615c02e8 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -61,11 +61,11 @@ CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-pr #CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wmissing-noreturn +CFLAGS += @COPTIMISE_FLAG@ + ifeq ("@DEBUG@", "yes") CFLAGS += -g -fno-omit-frame-pointer -DDEBUG CFLAGS += -DDEBUG_MEM -else - CFLAGS += -O2 endif ifeq ("@INTL@", "yes")