Browse code

configure: yet another Solaris 9 fix

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@691 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/07/23 07:46:10
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Jul 23 00:40:18 CEST 2004 (tk)
2
+----------------------------------
3
+  * configure: yet another Solaris 9 fix
4
+
1 5
 Thu Jul 22 21:23:57 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * docs: update
... ...
@@ -46,7 +46,7 @@ while test $# -gt 0; do
46 46
 	;;
47 47
 
48 48
     --version)
49
-	echo devel-20040721
49
+	echo devel-20040723
50 50
 	exit 0
51 51
 	;;
52 52
 
... ...
@@ -10877,6 +10877,141 @@ fi
10877 10877
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10878 10878
 fi
10879 10879
 
10880
+echo "$as_me:$LINENO: checking for bind in -lsocket" >&5
10881
+echo $ECHO_N "checking for bind in -lsocket... $ECHO_C" >&6
10882
+if test "${ac_cv_lib_socket_bind+set}" = set; then
10883
+  echo $ECHO_N "(cached) $ECHO_C" >&6
10884
+else
10885
+  ac_check_lib_save_LIBS=$LIBS
10886
+LIBS="-lsocket  $LIBS"
10887
+cat >conftest.$ac_ext <<_ACEOF
10888
+/* confdefs.h.  */
10889
+_ACEOF
10890
+cat confdefs.h >>conftest.$ac_ext
10891
+cat >>conftest.$ac_ext <<_ACEOF
10892
+/* end confdefs.h.  */
10893
+
10894
+/* Override any gcc2 internal prototype to avoid an error.  */
10895
+#ifdef __cplusplus
10896
+extern "C"
10897
+#endif
10898
+/* We use char because int might match the return type of a gcc2
10899
+   builtin and then its argument prototype would still apply.  */
10900
+char bind ();
10901
+int
10902
+main ()
10903
+{
10904
+bind ();
10905
+  ;
10906
+  return 0;
10907
+}
10908
+_ACEOF
10909
+rm -f conftest.$ac_objext conftest$ac_exeext
10910
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10911
+  (eval $ac_link) 2>conftest.er1
10912
+  ac_status=$?
10913
+  grep -v '^ *+' conftest.er1 >conftest.err
10914
+  rm -f conftest.er1
10915
+  cat conftest.err >&5
10916
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10917
+  (exit $ac_status); } &&
10918
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
10919
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10920
+  (eval $ac_try) 2>&5
10921
+  ac_status=$?
10922
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10923
+  (exit $ac_status); }; } &&
10924
+	 { ac_try='test -s conftest$ac_exeext'
10925
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10926
+  (eval $ac_try) 2>&5
10927
+  ac_status=$?
10928
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10929
+  (exit $ac_status); }; }; then
10930
+  ac_cv_lib_socket_bind=yes
10931
+else
10932
+  echo "$as_me: failed program was:" >&5
10933
+sed 's/^/| /' conftest.$ac_ext >&5
10934
+
10935
+ac_cv_lib_socket_bind=no
10936
+fi
10937
+rm -f conftest.err conftest.$ac_objext \
10938
+      conftest$ac_exeext conftest.$ac_ext
10939
+LIBS=$ac_check_lib_save_LIBS
10940
+fi
10941
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_bind" >&5
10942
+echo "${ECHO_T}$ac_cv_lib_socket_bind" >&6
10943
+if test $ac_cv_lib_socket_bind = yes; then
10944
+  LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; LDFLAGS="$LDFLAGS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"
10945
+fi
10946
+
10947
+echo "$as_me:$LINENO: checking for gethostent in -lnsl" >&5
10948
+echo $ECHO_N "checking for gethostent in -lnsl... $ECHO_C" >&6
10949
+if test "${ac_cv_lib_nsl_gethostent+set}" = set; then
10950
+  echo $ECHO_N "(cached) $ECHO_C" >&6
10951
+else
10952
+  ac_check_lib_save_LIBS=$LIBS
10953
+LIBS="-lnsl  $LIBS"
10954
+cat >conftest.$ac_ext <<_ACEOF
10955
+/* confdefs.h.  */
10956
+_ACEOF
10957
+cat confdefs.h >>conftest.$ac_ext
10958
+cat >>conftest.$ac_ext <<_ACEOF
10959
+/* end confdefs.h.  */
10960
+
10961
+/* Override any gcc2 internal prototype to avoid an error.  */
10962
+#ifdef __cplusplus
10963
+extern "C"
10964
+#endif
10965
+/* We use char because int might match the return type of a gcc2
10966
+   builtin and then its argument prototype would still apply.  */
10967
+char gethostent ();
10968
+int
10969
+main ()
10970
+{
10971
+gethostent ();
10972
+  ;
10973
+  return 0;
10974
+}
10975
+_ACEOF
10976
+rm -f conftest.$ac_objext conftest$ac_exeext
10977
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10978
+  (eval $ac_link) 2>conftest.er1
10979
+  ac_status=$?
10980
+  grep -v '^ *+' conftest.er1 >conftest.err
10981
+  rm -f conftest.er1
10982
+  cat conftest.err >&5
10983
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10984
+  (exit $ac_status); } &&
10985
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
10986
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10987
+  (eval $ac_try) 2>&5
10988
+  ac_status=$?
10989
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10990
+  (exit $ac_status); }; } &&
10991
+	 { ac_try='test -s conftest$ac_exeext'
10992
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10993
+  (eval $ac_try) 2>&5
10994
+  ac_status=$?
10995
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10996
+  (exit $ac_status); }; }; then
10997
+  ac_cv_lib_nsl_gethostent=yes
10998
+else
10999
+  echo "$as_me: failed program was:" >&5
11000
+sed 's/^/| /' conftest.$ac_ext >&5
11001
+
11002
+ac_cv_lib_nsl_gethostent=no
11003
+fi
11004
+rm -f conftest.err conftest.$ac_objext \
11005
+      conftest$ac_exeext conftest.$ac_ext
11006
+LIBS=$ac_check_lib_save_LIBS
11007
+fi
11008
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostent" >&5
11009
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostent" >&6
11010
+if test $ac_cv_lib_nsl_gethostent = yes; then
11011
+  LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; LDFLAGS="$LDFLAGS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl"
11012
+fi
11013
+
11014
+
10880 11015
 case "$target_os" in
