1 dnl WARNING WARNING WARNING WARNING
2 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
3 dnl aclocal.m4 -*-shell-script-*-
4 dnl StepMake subroutines for configure.in
6 AC_DEFUN(AC_STEPMAKE_COMPILE, [
7 # -O is necessary to get inlining
9 CXXFLAGS=${CXXFLAGS:-""}
16 AC_ARG_ENABLE(checking,
17 [ enable-checking set runtime checks (assert calls). Default: on],
18 [checking_b=$enableval] )
20 # actually, the default is: tja='-O' to get inlining...
23 #actually, that sucks.
24 # tja looks like a typo. Default is optimisation off. --hwn
26 AC_ARG_ENABLE(optimise,
27 [ enable-optimise use maximal speed optimisations. Default: off],
28 [optimise_b=$enableval])
30 AC_ARG_ENABLE(profiling,
31 [ enable-profiling compile with gprof support. Default: off],
32 [profile_b=$enableval])
34 AC_ARG_ENABLE(debugging,
35 [ enable-debugging set debug info. Default: on],
38 AC_ARG_ENABLE(mingw-prefix,
39 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
40 [MINGWPREFIX=$enableval],
43 if test "$printing_b" = no; then
46 DEFINES="$DEFINES -DNPRINT"
49 if test "$checking_b" = no; then
52 DEFINES="$DEFINES -DNDEBUG"
55 if test "$optimise_b" = yes; then
56 OPTIMIZE="-O2 -finline-functions"
59 if test "$optimise_b" = no; then
63 if test $profile_b = yes; then
65 OPTIMIZE="$OPTIMIZE -pg"
68 if test $debug_b = yes; then
69 OPTIMIZE="$OPTIMIZE -g"
72 # however, C++ support in mingw32 v 0.1.4 is still flaky
73 if test x$MINGWPREFIX != xno; then
74 ICFLAGS="-I$MINGWPREFIX/include"
75 ILDFLAGS="-$MINGWPREFIX/lib"
82 CFLAGS="$CFLAGS $OPTIMIZE"
83 CPPFLAGS=${CPPFLAGS:-""}
93 AC_DEFUN(AC_STEPMAKE_CXX, [
97 AC_CHECK_HEADER(FlexLexer.h, true,
98 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
100 CPPFLAGS="$CPPFLAGS $DEFINES"
101 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
110 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
111 AC_CACHE_CHECK([whether explicit instantiation is needed],
112 lily_cv_need_explicit_instantiation,
114 template <class T> struct foo { static int baz; };
115 template <class T> int foo<T>::baz = 1;
116 ], [ return foo<int>::baz; ],
117 lily_cv_need_explicit_instantiation=no,
118 lily_cv_need_explicit_instantiation=yes))
119 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
120 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
124 AC_DEFUN(AC_STEPMAKE_DATADIR, [
125 if test "$datadir" = "\${prefix}/share"; then
126 datadir='${prefix}/share/'$package
128 DIR_DATADIR=${datadir}
130 if test "$prefix" = "NONE"; then
131 presome=${ac_default_prefix}
133 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
135 AC_SUBST(DIR_DATADIR)
136 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
139 AC_DEFUN(AC_STEPMAKE_END, [
140 AC_OUTPUT($CONFIGFILE.make:config.make.in)
143 cp make/toplevel.make.in ./GNUmakefile
144 chmod 444 GNUmakefile
147 AC_DEFUN(AC_STEPMAKE_GXX, [
149 # urg, egcs: how to check for egcs >= 1.1?
150 changequote(<<, >>)dnl
151 if $CXX --version | grep '2\.8' > /dev/null ||
152 $CXX --version | grep 'egcs' > /dev/null
157 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
161 AC_DEFUN(AC_STEPMAKE_GUILE, [
162 # on some systems, -lguile succeeds for guile-1.3
163 # others need readline, dl (or even more)
164 # urg, must check for different functions in libguile
165 # to force new check iso reading from cache
167 # gh_scm2doubles,gh_doubles2scm are new in 1.3
169 AC_CHECK_LIB(guile, gh_scm2doubles,
170 [LIBS="`echo $GUILE_LDFLAGS | sed -e 's/-L[[/-_a-zA-Z0-9]]\+ //g'` $LIBS"
171 AC_DEFINE(HAVE_LIBGUILE)], , $GUILE_LDFLAGS dnl
173 if test "$ac_cv_lib_guile_gh_scm2doubles" != yes ; then
174 AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
178 AC_DEFUN(AC_STEPMAKE_INIT, [
181 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
182 if test x$MY_PATCH_LEVEL != x; then
183 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
186 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
187 changequote(<<, >>)dnl
188 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
189 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
192 # No versioning on directory names of sub-packages
194 stepmake=${datadir}/stepmake
196 if test "$prefix" = "NONE"; then
197 presome=${ac_default_prefix}
199 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
201 if test "x$PACKAGE" = "xSTEPMAKE"; then
202 echo Stepmake package!
203 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
204 (cd stepmake; rm -f bin; ln -s ../bin .)
205 AC_CONFIG_AUX_DIR(bin)
208 echo Package: $PACKAGE
209 # Check for installed stepmake
210 if test -d $stepmake; then
211 echo Using installed stepmake: $stepmake
213 stepmake='$(depth)'/stepmake
214 echo Using local stepmake: $datadir/stepmake not found
217 $HOME/usr/local/share/stepmake/bin\
218 $HOME/usr/local/lib/stepmake/bin\
219 $HOME/usr/share/stepmake/bin\
220 $HOME/usr/lib/stepmake/bin\
221 /usr/local/share/stepmake/bin\
222 /usr/local/lib/stepmake/bin\
223 /usr/share/stepmake/bin\
224 /usr/lib/stepmake/bin\
232 AC_SUBST(PACKAGE_NAME)
233 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
234 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
236 if test "$package_depth" = "" ; then
239 package_depth="../$package_depth"
242 AC_SUBST(package_depth)
244 AUTOGENERATE="This file was automatically generated by configure"
245 AC_SUBST(AUTOGENERATE)
246 absolute_builddir="`pwd`"
247 AC_SUBST(absolute_builddir)
249 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
250 if test "x$STATE_VECTOR" != "x"; then
251 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
253 AC_SUBST(STATE_VECTOR)
256 AC_ARG_ENABLE(config,
257 [ enable-config=FILE put configure settings in config-FILE.make],
258 [CONFIGSUFFIX=$enableval])
260 if test "$CONFIGSUFFIX" != "" ; then
261 CONFIGFILE=config-$CONFIGSUFFIX
265 AC_SUBST(CONFIGSUFFIX)
268 AC_CHECK_PROGS(MAKE, gmake make, error)
269 AC_CHECK_PROGS(FIND, find, error)
271 dnl system supplied INSTALL is unsafe; use our own install.
273 dnl if test "$INSTALL" = "bin/install-sh"; then
274 dnl export INSTALL="\$\(depth\)/bin/install-sh"
277 AC_CHECK_PROGS(TAR, tar, error)
278 AC_CHECK_PROGS(BASH, bash, /bin/sh)
280 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
283 if test $MAKE != "error" ; then
284 $MAKE -v 2> /dev/null | grep GNU > /dev/null
287 AC_STEPMAKE_WARN(Please install *GNU* make)
291 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
293 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
294 LN=cp # hard link does not work under cygnus-nt
295 LN_S='cp -r' # symbolic link does not work for native nt
302 # cygwin fixes all these things.
303 # it seems these were used because of dos-style TEXINPUTS and
304 # MFINPUTS needed for miktex.
305 # but this breaks parsing of all other cygwin/unix style paths.
307 # if your (mik)tex breaks, make a:
308 # /usr/local/bin/tex:
310 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
316 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
318 # this way, you may have buildscripts/out/lilypond-profile
319 # 'automatically' sourced from /usr/etc/profile.d/ too.
323 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
330 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
337 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
338 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
346 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
347 # ugh, automake: we want (and check for) bison
349 # ugh, automake: we want (and check for) flex
351 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
355 ac_cv_prog_lex_root=lex.yy
357 AC_CHECK_PROGS(BISON, bison, error)
358 AC_CHECK_PROGS(FLEX, flex, error)
359 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
360 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
362 if test $BISON != "error"; then
363 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
364 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
365 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
373 AC_DEFUN(AC_STEPMAKE_LIB, [
374 AC_CHECK_PROGS(AR, ar, error)
381 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
383 # **Never** try to set library version numbers so that they correspond
384 # to the release number of your package. This is an abuse that only
385 # fosters misunderstanding of the purpose of library versions.
387 REVISION=$PATCH_LEVEL
388 # CURRENT=$MINOR_VERSION
389 CURRENT=`expr $MINOR_VERSION + 1`
390 # AGE=$(expr $MAJOR_VERSION + 1)
397 AC_DEFUN(AC_STEPMAKE_LOCALE, [
402 AC_ARG_WITH(localedir,
403 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
404 localedir=$with_localedir,
405 localedir='${prefix}/share/locale')
408 [ with-lang=LANG use LANG as language to emit messages],
412 AC_MSG_CHECKING(language)
414 En* | en* | Am* | am* | US* | us*)
416 NL | nl | Du* | du* | Ned* | ned*)
425 if test "$lang" = "unknown" ; then
426 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
431 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
432 DIR_LOCALEDIR=${localedir}
434 if test "$prefix" = "NONE"; then
435 presome=${ac_default_prefix}
437 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
439 AC_SUBST(DIR_LOCALEDIR)
440 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
442 AC_CHECK_LIB(intl, gettext)
443 AC_CHECK_FUNCS(gettext)
446 AC_DEFUN(AC_STEPMAKE_MAN, [
447 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
448 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
449 AC_CHECK_PROGS(TBL, tbl, cat)
452 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
453 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
454 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
455 AC_MSG_CHECKING(whether msgfmt accepts -o)
456 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
457 if test "$msgfmt_output" = ""; then
461 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
463 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
465 if test ! -n "$MSGFMT"; then
466 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
470 AC_DEFUN(AC_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, [
505 # urg, never know what names these teTeX guys will think up
507 AC_CHECK_PROGS(METAFONT, mf, no)
508 if test "x$METAFONT" = "xno"; then
509 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
513 AC_CHECK_PROGS(METAPOST, mp, no)
514 if test "x$METAPOST" = "xno"; then
515 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
519 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
520 if test "x$INIMETAFONT" = "xno"; then
521 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
522 INIMETAFONT=$INIMFONT
525 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
526 if test "x$INIMETAPOST" = "xno"; then
527 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
528 INIMETAPOST=$INIMPOST
533 AC_SUBST(INIMETAFONT)
534 AC_SUBST(INIMETAPOST)
537 AC_DEFUN(AC_STEPMAKE_WARN, [
542 AC_DEFUN(AC_STEPMAKE_YODL, [
543 if test "x$YODL" = "x"; then
544 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
545 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
546 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
547 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
548 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
549 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
550 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
551 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
552 YODL2LESS_DIR='$(bindir)/'
558 AC_SUBST(YODL2LESS_DIR)
560 AC_SUBST(YODL2MSLESS)
561 AC_SUBST(YODL2TEXINFO)
563 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
565 if test "x$YODL" = "-echo no yodl"; then
566 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
570 dnl should cache result.
571 dnl should look in $prefix first.
572 dnl should probably assume TDS
574 AC_DEFUN(AC_TEX_PREFIX, [
577 AC_MSG_CHECKING(TeX/MF root dir directory)
579 find_root_prefix="$prefix"
582 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
584 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
585 find_texprefix="$find_root_prefix$postfix"
586 if test -d $find_texprefix; then
587 find_texpostfix=$postfix
592 if test "x$find_texpostfix" = x; then
593 find_texpostfix='/lib/texmf/tex'
594 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
597 find_texprefix="$find_root_prefix/$find_texpostfix"
599 # only assign if variablename not empty
600 if test x != "x[$]$1"; then
601 $1='${prefix}'/"$find_texpostfix"
603 AC_MSG_RESULT($find_texprefix)
608 # find a directory inside a prefix,
609 # $1 the prefix (expanded version)
610 # $2 variable to assign
611 # $3 the directory name
613 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
615 AC_MSG_CHECKING($4 directory)
617 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
620 if test "x$find_dirdir" = x; then
622 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
626 AC_MSG_RESULT($1/$find_dirdir)
629 # ugh. this is hopeless
630 AC_DEFUN(AC_KPSE_TEX_DIR, [
631 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
632 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
634 if test -w "$kpse_syspaths";
636 dir=`echo $kpse_syspaths | head -1`
638 dir=`echo $kpse_paths | grep -v '!'| head -1`
640 if test "$prefix" = "NONE"; then
641 local_prefix=$ac_default_prefix
642 local_prefix_quote='${prefix}'
646 local_prefix_quote=$prefix
648 echo $local_prefix_quote = $local_prefix
650 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
653 AC_DEFUN(AC_TEX_SUBDIR, [
654 dnl AC_REQUIRE([AC_TEX_PREFIX])
655 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
659 AC_DEFUN(AC_MF_SUBDIR, [
660 dnl AC_REQUIRE([AC_TEX_PREFIX])
661 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
665 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
666 result="`echo \"$1\" | grep echo`"
667 if test "x$1" = "xerror" -o "x$result" != "x"; then
668 AC_STEPMAKE_WARN(can\'t find $2. $3)
672 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
674 dnl This macro runs the `guile-config' script, installed with Guile,
675 dnl to find out where Guile's header files and libraries are
676 dnl installed. It sets two variables, marked for substitution, as
679 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
680 dnl code that uses Guile header files. This is almost
681 dnl always just a -I flag.
683 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
684 dnl program against Guile. This includes `-lguile' for
685 dnl the Guile library itself, any libraries that Guile
686 dnl itself requires (like -lqthreads), and so on. It may
687 dnl also include a -L flag to tell the compiler where to
688 dnl find the libraries.
690 AC_DEFUN([GUILE_FLAGS],[
691 ## The GUILE_FLAGS macro.
692 ## First, let's just see if we can find Guile at all.
693 AC_MSG_CHECKING(for Guile)
694 guile-config link > /dev/null || {
695 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
698 GUILE_CFLAGS="`guile-config compile`"
699 GUILE_LDFLAGS="`guile-config link`"
700 AC_SUBST(GUILE_CFLAGS)
701 AC_SUBST(GUILE_LDFLAGS)
706 # Configure paths for GTK+
707 # Owen Taylor 97-11-3
709 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
710 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
712 AC_DEFUN(AM_PATH_GTK,
714 dnl Get the cflags and libraries from the gtk-config script
716 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
717 min_gtk_version=ifelse([$1], ,1.1.1,$1)
718 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
720 if test "$GTK_CONFIG" != "no" ; then
721 GTK_CFLAGS=`$GTK_CONFIG --cflags`
722 GTK_LIBS=`$GTK_CONFIG --libs`
723 ac_save_CFLAGS="$CFLAGS"
725 ac_save_CXXFLAGS="$CXXFLAGS"
726 CFLAGS="$CFLAGS $GTK_CFLAGS"
727 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
728 LIBS="$LIBS $GTK_LIBS"
730 dnl Now check if the installed GTK is sufficiently new. (Also sanity
731 dnl checks the results of gtk-config to some extent)
740 int major, minor, micro;
742 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
743 printf("%s, bad version string\n", "$min_gtk_version");
747 return !((gtk_major_version > major) ||
748 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
749 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
751 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
752 CFLAGS="$ac_save_CFLAGS"
753 CXXFLAGS="$ac_save_CXXFLAGS"
758 if test "x$no_gtk" = x ; then
760 ifelse([$2], , :, [$2])
765 ifelse([$3], , :, [$3])
767 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
774 # Configure paths for GTK--
775 # Erik Andersen 30 May 1998
776 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
778 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
779 dnl to be used as follows:
780 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
783 dnl Get the cflags and libraries from the gtkmm-config script
785 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
786 Prefix where GTK-- is installed (optional)],
787 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
788 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
789 Exec prefix where GTK-- is installed (optional)],
790 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
791 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
792 , enable_gtkmmtest=yes)
794 if test x$gtkmm_config_exec_prefix != x ; then
795 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
796 if test x${GTKMM_CONFIG+set} != xset ; then
797 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
800 if test x$gtkmm_config_prefix != x ; then
801 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
802 if test x${GTKMM_CONFIG+set} != xset ; then
803 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
808 AC_DEFUN(AM_PATH_GTKMM,
812 dnl Check if the installed GTK-- is sufficiently new.
814 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
815 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
817 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
819 if test "$GTKMM_CONFIG" = "no" ; then
825 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
826 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
827 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
828 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
829 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
830 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
831 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
832 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
833 if test "x$enable_gtkmmtest" = "xyes" ; then
834 ac_save_CXXFLAGS="$CXXFLAGS"
836 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
837 LIBS="$LIBS $GTK___LIBS"
839 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
840 dnl checks the results of gtkmm-config to some extent
851 int major, minor, micro;
854 system ("touch conf.gtkmmtest");
856 /* HP/UX 0 (%@#!) writes to sscanf strings */
857 tmp_version = g_strdup("$min_gtkmm_version");
858 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
859 printf("%s, bad version string\n", "$min_gtkmm_version");
863 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
864 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
865 (gtkmm_micro_version != $gtkmm_config_micro_version))
867 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
868 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
869 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
870 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
871 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
872 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
873 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
874 printf("*** required on your system.\n");
875 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
876 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
877 printf("*** before re-running configure\n");
879 /* GTK-- does not have the GTKMM_*_VERSION constants */
881 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
882 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
883 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
885 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
886 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
887 printf("*** library (version %d.%d.%d)\n",
888 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
893 if ((gtkmm_major_version > major) ||
894 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
895 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
901 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
902 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
903 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
904 major, minor, micro);
905 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
907 printf("*** If you have already installed a sufficiently new version, this error\n");
908 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
909 printf("*** being found. The easiest way to fix this is to remove the old version\n");
910 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
911 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
912 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
913 printf("*** so that the correct libraries are found at run-time))\n");
918 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
919 CXXFLAGS="$ac_save_CXXFLAGS"
923 if test "x$no_gtkmm" = x ; then
925 ifelse([$2], , :, [$2])
928 if test "$GTKMM_CONFIG" = "no" ; then
929 echo "*** The gtkmm-config script installed by GTK-- could not be found"
930 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
931 echo "*** your path, or set the GTK_CONFIG environment variable to the"
932 echo "*** full path to gtk-config."
933 echo "*** The gtkmm-config script was not available in GTK-- versions"
934 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
935 echo "*** version to 0.9.12 or newer"
937 if test -f conf.gtkmmtest ; then
940 echo "*** Could not run GTK-- test program, checking why..."
941 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
942 LIBS="$LIBS $GTK___LIBS"
946 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
947 [ echo "*** The test program compiled, but did not run. This usually means"
948 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
949 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
950 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
951 echo "*** to the installed location Also, make sure you have run ldconfig if that"
952 echo "*** is required on your system"
954 echo "*** If you have an old version installed, it is best to remove it, although"
955 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
956 [ echo "*** The test program failed to compile or link. See the file config.log for the"
957 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
958 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
959 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
960 CXXFLAGS="$ac_save_CXXFLAGS"
966 ifelse([$3], , :, [$3])
969 AC_SUBST(GTK___CFLAGS)
974 # Configure paths for GTK--DRAW
975 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
977 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
978 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
980 AC_DEFUN(AM_PATH_GTK__DRAW,
982 dnl Get the cflags and libraries from the gtk__-config script
984 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
985 min_gtk___version=ifelse([$1], ,0.0.5,$1)
986 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
988 if test "$GTKMM_CONFIG" != "no" ; then
989 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
990 GTK___LIBS=`$GTKMM_CONFIG --libs`
991 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
992 GTK___LIBS="$GTK___DLIBS"
993 ac_save_CFLAGS="$CFLAGS"
995 ac_save_CXXFLAGS="$CXXFLAGS"
996 CFLAGS="$CFLAGS $GTK___CFLAGS"
997 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
998 LIBS="$LIBS $GTK___LIBS"
1000 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1001 dnl checks the results of gtk__-config to some extent)
1013 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1014 CFLAGS="$ac_save_CFLAGS"
1015 CXXFLAGS="$ac_save_CXXFLAGS"
1016 LIBS="$ac_save_LIBS"
1020 if test "x$no_gtk__" = x ; then
1022 ifelse([$2], , :, [$2])
1027 ifelse([$3], , :, [$3])
1029 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1031 AC_SUBST(GTK___CFLAGS)
1032 AC_SUBST(GTK___LIBS)
1035 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
1037 dnl This macro runs the `guile-config' script, installed with Guile,
1038 dnl to find out where Guile's header files and libraries are
1039 dnl installed. It sets two variables, marked for substitution, as
1042 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
1043 dnl code that uses Guile header files. This is almost
1044 dnl always just a -I flag.
1046 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
1047 dnl program against Guile. This includes `-lguile' for
1048 dnl the Guile library itself, any libraries that Guile
1049 dnl itself requires (like -lqthreads), and so on. It may
1050 dnl also include a -L flag to tell the compiler where to
1051 dnl find the libraries.
1053 AC_DEFUN([GUILE_FLAGS],[
1054 ## The GUILE_FLAGS macro.
1055 ## First, let's just see if we can find Guile at all.
1056 AC_MSG_CHECKING(for Guile)
1057 guile-config link > /dev/null || {
1058 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
1061 GUILE_CFLAGS="`guile-config compile`"
1062 GUILE_LDFLAGS="`guile-config link`"
1063 AC_SUBST(GUILE_CFLAGS)
1064 AC_SUBST(GUILE_LDFLAGS)