1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
4 AC_DEFUN(AC_STEPMAKE_COMPILE, [
5 # -O is necessary to get inlining
7 CXXFLAGS=${CXXFLAGS:-""}
14 AC_ARG_ENABLE(checking,
15 [ enable-checking set runtime checks (assert calls). Default: on],
16 [checking_b=$enableval] )
18 # actually, the default is: tja='-O' to get inlining...
21 #actually, that sucks.
22 # tja looks like a typo. Default is optimisation off. --hwn
24 AC_ARG_ENABLE(optimise,
25 [ enable-optimise use maximal speed optimisations. Default: off],
26 [optimise_b=$enableval])
28 AC_ARG_ENABLE(profiling,
29 [ enable-profiling compile with gprof support. Default: off],
30 [profile_b=$enableval])
32 AC_ARG_ENABLE(debugging,
33 [ enable-debugging set debug info. Default: on],
36 AC_ARG_ENABLE(mingw-prefix,
37 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
38 [MINGWPREFIX=$enableval],
41 if test "$printing_b" = no; then
44 DEFINES="$DEFINES -DNPRINT"
47 if test "$checking_b" = no; then
50 DEFINES="$DEFINES -DNDEBUG"
53 if test "$optimise_b" = yes; then
54 OPTIMIZE="-O2 -finline-functions"
57 if test "$optimise_b" = no; then
61 if test $profile_b = yes; then
63 OPTIMIZE="$OPTIMIZE -pg"
66 if test $debug_b = yes; then
67 OPTIMIZE="$OPTIMIZE -g"
70 # however, C++ support in mingw32 v 0.1.4 is still flaky
71 if test x$MINGWPREFIX != xno; then
72 ICFLAGS="-I$MINGWPREFIX/include"
73 ILDFLAGS="-$MINGWPREFIX/lib"
80 CPPFLAGS=${CPPFLAGS:-""}
89 AC_DEFUN(AC_STEPMAKE_CXX, [
93 AC_CHECK_HEADER(FlexLexer.h, true,
94 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
96 CPPFLAGS="$CPPFLAGS $DEFINES"
97 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
106 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
107 AC_CACHE_CHECK([whether explicit instantiation is needed],
108 lily_cv_need_explicit_instantiation,
110 template <class T> struct foo { static int baz; };
111 template <class T> int foo<T>::baz = 1;
112 ], [ return foo<int>::baz; ],
113 lily_cv_need_explicit_instantiation=no,
114 lily_cv_need_explicit_instantiation=yes))
115 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
116 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
120 AC_DEFUN(AC_STEPMAKE_DATADIR, [
121 if test "$datadir" = "\${prefix}/share"; then
122 datadir='${prefix}/share/'$package
124 DIR_DATADIR=${datadir}
126 if test "$prefix" = "NONE"; then
127 presome=${ac_default_prefix}
129 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
131 AC_SUBST(DIR_DATADIR)
132 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
135 AC_DEFUN(AC_STEPMAKE_END, [
136 AC_OUTPUT($CONFIGFILE.make:config.make.in)
139 cp make/toplevel.make.in ./GNUmakefile
140 chmod 444 GNUmakefile
143 AC_DEFUN(AC_STEPMAKE_GXX, [
145 changequote(<<, >>)dnl
146 if $CXX --version | grep '2\.[78]' > /dev/null ||
147 $CXX --version | grep 'egcs' > /dev/null
152 AC_STEPMAKE_WARN(can\'t find g++ 2.7, 2.8 or egcs)
156 AC_DEFUN(AC_STEPMAKE_GUILE, [
157 # urg, must check for different functions in libguile
158 # to force new check iso reading from cache
159 AC_CHECK_LIB(guile, scm_shell, \
160 LIBS="-lguile $LIBS" AC_DEFINE(HAVE_LIBGUILE), \
161 AC_CHECK_LIB(readline, readline) \
162 AC_CHECK_LIB(dl, dlopen) \
163 AC_CHECK_LIB(guile, scm_boot_guile))
166 AC_DEFUN(AC_STEPMAKE_INIT, [
169 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
170 if test x$MY_PATCH_LEVEL != x; then
171 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
174 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
175 changequote(<<, >>)dnl
176 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
177 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
180 # No versioning on directory names of sub-packages
182 stepmake=${datadir}/stepmake
184 if test "$prefix" = "NONE"; then
185 presome=${ac_default_prefix}
187 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
189 if test "x$PACKAGE" = "xSTEPMAKE"; then
190 echo Stepmake package!
191 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
192 (cd stepmake; rm -f bin; ln -s ../bin .)
193 AC_CONFIG_AUX_DIR(bin)
196 echo Package: $PACKAGE
197 # Check for installed stepmake
198 if test -d $stepmake; then
199 echo Using installed stepmake: $stepmake
201 stepmake='$(depth)'/stepmake
202 echo Using local stepmake: $datadir/stepmake not found
205 $HOME/usr/local/share/stepmake/bin\
206 $HOME/usr/local/lib/stepmake/bin\
207 $HOME/usr/share/stepmake/bin\
208 $HOME/usr/lib/stepmake/bin\
209 /usr/local/share/stepmake/bin\
210 /usr/local/lib/stepmake/bin\
211 /usr/share/stepmake/bin\
212 /usr/lib/stepmake/bin\
220 AC_SUBST(PACKAGE_NAME)
221 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
222 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
224 package_depth=`dirname $cache_file`
225 AC_SUBST(package_depth)
227 AUTOGENERATE="This file was automatically generated by configure"
228 AC_SUBST(AUTOGENERATE)
229 absolute_builddir="`pwd`"
230 AC_SUBST(absolute_builddir)
232 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
233 if test "x$STATE_VECTOR" != "x"; then
234 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
236 AC_SUBST(STATE_VECTOR)
239 AC_ARG_ENABLE(config,
240 [ enable-config=FILE put configure settings in config-FILE.make],
241 [CONFIGSUFFIX=$enableval])
243 if test "$CONFIGSUFFIX" != "" ; then
244 CONFIGFILE=config-$CONFIGSUFFIX
248 AC_SUBST(CONFIGSUFFIX)
251 AC_CHECK_PROGS(MAKE, make, error)
252 AC_CHECK_PROGS(FIND, find, error)
255 dnl system supplied INSTALL is unsafe; use our own install.
257 dnl if test "$INSTALL" = "bin/install-sh"; then
258 dnl export INSTALL="\$\(depth\)/bin/install-sh"
261 AC_CHECK_PROGS(TAR, tar, error)
262 AC_CHECK_PROGS(BASH, bash, /bin/sh)
264 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
268 AC_CHECK_SEARCH_RESULT($MAKE, GNU make, You should install GNU make)
269 if test $MAKE != "error" ; then
270 $MAKE -v| grep GNU > /dev/null
273 AC_STEPMAKE_WARN(Please install *GNU* make)
277 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
279 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
280 LN=cp # hard link does not work under cygnus-nt
281 LN_S=cp # symbolic link does not work for native nt
286 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
293 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
300 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
301 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
309 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
310 # ugh, automake: we want (and check for) bison
312 # ugh, automake: we want (and check for) flex
314 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
318 ac_cv_prog_lex_root=lex.yy
320 AC_CHECK_PROGS(BISON, bison, error)
321 AC_CHECK_PROGS(FLEX, flex, error)
322 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or better)
323 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or better)
325 if test $BISON != "error"; then
326 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
327 if test $bison_version -lt 25; then
328 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
336 AC_DEFUN(AC_STEPMAKE_LIB, [
337 AC_CHECK_PROGS(AR, ar, error)
344 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
346 # **Never** try to set library version numbers so that they correspond
347 # to the release number of your package. This is an abuse that only
348 # fosters misunderstanding of the purpose of library versions.
350 REVISION=$PATCH_LEVEL
351 # CURRENT=$MINOR_VERSION
352 CURRENT=`expr $MINOR_VERSION + 1`
353 # AGE=$(expr $MAJOR_VERSION + 1)
360 AC_DEFUN(AC_STEPMAKE_LOCALE, [
365 AC_ARG_WITH(localedir,
366 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
367 localedir=$with_localedir,
368 localedir='${prefix}/share/locale')
371 [ with-lang=LANG use LANG as language to emit messages],
375 AC_MSG_CHECKING(language)
377 En* | en* | Am* | am* | US* | us*)
379 NL | nl | Du* | du* | Ned* | ned*)
388 if test "$lang" = "unknown" ; then
389 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
394 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
395 DIR_LOCALEDIR=${localedir}
397 if test "$prefix" = "NONE"; then
398 presome=${ac_default_prefix}
400 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
402 AC_SUBST(DIR_LOCALEDIR)
403 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
405 AC_CHECK_LIB(intl, gettext)
406 AC_CHECK_FUNCS(gettext)
409 AC_DEFUN(AC_STEPMAKE_MAN, [
410 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
413 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
414 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
415 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
416 AC_MSG_CHECKING(whether msgfmt accepts -o)
417 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
418 if test "$msgfmt_output" = ""; then
422 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
424 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
426 if test ! -n "$MSGFMT"; then
427 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
431 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
432 AC_ARG_ENABLE(tex-prefix,
433 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
434 [TEXPREFIX=$enableval],
437 AC_ARG_ENABLE(tex-dir,
438 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
442 AC_ARG_ENABLE(mf-dir,
443 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
447 if test "x$TEXPREFIX" = xauto ; then
448 AC_TEX_PREFIX(TEXPREFIX)
450 find_texprefix=$TEXPREFIX
453 if test "x$MFDIR" = xauto; then
457 if test "x$TEXDIR" = xauto ; then
458 AC_TEX_SUBDIR(TEXDIR)
465 AC_DEFUN(AC_STEPMAKE_TEXMF, [
466 # urg, never know what names these teTeX guys will think up
467 AC_CHECK_PROGS(METAFONT, mf, no)
468 if test "x$METAFONT" = "xno"; then
469 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
473 AC_CHECK_PROGS(METAPOST, mp, no)
474 if test "x$METAPOST" = "xno"; then
475 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
483 AC_DEFUN(AC_STEPMAKE_WARN, [
488 AC_DEFUN(AC_STEPMAKE_YODL, [
489 if test "x$YODL" = "x"; then
490 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
491 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
492 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
493 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
494 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
495 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
496 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
497 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
498 YODL2LESS_DIR='$(bindir)/'
504 AC_SUBST(YODL2LESS_DIR)
506 AC_SUBST(YODL2MSLESS)
507 AC_SUBST(YODL2TEXINFO)
509 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
511 if test "x$YODL" = "-echo no yodl"; then
512 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
516 dnl should cache result.
517 dnl should look in $prefix first.
518 dnl should probably assume TDS
520 AC_DEFUN(AC_TEX_PREFIX, [
523 AC_MSG_CHECKING(TeX/MF root dir directory)
525 find_root_prefix="$prefix"
528 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
530 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
531 find_texprefix="$find_root_prefix$postfix"
532 if test -d $find_texprefix; then
533 find_texpostfix=$postfix
538 if test "x$find_texpostfix" = x; then
539 find_texpostfix='/lib/texmf/tex'
540 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
543 find_texprefix="$find_root_prefix/$find_texpostfix"
545 # only assign if variablename not empty
546 if test x != "x[$]$1"; then
547 $1='${prefix}'/"$find_texpostfix"
549 AC_MSG_RESULT($find_texprefix)
554 # find a directory inside a prefix,
555 # $1 the prefix (expanded version)
556 # $2 variable to assign
557 # $3 the directory name
559 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
561 AC_MSG_CHECKING($4 directory)
563 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
566 if test "x$find_dirdir" = x; then
568 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
572 AC_MSG_RESULT($1/$find_dirdir)
575 # ugh. this is hopeless
576 AC_DEFUN(AC_KPSE_TEX_DIR, [
577 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
578 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
580 if test -w "$kpse_syspaths";
582 dir=`echo $kpse_syspaths | head -1`
584 dir=`echo $kpse_paths | grep -v '!'| head -1`
586 if test "$prefix" = "NONE"; then
587 local_prefix=$ac_default_prefix
588 local_prefix_quote='${prefix}'
592 local_prefix_quote=$prefix
594 echo $local_prefix_quote = $local_prefix
596 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
599 AC_DEFUN(AC_TEX_SUBDIR, [
600 dnl AC_REQUIRE([AC_TEX_PREFIX])
601 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
605 AC_DEFUN(AC_MF_SUBDIR, [
606 dnl AC_REQUIRE([AC_TEX_PREFIX])
607 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
611 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
612 result="`echo \"$1\" | grep echo`"
613 if test "x$1" = "xerror" -o "x$result" != "x"; then
614 AC_STEPMAKE_WARN(can\'t find $2. $3)
619 # Configure paths for GTK+
620 # Owen Taylor 97-11-3
622 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
623 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
625 AC_DEFUN(AM_PATH_GTK,
627 dnl Get the cflags and libraries from the gtk-config script
629 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
630 min_gtk_version=ifelse([$1], ,1.1.1,$1)
631 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
633 if test "$GTK_CONFIG" != "no" ; then
634 GTK_CFLAGS=`$GTK_CONFIG --cflags`
635 GTK_LIBS=`$GTK_CONFIG --libs`
636 ac_save_CFLAGS="$CFLAGS"
638 ac_save_CXXFLAGS="$CXXFLAGS"
639 CFLAGS="$CFLAGS $GTK_CFLAGS"
640 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
641 LIBS="$LIBS $GTK_LIBS"
643 dnl Now check if the installed GTK is sufficiently new. (Also sanity
644 dnl checks the results of gtk-config to some extent
653 int major, minor, micro;
655 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
656 printf("%s, bad version string\n", "$min_gtk_version");
660 return !((gtk_major_version > major) ||
661 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
662 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
664 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
665 CFLAGS="$ac_save_CFLAGS"
666 CXXFLAGS="$ac_save_CXXFLAGS"
671 if test "x$no_gtk" = x ; then
673 ifelse([$2], , :, [$2])
678 ifelse([$3], , :, [$3])
680 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
687 # Configure paths for GTK--
688 # Erik Andersen 30 May 1998
689 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
691 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
692 dnl to be used as follows:
693 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
696 dnl Get the cflags and libraries from the gtkmm-config script
698 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
699 Prefix where GTK-- is installed (optional)],
700 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
701 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
702 Exec prefix where GTK-- is installed (optional)],
703 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
704 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
705 , enable_gtkmmtest=yes)
707 if test x$gtkmm_config_exec_prefix != x ; then
708 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
709 if test x${GTKMM_CONFIG+set} != xset ; then
710 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
713 if test x$gtkmm_config_prefix != x ; then
714 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
715 if test x${GTKMM_CONFIG+set} != xset ; then
716 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
721 AC_DEFUN(AM_PATH_GTKMM,
725 dnl Check check if the installed GTK-- is sufficiently new.
727 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
728 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
730 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
732 if test "$GTKMM_CONFIG" = "no" ; then
738 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
739 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
740 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
741 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
742 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
743 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
744 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
745 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
746 if test "x$enable_gtkmmtest" = "xyes" ; then
747 ac_save_CXXFLAGS="$CXXFLAGS"
749 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
750 LIBS="$LIBS $GTK___LIBS"
752 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
753 dnl checks the results of gtkmm-config to some extent
764 int major, minor, micro;
767 system ("touch conf.gtkmmtest");
769 /* HP/UX 0 (%@#!) writes to sscanf strings */
770 tmp_version = g_strdup("$min_gtkmm_version");
771 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
772 printf("%s, bad version string\n", "$min_gtkmm_version");
776 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
777 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
778 (gtkmm_micro_version != $gtkmm_config_micro_version))
780 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
781 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
782 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
783 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
784 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
785 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
786 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
787 printf("*** required on your system.\n");
788 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
789 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
790 printf("*** before re-running configure\n");
792 /* GTK-- does not have the GTKMM_*_VERSION constants */
794 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
795 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
796 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
798 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
799 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
800 printf("*** library (version %d.%d.%d)\n",
801 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
806 if ((gtkmm_major_version > major) ||
807 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
808 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
814 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
815 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
816 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
817 major, minor, micro);
818 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
820 printf("*** If you have already installed a sufficiently new version, this error\n");
821 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
822 printf("*** being found. The easiest way to fix this is to remove the old version\n");
823 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
824 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
825 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
826 printf("*** so that the correct libraries are found at run-time))\n");
831 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
832 CXXFLAGS="$ac_save_CXXFLAGS"
836 if test "x$no_gtkmm" = x ; then
838 ifelse([$2], , :, [$2])
841 if test "$GTKMM_CONFIG" = "no" ; then
842 echo "*** The gtkmm-config script installed by GTK-- could not be found"
843 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
844 echo "*** your path, or set the GTK_CONFIG environment variable to the"
845 echo "*** full path to gtk-config."
846 echo "*** The gtkmm-config script was not available in GTK-- versions"
847 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
848 echo "*** version to 0.9.12 or later"
850 if test -f conf.gtkmmtest ; then
853 echo "*** Could not run GTK-- test program, checking why..."
854 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
855 LIBS="$LIBS $GTK___LIBS"
859 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
860 [ echo "*** The test program compiled, but did not run. This usually means"
861 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
862 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
863 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
864 echo "*** to the installed location Also, make sure you have run ldconfig if that"
865 echo "*** is required on your system"
867 echo "*** If you have an old version installed, it is best to remove it, although"
868 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
869 [ echo "*** The test program failed to compile or link. See the file config.log for the"
870 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
871 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
872 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
873 CXXFLAGS="$ac_save_CXXFLAGS"
879 ifelse([$3], , :, [$3])
882 AC_SUBST(GTK___CFLAGS)
887 # Configure paths for GTK--DRAW
888 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
890 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
891 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
893 AC_DEFUN(AM_PATH_GTK__DRAW,
895 dnl Get the cflags and libraries from the gtk__-config script
897 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
898 min_gtk___version=ifelse([$1], ,0.0.5,$1)
899 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
901 if test "$GTKMM_CONFIG" != "no" ; then
902 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
903 GTK___LIBS=`$GTKMM_CONFIG --libs`
904 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
905 GTK___LIBS="$GTK___DLIBS"
906 ac_save_CFLAGS="$CFLAGS"
908 ac_save_CXXFLAGS="$CXXFLAGS"
909 CFLAGS="$CFLAGS $GTK___CFLAGS"
910 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
911 LIBS="$LIBS $GTK___LIBS"
913 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
914 dnl checks the results of gtk__-config to some extent
926 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
927 CFLAGS="$ac_save_CFLAGS"
928 CXXFLAGS="$ac_save_CXXFLAGS"
933 if test "x$no_gtk__" = x ; then
935 ifelse([$2], , :, [$2])
940 ifelse([$3], , :, [$3])
942 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
944 AC_SUBST(GTK___CFLAGS)