1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
4 AC_DEFUN(AC_STEPMAKE_COMPILE, [
5 # -O is necessary to get inlining
8 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
15 AC_ARG_ENABLE(checking,
16 [ enable-checking set runtime checks (assert calls). Default: on],
17 [checking_b=$enableval] )
19 # actually, the default is: tja='-O' to get inlining...
22 #actually, that sucks.
23 # tja looks like a typo. Default is optimisation off. --hwn
25 AC_ARG_ENABLE(optimise,
26 [ enable-optimise use maximal speed optimisations. Default: off],
27 [optimise_b=$enableval])
29 AC_ARG_ENABLE(profiling,
30 [ enable-profiling compile with gprof support. Default: off],
31 [profile_b=$enableval])
33 AC_ARG_ENABLE(debugging,
34 [ enable-debugging set debug info. Default: on],
37 AC_ARG_ENABLE(mingw-prefix,
38 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
39 [MINGWPREFIX=$enableval],
42 if test "$checking_b" = no; then
45 DEFINES="$DEFINES -DNDEBUG"
48 if test "$optimise_b" = yes; then
49 OPTIMIZE="-O2 -finline-functions"
52 if test "$optimise_b" = no; then
56 if test $profile_b = yes; then
58 OPTIMIZE="$OPTIMIZE -pg"
61 if test $debug_b = yes; then
62 OPTIMIZE="$OPTIMIZE -g"
65 # however, C++ support in mingw32 v 0.1.4 is still flaky
66 if test x$MINGWPREFIX != xno; then
67 ICFLAGS="-I$MINGWPREFIX/include"
68 ILDFLAGS="-$MINGWPREFIX/lib"
75 CFLAGS="$CFLAGS $OPTIMIZE"
76 CPPFLAGS=${CPPFLAGS:-""}
86 AC_DEFUN(AC_STEPMAKE_CXX, [
90 AC_CHECK_HEADER(FlexLexer.h, true,
91 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
93 CPPFLAGS="$CPPFLAGS $DEFINES"
94 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
95 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
103 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
104 AC_CACHE_CHECK([whether explicit instantiation is needed],
105 lily_cv_need_explicit_instantiation,
107 template <class T> struct foo { static int baz; };
108 template <class T> int foo<T>::baz = 1;
109 ], [ return foo<int>::baz; ],
110 lily_cv_need_explicit_instantiation=no,
111 lily_cv_need_explicit_instantiation=yes))
112 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
113 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
117 AC_DEFUN(AC_STEPMAKE_DATADIR, [
118 if test "$datadir" = "\${prefix}/share"; then
119 datadir='${prefix}/share/'$package
121 DIR_DATADIR=${datadir}
123 if test "$prefix" = "NONE"; then
124 presome=${ac_default_prefix}
126 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
128 AC_SUBST(DIR_DATADIR)
129 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
132 AC_DEFUN(AC_STEPMAKE_END, [
133 AC_OUTPUT($CONFIGFILE.make:config.make.in)
135 rm -f $srcdir/GNUmakefile
136 cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
137 chmod 444 $srcdir/GNUmakefile
138 if test "$builddir" != "."; then
140 cp $srcdir/make/srcdir.make.in GNUmakefile
141 chmod 444 GNUmakefile
145 AC_DEFUN(AC_STEPMAKE_GXX, [
147 # urg, egcs: how to check for egcs >= 1.1?
148 changequote(<<, >>)dnl
149 if $CXX --version | egrep '2\.[89]' > /dev/null ||
150 $CXX --version | grep 'egcs' > /dev/null
155 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
159 AC_DEFUN(AC_STEPMAKE_GUILE, [
160 ## First, let's just see if we can find Guile at all.
161 AC_MSG_CHECKING("for guile-config")
162 for guile_config in guile-config $target-guile-config $build-guile-config; do
163 AC_MSG_RESULT("$guile_config")
164 if ! $guile_config --version > /dev/null 2>&1 ; then
165 AC_MSG_WARN("cannot execute $guile_config")
166 AC_MSG_CHECKING("if we are cross compiling")
172 if test "$guile_config" = "error"; then
173 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
176 AC_MSG_CHECKING("Guile version")
177 need_guile_version="1.3.4"
178 guile_version=`expr "\`$guile_config --version 2>&1\`" : ".*\($need_guile_version\).*"`
179 AC_MSG_RESULT("$guile_version")
180 if test "$guile_version" != "$need_guile_version"; then
181 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
184 AC_PATH_PROG(GUILE, guile, error)
188 AC_DEFUN(AC_STEPMAKE_INIT, [
191 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
192 if test x$MY_PATCH_LEVEL != x; then
193 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
196 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
197 changequote(<<, >>)dnl
198 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
199 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
202 # No versioning on directory names of sub-packages
204 stepmake=${datadir}/stepmake
206 if test "$prefix" = "NONE"; then
207 presome=${ac_default_prefix}
209 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
211 # urg, how is this supposed to work?
212 if test "$program_prefix" = "NONE"; then
215 if test "$program_suffix" = "NONE"; then
219 AC_MSG_CHECKING(Package)
220 if test "x$PACKAGE" = "xSTEPMAKE"; then
221 AC_MSG_RESULT(Stepmake package!)
223 #if test "x$builddir" != "x"; then
224 # builddir="../$builddir"
228 if test "$srcdir" != "."; then
229 absolute_builddir="`pwd`"
230 package_absolute_builddir="`dirname $absolute_builddir`"
231 package_srcdir="`dirname $srcdir`"
232 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
237 (cd stepmake 2>/dev/null || mkdir stepmake)
238 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
239 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
240 AC_CONFIG_AUX_DIR(bin)
243 AC_MSG_RESULT($PACKAGE)
245 if test "$srcdir" != "."; then
246 absolute_builddir="`pwd`"
247 builddir="`dirname $srcdir`/`basename $absolute_builddir`"
252 AC_MSG_CHECKING(for stepmake)
253 # Check for installed stepmake
254 if test -d $stepmake; then
255 AC_MSG_RESULT($stepmake)
257 stepmake='$(depth)'/$srcdir/stepmake
258 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
261 $HOME/usr/local/share/stepmake/bin\
262 $HOME/usr/local/lib/stepmake/bin\
263 $HOME/usr/share/stepmake/bin\
264 $HOME/usr/lib/stepmake/bin\
265 /usr/local/share/stepmake/bin\
266 /usr/local/lib/stepmake/bin\
267 /usr/share/stepmake/bin\
268 /usr/lib/stepmake/bin\
270 $srcdir/stepmake/bin\
278 AC_SUBST(PACKAGE_NAME)
279 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
280 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
282 if test "$package_depth" = "" ; then
285 package_depth="../$package_depth"
288 AC_SUBST(package_depth)
290 AUTOGENERATE="This file was automatically generated by configure"
291 AC_SUBST(AUTOGENERATE)
293 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
294 if test "x$STATE_VECTOR" != "x"; then
295 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
297 AC_SUBST(STATE_VECTOR)
300 AC_ARG_ENABLE(config,
301 [ enable-config=FILE put configure settings in config-FILE.make],
302 [CONFIGSUFFIX=-$enableval])
304 CONFIGFILE=config$CONFIGSUFFIX
305 AC_SUBST(CONFIGSUFFIX)
308 AC_CHECK_PROGS(MAKE, gmake make, error)
309 AC_CHECK_PROGS(FIND, find, error)
311 dnl system supplied INSTALL is unsafe; use our own install.
313 dnl if test "$INSTALL" = "bin/install-sh"; then
314 dnl export INSTALL="\$\(depth\)/bin/install-sh"
317 AC_CHECK_PROGS(TAR, tar, error)
319 if test "x`uname`" = "xHP-UX"; then
320 AC_PATH_PROG(BASH, bash, /bin/sh)
321 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
322 AC_PATH_PROG(SHELL, bash, /bin/ksh)
324 AC_PATH_PROG(BASH, bash, /bin/sh)
330 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
333 if test $MAKE != "error" ; then
334 $MAKE -v 2> /dev/null | grep GNU > /dev/null
337 AC_STEPMAKE_WARN(Please install *GNU* make)
341 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
343 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
344 LN=cp # hard link does not work under cygnus-nt
345 LN_S='cp -r' # symbolic link does not work for native nt
352 # cygwin fixes all these things.
353 # it seems these were used because of dos-style TEXINPUTS and
354 # MFINPUTS needed for miktex.
355 # but this breaks parsing of all other cygwin/unix style paths.
357 # if your (mik)tex breaks, make a:
358 # /usr/local/bin/tex:
360 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
366 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
368 # this way, you may have buildscripts/out/lilypond-profile
369 # 'automatically' sourced from /usr/etc/profile.d/ too.
373 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
380 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
382 AC_SUBST(program_prefix)
383 AC_SUBST(program_suffix)
388 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
389 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
396 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
399 AC_ARG_ENABLE(kpathsea,
400 [ enable-kpathsea use kpathsea lib. Default: on],
401 [kpathsea_b=$enableval])
403 if test $kpathsea_b = yes; then
404 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
405 AC_CHECK_LIB(kpathsea, kpse_find_file)
406 # urg: kpse_find_tfm is a #define, how to check for this?
407 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
408 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
409 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
411 AC_MSG_CHECKING(whether to use kpathsea)
412 if test $kpathsea_b = yes; then
421 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
424 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
425 # ugh, automake: we want (and check for) bison
427 # ugh, automake: we want (and check for) flex
429 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
433 ac_cv_prog_lex_root=lex.yy
435 AC_CHECK_PROGS(BISON, bison, error)
436 AC_CHECK_PROGS(FLEX, flex, error)
437 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
438 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
440 if test $BISON != "error"; then
441 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
442 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
443 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
451 AC_DEFUN(AC_STEPMAKE_LIB, [
452 AC_CHECK_PROGS(AR, ar, error)
459 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
461 # **Never** try to set library version numbers so that they correspond
462 # to the release number of your package. This is an abuse that only
463 # fosters misunderstanding of the purpose of library versions.
465 REVISION=$PATCH_LEVEL
466 # CURRENT=$MINOR_VERSION
467 CURRENT=`expr $MINOR_VERSION + 1`
468 # AGE=$(expr $MAJOR_VERSION + 1)
475 AC_DEFUN(AC_STEPMAKE_LOCALE, [
480 AC_ARG_WITH(localedir,
481 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
482 localedir=$with_localedir,
483 localedir='${prefix}/share/locale')
486 [ with-lang=LANG use LANG as language to emit messages],
490 AC_MSG_CHECKING(language)
492 En* | en* | Am* | am* | US* | us*)
494 NL | nl | Du* | du* | Ned* | ned*)
503 if test "$lang" = "unknown" ; then
504 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
509 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
510 DIR_LOCALEDIR=${localedir}
512 if test "$prefix" = "NONE"; then
513 presome=${ac_default_prefix}
515 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
517 AC_SUBST(DIR_LOCALEDIR)
518 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
520 AC_CHECK_LIB(intl, gettext)
521 AC_CHECK_FUNCS(gettext)
524 AC_DEFUN(AC_STEPMAKE_MAN, [
525 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
526 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
527 AC_CHECK_PROGS(TBL, tbl, cat)
530 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
531 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
532 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
533 AC_MSG_CHECKING(whether msgfmt accepts -o)
534 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
535 if test "$msgfmt_output" = ""; then
539 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
541 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
543 if test ! -n "$MSGFMT"; then
544 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
548 #why has this been dropped?
549 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
550 AC_ARG_ENABLE(tex-prefix,
551 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. Default: PREFIX],
552 [TEXPREFIX=$enableval],
555 AC_ARG_ENABLE(tex-dir,
556 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
560 AC_ARG_ENABLE(mf-dir,
561 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
565 if test "x$TEXPREFIX" = xauto ; then
566 AC_TEX_PREFIX(TEXPREFIX)
568 find_texprefix=$TEXPREFIX
571 if test "x$MFDIR" = xauto; then
575 if test "x$TEXDIR" = xauto ; then
576 AC_TEX_SUBDIR(TEXDIR)
583 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
584 AC_ARG_ENABLE(tfm-path,
585 [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm. Default: use kpsewhich],
586 [tfm_path=$enableval],
589 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
590 AC_MSG_CHECKING(for tfm path)
594 if test "x$tfm_path" = xauto ; then
595 if test "x$KPSEWHICH" != "xno" ; then
596 for i in $TFM_FONTS; do
597 dir=`$KPSEWHICH tfm ${i}10.tfm`
598 TFM_PATH="$TFM_PATH `dirname $dir`"
601 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
602 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
608 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
609 AC_MSG_RESULT($TFM_PATH)
613 AC_DEFUN(AC_STEPMAKE_TEXMF, [
614 # urg, never know what names these teTeX guys will think up
616 AC_CHECK_PROGS(METAFONT, mf, no)
617 if test "x$METAFONT" = "xno"; then
618 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
622 AC_CHECK_PROGS(METAPOST, mp, no)
623 if test "x$METAPOST" = "xno"; then
624 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
629 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
630 if test "x$INIMETAFONT" = "xno"; then
631 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
632 INIMETAFONT=$INIMFONT
635 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
636 if test "x$INIMETAPOST" = "xno"; then
637 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
638 INIMETAPOST=$INIMPOST
641 AC_MSG_CHECKING(for working metafont mode)
642 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
643 for MFMODE in $modelist; do
644 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
645 if test -f mfput.tfm; then
651 # For now let people define these in their environments
653 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
655 if test ${INIMETAPOST} = "inimp" ; then
656 : ${INIMETAPOST_FLAGS=''}
658 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
662 AC_MSG_RESULT($MFMODE)
667 AC_SUBST(INIMETAFONT)
668 AC_SUBST(INIMETAPOST)
670 AC_SUBST(INIMETAPOST_FLAGS)
673 AC_DEFUN(AC_STEPMAKE_WARN, [
678 AC_DEFUN(AC_STEPMAKE_YODL, [
679 if test "x$YODL" = "x"; then
680 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
681 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
682 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
683 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
684 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
685 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
686 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
687 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
688 YODL2LESS_DIR='$(bindir)/'
694 AC_SUBST(YODL2LESS_DIR)
696 AC_SUBST(YODL2MSLESS)
697 AC_SUBST(YODL2TEXINFO)
699 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
701 if test "x$YODL" = "-echo no yodl"; then
702 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
706 dnl should cache result.
707 dnl should look in $prefix first.
708 dnl should probably assume TDS
710 AC_DEFUN(AC_TEX_PREFIX, [
713 AC_MSG_CHECKING(TeX/MF root dir directory)
715 find_root_prefix="$prefix"
718 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
720 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
721 find_texprefix="$find_root_prefix$postfix"
722 if test -d $find_texprefix; then
723 find_texpostfix=$postfix
728 if test "x$find_texpostfix" = x; then
729 find_texpostfix='/lib/texmf/tex'
730 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
733 find_texprefix="$find_root_prefix/$find_texpostfix"
735 # only assign if variablename not empty
736 if test x != "x[$]$1"; then
737 $1='${prefix}'/"$find_texpostfix"
739 AC_MSG_RESULT($find_texprefix)
744 # find a directory inside a prefix,
745 # $1 the prefix (expanded version)
746 # $2 variable to assign
747 # $3 the directory name
749 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
751 AC_MSG_CHECKING($4 directory)
753 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
756 if test "x$find_dirdir" = x; then
758 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
762 AC_MSG_RESULT($1/$find_dirdir)
765 # ugh. this is hopeless
766 AC_DEFUN(AC_KPSE_TEX_DIR, [
767 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
768 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
770 if test -w "$kpse_syspaths";
772 dir=`echo $kpse_syspaths | head -1`
774 dir=`echo $kpse_paths | grep -v '!'| head -1`
776 if test "$prefix" = "NONE"; then
777 local_prefix=$ac_default_prefix
778 local_prefix_quote='${prefix}'
782 local_prefix_quote=$prefix
784 echo $local_prefix_quote = $local_prefix
786 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
789 AC_DEFUN(AC_TEX_SUBDIR, [
790 dnl AC_REQUIRE([AC_TEX_PREFIX])
791 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
795 AC_DEFUN(AC_MF_SUBDIR, [
796 dnl AC_REQUIRE([AC_TEX_PREFIX])
797 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
801 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
802 result="`echo \"$1\" | grep echo`"
803 if test "x$1" = "xerror" -o "x$result" != "x"; then
804 AC_STEPMAKE_WARN(can\'t find $2. $3)
808 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
810 dnl This macro runs the `guile-config' script, installed with Guile,
811 dnl to find out where Guile's header files and libraries are
812 dnl installed. It sets two variables, marked for substitution, as
815 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
816 dnl code that uses Guile header files. This is almost
817 dnl always just a -I flag.
819 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
820 dnl program against Guile. This includes `-lguile' for
821 dnl the Guile library itself, any libraries that Guile
822 dnl itself requires (like -lqthreads), and so on. It may
823 dnl also include a -L flag to tell the compiler where to
824 dnl find the libraries.
826 AC_DEFUN([GUILE_FLAGS],[
827 ## The GUILE_FLAGS macro.
828 AC_MSG_CHECKING(for Guile)
829 if ! $guile_config link > /dev/null ; then
830 AC_MSG_RESULT("cannot execute $guile_config")
831 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
834 GUILE_CFLAGS="`$guile_config compile`"
835 GUILE_LDFLAGS="`$guile_config link`"
836 AC_SUBST(GUILE_CFLAGS)
837 AC_SUBST(GUILE_LDFLAGS)
842 # Configure paths for GTK+
843 # Owen Taylor 97-11-3
845 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
846 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
848 AC_DEFUN(AM_PATH_GTK,
850 dnl Get the cflags and libraries from the gtk-config script
852 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
853 min_gtk_version=ifelse([$1], ,1.1.1,$1)
854 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
856 if test "$GTK_CONFIG" != "no" ; then
857 GTK_CFLAGS=`$GTK_CONFIG --cflags`
858 GTK_LIBS=`$GTK_CONFIG --libs`
859 ac_save_CFLAGS="$CFLAGS"
861 ac_save_CXXFLAGS="$CXXFLAGS"
862 CFLAGS="$CFLAGS $GTK_CFLAGS"
863 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
864 LIBS="$LIBS $GTK_LIBS"
866 dnl Now check if the installed GTK is sufficiently new. (Also sanity
867 dnl checks the results of gtk-config to some extent)
876 int major, minor, micro;
878 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
879 printf("%s, bad version string\n", "$min_gtk_version");
883 return !((gtk_major_version > major) ||
884 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
885 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
887 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
888 CFLAGS="$ac_save_CFLAGS"
889 CXXFLAGS="$ac_save_CXXFLAGS"
894 if test "x$no_gtk" = x ; then
896 ifelse([$2], , :, [$2])
901 ifelse([$3], , :, [$3])
903 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
910 # Configure paths for GTK--
911 # Erik Andersen 30 May 1998
912 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
914 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
915 dnl to be used as follows:
916 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
919 dnl Get the cflags and libraries from the gtkmm-config script
921 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
922 Prefix where GTK-- is installed (optional)],
923 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
924 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
925 Exec prefix where GTK-- is installed (optional)],
926 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
927 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
928 , enable_gtkmmtest=yes)
930 if test x$gtkmm_config_exec_prefix != x ; then
931 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
932 if test x${GTKMM_CONFIG+set} != xset ; then
933 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
936 if test x$gtkmm_config_prefix != x ; then
937 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
938 if test x${GTKMM_CONFIG+set} != xset ; then
939 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
944 AC_DEFUN(AM_PATH_GTKMM,
948 dnl Check if the installed GTK-- is sufficiently new.
950 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
951 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
953 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
955 if test "$GTKMM_CONFIG" = "no" ; then
961 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
962 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
963 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
964 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
965 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
966 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
967 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
968 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
969 if test "x$enable_gtkmmtest" = "xyes" ; then
970 ac_save_CXXFLAGS="$CXXFLAGS"
972 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
973 LIBS="$LIBS $GTK___LIBS"
975 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
976 dnl checks the results of gtkmm-config to some extent
987 int major, minor, micro;
990 system ("touch conf.gtkmmtest");
992 /* HP/UX 0 (%@#!) writes to sscanf strings */
993 tmp_version = g_strdup("$min_gtkmm_version");
994 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
995 printf("%s, bad version string\n", "$min_gtkmm_version");
999 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1000 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1001 (gtkmm_micro_version != $gtkmm_config_micro_version))
1003 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1004 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1005 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1006 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1007 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1008 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1009 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1010 printf("*** required on your system.\n");
1011 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1012 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1013 printf("*** before re-running configure\n");
1015 /* GTK-- does not have the GTKMM_*_VERSION constants */
1017 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1018 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1019 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1021 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1022 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1023 printf("*** library (version %d.%d.%d)\n",
1024 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1029 if ((gtkmm_major_version > major) ||
1030 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1031 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1037 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1038 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1039 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1040 major, minor, micro);
1041 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1043 printf("*** If you have already installed a sufficiently new version, this error\n");
1044 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1045 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1046 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1047 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1048 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1049 printf("*** so that the correct libraries are found at run-time))\n");
1054 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1055 CXXFLAGS="$ac_save_CXXFLAGS"
1056 LIBS="$ac_save_LIBS"
1059 if test "x$no_gtkmm" = x ; then
1061 ifelse([$2], , :, [$2])
1064 if test "$GTKMM_CONFIG" = "no" ; then
1065 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1066 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1067 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1068 echo "*** full path to gtk-config."
1069 echo "*** The gtkmm-config script was not available in GTK-- versions"
1070 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1071 echo "*** version to 0.9.12 or newer"
1073 if test -f conf.gtkmmtest ; then
1076 echo "*** Could not run GTK-- test program, checking why..."
1077 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1078 LIBS="$LIBS $GTK___LIBS"
1082 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1083 [ echo "*** The test program compiled, but did not run. This usually means"
1084 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1085 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1086 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1087 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1088 echo "*** is required on your system"
1090 echo "*** If you have an old version installed, it is best to remove it, although"
1091 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1092 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1093 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1094 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1095 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1096 CXXFLAGS="$ac_save_CXXFLAGS"
1097 LIBS="$ac_save_LIBS"
1102 ifelse([$3], , :, [$3])
1105 AC_SUBST(GTK___CFLAGS)
1106 AC_SUBST(GTK___LIBS)
1107 rm -f conf.gtkmmtest
1110 # Configure paths for GTK--DRAW
1111 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1113 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1114 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1116 AC_DEFUN(AM_PATH_GTK__DRAW,
1118 dnl Get the cflags and libraries from the gtk__-config script
1120 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1121 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1122 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1124 if test "$GTKMM_CONFIG" != "no" ; then
1125 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1126 GTK___LIBS=`$GTKMM_CONFIG --libs`
1127 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1128 GTK___LIBS="$GTK___DLIBS"
1129 ac_save_CFLAGS="$CFLAGS"
1130 ac_save_LIBS="$LIBS"
1131 ac_save_CXXFLAGS="$CXXFLAGS"
1132 CFLAGS="$CFLAGS $GTK___CFLAGS"
1133 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1134 LIBS="$LIBS $GTK___LIBS"
1136 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1137 dnl checks the results of gtk__-config to some extent)
1149 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1150 CFLAGS="$ac_save_CFLAGS"
1151 CXXFLAGS="$ac_save_CXXFLAGS"
1152 LIBS="$ac_save_LIBS"
1156 if test "x$no_gtk__" = x ; then
1158 ifelse([$2], , :, [$2])
1163 ifelse([$3], , :, [$3])
1165 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1167 AC_SUBST(GTK___CFLAGS)
1168 AC_SUBST(GTK___LIBS)