diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 131 |
1 files changed, 39 insertions, 92 deletions
diff --git a/configure b/configure index f09500f6199..2c113768979 100755 --- a/configure +++ b/configure @@ -5038,14 +5038,20 @@ _ACEOF ## ## Libraries ## +## Most libraries are included only if they demonstrably provide a function +## we need, but libm is an exception: always include it, because there are +## too many compilers that play cute optimization games that will break +## probes for standard functions such as pow(). +## -echo "$as_me:$LINENO: checking for library containing setproctitle" >&5 -echo $ECHO_N "checking for library containing setproctitle... $ECHO_C" >&6 -if test "${ac_cv_search_setproctitle+set}" = set; then + +echo "$as_me:$LINENO: checking for main in -lm" >&5 +echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_setproctitle=no + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5053,72 +5059,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setproctitle (); -int -main () -{ -setproctitle (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_setproctitle="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_setproctitle" = no; then - for ac_lib in util; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setproctitle (); int main () { -setproctitle (); +main (); ; return 0; } @@ -5145,33 +5090,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_setproctitle="-l$ac_lib" -break + ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_m_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_setproctitle" >&5 -echo "${ECHO_T}$ac_cv_search_setproctitle" >&6 -if test "$ac_cv_search_setproctitle" != no; then - test "$ac_cv_search_setproctitle" = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +echo "${ECHO_T}$ac_cv_lib_m_main" >&6 +if test $ac_cv_lib_m_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" fi -echo "$as_me:$LINENO: checking for library containing pow" >&5 -echo $ECHO_N "checking for library containing pow... $ECHO_C" >&6 -if test "${ac_cv_search_pow+set}" = set; then +echo "$as_me:$LINENO: checking for library containing setproctitle" >&5 +echo $ECHO_N "checking for library containing setproctitle... $ECHO_C" >&6 +if test "${ac_cv_search_setproctitle+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_pow=no +ac_cv_search_setproctitle=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5185,11 +5132,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char pow (); +char setproctitle (); int main () { -pow (); +setproctitle (); ; return 0; } @@ -5216,7 +5163,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_pow="none required" + ac_cv_search_setproctitle="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -5224,8 +5171,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_pow" = no; then - for ac_lib in m; do +if test "$ac_cv_search_setproctitle" = no; then + for ac_lib in util; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5240,11 +5187,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char pow (); +char setproctitle (); int main () { -pow (); +setproctitle (); ; return 0; } @@ -5271,7 +5218,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_pow="-l$ac_lib" + ac_cv_search_setproctitle="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 @@ -5284,10 +5231,10 @@ rm -f conftest.err conftest.$ac_objext \ fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5 -echo "${ECHO_T}$ac_cv_search_pow" >&6 -if test "$ac_cv_search_pow" != no; then - test "$ac_cv_search_pow" = "none required" || LIBS="$ac_cv_search_pow $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_setproctitle" >&5 +echo "${ECHO_T}$ac_cv_search_setproctitle" >&6 +if test "$ac_cv_search_setproctitle" != no; then + test "$ac_cv_search_setproctitle" = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS" fi |