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 aclocal.m4 -*-shell-script-*-
6 dnl StepMake subroutines for configure.in
8 AC_DEFUN(AC_STEPMAKE_COMPILE, [
9 # -O is necessary to get inlining
11 CXXFLAGS=${CXXFLAGS:-""}
18 AC_ARG_ENABLE(checking,
19 [ enable-checking set runtime checks (assert calls). Default: on],
20 [checking_b=$enableval] )
22 # actually, the default is: tja='-O' to get inlining...
25 #actually, that sucks.
26 # tja looks like a typo. Default is optimisation off. --hwn
28 AC_ARG_ENABLE(optimise,
29 [ enable-optimise use maximal speed optimisations. Default: off],
30 [optimise_b=$enableval])
32 AC_ARG_ENABLE(profiling,
33 [ enable-profiling compile with gprof support. Default: off],
34 [profile_b=$enableval])
36 AC_ARG_ENABLE(debugging,
37 [ enable-debugging set debug info. Default: on],
40 AC_ARG_ENABLE(mingw-prefix,
41 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
42 [MINGWPREFIX=$enableval],
45 if test "$printing_b" = no; then
48 DEFINES="$DEFINES -DNPRINT"
51 if test "$checking_b" = no; then
54 DEFINES="$DEFINES -DNDEBUG"
57 if test "$optimise_b" = yes; then
58 OPTIMIZE="-O2 -finline-functions"
61 if test "$optimise_b" = no; then
65 if test $profile_b = yes; then
67 OPTIMIZE="$OPTIMIZE -pg"
70 if test $debug_b = yes; then
71 OPTIMIZE="$OPTIMIZE -g"
74 # however, C++ support in mingw32 v 0.1.4 is still flaky
75 if test x$MINGWPREFIX != xno; then
76 ICFLAGS="-I$MINGWPREFIX/include"
77 ILDFLAGS="-$MINGWPREFIX/lib"
84 CFLAGS="$CFLAGS $OPTIMIZE"
85 CPPFLAGS=${CPPFLAGS:-""}
95 AC_DEFUN(AC_STEPMAKE_CXX, [
99 AC_CHECK_HEADER(FlexLexer.h, true,
100 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
102 CPPFLAGS="$CPPFLAGS $DEFINES"
103 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
112 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
113 AC_CACHE_CHECK([whether explicit instantiation is needed],
114 lily_cv_need_explicit_instantiation,
116 template <class T> struct foo { static int baz; };
117 template <class T> int foo<T>::baz = 1;
118 ], [ return foo<int>::baz; ],
119 lily_cv_need_explicit_instantiation=no,
120 lily_cv_need_explicit_instantiation=yes))
121 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
122 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
126 AC_DEFUN(AC_STEPMAKE_DATADIR, [
127 if test "$datadir" = "\${prefix}/share"; then
128 datadir='${prefix}/share/'$package
130 DIR_DATADIR=${datadir}
132 if test "$prefix" = "NONE"; then
133 presome=${ac_default_prefix}
135 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
137 AC_SUBST(DIR_DATADIR)
138 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
141 AC_DEFUN(AC_STEPMAKE_END, [
142 AC_OUTPUT($CONFIGFILE.make:config.make.in)
145 cp make/toplevel.make.in ./GNUmakefile
146 chmod 444 GNUmakefile
149 AC_DEFUN(AC_STEPMAKE_GXX, [
151 # urg, egcs: how to check for egcs >= 1.1?
152 changequote(<<, >>)dnl
153 if $CXX --version | egrep '2\.[89]' > /dev/null ||
154 $CXX --version | grep 'egcs' > /dev/null
159 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
163 AC_DEFUN(AC_STEPMAKE_GUILE, [
165 if guile-config --version 2>&1 | grep -q 'version 1\.[012]'; then
166 AC_STEPMAKE_WARN(Guile version 1.3 or better needed)
170 AC_DEFUN(AC_STEPMAKE_INIT, [
173 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
174 if test x$MY_PATCH_LEVEL != x; then
175 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
178 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
179 changequote(<<, >>)dnl
180 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
181 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
184 # No versioning on directory names of sub-packages
186 stepmake=${datadir}/stepmake
188 if test "$prefix" = "NONE"; then
189 presome=${ac_default_prefix}
191 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
193 AC_MSG_CHECKING(Package)
194 if test "x$PACKAGE" = "xSTEPMAKE"; then
195 AC_MSG_RESULT(Stepmake package!)
196 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
197 (cd stepmake; rm -f bin; ln -s ../bin .)
198 AC_CONFIG_AUX_DIR(bin)
201 AC_MSG_RESULT($PACKAGE)
202 AC_MSG_CHECKING(for stepmake)
203 # Check for installed stepmake
204 if test -d $stepmake; then
205 AC_MSG_RESULT($stepmake)
207 stepmake='$(depth)'/stepmake
208 AC_MSG_RESULT(./stepmake ($datadir/stepmake not found))
211 $HOME/usr/local/share/stepmake/bin\
212 $HOME/usr/local/lib/stepmake/bin\
213 $HOME/usr/share/stepmake/bin\
214 $HOME/usr/lib/stepmake/bin\
215 /usr/local/share/stepmake/bin\
216 /usr/local/lib/stepmake/bin\
217 /usr/share/stepmake/bin\
218 /usr/lib/stepmake/bin\
226 AC_SUBST(PACKAGE_NAME)
227 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
228 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
230 if test "$package_depth" = "" ; then
233 package_depth="../$package_depth"
236 AC_SUBST(package_depth)
238 AUTOGENERATE="This file was automatically generated by configure"
239 AC_SUBST(AUTOGENERATE)
240 absolute_builddir="`pwd`"
241 AC_SUBST(absolute_builddir)
243 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
244 if test "x$STATE_VECTOR" != "x"; then
245 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
247 AC_SUBST(STATE_VECTOR)
250 AC_ARG_ENABLE(config,
251 [ enable-config=FILE put configure settings in config-FILE.make],
252 [CONFIGSUFFIX=$enableval])
254 if test "$CONFIGSUFFIX" != "" ; then
255 CONFIGFILE=config-$CONFIGSUFFIX
259 AC_SUBST(CONFIGSUFFIX)
262 AC_CHECK_PROGS(MAKE, gmake make, error)
263 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)
273 if test "x`uname`" = "xHP-UX"; then
274 AC_PATH_PROG(BASH, bash, /bin/sh)
275 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
276 AC_PATH_PROG(SHELL, bash, /bin/ksh)
278 AC_PATH_PROG(BASH, bash, /bin/sh)
284 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
287 if test $MAKE != "error" ; then
288 $MAKE -v 2> /dev/null | grep GNU > /dev/null
291 AC_STEPMAKE_WARN(Please install *GNU* make)
295 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
297 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
298 LN=cp # hard link does not work under cygnus-nt
299 LN_S='cp -r' # symbolic link does not work for native nt
306 # cygwin fixes all these things.
307 # it seems these were used because of dos-style TEXINPUTS and
308 # MFINPUTS needed for miktex.
309 # but this breaks parsing of all other cygwin/unix style paths.
311 # if your (mik)tex breaks, make a:
312 # /usr/local/bin/tex:
314 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
320 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
322 # this way, you may have buildscripts/out/lilypond-profile
323 # 'automatically' sourced from /usr/etc/profile.d/ too.
327 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
334 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
341 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
342 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
350 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
351 # ugh, automake: we want (and check for) bison
353 # ugh, automake: we want (and check for) flex
355 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
359 ac_cv_prog_lex_root=lex.yy
361 AC_CHECK_PROGS(BISON, bison, error)
362 AC_CHECK_PROGS(FLEX, flex, error)
363 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
364 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
366 if test $BISON != "error"; then
367 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
368 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
369 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
377 AC_DEFUN(AC_STEPMAKE_LIB, [
378 AC_CHECK_PROGS(AR, ar, error)
385 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
387 # **Never** try to set library version numbers so that they correspond
388 # to the release number of your package. This is an abuse that only
389 # fosters misunderstanding of the purpose of library versions.
391 REVISION=$PATCH_LEVEL
392 # CURRENT=$MINOR_VERSION
393 CURRENT=`expr $MINOR_VERSION + 1`
394 # AGE=$(expr $MAJOR_VERSION + 1)
401 AC_DEFUN(AC_STEPMAKE_LOCALE, [
406 AC_ARG_WITH(localedir,
407 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
408 localedir=$with_localedir,
409 localedir='${prefix}/share/locale')
412 [ with-lang=LANG use LANG as language to emit messages],
416 AC_MSG_CHECKING(language)
418 En* | en* | Am* | am* | US* | us*)
420 NL | nl | Du* | du* | Ned* | ned*)
429 if test "$lang" = "unknown" ; then
430 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
435 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
436 DIR_LOCALEDIR=${localedir}
438 if test "$prefix" = "NONE"; then
439 presome=${ac_default_prefix}
441 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
443 AC_SUBST(DIR_LOCALEDIR)
444 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
446 AC_CHECK_LIB(intl, gettext)
447 AC_CHECK_FUNCS(gettext)
450 AC_DEFUN(AC_STEPMAKE_MAN, [
451 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
452 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
453 AC_CHECK_PROGS(TBL, tbl, cat)
456 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
457 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
458 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
459 AC_MSG_CHECKING(whether msgfmt accepts -o)
460 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
461 if test "$msgfmt_output" = ""; then
465 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
467 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
469 if test ! -n "$MSGFMT"; then
470 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
474 #why has this been dropped?
475 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
476 AC_ARG_ENABLE(tex-prefix,
477 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
478 [TEXPREFIX=$enableval],
481 AC_ARG_ENABLE(tex-dir,
482 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
486 AC_ARG_ENABLE(mf-dir,
487 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
491 if test "x$TEXPREFIX" = xauto ; then
492 AC_TEX_PREFIX(TEXPREFIX)
494 find_texprefix=$TEXPREFIX
497 if test "x$MFDIR" = xauto; then
501 if test "x$TEXDIR" = xauto ; then
502 AC_TEX_SUBDIR(TEXDIR)
509 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
510 AC_ARG_ENABLE(tex-tfmdir,
511 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
515 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
516 AC_MSG_CHECKING(for TeX TFM directory)
517 if test "x$TFMDIR" = xauto ; then
518 if test "x$TEX_TFMDIR" = "x" ; then
519 if test "x$KPSEWHICH" != "xno" ; then
520 CMR10=`kpsewhich tfm cmr10.tfm`
521 TEX_TFMDIR=`dirname $CMR10`
523 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
524 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
528 AC_MSG_RESULT($TEX_TFMDIR)
532 AC_DEFUN(AC_STEPMAKE_TEXMF, [
533 # urg, never know what names these teTeX guys will think up
535 AC_CHECK_PROGS(METAFONT, mf, no)
536 if test "x$METAFONT" = "xno"; then
537 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
541 AC_CHECK_PROGS(METAPOST, mp, no)
542 if test "x$METAPOST" = "xno"; then
543 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
548 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
549 if test "x$INIMETAFONT" = "xno"; then
550 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
551 INIMETAFONT=$INIMFONT
554 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
555 if test "x$INIMETAPOST" = "xno"; then
556 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
557 INIMETAPOST=$INIMPOST
560 AC_MSG_CHECKING(for working metafont mode)
561 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
562 for MFMODE in $modelist; do
563 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
564 if test -f mfput.tfm; then
569 AC_MSG_RESULT($MFMODE)
574 AC_SUBST(INIMETAFONT)
575 AC_SUBST(INIMETAPOST)
578 AC_DEFUN(AC_STEPMAKE_WARN, [
583 AC_DEFUN(AC_STEPMAKE_YODL, [
584 if test "x$YODL" = "x"; then
585 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
586 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
587 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
588 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
589 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
590 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
591 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
592 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
593 YODL2LESS_DIR='$(bindir)/'
599 AC_SUBST(YODL2LESS_DIR)
601 AC_SUBST(YODL2MSLESS)
602 AC_SUBST(YODL2TEXINFO)
604 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
606 if test "x$YODL" = "-echo no yodl"; then
607 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
611 dnl should cache result.
612 dnl should look in $prefix first.
613 dnl should probably assume TDS
615 AC_DEFUN(AC_TEX_PREFIX, [
618 AC_MSG_CHECKING(TeX/MF root dir directory)
620 find_root_prefix="$prefix"
623 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
625 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
626 find_texprefix="$find_root_prefix$postfix"
627 if test -d $find_texprefix; then
628 find_texpostfix=$postfix
633 if test "x$find_texpostfix" = x; then
634 find_texpostfix='/lib/texmf/tex'
635 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
638 find_texprefix="$find_root_prefix/$find_texpostfix"
640 # only assign if variablename not empty
641 if test x != "x[$]$1"; then
642 $1='${prefix}'/"$find_texpostfix"
644 AC_MSG_RESULT($find_texprefix)
649 # find a directory inside a prefix,
650 # $1 the prefix (expanded version)
651 # $2 variable to assign
652 # $3 the directory name
654 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
656 AC_MSG_CHECKING($4 directory)
658 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
661 if test "x$find_dirdir" = x; then
663 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
667 AC_MSG_RESULT($1/$find_dirdir)
670 # ugh. this is hopeless
671 AC_DEFUN(AC_KPSE_TEX_DIR, [
672 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
673 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
675 if test -w "$kpse_syspaths";
677 dir=`echo $kpse_syspaths | head -1`
679 dir=`echo $kpse_paths | grep -v '!'| head -1`
681 if test "$prefix" = "NONE"; then
682 local_prefix=$ac_default_prefix
683 local_prefix_quote='${prefix}'
687 local_prefix_quote=$prefix
689 echo $local_prefix_quote = $local_prefix
691 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
694 AC_DEFUN(AC_TEX_SUBDIR, [
695 dnl AC_REQUIRE([AC_TEX_PREFIX])
696 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
700 AC_DEFUN(AC_MF_SUBDIR, [
701 dnl AC_REQUIRE([AC_TEX_PREFIX])
702 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
706 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
707 result="`echo \"$1\" | grep echo`"
708 if test "x$1" = "xerror" -o "x$result" != "x"; then
709 AC_STEPMAKE_WARN(can\'t find $2. $3)
713 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
715 dnl This macro runs the `guile-config' script, installed with Guile,
716 dnl to find out where Guile's header files and libraries are
717 dnl installed. It sets two variables, marked for substitution, as
720 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
721 dnl code that uses Guile header files. This is almost
722 dnl always just a -I flag.
724 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
725 dnl program against Guile. This includes `-lguile' for
726 dnl the Guile library itself, any libraries that Guile
727 dnl itself requires (like -lqthreads), and so on. It may
728 dnl also include a -L flag to tell the compiler where to
729 dnl find the libraries.
731 AC_DEFUN([GUILE_FLAGS],[
732 ## The GUILE_FLAGS macro.
733 ## First, let's just see if we can find Guile at all.
734 AC_MSG_CHECKING(for Guile)
735 guile-config link > /dev/null || {
736 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
739 GUILE_CFLAGS="`guile-config compile`"
740 GUILE_LDFLAGS="`guile-config link`"
741 AC_SUBST(GUILE_CFLAGS)
742 AC_SUBST(GUILE_LDFLAGS)
747 # Configure paths for GTK+
748 # Owen Taylor 97-11-3
750 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
751 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
753 AC_DEFUN(AM_PATH_GTK,
755 dnl Get the cflags and libraries from the gtk-config script
757 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
758 min_gtk_version=ifelse([$1], ,1.1.1,$1)
759 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
761 if test "$GTK_CONFIG" != "no" ; then
762 GTK_CFLAGS=`$GTK_CONFIG --cflags`
763 GTK_LIBS=`$GTK_CONFIG --libs`
764 ac_save_CFLAGS="$CFLAGS"
766 ac_save_CXXFLAGS="$CXXFLAGS"
767 CFLAGS="$CFLAGS $GTK_CFLAGS"
768 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
769 LIBS="$LIBS $GTK_LIBS"
771 dnl Now check if the installed GTK is sufficiently new. (Also sanity
772 dnl checks the results of gtk-config to some extent)
781 int major, minor, micro;
783 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
784 printf("%s, bad version string\n", "$min_gtk_version");
788 return !((gtk_major_version > major) ||
789 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
790 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
792 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
793 CFLAGS="$ac_save_CFLAGS"
794 CXXFLAGS="$ac_save_CXXFLAGS"
799 if test "x$no_gtk" = x ; then
801 ifelse([$2], , :, [$2])
806 ifelse([$3], , :, [$3])
808 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
815 # Configure paths for GTK--
816 # Erik Andersen 30 May 1998
817 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
819 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
820 dnl to be used as follows:
821 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
824 dnl Get the cflags and libraries from the gtkmm-config script
826 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
827 Prefix where GTK-- is installed (optional)],
828 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
829 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
830 Exec prefix where GTK-- is installed (optional)],
831 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
832 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
833 , enable_gtkmmtest=yes)
835 if test x$gtkmm_config_exec_prefix != x ; then
836 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
837 if test x${GTKMM_CONFIG+set} != xset ; then
838 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
841 if test x$gtkmm_config_prefix != x ; then
842 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
843 if test x${GTKMM_CONFIG+set} != xset ; then
844 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
849 AC_DEFUN(AM_PATH_GTKMM,
853 dnl Check if the installed GTK-- is sufficiently new.
855 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
856 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
858 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
860 if test "$GTKMM_CONFIG" = "no" ; then
866 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
867 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
868 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
869 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
870 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
871 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
872 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
873 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
874 if test "x$enable_gtkmmtest" = "xyes" ; then
875 ac_save_CXXFLAGS="$CXXFLAGS"
877 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
878 LIBS="$LIBS $GTK___LIBS"
880 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
881 dnl checks the results of gtkmm-config to some extent
892 int major, minor, micro;
895 system ("touch conf.gtkmmtest");
897 /* HP/UX 0 (%@#!) writes to sscanf strings */
898 tmp_version = g_strdup("$min_gtkmm_version");
899 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
900 printf("%s, bad version string\n", "$min_gtkmm_version");
904 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
905 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
906 (gtkmm_micro_version != $gtkmm_config_micro_version))
908 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
909 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
910 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
911 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
912 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
913 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
914 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
915 printf("*** required on your system.\n");
916 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
917 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
918 printf("*** before re-running configure\n");
920 /* GTK-- does not have the GTKMM_*_VERSION constants */
922 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
923 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
924 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
926 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
927 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
928 printf("*** library (version %d.%d.%d)\n",
929 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
934 if ((gtkmm_major_version > major) ||
935 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
936 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
942 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
943 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
944 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
945 major, minor, micro);
946 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
948 printf("*** If you have already installed a sufficiently new version, this error\n");
949 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
950 printf("*** being found. The easiest way to fix this is to remove the old version\n");
951 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
952 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
953 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
954 printf("*** so that the correct libraries are found at run-time))\n");
959 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
960 CXXFLAGS="$ac_save_CXXFLAGS"
964 if test "x$no_gtkmm" = x ; then
966 ifelse([$2], , :, [$2])
969 if test "$GTKMM_CONFIG" = "no" ; then
970 echo "*** The gtkmm-config script installed by GTK-- could not be found"
971 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
972 echo "*** your path, or set the GTK_CONFIG environment variable to the"
973 echo "*** full path to gtk-config."
974 echo "*** The gtkmm-config script was not available in GTK-- versions"
975 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
976 echo "*** version to 0.9.12 or newer"
978 if test -f conf.gtkmmtest ; then
981 echo "*** Could not run GTK-- test program, checking why..."
982 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
983 LIBS="$LIBS $GTK___LIBS"
987 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
988 [ echo "*** The test program compiled, but did not run. This usually means"
989 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
990 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
991 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
992 echo "*** to the installed location Also, make sure you have run ldconfig if that"
993 echo "*** is required on your system"
995 echo "*** If you have an old version installed, it is best to remove it, although"
996 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
997 [ echo "*** The test program failed to compile or link. See the file config.log for the"
998 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
999 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1000 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1001 CXXFLAGS="$ac_save_CXXFLAGS"
1002 LIBS="$ac_save_LIBS"
1007 ifelse([$3], , :, [$3])
1010 AC_SUBST(GTK___CFLAGS)
1011 AC_SUBST(GTK___LIBS)
1012 rm -f conf.gtkmmtest
1015 # Configure paths for GTK--DRAW
1016 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1018 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1019 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1021 AC_DEFUN(AM_PATH_GTK__DRAW,
1023 dnl Get the cflags and libraries from the gtk__-config script
1025 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1026 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1027 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1029 if test "$GTKMM_CONFIG" != "no" ; then
1030 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1031 GTK___LIBS=`$GTKMM_CONFIG --libs`
1032 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1033 GTK___LIBS="$GTK___DLIBS"
1034 ac_save_CFLAGS="$CFLAGS"
1035 ac_save_LIBS="$LIBS"
1036 ac_save_CXXFLAGS="$CXXFLAGS"
1037 CFLAGS="$CFLAGS $GTK___CFLAGS"
1038 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1039 LIBS="$LIBS $GTK___LIBS"
1041 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1042 dnl checks the results of gtk__-config to some extent)
1054 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1055 CFLAGS="$ac_save_CFLAGS"
1056 CXXFLAGS="$ac_save_CXXFLAGS"
1057 LIBS="$ac_save_LIBS"
1061 if test "x$no_gtk__" = x ; then
1063 ifelse([$2], , :, [$2])
1068 ifelse([$3], , :, [$3])
1070 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1072 AC_SUBST(GTK___CFLAGS)
1073 AC_SUBST(GTK___LIBS)