3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- glib-2.1.3/configure.in~configure
7 +++ glib-2.1.3/configure.in
9 cflags_set=${CFLAGS+set}
11 # we rewrite this file
12 +if "x$cross_compiling" != xyes; then
13 rm -f glibconfig-sysdefs.h
16 GLIB_AC_DIVERT_BEFORE_HELP([
25 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
26 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
30 AC_TRY_RUN([#include <math.h>
31 int main (void) { return (log(1) != log(1.)); }],
32 AC_MSG_RESULT(none needed),
35 CFLAGS=$glib_save_CFLAGS
37 - [No ANSI prototypes found in library. (-std1 didn't work.)])
39 + [No ANSI prototypes found in library. (-std1 didn't work.)]),
42 + AC_MSG_RESULT([assuming none needed])
47 dnl *** strlcpy/strlcat ***
48 dnl ****************************************
50 -AC_MSG_CHECKING(for OpenBSD strlcpy/strlcat)
54 - char *p = malloc (10);
55 - (void) strlcpy (p, "hi", 10);
56 - if (strlcat (p, "bye", 0) != 3)
59 -}], glib_ok=yes, glib_ok=no)
60 -AC_MSG_RESULT($glib_ok)
61 -if test "$glib_ok" = "yes"; then
62 +AC_CACHE_CHECK([for OpenBSD strlcpy/strlcat],[glib_cv_strlcpy],
66 + char *p = malloc (10);
67 + (void) strlcpy (p, "hi", 10);
68 + if (strlcat (p, "bye", 0) != 3)
71 + }], glib_cv_strlcpy=yes, glib_cv_strlcpy=no)
73 +if test "x$glib_cv_strlcpy" = xyes; then
74 AC_DEFINE(HAVE_STRLCPY,1,[Have functions strlcpy and strlcat])
77 @@ -1302,16 +1309,15 @@
78 for flag in pthread pthreads; do
79 glib_save_CFLAGS="$CFLAGS"
80 CFLAGS="$CFLAGS -$flag"
81 - AC_TRY_RUN([#include <pthread.h>
82 + AC_TRY_LINK([#include <pthread.h>],[
84 void* func(void* data) {return check_me = 42;}
89 pthread_create (&t, 0, func, 0);
90 pthread_join (t, &ret);
91 exit (check_me != 42 || ret != 42);
94 [G_THREAD_CFLAGS=-$flag
95 G_THREAD_LIBS=-$flag])
96 CFLAGS="$glib_save_CFLAGS"
97 @@ -1431,16 +1437,15 @@
98 LIBS="$glib_save_LIBS $add_thread_lib"
100 AC_MSG_CHECKING(for pthread_create/pthread_join$IN)
101 - AC_TRY_RUN([#include <pthread.h>
102 + AC_TRY_LINK([#include <pthread.h>],[
104 void* func(void* data) {check_me = 42;}
109 pthread_create (&t, $defattr, func, 0);
110 pthread_join (t, &ret);
111 exit (check_me != 42);
115 G_THREAD_LIBS="$add_thread_lib"
117 @@ -1466,12 +1471,11 @@
118 LIBS="$glib_save_LIBS $add_thread_lib"
120 AC_MSG_CHECKING(for sched_get_priority_min$IN)
121 - AC_TRY_RUN([#include <sched.h>
124 + AC_TRY_LINK([#include <sched.h>
125 + #include <errno.h>],[
127 return sched_get_priority_min(SCHED_OTHER)==-1
131 G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib"
132 posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
133 @@ -1636,7 +1640,8 @@
134 AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
135 CPPFLAGS="$glib_save_CPPFLAGS"
137 - AC_MSG_CHECKING(whether to use the PID niceness surrogate for thread priorities)
138 + AC_CACHE_CHECK([whether to use the PID niceness surrogate for thread priorities],
139 + [glib_cv_sys_use_pid_niceness_surrogate],
140 AC_TRY_RUN([#include <pthread.h>
141 #include <sys/types.h>
143 @@ -1651,10 +1656,12 @@
144 exit (getpid()==other_pid ||
145 $posix_priority_min != $posix_priority_max);
147 - [AC_MSG_RESULT(yes)
148 - AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
150 - [AC_MSG_RESULT(no)])
151 + [ glib_cv_sys_use_pid_niceness_surrogate=yes ],
152 + [ glib_cv_sys_use_pid_niceness_surrogate=no ])
154 + if test x"$glib_cv_sys_use_pid_niceness_surrogate" = xyes; then
155 + AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
157 elif test x"$have_threads" = xwin32; then
158 # It's a pointer to a private struct
159 GLIB_SIZEOF(,struct _GThreadData *, system_thread)
160 @@ -1717,12 +1724,14 @@
161 dnl ****************************************
162 dnl *** GLib POLL* compatibility defines ***
163 dnl ****************************************
164 +if test x"$cross_compiling" != xyes; then
166 [#include <sys/types.h>
167 #include <sys/poll.h>],
168 POLLIN:1 POLLOUT:4 POLLPRI:2 POLLERR:8 POLLHUP:16 POLLNVAL:32,
169 glibconfig-sysdefs.h,
173 dnl **********************
174 dnl *** Win32 API libs ***