Browse code

Fix Solaris memory usage: don't link with -lmalloc on Solaris (bb #1595, thanks to David Schweikert <david*schweikert.ch> for tracking down the problem).

git-svn: trunk@5062

Török Edvin authored on 2009/05/06 16:56:34
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+Wed May  6 10:45:55 EEST 2009 (edwin)
2
+-------------------------------------
3
+ * configure, configure.in: Fix Solaris memory usage: don't link with
4
+ -lmalloc on Solaris (bb #1595, thanks to David Schweikert
5
+ <david*schweikert.ch> for tracking down the problem).
6
+
1 7
 Wed May  6 10:40:19 EEST 2009 (edwin)
2 8
 -------------------------------------
3 9
  * clamd/others.c, clamd/others.h, clamd/server-th.c,
... ...
@@ -16277,7 +16277,8 @@ fi
16277 16277
 
16278 16278
 
16279 16279
 
16280
-for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp
16280
+
16281
+for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo
16281 16282
 do
16282 16283
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16283 16284
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
... ...
@@ -25387,100 +25388,6 @@ else
25387 25387
 fi
25388 25388
 
25389 25389
 
25390
-{ $as_echo "$as_me:$LINENO: checking for library containing mallinfo" >&5
25391
-$as_echo_n "checking for library containing mallinfo... " >&6; }
25392
-if test "${ac_cv_search_mallinfo+set}" = set; then
25393
-  $as_echo_n "(cached) " >&6
25394
-else
25395
-  ac_func_search_save_LIBS=$LIBS
25396
-cat >conftest.$ac_ext <<_ACEOF
25397
-/* confdefs.h.  */
25398
-_ACEOF
25399
-cat confdefs.h >>conftest.$ac_ext
25400
-cat >>conftest.$ac_ext <<_ACEOF
25401
-/* end confdefs.h.  */
25402
-
25403
-/* Override any GCC internal prototype to avoid an error.
25404
-   Use char because int might match the return type of a GCC
25405
-   builtin and then its argument prototype would still apply.  */
25406
-#ifdef __cplusplus
25407
-extern "C"
25408
-#endif
25409
-char mallinfo ();
25410
-int
25411
-main ()
25412
-{
25413
-return mallinfo ();
25414
-  ;
25415
-  return 0;
25416
-}
25417
-_ACEOF
25418
-for ac_lib in '' malloc; do
25419
-  if test -z "$ac_lib"; then
25420
-    ac_res="none required"
25421
-  else
25422
-    ac_res=-l$ac_lib
25423
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
25424
-  fi
25425
-  rm -f conftest.$ac_objext conftest$ac_exeext
25426
-if { (ac_try="$ac_link"
25427
-case "(($ac_try" in
25428
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25429
-  *) ac_try_echo=$ac_try;;
25430
-esac
25431
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25432
-$as_echo "$ac_try_echo") >&5
25433
-  (eval "$ac_link") 2>conftest.er1
25434
-  ac_status=$?
25435
-  grep -v '^ *+' conftest.er1 >conftest.err
25436
-  rm -f conftest.er1
25437
-  cat conftest.err >&5
25438
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25439
-  (exit $ac_status); } && {
25440
-	 test -z "$ac_c_werror_flag" ||
25441
-	 test ! -s conftest.err
25442
-       } && test -s conftest$ac_exeext && {
25443
-	 test "$cross_compiling" = yes ||
25444
-	 $as_test_x conftest$ac_exeext
25445
-       }; then
25446
-  ac_cv_search_mallinfo=$ac_res
25447
-else
25448
-  $as_echo "$as_me: failed program was:" >&5
25449
-sed 's/^/| /' conftest.$ac_ext >&5
25450
-
25451
-
25452
-fi
25453
-
25454
-rm -rf conftest.dSYM
25455
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
25456
-      conftest$ac_exeext
25457
-  if test "${ac_cv_search_mallinfo+set}" = set; then
25458
-  break
25459
-fi
25460
-done
25461
-if test "${ac_cv_search_mallinfo+set}" = set; then
25462
-  :
25463
-else
25464
-  ac_cv_search_mallinfo=no
25465
-fi
25466
-rm conftest.$ac_ext
25467
-LIBS=$ac_func_search_save_LIBS
25468
-fi
25469
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_mallinfo" >&5
25470
-$as_echo "$ac_cv_search_mallinfo" >&6; }
25471
-ac_res=$ac_cv_search_mallinfo
25472
-if test "$ac_res" != no; then
25473
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
25474
-
25475
-cat >>confdefs.h <<\_ACEOF
25476
-#define HAVE_MALLINFO 1
25477
-_ACEOF
25478
-
25479
-	        test "$ac_cv_search_mallinfo" = "none required" ||
25480
-		CLAMD_LIBS="$CLAMD_LIBS $ac_cv_search_mallinfo"
25481
-fi
25482
-
25483
-
25484 25390
 ac_config_files="$ac_config_files libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1"
25485 25391
 
25486 25392
 cat >confcache <<\_ACEOF
... ...
@@ -420,7 +420,7 @@ fi
420 420
 AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
421 421
 AC_SEARCH_LIBS([gethostent],[nsl], [(LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl")])
422 422
 
423
-AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp])
423
+AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo])
424 424
 AC_C_FUNC_MMAP_PRIVATE
425 425
 AC_FUNC_FSEEKO
426 426
 
... ...
@@ -1570,11 +1570,6 @@ AC_SUBST([CURSES_LIBS])
1570 1570
 AM_CONDITIONAL([HAVE_CURSES],
1571 1571
 	       [test "X$HAVE_LIBNCURSES" = "Xyes" || test "X$HAVE_LIBPDCURSES" = "Xyes"])
1572 1572
 
1573
-AC_SEARCH_LIBS([mallinfo],[malloc],
1574
-	       [AC_DEFINE([HAVE_MALLINFO],1,[have mallinfo])
1575
-	        test "$ac_cv_search_mallinfo" = "none required" ||
1576
-		CLAMD_LIBS="$CLAMD_LIBS $ac_cv_search_mallinfo"])
1577
-
1578 1573
 AC_OUTPUT([
1579 1574
 libclamav/Makefile
1580 1575
 libclamav/lzma/Makefile