Browse code

configure: improve gethostbyname_r check; cleanups

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

Tomasz Kojm authored on 2004/07/29 09:50:07
Showing 5 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Jul 29 02:43:13 CEST 2004 (tk)
2
+----------------------------------
3
+  * configure: improve gethostbyname_r check; cleanups
4
+
1 5
 Wed Jul 28 22:21:10 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * clamdscan: fix stdin scanning in local mode (patch by Stephen Gran
... ...
@@ -46,7 +46,7 @@ while test $# -gt 0; do
46 46
 	;;
47 47
 
48 48
     --version)
49
-	echo devel-20040723
49
+	echo devel-20040729
50 50
 	exit 0
51 51
 	;;
52 52
 
... ...
@@ -84,8 +84,14 @@
84 84
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
85 85
 #undef HAVE_FSEEKO
86 86
 
87
-/* Define to 1 if you have the `gethostbyname_r' function. */
88
-#undef HAVE_GETHOSTBYNAME_R
87
+/* gethostbyname_r takes 3 arguments */
88
+#undef HAVE_GETHOSTBYNAME_R_3
89
+
90
+/* gethostbyname_r takes 5 arguments */
91
+#undef HAVE_GETHOSTBYNAME_R_5
92
+
93
+/* gethostbyname_r takes 6 arguments */
94
+#undef HAVE_GETHOSTBYNAME_R_6
89 95
 
90 96
 /* Define to 1 if you have the `getpagesize' function. */
91 97
 #undef HAVE_GETPAGESIZE
... ...
@@ -8974,8 +8974,7 @@ _ACEOF
8974 8974
 
8975 8975
 
8976 8976
 
8977
-
8978
-for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups gethostbyname_r
8977
+for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups
8979 8978
 do
8980 8979
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8981 8980
 echo "$as_me:$LINENO: checking for $ac_func" >&5
... ...
@@ -9674,7 +9673,6 @@ _ACEOF
9674 9674
 fi
9675 9675
 
9676 9676
 
9677
-# Check for broken snprintf
9678 9677
 if test "x$ac_cv_func_snprintf" = "xyes" ; then
9679 9678
         echo "$as_me:$LINENO: checking whether snprintf correctly terminates long strings" >&5
9680 9679
 echo $ECHO_N "checking whether snprintf correctly terminates long strings... $ECHO_C" >&6
... ...
@@ -10018,7 +10016,9 @@ cat >>confdefs.h <<\_ACEOF
10018 10018
 _ACEOF
10019 10019
 
10020 10020
 else
10021
-  echo "Please install zlib and zlib-devel packages."; exit 1
10021
+  { { echo "$as_me:$LINENO: error: Please install zlib and zlib-devel packages" >&5
10022
+echo "$as_me: error: Please install zlib and zlib-devel packages" >&2;}
10023
+   { (exit 1); exit 1; }; }
10022 10024
 fi
10023 10025
 
10024 10026
 
... ...
@@ -10032,6 +10032,77 @@ fi;
10032 10032
 
10033 10033
 if test "$want_bzip2" = "yes"
10034 10034
 then
10035
+    echo "$as_me:$LINENO: checking for bzReadOpen in -lbz2" >&5
10036
+echo $ECHO_N "checking for bzReadOpen in -lbz2... $ECHO_C" >&6
10037
+if test "${ac_cv_lib_bz2_bzReadOpen+set}" = set; then
10038
+  echo $ECHO_N "(cached) $ECHO_C" >&6
10039
+else
10040
+  ac_check_lib_save_LIBS=$LIBS
10041
+LIBS="-lbz2  $LIBS"
10042
+cat >conftest.$ac_ext <<_ACEOF
10043
+/* confdefs.h.  */
10044
+_ACEOF
10045
+cat confdefs.h >>conftest.$ac_ext
10046
+cat >>conftest.$ac_ext <<_ACEOF
10047
+/* end confdefs.h.  */
10048
+
10049
+/* Override any gcc2 internal prototype to avoid an error.  */
10050
+#ifdef __cplusplus
10051
+extern "C"
10052
+#endif
10053
+/* We use char because int might match the return type of a gcc2
10054
+   builtin and then its argument prototype would still apply.  */
10055
+char bzReadOpen ();
10056
+int
10057
+main ()
10058
+{
10059
+bzReadOpen ();
10060
+  ;
10061
+  return 0;
10062
+}
10063
+_ACEOF
10064
+rm -f conftest.$ac_objext conftest$ac_exeext
10065
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10066
+  (eval $ac_link) 2>conftest.er1
10067
+  ac_status=$?
10068
+  grep -v '^ *+' conftest.er1 >conftest.err
10069
+  rm -f conftest.er1
10070
+  cat conftest.err >&5
10071
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10072
+  (exit $ac_status); } &&
10073
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
10074
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10075
+  (eval $ac_try) 2>&5
10076
+  ac_status=$?
10077
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10078
+  (exit $ac_status); }; } &&
10079
+	 { ac_try='test -s conftest$ac_exeext'
10080
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10081
+  (eval $ac_try) 2>&5
10082
+  ac_status=$?
10083
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10084
+  (exit $ac_status); }; }; then
10085
+  ac_cv_lib_bz2_bzReadOpen=yes
10086
+else
10087
+  echo "$as_me: failed program was:" >&5
10088
+sed 's/^/| /' conftest.$ac_ext >&5
10089
+
10090
+ac_cv_lib_bz2_bzReadOpen=no
10091
+fi
10092
+rm -f conftest.err conftest.$ac_objext \
10093
+      conftest$ac_exeext conftest.$ac_ext
10094
+LIBS=$ac_check_lib_save_LIBS
10095
+fi
10096
+echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_bzReadOpen" >&5
10097
+echo "${ECHO_T}$ac_cv_lib_bz2_bzReadOpen" >&6
10098
+if test $ac_cv_lib_bz2_bzReadOpen = yes; then
10099
+
10100
+cat >>confdefs.h <<\_ACEOF
10101
+#define NOBZ2PREFIX 1
10102
+_ACEOF
10103
+
10104
+fi
10105
+
10035 10106
     if test "${ac_cv_header_bzlib_h+set}" = set; then
