[Groonga-commit] groonga/groonga [master] Use AC_CHECK_FUNCS to check whether mkostemp() is available or not.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 24日 (金) 15:47:19 JST


Daijiro MORI	2012-02-24 15:47:19 +0900 (Fri, 24 Feb 2012)

  New Revision: 51fffa6afc493131a65979078b8225819c2f22d9

  Log:
    Use AC_CHECK_FUNCS to check whether mkostemp() is available or not.

  Modified files:
    configure.ac
    lib/groonga_in.h

  Modified: configure.ac (+1 -1)
===================================================================
--- configure.ac    2012-02-24 15:07:15 +0900 (b7c21e4)
+++ configure.ac    2012-02-24 15:47:19 +0900 (bce35f1)
@@ -310,7 +310,7 @@ AC_CHECK_HEADERS(sys/mman.h sys/time.h sys/timeb.h sys/param.h sys/types.h sys/r
 AC_CHECK_HEADERS(netdb.h sys/wait.h sys/socket.h netinet/in.h netinet/tcp.h)
 AC_CHECK_HEADERS(ucontext.h signal.h errno.h execinfo.h sys/sysctl.h)
 AC_CHECK_HEADERS(time.h)
-AC_CHECK_FUNCS(localtime_r gmtime_r)
+AC_CHECK_FUNCS(localtime_r gmtime_r mkostemp)
 BACKTRACE_LIBS=
 AC_CHECK_FUNCS(backtrace,
  [],

  Modified: lib/groonga_in.h (+3 -4)
===================================================================
--- lib/groonga_in.h    2012-02-24 15:07:15 +0900 (8cd9e16)
+++ lib/groonga_in.h    2012-02-24 15:47:19 +0900 (0bf117a)
@@ -375,7 +375,6 @@ typedef int grn_cond;
 #endif /* WIN32 */
 
 #ifdef __GNUC__
-# include <features.h>
 # if (defined(__i386__) || defined(__x86_64__)) /* ATOMIC ADD */
 #  define GRN_ATOMIC_ADD_EX(p,i,r) \
   __asm__ __volatile__ ("lock; xaddl %0,%1" : "=r"(r), "=m"(*p) : "0"(i), "m" (*p))
@@ -414,12 +413,12 @@ typedef int grn_cond;
   (void)atomic_swap_64(p, v)
 # endif /* ATOMIC 64BIT SET */
 
-# if __GNUC_PREREQ(2, 7)
+# ifdef HAVE_MKOSTEMP
 #  define GRN_MKOSTEMP mkostemp
-# else /* __GNUC_PREREQ(2, 7) */
+# else /* HAVE_MKOSTEMP */
 #  define GRN_MKOSTEMP(template,flags) \
   (mktemp(template), open((template),flags))
-# endif /* __GNUC_PREREQ(2, 7) */
+# endif /* HAVE_MKOSTEMP */
 
 #elif (defined(WIN32) || defined (_WIN64)) /* __GNUC__ */
 




Groonga-commit メーリングリストの案内
Back to archive index