Patch to glib/configure.in



Hello!

I'm attaching a patch against configure.in for glib.
Autoconf produces a lot of warnings while processing this file because
several AC_TRY_RUN directives don't allow cross-compiling. The
default (for cross-compiling) behaviour, as specified by autoconf
documentation should be to use `pessimistic' values, so that the program
compiles, even if it lacks some features.
It is not possible to fix all such cases. Sometimes it is necessary to ask
the user to run the test program on the host machine; this is not yet
implemented in autoconf.
Following changes have been made:
1) While testing for flags enabling ANSI mode, assume no flags are needed.
It is unbelievable that someone cross-compiles using a K&R compiler.
2) While testing for `-std1' flag, add a dummy error to placate autoconf.
The shell should never get there.
3) Pessimistic values for __inline, __inline__ and inline - assume they
are not supported. Spaces changed to tabs where needed.
4) Pessimistic values for va_copy, __va_copy and copy by value - assume
that none is supported.
5) Assume that underscores are not needed. With 50% probability modules
will not be loaded, but who cares when cross-compiling?
6) `e' -> `we'. Just an annoying mistyping.
7) Never use $host. Use $host_os instead, because this is more reliable.
8) Pessimistic value for getpwuid_r - assume that this function is not
present or doesn't work.

Pavel Roskin
--- configure.in.v0	Mon Feb 15 18:50:25 1999
+++ configure.in	Mon Feb 15 20:13:04 1999
@@ -159,7 +159,7 @@
 AC_TRY_RUN([#include <math.h>
              int main (void) { return (log(1) != log(1.)); }],
      AC_MSG_RESULT(none needed),
-     glib_save_CFLAGS=$CFLAGS
+     [glib_save_CFLAGS=$CFLAGS
      CFLAGS="$CFLAGS -std1"
      AC_TRY_RUN([#include <math.h>
                  int main (void) { return (log(1) != log(1.)); }],
@@ -167,8 +167,10 @@
          AC_MSG_RESULT()
          CFLAGS=$glib_save_CFLAGS
          AC_MSG_WARN(
-                [No ANSI prototypes found in library. (-std1 didn't work.)])
-     )
+                [No ANSI prototypes found in library. (-std1 didn't work.)]),
+         AC_MSG_ERROR([Error in configure.in - please report])
+     )],
+     AC_MSG_RESULT([none needed (hopefully)])
 )
 LIBS=$glib_save_LIBS
 
@@ -208,14 +210,13 @@
 dnl actually supported.
 AC_MSG_CHECKING(for __inline)
 AC_CACHE_VAL(glib_cv_has__inline,[
-        AC_TRY_RUN([
+	AC_TRY_RUN([
 	__inline int foo () { return 0; }
 	int main () { return foo (); }
-       	],
-	glib_cv_has__inline=yes
-        ,
-	glib_cv_has__inline=no
-        ,)
+	],
+	glib_cv_has__inline=yes,
+	glib_cv_has__inline=no,
+	glib_cv_has__inline=no)
 ])
 AC_MSG_RESULT($glib_cv_has__inline)
 case x$glib_cv_has__inline in
@@ -223,14 +224,13 @@
 esac
 AC_MSG_CHECKING(for __inline__)
 AC_CACHE_VAL(glib_cv_has__inline__,[
-        AC_TRY_RUN([
+	AC_TRY_RUN([
 	__inline__ int foo () { return 0; }
 	int main () { return foo (); }
-       	],
-	glib_cv_has__inline__=yes
-        ,
-	glib_cv_has__inline__=no
-        ,)
+	],
+	glib_cv_has__inline__=yes,
+	glib_cv_has__inline__=no,
+	glib_cv_has__inline__=no)
 ])
 AC_MSG_RESULT($glib_cv_has__inline__)
 case x$glib_cv_has__inline__ in
@@ -238,14 +238,13 @@
 esac
 AC_MSG_CHECKING(for inline)
 AC_CACHE_VAL(glib_cv_hasinline,[
-        AC_TRY_RUN([
+	AC_TRY_RUN([
 	inline int foo () { return 0; }
 	int main () { return foo (); }
-       	],
-	glib_cv_hasinline=yes
-        ,
-	glib_cv_hasinline=no
-        ,)
+	],
+	glib_cv_hasinline=yes,
+	glib_cv_hasinline=no,
+	glib_cv_hasinline=no)
 ])
 AC_MSG_RESULT($glib_cv_hasinline)
 case x$glib_cv_hasinline in
@@ -392,10 +391,9 @@
 	  f (0, 42);
 	  return 0;
 	}],
-	glib_cv_va_copy=yes
-	,
-	glib_cv_va_copy=no
-	,)
+	glib_cv_va_copy=yes,
+	glib_cv_va_copy=no,
+	glib_cv_va_copy=no)
 ])
 AC_MSG_RESULT($glib_cv_va_copy)
 AC_MSG_CHECKING(for an implementation of __va_copy())
