[PATCH] Crosscompiling fixes



Hija,

I'm currently experiencing heavy troubles to crosscompile glib on a
i386 platform mainly because configure bails out on every try to 
run a program on the build platform.

To deal with the problems I'm considering to turn a few runtime checks
into compiletime checks to survive crossplatfom configuration.

Attached is a first patch that deals with stuff the compiler will
figure out and bail out if impossible and thus having the same effect
as a runtime check.

glib has built natively on i386 with the changes and went a bit further
with a handtuned configure for my cross.

Okay, to apply to head with an appropiate changelog entry?

As I next step I'd try to redo the GLIB_SIZEOF macro to work
like the AC_CHECK_SIZEOF one.

-- 
Servus,
       Daniel
--- configure.in.old	Fri Jul 12 21:16:50 2002
+++ configure.in	Fri Jul 12 21:54:57 2002
@@ -379,12 +379,12 @@
 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
 glib_save_LIBS=$LIBS
 LIBS="$LIBS -lm"
-AC_TRY_RUN([#include <math.h>
+AC_TRY_COMPILE([#include <math.h>
              int main (void) { return (log(1) != log(1.)); }],
      AC_MSG_RESULT(none needed),
      glib_save_CFLAGS=$CFLAGS
      CFLAGS="$CFLAGS -std1"
-     AC_TRY_RUN([#include <math.h>
+     AC_TRY_COMPILE([#include <math.h>
                  int main (void) { return (log(1) != log(1.)); }],
          AC_MSG_RESULT(-std1),
          AC_MSG_RESULT()
@@ -515,7 +515,7 @@
 dnl truely know which ones of `inline', `__inline' and `__inline__' are
 dnl actually supported.
 AC_CACHE_CHECK([for __inline],glib_cv_has__inline,[
-        AC_TRY_RUN([
+        AC_TRY_COMPILE([
 	__inline int foo () { return 0; }
 	int main () { return foo (); }
        	],
@@ -528,7 +528,7 @@
 xyes) AC_DEFINE(G_HAVE___INLINE,1,[Have __inline keyword])
 esac
 AC_CACHE_CHECK([for __inline__],glib_cv_has__inline__,[
-        AC_TRY_RUN([
+        AC_TRY_COMPILE([
 	__inline__ int foo () { return 0; }
 	int main () { return foo (); }
        	],
@@ -541,7 +541,7 @@
 xyes) AC_DEFINE(G_HAVE___INLINE__,1,[Have __inline__ keyword])
 esac
 AC_CACHE_CHECK([for inline], glib_cv_hasinline,[
-        AC_TRY_RUN([
+        AC_TRY_COMPILE([
 	#undef inline
 	inline int foo () { return 0; }
 	int main () { return foo (); }
@@ -811,7 +811,7 @@
 dnl we currently check for all three va_copy possibilities, so we get
 dnl all results in config.log for bug reports.
 AC_CACHE_CHECK([for an implementation of va_copy()],glib_cv_va_copy,[
-	AC_TRY_RUN([
+	AC_TRY_COMPILE([
 	#include <stdarg.h>
 	void f (int i, ...) {
 	va_list args1, args2;
@@ -830,7 +830,7 @@
 	[])
 ])
 AC_CACHE_CHECK([for an implementation of __va_copy()],glib_cv___va_copy,[
-	AC_TRY_RUN([
+	AC_TRY_COMPILE([
 	#include <stdarg.h>
 	void f (int i, ...) {
 	va_list args1, args2;
@@ -1242,7 +1242,7 @@
     for flag in pthread pthreads; do
       glib_save_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -$flag"
-      AC_TRY_RUN([#include <pthread.h> 
+      AC_TRY_COMPILE([#include <pthread.h> 
 	          int check_me = 0;
 		  void* func(void* data) {return check_me = 42;}
 		  main()

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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