10036 10107
   echo "$as_me:$LINENO: checking for bzlib.h" >&5
10037 10108
 echo $ECHO_N "checking for bzlib.h... $ECHO_C" >&6
... ...
@@ -10175,81 +10246,11 @@ cat >>confdefs.h <<\_ACEOF
10175 10175
 _ACEOF
10176 10176
 
10177 10177
 else
10178
-  echo "WARNING: Bzip2 support disabled"
10178
+  { echo "$as_me:$LINENO: WARNING: ****** bzip2 support disabled" >&5
10179
+echo "$as_me: WARNING: ****** bzip2 support disabled" >&2;}
10179 10180
 fi
10180 10181
 
10181 10182
 
10182
-    echo "$as_me:$LINENO: checking for bzReadOpen in -lbz2" >&5
10183
-echo $ECHO_N "checking for bzReadOpen in -lbz2... $ECHO_C" >&6
10184
-if test "${ac_cv_lib_bz2_bzReadOpen+set}" = set; then
10185
-  echo $ECHO_N "(cached) $ECHO_C" >&6
10186
-else
10187
-  ac_check_lib_save_LIBS=$LIBS
10188
-LIBS="-lbz2  $LIBS"
10189
-cat >conftest.$ac_ext <<_ACEOF
10190
-/* confdefs.h.  */
10191
-_ACEOF
10192
-cat confdefs.h >>conftest.$ac_ext
10193
-cat >>conftest.$ac_ext <<_ACEOF
10194
-/* end confdefs.h.  */
10195
-
10196
-/* Override any gcc2 internal prototype to avoid an error.  */
10197
-#ifdef __cplusplus
10198
-extern "C"
10199
-#endif
10200
-/* We use char because int might match the return type of a gcc2
10201
-   builtin and then its argument prototype would still apply.  */
10202
-char bzReadOpen ();
10203
-int
10204
-main ()
10205
-{
10206
-bzReadOpen ();
10207
-  ;
10208
-  return 0;
10209
-}
10210
-_ACEOF
10211
-rm -f conftest.$ac_objext conftest$ac_exeext
10212
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10213
-  (eval $ac_link) 2>conftest.er1
10214
-  ac_status=$?
10215
-  grep -v '^ *+' conftest.er1 >conftest.err
10216
-  rm -f conftest.er1
10217
-  cat conftest.err >&5
10218
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10219
-  (exit $ac_status); } &&
10220
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
10221
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10222
-  (eval $ac_try) 2>&5
10223
-  ac_status=$?
10224
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10225
-  (exit $ac_status); }; } &&
10226
-	 { ac_try='test -s conftest$ac_exeext'
10227
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10228
-  (eval $ac_try) 2>&5
10229
-  ac_status=$?
10230
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10231
-  (exit $ac_status); }; }; then
10232
-  ac_cv_lib_bz2_bzReadOpen=yes
10233
-else
10234
-  echo "$as_me: failed program was:" >&5
10235
-sed 's/^/| /' conftest.$ac_ext >&5
10236
-
10237
-ac_cv_lib_bz2_bzReadOpen=no
10238
-fi
10239
-rm -f conftest.err conftest.$ac_objext \
10240
-      conftest$ac_exeext conftest.$ac_ext
10241
-LIBS=$ac_check_lib_save_LIBS
10242
-fi
10243
-echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_bzReadOpen" >&5
10244
-echo "${ECHO_T}$ac_cv_lib_bz2_bzReadOpen" >&6
10245
-if test $ac_cv_lib_bz2_bzReadOpen = yes; then
10246
-
10247
-cat >>confdefs.h <<\_ACEOF
10248
-#define NOBZ2PREFIX 1
10249
-_ACEOF
10250
-
10251
-fi
10252
-
10253 10183
 fi
10254 10184
 
10255 10185
 want_clamuko="yes"
... ...
@@ -10481,7 +10482,8 @@ cat >>confdefs.h <<\_ACEOF
10481 10481
 _ACEOF
10482 10482
 
10483 10483
 else
10484
-  echo "WARNING: GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !"; want_dsig="no"
10484
+  { echo "$as_me:$LINENO: WARNING: ****** GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !" >&5
10485
+echo "$as_me: WARNING: ****** GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !" >&2;}; want_dsig="no"
10485 10486
 fi
10486 10487
 
10487 10488
 fi
... ...
@@ -10786,7 +10788,6 @@ _ACEOF
10786 10786
 DBDIR="$db_dir"
10787 10787
 
10788 10788
 
10789
-# config file
10790 10789
 cfg_dir=`echo $sysconfdir | grep prefix`
10791 10790
 
10792 10791
 if test -n "$cfg_dir"; then
... ...
@@ -10829,7 +10830,6 @@ else
10829 10829
 fi
