[giggle] Use autoconf macros for strptime detection



commit 948ffa9cf5690d50523b95af78df91a2392606ec
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Jul 29 13:32:24 2013 +0100

    Use autoconf macros for strptime detection

 configure.ac                         |   17 ++---------------
 libgiggle-git/giggle-git-revisions.c |    2 +-
 2 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d56eef4..e4b8460 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AM_SILENT_RULES([yes])
 AC_PROG_CC
 AC_PROG_CC_C_O
 AC_PROG_CC_C99
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
 gl_EARLY
 
 # For gnulib.
@@ -39,7 +39,7 @@ AC_C_INLINE
 
 # Checks for library functions.
 AC_FUNC_MKTIME
-AC_CHECK_FUNCS([localtime_r setlocale strchr strrchr strstr])
+AC_CHECK_FUNCS([strptime])
 
 
 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
@@ -124,19 +124,6 @@ dnl  ----------------------
 dnl | library requirements |-----------------------------------
 dnl  ----------------------
 
-dnl Make sure that strptime can be used (read: has gnu extensions)
-AC_MSG_CHECKING([for GNU extensions of strptime()])
-AC_RUN_IFELSE(
-  [AC_LANG_PROGRAM(
-    [[#include <time.h>]],
-    [[const char* date = "1168635922 +0100"; struct tm tm;
-      char const* returned = strptime(date, "%s %z", &tm);
-      return (!returned || *returned ? 1 : 0);]])],
-  [AC_MSG_RESULT(available)
-   AC_DEFINE([STRPTIME_HAS_GNU], [1],
-             [strptime() has GNU extensions %s and %z])],
-  [AC_MSG_RESULT(not available)])
-
 dnl Figure out which format string to use for time_t
 AC_MSG_CHECKING([size of time_t type])
 AC_RUN_IFELSE(
diff --git a/libgiggle-git/giggle-git-revisions.c b/libgiggle-git/giggle-git-revisions.c
index d074d5c..870c277 100644
--- a/libgiggle-git/giggle-git-revisions.c
+++ b/libgiggle-git/giggle-git-revisions.c
@@ -130,7 +130,7 @@ git_revisions_get_command_line (GiggleJob  *job,
 static struct tm *
 git_revisions_get_time (const gchar *date)
 {
-#if STRPTIME_HAS_GNU
+#if HAVE_STRPTIME
        const gchar *returned;
        struct tm   *tm;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]