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 $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 AC_MSG_CHECKING(Package)
214 if test "x$PACKAGE" = "xSTEPMAKE"; then
215 AC_MSG_RESULT(Stepmake package!)
217 #if test "x$builddir" != "x"; then
218 # builddir="../$builddir"
222 if test "$srcdir" != "."; then
223 absolute_builddir="`pwd`"
224 package_absolute_builddir="`dirname $absolute_builddir`"
225 package_srcdir="`dirname $srcdir`"
226 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
231 (cd stepmake 2>/dev/null || mkdir stepmake)
232 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
233 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
234 AC_CONFIG_AUX_DIR(bin)
237 AC_MSG_RESULT($PACKAGE)
239 if test "$srcdir" != "."; then
240 absolute_builddir="`pwd`"
241 builddir="`dirname $srcdir`/`basename $absolute_builddir`"
246 AC_MSG_CHECKING(for stepmake)
247 # Check for installed stepmake
248 if test -d $stepmake; then
249 AC_MSG_RESULT($stepmake)
251 stepmake='$(depth)'/$srcdir/stepmake
252 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
255 $HOME/usr/local/share/stepmake/bin\
256 $HOME/usr/local/lib/stepmake/bin\
257 $HOME/usr/share/stepmake/bin\
258 $HOME/usr/lib/stepmake/bin\
259 /usr/local/share/stepmake/bin\
260 /usr/local/lib/stepmake/bin\
261 /usr/share/stepmake/bin\
262 /usr/lib/stepmake/bin\
264 $srcdir/stepmake/bin\
272 AC_SUBST(PACKAGE_NAME)
273 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
274 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
276 if test "$package_depth" = "" ; then
279 package_depth="../$package_depth"
282 AC_SUBST(package_depth)
284 AUTOGENERATE="This file was automatically generated by configure"
285 AC_SUBST(AUTOGENERATE)
287 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
288 if test "x$STATE_VECTOR" != "x"; then
289 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
291 AC_SUBST(STATE_VECTOR)
294 AC_ARG_ENABLE(config,
295 [ enable-config=FILE put configure settings in config-FILE.make],
296 [CONFIGSUFFIX=-$enableval])
298 CONFIGFILE=config$CONFIGSUFFIX
299 AC_SUBST(CONFIGSUFFIX)
302 AC_CHECK_PROGS(MAKE, gmake make, error)
303 AC_CHECK_PROGS(FIND, find, error)
305 dnl system supplied INSTALL is unsafe; use our own install.
307 dnl if test "$INSTALL" = "bin/install-sh"; then
308 dnl export INSTALL="\$\(depth\)/bin/install-sh"
311 AC_CHECK_PROGS(TAR, tar, error)
313 if test "x`uname`" = "xHP-UX"; then
314 AC_PATH_PROG(BASH, bash, /bin/sh)
315 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
316 AC_PATH_PROG(SHELL, bash, /bin/ksh)
318 AC_PATH_PROG(BASH, bash, /bin/sh)
324 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
327 if test $MAKE != "error" ; then
328 $MAKE -v 2> /dev/null | grep GNU > /dev/null
331 AC_STEPMAKE_WARN(Please install *GNU* make)
335 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
337 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
338 LN=cp # hard link does not work under cygnus-nt
339 LN_S='cp -r' # symbolic link does not work for native nt
346 # cygwin fixes all these things.
347 # it seems these were used because of dos-style TEXINPUTS and
348 # MFINPUTS needed for miktex.
349 # but this breaks parsing of all other cygwin/unix style paths.
351 # if your (mik)tex breaks, make a:
352 # /usr/local/bin/tex:
354 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
360 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
362 # this way, you may have buildscripts/out/lilypond-profile
363 # 'automatically' sourced from /usr/etc/profile.d/ too.
367 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
374 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
381 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
382 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
389 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
390 # ugh, automake: we want (and check for) bison
392 # ugh, automake: we want (and check for) flex
394 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
398 ac_cv_prog_lex_root=lex.yy
400 AC_CHECK_PROGS(BISON, bison, error)
401 AC_CHECK_PROGS(FLEX, flex, error)
402 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
403 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
405 if test $BISON != "error"; then
406 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
407 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
408 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
416 AC_DEFUN(AC_STEPMAKE_LIB, [
417 AC_CHECK_PROGS(AR, ar, error)
424 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
426 # **Never** try to set library version numbers so that they correspond
427 # to the release number of your package. This is an abuse that only
428 # fosters misunderstanding of the purpose of library versions.
430 REVISION=$PATCH_LEVEL
431 # CURRENT=$MINOR_VERSION
432 CURRENT=`expr $MINOR_VERSION + 1`
433 # AGE=$(expr $MAJOR_VERSION + 1)
440 AC_DEFUN(AC_STEPMAKE_LOCALE, [
445 AC_ARG_WITH(localedir,
446 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
447 localedir=$with_localedir,
448 localedir='${prefix}/share/locale')
451 [ with-lang=LANG use LANG as language to emit messages],
455 AC_MSG_CHECKING(language)
457 En* | en* | Am* | am* | US* | us*)
459 NL | nl | Du* | du* | Ned* | ned*)
468 if test "$lang" = "unknown" ; then
469 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
474 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
475 DIR_LOCALEDIR=${localedir}
477 if test "$prefix" = "NONE"; then
478 presome=${ac_default_prefix}
480 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
482 AC_SUBST(DIR_LOCALEDIR)
483 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
485 AC_CHECK_LIB(intl, gettext)
486 AC_CHECK_FUNCS(gettext)
489 AC_DEFUN(AC_STEPMAKE_MAN, [
490 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
491 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
492 AC_CHECK_PROGS(TBL, tbl, cat)
495 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
496 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
497 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
498 AC_MSG_CHECKING(whether msgfmt accepts -o)
499 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
500 if test "$msgfmt_output" = ""; then
504 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
506 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
508 if test ! -n "$MSGFMT"; then
509 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
513 #why has this been dropped?
514 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
515 AC_ARG_ENABLE(tex-prefix,
516 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
517 [TEXPREFIX=$enableval],
520 AC_ARG_ENABLE(tex-dir,
521 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
525 AC_ARG_ENABLE(mf-dir,
526 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
530 if test "x$TEXPREFIX" = xauto ; then
531 AC_TEX_PREFIX(TEXPREFIX)
533 find_texprefix=$TEXPREFIX
536 if test "x$MFDIR" = xauto; then
540 if test "x$TEXDIR" = xauto ; then
541 AC_TEX_SUBDIR(TEXDIR)
548 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
549 AC_ARG_ENABLE(tex-tfmdir,
550 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
554 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
555 AC_MSG_CHECKING(for TeX TFM directory)
556 if test "x$TFMDIR" = xauto ; then
557 if test "x$TEX_TFMDIR" = "x" ; then
558 if test "x$KPSEWHICH" != "xno" ; then
559 CMR10=`kpsewhich tfm cmr10.tfm`
560 TEX_TFMDIR=`dirname $CMR10`
562 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
563 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
567 AC_MSG_RESULT($TEX_TFMDIR)
571 AC_DEFUN(AC_STEPMAKE_TEXMF, [
572 # urg, never know what names these teTeX guys will think up
574 AC_CHECK_PROGS(METAFONT, mf, no)
575 if test "x$METAFONT" = "xno"; then
576 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
580 AC_CHECK_PROGS(METAPOST, mp, no)
581 if test "x$METAPOST" = "xno"; then
582 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
587 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
588 if test "x$INIMETAFONT" = "xno"; then
589 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
590 INIMETAFONT=$INIMFONT
593 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
594 if test "x$INIMETAPOST" = "xno"; then
595 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
596 INIMETAPOST=$INIMPOST
599 AC_MSG_CHECKING(for working metafont mode)
600 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
601 for MFMODE in $modelist; do
602 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
603 if test -f mfput.tfm; then
609 # For now let people define these in their environments
611 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
613 if test ${INIMETAPOST} = "inimp" ; then
614 : ${INIMETAPOST_FLAGS=''}
616 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
620 AC_MSG_RESULT($MFMODE)
625 AC_SUBST(INIMETAFONT)
626 AC_SUBST(INIMETAPOST)
628 AC_SUBST(INIMETAPOST_FLAGS)
631 AC_DEFUN(AC_STEPMAKE_WARN, [
636 AC_DEFUN(AC_STEPMAKE_YODL, [
637 if test "x$YODL" = "x"; then
638 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
639 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
640 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
641 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
642 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
643 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
644 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
645 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
646 YODL2LESS_DIR='$(bindir)/'
652 AC_SUBST(YODL2LESS_DIR)
654 AC_SUBST(YODL2MSLESS)
655 AC_SUBST(YODL2TEXINFO)
657 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
659 if test "x$YODL" = "-echo no yodl"; then
660 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
664 dnl should cache result.
665 dnl should look in $prefix first.
666 dnl should probably assume TDS
668 AC_DEFUN(AC_TEX_PREFIX, [
671 AC_MSG_CHECKING(TeX/MF root dir directory)
673 find_root_prefix="$prefix"
676 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
678 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
679 find_texprefix="$find_root_prefix$postfix"
680 if test -d $find_texprefix; then
681 find_texpostfix=$postfix
686 if test "x$find_texpostfix" = x; then
687 find_texpostfix='/lib/texmf/tex'
688 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
691 find_texprefix="$find_root_prefix/$find_texpostfix"
693 # only assign if variablename not empty
694 if test x != "x[$]$1"; then
695 $1='${prefix}'/"$find_texpostfix"
697 AC_MSG_RESULT($find_texprefix)
702 # find a directory inside a prefix,
703 # $1 the prefix (expanded version)
704 # $2 variable to assign
705 # $3 the directory name
707 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
709 AC_MSG_CHECKING($4 directory)
711 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
714 if test "x$find_dirdir" = x; then
716 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
720 AC_MSG_RESULT($1/$find_dirdir)
723 # ugh. this is hopeless
724 AC_DEFUN(AC_KPSE_TEX_DIR, [
725 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
726 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
728 if test -w "$kpse_syspaths";
730 dir=`echo $kpse_syspaths | head -1`
732 dir=`echo $kpse_paths | grep -v '!'| head -1`
734 if test "$prefix" = "NONE"; then
735 local_prefix=$ac_default_prefix
736 local_prefix_quote='${prefix}'
740 local_prefix_quote=$prefix
742 echo $local_prefix_quote = $local_prefix
744 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
747 AC_DEFUN(AC_TEX_SUBDIR, [
748 dnl AC_REQUIRE([AC_TEX_PREFIX])
749 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
753 AC_DEFUN(AC_MF_SUBDIR, [
754 dnl AC_REQUIRE([AC_TEX_PREFIX])
755 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
759 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
760 result="`echo \"$1\" | grep echo`"
761 if test "x$1" = "xerror" -o "x$result" != "x"; then
762 AC_STEPMAKE_WARN(can\'t find $2. $3)
766 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
768 dnl This macro runs the `guile-config' script, installed with Guile,
769 dnl to find out where Guile's header files and libraries are
770 dnl installed. It sets two variables, marked for substitution, as
773 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
774 dnl code that uses Guile header files. This is almost
775 dnl always just a -I flag.
777 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
778 dnl program against Guile. This includes `-lguile' for
779 dnl the Guile library itself, any libraries that Guile
780 dnl itself requires (like -lqthreads), and so on. It may
781 dnl also include a -L flag to tell the compiler where to
782 dnl find the libraries.
784 AC_DEFUN([GUILE_FLAGS],[
785 ## The GUILE_FLAGS macro.
786 AC_MSG_CHECKING(for Guile)
787 if ! $guile_config link > /dev/null ; then
788 AC_MSG_RESULT("cannot execute $guile_config")
789 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
792 GUILE_CFLAGS="`$guile_config compile`"
793 GUILE_LDFLAGS="`$guile_config link`"
794 AC_SUBST(GUILE_CFLAGS)
795 AC_SUBST(GUILE_LDFLAGS)
800 # Configure paths for GTK+
801 # Owen Taylor 97-11-3
803 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
804 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
806 AC_DEFUN(AM_PATH_GTK,
808 dnl Get the cflags and libraries from the gtk-config script
810 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
811 min_gtk_version=ifelse([$1], ,1.1.1,$1)
812 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
814 if test "$GTK_CONFIG" != "no" ; then
815 GTK_CFLAGS=`$GTK_CONFIG --cflags`
816 GTK_LIBS=`$GTK_CONFIG --libs`
817 ac_save_CFLAGS="$CFLAGS"
819 ac_save_CXXFLAGS="$CXXFLAGS"
820 CFLAGS="$CFLAGS $GTK_CFLAGS"
821 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
822 LIBS="$LIBS $GTK_LIBS"
824 dnl Now check if the installed GTK is sufficiently new. (Also sanity
825 dnl checks the results of gtk-config to some extent)
834 int major, minor, micro;
836 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
837 printf("%s, bad version string\n", "$min_gtk_version");
841 return !((gtk_major_version > major) ||
842 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
843 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
845 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
846 CFLAGS="$ac_save_CFLAGS"
847 CXXFLAGS="$ac_save_CXXFLAGS"
852 if test "x$no_gtk" = x ; then
854 ifelse([$2], , :, [$2])
859 ifelse([$3], , :, [$3])
861 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
868 # Configure paths for GTK--
869 # Erik Andersen 30 May 1998
870 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
872 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
873 dnl to be used as follows:
874 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
877 dnl Get the cflags and libraries from the gtkmm-config script
879 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
880 Prefix where GTK-- is installed (optional)],
881 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
882 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
883 Exec prefix where GTK-- is installed (optional)],
884 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
885 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
886 , enable_gtkmmtest=yes)
888 if test x$gtkmm_config_exec_prefix != x ; then
889 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
890 if test x${GTKMM_CONFIG+set} != xset ; then
891 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
894 if test x$gtkmm_config_prefix != x ; then
895 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
896 if test x${GTKMM_CONFIG+set} != xset ; then
897 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
902 AC_DEFUN(AM_PATH_GTKMM,
906 dnl Check if the installed GTK-- is sufficiently new.
908 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
909 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
911 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
913 if test "$GTKMM_CONFIG" = "no" ; then
919 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
920 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
921 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
922 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
923 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
924 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
925 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
926 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
927 if test "x$enable_gtkmmtest" = "xyes" ; then
928 ac_save_CXXFLAGS="$CXXFLAGS"
930 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
931 LIBS="$LIBS $GTK___LIBS"
933 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
934 dnl checks the results of gtkmm-config to some extent
945 int major, minor, micro;
948 system ("touch conf.gtkmmtest");
950 /* HP/UX 0 (%@#!) writes to sscanf strings */
951 tmp_version = g_strdup("$min_gtkmm_version");
952 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
953 printf("%s, bad version string\n", "$min_gtkmm_version");
957 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
958 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
959 (gtkmm_micro_version != $gtkmm_config_micro_version))
961 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
962 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
963 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
964 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
965 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
966 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
967 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
968 printf("*** required on your system.\n");
969 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
970 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
971 printf("*** before re-running configure\n");
973 /* GTK-- does not have the GTKMM_*_VERSION constants */
975 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
976 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
977 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
979 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
980 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
981 printf("*** library (version %d.%d.%d)\n",
982 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
987 if ((gtkmm_major_version > major) ||
988 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
989 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
995 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
996 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
997 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
998 major, minor, micro);
999 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1001 printf("*** If you have already installed a sufficiently new version, this error\n");
1002 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1003 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1004 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1005 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1006 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1007 printf("*** so that the correct libraries are found at run-time))\n");
1012 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1013 CXXFLAGS="$ac_save_CXXFLAGS"
1014 LIBS="$ac_save_LIBS"
1017 if test "x$no_gtkmm" = x ; then
1019 ifelse([$2], , :, [$2])
1022 if test "$GTKMM_CONFIG" = "no" ; then
1023 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1024 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1025 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1026 echo "*** full path to gtk-config."
1027 echo "*** The gtkmm-config script was not available in GTK-- versions"
1028 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1029 echo "*** version to 0.9.12 or newer"
1031 if test -f conf.gtkmmtest ; then
1034 echo "*** Could not run GTK-- test program, checking why..."
1035 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1036 LIBS="$LIBS $GTK___LIBS"
1040 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1041 [ echo "*** The test program compiled, but did not run. This usually means"
1042 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1043 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1044 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1045 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1046 echo "*** is required on your system"
1048 echo "*** If you have an old version installed, it is best to remove it, although"
1049 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1050 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1051 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1052 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1053 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1054 CXXFLAGS="$ac_save_CXXFLAGS"
1055 LIBS="$ac_save_LIBS"
1060 ifelse([$3], , :, [$3])
1063 AC_SUBST(GTK___CFLAGS)
1064 AC_SUBST(GTK___LIBS)
1065 rm -f conf.gtkmmtest
1068 # Configure paths for GTK--DRAW
1069 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1071 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1072 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1074 AC_DEFUN(AM_PATH_GTK__DRAW,
1076 dnl Get the cflags and libraries from the gtk__-config script
1078 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1079 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1080 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1082 if test "$GTKMM_CONFIG" != "no" ; then
1083 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1084 GTK___LIBS=`$GTKMM_CONFIG --libs`
1085 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1086 GTK___LIBS="$GTK___DLIBS"
1087 ac_save_CFLAGS="$CFLAGS"
1088 ac_save_LIBS="$LIBS"
1089 ac_save_CXXFLAGS="$CXXFLAGS"
1090 CFLAGS="$CFLAGS $GTK___CFLAGS"
1091 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1092 LIBS="$LIBS $GTK___LIBS"
1094 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1095 dnl checks the results of gtk__-config to some extent)
1107 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1108 CFLAGS="$ac_save_CFLAGS"
1109 CXXFLAGS="$ac_save_CXXFLAGS"
1110 LIBS="$ac_save_LIBS"
1114 if test "x$no_gtk__" = x ; then
1116 ifelse([$2], , :, [$2])
1121 ifelse([$3], , :, [$3])
1123 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1125 AC_SUBST(GTK___CFLAGS)
1126 AC_SUBST(GTK___LIBS)