10830 10830
 
10831 10831
 
10832
-# check for in_port_t definition
10833 10832
 if test "$cross_compiling" = yes; then
10834 10833
   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
10835 10834
 See \`config.log' for more details." >&5
... ...
@@ -10877,141 +10877,6 @@ 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
-
11015 10880
 case "$target_os" in
11016 10881
 linux*)
11017 10882
 
... ...
@@ -11341,13 +11206,144 @@ esac
11341 11341
 
11342 11342
 
11343 11343
 
11344
-# --enable-milter
11344
+echo "$as_me:$LINENO: checking for bind in -lsocket" >&5
11345
+echo $ECHO_N "checking for bind in -lsocket... $ECHO_C" >&6
11346
+if test "${ac_cv_lib_socket_bind+set}" = set; then
11347
+  echo $ECHO_N "(cached) $ECHO_C" >&6
11348
+else
11349
+  ac_check_lib_save_LIBS=$LIBS
11350
+LIBS="-lsocket  $LIBS"
11351
+cat >conftest.$ac_ext <<_ACEOF
11352
+/* confdefs.h.  */
11353
+_ACEOF
11354
+cat confdefs.h >>conftest.$ac_ext
11355
+cat >>conftest.$ac_ext <<_ACEOF
11356
+/* end confdefs.h.  */
11357
+
11358
+/* Override any gcc2 internal prototype to avoid an error.  */
11359
+#ifdef __cplusplus
11360
+extern "C"
11361
+#endif
11362
+/* We use char because int might match the return type of a gcc2
11363
+   builtin and then its argument prototype would still apply.  */
11364
+char bind ();
11365
+int
11366
+main ()
11367
+{
11368
+bind ();
11369
+  ;
11370
+  return 0;
11371
+}
11372
+_ACEOF
11373
+rm -f conftest.$ac_objext conftest$ac_exeext
11374
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11375
+  (eval $ac_link) 2>conftest.er1
11376
+  ac_status=$?
11377
+  grep -v '^ *+' conftest.er1 >conftest.err
11378
+  rm -f conftest.er1
11379
+  cat conftest.err >&5
11380
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11381
+  (exit $ac_status); } &&
11382
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
11383
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11384
+  (eval $ac_try) 2>&5
11385
+  ac_status=$?
11386
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11387
+  (exit $ac_status); }; } &&
11388
+	 { ac_try='test -s conftest$ac_exeext'
11389
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11390
+  (eval $ac_try) 2>&5
11391
+  ac_status=$?
11392
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11393
+  (exit $ac_status); }; }; then
11394
+  ac_cv_lib_socket_bind=yes
11395
+else
11396
+  echo "$as_me: failed program was:" >&5
11397
+sed 's/^/| /' conftest.$ac_ext >&5
11398
+
11399
+ac_cv_lib_socket_bind=no
11400
+fi
11401
+rm -f conftest.err conftest.$ac_objext \
11402
+      conftest$ac_exeext conftest.$ac_ext
11403
+LIBS=$ac_check_lib_save_LIBS
11404
+fi
11405
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_bind" >&5
11406
+echo "${ECHO_T}$ac_cv_lib_socket_bind" >&6
11407
+if test $ac_cv_lib_socket_bind = yes; then
11408
+  LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; LDFLAGS="$LDFLAGS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"
11409
+fi
11410
+
11411
+echo "$as_me:$LINENO: checking for gethostent in -lnsl" >&5
11412
+echo $ECHO_N "checking for gethostent in -lnsl... $ECHO_C" >&6
11413
+if test "${ac_cv_lib_nsl_gethostent+set}" = set; then
11414
+  echo $ECHO_N "(cached) $ECHO_C" >&6
11415
+else
11416
+  ac_check_lib_save_LIBS=$LIBS
11417
+LIBS="-lnsl  $LIBS"
11418
+cat >conftest.$ac_ext <<_ACEOF
11419
+/* confdefs.h.  */
11420
+_ACEOF
11421
+cat confdefs.h >>conftest.$ac_ext
11422
+cat >>conftest.$ac_ext <<_ACEOF
11423
+/* end confdefs.h.  */
11424
+
11425
+/* Override any gcc2 internal prototype to avoid an error.  */
11426
+#ifdef __cplusplus
11427
+extern "C"
11428
+#endif
11429
+/* We use char because int might match the return type of a gcc2
11430
+   builtin and then its argument prototype would still apply.  */
11431
+char gethostent ();
11432
+int
11433
+main ()
11434
+{
11435
+gethostent ();
11436
+  ;
11437
+  return 0;
11438
+}
11439
+_ACEOF
11440
+rm -f conftest.$ac_objext conftest$ac_exeext
11441
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11442
+  (eval $ac_link) 2>conftest.er1
11443
+  ac_status=$?
11444
+  grep -v '^ *+' conftest.er1 >conftest.err
11445
+  rm -f conftest.er1
11446
+  cat conftest.err >&5
11447
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11448
+  (exit $ac_status); } &&
11449
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
11450
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11451
+  (eval $ac_try) 2>&5
11452
+  ac_status=$?
11453
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11454
+  (exit $ac_status); }; } &&
11455
+	 { ac_try='test -s conftest$ac_exeext'
11456
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11457
+  (eval $ac_try) 2>&5
11458
+  ac_status=$?
11459
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11460
+  (exit $ac_status); }; }; then
11461
+  ac_cv_lib_nsl_gethostent=yes
11462
+else
11463
+  echo "$as_me: failed program was:" >&5
11464
+sed 's/^/| /' conftest.$ac_ext >&5
11465
+
11466
+ac_cv_lib_nsl_gethostent=no
11467
+fi
11468
+rm -f conftest.err conftest.$ac_objext \
11469
+      conftest$ac_exeext conftest.$ac_ext
11470
+LIBS=$ac_check_lib_save_LIBS
11471
+fi
11472
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostent" >&5
11473
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostent" >&6
11474
+if test $ac_cv_lib_nsl_gethostent = yes; then
11475
+  LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; LDFLAGS="$LDFLAGS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl"
11476
+fi
11477
+
11478
+
11345 11479
 if test "$have_milter" = "yes"; then
11346
-    # libmilter checking code adapted from spamass-milter by
11347
-    # Tom G. Christensen <tgc@statsbiblioteket.dk>
11348 11480
 
11349
-    # Check for libmilter and it's header files in the usual locations
11350
-    save_LDFLAGS="$LDFLAGS"
11481
+        save_LDFLAGS="$LDFLAGS"
11351 11482
     if test -d /usr/lib/libmilter ; then
11352 11483
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter"
11353 11484
     fi
... ...
@@ -11419,8 +11415,7 @@ if test $ac_cv_lib_milter_mi_stop = yes; then
11419 11419
   CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS"
11420 11420
 else
11421 11421
 
11422
-	# Older sendmails require libsm or libsmutil for support functions
11423
-	echo "$as_me:$LINENO: checking for library containing strlcpy" >&5
11422
+		echo "$as_me:$LINENO: checking for library containing strlcpy" >&5
11424 11423
 echo $ECHO_N "checking for library containing strlcpy... $ECHO_C" >&6
11425 11424
 if test "${ac_cv_search_strlcpy+set}" = set; then
11426 11425
   echo $ECHO_N "(cached) $ECHO_C" >&6
... ...
@@ -11855,8 +11850,6 @@ fi
11855 11855
 
11856 11856
 fi
11857 11857
 
11858
-# tcpwrappers support
11859
-# rules from http://ma.ph-freiburg.de/tng/tng-technical/2002-01/msg00094.html
11860 11858
 
11861 11859
 # Check whether --with-tcpwrappers or --without-tcpwrappers was given.
11862 11860
 if test "${with_tcpwrappers+set}" = set; then
... ...
@@ -12162,21 +12155,214 @@ echo "$as_me: WARNING: could not find TCP wrappers, support disabled" >&2;}
12162 12162
         fi
12163 12163
 fi
12164 12164
 
12165
+echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
12166
+echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6
12167
+if test -z "$ac_cv_gethostbyname_args"; then
12168
+cat >conftest.$ac_ext <<_ACEOF
12169
+/* confdefs.h.  */
12170
+_ACEOF
12171
+cat confdefs.h >>conftest.$ac_ext
12172
+cat >>conftest.$ac_ext <<_ACEOF
12173
+/* end confdefs.h.  */
12174
+
12175
+#include <sys/types.h>
12176
+#include <netdb.h>
12177
+
12178
+int
12179
+main ()
12180
+{
12181
+
12182
+struct hostent *hp;
12183
+struct hostent h;
12184
+char *name;
12185
+char buffer[10];
12186
+int  h_errno;
12187
+hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);
12188
+
12189
+  ;
12190
+  return 0;
12191
+}
12192
+_ACEOF
12193
+rm -f conftest.$ac_objext
12194
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12195
+  (eval $ac_compile) 2>conftest.er1
12196
+  ac_status=$?
12197
+  grep -v '^ *+' conftest.er1 >conftest.err
12198
+  rm -f conftest.er1
12199
+  cat conftest.err >&5
12200
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12201
+  (exit $ac_status); } &&
12202
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
12203
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12204
+  (eval $ac_try) 2>&5
12205
+  ac_status=$?
12206
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12207
+  (exit $ac_status); }; } &&
12208
+	 { ac_try='test -s conftest.$ac_objext'
12209
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12210
+  (eval $ac_try) 2>&5
12211
+  ac_status=$?
12212
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12213
+  (exit $ac_status); }; }; then
12214
+  ac_cv_gethostbyname_args=5
12215
+else
12216
+  echo "$as_me: failed program was:" >&5
12217
+sed 's/^/| /' conftest.$ac_ext >&5
12218
+
12219
+fi
12220
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12221
+fi
12222
+if test -z "$ac_cv_gethostbyname_args"; then
12223
+cat >conftest.$ac_ext <<_ACEOF
12224
+/* confdefs.h.  */
12225
+_ACEOF
12226
+cat confdefs.h >>conftest.$ac_ext
12227
+cat >>conftest.$ac_ext <<_ACEOF
12228
+/* end confdefs.h.  */
12229
+
12230
+#include <sys/types.h>
12231
+#include <netdb.h>
12232
+
12233
+int
12234
+main ()
12235
+{
12236
+
12237
+struct hostent h;
12238
+struct hostent_data hdata;
12239
+char *name;
12240
+int  rc;
12241
+rc = gethostbyname_r(name, &h, &hdata);
12242
+
12243
+  ;
12244
+  return 0;
12245
+}
12246
+_ACEOF
12247
+rm -f conftest.$ac_objext
12248
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12249
+  (eval $ac_compile) 2>conftest.er1
12250
+  ac_status=$?
12251
+  grep -v '^ *+' conftest.er1 >conftest.err
12252
+  rm -f conftest.er1
12253
+  cat conftest.err >&5
12254
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12255
+  (exit $ac_status); } &&
12256
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
12257
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12258
+  (eval $ac_try) 2>&5
12259
+  ac_status=$?
12260
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12261
+  (exit $ac_status); }; } &&
12262
+	 { ac_try='test -s conftest.$ac_objext'
12263
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12264
+  (eval $ac_try) 2>&5
12265
+  ac_status=$?
12266
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12267
+  (exit $ac_status); }; }; then
12268
+  ac_cv_gethostbyname_args=3
12269
+else
12270
+  echo "$as_me: failed program was:" >&5
12271
+sed 's/^/| /' conftest.$ac_ext >&5
12272
+
12273
+fi
12274
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12275
+fi
12276
+if test -z "$ac_cv_gethostbyname_args"; then
12277
+cat >conftest.$ac_ext <<_ACEOF
12278
+/* confdefs.h.  */
12279
+_ACEOF
12280
+cat confdefs.h >>conftest.$ac_ext
12281
+cat >>conftest.$ac_ext <<_ACEOF
12282
+/* end confdefs.h.  */
12283
+
12284
+#include <sys/types.h>
12285
+#include <netdb.h>
12286
+
12287
+int
12288
+main ()
12289
+{
12290
+
12291
+struct hostent h;
12292
+struct hostent *hp;
12293
+char *name;
12294
+char buf[10];
12295
+int rc;
12296
+int h_errno;
12297
+
12298
+rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
12299
+
12300
+  ;
12301
+  return 0;
12302
+}
12303
+_ACEOF
12304
+rm -f conftest.$ac_objext
12305
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12306
+  (eval $ac_compile) 2>conftest.er1
12307
+  ac_status=$?
12308
+  grep -v '^ *+' conftest.er1 >conftest.err
12309
+  rm -f conftest.er1
12310
+  cat conftest.err >&5
12311
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12312
+  (exit $ac_status); } &&
12313
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
12314
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12315
+  (eval $ac_try) 2>&5
12316
+  ac_status=$?
12317
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12318
+  (exit $ac_status); }; } &&
12319
+	 { ac_try='test -s conftest.$ac_objext'
12320
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12321
+  (eval $ac_try) 2>&5
12322
+  ac_status=$?
12323
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12324
+  (exit $ac_status); }; }; then
12325
+  ac_cv_gethostbyname_args=6
12326
+else
12327
+  echo "$as_me: failed program was:" >&5
12328
+sed 's/^/| /' conftest.$ac_ext >&5
12329
+
12330
+fi
12331
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12332
+fi
12333
+if test -z "$ac_cv_gethostbyname_args"; then
12334
+    echo "$as_me:$LINENO: result: no" >&5
12335
+echo "${ECHO_T}no" >&6
12336
+else
12337
+    if test "$ac_cv_gethostbyname_args" = 3; then
12338
+
12339
+cat >>confdefs.h <<\_ACEOF
12340
+#define HAVE_GETHOSTBYNAME_R_3 1
12341
+_ACEOF
12342
+
12343
+    elif test "$ac_cv_gethostbyname_args" = 5; then
12344
+
12345
+cat >>confdefs.h <<\_ACEOF
12346
+#define HAVE_GETHOSTBYNAME_R_5 1
12347
+_ACEOF
12348
+
12349
+    elif test "$ac_cv_gethostbyname_args" = 6; then
12350
+
12351
+cat >>confdefs.h <<\_ACEOF
12352
+#define HAVE_GETHOSTBYNAME_R_6 1
12353
+_ACEOF
12354
+
12355
+    fi
12356
+    echo "$as_me:$LINENO: result: yes, and it takes $ac_cv_gethostbyname_args arguments" >&5
12357
+echo "${ECHO_T}yes, and it takes $ac_cv_gethostbyname_args arguments" >&6
12358
+fi
12165 12359
 
12166 12360
 if test "$test_clamav" = "yes"
12167 12361
 then
12168
-    # parse /etc/passwd
12169
-    if test "$use_id" = no
12362
+        if test "$use_id" = "no"
12170 12363
     then
12171
-	echo "$as_me:$LINENO: result: Checking /etc/passwd..." >&5
12172
-echo "${ECHO_T}Checking /etc/passwd..." >&6
12364
+	echo "$as_me:$LINENO: checking for $clamav_user in /etc/passwd" >&5
12365
+echo $ECHO_N "checking for $clamav_user in /etc/passwd... $ECHO_C" >&6
12173 12366
 	if test -r /etc/passwd; then
12174
-	    clamavuser=`cat /etc/passwd|grep ${clamav_user}`
12175
-	    clamavgroup=`cat /etc/group|grep ${clamav_group}`
12367
+	    clamavuser=`cat /etc/passwd|grep $clamav_user`
12368
+	    clamavgroup=`cat /etc/group|grep $clamav_group`
12176 12369
 	fi
12177 12370
     else
12178
-	echo "$as_me:$LINENO: result: Checking id output..." >&5
12179
-echo "${ECHO_T}Checking id output..." >&6
12371
+	echo "$as_me:$LINENO: checking for $clamav_user using id" >&5
12372
+echo $ECHO_N "checking for $clamav_user using id... $ECHO_C" >&6
12180 12373
 	id $clamav_user > /dev/null 2>&1
12181 12374
 	if test "$?" = 0 ; then
12182 12375
 	    clamavuser=1
... ...
@@ -12229,23 +12415,32 @@ fi
12229 12229
 
12230 12230
     if test "$use_netinfo" = "yes"
12231 12231
     then
12232
+	echo "$as_me:$LINENO: checking for $clamav_user using netinfo" >&5
12233
+echo $ECHO_N "checking for $clamav_user using netinfo... $ECHO_C" >&6
12232 12234
         clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}`
