Removed bashism in test for the pkg-config version.
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Thu, 19 Apr 2001 08:26:21 +0000 (08:26 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Thu, 19 Apr 2001 08:26:21 +0000 (08:26 +0000)
2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* configure.in: Removed bashism in test for the pkg-config
version.

* configure.in: Rewrote test for multithread flag. Now uses
localtime_r, which hopefully has a consistent prototype across
different platforms. Also it uses a clever double EGREP trick
instead of compiling, which could give false positives. Thanks to
Dan Winship <danw@ximian.com> for the hint.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in

index 32425b4..05717d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index 32425b4..05717d9 100644 (file)
@@ -1,3 +1,14 @@
+2001-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Removed bashism in test for the pkg-config
+       version.
+
+       * configure.in: Rewrote test for multithread flag. Now uses
+       localtime_r, which hopefully has a consistent prototype across
+       different platforms. Also it uses a clever double EGREP trick
+       instead of compiling, which could give false positives. Thanks to
+       Dan Winship <danw@ximian.com> for the hint.
+
 Wed Apr 18 17:35:38 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gutils.c (_glib_gettext): Add missing static pointed
index ae2ff8f..fc041bf 100644 (file)
@@ -154,7 +154,9 @@ if test x$PKG_CONFIG = xno ; then
   AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
 fi
 
-if ! pkg-config --atleast-pkgconfig-version 0.5 ; then
+if pkg-config --atleast-pkgconfig-version 0.5 ; then
+  :
+else
   AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
 fi
 
@@ -1004,17 +1006,22 @@ if test x"$have_threads" != xnone; then
                G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
     esac
 
-    # if we are not finding the ctime_r function, then we probably are
+    # if we are not finding the localtime_r function, then we probably are
     # not using the proper multithread flag
 
     glib_save_CPPFLAGS="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS"
 
-    AC_TRY_COMPILE([#include <time.h>],
-       [time_t t; char b[30]; ctime_r (&t, b);], ,
-           [AC_TRY_COMPILE([#include <time.h>],
-               [time_t t; char b[30]; ctime_r (&t, b, 30);], ,
-                       AC_MSG_WARN($FLAG_DOES_NOT_WORK))])
+    # First we test, whether localtime_r is declared in time.h
+    # directly. Then we test wether a macro localtime_r exists, in
+    # which case localtime_r in the test program is replaced and thus
+    # if we still find localtime_r in the output, it is not defined as 
+    # a macro.
+
+    AC_EGREP_CPP([[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]], [#include <time.h>], ,
+      [AC_EGREP_CPP([[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]], [#include <time.h> 
+                                                          localtime_r(a,b)],
+                  AC_MSG_WARN($FLAG_DOES_NOT_WORK))])
 
     CPPFLAGS="$glib_save_CPPFLAGS"