]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glib-2.0/glib-2.0-2.2.3/configure.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glib-2.0 / glib-2.0-2.2.3 / configure.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 --- glib-2.1.3/configure.in~configure
7 +++ glib-2.1.3/configure.in
8 @@ -15,7 +15,9 @@
9  cflags_set=${CFLAGS+set}
10  
11  # we rewrite this file
12 +if "x$cross_compiling" != xyes; then
13  rm -f glibconfig-sysdefs.h
14 +fi
15  
16  GLIB_AC_DIVERT_BEFORE_HELP([
17  #
18 @@ -402,10 +404,13 @@
19    fi
20  fi
21  
22 +AC_CHECK_LIBM
23 +LIBS="$LIBS $LIBM"
24 +
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])
27  glib_save_LIBS=$LIBS
28 -LIBS="$LIBS -lm"
29 +#LIBS="$LIBS -lm"
30  AC_TRY_RUN([#include <math.h>
31               int main (void) { return (log(1) != log(1.)); }],
32       AC_MSG_RESULT(none needed),
33 @@ -417,8 +422,10 @@
34           AC_MSG_RESULT()
35           CFLAGS=$glib_save_CFLAGS
36           AC_MSG_WARN(
37 -                [No ANSI prototypes found in library. (-std1 didn't work.)])
38 -     )
39 +               [No ANSI prototypes found in library. (-std1 didn't work.)]),
40 +        AC_MSG_RESULT()
41 +      ),
42 +      AC_MSG_RESULT([assuming none needed])
43  )
44  LIBS=$glib_save_LIBS
45  
46 @@ -844,18 +851,18 @@
47  dnl *** strlcpy/strlcat                  ***
48  dnl ****************************************
49  # Check for strlcpy
50 -AC_MSG_CHECKING(for OpenBSD strlcpy/strlcat)
51 -AC_TRY_RUN([
52 -#include <string.h>
53 -int main() {
54 -  char *p = malloc (10);
55 -  (void) strlcpy (p, "hi", 10);
56 -  if (strlcat (p, "bye", 0) != 3) 
57 -    exit (1);
58 -  return 0;
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],
63 +       AC_TRY_RUN([
64 +       #include <string.h>
65 +       int main() {
66 +         char *p = malloc (10);
67 +         (void) strlcpy (p, "hi", 10);
68 +         if (strlcat (p, "bye", 0) != 3) 
69 +           exit (1);
70 +         return 0;
71 +       }], glib_cv_strlcpy=yes, glib_cv_strlcpy=no)
72 +)
73 +if test "x$glib_cv_strlcpy" = xyes; then
74      AC_DEFINE(HAVE_STRLCPY,1,[Have functions strlcpy and strlcat])
75  fi
76    
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>],[
83                   int check_me = 0;
84                   void* func(void* data) {return check_me = 42;}
85 -                 main()
86 -                 { pthread_t t; 
87 +                   pthread_t t; 
88                     void *ret;
89                     pthread_create (&t, 0, func, 0);
90                     pthread_join (t, &ret);
91                     exit (check_me != 42 || ret != 42);
92 -                  }],
93 +                  ],
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"
99                         
100                         AC_MSG_CHECKING(for pthread_create/pthread_join$IN)
101 -                       AC_TRY_RUN([#include <pthread.h> 
102 +                       AC_TRY_LINK([#include <pthread.h>],[ 
103                                 int check_me = 0;
104                                 void* func(void* data) {check_me = 42;}
105 -                                main()
106 -                               { pthread_t t; 
107 +                                 pthread_t t; 
108                                   void *ret;
109                                   pthread_create (&t, $defattr, func, 0);
110                                   pthread_join (t, &ret);
111                                   exit (check_me != 42);
112 -                               }],
113 +                               ],
114                                 [AC_MSG_RESULT(yes)
115                                 G_THREAD_LIBS="$add_thread_lib"
116                                 break],
117 @@ -1466,12 +1471,11 @@
118             LIBS="$glib_save_LIBS $add_thread_lib"
119         
120              AC_MSG_CHECKING(for sched_get_priority_min$IN)
121 -           AC_TRY_RUN([#include <sched.h>
122 -                       #include <errno.h>
123 -                       int main() {
124 +           AC_TRY_LINK([#include <sched.h>
125 +                       #include <errno.h>],[
126                           errno = 0;
127                            return sched_get_priority_min(SCHED_OTHER)==-1
128 -                               && errno != 0;}],
129 +                               && errno != 0;],
130                         [AC_MSG_RESULT(yes)
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"
136  
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>
142                         #include <unistd.h>
143 @@ -1651,10 +1656,12 @@
144                           exit (getpid()==other_pid || 
145                                 $posix_priority_min != $posix_priority_max);
146                         }],
147 -                       [AC_MSG_RESULT(yes)
148 -                         AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
149 -                        ],
150 -                       [AC_MSG_RESULT(no)])
151 +                       [ glib_cv_sys_use_pid_niceness_surrogate=yes ],
152 +                       [ glib_cv_sys_use_pid_niceness_surrogate=no ])
153 +               )
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])
156 +               fi
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
165  GLIB_SYSDEFS(
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,
170         =)
171 +fi
172  
173  dnl **********************
174  dnl *** Win32 API libs ***