12233 12235
         clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}`
12234 12236
     fi
12235 12237
 
12236 12238
     if test "$use_yp" = "yes"
12237 12239
     then
12240
+	echo "$as_me:$LINENO: checking for $clamav_user using ypmatch" >&5
12241
+echo $ECHO_N "checking for $clamav_user using ypmatch... $ECHO_C" >&6
12238 12242
         clamavuser=`ypmatch ${clamav_user} passwd`
12239 12243
         clamavgroup=`ypmatch ${clamav_group} group`
12240 12244
     fi
12241 12245
 
12242 12246
     if test -z "$clamavuser" || test -z "$clamavgroup"
12243 12247
     then
12244
-        echo "ERROR: User \"$clamav_user\" (and/or group \"$clamav_group\") doesn't exist. Please create it. You can omit this check with the --disable-clamav option."
12245
-        exit 1
12248
+	echo "$as_me:$LINENO: result: no" >&5
12249
+echo "${ECHO_T}no" >&6
12250
+	{ { echo "$as_me:$LINENO: error: User $clamav_user (and/or group $clamav_group) doesn't exist. Please read the documentation !" >&5
12251
+echo "$as_me: error: User $clamav_user (and/or group $clamav_group) doesn't exist. Please read the documentation !" >&2;}
12252
+   { (exit 1); exit 1; }; }
12246 12253
     else
12247
-        CLAMAVUSER="${clamav_user}"
12248
-        CLAMAVGROUP="${clamav_group}"
12254
+	echo "$as_me:$LINENO: result: yes, user $clamav_user and group $clamav_group" >&5
12255
+echo "${ECHO_T}yes, user $clamav_user and group $clamav_group" >&6
12256
+        CLAMAVUSER="$clamav_user"
12257
+        CLAMAVGROUP="$clamav_group"
12249 12258
 
12250 12259
 
12251 12260
     fi
... ...
@@ -12726,7 +12921,6 @@ _ACEOF
12726 12726
 
12727 12727
 fi
12728 12728
 
12729
-# Check if <sys/select.h> needs to be included for fd_set
12730 12729
 echo "$as_me:$LINENO: checking for fd_set" >&5
12731 12730
 echo $ECHO_N "checking for fd_set... $ECHO_C" >&6
12732 12731
 cat >conftest.$ac_ext <<_ACEOF
... ...
@@ -12811,8 +13005,8 @@ echo "${ECHO_T}no" >&6
12811 12811
     fi
12812 12812
 fi
12813 12813
 
12814
-echo "$as_me:$LINENO: checking Default FD_SETSIZE value" >&5
12815
-echo $ECHO_N "checking Default FD_SETSIZE value... $ECHO_C" >&6
12814
+echo "$as_me:$LINENO: checking default FD_SETSIZE value" >&5
12815
+echo $ECHO_N "checking default FD_SETSIZE value... $ECHO_C" >&6
12816 12816
 if test "$cross_compiling" = yes; then
12817 12817
   DEFAULT_FD_SETSIZE=256
12818 12818
 else
... ...
@@ -42,11 +42,11 @@ AC_TYPE_OFF_T
42 42
 AC_COMPILE_CHECK_SIZEOF(short)
43 43
 AC_COMPILE_CHECK_SIZEOF(int)
44 44
 AC_COMPILE_CHECK_SIZEOF(long)
45
-AC_CHECK_FUNCS(poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups gethostbyname_r)
45
+AC_CHECK_FUNCS(poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups)
46 46
 AC_FUNC_MMAP
47 47
 AC_FUNC_FSEEKO
48 48
 
49
-# Check for broken snprintf
49
+dnl Check for broken snprintf (code from Phil Oleson <oz*nixil.net>)
50 50
 if test "x$ac_cv_func_snprintf" = "xyes" ; then
51 51
         AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
52 52
         AC_TRY_RUN(
... ...
@@ -66,7 +66,7 @@ fi
66 66
 have_pthreads=no
67 67
 AC_CHECK_HEADER(pthread.h,[have_pthreads=yes],)
68 68
 
69
-AC_CHECK_HEADER(zlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; AC_DEFINE(HAVE_ZLIB_H,1,zlib installed)],[echo "Please install zlib and zlib-devel packages."; exit 1])
69
+AC_CHECK_HEADER(zlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz"; AC_DEFINE(HAVE_ZLIB_H,1,zlib installed)],AC_MSG_ERROR(Please install zlib and zlib-devel packages))
70 70
 
71 71
 want_bzip2="yes"
72 72
 AC_ARG_ENABLE(bzip2,
... ...
@@ -75,8 +75,8 @@ want_bzip2="no",)
75 75
 
76 76
 if test "$want_bzip2" = "yes"
77 77
 then
78
-    AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H,1,have bzip2)],[echo "WARNING: Bzip2 support disabled"])
79 78
     AC_CHECK_LIB(bz2, bzReadOpen, AC_DEFINE(NOBZ2PREFIX,1,bzip funtions do not have bz2 prefix),)
79
+    AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H,1,have bzip2)], AC_MSG_WARN([****** bzip2 support disabled]))
80 80
 fi
81 81
 
82 82
 want_clamuko="yes"
... ...
@@ -97,7 +97,7 @@ want_dsig="no",)
97 97
 
98 98
 if test "$want_dsig" = "yes"
99 99
 then
100
-    AC_CHECK_LIB(gmp, __gmpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], [AC_CHECK_LIB(gmp, mpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], [echo "WARNING: GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !"; want_dsig="no"])])
100
+    AC_CHECK_LIB(gmp, __gmpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], [AC_CHECK_LIB(gmp, mpz_init, [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lgmp"; AC_DEFINE(HAVE_GMP,1,have gmp installed)], AC_MSG_WARN([****** GNU MP 2 or newer NOT FOUND - digital signature support will be disabled !]); want_dsig="no")])
101 101
 fi
102 102
 
103 103
 AC_CHECK_HEADER(syslog.h,AC_DEFINE(USE_SYSLOG,1,[use syslog]),)
... ...
@@ -174,7 +174,7 @@ AC_DEFINE_UNQUOTED(DATADIR,"$db_dir", [Path to virus database directory.])
174 174
 DBDIR="$db_dir"
175 175
 AC_SUBST(DBDIR)
176 176
 
177
-# config file
177
+dnl configure config directory
178 178
 cfg_dir=`echo $sysconfdir | grep prefix`
179 179
 
180 180
 if test -n "$cfg_dir"; then
... ...
@@ -196,16 +196,13 @@ dnl Do not overwrite current config files
196 196
 AM_CONDITIONAL(INSTALL_CLAMAV_CONF, test ! -r "$cfg_dir/clamav.conf")
197 197
 AM_CONDITIONAL(INSTALL_FRESHCLAM_CONF, test ! -r "$cfg_dir/freshclam.conf")
198 198
 
199
-# check for in_port_t definition
199
+dnl check for in_port_t definition
200 200
 AC_TRY_RUN([
201 201
 #include <sys/types.h>
202 202
 #include <netinet/in.h>
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
-
209 206
 case "$target_os" in
210 207
 linux*)
211 208
     AC_DEFINE(C_LINUX,1,[target is linux])
... ...
@@ -381,19 +378,22 @@ AC_SUBST(FRESHCLAM_LIBS)
381 381
 AC_SUBST(TH_SAFE)
382 382
 AC_SUBST(ADDITIONAL_LIBS)
383 383
 
384
-# --enable-milter
384
+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"])
385
+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"])
386
+
387
+dnl --enable-milter
385 388
 if test "$have_milter" = "yes"; then
386
-    # libmilter checking code adapted from spamass-milter by
387
-    # Tom G. Christensen <tgc@statsbiblioteket.dk>
389
+    dnl libmilter checking code adapted from spamass-milter by
390
+    dnl Tom G. Christensen <tgc@statsbiblioteket.dk>
388 391
 
389
-    # Check for libmilter and it's header files in the usual locations
392
+    dnl Check for libmilter and it's header files in the usual locations
390 393
     save_LDFLAGS="$LDFLAGS"
391 394
     if test -d /usr/lib/libmilter ; then
392 395
 	CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter"
393 396
     fi
394 397
     LDFLAGS="$LDFLAGS -lmilter $CLAMAV_MILTER_LIBS"
395 398
     AC_CHECK_LIB(milter, mi_stop,[CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS"],[
396
-	# Older sendmails require libsm or libsmutil for support functions
399
+	dnl Older sendmails require libsm or libsmutil for support functions
397 400
 	AC_SEARCH_LIBS(strlcpy, [sm smutil], [test "$ac_cv_search_strlcpy" = "none required" || CLAMAV_MILTER_XLIB="$ac_cv_search_strlcpy"])
398 401
 	LDFLAGS="$save_LDFLAGS $CLAMAV_MILTER_LIBS $CLAMAV_MILTER_XLIB"
399 402
 	$as_unset ac_cv_lib_milter_mi_stop
... ...
@@ -420,8 +420,8 @@ then
420 420
     AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail, $PATH:/usr/lib:/usr/sbin:/etc:/usr/local/lib:/usr/local/sbin:/usr/bin:/usr/local/bin)
421 421
 fi
422 422
 
423
-# tcpwrappers support
424
-# rules from http://ma.ph-freiburg.de/tng/tng-technical/2002-01/msg00094.html
423
+dnl tcpwrappers support
424
+dnl rules from http://ma.ph-freiburg.de/tng/tng-technical/2002-01/msg00094.html
425 425
 AC_ARG_WITH(tcpwrappers,
426 426
 [  --with-tcpwrappers      Support hosts.allow / hosts.deny (default=auto)],
427 427
 [ case "$withval" in
... ...
@@ -474,20 +474,78 @@ hosts_access(req)
474 474
         fi
475 475
 fi
476 476
 
477
-dnl Check for clamav in /etc/passwd
477
+dnl Check for gethostbyname_r and number of its arguments
478
+dnl Code from libwww/configure.in
479
+AC_MSG_CHECKING(for gethostbyname_r)
480
+if test -z "$ac_cv_gethostbyname_args"; then
481
+AC_TRY_COMPILE(
482
+[
483
+#include <sys/types.h>
484
+#include <netdb.h>
485
+],[
486
+struct hostent *hp;
487
+struct hostent h;
488
+char *name;
489
+char buffer[10];
490
+int  h_errno;
491
+hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);
492
+], ac_cv_gethostbyname_args=5)
493
+fi
494
+if test -z "$ac_cv_gethostbyname_args"; then
495
+AC_TRY_COMPILE(
496
+[
497
+#include <sys/types.h>
498
+#include <netdb.h>
499
+],[
500
+struct hostent h;
501
+struct hostent_data hdata;
502
+char *name;
503
+int  rc;
504
+rc = gethostbyname_r(name, &h, &hdata);
505
+], ac_cv_gethostbyname_args=3)
506
+fi
507
+if test -z "$ac_cv_gethostbyname_args"; then
508
+AC_TRY_COMPILE(
509
+[
510
+#include <sys/types.h>
511
+#include <netdb.h>
512
+], [
513
+struct hostent h;
514
+struct hostent *hp;
515
+char *name;
516
+char buf[10];
517
+int rc;
518
+int h_errno;
519
+
520
+rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
521
+], ac_cv_gethostbyname_args=6)
522
+fi
523
+if test -z "$ac_cv_gethostbyname_args"; then
524
+    AC_MSG_RESULT(no)
525
+else
526
+    if test "$ac_cv_gethostbyname_args" = 3; then
527
+	AC_DEFINE(HAVE_GETHOSTBYNAME_R_3,1,[gethostbyname_r takes 3 arguments])
528
+    elif test "$ac_cv_gethostbyname_args" = 5; then
529
+	AC_DEFINE(HAVE_GETHOSTBYNAME_R_5,1,[gethostbyname_r takes 5 arguments])
530
+    elif test "$ac_cv_gethostbyname_args" = 6; then
531
+	AC_DEFINE(HAVE_GETHOSTBYNAME_R_6,1,[gethostbyname_r takes 6 arguments])
532
+    fi
533
+    AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyname_args arguments])
534
+fi
478 535
 
536
+dnl Check for clamav in /etc/passwd
479 537
 if test "$test_clamav" = "yes"
480 538
 then
481
-    # parse /etc/passwd
482
-    if test "$use_id" = no
539
+    dnl parse /etc/passwd
540
+    if test "$use_id" = "no"
483 541
     then
484
-	AC_MSG_RESULT(Checking /etc/passwd...)
542
+	AC_MSG_CHECKING(for $clamav_user in /etc/passwd)
485 543
 	if test -r /etc/passwd; then
486
-	    clamavuser=`cat /etc/passwd|grep ${clamav_user}`
487
-	    clamavgroup=`cat /etc/group|grep ${clamav_group}`
544
+	    clamavuser=`cat /etc/passwd|grep $clamav_user`
545
+	    clamavgroup=`cat /etc/group|grep $clamav_group`
488 546
 	fi
489 547
     else
490
-	AC_MSG_RESULT(Checking id output...)
548
+	AC_MSG_CHECKING(for $clamav_user using id)
491 549
 	id $clamav_user > /dev/null 2>&1
492 550
 	if test "$?" = 0 ; then
493 551
 	    clamavuser=1
... ...
@@ -502,23 +560,26 @@ then
502 502
 
503 503
     if test "$use_netinfo" = "yes"
504 504
     then
505
+	AC_MSG_CHECKING(for $clamav_user using netinfo)
505 506
         clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}`
