1 dnl WARNING WARNING WARNING WARNING
2 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
3 dnl WARNING WARNING WARNING WARNING
4 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
5 dnl WARNING WARNING WARNING WARNING
6 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
7 dnl aclocal.m4 -*-shell-script-*-
8 dnl StepMake subroutines for configure.in
10 AC_DEFUN(AC_STEPMAKE_COMPILE, [
11 # -O is necessary to get inlining
13 CXXFLAGS=${CXXFLAGS:-""}
20 AC_ARG_ENABLE(checking,
21 [ enable-checking set runtime checks (assert calls). Default: on],
22 [checking_b=$enableval] )
24 # actually, the default is: tja='-O' to get inlining...
27 #actually, that sucks.
28 # tja looks like a typo. Default is optimisation off. --hwn
30 AC_ARG_ENABLE(optimise,
31 [ enable-optimise use maximal speed optimisations. Default: off],
32 [optimise_b=$enableval])
34 AC_ARG_ENABLE(profiling,
35 [ enable-profiling compile with gprof support. Default: off],
36 [profile_b=$enableval])
38 AC_ARG_ENABLE(debugging,
39 [ enable-debugging set debug info. Default: on],
42 AC_ARG_ENABLE(mingw-prefix,
43 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
44 [MINGWPREFIX=$enableval],
47 if test "$printing_b" = no; then
50 DEFINES="$DEFINES -DNPRINT"
53 if test "$checking_b" = no; then
56 DEFINES="$DEFINES -DNDEBUG"
59 if test "$optimise_b" = yes; then
60 OPTIMIZE="-O2 -finline-functions"
63 if test "$optimise_b" = no; then
67 if test $profile_b = yes; then
69 OPTIMIZE="$OPTIMIZE -pg"
72 if test $debug_b = yes; then
73 OPTIMIZE="$OPTIMIZE -g"
76 # however, C++ support in mingw32 v 0.1.4 is still flaky
77 if test x$MINGWPREFIX != xno; then
78 ICFLAGS="-I$MINGWPREFIX/include"
79 ILDFLAGS="-$MINGWPREFIX/lib"
86 CFLAGS="$CFLAGS $OPTIMIZE"
87 CPPFLAGS=${CPPFLAGS:-""}
97 AC_DEFUN(AC_STEPMAKE_CXX, [
101 AC_CHECK_HEADER(FlexLexer.h, true,
102 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
104 CPPFLAGS="$CPPFLAGS $DEFINES"
105 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
114 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
115 AC_CACHE_CHECK([whether explicit instantiation is needed],
116 lily_cv_need_explicit_instantiation,
118 template <class T> struct foo { static int baz; };
119 template <class T> int foo<T>::baz = 1;
120 ], [ return foo<int>::baz; ],
121 lily_cv_need_explicit_instantiation=no,
122 lily_cv_need_explicit_instantiation=yes))
123 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
124 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
128 AC_DEFUN(AC_STEPMAKE_DATADIR, [
129 if test "$datadir" = "\${prefix}/share"; then
130 datadir='${prefix}/share/'$package
132 DIR_DATADIR=${datadir}
134 if test "$prefix" = "NONE"; then
135 presome=${ac_default_prefix}
137 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
139 AC_SUBST(DIR_DATADIR)
140 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
143 AC_DEFUN(AC_STEPMAKE_END, [
144 AC_OUTPUT($CONFIGFILE.make:config.make.in)
147 cp make/toplevel.make.in ./GNUmakefile
148 chmod 444 GNUmakefile
151 AC_DEFUN(AC_STEPMAKE_GXX, [
153 # urg, egcs: how to check for egcs >= 1.1?
154 changequote(<<, >>)dnl
155 if $CXX --version | egrep '2\.[89]' > /dev/null ||
156 $CXX --version | grep 'egcs' > /dev/null
161 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
165 AC_DEFUN(AC_STEPMAKE_GUILE, [
167 if guile-config --version 2>&1 | grep -q 'version 1\.[012]'; then
168 AC_STEPMAKE_WARN(Guile version 1.3 or better needed)
172 AC_DEFUN(AC_STEPMAKE_INIT, [
175 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
176 if test x$MY_PATCH_LEVEL != x; then
177 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
180 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
181 changequote(<<, >>)dnl
182 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
183 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
186 # No versioning on directory names of sub-packages
188 stepmake=${datadir}/stepmake
190 if test "$prefix" = "NONE"; then
191 presome=${ac_default_prefix}
193 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
195 AC_MSG_CHECKING(Package)
196 if test "x$PACKAGE" = "xSTEPMAKE"; then
197 AC_MSG_RESULT(Stepmake package!)
198 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
199 (cd stepmake; rm -f bin; ln -s ../bin .)
200 AC_CONFIG_AUX_DIR(bin)
203 AC_MSG_RESULT($PACKAGE)
204 AC_MSG_CHECKING(for stepmake)
205 # Check for installed stepmake
206 if test -d $stepmake; then
207 AC_MSG_RESULT($stepmake)
209 stepmake='$(depth)'/stepmake
210 AC_MSG_RESULT(./stepmake ($datadir/stepmake not found))
213 $HOME/usr/local/share/stepmake/bin\
214 $HOME/usr/local/lib/stepmake/bin\
215 $HOME/usr/share/stepmake/bin\
216 $HOME/usr/lib/stepmake/bin\
217 /usr/local/share/stepmake/bin\
218 /usr/local/lib/stepmake/bin\
219 /usr/share/stepmake/bin\
220 /usr/lib/stepmake/bin\
228 AC_SUBST(PACKAGE_NAME)
229 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
230 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
232 if test "$package_depth" = "" ; then
235 package_depth="../$package_depth"
238 AC_SUBST(package_depth)
240 AUTOGENERATE="This file was automatically generated by configure"
241 AC_SUBST(AUTOGENERATE)
242 absolute_builddir="`pwd`"
243 AC_SUBST(absolute_builddir)
245 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
246 if test "x$STATE_VECTOR" != "x"; then
247 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
249 AC_SUBST(STATE_VECTOR)
252 AC_ARG_ENABLE(config,
253 [ enable-config=FILE put configure settings in config-FILE.make],
254 [CONFIGSUFFIX=$enableval])
256 if test "$CONFIGSUFFIX" != "" ; then
257 CONFIGFILE=config-$CONFIGSUFFIX
261 AC_SUBST(CONFIGSUFFIX)
264 AC_CHECK_PROGS(MAKE, gmake make, error)
265 AC_CHECK_PROGS(FIND, find, error)
267 dnl system supplied INSTALL is unsafe; use our own install.
269 dnl if test "$INSTALL" = "bin/install-sh"; then
270 dnl export INSTALL="\$\(depth\)/bin/install-sh"
273 AC_CHECK_PROGS(TAR, tar, error)
275 if test "x`uname`" = "xHP-UX"; then
276 AC_PATH_PROG(BASH, bash, /bin/sh)
277 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
278 AC_PATH_PROG(SHELL, bash, /bin/ksh)
280 AC_PATH_PROG(BASH, bash, /bin/sh)
286 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
289 if test $MAKE != "error" ; then
290 $MAKE -v 2> /dev/null | grep GNU > /dev/null
293 AC_STEPMAKE_WARN(Please install *GNU* make)
297 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
299 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
300 LN=cp # hard link does not work under cygnus-nt
301 LN_S='cp -r' # symbolic link does not work for native nt
308 # cygwin fixes all these things.
309 # it seems these were used because of dos-style TEXINPUTS and
310 # MFINPUTS needed for miktex.
311 # but this breaks parsing of all other cygwin/unix style paths.
313 # if your (mik)tex breaks, make a:
314 # /usr/local/bin/tex:
316 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
322 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
324 # this way, you may have buildscripts/out/lilypond-profile
325 # 'automatically' sourced from /usr/etc/profile.d/ too.
329 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
336 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
343 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
344 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
352 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
353 # ugh, automake: we want (and check for) bison
355 # ugh, automake: we want (and check for) flex
357 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
361 ac_cv_prog_lex_root=lex.yy
363 AC_CHECK_PROGS(BISON, bison, error)
364 AC_CHECK_PROGS(FLEX, flex, error)
365 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
366 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
368 if test $BISON != "error"; then
369 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
370 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
371 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
379 AC_DEFUN(AC_STEPMAKE_LIB, [
380 AC_CHECK_PROGS(AR, ar, error)
387 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
389 # **Never** try to set library version numbers so that they correspond
390 # to the release number of your package. This is an abuse that only
391 # fosters misunderstanding of the purpose of library versions.
393 REVISION=$PATCH_LEVEL
394 # CURRENT=$MINOR_VERSION
395 CURRENT=`expr $MINOR_VERSION + 1`
396 # AGE=$(expr $MAJOR_VERSION + 1)
403 AC_DEFUN(AC_STEPMAKE_LOCALE, [
408 AC_ARG_WITH(localedir,
409 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
410 localedir=$with_localedir,
411 localedir='${prefix}/share/locale')
414 [ with-lang=LANG use LANG as language to emit messages],
418 AC_MSG_CHECKING(language)
420 En* | en* | Am* | am* | US* | us*)
422 NL | nl | Du* | du* | Ned* | ned*)
431 if test "$lang" = "unknown" ; then
432 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
437 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
438 DIR_LOCALEDIR=${localedir}
440 if test "$prefix" = "NONE"; then
441 presome=${ac_default_prefix}
443 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
445 AC_SUBST(DIR_LOCALEDIR)
446 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
448 AC_CHECK_LIB(intl, gettext)
449 AC_CHECK_FUNCS(gettext)
452 AC_DEFUN(AC_STEPMAKE_MAN, [
453 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
454 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
455 AC_CHECK_PROGS(TBL, tbl, cat)
458 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
459 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
460 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
461 AC_MSG_CHECKING(whether msgfmt accepts -o)
462 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
463 if test "$msgfmt_output" = ""; then
467 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
469 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
471 if test ! -n "$MSGFMT"; then
472 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
476 #why has this been dropped?
477 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
478 AC_ARG_ENABLE(tex-prefix,
479 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
480 [TEXPREFIX=$enableval],
483 AC_ARG_ENABLE(tex-dir,
484 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
488 AC_ARG_ENABLE(mf-dir,
489 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
493 if test "x$TEXPREFIX" = xauto ; then
494 AC_TEX_PREFIX(TEXPREFIX)
496 find_texprefix=$TEXPREFIX
499 if test "x$MFDIR" = xauto; then
503 if test "x$TEXDIR" = xauto ; then
504 AC_TEX_SUBDIR(TEXDIR)
511 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
512 AC_ARG_ENABLE(tex-tfmdir,
513 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
517 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
518 AC_MSG_CHECKING(for TeX TFM directory)
519 if test "x$TFMDIR" = xauto ; then
520 if test "x$TEX_TFMDIR" = "x" ; then
521 if test "x$KPSEWHICH" != "xno" ; then
522 CMR10=`kpsewhich tfm cmr10.tfm`
523 TEX_TFMDIR=`dirname $CMR10`
525 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
526 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
530 AC_MSG_RESULT($TEX_TFMDIR)
534 AC_DEFUN(AC_STEPMAKE_TEXMF, [
535 # urg, never know what names these teTeX guys will think up
537 AC_CHECK_PROGS(METAFONT, mf, no)
538 if test "x$METAFONT" = "xno"; then
539 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
543 AC_CHECK_PROGS(METAPOST, mp, no)
544 if test "x$METAPOST" = "xno"; then
545 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
550 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
551 if test "x$INIMETAFONT" = "xno"; then
552 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
553 INIMETAFONT=$INIMFONT
556 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
557 if test "x$INIMETAPOST" = "xno"; then
558 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
559 INIMETAPOST=$INIMPOST
562 AC_MSG_CHECKING(for working metafont mode)
563 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
564 for MFMODE in $modelist; do
565 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
566 if test -f mfput.tfm; then
571 AC_MSG_RESULT($MFMODE)
576 AC_SUBST(INIMETAFONT)
577 AC_SUBST(INIMETAPOST)
580 AC_DEFUN(AC_STEPMAKE_WARN, [
585 AC_DEFUN(AC_STEPMAKE_YODL, [
586 if test "x$YODL" = "x"; then
587 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
588 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
589 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
590 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
591 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
592 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
593 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
594 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
595 YODL2LESS_DIR='$(bindir)/'
601 AC_SUBST(YODL2LESS_DIR)
603 AC_SUBST(YODL2MSLESS)
604 AC_SUBST(YODL2TEXINFO)
606 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
608 if test "x$YODL" = "-echo no yodl"; then
609 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
613 dnl should cache result.
614 dnl should look in $prefix first.
615 dnl should probably assume TDS
617 AC_DEFUN(AC_TEX_PREFIX, [
620 AC_MSG_CHECKING(TeX/MF root dir directory)
622 find_root_prefix="$prefix"
625 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
627 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
628 find_texprefix="$find_root_prefix$postfix"
629 if test -d $find_texprefix; then
630 find_texpostfix=$postfix
635 if test "x$find_texpostfix" = x; then
636 find_texpostfix='/lib/texmf/tex'
637 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
640 find_texprefix="$find_root_prefix/$find_texpostfix"
642 # only assign if variablename not empty
643 if test x != "x[$]$1"; then
644 $1='${prefix}'/"$find_texpostfix"
646 AC_MSG_RESULT($find_texprefix)
651 # find a directory inside a prefix,
652 # $1 the prefix (expanded version)
653 # $2 variable to assign
654 # $3 the directory name
656 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
658 AC_MSG_CHECKING($4 directory)
660 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
663 if test "x$find_dirdir" = x; then
665 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
669 AC_MSG_RESULT($1/$find_dirdir)
672 # ugh. this is hopeless
673 AC_DEFUN(AC_KPSE_TEX_DIR, [
674 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
675 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
677 if test -w "$kpse_syspaths";
679 dir=`echo $kpse_syspaths | head -1`
681 dir=`echo $kpse_paths | grep -v '!'| head -1`
683 if test "$prefix" = "NONE"; then
684 local_prefix=$ac_default_prefix
685 local_prefix_quote='${prefix}'
689 local_prefix_quote=$prefix
691 echo $local_prefix_quote = $local_prefix
693 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
696 AC_DEFUN(AC_TEX_SUBDIR, [
697 dnl AC_REQUIRE([AC_TEX_PREFIX])
698 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
702 AC_DEFUN(AC_MF_SUBDIR, [
703 dnl AC_REQUIRE([AC_TEX_PREFIX])
704 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
708 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
709 result="`echo \"$1\" | grep echo`"
710 if test "x$1" = "xerror" -o "x$result" != "x"; then
711 AC_STEPMAKE_WARN(can\'t find $2. $3)
715 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
717 dnl This macro runs the `guile-config' script, installed with Guile,
718 dnl to find out where Guile's header files and libraries are
719 dnl installed. It sets two variables, marked for substitution, as
722 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
723 dnl code that uses Guile header files. This is almost
724 dnl always just a -I flag.
726 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
727 dnl program against Guile. This includes `-lguile' for
728 dnl the Guile library itself, any libraries that Guile
729 dnl itself requires (like -lqthreads), and so on. It may
730 dnl also include a -L flag to tell the compiler where to
731 dnl find the libraries.
733 AC_DEFUN([GUILE_FLAGS],[
734 ## The GUILE_FLAGS macro.
735 ## First, let's just see if we can find Guile at all.
736 AC_MSG_CHECKING(for Guile)
737 guile-config link > /dev/null || {
738 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
741 GUILE_CFLAGS="`guile-config compile`"
742 GUILE_LDFLAGS="`guile-config link`"
743 AC_SUBST(GUILE_CFLAGS)
744 AC_SUBST(GUILE_LDFLAGS)
749 # Configure paths for GTK+
750 # Owen Taylor 97-11-3
752 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
753 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
755 AC_DEFUN(AM_PATH_GTK,
757 dnl Get the cflags and libraries from the gtk-config script
759 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
760 min_gtk_version=ifelse([$1], ,1.1.1,$1)
761 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
763 if test "$GTK_CONFIG" != "no" ; then
764 GTK_CFLAGS=`$GTK_CONFIG --cflags`
765 GTK_LIBS=`$GTK_CONFIG --libs`
766 ac_save_CFLAGS="$CFLAGS"
768 ac_save_CXXFLAGS="$CXXFLAGS"
769 CFLAGS="$CFLAGS $GTK_CFLAGS"
770 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
771 LIBS="$LIBS $GTK_LIBS"
773 dnl Now check if the installed GTK is sufficiently new. (Also sanity
774 dnl checks the results of gtk-config to some extent)
783 int major, minor, micro;
785 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
786 printf("%s, bad version string\n", "$min_gtk_version");
790 return !((gtk_major_version > major) ||
791 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
792 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
794 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
795 CFLAGS="$ac_save_CFLAGS"
796 CXXFLAGS="$ac_save_CXXFLAGS"
801 if test "x$no_gtk" = x ; then
803 ifelse([$2], , :, [$2])
808 ifelse([$3], , :, [$3])
810 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
817 # Configure paths for GTK--
818 # Erik Andersen 30 May 1998
819 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
821 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
822 dnl to be used as follows:
823 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
826 dnl Get the cflags and libraries from the gtkmm-config script
828 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
829 Prefix where GTK-- is installed (optional)],
830 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
831 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
832 Exec prefix where GTK-- is installed (optional)],
833 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
834 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
835 , enable_gtkmmtest=yes)
837 if test x$gtkmm_config_exec_prefix != x ; then
838 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
839 if test x${GTKMM_CONFIG+set} != xset ; then
840 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
843 if test x$gtkmm_config_prefix != x ; then
844 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
845 if test x${GTKMM_CONFIG+set} != xset ; then
846 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
851 AC_DEFUN(AM_PATH_GTKMM,
855 dnl Check if the installed GTK-- is sufficiently new.
857 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
858 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
860 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
862 if test "$GTKMM_CONFIG" = "no" ; then
868 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
869 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
870 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
871 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
872 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
873 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
874 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
875 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
876 if test "x$enable_gtkmmtest" = "xyes" ; then
877 ac_save_CXXFLAGS="$CXXFLAGS"
879 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
880 LIBS="$LIBS $GTK___LIBS"
882 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
883 dnl checks the results of gtkmm-config to some extent
894 int major, minor, micro;
897 system ("touch conf.gtkmmtest");
899 /* HP/UX 0 (%@#!) writes to sscanf strings */
900 tmp_version = g_strdup("$min_gtkmm_version");
901 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
902 printf("%s, bad version string\n", "$min_gtkmm_version");
906 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
907 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
908 (gtkmm_micro_version != $gtkmm_config_micro_version))
910 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
911 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
912 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
913 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
914 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
915 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
916 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
917 printf("*** required on your system.\n");
918 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
919 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
920 printf("*** before re-running configure\n");
922 /* GTK-- does not have the GTKMM_*_VERSION constants */
924 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
925 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
926 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
928 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
929 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
930 printf("*** library (version %d.%d.%d)\n",
931 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
936 if ((gtkmm_major_version > major) ||
937 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
938 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
944 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
945 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
946 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
947 major, minor, micro);
948 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
950 printf("*** If you have already installed a sufficiently new version, this error\n");
951 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
952 printf("*** being found. The easiest way to fix this is to remove the old version\n");
953 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
954 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
955 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
956 printf("*** so that the correct libraries are found at run-time))\n");
961 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
962 CXXFLAGS="$ac_save_CXXFLAGS"
966 if test "x$no_gtkmm" = x ; then
968 ifelse([$2], , :, [$2])
971 if test "$GTKMM_CONFIG" = "no" ; then
972 echo "*** The gtkmm-config script installed by GTK-- could not be found"
973 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
974 echo "*** your path, or set the GTK_CONFIG environment variable to the"
975 echo "*** full path to gtk-config."
976 echo "*** The gtkmm-config script was not available in GTK-- versions"
977 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
978 echo "*** version to 0.9.12 or newer"
980 if test -f conf.gtkmmtest ; then
983 echo "*** Could not run GTK-- test program, checking why..."
984 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
985 LIBS="$LIBS $GTK___LIBS"
989 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
990 [ echo "*** The test program compiled, but did not run. This usually means"
991 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
992 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
993 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
994 echo "*** to the installed location Also, make sure you have run ldconfig if that"
995 echo "*** is required on your system"
997 echo "*** If you have an old version installed, it is best to remove it, although"
998 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
999 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1000 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1001 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1002 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1003 CXXFLAGS="$ac_save_CXXFLAGS"
1004 LIBS="$ac_save_LIBS"
1009 ifelse([$3], , :, [$3])
1012 AC_SUBST(GTK___CFLAGS)
1013 AC_SUBST(GTK___LIBS)
1014 rm -f conf.gtkmmtest
1017 # Configure paths for GTK--DRAW
1018 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1020 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1021 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1023 AC_DEFUN(AM_PATH_GTK__DRAW,
1025 dnl Get the cflags and libraries from the gtk__-config script
1027 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1028 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1029 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1031 if test "$GTKMM_CONFIG" != "no" ; then
1032 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1033 GTK___LIBS=`$GTKMM_CONFIG --libs`
1034 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1035 GTK___LIBS="$GTK___DLIBS"
1036 ac_save_CFLAGS="$CFLAGS"
1037 ac_save_LIBS="$LIBS"
1038 ac_save_CXXFLAGS="$CXXFLAGS"
1039 CFLAGS="$CFLAGS $GTK___CFLAGS"
1040 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1041 LIBS="$LIBS $GTK___LIBS"
1043 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1044 dnl checks the results of gtk__-config to some extent)
1056 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1057 CFLAGS="$ac_save_CFLAGS"
1058 CXXFLAGS="$ac_save_CXXFLAGS"
1059 LIBS="$ac_save_LIBS"
1063 if test "x$no_gtk__" = x ; then
1065 ifelse([$2], , :, [$2])
1070 ifelse([$3], , :, [$3])
1072 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1074 AC_SUBST(GTK___CFLAGS)
1075 AC_SUBST(GTK___LIBS)