@@ -5038,87 +5038,32 @@ _ACEOF
5038
5038
##
5039
5039
## Libraries
5040
5040
##
5041
+ ## Most libraries are included only if they demonstrably provide a function
5042
+ ## we need, but libm is an exception: always include it, because there are
5043
+ ## too many compilers that play cute optimization games that will break
5044
+ ## probes for standard functions such as pow().
5045
+ ##
5041
5046
5042
- echo "$as_me:$LINENO: checking for library containing setproctitle" >&5
5043
- echo $ECHO_N "checking for library containing setproctitle... $ECHO_C" >&6
5044
- if test "${ac_cv_search_setproctitle+set}" = set; then
5047
+
5048
+ echo "$as_me:$LINENO: checking for main in -lm" >&5
5049
+ echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
5050
+ if test "${ac_cv_lib_m_main+set}" = set; then
5045
5051
echo $ECHO_N "(cached) $ECHO_C" >&6
5046
5052
else
5047
- ac_func_search_save_LIBS =$LIBS
5048
- ac_cv_search_setproctitle=no
5053
+ ac_check_lib_save_LIBS =$LIBS
5054
+ LIBS="-lm $LIBS"
5049
5055
cat >conftest.$ac_ext <<_ACEOF
5050
5056
/* confdefs.h. */
5051
5057
_ACEOF
5052
5058
cat confdefs.h >>conftest.$ac_ext
5053
5059
cat >>conftest.$ac_ext <<_ACEOF
5054
5060
/* end confdefs.h. */
5055
5061
5056
- /* Override any gcc2 internal prototype to avoid an error. */
5057
- #ifdef __cplusplus
5058
- extern "C"
5059
- #endif
5060
- /* We use char because int might match the return type of a gcc2
5061
- builtin and then its argument prototype would still apply. */
5062
- char setproctitle ();
5063
- int
5064
- main ()
5065
- {
5066
- setproctitle ();
5067
- ;
5068
- return 0;
5069
- }
5070
- _ACEOF
5071
- rm -f conftest.$ac_objext conftest$ac_exeext
5072
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5073
- (eval $ac_link) 2>conftest.er1
5074
- ac_status=$?
5075
- grep -v '^ *+' conftest.er1 >conftest.err
5076
- rm -f conftest.er1
5077
- cat conftest.err >&5
5078
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
5079
- (exit $ac_status); } &&
5080
- { ac_try='test -z "$ac_c_werror_flag"
5081
- || test ! -s conftest.err'
5082
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5083
- (eval $ac_try) 2>&5
5084
- ac_status=$?
5085
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
5086
- (exit $ac_status); }; } &&
5087
- { ac_try='test -s conftest$ac_exeext'
5088
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5089
- (eval $ac_try) 2>&5
5090
- ac_status=$?
5091
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
5092
- (exit $ac_status); }; }; then
5093
- ac_cv_search_setproctitle="none required"
5094
- else
5095
- echo "$as_me: failed program was:" >&5
5096
- sed 's/^/| /' conftest.$ac_ext >&5
5097
5062
5098
- fi
5099
- rm -f conftest.err conftest.$ac_objext \
5100
- conftest$ac_exeext conftest.$ac_ext
5101
- if test "$ac_cv_search_setproctitle" = no; then
5102
- for ac_lib in util; do
5103
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5104
- cat >conftest.$ac_ext <<_ACEOF
5105
- /* confdefs.h. */
5106
- _ACEOF
5107
- cat confdefs.h >>conftest.$ac_ext
5108
- cat >>conftest.$ac_ext <<_ACEOF
5109
- /* end confdefs.h. */
5110
-
5111
- /* Override any gcc2 internal prototype to avoid an error. */
5112
- #ifdef __cplusplus
5113
- extern "C"
5114
- #endif
5115
- /* We use char because int might match the return type of a gcc2
5116
- builtin and then its argument prototype would still apply. */
5117
- char setproctitle ();
5118
5063
int
5119
5064
main ()
5120
5065
{
5121
- setproctitle ();
5066
+ main ();
5122
5067
;
5123
5068
return 0;
5124
5069
}
@@ -5145,33 +5090,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5145
5090
ac_status=$?
5146
5091
echo "$as_me:$LINENO: \$? = $ac_status" >&5
5147
5092
(exit $ac_status); }; }; then
5148
- ac_cv_search_setproctitle="-l$ac_lib"
5149
- break
5093
+ ac_cv_lib_m_main=yes
5150
5094
else
5151
5095
echo "$as_me: failed program was:" >&5
5152
5096
sed 's/^/| /' conftest.$ac_ext >&5
5153
5097
5098
+ ac_cv_lib_m_main=no
5154
5099
fi
5155
5100
rm -f conftest.err conftest.$ac_objext \
5156
5101
conftest$ac_exeext conftest.$ac_ext
5157
- done
5158
- fi
5159
- LIBS=$ac_func_search_save_LIBS
5102
+ LIBS=$ac_check_lib_save_LIBS
5160
5103
fi
5161
- echo "$as_me:$LINENO: result: $ac_cv_search_setproctitle" >&5
5162
- echo "${ECHO_T}$ac_cv_search_setproctitle" >&6
5163
- if test "$ac_cv_search_setproctitle" != no; then
5164
- test "$ac_cv_search_setproctitle" = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS"
5104
+ echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
5105
+ echo "${ECHO_T}$ac_cv_lib_m_main" >&6
5106
+ if test $ac_cv_lib_m_main = yes; then
5107
+ cat >>confdefs.h <<_ACEOF
5108
+ #define HAVE_LIBM 1
5109
+ _ACEOF
5110
+
5111
+ LIBS="-lm $LIBS"
5165
5112
5166
5113
fi
5167
5114
5168
- echo "$as_me:$LINENO: checking for library containing pow " >&5
5169
- echo $ECHO_N "checking for library containing pow ... $ECHO_C" >&6
5170
- if test "${ac_cv_search_pow +set}" = set; then
5115
+ echo "$as_me:$LINENO: checking for library containing setproctitle " >&5
5116
+ echo $ECHO_N "checking for library containing setproctitle ... $ECHO_C" >&6
5117
+ if test "${ac_cv_search_setproctitle +set}" = set; then
5171
5118
echo $ECHO_N "(cached) $ECHO_C" >&6
5172
5119
else
5173
5120
ac_func_search_save_LIBS=$LIBS
5174
- ac_cv_search_pow =no
5121
+ ac_cv_search_setproctitle =no
5175
5122
cat >conftest.$ac_ext <<_ACEOF
5176
5123
/* confdefs.h. */
5177
5124
_ACEOF
@@ -5185,11 +5132,11 @@ extern "C"
5185
5132
#endif
5186
5133
/* We use char because int might match the return type of a gcc2
5187
5134
builtin and then its argument prototype would still apply. */
5188
- char pow ();
5135
+ char setproctitle ();
5189
5136
int
5190
5137
main ()
5191
5138
{
5192
- pow ();
5139
+ setproctitle ();
5193
5140
;
5194
5141
return 0;
5195
5142
}
@@ -5216,16 +5163,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5216
5163
ac_status=$?
5217
5164
echo "$as_me:$LINENO: \$? = $ac_status" >&5
5218
5165
(exit $ac_status); }; }; then
5219
- ac_cv_search_pow ="none required"
5166
+ ac_cv_search_setproctitle ="none required"
5220
5167
else
5221
5168
echo "$as_me: failed program was:" >&5
5222
5169
sed 's/^/| /' conftest.$ac_ext >&5
5223
5170
5224
5171
fi
5225
5172
rm -f conftest.err conftest.$ac_objext \
5226
5173
conftest$ac_exeext conftest.$ac_ext
5227
- if test "$ac_cv_search_pow " = no; then
5228
- for ac_lib in m ; do
5174
+ if test "$ac_cv_search_setproctitle " = no; then
5175
+ for ac_lib in util ; do
5229
5176
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5230
5177
cat >conftest.$ac_ext <<_ACEOF
5231
5178
/* confdefs.h. */
@@ -5240,11 +5187,11 @@ extern "C"
5240
5187
#endif
5241
5188
/* We use char because int might match the return type of a gcc2
5242
5189
builtin and then its argument prototype would still apply. */
5243
- char pow ();
5190
+ char setproctitle ();
5244
5191
int
5245
5192
main ()
5246
5193
{
5247
- pow ();
5194
+ setproctitle ();
5248
5195
;
5249
5196
return 0;
5250
5197
}
@@ -5271,7 +5218,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5271
5218
ac_status=$?
5272
5219
echo "$as_me:$LINENO: \$? = $ac_status" >&5
5273
5220
(exit $ac_status); }; }; then
5274
- ac_cv_search_pow ="-l$ac_lib"
5221
+ ac_cv_search_setproctitle ="-l$ac_lib"
5275
5222
break
5276
5223
else
5277
5224
echo "$as_me: failed program was:" >&5
@@ -5284,10 +5231,10 @@ rm -f conftest.err conftest.$ac_objext \
5284
5231
fi
5285
5232
LIBS=$ac_func_search_save_LIBS
5286
5233
fi
5287
- echo "$as_me:$LINENO: result: $ac_cv_search_pow " >&5
5288
- echo "${ECHO_T}$ac_cv_search_pow " >&6
5289
- if test "$ac_cv_search_pow " != no; then
5290
- test "$ac_cv_search_pow " = "none required" || LIBS="$ac_cv_search_pow $LIBS"
5234
+ echo "$as_me:$LINENO: result: $ac_cv_search_setproctitle " >&5
5235
+ echo "${ECHO_T}$ac_cv_search_setproctitle " >&6
5236
+ if test "$ac_cv_search_setproctitle " != no; then
5237
+ test "$ac_cv_search_setproctitle " = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS"
5291
5238
5292
5239
fi
5293
5240
0 commit comments