update to 2.32.1
[pkgsrcv2.git] / devel / glib2 / patches / patch-aa
1 $NetBSD$
2
3 --- configure.orig      2012-03-24 03:02:40.000000000 +0000
4 +++ configure
5 @@ -697,6 +697,7 @@ GIO
6  GSPAWN
7  GLIB_DEBUG_FLAGS
8  G_MODULE_NEED_USCORE
9 +G_MODULE_BROKEN_DLOPEN_NULL
10  G_MODULE_BROKEN_RTLD_GLOBAL
11  G_MODULE_HAVE_DLERROR
12  G_MODULE_LDFLAGS
13 @@ -22442,8 +22443,8 @@ else
14  fi
15  
16  
17 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler" >&5
18 -$as_echo_n "checking whether using Sun Studio C compiler... " >&6; }
19 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler visibilily" >&5
20 +$as_echo_n "checking whether using Sun Studio C compiler visibilily... " >&6; }
21  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22  /* end confdefs.h.  */
23  #if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
24 @@ -24038,16 +24039,48 @@ fi
25  
26  case $host in
27    *-*-solaris* )
28 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler with C99" >&5
29 +$as_echo_n "checking whether using Sun Studio C compiler with C99... " >&6; }
30 +    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31 +/* end confdefs.h.  */
32 +#if defined(__STDC_VERSION__) || (__STDC_VERSION__ - 0 >= 199901L)
33 +#else
34 +# include "error: this is STD C99."
35 +#endif
36 +
37 +int
38 +main ()
39 +{
40 +
41 +  ;
42 +  return 0;
43 +}
44 +_ACEOF
45 +if ac_fn_c_try_compile "$LINENO"; then :
46 +   g_have_sunstudio_c99=yes
47 +else
48 +   g_have_sunstudio_c99=no
49 +fi
50 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $g_have_sunstudio_c99" >&5
52 +$as_echo "$g_have_sunstudio_c99" >&6; }
53 +    if test $g_have_sunstudio_c99 = yes; then
54 +
55 +$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
56 +
57 +    else
58  
59  $as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
60  
61  
62  $as_echo "#define _XOPEN_SOURCE 2" >>confdefs.h
63  
64 +    fi
65 +
66  
67  $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
68  
69 -     ;;
70 +    ;;
71  esac
72  
73  if test "$ac_cv_func_statfs" = yes ; then
74 @@ -25040,10 +25073,11 @@ if test x"$glib_native_win32" = xyes; th
75      G_MODULE_LDFLAGS=
76  else
77    export SED
78 -  G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
79 +  G_MODULE_LDFLAGS=`(libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
80  fi
81  G_MODULE_NEED_USCORE=0
82  G_MODULE_BROKEN_RTLD_GLOBAL=0
83 +G_MODULE_BROKEN_DLOPEN_NULL=0
84  G_MODULE_HAVE_DLERROR=0
85  if test -z "$G_MODULE_IMPL"; then
86    case "$host" in
87 @@ -25250,13 +25284,13 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
88         LIBS="$G_MODULE_LIBS $LIBS"
89         LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
90         echo "void glib_plugin_test(void) { }" > plugin.c
91 -       ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
92 +       ${SHELL} libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
93                 ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
94 -       ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
95 +       ${SHELL} libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
96                 ${LDFLAGS} -module -o plugin.la -export-dynamic \
97                 -shrext ".o" -avoid-version plugin.lo \
98                 -rpath /dont/care >/dev/null 2>&1
99 -       eval `./libtool --config | grep ^objdir`
100 +       eval `libtool --config | grep ^objdir`
101         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL brokenness" >&5
102  $as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; }
103  if ${glib_cv_rtldglobal_broken+:} false; then :
104 @@ -25365,6 +25399,56 @@ fi
105  
106         LIBS="$LIBS_orig"
107  fi
108 +       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen(NULL, 0) brokenness" >&5
109 +$as_echo_n "checking for dlopen(NULL, 0) brokenness... " >&6; }
110 +if test "${glib_cv_dlopennull_broken+set}" = set; then :
111 +  $as_echo_n "(cached) " >&6
112 +else
113 +
114 +               if test "$cross_compiling" = yes; then :
115 +  glib_cv_dlopennull_broken=no
116 +else
117 +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
118 +/* end confdefs.h.  */
119 +
120 +#include <stdio.h>
121 +#include <dlfcn.h>
122 +#ifndef RTLD_GLOBAL
123 +#  define RTLD_GLOBAL 0
124 +#endif
125 +#ifndef RTLD_LAZY
126 +#  define RTLD_LAZY 0
127 +#endif
128 +int gettext;
129 +int main () {
130 +    void *handle;
131 +    handle = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
132 +    if (!handle) return 0;
133 +    handle = dlopen (NULL, 0);
134 +    if (!handle) return 0;
135 +    handle = dlsym (handle, "sin");
136 +    return handle == NULL;
137 +}
138 +
139 +_ACEOF
140 +if ac_fn_c_try_run "$LINENO"; then :
141 +  glib_cv_dlopennull_broken=no
142 +else
143 +  glib_cv_dlopennull_broken=yes
144 +fi
145 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
146 +  conftest.$ac_objext conftest.beam conftest.$ac_ext
147 +fi
148 +
149 +
150 +fi
151 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_dlopennull_broken" >&5
152 +$as_echo "$glib_cv_dlopennull_broken" >&6; }
153 +       if test "x$glib_cv_dlopennull_broken" = "xyes"; then
154 +               G_MODULE_BROKEN_DLOPEN_NULL=1
155 +       else
156 +               G_MODULE_BROKEN_DLOPEN_NULL=0
157 +       fi
158  if test -z "$G_MODULE_IMPL"; then
159         G_MODULE_IMPL=0
160          G_MODULE_SUPPORTED=false
161 @@ -25375,7 +25459,7 @@ fi
162  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module shared libraries" >&5
163  $as_echo_n "checking for the suffix of module shared libraries... " >&6; }
164  export SED
165 -shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
166 +shrext_cmds=`libtool --config | grep '^shrext_cmds='`
167  eval $shrext_cmds
168  module=yes eval std_shrext=$shrext_cmds
169  # chop the initial dot
170 @@ -25399,6 +25483,8 @@ fi
171  
172  
173  
174 +
175 +
176  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" >&5
177  $as_echo_n "checking for gspawn implementation... " >&6; }
178  case "$host" in
179 @@ -26147,62 +26233,6 @@ if test x"$have_threads" = xposix; then
180        G_THREAD_LIBS="-lpthread -lthread"
181        ;;
182      *)
183 -      for flag in pthread pthreads mt; do
184 -        glib_save_CFLAGS="$CFLAGS"
185 -        CFLAGS="$CFLAGS -$flag"
186 -        if test "$cross_compiling" = yes; then :
187 -  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
188 -/* end confdefs.h.  */
189 -
190 -#include <pthread.h>
191 -int check_me = 0;
192 -void* func(void* data) {check_me = 42; return &check_me;}
193 -int main()
194 - { pthread_t t;
195 -   void *ret;
196 -   pthread_create (&t, 0, func, 0);
197 -   pthread_join (t, &ret);
198 -   return (check_me != 42 || ret != &check_me);
199 -}
200 -_ACEOF
201 -if ac_fn_c_try_link "$LINENO"; then :
202 -  glib_flag_works=yes
203 -else
204 -  glib_flag_works=no
205 -fi
206 -rm -f core conftest.err conftest.$ac_objext \
207 -    conftest$ac_exeext conftest.$ac_ext
208 -else
209 -  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
210 -/* end confdefs.h.  */
211 -
212 -#include <pthread.h>
213 -int check_me = 0;
214 -void* func(void* data) {check_me = 42; return &check_me;}
215 -int main()
216 - { pthread_t t;
217 -   void *ret;
218 -   pthread_create (&t, 0, func, 0);
219 -   pthread_join (t, &ret);
220 -   return (check_me != 42 || ret != &check_me);
221 -}
222 -_ACEOF
223 -if ac_fn_c_try_run "$LINENO"; then :
224 -  glib_flag_works=yes
225 -else
226 -  glib_flag_works=no
227 -fi
228 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
229 -  conftest.$ac_objext conftest.beam conftest.$ac_ext
230 -fi
231 -
232 -        CFLAGS="$glib_save_CFLAGS"
233 -        if test $glib_flag_works = yes ; then
234 -           G_THREAD_CFLAGS=-$flag
235 -        G_THREAD_LIBS=-$flag
236 -        break;
237 -        fi
238 -      done
239         ;;
240    esac
241  fi