Browse code

check for ctime_r

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

Tomasz Kojm authored on 2005/04/14 21:07:42
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Apr 14 14:04:46 CEST 2005 (tk)
2
+----------------------------------
3
+  * configure: check for ctime_r
4
+
1 5
 Tue Apr 12 09:54:58 BST 2005 (trog)
2 6
 -----------------------------------
3 7
   * libclamav/unrar: First commit of RAR3, RAR2 and RAR1 code.
... ...
@@ -93,6 +93,15 @@
93 93
 /* ancillary data style fd pass */
94 94
 #undef HAVE_CONTROL_IN_MSGHDR
95 95
 
96
+/* Define to 1 if you have the `ctime_r' function. */
97
+#undef HAVE_CTIME_R
98
+
99
+/* ctime_r takes 2 arguments */
100
+#undef HAVE_CTIME_R_2
101
+
102
+/* ctime_r takes 3 arguments */
103
+#undef HAVE_CTIME_R_3
104
+
96 105
 /* Define to 1 if you have the <dlfcn.h> header file. */
97 106
 #undef HAVE_DLFCN_H
98 107
 
... ...
@@ -9365,7 +9365,8 @@ fi
9365 9365
 
9366 9366
 
9367 9367
 
9368
-for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups
9368
+
9369
+for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups ctime_r
9369 9370
 do
9370 9371
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
9371 9372
 echo "$as_me:$LINENO: checking for $ac_func" >&5
... ...
@@ -13369,6 +13370,78 @@ _ACEOF
13369 13369
 echo "${ECHO_T}yes, and it takes $ac_cv_readdir_args arguments" >&6
13370 13370
 fi
13371 13371
 
13372
+echo "$as_me:$LINENO: checking for ctime_r" >&5
13373
+echo $ECHO_N "checking for ctime_r... $ECHO_C" >&6
13374
+if test "$ac_cv_func_ctime_r" = "yes"; then
13375
+    cat >conftest.$ac_ext <<_ACEOF
13376
+/* confdefs.h.  */
13377
+_ACEOF
13378
+cat confdefs.h >>conftest.$ac_ext
13379
+cat >>conftest.$ac_ext <<_ACEOF
13380
+/* end confdefs.h.  */
13381
+
13382
+	#include <time.h>
13383
+
13384
+int
13385
+main ()
13386
+{
13387
+
13388
+	char buf[31];
13389
+	time_t t;
13390
+	ctime_r(&t, buf, 30);
13391
+
13392
+  ;
13393
+  return 0;
13394
+}
13395
+_ACEOF
13396
+rm -f conftest.$ac_objext
13397
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
13398
+  (eval $ac_compile) 2>conftest.er1
13399
+  ac_status=$?
13400
+  grep -v '^ *+' conftest.er1 >conftest.err
13401
+  rm -f conftest.er1
13402
+  cat conftest.err >&5
13403
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
13404
+  (exit $ac_status); } &&
13405
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
13406
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13407
+  (eval $ac_try) 2>&5
13408
+  ac_status=$?
13409
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
13410
+  (exit $ac_status); }; } &&
13411
+	 { ac_try='test -s conftest.$ac_objext'
13412
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13413
+  (eval $ac_try) 2>&5
13414
+  ac_status=$?
13415
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
13416
+  (exit $ac_status); }; }; then
13417
+
13418
+	ac_cv_ctime_args=3
13419
+
13420
+cat >>confdefs.h <<\_ACEOF
13421
+#define HAVE_CTIME_R_3 1
13422
+_ACEOF
13423
+
13424
+
13425
+else
13426
+  echo "$as_me: failed program was:" >&5
13427
+sed 's/^/| /' conftest.$ac_ext >&5
13428
+
13429
+
13430
+	ac_cv_ctime_args=2
13431
+
13432
+cat >>confdefs.h <<\_ACEOF
13433
+#define HAVE_CTIME_R_2 1
13434
+_ACEOF
13435
+
13436
+
13437
+fi
13438
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
13439
+
13440
+    echo "$as_me:$LINENO: result: yes, and it takes $ac_cv_ctime_args arguments" >&5
13441
+echo "${ECHO_T}yes, and it takes $ac_cv_ctime_args arguments" >&6
13442
+fi
13443
+
13372 13444
 if test "$test_clamav" = "yes"
13373 13445
 then
13374 13446
         if test "$use_id" = "no"
... ...
@@ -50,7 +50,7 @@ AC_COMPILE_CHECK_SIZEOF(long long)
50 50
 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"])
51 51
 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"])
52 52
 
53
-AC_CHECK_FUNCS(poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups)
53
+AC_CHECK_FUNCS(poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop setgroups initgroups ctime_r)
54 54
 AC_FUNC_MMAP
55 55
 AC_FUNC_FSEEKO
56 56
 
... ...
@@ -775,6 +775,25 @@ else
775 775
     AC_MSG_RESULT([yes, and it takes $ac_cv_readdir_args arguments])
776 776
 fi
777 777
 
778
+AC_MSG_CHECKING(for ctime_r)
779
+if test "$ac_cv_func_ctime_r" = "yes"; then
780
+    AC_TRY_COMPILE([
781
+	#include <time.h>
782
+    ],[
783
+	char buf[31];
784
+	time_t t;
785
+	ctime_r(&t, buf, 30);
786
+    ],[
787
+	ac_cv_ctime_args=3
788
+	AC_DEFINE(HAVE_CTIME_R_3,1,[ctime_r takes 3 arguments])
789
+    ],[
790
+	ac_cv_ctime_args=2
791
+	AC_DEFINE(HAVE_CTIME_R_2,1,[ctime_r takes 2 arguments])
792
+    ])
793
+
794
+    AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
795
+fi
796
+
778 797
 dnl Check for clamav in /etc/passwd
779 798
 if test "$test_clamav" = "yes"
780 799
 then