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
10 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
11 LDFLAGS=${LDFLAGS:-""}
17 AC_ARG_ENABLE(checking,
18 [ enable-checking set runtime checks (assert calls). Default: on],
19 [checking_b=$enableval] )
21 # actually, the default is: tja='-O' to get inlining...
24 #actually, that sucks.
25 # tja looks like a typo. Default is optimisation off. --hwn
27 AC_ARG_ENABLE(optimise,
28 [ enable-optimise use maximal speed optimisations. Default: off],
29 [optimise_b=$enableval])
31 AC_ARG_ENABLE(profiling,
32 [ enable-profiling compile with gprof support. Default: off],
33 [profile_b=$enableval])
35 AC_ARG_ENABLE(debugging,
36 [ enable-debugging set debug info. Default: on],
39 AC_ARG_ENABLE(mingw-prefix,
40 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
41 [MINGWPREFIX=$enableval],
44 if test "$checking_b" = no; then
47 DEFINES="$DEFINES -DNDEBUG"
50 if test "$optimise_b" = yes; then
51 OPTIMIZE="-O2 -finline-functions"
54 if test "$optimise_b" = no; then
58 if test $profile_b = yes; then
60 OPTIMIZE="$OPTIMIZE -pg"
63 if test $debug_b = yes; then
64 OPTIMIZE="$OPTIMIZE -g"
67 # however, C++ support in mingw32 v 0.1.4 is still flaky
68 if test x$MINGWPREFIX != xno; then
69 ICFLAGS="-I$MINGWPREFIX/include"
70 ILDFLAGS="-$MINGWPREFIX/lib"
77 CFLAGS="$CFLAGS $OPTIMIZE"
78 CPPFLAGS=${CPPFLAGS:-""}
88 AC_DEFUN(AC_STEPMAKE_CXX, [
92 AC_CHECK_HEADER(FlexLexer.h, true,
93 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
95 CPPFLAGS="$CPPFLAGS $DEFINES"
96 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
97 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
105 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
106 AC_CACHE_CHECK([whether explicit instantiation is needed],
107 lily_cv_need_explicit_instantiation,
109 template <class T> struct foo { static int baz; };
110 template <class T> int foo<T>::baz = 1;
111 ], [ return foo<int>::baz; ],
112 lily_cv_need_explicit_instantiation=no,
113 lily_cv_need_explicit_instantiation=yes))
114 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
115 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
119 AC_DEFUN(AC_STEPMAKE_DATADIR, [
120 if test "$datadir" = "\${prefix}/share"; then
121 datadir='${prefix}/share/'$package
123 DIR_DATADIR=${datadir}
125 if test "$prefix" = "NONE"; then
126 presome=${ac_default_prefix}
128 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
130 AC_SUBST(DIR_DATADIR)
131 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
134 AC_DEFUN(AC_STEPMAKE_END, [
135 AC_OUTPUT($CONFIGFILE.make:config.make.in)
137 rm -f $srcdir/GNUmakefile
138 cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
139 chmod 444 $srcdir/GNUmakefile
140 if test "$builddir" != "."; then
142 cp $srcdir/make/srcdir.make.in GNUmakefile
143 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 | egrep '2\.[89]' > /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 ## First, let's just see if we can find Guile at all.
163 AC_MSG_CHECKING("for guile-config")
164 for guile_config in guile-config $target-guile-config $build-guile-config; do
165 AC_MSG_RESULT("$guile_config")
166 if ! $guile_config --version > /dev/null 2>&1 ; then
167 AC_MSG_WARN("cannot execute $guile_config")
168 AC_MSG_CHECKING("if we are cross compiling")
174 if test "$guile_config" = "error"; then
175 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
178 AC_MSG_CHECKING("Guile version")
179 need_guile_version="1.3.4"
180 guile_version=`expr "\`$guile_config --version 2>&1\`" : ".*\($need_guile_version\).*"`
181 AC_MSG_RESULT("$guile_version")
182 if test "$guile_version" != "$need_guile_version"; then
183 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
186 AC_PATH_PROG(GUILE, guile, error)
190 AC_DEFUN(AC_STEPMAKE_INIT, [
193 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
194 if test x$MY_PATCH_LEVEL != x; then
195 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
198 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
199 changequote(<<, >>)dnl
200 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
201 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
204 # No versioning on directory names of sub-packages
206 stepmake=${datadir}/stepmake
208 if test "$prefix" = "NONE"; then
209 presome=${ac_default_prefix}
211 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
213 # urg, how is this supposed to work?
214 if test "$program_prefix" = "NONE"; then
217 if test "$program_suffix" = "NONE"; then
221 AC_MSG_CHECKING(Package)
222 if test "x$PACKAGE" = "xSTEPMAKE"; then
223 AC_MSG_RESULT(Stepmake package!)
225 #if test "x$builddir" != "x"; then
226 # builddir="../$builddir"
230 if test "$srcdir" != "."; then
231 absolute_builddir="`pwd`"
232 package_absolute_builddir="`dirname $absolute_builddir`"
233 package_srcdir="`dirname $srcdir`"
234 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
239 (cd stepmake 2>/dev/null || mkdir stepmake)
240 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
241 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
242 AC_CONFIG_AUX_DIR(bin)
245 AC_MSG_RESULT($PACKAGE)
247 if test "$srcdir" != "."; then
248 absolute_builddir="`pwd`"
249 builddir="`dirname $srcdir`/`basename $absolute_builddir`"
254 AC_MSG_CHECKING(for stepmake)
255 # Check for installed stepmake
256 if test -d $stepmake; then
257 AC_MSG_RESULT($stepmake)
259 stepmake='$(depth)'/$srcdir/stepmake
260 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
263 $HOME/usr/local/share/stepmake/bin\
264 $HOME/usr/local/lib/stepmake/bin\
265 $HOME/usr/share/stepmake/bin\
266 $HOME/usr/lib/stepmake/bin\
267 /usr/local/share/stepmake/bin\
268 /usr/local/lib/stepmake/bin\
269 /usr/share/stepmake/bin\
270 /usr/lib/stepmake/bin\
272 $srcdir/stepmake/bin\
280 AC_SUBST(PACKAGE_NAME)
281 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
282 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
284 if test "$package_depth" = "" ; then
287 package_depth="../$package_depth"
290 AC_SUBST(package_depth)
292 AUTOGENERATE="This file was automatically generated by configure"
293 AC_SUBST(AUTOGENERATE)
295 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
296 if test "x$STATE_VECTOR" != "x"; then
297 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
299 AC_SUBST(STATE_VECTOR)
302 AC_ARG_ENABLE(config,
303 [ enable-config=FILE put configure settings in config-FILE.make],
304 [CONFIGSUFFIX=-$enableval])
306 CONFIGFILE=config$CONFIGSUFFIX
307 AC_SUBST(CONFIGSUFFIX)
310 AC_CHECK_PROGS(MAKE, gmake make, error)
311 AC_CHECK_PROGS(FIND, find, error)
313 dnl system supplied INSTALL is unsafe; use our own install.
315 dnl if test "$INSTALL" = "bin/install-sh"; then
316 dnl export INSTALL="\$\(depth\)/bin/install-sh"
319 AC_CHECK_PROGS(TAR, tar, error)
321 if test "x`uname`" = "xHP-UX"; then
322 AC_PATH_PROG(BASH, bash, /bin/sh)
323 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
324 AC_PATH_PROG(SHELL, bash, /bin/ksh)
326 AC_PATH_PROG(BASH, bash, /bin/sh)
332 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
335 if test $MAKE != "error" ; then
336 $MAKE -v 2> /dev/null | grep GNU > /dev/null
339 AC_STEPMAKE_WARN(Please install *GNU* make)
343 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
345 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
346 LN=cp # hard link does not work under cygnus-nt
347 LN_S='cp -r' # symbolic link does not work for native nt
354 # cygwin fixes all these things.
355 # it seems these were used because of dos-style TEXINPUTS and
356 # MFINPUTS needed for miktex.
357 # but this breaks parsing of all other cygwin/unix style paths.
359 # if your (mik)tex breaks, make a:
360 # /usr/local/bin/tex:
362 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
368 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
370 # this way, you may have buildscripts/out/lilypond-profile
371 # 'automatically' sourced from /usr/etc/profile.d/ too.
375 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
382 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
384 AC_SUBST(program_prefix)
385 AC_SUBST(program_suffix)
390 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
391 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
398 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
399 # ugh, automake: we want (and check for) bison
401 # ugh, automake: we want (and check for) flex
403 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
407 ac_cv_prog_lex_root=lex.yy
409 AC_CHECK_PROGS(BISON, bison, error)
410 AC_CHECK_PROGS(FLEX, flex, error)
411 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
412 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
414 if test $BISON != "error"; then
415 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
416 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
417 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
425 AC_DEFUN(AC_STEPMAKE_LIB, [
426 AC_CHECK_PROGS(AR, ar, error)
433 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
435 # **Never** try to set library version numbers so that they correspond
436 # to the release number of your package. This is an abuse that only
437 # fosters misunderstanding of the purpose of library versions.
439 REVISION=$PATCH_LEVEL
440 # CURRENT=$MINOR_VERSION
441 CURRENT=`expr $MINOR_VERSION + 1`
442 # AGE=$(expr $MAJOR_VERSION + 1)
449 AC_DEFUN(AC_STEPMAKE_LOCALE, [
454 AC_ARG_WITH(localedir,
455 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
456 localedir=$with_localedir,
457 localedir='${prefix}/share/locale')
460 [ with-lang=LANG use LANG as language to emit messages],
464 AC_MSG_CHECKING(language)
466 En* | en* | Am* | am* | US* | us*)
468 NL | nl | Du* | du* | Ned* | ned*)
477 if test "$lang" = "unknown" ; then
478 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
483 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
484 DIR_LOCALEDIR=${localedir}
486 if test "$prefix" = "NONE"; then
487 presome=${ac_default_prefix}
489 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
491 AC_SUBST(DIR_LOCALEDIR)
492 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
494 AC_CHECK_LIB(intl, gettext)
495 AC_CHECK_FUNCS(gettext)
498 AC_DEFUN(AC_STEPMAKE_MAN, [
499 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
500 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
501 AC_CHECK_PROGS(TBL, tbl, cat)
504 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
505 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
506 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
507 AC_MSG_CHECKING(whether msgfmt accepts -o)
508 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
509 if test "$msgfmt_output" = ""; then
513 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
515 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
517 if test ! -n "$MSGFMT"; then
518 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
522 #why has this been dropped?
523 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
524 AC_ARG_ENABLE(tex-prefix,
525 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
526 [TEXPREFIX=$enableval],
529 AC_ARG_ENABLE(tex-dir,
530 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
534 AC_ARG_ENABLE(mf-dir,
535 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
539 if test "x$TEXPREFIX" = xauto ; then
540 AC_TEX_PREFIX(TEXPREFIX)
542 find_texprefix=$TEXPREFIX
545 if test "x$MFDIR" = xauto; then
549 if test "x$TEXDIR" = xauto ; then
550 AC_TEX_SUBDIR(TEXDIR)
557 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
558 AC_ARG_ENABLE(tex-tfmdir,
559 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
563 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
564 AC_MSG_CHECKING(for TeX TFM directory)
565 if test "x$TFMDIR" = xauto ; then
566 if test "x$TEX_TFMDIR" = "x" ; then
567 if test "x$KPSEWHICH" != "xno" ; then
568 CMR10=`kpsewhich tfm cmr10.tfm`
569 TEX_TFMDIR=`dirname $CMR10`
571 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
572 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
576 AC_MSG_RESULT($TEX_TFMDIR)
580 AC_DEFUN(AC_STEPMAKE_TEXMF, [
581 # urg, never know what names these teTeX guys will think up
583 AC_CHECK_PROGS(METAFONT, mf, no)
584 if test "x$METAFONT" = "xno"; then
585 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
589 AC_CHECK_PROGS(METAPOST, mp, no)
590 if test "x$METAPOST" = "xno"; then
591 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
596 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
597 if test "x$INIMETAFONT" = "xno"; then
598 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
599 INIMETAFONT=$INIMFONT
602 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
603 if test "x$INIMETAPOST" = "xno"; then
604 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
605 INIMETAPOST=$INIMPOST
608 AC_MSG_CHECKING(for working metafont mode)
609 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
610 for MFMODE in $modelist; do
611 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
612 if test -f mfput.tfm; then
618 # For now let people define these in their environments
620 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
622 if test ${INIMETAPOST} = "inimp" ; then
623 : ${INIMETAPOST_FLAGS=''}
625 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
629 AC_MSG_RESULT($MFMODE)
634 AC_SUBST(INIMETAFONT)
635 AC_SUBST(INIMETAPOST)
637 AC_SUBST(INIMETAPOST_FLAGS)
640 AC_DEFUN(AC_STEPMAKE_WARN, [
645 AC_DEFUN(AC_STEPMAKE_YODL, [
646 if test "x$YODL" = "x"; then
647 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
648 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
649 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
650 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
651 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
652 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
653 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
654 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
655 YODL2LESS_DIR='$(bindir)/'
661 AC_SUBST(YODL2LESS_DIR)
663 AC_SUBST(YODL2MSLESS)
664 AC_SUBST(YODL2TEXINFO)
666 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
668 if test "x$YODL" = "-echo no yodl"; then
669 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
673 dnl should cache result.
674 dnl should look in $prefix first.
675 dnl should probably assume TDS
677 AC_DEFUN(AC_TEX_PREFIX, [
680 AC_MSG_CHECKING(TeX/MF root dir directory)
682 find_root_prefix="$prefix"
685 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
687 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
688 find_texprefix="$find_root_prefix$postfix"
689 if test -d $find_texprefix; then
690 find_texpostfix=$postfix
695 if test "x$find_texpostfix" = x; then
696 find_texpostfix='/lib/texmf/tex'
697 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
700 find_texprefix="$find_root_prefix/$find_texpostfix"
702 # only assign if variablename not empty
703 if test x != "x[$]$1"; then
704 $1='${prefix}'/"$find_texpostfix"
706 AC_MSG_RESULT($find_texprefix)
711 # find a directory inside a prefix,
712 # $1 the prefix (expanded version)
713 # $2 variable to assign
714 # $3 the directory name
716 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
718 AC_MSG_CHECKING($4 directory)
720 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
723 if test "x$find_dirdir" = x; then
725 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
729 AC_MSG_RESULT($1/$find_dirdir)
732 # ugh. this is hopeless
733 AC_DEFUN(AC_KPSE_TEX_DIR, [
734 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
735 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
737 if test -w "$kpse_syspaths";
739 dir=`echo $kpse_syspaths | head -1`
741 dir=`echo $kpse_paths | grep -v '!'| head -1`
743 if test "$prefix" = "NONE"; then
744 local_prefix=$ac_default_prefix
745 local_prefix_quote='${prefix}'
749 local_prefix_quote=$prefix
751 echo $local_prefix_quote = $local_prefix
753 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
756 AC_DEFUN(AC_TEX_SUBDIR, [
757 dnl AC_REQUIRE([AC_TEX_PREFIX])
758 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
762 AC_DEFUN(AC_MF_SUBDIR, [
763 dnl AC_REQUIRE([AC_TEX_PREFIX])
764 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
768 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
769 result="`echo \"$1\" | grep echo`"
770 if test "x$1" = "xerror" -o "x$result" != "x"; then
771 AC_STEPMAKE_WARN(can\'t find $2. $3)
775 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
777 dnl This macro runs the `guile-config' script, installed with Guile,
778 dnl to find out where Guile's header files and libraries are
779 dnl installed. It sets two variables, marked for substitution, as
782 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
783 dnl code that uses Guile header files. This is almost
784 dnl always just a -I flag.
786 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
787 dnl program against Guile. This includes `-lguile' for
788 dnl the Guile library itself, any libraries that Guile
789 dnl itself requires (like -lqthreads), and so on. It may
790 dnl also include a -L flag to tell the compiler where to
791 dnl find the libraries.
793 AC_DEFUN([GUILE_FLAGS],[
794 ## The GUILE_FLAGS macro.
795 AC_MSG_CHECKING(for Guile)
796 if ! $guile_config link > /dev/null ; then
797 AC_MSG_RESULT("cannot execute $guile_config")
798 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
801 GUILE_CFLAGS="`$guile_config compile`"
802 GUILE_LDFLAGS="`$guile_config link`"
803 AC_SUBST(GUILE_CFLAGS)
804 AC_SUBST(GUILE_LDFLAGS)
809 # Configure paths for GTK+
810 # Owen Taylor 97-11-3
812 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
813 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
815 AC_DEFUN(AM_PATH_GTK,
817 dnl Get the cflags and libraries from the gtk-config script
819 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
820 min_gtk_version=ifelse([$1], ,1.1.1,$1)
821 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
823 if test "$GTK_CONFIG" != "no" ; then
824 GTK_CFLAGS=`$GTK_CONFIG --cflags`
825 GTK_LIBS=`$GTK_CONFIG --libs`
826 ac_save_CFLAGS="$CFLAGS"
828 ac_save_CXXFLAGS="$CXXFLAGS"
829 CFLAGS="$CFLAGS $GTK_CFLAGS"
830 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
831 LIBS="$LIBS $GTK_LIBS"
833 dnl Now check if the installed GTK is sufficiently new. (Also sanity
834 dnl checks the results of gtk-config to some extent)
843 int major, minor, micro;
845 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
846 printf("%s, bad version string\n", "$min_gtk_version");
850 return !((gtk_major_version > major) ||
851 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
852 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
854 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
855 CFLAGS="$ac_save_CFLAGS"
856 CXXFLAGS="$ac_save_CXXFLAGS"
861 if test "x$no_gtk" = x ; then
863 ifelse([$2], , :, [$2])
868 ifelse([$3], , :, [$3])
870 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
877 # Configure paths for GTK--
878 # Erik Andersen 30 May 1998
879 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
881 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
882 dnl to be used as follows:
883 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
886 dnl Get the cflags and libraries from the gtkmm-config script
888 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
889 Prefix where GTK-- is installed (optional)],
890 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
891 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
892 Exec prefix where GTK-- is installed (optional)],
893 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
894 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
895 , enable_gtkmmtest=yes)
897 if test x$gtkmm_config_exec_prefix != x ; then
898 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
899 if test x${GTKMM_CONFIG+set} != xset ; then
900 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
903 if test x$gtkmm_config_prefix != x ; then
904 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
905 if test x${GTKMM_CONFIG+set} != xset ; then
906 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
911 AC_DEFUN(AM_PATH_GTKMM,
915 dnl Check if the installed GTK-- is sufficiently new.
917 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
918 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
920 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
922 if test "$GTKMM_CONFIG" = "no" ; then
928 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
929 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
930 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
931 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
932 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
933 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
934 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
935 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
936 if test "x$enable_gtkmmtest" = "xyes" ; then
937 ac_save_CXXFLAGS="$CXXFLAGS"
939 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
940 LIBS="$LIBS $GTK___LIBS"
942 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
943 dnl checks the results of gtkmm-config to some extent
954 int major, minor, micro;
957 system ("touch conf.gtkmmtest");
959 /* HP/UX 0 (%@#!) writes to sscanf strings */
960 tmp_version = g_strdup("$min_gtkmm_version");
961 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
962 printf("%s, bad version string\n", "$min_gtkmm_version");
966 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
967 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
968 (gtkmm_micro_version != $gtkmm_config_micro_version))
970 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
971 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
972 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
973 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
974 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
975 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
976 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
977 printf("*** required on your system.\n");
978 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
979 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
980 printf("*** before re-running configure\n");
982 /* GTK-- does not have the GTKMM_*_VERSION constants */
984 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
985 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
986 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
988 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
989 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
990 printf("*** library (version %d.%d.%d)\n",
991 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
996 if ((gtkmm_major_version > major) ||
997 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
998 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1004 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1005 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1006 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1007 major, minor, micro);
1008 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1010 printf("*** If you have already installed a sufficiently new version, this error\n");
1011 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1012 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1013 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1014 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1015 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1016 printf("*** so that the correct libraries are found at run-time))\n");
1021 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1022 CXXFLAGS="$ac_save_CXXFLAGS"
1023 LIBS="$ac_save_LIBS"
1026 if test "x$no_gtkmm" = x ; then
1028 ifelse([$2], , :, [$2])
1031 if test "$GTKMM_CONFIG" = "no" ; then
1032 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1033 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1034 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1035 echo "*** full path to gtk-config."
1036 echo "*** The gtkmm-config script was not available in GTK-- versions"
1037 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1038 echo "*** version to 0.9.12 or newer"
1040 if test -f conf.gtkmmtest ; then
1043 echo "*** Could not run GTK-- test program, checking why..."
1044 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1045 LIBS="$LIBS $GTK___LIBS"
1049 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1050 [ echo "*** The test program compiled, but did not run. This usually means"
1051 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1052 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1053 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1054 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1055 echo "*** is required on your system"
1057 echo "*** If you have an old version installed, it is best to remove it, although"
1058 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1059 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1060 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1061 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1062 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1063 CXXFLAGS="$ac_save_CXXFLAGS"
1064 LIBS="$ac_save_LIBS"
1069 ifelse([$3], , :, [$3])
1072 AC_SUBST(GTK___CFLAGS)
1073 AC_SUBST(GTK___LIBS)
1074 rm -f conf.gtkmmtest
1077 # Configure paths for GTK--DRAW
1078 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1080 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1081 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1083 AC_DEFUN(AM_PATH_GTK__DRAW,
1085 dnl Get the cflags and libraries from the gtk__-config script
1087 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1088 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1089 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1091 if test "$GTKMM_CONFIG" != "no" ; then
1092 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1093 GTK___LIBS=`$GTKMM_CONFIG --libs`
1094 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1095 GTK___LIBS="$GTK___DLIBS"
1096 ac_save_CFLAGS="$CFLAGS"
1097 ac_save_LIBS="$LIBS"
1098 ac_save_CXXFLAGS="$CXXFLAGS"
1099 CFLAGS="$CFLAGS $GTK___CFLAGS"
1100 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1101 LIBS="$LIBS $GTK___LIBS"
1103 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1104 dnl checks the results of gtk__-config to some extent)
1116 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1117 CFLAGS="$ac_save_CFLAGS"
1118 CXXFLAGS="$ac_save_CXXFLAGS"
1119 LIBS="$ac_save_LIBS"
1123 if test "x$no_gtk__" = x ; then
1125 ifelse([$2], , :, [$2])
1130 ifelse([$3], , :, [$3])
1132 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1134 AC_SUBST(GTK___CFLAGS)
1135 AC_SUBST(GTK___LIBS)