aboutsummaryrefslogtreecommitdiffstats
path: root/packages/glib-2.0/glib-2.0-2.2.3/configure.patch
blob: f6a04e34c53a9ca03e00125a5208bc57d3799494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

--- glib-2.1.3/configure.in~configure
+++ glib-2.1.3/configure.in
@@ -15,7 +15,9 @@
 cflags_set=${CFLAGS+set}
 
 # we rewrite this file
+if "x$cross_compiling" != xyes; then
 rm -f glibconfig-sysdefs.h
+fi
 
 GLIB_AC_DIVERT_BEFORE_HELP([
 #
@@ -402,10 +404,13 @@
   fi
 fi
 
+AC_CHECK_LIBM
+LIBS="$LIBS $LIBM"
+
 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
 glib_save_LIBS=$LIBS
-LIBS="$LIBS -lm"
+#LIBS="$LIBS -lm"
 AC_TRY_RUN([#include <math.h>
              int main (void) { return (log(1) != log(1.)); }],
      AC_MSG_RESULT(none needed),
@@ -417,8 +422,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_RESULT()
+      ),
+      AC_MSG_RESULT([assuming none needed])
 )
 LIBS=$glib_save_LIBS
 
@@ -844,18 +851,18 @@
 dnl *** strlcpy/strlcat                  ***
 dnl ****************************************
 # Check for strlcpy
-AC_MSG_CHECKING(for OpenBSD strlcpy/strlcat)
-AC_TRY_RUN([
-#include <string.h>
-int main() {
-  char *p = malloc (10);
-  (void) strlcpy (p, "hi", 10);
-  if (strlcat (p, "bye", 0) != 3) 
-    exit (1);
-  return 0;
-}], glib_ok=yes, glib_ok=no)
-AC_MSG_RESULT($glib_ok)
-if test "$glib_ok" = "yes"; then
+AC_CACHE_CHECK([for OpenBSD strlcpy/strlcat],[glib_cv_strlcpy],
+	AC_TRY_RUN([
+	#include <string.h>
+	int main() {
+	  char *p = malloc (10);
+	  (void) strlcpy (p, "hi", 10);
+	  if (strlcat (p, "bye", 0) != 3) 
+	    exit (1);
+	  return 0;
+	}], glib_cv_strlcpy=yes, glib_cv_strlcpy=no)
+)
+if test "x$glib_cv_strlcpy" = xyes; then
     AC_DEFINE(HAVE_STRLCPY,1,[Have functions strlcpy and strlcat])
 fi
   
@@ -1302,16 +1309,15 @@
     for flag in pthread pthreads; do
       glib_save_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -$flag"
-      AC_TRY_RUN([#include <pthread.h> 
+      AC_TRY_LINK([#include <pthread.h>],[
 	          int check_me = 0;
 		  void* func(void* data) {return check_me = 42;}
-		  main()
-		  { pthread_t t; 
+		    pthread_t t; 
 		    void *ret;
 		    pthread_create (&t, 0, func, 0);
 		    pthread_join (t, &ret);
 		    exit (check_me != 42 || ret != 42);
-		   }],
+		   ],
 		   [G_THREAD_CFLAGS=-$flag
 		    G_THREAD_LIBS=-$flag])
       CFLAGS="$glib_save_CFLAGS"
@@ -1431,16 +1437,15 @@
 			LIBS="$glib_save_LIBS $add_thread_lib"
 			
 			AC_MSG_CHECKING(for pthread_create/pthread_join$IN)
-			AC_TRY_RUN([#include <pthread.h> 
+			AC_TRY_LINK([#include <pthread.h>],[ 
 				int check_me = 0;
 				void* func(void* data) {check_me = 42;}
-                                main()
-				{ pthread_t t; 
+				  pthread_t t; 
 				  void *ret;
 				  pthread_create (&t, $defattr, func, 0);
 				  pthread_join (t, &ret);
 				  exit (check_me != 42);
-				}],
+				],
 				[AC_MSG_RESULT(yes)
 				G_THREAD_LIBS="$add_thread_lib"
 				break],
@@ -1466,12 +1471,11 @@
 	    LIBS="$glib_save_LIBS $add_thread_lib"
 	
             AC_MSG_CHECKING(for sched_get_priority_min$IN)
-	    AC_TRY_RUN([#include <sched.h>
-		        #include <errno.h>
-		        int main() {
+	    AC_TRY_LINK([#include <sched.h>
+		        #include <errno.h>],[
     			  errno = 0;
                           return sched_get_priority_min(SCHED_OTHER)==-1
-			 	&& errno != 0;}],
+			 	&& errno != 0;],
 	 		[AC_MSG_RESULT(yes)
 		 	 G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib"
 			 posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
@@ -1636,7 +1640,8 @@
 		AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
 		CPPFLAGS="$glib_save_CPPFLAGS"
 
-		AC_MSG_CHECKING(whether to use the PID niceness surrogate for thread priorities)
+		AC_CACHE_CHECK([whether to use the PID niceness surrogate for thread priorities],
+		[glib_cv_sys_use_pid_niceness_surrogate],
 		AC_TRY_RUN([#include <pthread.h> 
 			#include <sys/types.h>
 			#include <unistd.h>
@@ -1651,10 +1656,12 @@
 			  exit (getpid()==other_pid || 
 				$posix_priority_min != $posix_priority_max);
 			}],
-			[AC_MSG_RESULT(yes)
-			  AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
-                        ],
-			[AC_MSG_RESULT(no)])
+			[ glib_cv_sys_use_pid_niceness_surrogate=yes ],
+			[ glib_cv_sys_use_pid_niceness_surrogate=no ])
+		)
+		if test x"$glib_cv_sys_use_pid_niceness_surrogate" = xyes; then
+			AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
+		fi
 	elif test x"$have_threads" = xwin32; then
 		# It's a pointer to a private struct
 		GLIB_SIZEOF(,struct _GThreadData *, system_thread)
@@ -1717,12 +1724,14 @@
 dnl ****************************************
 dnl *** GLib POLL* compatibility defines ***
 dnl ****************************************
+if test x"$cross_compiling" != xyes; then
 GLIB_SYSDEFS(
 [#include <sys/types.h>
 #include <sys/poll.h>],
 	POLLIN:1 POLLOUT:4 POLLPRI:2 POLLERR:8 POLLHUP:16 POLLNVAL:32,
 	glibconfig-sysdefs.h,
 	=)
+fi
 
 dnl **********************
 dnl *** Win32 API libs ***