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 # on some systems, -lguile succeeds for guile-1.3
158 # others need readline, dl (or even more)
159 # urg, must check for different functions in libguile
160 # to force new check iso reading from cache
161 AC_CHECK_LIB(guile, scm_shell, \
162 LIBS="-lguile $LIBS"; AC_DEFINE(HAVE_LIBGUILE), \
163 AC_CHECK_LIB(readline, readline) \
164 AC_CHECK_LIB(dl, dlopen) \
165 AC_CHECK_LIB(socket, socket)\
166 AC_CHECK_LIB(termcap,tgetent)\
167 AC_CHECK_LIB(m, fabs)\
168 AC_CHECK_LIB(guile, scm_boot_guile)\
170 if test "$ac_cv_lib_guile_scm_shell" != yes -a \
171 "$ac_cv_lib_guile_scm_boot_guile" != yes ; then
172 AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
176 AC_DEFUN(AC_STEPMAKE_INIT, [
179 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
180 if test x$MY_PATCH_LEVEL != x; then
181 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
184 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
185 changequote(<<, >>)dnl
186 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
187 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
190 # No versioning on directory names of sub-packages
192 stepmake=${datadir}/stepmake
194 if test "$prefix" = "NONE"; then
195 presome=${ac_default_prefix}
197 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
199 if test "x$PACKAGE" = "xSTEPMAKE"; then
200 echo Stepmake package!
201 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
202 (cd stepmake; rm -f bin; ln -s ../bin .)
203 AC_CONFIG_AUX_DIR(bin)
206 echo Package: $PACKAGE
207 # Check for installed stepmake
208 if test -d $stepmake; then
209 echo Using installed stepmake: $stepmake
211 stepmake='$(depth)'/stepmake
212 echo Using local stepmake: $datadir/stepmake not found
215 $HOME/usr/local/share/stepmake/bin\
216 $HOME/usr/local/lib/stepmake/bin\
217 $HOME/usr/share/stepmake/bin\
218 $HOME/usr/lib/stepmake/bin\
219 /usr/local/share/stepmake/bin\
220 /usr/local/lib/stepmake/bin\
221 /usr/share/stepmake/bin\
222 /usr/lib/stepmake/bin\
230 AC_SUBST(PACKAGE_NAME)
231 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
232 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
234 package_depth=`dirname $cache_file`
235 AC_SUBST(package_depth)
237 AUTOGENERATE="This file was automatically generated by configure"
238 AC_SUBST(AUTOGENERATE)
239 absolute_builddir="`pwd`"
240 AC_SUBST(absolute_builddir)
242 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
243 if test "x$STATE_VECTOR" != "x"; then
244 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
246 AC_SUBST(STATE_VECTOR)
249 AC_ARG_ENABLE(config,
250 [ enable-config=FILE put configure settings in config-FILE.make],
251 [CONFIGSUFFIX=$enableval])
253 if test "$CONFIGSUFFIX" != "" ; then
254 CONFIGFILE=config-$CONFIGSUFFIX
258 AC_SUBST(CONFIGSUFFIX)
261 AC_CHECK_PROGS(MAKE, make, error)
262 AC_CHECK_PROGS(FIND, find, error)
265 dnl system supplied INSTALL is unsafe; use our own install.
267 dnl if test "$INSTALL" = "bin/install-sh"; then
268 dnl export INSTALL="\$\(depth\)/bin/install-sh"
271 AC_CHECK_PROGS(TAR, tar, error)
272 AC_CHECK_PROGS(BASH, bash, /bin/sh)
274 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
278 AC_CHECK_SEARCH_RESULT($MAKE, GNU make, You should install GNU make)
279 if test $MAKE != "error" ; then
280 $MAKE -v| grep GNU > /dev/null
283 AC_STEPMAKE_WARN(Please install *GNU* make)
287 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
289 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
290 LN=cp # hard link does not work under cygnus-nt
291 LN_S=cp # symbolic link does not work for native nt
296 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
303 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
310 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
311 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
319 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
320 # ugh, automake: we want (and check for) bison
322 # ugh, automake: we want (and check for) flex
324 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
328 ac_cv_prog_lex_root=lex.yy
330 AC_CHECK_PROGS(BISON, bison, error)
331 AC_CHECK_PROGS(FLEX, flex, error)
332 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
333 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
335 if test $BISON != "error"; then
336 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
337 if test $bison_version -lt 25; then
338 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
346 AC_DEFUN(AC_STEPMAKE_LIB, [
347 AC_CHECK_PROGS(AR, ar, error)
354 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
356 # **Never** try to set library version numbers so that they correspond
357 # to the release number of your package. This is an abuse that only
358 # fosters misunderstanding of the purpose of library versions.
360 REVISION=$PATCH_LEVEL
361 # CURRENT=$MINOR_VERSION
362 CURRENT=`expr $MINOR_VERSION + 1`
363 # AGE=$(expr $MAJOR_VERSION + 1)
370 AC_DEFUN(AC_STEPMAKE_LOCALE, [
375 AC_ARG_WITH(localedir,
376 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
377 localedir=$with_localedir,
378 localedir='${prefix}/share/locale')
381 [ with-lang=LANG use LANG as language to emit messages],
385 AC_MSG_CHECKING(language)
387 En* | en* | Am* | am* | US* | us*)
389 NL | nl | Du* | du* | Ned* | ned*)
398 if test "$lang" = "unknown" ; then
399 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
404 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
405 DIR_LOCALEDIR=${localedir}
407 if test "$prefix" = "NONE"; then
408 presome=${ac_default_prefix}
410 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
412 AC_SUBST(DIR_LOCALEDIR)
413 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
415 AC_CHECK_LIB(intl, gettext)
416 AC_CHECK_FUNCS(gettext)
419 AC_DEFUN(AC_STEPMAKE_MAN, [
420 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
423 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
424 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
425 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
426 AC_MSG_CHECKING(whether msgfmt accepts -o)
427 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
428 if test "$msgfmt_output" = ""; then
432 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
434 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
436 if test ! -n "$MSGFMT"; then
437 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
441 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
442 AC_ARG_ENABLE(tex-prefix,
443 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
444 [TEXPREFIX=$enableval],
447 AC_ARG_ENABLE(tex-dir,
448 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
452 AC_ARG_ENABLE(mf-dir,
453 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
457 if test "x$TEXPREFIX" = xauto ; then
458 AC_TEX_PREFIX(TEXPREFIX)
460 find_texprefix=$TEXPREFIX
463 if test "x$MFDIR" = xauto; then
467 if test "x$TEXDIR" = xauto ; then
468 AC_TEX_SUBDIR(TEXDIR)
475 AC_DEFUN(AC_STEPMAKE_TEXMF, [
476 # urg, never know what names these teTeX guys will think up
477 AC_CHECK_PROGS(METAFONT, mf, no)
478 if test "x$METAFONT" = "xno"; then
479 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
483 AC_CHECK_PROGS(METAPOST, mp, no)
484 if test "x$METAPOST" = "xno"; then
485 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
493 AC_DEFUN(AC_STEPMAKE_WARN, [
498 AC_DEFUN(AC_STEPMAKE_YODL, [
499 if test "x$YODL" = "x"; then
500 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
501 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
502 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
503 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
504 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
505 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
506 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
507 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
508 YODL2LESS_DIR='$(bindir)/'
514 AC_SUBST(YODL2LESS_DIR)
516 AC_SUBST(YODL2MSLESS)
517 AC_SUBST(YODL2TEXINFO)
519 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
521 if test "x$YODL" = "-echo no yodl"; then
522 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
526 dnl should cache result.
527 dnl should look in $prefix first.
528 dnl should probably assume TDS
530 AC_DEFUN(AC_TEX_PREFIX, [
533 AC_MSG_CHECKING(TeX/MF root dir directory)
535 find_root_prefix="$prefix"
538 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
540 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
541 find_texprefix="$find_root_prefix$postfix"
542 if test -d $find_texprefix; then
543 find_texpostfix=$postfix
548 if test "x$find_texpostfix" = x; then
549 find_texpostfix='/lib/texmf/tex'
550 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
553 find_texprefix="$find_root_prefix/$find_texpostfix"
555 # only assign if variablename not empty
556 if test x != "x[$]$1"; then
557 $1='${prefix}'/"$find_texpostfix"
559 AC_MSG_RESULT($find_texprefix)
564 # find a directory inside a prefix,
565 # $1 the prefix (expanded version)
566 # $2 variable to assign
567 # $3 the directory name
569 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
571 AC_MSG_CHECKING($4 directory)
573 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
576 if test "x$find_dirdir" = x; then
578 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
582 AC_MSG_RESULT($1/$find_dirdir)
585 # ugh. this is hopeless
586 AC_DEFUN(AC_KPSE_TEX_DIR, [
587 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
588 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
590 if test -w "$kpse_syspaths";
592 dir=`echo $kpse_syspaths | head -1`
594 dir=`echo $kpse_paths | grep -v '!'| head -1`
596 if test "$prefix" = "NONE"; then
597 local_prefix=$ac_default_prefix
598 local_prefix_quote='${prefix}'
602 local_prefix_quote=$prefix
604 echo $local_prefix_quote = $local_prefix
606 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
609 AC_DEFUN(AC_TEX_SUBDIR, [
610 dnl AC_REQUIRE([AC_TEX_PREFIX])
611 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
615 AC_DEFUN(AC_MF_SUBDIR, [
616 dnl AC_REQUIRE([AC_TEX_PREFIX])
617 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
621 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
622 result="`echo \"$1\" | grep echo`"
623 if test "x$1" = "xerror" -o "x$result" != "x"; then
624 AC_STEPMAKE_WARN(can\'t find $2. $3)
629 # Configure paths for GTK+
630 # Owen Taylor 97-11-3
632 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
633 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
635 AC_DEFUN(AM_PATH_GTK,
637 dnl Get the cflags and libraries from the gtk-config script
639 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
640 min_gtk_version=ifelse([$1], ,1.1.1,$1)
641 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
643 if test "$GTK_CONFIG" != "no" ; then
644 GTK_CFLAGS=`$GTK_CONFIG --cflags`
645 GTK_LIBS=`$GTK_CONFIG --libs`
646 ac_save_CFLAGS="$CFLAGS"
648 ac_save_CXXFLAGS="$CXXFLAGS"
649 CFLAGS="$CFLAGS $GTK_CFLAGS"
650 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
651 LIBS="$LIBS $GTK_LIBS"
653 dnl Now check if the installed GTK is sufficiently new. (Also sanity
654 dnl checks the results of gtk-config to some extent
663 int major, minor, micro;
665 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
666 printf("%s, bad version string\n", "$min_gtk_version");
670 return !((gtk_major_version > major) ||
671 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
672 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
674 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
675 CFLAGS="$ac_save_CFLAGS"
676 CXXFLAGS="$ac_save_CXXFLAGS"
681 if test "x$no_gtk" = x ; then
683 ifelse([$2], , :, [$2])
688 ifelse([$3], , :, [$3])
690 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
697 # Configure paths for GTK--
698 # Erik Andersen 30 May 1998
699 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
701 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
702 dnl to be used as follows:
703 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
706 dnl Get the cflags and libraries from the gtkmm-config script
708 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
709 Prefix where GTK-- is installed (optional)],
710 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
711 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
712 Exec prefix where GTK-- is installed (optional)],
713 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
714 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
715 , enable_gtkmmtest=yes)
717 if test x$gtkmm_config_exec_prefix != x ; then
718 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
719 if test x${GTKMM_CONFIG+set} != xset ; then
720 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
723 if test x$gtkmm_config_prefix != x ; then
724 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
725 if test x${GTKMM_CONFIG+set} != xset ; then
726 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
731 AC_DEFUN(AM_PATH_GTKMM,
735 dnl Check check if the installed GTK-- is sufficiently new.
737 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
738 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
740 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
742 if test "$GTKMM_CONFIG" = "no" ; then
748 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
749 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
750 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
751 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
752 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
753 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
754 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
755 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
756 if test "x$enable_gtkmmtest" = "xyes" ; then
757 ac_save_CXXFLAGS="$CXXFLAGS"
759 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
760 LIBS="$LIBS $GTK___LIBS"
762 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
763 dnl checks the results of gtkmm-config to some extent
774 int major, minor, micro;
777 system ("touch conf.gtkmmtest");
779 /* HP/UX 0 (%@#!) writes to sscanf strings */
780 tmp_version = g_strdup("$min_gtkmm_version");
781 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
782 printf("%s, bad version string\n", "$min_gtkmm_version");
786 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
787 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
788 (gtkmm_micro_version != $gtkmm_config_micro_version))
790 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
791 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
792 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
793 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
794 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
795 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
796 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
797 printf("*** required on your system.\n");
798 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
799 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
800 printf("*** before re-running configure\n");
802 /* GTK-- does not have the GTKMM_*_VERSION constants */
804 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
805 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
806 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
808 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
809 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
810 printf("*** library (version %d.%d.%d)\n",
811 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
816 if ((gtkmm_major_version > major) ||
817 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
818 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
824 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
825 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
826 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
827 major, minor, micro);
828 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
830 printf("*** If you have already installed a sufficiently new version, this error\n");
831 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
832 printf("*** being found. The easiest way to fix this is to remove the old version\n");
833 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
834 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
835 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
836 printf("*** so that the correct libraries are found at run-time))\n");
841 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
842 CXXFLAGS="$ac_save_CXXFLAGS"
846 if test "x$no_gtkmm" = x ; then
848 ifelse([$2], , :, [$2])
851 if test "$GTKMM_CONFIG" = "no" ; then
852 echo "*** The gtkmm-config script installed by GTK-- could not be found"
853 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
854 echo "*** your path, or set the GTK_CONFIG environment variable to the"
855 echo "*** full path to gtk-config."
856 echo "*** The gtkmm-config script was not available in GTK-- versions"
857 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
858 echo "*** version to 0.9.12 or newer"
860 if test -f conf.gtkmmtest ; then
863 echo "*** Could not run GTK-- test program, checking why..."
864 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
865 LIBS="$LIBS $GTK___LIBS"
869 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
870 [ echo "*** The test program compiled, but did not run. This usually means"
871 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
872 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
873 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
874 echo "*** to the installed location Also, make sure you have run ldconfig if that"
875 echo "*** is required on your system"
877 echo "*** If you have an old version installed, it is best to remove it, although"
878 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
879 [ echo "*** The test program failed to compile or link. See the file config.log for the"
880 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
881 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
882 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
883 CXXFLAGS="$ac_save_CXXFLAGS"
889 ifelse([$3], , :, [$3])
892 AC_SUBST(GTK___CFLAGS)
897 # Configure paths for GTK--DRAW
898 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
900 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
901 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
903 AC_DEFUN(AM_PATH_GTK__DRAW,
905 dnl Get the cflags and libraries from the gtk__-config script
907 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
908 min_gtk___version=ifelse([$1], ,0.0.5,$1)
909 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
911 if test "$GTKMM_CONFIG" != "no" ; then
912 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
913 GTK___LIBS=`$GTKMM_CONFIG --libs`
914 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
915 GTK___LIBS="$GTK___DLIBS"
916 ac_save_CFLAGS="$CFLAGS"
918 ac_save_CXXFLAGS="$CXXFLAGS"
919 CFLAGS="$CFLAGS $GTK___CFLAGS"
920 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
921 LIBS="$LIBS $GTK___LIBS"
923 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
924 dnl checks the results of gtk__-config to some extent
936 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
937 CFLAGS="$ac_save_CFLAGS"
938 CXXFLAGS="$ac_save_CXXFLAGS"
943 if test "x$no_gtk__" = x ; then
945 ifelse([$2], , :, [$2])
950 ifelse([$3], , :, [$3])
952 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
954 AC_SUBST(GTK___CFLAGS)