aclocal.m4 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. dnl aclocal.m4 generated automatically by aclocal 1.4
  2. dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl This program is distributed in the hope that it will be useful,
  7. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. dnl PARTICULAR PURPOSE.
  10. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  11. AC_DEFUN(AM_CONFIG_HEADER,
  12. [AC_PREREQ([2.12])
  13. AC_CONFIG_HEADER([$1])
  14. dnl When config.status generates a header, we must update the stamp-h file.
  15. dnl This file resides in the same directory as the config header
  16. dnl that is generated. We must strip everything past the first ":",
  17. dnl and everything past the last "/".
  18. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  19. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  20. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  21. <<am_indx=1
  22. for am_file in <<$1>>; do
  23. case " <<$>>CONFIG_HEADERS " in
  24. *" <<$>>am_file "*<<)>>
  25. echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  26. ;;
  27. esac
  28. am_indx=`expr "<<$>>am_indx" + 1`
  29. done<<>>dnl>>)
  30. changequote([,]))])
  31. # Do all the work for Automake. This macro actually does too much --
  32. # some checks are only needed if your package does certain things.
  33. # But this isn't really a big deal.
  34. # serial 1
  35. dnl Usage:
  36. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  37. AC_DEFUN(AM_INIT_AUTOMAKE,
  38. [AC_REQUIRE([AC_PROG_INSTALL])
  39. PACKAGE=[$1]
  40. AC_SUBST(PACKAGE)
  41. VERSION=[$2]
  42. AC_SUBST(VERSION)
  43. dnl test to see if srcdir already configured
  44. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  45. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  46. fi
  47. ifelse([$3],,
  48. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  49. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  50. AC_REQUIRE([AM_SANITY_CHECK])
  51. AC_REQUIRE([AC_ARG_PROGRAM])
  52. dnl FIXME This is truly gross.
  53. missing_dir=`cd $ac_aux_dir && pwd`
  54. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  55. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  56. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  57. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  58. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  59. AC_REQUIRE([AC_PROG_MAKE_SET])])
  60. #
  61. # Check to make sure that the build environment is sane.
  62. #
  63. AC_DEFUN(AM_SANITY_CHECK,
  64. [AC_MSG_CHECKING([whether build environment is sane])
  65. # Just in case
  66. sleep 1
  67. echo timestamp > conftestfile
  68. # Do `set' in a subshell so we don't clobber the current shell's
  69. # arguments. Must try -L first in case configure is actually a
  70. # symlink; some systems play weird games with the mod time of symlinks
  71. # (eg FreeBSD returns the mod time of the symlink's containing
  72. # directory).
  73. if (
  74. set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  75. if test "[$]*" = "X"; then
  76. # -L didn't work.
  77. set X `ls -t $srcdir/configure conftestfile`
  78. fi
  79. if test "[$]*" != "X $srcdir/configure conftestfile" \
  80. && test "[$]*" != "X conftestfile $srcdir/configure"; then
  81. # If neither matched, then we have a broken ls. This can happen
  82. # if, for instance, CONFIG_SHELL is bash and it inherits a
  83. # broken ls alias from the environment. This has actually
  84. # happened. Such a system could not be considered "sane".
  85. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  86. alias in your environment])
  87. fi
  88. test "[$]2" = conftestfile
  89. )
  90. then
  91. # Ok.
  92. :
  93. else
  94. AC_MSG_ERROR([newly created file is older than distributed files!
  95. Check your system clock])
  96. fi
  97. rm -f conftest*
  98. AC_MSG_RESULT(yes)])
  99. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  100. dnl The program must properly implement --version.
  101. AC_DEFUN(AM_MISSING_PROG,
  102. [AC_MSG_CHECKING(for working $2)
  103. # Run test in a subshell; some versions of sh will print an error if
  104. # an executable is not found, even if stderr is redirected.
  105. # Redirect stdin to placate older versions of autoconf. Sigh.
  106. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  107. $1=$2
  108. AC_MSG_RESULT(found)
  109. else
  110. $1="$3/missing $2"
  111. AC_MSG_RESULT(missing)
  112. fi
  113. AC_SUBST($1)])
  114. #serial 1
  115. # This test replaces the one in autoconf.
  116. # Currently this macro should have the same name as the autoconf macro
  117. # because gettext's gettext.m4 (distributed in the automake package)
  118. # still uses it. Otherwise, the use in gettext.m4 makes autoheader
  119. # give these diagnostics:
  120. # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
  121. # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
  122. undefine([AC_ISC_POSIX])
  123. AC_DEFUN([AC_ISC_POSIX],
  124. [
  125. dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
  126. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
  127. ]
  128. )
  129. # serial 1
  130. # @defmac AC_PROG_CC_STDC
  131. # @maindex PROG_CC_STDC
  132. # @ovindex CC
  133. # If the C compiler in not in ANSI C mode by default, try to add an option
  134. # to output variable @code{CC} to make it so. This macro tries various
  135. # options that select ANSI C on some system or another. It considers the
  136. # compiler to be in ANSI C mode if it handles function prototypes correctly.
  137. #
  138. # If you use this macro, you should check after calling it whether the C
  139. # compiler has been set to accept ANSI C; if not, the shell variable
  140. # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
  141. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  142. # program @code{ansi2knr}, which comes with Ghostscript.
  143. # @end defmac
  144. AC_DEFUN(AM_PROG_CC_STDC,
  145. [AC_REQUIRE([AC_PROG_CC])
  146. AC_BEFORE([$0], [AC_C_INLINE])
  147. AC_BEFORE([$0], [AC_C_CONST])
  148. dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
  149. dnl a magic option to avoid problems with ANSI preprocessor commands
  150. dnl like #elif.
  151. dnl FIXME: can't do this because then AC_AIX won't work due to a
  152. dnl circular dependency.
  153. dnl AC_BEFORE([$0], [AC_PROG_CPP])
  154. AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  155. AC_CACHE_VAL(am_cv_prog_cc_stdc,
  156. [am_cv_prog_cc_stdc=no
  157. ac_save_CC="$CC"
  158. # Don't try gcc -ansi; that turns off useful extensions and
  159. # breaks some systems' header files.
  160. # AIX -qlanglvl=ansi
  161. # Ultrix and OSF/1 -std1
  162. # HP-UX -Aa -D_HPUX_SOURCE
  163. # SVR4 -Xc -D__EXTENSIONS__
  164. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  165. do
  166. CC="$ac_save_CC $ac_arg"
  167. AC_TRY_COMPILE(
  168. [#include <stdarg.h>
  169. #include <stdio.h>
  170. #include <sys/types.h>
  171. #include <sys/stat.h>
  172. /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
  173. struct buf { int x; };
  174. FILE * (*rcsopen) (struct buf *, struct stat *, int);
  175. static char *e (p, i)
  176. char **p;
  177. int i;
  178. {
  179. return p[i];
  180. }
  181. static char *f (char * (*g) (char **, int), char **p, ...)
  182. {
  183. char *s;
  184. va_list v;
  185. va_start (v,p);
  186. s = g (p, va_arg (v,int));
  187. va_end (v);
  188. return s;
  189. }
  190. int test (int i, double x);
  191. struct s1 {int (*f) (int a);};
  192. struct s2 {int (*f) (double a);};
  193. int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
  194. int argc;
  195. char **argv;
  196. ], [
  197. return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
  198. ],
  199. [am_cv_prog_cc_stdc="$ac_arg"; break])
  200. done
  201. CC="$ac_save_CC"
  202. ])
  203. if test -z "$am_cv_prog_cc_stdc"; then
  204. AC_MSG_RESULT([none needed])
  205. else
  206. AC_MSG_RESULT($am_cv_prog_cc_stdc)
  207. fi
  208. case "x$am_cv_prog_cc_stdc" in
  209. x|xno) ;;
  210. *) CC="$CC $am_cv_prog_cc_stdc" ;;
  211. esac
  212. ])
  213. # Configure paths for GLIB
  214. # Owen Taylor 97-11-3
  215. dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  216. dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
  217. dnl gthread is specified in MODULES, pass to glib-config
  218. dnl
  219. AC_DEFUN(AM_PATH_GLIB,
  220. [dnl
  221. dnl Get the cflags and libraries from the glib-config script
  222. dnl
  223. AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
  224. glib_config_prefix="$withval", glib_config_prefix="")
  225. AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
  226. glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
  227. AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
  228. , enable_glibtest=yes)
  229. if test x$glib_config_exec_prefix != x ; then
  230. glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
  231. if test x${GLIB_CONFIG+set} != xset ; then
  232. GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
  233. fi
  234. fi
  235. if test x$glib_config_prefix != x ; then
  236. glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
  237. if test x${GLIB_CONFIG+set} != xset ; then
  238. GLIB_CONFIG=$glib_config_prefix/bin/glib-config
  239. fi
  240. fi
  241. for module in . $4
  242. do
  243. case "$module" in
  244. gmodule)
  245. glib_config_args="$glib_config_args gmodule"
  246. ;;
  247. gthread)
  248. glib_config_args="$glib_config_args gthread"
  249. ;;
  250. esac
  251. done
  252. AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
  253. min_glib_version=ifelse([$1], ,0.99.7,$1)
  254. AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
  255. no_glib=""
  256. if test "$GLIB_CONFIG" = "no" ; then
  257. no_glib=yes
  258. else
  259. GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
  260. GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
  261. glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
  262. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  263. glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
  264. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  265. glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
  266. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  267. if test "x$enable_glibtest" = "xyes" ; then
  268. ac_save_CFLAGS="$CFLAGS"
  269. ac_save_LIBS="$LIBS"
  270. CFLAGS="$CFLAGS $GLIB_CFLAGS"
  271. LIBS="$GLIB_LIBS $LIBS"
  272. dnl
  273. dnl Now check if the installed GLIB is sufficiently new. (Also sanity
  274. dnl checks the results of glib-config to some extent
  275. dnl
  276. rm -f conf.glibtest
  277. AC_TRY_RUN([
  278. #include <glib.h>
  279. #include <stdio.h>
  280. #include <stdlib.h>
  281. int
  282. main ()
  283. {
  284. int major, minor, micro;
  285. char *tmp_version;
  286. system ("touch conf.glibtest");
  287. /* HP/UX 9 (%@#!) writes to sscanf strings */
  288. tmp_version = g_strdup("$min_glib_version");
  289. if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  290. printf("%s, bad version string\n", "$min_glib_version");
  291. exit(1);
  292. }
  293. if ((glib_major_version != $glib_config_major_version) ||
  294. (glib_minor_version != $glib_config_minor_version) ||
  295. (glib_micro_version != $glib_config_micro_version))
  296. {
  297. printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
  298. $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
  299. glib_major_version, glib_minor_version, glib_micro_version);
  300. printf ("*** was found! If glib-config was correct, then it is best\n");
  301. printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
  302. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  303. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  304. printf("*** required on your system.\n");
  305. printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
  306. printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
  307. printf("*** before re-running configure\n");
  308. }
  309. else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
  310. (glib_minor_version != GLIB_MINOR_VERSION) ||
  311. (glib_micro_version != GLIB_MICRO_VERSION))
  312. {
  313. printf("*** GLIB header files (version %d.%d.%d) do not match\n",
  314. GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
  315. printf("*** library (version %d.%d.%d)\n",
  316. glib_major_version, glib_minor_version, glib_micro_version);
  317. }
  318. else
  319. {
  320. if ((glib_major_version > major) ||
  321. ((glib_major_version == major) && (glib_minor_version > minor)) ||
  322. ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
  323. {
  324. return 0;
  325. }
  326. else
  327. {
  328. printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
  329. glib_major_version, glib_minor_version, glib_micro_version);
  330. printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
  331. major, minor, micro);
  332. printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
  333. printf("***\n");
  334. printf("*** If you have already installed a sufficiently new version, this error\n");
  335. printf("*** probably means that the wrong copy of the glib-config shell script is\n");
  336. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  337. printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
  338. printf("*** correct copy of glib-config. (In this case, you will have to\n");
  339. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  340. printf("*** so that the correct libraries are found at run-time))\n");
  341. }
  342. }
  343. return 1;
  344. }
  345. ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  346. CFLAGS="$ac_save_CFLAGS"
  347. LIBS="$ac_save_LIBS"
  348. fi
  349. fi
  350. if test "x$no_glib" = x ; then
  351. AC_MSG_RESULT(yes)
  352. ifelse([$2], , :, [$2])
  353. else
  354. AC_MSG_RESULT(no)
  355. if test "$GLIB_CONFIG" = "no" ; then
  356. echo "*** The glib-config script installed by GLIB could not be found"
  357. echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
  358. echo "*** your path, or set the GLIB_CONFIG environment variable to the"
  359. echo "*** full path to glib-config."
  360. else
  361. if test -f conf.glibtest ; then
  362. :
  363. else
  364. echo "*** Could not run GLIB test program, checking why..."
  365. CFLAGS="$CFLAGS $GLIB_CFLAGS"
  366. LIBS="$LIBS $GLIB_LIBS"
  367. AC_TRY_LINK([
  368. #include <glib.h>
  369. #include <stdio.h>
  370. ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
  371. [ echo "*** The test program compiled, but did not run. This usually means"
  372. echo "*** that the run-time linker is not finding GLIB or finding the wrong"
  373. echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
  374. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  375. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  376. echo "*** is required on your system"
  377. echo "***"
  378. echo "*** If you have an old version installed, it is best to remove it, although"
  379. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  380. echo "***"
  381. echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  382. echo "*** came with the system with the command"
  383. echo "***"
  384. echo "*** rpm --erase --nodeps gtk gtk-devel" ],
  385. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  386. echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
  387. echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
  388. echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
  389. CFLAGS="$ac_save_CFLAGS"
  390. LIBS="$ac_save_LIBS"
  391. fi
  392. fi
  393. GLIB_CFLAGS=""
  394. GLIB_LIBS=""
  395. ifelse([$3], , :, [$3])
  396. fi
  397. AC_SUBST(GLIB_CFLAGS)
  398. AC_SUBST(GLIB_LIBS)
  399. rm -f conf.glibtest
  400. ])
  401. # Configure paths for GTK+
  402. # Owen Taylor 97-11-3
  403. dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  404. dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
  405. dnl
  406. AC_DEFUN(AM_PATH_GTK,
  407. [dnl
  408. dnl Get the cflags and libraries from the gtk-config script
  409. dnl
  410. AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
  411. gtk_config_prefix="$withval", gtk_config_prefix="")
  412. AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
  413. gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
  414. AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
  415. , enable_gtktest=yes)
  416. for module in . $4
  417. do
  418. case "$module" in
  419. gthread)
  420. gtk_config_args="$gtk_config_args gthread"
  421. ;;
  422. esac
  423. done
  424. if test x$gtk_config_exec_prefix != x ; then
  425. gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
  426. if test x${GTK_CONFIG+set} != xset ; then
  427. GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
  428. fi
  429. fi
  430. if test x$gtk_config_prefix != x ; then
  431. gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
  432. if test x${GTK_CONFIG+set} != xset ; then
  433. GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
  434. fi
  435. fi
  436. AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  437. min_gtk_version=ifelse([$1], ,0.99.7,$1)
  438. AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
  439. no_gtk=""
  440. if test "$GTK_CONFIG" = "no" ; then
  441. no_gtk=yes
  442. else
  443. GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
  444. GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
  445. gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
  446. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  447. gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
  448. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  449. gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
  450. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  451. if test "x$enable_gtktest" = "xyes" ; then
  452. ac_save_CFLAGS="$CFLAGS"
  453. ac_save_LIBS="$LIBS"
  454. CFLAGS="$CFLAGS $GTK_CFLAGS"
  455. LIBS="$GTK_LIBS $LIBS"
  456. dnl
  457. dnl Now check if the installed GTK is sufficiently new. (Also sanity
  458. dnl checks the results of gtk-config to some extent
  459. dnl
  460. rm -f conf.gtktest
  461. AC_TRY_RUN([
  462. #include <gtk/gtk.h>
  463. #include <stdio.h>
  464. #include <stdlib.h>
  465. int
  466. main ()
  467. {
  468. int major, minor, micro;
  469. char *tmp_version;
  470. system ("touch conf.gtktest");
  471. /* HP/UX 9 (%@#!) writes to sscanf strings */
  472. tmp_version = g_strdup("$min_gtk_version");
  473. if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  474. printf("%s, bad version string\n", "$min_gtk_version");
  475. exit(1);
  476. }
  477. if ((gtk_major_version != $gtk_config_major_version) ||
  478. (gtk_minor_version != $gtk_config_minor_version) ||
  479. (gtk_micro_version != $gtk_config_micro_version))
  480. {
  481. printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
  482. $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
  483. gtk_major_version, gtk_minor_version, gtk_micro_version);
  484. printf ("*** was found! If gtk-config was correct, then it is best\n");
  485. printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
  486. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  487. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  488. printf("*** required on your system.\n");
  489. printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
  490. printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
  491. printf("*** before re-running configure\n");
  492. }
  493. #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
  494. else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
  495. (gtk_minor_version != GTK_MINOR_VERSION) ||
  496. (gtk_micro_version != GTK_MICRO_VERSION))
  497. {
  498. printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
  499. GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
  500. printf("*** library (version %d.%d.%d)\n",
  501. gtk_major_version, gtk_minor_version, gtk_micro_version);
  502. }
  503. #endif /* defined (GTK_MAJOR_VERSION) ... */
  504. else
  505. {
  506. if ((gtk_major_version > major) ||
  507. ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
  508. ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
  509. {
  510. return 0;
  511. }
  512. else
  513. {
  514. printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
  515. gtk_major_version, gtk_minor_version, gtk_micro_version);
  516. printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
  517. major, minor, micro);
  518. printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
  519. printf("***\n");
  520. printf("*** If you have already installed a sufficiently new version, this error\n");
  521. printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
  522. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  523. printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
  524. printf("*** correct copy of gtk-config. (In this case, you will have to\n");
  525. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  526. printf("*** so that the correct libraries are found at run-time))\n");
  527. }
  528. }
  529. return 1;
  530. }
  531. ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  532. CFLAGS="$ac_save_CFLAGS"
  533. LIBS="$ac_save_LIBS"
  534. fi
  535. fi
  536. if test "x$no_gtk" = x ; then
  537. AC_MSG_RESULT(yes)
  538. ifelse([$2], , :, [$2])
  539. else
  540. AC_MSG_RESULT(no)
  541. if test "$GTK_CONFIG" = "no" ; then
  542. echo "*** The gtk-config script installed by GTK could not be found"
  543. echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
  544. echo "*** your path, or set the GTK_CONFIG environment variable to the"
  545. echo "*** full path to gtk-config."
  546. else
  547. if test -f conf.gtktest ; then
  548. :
  549. else
  550. echo "*** Could not run GTK test program, checking why..."
  551. CFLAGS="$CFLAGS $GTK_CFLAGS"
  552. LIBS="$LIBS $GTK_LIBS"
  553. AC_TRY_LINK([
  554. #include <gtk/gtk.h>
  555. #include <stdio.h>
  556. ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
  557. [ echo "*** The test program compiled, but did not run. This usually means"
  558. echo "*** that the run-time linker is not finding GTK or finding the wrong"
  559. echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
  560. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  561. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  562. echo "*** is required on your system"
  563. echo "***"
  564. echo "*** If you have an old version installed, it is best to remove it, although"
  565. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  566. echo "***"
  567. echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  568. echo "*** came with the system with the command"
  569. echo "***"
  570. echo "*** rpm --erase --nodeps gtk gtk-devel" ],
  571. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  572. echo "*** exact error that occured. This usually means GTK was incorrectly installed"
  573. echo "*** or that you have moved GTK since it was installed. In the latter case, you"
  574. echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
  575. CFLAGS="$ac_save_CFLAGS"
  576. LIBS="$ac_save_LIBS"
  577. fi
  578. fi
  579. GTK_CFLAGS=""
  580. GTK_LIBS=""
  581. ifelse([$3], , :, [$3])
  582. fi
  583. AC_SUBST(GTK_CFLAGS)
  584. AC_SUBST(GTK_LIBS)
  585. rm -f conf.gtktest
  586. ])
  587. # Configure paths for gdk-pixbuf
  588. # Elliot Lee 2000-01-10
  589. # stolen from Raph Levien 98-11-18
  590. # stolen from Manish Singh 98-9-30
  591. # stolen back from Frank Belew
  592. # stolen from Manish Singh
  593. # Shamelessly stolen from Owen Taylor
  594. dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
  595. dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
  596. dnl
  597. AC_DEFUN(AM_PATH_GDK_PIXBUF,
  598. [dnl
  599. dnl Get the cflags and libraries from the gdk-pixbuf-config script
  600. dnl
  601. AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)],
  602. gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
  603. AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
  604. gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
  605. AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program],
  606. , enable_gdk_pixbuftest=yes)
  607. if test x$gdk_pixbuf_exec_prefix != x ; then
  608. gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
  609. if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
  610. GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
  611. fi
  612. fi
  613. if test x$gdk_pixbuf_prefix != x ; then
  614. gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
  615. if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
  616. GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
  617. fi
  618. fi
  619. AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
  620. min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
  621. AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
  622. no_gdk_pixbuf=""
  623. if test "$GDK_PIXBUF_CONFIG" = "no" ; then
  624. no_gdk_pixbuf=yes
  625. else
  626. GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
  627. GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
  628. gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
  629. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  630. gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
  631. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  632. gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
  633. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  634. if test "x$enable_gdk_pixbuftest" = "xyes" ; then
  635. ac_save_CFLAGS="$CFLAGS"
  636. ac_save_LIBS="$LIBS"
  637. CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
  638. LIBS="$LIBS $GDK_PIXBUF_LIBS"
  639. dnl
  640. dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
  641. dnl checks the results of gdk-pixbuf-config to some extent
  642. dnl
  643. rm -f conf.gdk_pixbuftest
  644. AC_TRY_RUN([
  645. #include <stdio.h>
  646. #include <stdlib.h>
  647. #include <string.h>
  648. #include <gdk-pixbuf/gdk-pixbuf.h>
  649. char*
  650. my_strdup (char *str)
  651. {
  652. char *new_str;
  653. if (str)
  654. {
  655. new_str = malloc ((strlen (str) + 1) * sizeof(char));
  656. strcpy (new_str, str);
  657. }
  658. else
  659. new_str = NULL;
  660. return new_str;
  661. }
  662. int main ()
  663. {
  664. int major, minor, micro;
  665. char *tmp_version;
  666. system ("touch conf.gdk_pixbuftest");
  667. /* HP/UX 9 (%@#!) writes to sscanf strings */
  668. tmp_version = my_strdup("$min_gdk_pixbuf_version");
  669. if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  670. printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
  671. exit(1);
  672. }
  673. if (($gdk_pixbuf_major_version > major) ||
  674. (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
  675. (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
  676. {
  677. return 0;
  678. }
  679. else
  680. {
  681. printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
  682. printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
  683. printf("*** best to upgrade to the required version.\n");
  684. printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
  685. printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
  686. printf("*** config.cache before re-running configure\n");
  687. return 1;
  688. }
  689. }
  690. ],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  691. CFLAGS="$ac_save_CFLAGS"
  692. LIBS="$ac_save_LIBS"
  693. fi
  694. fi
  695. if test "x$no_gdk_pixbuf" = x ; then
  696. AC_MSG_RESULT(yes)
  697. ifelse([$2], , :, [$2])
  698. else
  699. AC_MSG_RESULT(no)
  700. if test "$GDK_PIXBUF_CONFIG" = "no" ; then
  701. echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
  702. echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
  703. echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
  704. echo "*** full path to gdk-pixbuf-config."
  705. else
  706. if test -f conf.gdk_pixbuftest ; then
  707. :
  708. else
  709. echo "*** Could not run GDK_PIXBUF test program, checking why..."
  710. CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
  711. LIBS="$LIBS $GDK_PIXBUF_LIBS"
  712. AC_TRY_LINK([
  713. #include <stdio.h>
  714. #include <gdk-pixbuf/gdk-pixbuf.h>
  715. ], [ return 0; ],
  716. [ echo "*** The test program compiled, but did not run. This usually means"
  717. echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
  718. echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
  719. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  720. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  721. echo "*** is required on your system"
  722. echo "***"
  723. echo "*** If you have an old version installed, it is best to remove it, although"
  724. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
  725. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  726. echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
  727. echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
  728. echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
  729. CFLAGS="$ac_save_CFLAGS"
  730. LIBS="$ac_save_LIBS"
  731. fi
  732. fi
  733. GDK_PIXBUF_CFLAGS=""
  734. GDK_PIXBUF_LIBS=""
  735. ifelse([$3], , :, [$3])
  736. fi
  737. AC_SUBST(GDK_PIXBUF_CFLAGS)
  738. AC_SUBST(GDK_PIXBUF_LIBS)
  739. rm -f conf.gdk_pixbuftest
  740. ])
  741. # Define a conditional.
  742. AC_DEFUN(AM_CONDITIONAL,
  743. [AC_SUBST($1_TRUE)
  744. AC_SUBST($1_FALSE)
  745. if $2; then
  746. $1_TRUE=
  747. $1_FALSE='#'
  748. else
  749. $1_TRUE='#'
  750. $1_FALSE=
  751. fi])