10881 11016
 linux*)
10882 11017
 
... ...
@@ -10897,7 +11032,7 @@ cat >>confdefs.h <<\_ACEOF
10897 10897
 #define _REENTRANT 1
10898 10898
 _ACEOF
10899 10899
 
10900
-	CLAMD_LIBS="-lpthread"
10900
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
10901 10901
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
10902 10902
 	if test "$want_clamuko" = "yes"; then
10903 10903
 
... ...
@@ -10906,7 +11041,7 @@ cat >>confdefs.h <<\_ACEOF
10906 10906
 _ACEOF
10907 10907
 
10908 10908
 	fi
10909
-	CLAMSCAN_LIBS="-lpthread"
10909
+	CLAMSCAN_LIBS="$CLAMSCAN_LIBS -lpthread"
10910 10910
     fi
10911 10911
     ;;
10912 10912
 cygwin*)
... ...
@@ -10936,11 +11071,11 @@ _ACEOF
10936 10936
     fi
10937 10937
     ;;
10938 10938
 solaris*)
10939
-    FRESHCLAM_LIBS="-lsocket -lnsl -lresolv"
10939
+    FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv"
10940 10940
     if test "$have_pthreads" = "yes"; then
10941 10941
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
10942
-	CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv"
10943
-	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lsocket -lnsl -lresolv"
10942
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread -lresolv"
10943
+	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lresolv"
10944 10944
 	TH_SAFE="-thread-safe"
10945 10945
 
10946 10946
 cat >>confdefs.h <<\_ACEOF
... ...
@@ -10962,7 +11097,7 @@ _ACEOF
10962 10962
 freebsd*)
10963 10963
     if test "$have_pthreads" = "yes"; then
10964 10964
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r"
10965
-	CLAMD_LIBS="-pthread -lc_r"
10965
+	CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
10966 10966
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
10967 10967
 	TH_SAFE="-thread-safe"
10968 10968
 
... ...
@@ -10993,7 +11128,7 @@ openbsd3.3*)
10993 10993
     if test "$have_pthreads" = "yes"; then
10994 10994
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
10995 10995
 	if test "$disable_cr" = "yes"; then
10996
-	    CLAMD_LIBS="-pthread"
10996
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
10997 10997
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
10998 10998
 	fi
10999 10999
 	TH_SAFE="-thread-safe"
... ...
@@ -11018,10 +11153,10 @@ openbsd*)
11018 11018
     if test "$have_pthreads" = "yes"; then
11019 11019
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
11020 11020
 	if test "$disable_cr" = "yes"; then
11021
-	    CLAMD_LIBS="-pthread"
11021
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
11022 11022
 	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
11023 11023
 	else
11024
-	    CLAMD_LIBS="-pthread -lc_r"
11024
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
11025 11025
 	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
11026 11026
 	fi
11027 11027
 	TH_SAFE="-thread-safe"
... ...
@@ -11099,14 +11234,11 @@ _ACEOF
11099 11099
     use_netinfo="yes"
11100 11100
     ;;
11101 11101
 sco*)
11102
-        FRESHCLAM_LIBS="-lsocket"
11103
-    CLAMD_LIBS="-lsocket"
11104
-    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"
11105
-    ;;
11102
+                    ;;
11106 11103
 hpux*)
11107 11104
     if test "$have_pthreads" = "yes"; then
11108 11105
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
11109
-	CLAMD_LIBS="-lpthread"
11106
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
11110 11107
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
11111 11108
 	TH_SAFE="-thread-safe"
11112 11109
 
... ...
@@ -11129,7 +11261,7 @@ _ACEOF
11129 11129
 aix*)
11130 11130
     if test "$have_pthreads" = "yes"; then
11131 11131
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
11132
-	CLAMD_LIBS="-lpthread"
11132
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
11133 11133
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
11134 11134
 	TH_SAFE="-thread-safe"
