| 1 | Taken from http://bugs.gentoo.org/127866 |
| 2 | Index: m4/glib.m4 |
| 3 | =================================================================== |
| 4 | --- /dev/null |
| 5 | +++ m4/glib.m4 |
| 6 | @@ -0,0 +1,196 @@ |
| 7 | +# Configure paths for GLIB |
| 8 | +# Owen Taylor 97-11-3 |
| 9 | + |
| 10 | +dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
| 11 | +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or |
| 12 | +dnl gthread is specified in MODULES, pass to glib-config |
| 13 | +dnl |
| 14 | +AC_DEFUN([AM_PATH_GLIB], |
| 15 | +[dnl |
| 16 | +dnl Get the cflags and libraries from the glib-config script |
| 17 | +dnl |
| 18 | +AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], |
| 19 | + glib_config_prefix="$withval", glib_config_prefix="") |
| 20 | +AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], |
| 21 | + glib_config_exec_prefix="$withval", glib_config_exec_prefix="") |
| 22 | +AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], |
| 23 | + , enable_glibtest=yes) |
| 24 | + |
| 25 | + if test x$glib_config_exec_prefix != x ; then |
| 26 | + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" |
| 27 | + if test x${GLIB_CONFIG+set} != xset ; then |
| 28 | + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config |
| 29 | + fi |
| 30 | + fi |
| 31 | + if test x$glib_config_prefix != x ; then |
| 32 | + glib_config_args="$glib_config_args --prefix=$glib_config_prefix" |
| 33 | + if test x${GLIB_CONFIG+set} != xset ; then |
| 34 | + GLIB_CONFIG=$glib_config_prefix/bin/glib-config |
| 35 | + fi |
| 36 | + fi |
| 37 | + |
| 38 | + for module in . $4 |
| 39 | + do |
| 40 | + case "$module" in |
| 41 | + gmodule) |
| 42 | + glib_config_args="$glib_config_args gmodule" |
| 43 | + ;; |
| 44 | + gthread) |
| 45 | + glib_config_args="$glib_config_args gthread" |
| 46 | + ;; |
| 47 | + esac |
| 48 | + done |
| 49 | + |
| 50 | + AC_PATH_PROG(GLIB_CONFIG, glib-config, no) |
| 51 | + min_glib_version=ifelse([$1], ,0.99.7,$1) |
| 52 | + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) |
| 53 | + no_glib="" |
| 54 | + if test "$GLIB_CONFIG" = "no" ; then |
| 55 | + no_glib=yes |
| 56 | + else |
| 57 | + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` |
| 58 | + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` |
| 59 | + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ |
| 60 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
| 61 | + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ |
| 62 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
| 63 | + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ |
| 64 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
| 65 | + if test "x$enable_glibtest" = "xyes" ; then |
| 66 | + ac_save_CFLAGS="$CFLAGS" |
| 67 | + ac_save_LIBS="$LIBS" |
| 68 | + CFLAGS="$CFLAGS $GLIB_CFLAGS" |
| 69 | + LIBS="$GLIB_LIBS $LIBS" |
| 70 | +dnl |
| 71 | +dnl Now check if the installed GLIB is sufficiently new. (Also sanity |
| 72 | +dnl checks the results of glib-config to some extent |
| 73 | +dnl |
| 74 | + rm -f conf.glibtest |
| 75 | + AC_TRY_RUN([ |
| 76 | +#include <glib.h> |
| 77 | +#include <stdio.h> |
| 78 | +#include <stdlib.h> |
| 79 | + |
| 80 | +int |
| 81 | +main () |
| 82 | +{ |
| 83 | + int major, minor, micro; |
| 84 | + char *tmp_version; |
| 85 | + |
| 86 | + system ("touch conf.glibtest"); |
| 87 | + |
| 88 | + /* HP/UX 9 (%@#!) writes to sscanf strings */ |
| 89 | + tmp_version = g_strdup("$min_glib_version"); |
| 90 | + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
| 91 | + printf("%s, bad version string\n", "$min_glib_version"); |
| 92 | + exit(1); |
| 93 | + } |
| 94 | + |
| 95 | + if ((glib_major_version != $glib_config_major_version) || |
| 96 | + (glib_minor_version != $glib_config_minor_version) || |
| 97 | + (glib_micro_version != $glib_config_micro_version)) |
| 98 | + { |
| 99 | + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", |
| 100 | + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, |
| 101 | + glib_major_version, glib_minor_version, glib_micro_version); |
| 102 | + printf ("*** was found! If glib-config was correct, then it is best\n"); |
| 103 | + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); |
| 104 | + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
| 105 | + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
| 106 | + printf("*** required on your system.\n"); |
| 107 | + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); |
| 108 | + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); |
| 109 | + printf("*** before re-running configure\n"); |
| 110 | + } |
| 111 | + else if ((glib_major_version != GLIB_MAJOR_VERSION) || |
| 112 | + (glib_minor_version != GLIB_MINOR_VERSION) || |
| 113 | + (glib_micro_version != GLIB_MICRO_VERSION)) |
| 114 | + { |
| 115 | + printf("*** GLIB header files (version %d.%d.%d) do not match\n", |
| 116 | + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); |
| 117 | + printf("*** library (version %d.%d.%d)\n", |
| 118 | + glib_major_version, glib_minor_version, glib_micro_version); |
| 119 | + } |
| 120 | + else |
| 121 | + { |
| 122 | + if ((glib_major_version > major) || |
| 123 | + ((glib_major_version == major) && (glib_minor_version > minor)) || |
| 124 | + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) |
| 125 | + { |
| 126 | + return 0; |
| 127 | + } |
| 128 | + else |
| 129 | + { |
| 130 | + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", |
| 131 | + glib_major_version, glib_minor_version, glib_micro_version); |
| 132 | + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", |
| 133 | + major, minor, micro); |
| 134 | + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); |
| 135 | + printf("***\n"); |
| 136 | + printf("*** If you have already installed a sufficiently new version, this error\n"); |
| 137 | + printf("*** probably means that the wrong copy of the glib-config shell script is\n"); |
| 138 | + printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
| 139 | + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); |
| 140 | + printf("*** correct copy of glib-config. (In this case, you will have to\n"); |
| 141 | + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
| 142 | + printf("*** so that the correct libraries are found at run-time))\n"); |
| 143 | + } |
| 144 | + } |
| 145 | + return 1; |
| 146 | +} |
| 147 | +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
| 148 | + CFLAGS="$ac_save_CFLAGS" |
| 149 | + LIBS="$ac_save_LIBS" |
| 150 | + fi |
| 151 | + fi |
| 152 | + if test "x$no_glib" = x ; then |
| 153 | + AC_MSG_RESULT(yes) |
| 154 | + ifelse([$2], , :, [$2]) |
| 155 | + else |
| 156 | + AC_MSG_RESULT(no) |
| 157 | + if test "$GLIB_CONFIG" = "no" ; then |
| 158 | + echo "*** The glib-config script installed by GLIB could not be found" |
| 159 | + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" |
| 160 | + echo "*** your path, or set the GLIB_CONFIG environment variable to the" |
| 161 | + echo "*** full path to glib-config." |
| 162 | + else |
| 163 | + if test -f conf.glibtest ; then |
| 164 | + : |
| 165 | + else |
| 166 | + echo "*** Could not run GLIB test program, checking why..." |
| 167 | + CFLAGS="$CFLAGS $GLIB_CFLAGS" |
| 168 | + LIBS="$LIBS $GLIB_LIBS" |
| 169 | + AC_TRY_LINK([ |
| 170 | +#include <glib.h> |
| 171 | +#include <stdio.h> |
| 172 | +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], |
| 173 | + [ echo "*** The test program compiled, but did not run. This usually means" |
| 174 | + echo "*** that the run-time linker is not finding GLIB or finding the wrong" |
| 175 | + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" |
| 176 | + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
| 177 | + echo "*** to the installed location Also, make sure you have run ldconfig if that" |
| 178 | + echo "*** is required on your system" |
| 179 | + echo "***" |
| 180 | + echo "*** If you have an old version installed, it is best to remove it, although" |
| 181 | + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
| 182 | + echo "***" |
| 183 | + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
| 184 | + echo "*** came with the system with the command" |
| 185 | + echo "***" |
| 186 | + echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
| 187 | + [ echo "*** The test program failed to compile or link. See the file config.log for the" |
| 188 | + echo "*** exact error that occured. This usually means GLIB was incorrectly installed" |
| 189 | + echo "*** or that you have moved GLIB since it was installed. In the latter case, you" |
| 190 | + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) |
| 191 | + CFLAGS="$ac_save_CFLAGS" |
| 192 | + LIBS="$ac_save_LIBS" |
| 193 | + fi |
| 194 | + fi |
| 195 | + GLIB_CFLAGS="" |
| 196 | + GLIB_LIBS="" |
| 197 | + ifelse([$3], , :, [$3]) |
| 198 | + fi |
| 199 | + AC_SUBST(GLIB_CFLAGS) |
| 200 | + AC_SUBST(GLIB_LIBS) |
| 201 | + rm -f conf.glibtest |
| 202 | +]) |
| 203 | Index: m4/gtk.m4 |
| 204 | =================================================================== |
| 205 | --- /dev/null |
| 206 | +++ m4/gtk.m4 |
| 207 | @@ -0,0 +1,194 @@ |
| 208 | +# Configure paths for GTK+ |
| 209 | +# Owen Taylor 97-11-3 |
| 210 | + |
| 211 | +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
| 212 | +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
| 213 | +dnl |
| 214 | +AC_DEFUN([AM_PATH_GTK], |
| 215 | +[dnl |
| 216 | +dnl Get the cflags and libraries from the gtk-config script |
| 217 | +dnl |
| 218 | +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], |
| 219 | + gtk_config_prefix="$withval", gtk_config_prefix="") |
| 220 | +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], |
| 221 | + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") |
| 222 | +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
| 223 | + , enable_gtktest=yes) |
| 224 | + |
| 225 | + for module in . $4 |
| 226 | + do |
| 227 | + case "$module" in |
| 228 | + gthread) |
| 229 | + gtk_config_args="$gtk_config_args gthread" |
| 230 | + ;; |
| 231 | + esac |
| 232 | + done |
| 233 | + |
| 234 | + if test x$gtk_config_exec_prefix != x ; then |
| 235 | + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
| 236 | + if test x${GTK_CONFIG+set} != xset ; then |
| 237 | + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config |
| 238 | + fi |
| 239 | + fi |
| 240 | + if test x$gtk_config_prefix != x ; then |
| 241 | + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" |
| 242 | + if test x${GTK_CONFIG+set} != xset ; then |
| 243 | + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config |
| 244 | + fi |
| 245 | + fi |
| 246 | + |
| 247 | + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) |
| 248 | + min_gtk_version=ifelse([$1], ,0.99.7,$1) |
| 249 | + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
| 250 | + no_gtk="" |
| 251 | + if test "$GTK_CONFIG" = "no" ; then |
| 252 | + no_gtk=yes |
| 253 | + else |
| 254 | + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` |
| 255 | + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` |
| 256 | + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ |
| 257 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
| 258 | + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ |
| 259 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
| 260 | + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ |
| 261 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
| 262 | + if test "x$enable_gtktest" = "xyes" ; then |
| 263 | + ac_save_CFLAGS="$CFLAGS" |
| 264 | + ac_save_LIBS="$LIBS" |
| 265 | + CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 266 | + LIBS="$GTK_LIBS $LIBS" |
| 267 | +dnl |
| 268 | +dnl Now check if the installed GTK is sufficiently new. (Also sanity |
| 269 | +dnl checks the results of gtk-config to some extent |
| 270 | +dnl |
| 271 | + rm -f conf.gtktest |
| 272 | + AC_TRY_RUN([ |
| 273 | +#include <gtk/gtk.h> |
| 274 | +#include <stdio.h> |
| 275 | +#include <stdlib.h> |
| 276 | + |
| 277 | +int |
| 278 | +main () |
| 279 | +{ |
| 280 | + int major, minor, micro; |
| 281 | + char *tmp_version; |
| 282 | + |
| 283 | + system ("touch conf.gtktest"); |
| 284 | + |
| 285 | + /* HP/UX 9 (%@#!) writes to sscanf strings */ |
| 286 | + tmp_version = g_strdup("$min_gtk_version"); |
| 287 | + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
| 288 | + printf("%s, bad version string\n", "$min_gtk_version"); |
| 289 | + exit(1); |
| 290 | + } |
| 291 | + |
| 292 | + if ((gtk_major_version != $gtk_config_major_version) || |
| 293 | + (gtk_minor_version != $gtk_config_minor_version) || |
| 294 | + (gtk_micro_version != $gtk_config_micro_version)) |
| 295 | + { |
| 296 | + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
| 297 | + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
| 298 | + gtk_major_version, gtk_minor_version, gtk_micro_version); |
| 299 | + printf ("*** was found! If gtk-config was correct, then it is best\n"); |
| 300 | + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
| 301 | + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
| 302 | + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
| 303 | + printf("*** required on your system.\n"); |
| 304 | + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); |
| 305 | + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
| 306 | + printf("*** before re-running configure\n"); |
| 307 | + } |
| 308 | +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
| 309 | + else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
| 310 | + (gtk_minor_version != GTK_MINOR_VERSION) || |
| 311 | + (gtk_micro_version != GTK_MICRO_VERSION)) |
| 312 | + { |
| 313 | + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
| 314 | + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
| 315 | + printf("*** library (version %d.%d.%d)\n", |
| 316 | + gtk_major_version, gtk_minor_version, gtk_micro_version); |
| 317 | + } |
| 318 | +#endif /* defined (GTK_MAJOR_VERSION) ... */ |
| 319 | + else |
| 320 | + { |
| 321 | + if ((gtk_major_version > major) || |
| 322 | + ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
| 323 | + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
| 324 | + { |
| 325 | + return 0; |
| 326 | + } |
| 327 | + else |
| 328 | + { |
| 329 | + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
| 330 | + gtk_major_version, gtk_minor_version, gtk_micro_version); |
| 331 | + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
| 332 | + major, minor, micro); |
| 333 | + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
| 334 | + printf("***\n"); |
| 335 | + printf("*** If you have already installed a sufficiently new version, this error\n"); |
| 336 | + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); |
| 337 | + printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
| 338 | + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); |
| 339 | + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); |
| 340 | + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
| 341 | + printf("*** so that the correct libraries are found at run-time))\n"); |
| 342 | + } |
| 343 | + } |
| 344 | + return 1; |
| 345 | +} |
| 346 | +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
| 347 | + CFLAGS="$ac_save_CFLAGS" |
| 348 | + LIBS="$ac_save_LIBS" |
| 349 | + fi |
| 350 | + fi |
| 351 | + if test "x$no_gtk" = x ; then |
| 352 | + AC_MSG_RESULT(yes) |
| 353 | + ifelse([$2], , :, [$2]) |
| 354 | + else |
| 355 | + AC_MSG_RESULT(no) |
| 356 | + if test "$GTK_CONFIG" = "no" ; then |
| 357 | + echo "*** The gtk-config script installed by GTK could not be found" |
| 358 | + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" |
| 359 | + echo "*** your path, or set the GTK_CONFIG environment variable to the" |
| 360 | + echo "*** full path to gtk-config." |
| 361 | + else |
| 362 | + if test -f conf.gtktest ; then |
| 363 | + : |
| 364 | + else |
| 365 | + echo "*** Could not run GTK test program, checking why..." |
| 366 | + CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 367 | + LIBS="$LIBS $GTK_LIBS" |
| 368 | + AC_TRY_LINK([ |
| 369 | +#include <gtk/gtk.h> |
| 370 | +#include <stdio.h> |
| 371 | +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
| 372 | + [ echo "*** The test program compiled, but did not run. This usually means" |
| 373 | + echo "*** that the run-time linker is not finding GTK or finding the wrong" |
| 374 | + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" |
| 375 | + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
| 376 | + echo "*** to the installed location Also, make sure you have run ldconfig if that" |
| 377 | + echo "*** is required on your system" |
| 378 | + echo "***" |
| 379 | + echo "*** If you have an old version installed, it is best to remove it, although" |
| 380 | + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
| 381 | + echo "***" |
| 382 | + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
| 383 | + echo "*** came with the system with the command" |
| 384 | + echo "***" |
| 385 | + echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
| 386 | + [ echo "*** The test program failed to compile or link. See the file config.log for the" |
| 387 | + echo "*** exact error that occured. This usually means GTK was incorrectly installed" |
| 388 | + echo "*** or that you have moved GTK since it was installed. In the latter case, you" |
| 389 | + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) |
| 390 | + CFLAGS="$ac_save_CFLAGS" |
| 391 | + LIBS="$ac_save_LIBS" |
| 392 | + fi |
| 393 | + fi |
| 394 | + GTK_CFLAGS="" |
| 395 | + GTK_LIBS="" |
| 396 | + ifelse([$3], , :, [$3]) |
| 397 | + fi |
| 398 | + AC_SUBST(GTK_CFLAGS) |
| 399 | + AC_SUBST(GTK_LIBS) |
| 400 | + rm -f conf.gtktest |
| 401 | +]) |
| 402 | Index: m4/socklen.m4 |
| 403 | =================================================================== |
| 404 | --- /dev/null |
| 405 | +++ m4/socklen.m4 |
| 406 | @@ -0,0 +1,23 @@ |
| 407 | +################################################################### |
| 408 | +## To: autoconf@gnu.org |
| 409 | +## Subject: socklen_t |
| 410 | +## From: lars brinkhoff <lars@nocrew.org> |
| 411 | +## Date: 26 Mar 1999 11:38:09 +0100 |
| 412 | +## |
| 413 | +## Here's an attempt at a check for socklen_t. AC_CHECK_TYPE doesn't |
| 414 | +## work because it doesn't search <sys/socket.h>. Maybe that macro |
| 415 | +## should be changed instead. |
| 416 | +## |
| 417 | +AC_DEFUN(AC_TYPE_SOCKLEN_T, |
| 418 | +[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, |
| 419 | +[ |
| 420 | + AC_TRY_COMPILE( |
| 421 | + [#include <sys/socket.h>], |
| 422 | + [socklen_t len = 42; return len;], |
| 423 | + ac_cv_type_socklen_t=yes, |
| 424 | + ac_cv_type_socklen_t=no) |
| 425 | +]) |
| 426 | + if test $ac_cv_type_socklen_t != yes; then |
| 427 | + AC_DEFINE(socklen_t, int) |
| 428 | + fi |
| 429 | +]) |