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
12 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
13 LDFLAGS=${LDFLAGS:-""}
19 AC_ARG_ENABLE(checking,
20 [ enable-checking set runtime checks (assert calls). Default: on],
21 [checking_b=$enableval] )
23 # actually, the default is: tja='-O' to get inlining...
26 #actually, that sucks.
27 # tja looks like a typo. Default is optimisation off. --hwn
29 AC_ARG_ENABLE(optimise,
30 [ enable-optimise use maximal speed optimisations. Default: off],
31 [optimise_b=$enableval])
33 AC_ARG_ENABLE(profiling,
34 [ enable-profiling compile with gprof support. Default: off],
35 [profile_b=$enableval])
37 AC_ARG_ENABLE(debugging,
38 [ enable-debugging set debug info. Default: on],
41 AC_ARG_ENABLE(mingw-prefix,
42 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
43 [MINGWPREFIX=$enableval],
46 if test "$checking_b" = no; then
49 DEFINES="$DEFINES -DNDEBUG"
52 if test "$optimise_b" = yes; then
53 OPTIMIZE="-O2 -finline-functions"
56 if test "$optimise_b" = no; then
60 if test $profile_b = yes; then
62 OPTIMIZE="$OPTIMIZE -pg"
65 if test $debug_b = yes; then
66 OPTIMIZE="$OPTIMIZE -g"
69 # however, C++ support in mingw32 v 0.1.4 is still flaky
70 if test x$MINGWPREFIX != xno; then
71 ICFLAGS="-I$MINGWPREFIX/include"
72 ILDFLAGS="-$MINGWPREFIX/lib"
79 CFLAGS="$CFLAGS $OPTIMIZE"
80 CPPFLAGS=${CPPFLAGS:-""}
90 AC_DEFUN(AC_STEPMAKE_CXX, [
94 AC_CHECK_HEADER(FlexLexer.h, true,
95 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
97 CPPFLAGS="$CPPFLAGS $DEFINES"
98 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
99 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
107 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
108 AC_CACHE_CHECK([whether explicit instantiation is needed],
109 lily_cv_need_explicit_instantiation,
111 template <class T> struct foo { static int baz; };
112 template <class T> int foo<T>::baz = 1;
113 ], [ return foo<int>::baz; ],
114 lily_cv_need_explicit_instantiation=no,
115 lily_cv_need_explicit_instantiation=yes))
116 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
117 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
121 AC_DEFUN(AC_STEPMAKE_DATADIR, [
122 if test "$datadir" = "\${prefix}/share"; then
123 datadir='${prefix}/share/'$package
125 DIR_DATADIR=${datadir}
127 if test "$prefix" = "NONE"; then
128 presome=${ac_default_prefix}
130 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
132 AC_SUBST(DIR_DATADIR)
133 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
136 AC_DEFUN(AC_STEPMAKE_END, [
137 AC_OUTPUT($CONFIGFILE.make:config.make.in)
140 cp make/toplevel.make.in ./GNUmakefile
141 chmod 444 GNUmakefile
144 AC_DEFUN(AC_STEPMAKE_GXX, [
146 # urg, egcs: how to check for egcs >= 1.1?
147 changequote(<<, >>)dnl
148 if $CXX --version | egrep '2\.[89]' > /dev/null ||
149 $CXX --version | grep 'egcs' > /dev/null
154 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
158 AC_DEFUN(AC_STEPMAKE_GUILE, [
160 if guile-config --version 2>&1 | grep -q 'version 1\.[012]'; then
161 AC_STEPMAKE_WARN(Guile version 1.3 or better needed)
165 AC_DEFUN(AC_STEPMAKE_INIT, [
168 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
169 if test x$MY_PATCH_LEVEL != x; then
170 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
173 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
174 changequote(<<, >>)dnl
175 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
176 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
179 # No versioning on directory names of sub-packages
181 stepmake=${datadir}/stepmake
183 if test "$prefix" = "NONE"; then
184 presome=${ac_default_prefix}
186 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
188 AC_MSG_CHECKING(Package)
189 if test "x$PACKAGE" = "xSTEPMAKE"; then
190 AC_MSG_RESULT(Stepmake package!)
191 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
192 (cd stepmake; rm -f bin; ln -s ../bin .)
193 AC_CONFIG_AUX_DIR(bin)
196 AC_MSG_RESULT($PACKAGE)
197 AC_MSG_CHECKING(for stepmake)
198 # Check for installed stepmake
199 if test -d $stepmake; then
200 AC_MSG_RESULT($stepmake)
202 stepmake='$(depth)'/stepmake
203 AC_MSG_RESULT(./stepmake ($datadir/stepmake not found))
206 $HOME/usr/local/share/stepmake/bin\
207 $HOME/usr/local/lib/stepmake/bin\
208 $HOME/usr/share/stepmake/bin\
209 $HOME/usr/lib/stepmake/bin\
210 /usr/local/share/stepmake/bin\
211 /usr/local/lib/stepmake/bin\
212 /usr/share/stepmake/bin\
213 /usr/lib/stepmake/bin\
221 AC_SUBST(PACKAGE_NAME)
222 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
223 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
225 if test "$package_depth" = "" ; then
228 package_depth="../$package_depth"
231 AC_SUBST(package_depth)
233 AUTOGENERATE="This file was automatically generated by configure"
234 AC_SUBST(AUTOGENERATE)
235 absolute_builddir="`pwd`"
236 AC_SUBST(absolute_builddir)
238 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
239 if test "x$STATE_VECTOR" != "x"; then
240 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
242 AC_SUBST(STATE_VECTOR)
245 AC_ARG_ENABLE(config,
246 [ enable-config=FILE put configure settings in config-FILE.make],
247 [CONFIGSUFFIX=$enableval])
249 if test "$CONFIGSUFFIX" != "" ; then
250 CONFIGFILE=config-$CONFIGSUFFIX
254 AC_SUBST(CONFIGSUFFIX)
257 AC_CHECK_PROGS(MAKE, gmake make, error)
258 AC_CHECK_PROGS(FIND, find, error)
260 dnl system supplied INSTALL is unsafe; use our own install.
262 dnl if test "$INSTALL" = "bin/install-sh"; then
263 dnl export INSTALL="\$\(depth\)/bin/install-sh"
266 AC_CHECK_PROGS(TAR, tar, error)
268 if test "x`uname`" = "xHP-UX"; then
269 AC_PATH_PROG(BASH, bash, /bin/sh)
270 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
271 AC_PATH_PROG(SHELL, bash, /bin/ksh)
273 AC_PATH_PROG(BASH, bash, /bin/sh)
279 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
282 if test $MAKE != "error" ; then
283 $MAKE -v 2> /dev/null | grep GNU > /dev/null
286 AC_STEPMAKE_WARN(Please install *GNU* make)
290 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
292 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
293 LN=cp # hard link does not work under cygnus-nt
294 LN_S='cp -r' # symbolic link does not work for native nt
301 # cygwin fixes all these things.
302 # it seems these were used because of dos-style TEXINPUTS and
303 # MFINPUTS needed for miktex.
304 # but this breaks parsing of all other cygwin/unix style paths.
306 # if your (mik)tex breaks, make a:
307 # /usr/local/bin/tex:
309 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
315 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
317 # this way, you may have buildscripts/out/lilypond-profile
318 # 'automatically' sourced from /usr/etc/profile.d/ too.
322 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
329 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
336 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
337 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
345 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
346 # ugh, automake: we want (and check for) bison
348 # ugh, automake: we want (and check for) flex
350 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
354 ac_cv_prog_lex_root=lex.yy
356 AC_CHECK_PROGS(BISON, bison, error)
357 AC_CHECK_PROGS(FLEX, flex, error)
358 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
359 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
361 if test $BISON != "error"; then
362 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
363 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
364 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
372 AC_DEFUN(AC_STEPMAKE_LIB, [
373 AC_CHECK_PROGS(AR, ar, error)
380 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
382 # **Never** try to set library version numbers so that they correspond
383 # to the release number of your package. This is an abuse that only
384 # fosters misunderstanding of the purpose of library versions.
386 REVISION=$PATCH_LEVEL
387 # CURRENT=$MINOR_VERSION
388 CURRENT=`expr $MINOR_VERSION + 1`
389 # AGE=$(expr $MAJOR_VERSION + 1)
396 AC_DEFUN(AC_STEPMAKE_LOCALE, [
401 AC_ARG_WITH(localedir,
402 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
403 localedir=$with_localedir,
404 localedir='${prefix}/share/locale')
407 [ with-lang=LANG use LANG as language to emit messages],
411 AC_MSG_CHECKING(language)
413 En* | en* | Am* | am* | US* | us*)
415 NL | nl | Du* | du* | Ned* | ned*)
424 if test "$lang" = "unknown" ; then
425 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
430 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
431 DIR_LOCALEDIR=${localedir}
433 if test "$prefix" = "NONE"; then
434 presome=${ac_default_prefix}
436 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
438 AC_SUBST(DIR_LOCALEDIR)
439 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
441 AC_CHECK_LIB(intl, gettext)
442 AC_CHECK_FUNCS(gettext)
445 AC_DEFUN(AC_STEPMAKE_MAN, [
446 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
447 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
448 AC_CHECK_PROGS(TBL, tbl, cat)
451 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
452 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
453 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
454 AC_MSG_CHECKING(whether msgfmt accepts -o)
455 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
456 if test "$msgfmt_output" = ""; then
460 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
462 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
464 if test ! -n "$MSGFMT"; then
465 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
469 #why has this been dropped?
470 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
471 AC_ARG_ENABLE(tex-prefix,
472 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
473 [TEXPREFIX=$enableval],
476 AC_ARG_ENABLE(tex-dir,
477 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
481 AC_ARG_ENABLE(mf-dir,
482 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
486 if test "x$TEXPREFIX" = xauto ; then
487 AC_TEX_PREFIX(TEXPREFIX)
489 find_texprefix=$TEXPREFIX
492 if test "x$MFDIR" = xauto; then
496 if test "x$TEXDIR" = xauto ; then
497 AC_TEX_SUBDIR(TEXDIR)
504 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
505 AC_ARG_ENABLE(tex-tfmdir,
506 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
510 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
511 AC_MSG_CHECKING(for TeX TFM directory)
512 if test "x$TFMDIR" = xauto ; then
513 if test "x$TEX_TFMDIR" = "x" ; then
514 if test "x$KPSEWHICH" != "xno" ; then
515 CMR10=`kpsewhich tfm cmr10.tfm`
516 TEX_TFMDIR=`dirname $CMR10`
518 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
519 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
523 AC_MSG_RESULT($TEX_TFMDIR)
527 AC_DEFUN(AC_STEPMAKE_TEXMF, [
528 # urg, never know what names these teTeX guys will think up
530 AC_CHECK_PROGS(METAFONT, mf, no)
531 if test "x$METAFONT" = "xno"; then
532 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
536 AC_CHECK_PROGS(METAPOST, mp, no)
537 if test "x$METAPOST" = "xno"; then
538 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
543 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
544 if test "x$INIMETAFONT" = "xno"; then
545 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
546 INIMETAFONT=$INIMFONT
549 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
550 if test "x$INIMETAPOST" = "xno"; then
551 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
552 INIMETAPOST=$INIMPOST
555 AC_MSG_CHECKING(for working metafont mode)
556 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
557 for MFMODE in $modelist; do
558 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
559 if test -f mfput.tfm; then
564 AC_MSG_RESULT($MFMODE)
569 AC_SUBST(INIMETAFONT)
570 AC_SUBST(INIMETAPOST)
573 AC_DEFUN(AC_STEPMAKE_WARN, [
578 AC_DEFUN(AC_STEPMAKE_YODL, [
579 if test "x$YODL" = "x"; then
580 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
581 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
582 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
583 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
584 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
585 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
586 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
587 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
588 YODL2LESS_DIR='$(bindir)/'
594 AC_SUBST(YODL2LESS_DIR)
596 AC_SUBST(YODL2MSLESS)
597 AC_SUBST(YODL2TEXINFO)
599 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
601 if test "x$YODL" = "-echo no yodl"; then
602 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
606 dnl should cache result.
607 dnl should look in $prefix first.
608 dnl should probably assume TDS
610 AC_DEFUN(AC_TEX_PREFIX, [
613 AC_MSG_CHECKING(TeX/MF root dir directory)
615 find_root_prefix="$prefix"
618 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
620 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
621 find_texprefix="$find_root_prefix$postfix"
622 if test -d $find_texprefix; then
623 find_texpostfix=$postfix
628 if test "x$find_texpostfix" = x; then
629 find_texpostfix='/lib/texmf/tex'
630 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
633 find_texprefix="$find_root_prefix/$find_texpostfix"
635 # only assign if variablename not empty
636 if test x != "x[$]$1"; then
637 $1='${prefix}'/"$find_texpostfix"
639 AC_MSG_RESULT($find_texprefix)
644 # find a directory inside a prefix,
645 # $1 the prefix (expanded version)
646 # $2 variable to assign
647 # $3 the directory name
649 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
651 AC_MSG_CHECKING($4 directory)
653 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
656 if test "x$find_dirdir" = x; then
658 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
662 AC_MSG_RESULT($1/$find_dirdir)
665 # ugh. this is hopeless
666 AC_DEFUN(AC_KPSE_TEX_DIR, [
667 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
668 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
670 if test -w "$kpse_syspaths";
672 dir=`echo $kpse_syspaths | head -1`
674 dir=`echo $kpse_paths | grep -v '!'| head -1`
676 if test "$prefix" = "NONE"; then
677 local_prefix=$ac_default_prefix
678 local_prefix_quote='${prefix}'
682 local_prefix_quote=$prefix
684 echo $local_prefix_quote = $local_prefix
686 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
689 AC_DEFUN(AC_TEX_SUBDIR, [
690 dnl AC_REQUIRE([AC_TEX_PREFIX])
691 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
695 AC_DEFUN(AC_MF_SUBDIR, [
696 dnl AC_REQUIRE([AC_TEX_PREFIX])
697 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
701 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
702 result="`echo \"$1\" | grep echo`"
703 if test "x$1" = "xerror" -o "x$result" != "x"; then
704 AC_STEPMAKE_WARN(can\'t find $2. $3)
708 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
710 dnl This macro runs the `guile-config' script, installed with Guile,
711 dnl to find out where Guile's header files and libraries are
712 dnl installed. It sets two variables, marked for substitution, as
715 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
716 dnl code that uses Guile header files. This is almost
717 dnl always just a -I flag.
719 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
720 dnl program against Guile. This includes `-lguile' for
721 dnl the Guile library itself, any libraries that Guile
722 dnl itself requires (like -lqthreads), and so on. It may
723 dnl also include a -L flag to tell the compiler where to
724 dnl find the libraries.
726 AC_DEFUN([GUILE_FLAGS],[
727 ## The GUILE_FLAGS macro.
728 ## First, let's just see if we can find Guile at all.
729 AC_MSG_CHECKING(for Guile)
730 guile-config link > /dev/null || {
731 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
734 GUILE_CFLAGS="`guile-config compile`"
735 GUILE_LDFLAGS="`guile-config link`"
736 AC_SUBST(GUILE_CFLAGS)
737 AC_SUBST(GUILE_LDFLAGS)
742 # Configure paths for GTK+
743 # Owen Taylor 97-11-3
745 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
746 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
748 AC_DEFUN(AM_PATH_GTK,
750 dnl Get the cflags and libraries from the gtk-config script
752 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
753 min_gtk_version=ifelse([$1], ,1.1.1,$1)
754 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
756 if test "$GTK_CONFIG" != "no" ; then
757 GTK_CFLAGS=`$GTK_CONFIG --cflags`
758 GTK_LIBS=`$GTK_CONFIG --libs`
759 ac_save_CFLAGS="$CFLAGS"
761 ac_save_CXXFLAGS="$CXXFLAGS"
762 CFLAGS="$CFLAGS $GTK_CFLAGS"
763 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
764 LIBS="$LIBS $GTK_LIBS"
766 dnl Now check if the installed GTK is sufficiently new. (Also sanity
767 dnl checks the results of gtk-config to some extent)
776 int major, minor, micro;
778 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
779 printf("%s, bad version string\n", "$min_gtk_version");
783 return !((gtk_major_version > major) ||
784 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
785 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
787 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
788 CFLAGS="$ac_save_CFLAGS"
789 CXXFLAGS="$ac_save_CXXFLAGS"
794 if test "x$no_gtk" = x ; then
796 ifelse([$2], , :, [$2])
801 ifelse([$3], , :, [$3])
803 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
810 # Configure paths for GTK--
811 # Erik Andersen 30 May 1998
812 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
814 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
815 dnl to be used as follows:
816 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
819 dnl Get the cflags and libraries from the gtkmm-config script
821 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
822 Prefix where GTK-- is installed (optional)],
823 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
824 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
825 Exec prefix where GTK-- is installed (optional)],
826 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
827 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
828 , enable_gtkmmtest=yes)
830 if test x$gtkmm_config_exec_prefix != x ; then
831 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
832 if test x${GTKMM_CONFIG+set} != xset ; then
833 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
836 if test x$gtkmm_config_prefix != x ; then
837 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
838 if test x${GTKMM_CONFIG+set} != xset ; then
839 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
844 AC_DEFUN(AM_PATH_GTKMM,
848 dnl Check if the installed GTK-- is sufficiently new.
850 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
851 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
853 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
855 if test "$GTKMM_CONFIG" = "no" ; then
861 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
862 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
863 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
864 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
865 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
866 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
867 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
868 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
869 if test "x$enable_gtkmmtest" = "xyes" ; then
870 ac_save_CXXFLAGS="$CXXFLAGS"
872 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
873 LIBS="$LIBS $GTK___LIBS"
875 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
876 dnl checks the results of gtkmm-config to some extent
887 int major, minor, micro;
890 system ("touch conf.gtkmmtest");
892 /* HP/UX 0 (%@#!) writes to sscanf strings */
893 tmp_version = g_strdup("$min_gtkmm_version");
894 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
895 printf("%s, bad version string\n", "$min_gtkmm_version");
899 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
900 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
901 (gtkmm_micro_version != $gtkmm_config_micro_version))
903 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
904 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
905 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
906 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
907 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
908 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
909 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
910 printf("*** required on your system.\n");
911 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
912 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
913 printf("*** before re-running configure\n");
915 /* GTK-- does not have the GTKMM_*_VERSION constants */
917 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
918 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
919 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
921 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
922 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
923 printf("*** library (version %d.%d.%d)\n",
924 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
929 if ((gtkmm_major_version > major) ||
930 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
931 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
937 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
938 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
939 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
940 major, minor, micro);
941 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
943 printf("*** If you have already installed a sufficiently new version, this error\n");
944 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
945 printf("*** being found. The easiest way to fix this is to remove the old version\n");
946 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
947 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
948 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
949 printf("*** so that the correct libraries are found at run-time))\n");
954 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
955 CXXFLAGS="$ac_save_CXXFLAGS"
959 if test "x$no_gtkmm" = x ; then
961 ifelse([$2], , :, [$2])
964 if test "$GTKMM_CONFIG" = "no" ; then
965 echo "*** The gtkmm-config script installed by GTK-- could not be found"
966 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
967 echo "*** your path, or set the GTK_CONFIG environment variable to the"
968 echo "*** full path to gtk-config."
969 echo "*** The gtkmm-config script was not available in GTK-- versions"
970 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
971 echo "*** version to 0.9.12 or newer"
973 if test -f conf.gtkmmtest ; then
976 echo "*** Could not run GTK-- test program, checking why..."
977 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
978 LIBS="$LIBS $GTK___LIBS"
982 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
983 [ echo "*** The test program compiled, but did not run. This usually means"
984 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
985 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
986 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
987 echo "*** to the installed location Also, make sure you have run ldconfig if that"
988 echo "*** is required on your system"
990 echo "*** If you have an old version installed, it is best to remove it, although"
991 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
992 [ echo "*** The test program failed to compile or link. See the file config.log for the"
993 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
994 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
995 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
996 CXXFLAGS="$ac_save_CXXFLAGS"
1002 ifelse([$3], , :, [$3])
1005 AC_SUBST(GTK___CFLAGS)
1006 AC_SUBST(GTK___LIBS)
1007 rm -f conf.gtkmmtest
1010 # Configure paths for GTK--DRAW
1011 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1013 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1014 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1016 AC_DEFUN(AM_PATH_GTK__DRAW,
1018 dnl Get the cflags and libraries from the gtk__-config script
1020 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1021 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1022 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1024 if test "$GTKMM_CONFIG" != "no" ; then
1025 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1026 GTK___LIBS=`$GTKMM_CONFIG --libs`
1027 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1028 GTK___LIBS="$GTK___DLIBS"
1029 ac_save_CFLAGS="$CFLAGS"
1030 ac_save_LIBS="$LIBS"
1031 ac_save_CXXFLAGS="$CXXFLAGS"
1032 CFLAGS="$CFLAGS $GTK___CFLAGS"
1033 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1034 LIBS="$LIBS $GTK___LIBS"
1036 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1037 dnl checks the results of gtk__-config to some extent)
1049 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1050 CFLAGS="$ac_save_CFLAGS"
1051 CXXFLAGS="$ac_save_CXXFLAGS"
1052 LIBS="$ac_save_LIBS"
1056 if test "x$no_gtk__" = x ; then
1058 ifelse([$2], , :, [$2])
1063 ifelse([$3], , :, [$3])
1065 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1067 AC_SUBST(GTK___CFLAGS)
1068 AC_SUBST(GTK___LIBS)