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 CFLAGS="$CFLAGS $OPTIMIZE"
81 CPPFLAGS=${CPPFLAGS:-""}
91 AC_DEFUN(AC_STEPMAKE_CXX, [
95 AC_CHECK_HEADER(FlexLexer.h, true,
96 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
98 CPPFLAGS="$CPPFLAGS $DEFINES"
99 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
108 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
109 AC_CACHE_CHECK([whether explicit instantiation is needed],
110 lily_cv_need_explicit_instantiation,
112 template <class T> struct foo { static int baz; };
113 template <class T> int foo<T>::baz = 1;
114 ], [ return foo<int>::baz; ],
115 lily_cv_need_explicit_instantiation=no,
116 lily_cv_need_explicit_instantiation=yes))
117 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
118 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
122 AC_DEFUN(AC_STEPMAKE_DATADIR, [
123 if test "$datadir" = "\${prefix}/share"; then
124 datadir='${prefix}/share/'$package
126 DIR_DATADIR=${datadir}
128 if test "$prefix" = "NONE"; then
129 presome=${ac_default_prefix}
131 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
133 AC_SUBST(DIR_DATADIR)
134 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
137 AC_DEFUN(AC_STEPMAKE_END, [
138 AC_OUTPUT($CONFIGFILE.make:config.make.in)
141 cp make/toplevel.make.in ./GNUmakefile
142 chmod 444 GNUmakefile
145 AC_DEFUN(AC_STEPMAKE_GXX, [
147 # urg, egcs: how to check for egcs >= 1.1?
148 changequote(<<, >>)dnl
149 if $CXX --version | grep '2\.8' > /dev/null ||
150 $CXX --version | grep 'egcs' > /dev/null
155 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
159 AC_DEFUN(AC_STEPMAKE_GUILE, [
160 # on some systems, -lguile succeeds for guile-1.3
161 # others need readline, dl (or even more)
162 # urg, must check for different functions in libguile
163 # to force new check iso reading from cache
165 # gh_scm2doubles,gh_doubles2scm are new in 1.3
166 AC_CHECK_LIB(guile, gh_scm2doubles, \
167 LIBS="-lguile $LIBS"; AC_DEFINE(HAVE_LIBGUILE), \
168 AC_CHECK_LIB(readline, readline) \
169 AC_CHECK_LIB(dl, dlopen) \
170 AC_CHECK_LIB(socket, socket)\
171 AC_CHECK_LIB(termcap,tgetent)\
172 AC_CHECK_LIB(m, fabs)\
173 AC_CHECK_LIB(guile, gh_doubles2scm)\
175 if test "$ac_cv_lib_guile_gh_scm2doubles" != yes -a \
176 "$ac_cv_lib_guile_gh_doubles2scm" != yes ; then
177 AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
181 AC_DEFUN(AC_STEPMAKE_INIT, [
184 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
185 if test x$MY_PATCH_LEVEL != x; then
186 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
189 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
190 changequote(<<, >>)dnl
191 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
192 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
195 # No versioning on directory names of sub-packages
197 stepmake=${datadir}/stepmake
199 if test "$prefix" = "NONE"; then
200 presome=${ac_default_prefix}
202 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
204 if test "x$PACKAGE" = "xSTEPMAKE"; then
205 echo Stepmake package!
206 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
207 (cd stepmake; rm -f bin; ln -s ../bin .)
208 AC_CONFIG_AUX_DIR(bin)
211 echo Package: $PACKAGE
212 # Check for installed stepmake
213 if test -d $stepmake; then
214 echo Using installed stepmake: $stepmake
216 stepmake='$(depth)'/stepmake
217 echo Using local stepmake: $datadir/stepmake not found
220 $HOME/usr/local/share/stepmake/bin\
221 $HOME/usr/local/lib/stepmake/bin\
222 $HOME/usr/share/stepmake/bin\
223 $HOME/usr/lib/stepmake/bin\
224 /usr/local/share/stepmake/bin\
225 /usr/local/lib/stepmake/bin\
226 /usr/share/stepmake/bin\
227 /usr/lib/stepmake/bin\
235 AC_SUBST(PACKAGE_NAME)
236 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
237 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
239 package_depth=`dirname $cache_file`
240 AC_SUBST(package_depth)
242 AUTOGENERATE="This file was automatically generated by configure"
243 AC_SUBST(AUTOGENERATE)
244 absolute_builddir="`pwd`"
245 AC_SUBST(absolute_builddir)
247 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
248 if test "x$STATE_VECTOR" != "x"; then
249 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
251 AC_SUBST(STATE_VECTOR)
254 AC_ARG_ENABLE(config,
255 [ enable-config=FILE put configure settings in config-FILE.make],
256 [CONFIGSUFFIX=$enableval])
258 if test "$CONFIGSUFFIX" != "" ; then
259 CONFIGFILE=config-$CONFIGSUFFIX
263 AC_SUBST(CONFIGSUFFIX)
266 AC_CHECK_PROGS(MAKE, make, error)
267 AC_CHECK_PROGS(FIND, find, error)
270 dnl system supplied INSTALL is unsafe; use our own install.
272 dnl if test "$INSTALL" = "bin/install-sh"; then
273 dnl export INSTALL="\$\(depth\)/bin/install-sh"
276 AC_CHECK_PROGS(TAR, tar, error)
277 AC_CHECK_PROGS(BASH, bash, /bin/sh)
279 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
283 AC_CHECK_SEARCH_RESULT($MAKE, GNU make, You should install GNU make)
284 if test $MAKE != "error" ; then
285 $MAKE -v| grep GNU > /dev/null
288 AC_STEPMAKE_WARN(Please install *GNU* make)
292 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
294 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
295 LN=cp # hard link does not work under cygnus-nt
296 LN_S=cp # symbolic link does not work for native nt
301 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
308 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
315 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
316 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
324 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
325 # ugh, automake: we want (and check for) bison
327 # ugh, automake: we want (and check for) flex
329 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
333 ac_cv_prog_lex_root=lex.yy
335 AC_CHECK_PROGS(BISON, bison, error)
336 AC_CHECK_PROGS(FLEX, flex, error)
337 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
338 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
340 if test $BISON != "error"; then
341 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
342 if test $bison_version -lt 25; then
343 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
351 AC_DEFUN(AC_STEPMAKE_LIB, [
352 AC_CHECK_PROGS(AR, ar, error)
359 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
361 # **Never** try to set library version numbers so that they correspond
362 # to the release number of your package. This is an abuse that only
363 # fosters misunderstanding of the purpose of library versions.
365 REVISION=$PATCH_LEVEL
366 # CURRENT=$MINOR_VERSION
367 CURRENT=`expr $MINOR_VERSION + 1`
368 # AGE=$(expr $MAJOR_VERSION + 1)
375 AC_DEFUN(AC_STEPMAKE_LOCALE, [
380 AC_ARG_WITH(localedir,
381 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
382 localedir=$with_localedir,
383 localedir='${prefix}/share/locale')
386 [ with-lang=LANG use LANG as language to emit messages],
390 AC_MSG_CHECKING(language)
392 En* | en* | Am* | am* | US* | us*)
394 NL | nl | Du* | du* | Ned* | ned*)
403 if test "$lang" = "unknown" ; then
404 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
409 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
410 DIR_LOCALEDIR=${localedir}
412 if test "$prefix" = "NONE"; then
413 presome=${ac_default_prefix}
415 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
417 AC_SUBST(DIR_LOCALEDIR)
418 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
420 AC_CHECK_LIB(intl, gettext)
421 AC_CHECK_FUNCS(gettext)
424 AC_DEFUN(AC_STEPMAKE_MAN, [
425 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
428 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
429 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
430 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
431 AC_MSG_CHECKING(whether msgfmt accepts -o)
432 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
433 if test "$msgfmt_output" = ""; then
437 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
439 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
441 if test ! -n "$MSGFMT"; then
442 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
446 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
447 AC_ARG_ENABLE(tex-prefix,
448 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
449 [TEXPREFIX=$enableval],
452 AC_ARG_ENABLE(tex-dir,
453 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
457 AC_ARG_ENABLE(mf-dir,
458 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
462 if test "x$TEXPREFIX" = xauto ; then
463 AC_TEX_PREFIX(TEXPREFIX)
465 find_texprefix=$TEXPREFIX
468 if test "x$MFDIR" = xauto; then
472 if test "x$TEXDIR" = xauto ; then
473 AC_TEX_SUBDIR(TEXDIR)
480 AC_DEFUN(AC_STEPMAKE_TEXMF, [
481 # urg, never know what names these teTeX guys will think up
482 AC_CHECK_PROGS(METAFONT, mf, no)
483 if test "x$METAFONT" = "xno"; then
484 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
488 AC_CHECK_PROGS(METAPOST, mp, no)
489 if test "x$METAPOST" = "xno"; then
490 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
498 AC_DEFUN(AC_STEPMAKE_WARN, [
503 AC_DEFUN(AC_STEPMAKE_YODL, [
504 if test "x$YODL" = "x"; then
505 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
506 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
507 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
508 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
509 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
510 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
511 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
512 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
513 YODL2LESS_DIR='$(bindir)/'
519 AC_SUBST(YODL2LESS_DIR)
521 AC_SUBST(YODL2MSLESS)
522 AC_SUBST(YODL2TEXINFO)
524 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
526 if test "x$YODL" = "-echo no yodl"; then
527 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
531 dnl should cache result.
532 dnl should look in $prefix first.
533 dnl should probably assume TDS
535 AC_DEFUN(AC_TEX_PREFIX, [
538 AC_MSG_CHECKING(TeX/MF root dir directory)
540 find_root_prefix="$prefix"
543 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
545 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
546 find_texprefix="$find_root_prefix$postfix"
547 if test -d $find_texprefix; then
548 find_texpostfix=$postfix
553 if test "x$find_texpostfix" = x; then
554 find_texpostfix='/lib/texmf/tex'
555 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
558 find_texprefix="$find_root_prefix/$find_texpostfix"
560 # only assign if variablename not empty
561 if test x != "x[$]$1"; then
562 $1='${prefix}'/"$find_texpostfix"
564 AC_MSG_RESULT($find_texprefix)
569 # find a directory inside a prefix,
570 # $1 the prefix (expanded version)
571 # $2 variable to assign
572 # $3 the directory name
574 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
576 AC_MSG_CHECKING($4 directory)
578 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
581 if test "x$find_dirdir" = x; then
583 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
587 AC_MSG_RESULT($1/$find_dirdir)
590 # ugh. this is hopeless
591 AC_DEFUN(AC_KPSE_TEX_DIR, [
592 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
593 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
595 if test -w "$kpse_syspaths";
597 dir=`echo $kpse_syspaths | head -1`
599 dir=`echo $kpse_paths | grep -v '!'| head -1`
601 if test "$prefix" = "NONE"; then
602 local_prefix=$ac_default_prefix
603 local_prefix_quote='${prefix}'
607 local_prefix_quote=$prefix
609 echo $local_prefix_quote = $local_prefix
611 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
614 AC_DEFUN(AC_TEX_SUBDIR, [
615 dnl AC_REQUIRE([AC_TEX_PREFIX])
616 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
620 AC_DEFUN(AC_MF_SUBDIR, [
621 dnl AC_REQUIRE([AC_TEX_PREFIX])
622 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
626 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
627 result="`echo \"$1\" | grep echo`"
628 if test "x$1" = "xerror" -o "x$result" != "x"; then
629 AC_STEPMAKE_WARN(can\'t find $2. $3)
634 # Configure paths for GTK+
635 # Owen Taylor 97-11-3
637 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
638 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
640 AC_DEFUN(AM_PATH_GTK,
642 dnl Get the cflags and libraries from the gtk-config script
644 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
645 min_gtk_version=ifelse([$1], ,1.1.1,$1)
646 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
648 if test "$GTK_CONFIG" != "no" ; then
649 GTK_CFLAGS=`$GTK_CONFIG --cflags`
650 GTK_LIBS=`$GTK_CONFIG --libs`
651 ac_save_CFLAGS="$CFLAGS"
653 ac_save_CXXFLAGS="$CXXFLAGS"
654 CFLAGS="$CFLAGS $GTK_CFLAGS"
655 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
656 LIBS="$LIBS $GTK_LIBS"
658 dnl Now check if the installed GTK is sufficiently new. (Also sanity
659 dnl checks the results of gtk-config to some extent
668 int major, minor, micro;
670 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
671 printf("%s, bad version string\n", "$min_gtk_version");
675 return !((gtk_major_version > major) ||
676 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
677 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
679 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
680 CFLAGS="$ac_save_CFLAGS"
681 CXXFLAGS="$ac_save_CXXFLAGS"
686 if test "x$no_gtk" = x ; then
688 ifelse([$2], , :, [$2])
693 ifelse([$3], , :, [$3])
695 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
702 # Configure paths for GTK--
703 # Erik Andersen 30 May 1998
704 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
706 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
707 dnl to be used as follows:
708 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
711 dnl Get the cflags and libraries from the gtkmm-config script
713 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
714 Prefix where GTK-- is installed (optional)],
715 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
716 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
717 Exec prefix where GTK-- is installed (optional)],
718 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
719 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
720 , enable_gtkmmtest=yes)
722 if test x$gtkmm_config_exec_prefix != x ; then
723 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
724 if test x${GTKMM_CONFIG+set} != xset ; then
725 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
728 if test x$gtkmm_config_prefix != x ; then
729 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
730 if test x${GTKMM_CONFIG+set} != xset ; then
731 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
736 AC_DEFUN(AM_PATH_GTKMM,
740 dnl Check check if the installed GTK-- is sufficiently new.
742 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
743 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
745 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
747 if test "$GTKMM_CONFIG" = "no" ; then
753 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
754 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
755 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
756 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
757 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
758 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
759 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
760 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
761 if test "x$enable_gtkmmtest" = "xyes" ; then
762 ac_save_CXXFLAGS="$CXXFLAGS"
764 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
765 LIBS="$LIBS $GTK___LIBS"
767 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
768 dnl checks the results of gtkmm-config to some extent
779 int major, minor, micro;
782 system ("touch conf.gtkmmtest");
784 /* HP/UX 0 (%@#!) writes to sscanf strings */
785 tmp_version = g_strdup("$min_gtkmm_version");
786 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
787 printf("%s, bad version string\n", "$min_gtkmm_version");
791 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
792 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
793 (gtkmm_micro_version != $gtkmm_config_micro_version))
795 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
796 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
797 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
798 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
799 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
800 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
801 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
802 printf("*** required on your system.\n");
803 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
804 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
805 printf("*** before re-running configure\n");
807 /* GTK-- does not have the GTKMM_*_VERSION constants */
809 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
810 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
811 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
813 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
814 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
815 printf("*** library (version %d.%d.%d)\n",
816 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
821 if ((gtkmm_major_version > major) ||
822 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
823 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
829 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
830 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
831 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
832 major, minor, micro);
833 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
835 printf("*** If you have already installed a sufficiently new version, this error\n");
836 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
837 printf("*** being found. The easiest way to fix this is to remove the old version\n");
838 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
839 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
840 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
841 printf("*** so that the correct libraries are found at run-time))\n");
846 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
847 CXXFLAGS="$ac_save_CXXFLAGS"
851 if test "x$no_gtkmm" = x ; then
853 ifelse([$2], , :, [$2])
856 if test "$GTKMM_CONFIG" = "no" ; then
857 echo "*** The gtkmm-config script installed by GTK-- could not be found"
858 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
859 echo "*** your path, or set the GTK_CONFIG environment variable to the"
860 echo "*** full path to gtk-config."
861 echo "*** The gtkmm-config script was not available in GTK-- versions"
862 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
863 echo "*** version to 0.9.12 or newer"
865 if test -f conf.gtkmmtest ; then
868 echo "*** Could not run GTK-- test program, checking why..."
869 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
870 LIBS="$LIBS $GTK___LIBS"
874 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
875 [ echo "*** The test program compiled, but did not run. This usually means"
876 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
877 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
878 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
879 echo "*** to the installed location Also, make sure you have run ldconfig if that"
880 echo "*** is required on your system"
882 echo "*** If you have an old version installed, it is best to remove it, although"
883 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
884 [ echo "*** The test program failed to compile or link. See the file config.log for the"
885 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
886 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
887 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
888 CXXFLAGS="$ac_save_CXXFLAGS"
894 ifelse([$3], , :, [$3])
897 AC_SUBST(GTK___CFLAGS)
902 # Configure paths for GTK--DRAW
903 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
905 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
906 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
908 AC_DEFUN(AM_PATH_GTK__DRAW,
910 dnl Get the cflags and libraries from the gtk__-config script
912 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
913 min_gtk___version=ifelse([$1], ,0.0.5,$1)
914 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
916 if test "$GTKMM_CONFIG" != "no" ; then
917 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
918 GTK___LIBS=`$GTKMM_CONFIG --libs`
919 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
920 GTK___LIBS="$GTK___DLIBS"
921 ac_save_CFLAGS="$CFLAGS"
923 ac_save_CXXFLAGS="$CXXFLAGS"
924 CFLAGS="$CFLAGS $GTK___CFLAGS"
925 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
926 LIBS="$LIBS $GTK___LIBS"
928 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
929 dnl checks the results of gtk__-config to some extent
941 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
942 CFLAGS="$ac_save_CFLAGS"
943 CXXFLAGS="$ac_save_CXXFLAGS"
948 if test "x$no_gtk__" = x ; then
950 ifelse([$2], , :, [$2])
955 ifelse([$3], , :, [$3])
957 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
959 AC_SUBST(GTK___CFLAGS)