@@ -414,10 +412,9 @@
 	  f (0, 42);
 	  return 0;
 	}],
-	glib_cv___va_copy=yes
-	,
-	glib_cv___va_copy=no
-	,)
+	glib_cv___va_copy=yes,
+	glib_cv___va_copy=no,
+	glib_cv___va_copy=no)
 ])
 AC_MSG_RESULT($glib_cv___va_copy)
 AC_MSG_CHECKING(whether va_lists can be copied by value)
@@ -436,10 +433,9 @@
 	  f (0, 42);
 	  return 0;
 	}],
-	glib_cv_va_val_copy=yes
-	,
-	glib_cv_va_val_copy=no
-	,)
+	glib_cv_va_val_copy=yes,
+	glib_cv_va_val_copy=no,
+	glib_cv_va_val_copy=no)
 ])
 if test "x$glib_cv_va_copy" = "xyes"; then
   AC_DEFINE(G_VA_COPY, va_copy)
@@ -528,6 +524,7 @@
 		}],
 			glib_cv_uscore=yes,
 			glib_cv_uscore=no,
+			glib_cv_uscore=no
 		)
 		rm -f plugin.c plugin.o plugin.lo
 	])
@@ -545,7 +542,7 @@
 		G_MODULE_HAVE_DLERROR=0)
 	LIBS="$LIBS_orig"
 fi
-dnl *** done, have e got an implementation?
+dnl *** done, have we got an implementation?
 if test -z "$G_MODULE_IMPL"; then
 	G_MODULE_IMPL=0
 fi
@@ -606,8 +603,8 @@
 
 have_threads=none
 if test "x$want_threads" = xyes || test "x$want_threads" = xsolaris; then
-       	case $host in
-               	*-*-solaris*)
+       	case "$host_os" in
+               	solaris*)
               	AC_CHECK_LIB(thread, cond_init, have_threads=solaris)
 		;;
 	esac
@@ -709,14 +706,14 @@
 if test x"$have_threads" != xnone; then
 G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_REENTRANT" # good default guess
 
-    case $host in
-	*-aix*)
+    case "$host_os" in
+	aix*)
 		G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_THREAD_SAFE"
 		if test x"$GCC" = xyes; then
             	        G_THREAD_CFLAGS="$G_THREAD_CFLAGS -mthreads"
 		fi
 		;;
-	*-freebsd2.2*)
+	freebsd2.2*)
 		G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_THREAD_SAFE"
 
 		# FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
@@ -763,6 +760,7 @@
 					sizeof (buffer), &pointer);
 				return errno == ENOSYS;}],
 				[ac_cv_func_getpwuid_r=yes],
+				[ac_cv_func_getpwuid_r=no],
 				[ac_cv_func_getpwuid_r=no])])
 		if test "$ac_cv_func_getpwuid_r" = yes; then
 			AC_MSG_RESULT(yes)


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