506 507
         clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}`
507 508
     fi
508 509
 
509 510
     if test "$use_yp" = "yes"
510 511
     then
512
+	AC_MSG_CHECKING(for $clamav_user using ypmatch)
511 513
         clamavuser=`ypmatch ${clamav_user} passwd`
512 514
         clamavgroup=`ypmatch ${clamav_group} group`
513 515
     fi
514 516
 
515 517
     if test -z "$clamavuser" || test -z "$clamavgroup"
516 518
     then
517
-        echo "ERROR: User \"$clamav_user\" (and/or group \"$clamav_group\") doesn't exist. Please create it. You can omit this check with the --disable-clamav option."
518
-        exit 1
519
+	AC_MSG_RESULT(no)
520
+	AC_MSG_ERROR(User $clamav_user (and/or group $clamav_group) doesn't exist. Please read the documentation !)
519 521
     else
520
-        CLAMAVUSER="${clamav_user}"
521
-        CLAMAVGROUP="${clamav_group}"
522
+	AC_MSG_RESULT([yes, user $clamav_user and group $clamav_group])
523
+        CLAMAVUSER="$clamav_user"
524
+        CLAMAVGROUP="$clamav_group"
522 525
         AC_SUBST(CLAMAVUSER)
523 526
         AC_SUBST(CLAMAVGROUP)
524 527
     fi
... ...
@@ -563,7 +624,7 @@ if test "$have_attrib_packed" = yes; then
563 563
 	AC_DEFINE(HAVE_ATTRIB_PACKED, 1, "attrib packed")
564 564
 fi
565 565
 
566
-# Check if <sys/select.h> needs to be included for fd_set
566
+dnl Check if <sys/select.h> needs to be included for fd_set
567 567
 AC_MSG_CHECKING([for fd_set])
568 568
 AC_TRY_COMPILE([#include <sys/types.h>],
569 569
         [fd_set readMask, writeMask;], have_fd_set=yes, have_fd_set=no)
... ...
@@ -580,7 +641,7 @@ else
580 580
     fi
581 581
 fi
582 582
 
583
-AC_MSG_CHECKING(Default FD_SETSIZE value)
583
+AC_MSG_CHECKING(default FD_SETSIZE value)
584 584
 AC_TRY_RUN([
585 585
 #include <stdio.h>
586 586
 #include <unistd.h>