11135 11135
 
... ...
@@ -11152,7 +11284,7 @@ _ACEOF
11152 11152
 irix*)
11153 11153
     if test "$have_pthreads" = "yes"; then
11154 11154
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
11155
-	CLAMD_LIBS="-lpthread"
11155
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
11156 11156
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
11157 11157
 	TH_SAFE="-thread-safe"
11158 11158
 
... ...
@@ -203,6 +203,9 @@ AC_TRY_RUN([
203 203
 int main(int argc, char **argv) { in_port_t pt; pt = 0; return pt; }
204 204
 ], AC_DEFINE(HAVE_IN_PORT_T,1,[in_port_t is defined]), AC_MSG_RESULT(in_port_t is not defined))
205 205
 
206
+AC_CHECK_LIB(socket, bind, [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; LDFLAGS="$LDFLAGS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
207
+AC_CHECK_LIB(nsl, gethostent, [LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; LDFLAGS="$LDFLAGS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl"])
208
+
206 209
 case "$target_os" in
207 210
 linux*)
208 211
     AC_DEFINE(C_LINUX,1,[target is linux])
... ...
@@ -211,12 +214,12 @@ linux*)
211 211
 	TH_SAFE="-thread-safe"
212 212
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
213 213
 	AC_DEFINE(_REENTRANT,1,[thread safe])
214
-	CLAMD_LIBS="-lpthread"
214
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
215 215
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
216 216
 	if test "$want_clamuko" = "yes"; then
217 217
 	    AC_DEFINE(CLAMUKO,1,[enable clamuko])
218 218
 	fi
219
-	CLAMSCAN_LIBS="-lpthread"
219
+	CLAMSCAN_LIBS="$CLAMSCAN_LIBS -lpthread"
220 220
     fi
221 221
     ;;
222 222
 cygwin*)
... ...
@@ -234,11 +237,11 @@ cygwin*)
234 234
     fi
235 235
     ;;
236 236
 solaris*)
237
-    FRESHCLAM_LIBS="-lsocket -lnsl -lresolv"
237
+    FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv"
238 238
     if test "$have_pthreads" = "yes"; then
239 239
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
240
-	CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv"
241
-	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lsocket -lnsl -lresolv"
240
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread -lresolv"
241
+	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lresolv"
242 242
 	TH_SAFE="-thread-safe"
243 243
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
244 244
 	AC_DEFINE(_REENTRANT,1,[thread safe])
... ...
@@ -248,7 +251,7 @@ solaris*)
248 248
 freebsd*)
249 249
     if test "$have_pthreads" = "yes"; then
250 250
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r"
251
-	CLAMD_LIBS="-pthread -lc_r"
251
+	CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
252 252
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
253 253
 	TH_SAFE="-thread-safe"
254 254
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
... ...
@@ -263,7 +266,7 @@ openbsd3.3*)
263 263
     if test "$have_pthreads" = "yes"; then
264 264
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
265 265
 	if test "$disable_cr" = "yes"; then
266
-	    CLAMD_LIBS="-pthread"
266
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
267 267
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
268 268
 	fi
269 269
 	TH_SAFE="-thread-safe"
... ...
@@ -276,10 +279,10 @@ openbsd*)
276 276
     if test "$have_pthreads" = "yes"; then
277 277
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
278 278
 	if test "$disable_cr" = "yes"; then
279
-	    CLAMD_LIBS="-pthread"
279
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
280 280
 	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
281 281
 	else
282
-	    CLAMD_LIBS="-pthread -lc_r"
282
+	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
283 283
 	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
284 284
 	fi
285 285
 	TH_SAFE="-thread-safe"
... ...
@@ -316,14 +319,14 @@ darwin*)
316 316
     ;;
317 317
 sco*)
318 318
     dnl njh@bandsman.sco.uk: SCO Unix port
319
-    FRESHCLAM_LIBS="-lsocket"
320
-    CLAMD_LIBS="-lsocket"
321
-    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"
319
+    dnl FRESHCLAM_LIBS="-lsocket"
320
+    dnl CLAMD_LIBS="-lsocket"
321
+    dnl CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"
322 322
     ;;
323 323
 hpux*)
324 324
     if test "$have_pthreads" = "yes"; then
325 325
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
326
-	CLAMD_LIBS="-lpthread"
326
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
327 327
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
328 328
 	TH_SAFE="-thread-safe"
329 329
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
... ...
@@ -334,7 +337,7 @@ hpux*)
334 334
 aix*)
335 335
     if test "$have_pthreads" = "yes"; then
336 336
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
337
-	CLAMD_LIBS="-lpthread"
337
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
338 338
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
339 339
 	TH_SAFE="-thread-safe"
340 340
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
... ...
@@ -345,7 +348,7 @@ aix*)
345 345
 irix*)
346 346
     if test "$have_pthreads" = "yes"; then
347 347
 	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
348
-	CLAMD_LIBS="-lpthread"
348
+	CLAMD_LIBS="$CLAMD_LIBS -lpthread"
349 349
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
350 350
 	TH_SAFE="-thread-safe"
351 351
 	AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])