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_BIBTEX2HTML, [
7 AC_CHECK_PROGS(BIBTEX2HTML, bibtex2html bib2html, error)
8 if test "$BIBTEX2HTML" = "bib2html"; then
9 BIBTEX2HTML_FLAGS='$< $(@)'
11 BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
14 AC_SUBST(BIBTEX2HTML_FLAGS)
18 AC_DEFUN(AC_STEPMAKE_COMPILE, [
19 # -O is necessary to get inlining
21 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
22 LDFLAGS=${LDFLAGS:-""}
28 AC_ARG_ENABLE(checking,
29 [ --enable-checking set runtime checks (assert calls). Default: on],
30 [checking_b=$enableval] )
32 AC_ARG_ENABLE(debugging,
33 [ --enable-debugging compile with debugging info. Default: on],
36 AC_ARG_ENABLE(optimising,
37 [ --enable-optimising compile with optimising. Default: on],
38 [optimise_b=$enableval])
40 AC_ARG_ENABLE(profiling,
41 [ --enable-profiling compile with gprof support. Default: off],
42 [profile_b=$enableval])
45 if test "$checking_b" = no; then
48 DEFINES="$DEFINES -DNDEBUG"
51 if test "$optimise_b" = yes; then
52 OPTIMIZE="-O2 -finline-functions"
56 if test $profile_b = yes; then
58 OPTIMIZE="$OPTIMIZE -pg"
61 if test $debug_b = yes; then
62 OPTIMIZE="$OPTIMIZE -g"
70 CFLAGS="$CFLAGS $OPTIMIZE"
71 CPPFLAGS=${CPPFLAGS:-""}
73 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
77 dnl should do compile test?
79 CFLAGS="-mieee $CFLAGS"
85 AC_SUBST(cross_compiling)
95 AC_DEFUN(AC_STEPMAKE_CXX, [
99 AC_CHECK_HEADER(FlexLexer.h, true,
100 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
102 CPPFLAGS="$CPPFLAGS $DEFINES"
103 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
104 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
112 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
113 AC_CACHE_CHECK([whether explicit instantiation is needed],
114 lily_cv_need_explicit_instantiation,
116 template <class T> struct foo { static int baz; };
117 template <class T> int foo<T>::baz = 1;
118 ], [ return foo<int>::baz; ],
119 lily_cv_need_explicit_instantiation=no,
120 lily_cv_need_explicit_instantiation=yes))
121 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
122 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
126 AC_DEFUN(AC_STEPMAKE_DATADIR, [
127 if test "$datadir" = "\${prefix}/share"; then
128 datadir='${prefix}/share/'$package
130 DIR_DATADIR=${datadir}
132 if test "$prefix" = "NONE"; then
133 presome=${ac_default_prefix}
135 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
138 AC_SUBST(DIR_DATADIR)
140 dnl yeah, so fuck me gently with a cactus: this doesnt belong here
141 dnl Please take the person responsible for inventing shell-scripts out
142 dnl and shoot him. On behalf of the sane world, thank you.
143 dnl DIR_SHAREDSTATEDIR="foobar"
144 dnl AC_SUBST(DIR_SHAREDSTATEDIR)
146 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
149 AC_DEFUN(AC_STEPMAKE_END, [
150 AC_OUTPUT($CONFIGFILE.make:config.make.in)
152 # regular in-place build
153 # test for srcdir_build = yes ?
154 if test "$builddir" = "."; then
155 rm -f $srcdir/GNUmakefile
156 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
157 chmod 444 $srcdir/GNUmakefile
158 else # --srcdir build
160 cp $srcdir/make/srcdir.make.in GNUmakefile
161 chmod 444 GNUmakefile
165 AC_DEFUN(AC_STEPMAKE_GXX, [
166 AC_MSG_CHECKING("g++ version")
167 cxx_version=`$CXX --version`
168 AC_MSG_RESULT("$cxx_version")
169 changequote(<<, >>)dnl
170 # urg, egcs: how to check for egcs >= 1.1?
171 if expr "$cxx_version" : '.*2\.[89]' > /dev/null ||
172 expr "$cxx_version" : '.*egcs' > /dev/null ||
173 expr "$cxx_version" : '3\.0' > /dev/null
178 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9, 3.0 or egcs 1.1)
182 AC_DEFUN(AC_STEPMAKE_GUILE, [
183 ## First, let's just see if we can find Guile at all.
184 AC_MSG_CHECKING("for guile-config")
185 for guile_config in guile-config $target-guile-config $build-guile-config; do
186 AC_MSG_RESULT("$guile_config")
187 if ! $guile_config --version > /dev/null 2>&1 ; then
188 AC_MSG_WARN("cannot execute $guile_config")
189 AC_MSG_CHECKING("if we are cross compiling")
195 if test "$guile_config" = "error"; then
196 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
199 AC_MSG_CHECKING("Guile version")
200 need_guile_version="1.3.4"
201 need_guile_version_numeric=100304
202 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
203 guile_version_numeric=`echo $guile_version | awk -F. '
204 {if ([$]3) {last = [$]3}
206 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
207 AC_MSG_RESULT("$guile_version")
208 if test $guile_version_numeric -lt $need_guile_version_numeric
210 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
212 changequote(<<, >>)dnl
213 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
214 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
217 AC_PATH_PROG(GUILE, guile, error)
219 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
220 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
223 AC_DEFUN(AC_STEPMAKE_INIT, [
226 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
227 if test x$MY_PATCH_LEVEL != x; then
228 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
231 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
232 changequote(<<, >>)dnl
233 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
234 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
237 # No versioning on directory names of sub-packages
239 stepmake=${datadir}/stepmake
241 if test "$prefix" = "NONE"; then
242 presome=${ac_default_prefix}
244 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
246 # urg, how is this supposed to work?
247 if test "$program_prefix" = "NONE"; then
250 if test "$program_suffix" = "NONE"; then
254 AC_MSG_CHECKING(Package)
255 if test "x$PACKAGE" = "xSTEPMAKE"; then
256 AC_MSG_RESULT(Stepmake package!)
258 AC_MSG_CHECKING(builddir)
259 if test "$srcdir" = "."; then
262 absolute_builddir="`pwd`"
263 package_absolute_builddir="`dirname $absolute_builddir`"
264 package_srcdir="`dirname $srcdir`"
265 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
267 AC_MSG_RESULT($builddir)
269 (cd stepmake 2>/dev/null || mkdir stepmake)
270 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
271 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
272 AC_CONFIG_AUX_DIR(bin)
275 AC_MSG_RESULT($PACKAGE)
277 AC_MSG_CHECKING(builddir)
278 if test "$srcdir" = "."; then
282 absolute_builddir="`pwd`"
283 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
284 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
287 AC_MSG_RESULT($builddir)
288 if expr "$srcdir" : '/' > /dev/null 2>&1; then
290 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
293 AC_MSG_CHECKING(for stepmake)
294 # Check for installed stepmake
295 if test -d $stepmake; then
296 AC_MSG_RESULT($stepmake)
298 if test "$absolute_srcdir" != "yes"; then
299 stepmake='$(depth)'/$srcdir/stepmake
301 stepmake=$srcdir/stepmake
303 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
307 $HOME/usr/local/share/stepmake/bin\
308 $HOME/usr/local/lib/stepmake/bin\
309 $HOME/usr/share/stepmake/bin\
310 $HOME/usr/lib/stepmake/bin\
311 /usr/local/share/stepmake/bin\
312 /usr/local/lib/stepmake/bin\
313 /usr/share/stepmake/bin\
314 /usr/lib/stepmake/bin\
316 $srcdir/stepmake/bin\
324 AC_SUBST(PACKAGE_NAME)
325 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
326 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
328 if test "$package_depth" = "" ; then
331 package_depth="../$package_depth"
334 AC_SUBST(package_depth)
336 AUTOGENERATE="This file was automatically generated by configure"
337 AC_SUBST(AUTOGENERATE)
340 AC_ARG_ENABLE(config,
341 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
342 do \`make conf=CONF' to get output in ./out-CONF],
343 [CONFIGURATION=$enableval])
345 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
346 CONFIGFILE=config$CONFIGSUFFIX
347 AC_SUBST(CONFIGSUFFIX)
350 AC_CHECK_PROGS(MAKE, gmake make, error)
351 AC_CHECK_PROGS(FIND, find, error)
353 dnl system supplied INSTALL is unsafe; use our own install.
355 dnl if test "$INSTALL" = "bin/install-sh"; then
356 dnl export INSTALL="\$\(depth\)/bin/install-sh"
359 AC_CHECK_PROGS(TAR, tar, error)
361 if test "x`uname`" = "xHP-UX"; then
362 AC_PATH_PROG(BASH, bash, /bin/sh)
363 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
364 AC_PATH_PROG(SHELL, bash, /bin/ksh)
366 AC_PATH_PROG(BASH, bash, /bin/sh)
372 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
375 if test $MAKE != "error" ; then
376 $MAKE -v 2> /dev/null | grep GNU > /dev/null
379 AC_STEPMAKE_WARN(Please install *GNU* make)
383 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
385 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
386 LN=cp # hard link does not work under cygnus-nt
387 LN_S='cp -r' # symbolic link does not work for native nt
395 # cygwin fixes all these things.
396 # it seems these were used because of dos-style TEXINPUTS and
397 # MFINPUTS needed for miktex.
398 # but this breaks parsing of all other cygwin/unix style paths.
400 # if your (mik)tex breaks, make a:
401 # /usr/local/bin/tex:
403 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
409 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
411 # this way, you may have buildscripts/out/lilypond-profile
412 # 'automatically' sourced from /usr/etc/profile.d/ too.
417 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
425 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
427 AC_SUBST(program_prefix)
428 AC_SUBST(program_suffix)
433 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
434 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
441 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
444 #FIXME --with-xxx is meant for specifying a PATH too,
445 # so this should read: --enable-kpathsea,
446 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
447 AC_ARG_WITH(kpathsea,
448 [ --with-kpathsea use kpathsea lib. Default: on],
449 [kpathsea_b=$with_kpathsea])
451 if test "$kpathsea_b" != "no"; then
452 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
453 AC_CHECK_LIB(kpathsea, kpse_find_file)
454 AC_CHECK_FUNCS(kpse_find_file,, AC_ERROR(Cannot find kpathsea functions. You should install kpathsea; see INSTALL.txt. Rerun ./configure --without-kpathsea only if kpathsea is not available for your platform.))
456 AC_MSG_CHECKING(whether to use kpathsea)
457 if test "$kpathsea_b" != no; then
466 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
469 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
470 # ugh, automake: we want (and check for) bison
472 # ugh, automake: we want (and check for) flex
474 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
478 ac_cv_prog_lex_root=lex.yy
480 AC_CHECK_PROGS(BISON, bison, error)
481 AC_CHECK_PROGS(FLEX, flex, error)
482 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
483 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
486 ## Urg. We should fix this configure test. -- so clumsy
487 if test $BISON != "error"; then
488 bison_version=`$BISON --version | head -1 | sed 's/^.* 1\.//g'`
489 if test $bison_version -lt 25; then
490 AC_STEPMAKE_WARN(The bison installed might be too old (1.$bison_version). You might have to install 1.25)
498 AC_DEFUN(AC_STEPMAKE_LIB, [
499 AC_CHECK_PROGS(AR, ar, error)
506 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
508 # **Never** try to set library version numbers so that they correspond
509 # to the release number of your package. This is an abuse that only
510 # fosters misunderstanding of the purpose of library versions.
512 REVISION=$PATCH_LEVEL
513 # CURRENT=$MINOR_VERSION
514 CURRENT=`expr $MINOR_VERSION + 1`
515 # AGE=$(expr $MAJOR_VERSION + 1)
522 AC_DEFUN(AC_STEPMAKE_LOCALE, [
527 AC_ARG_WITH(localedir,
528 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
529 PREFIX/share/locale ],
530 localedir=$with_localedir,
531 localedir='${prefix}/share/locale')
534 [ --with-lang=LANG use LANG as language to emit messages],
538 AC_MSG_CHECKING(language)
540 En* | en* | Am* | am* | US* | us*)
542 NL | nl | Du* | du* | Ned* | ned*)
551 if test "$lang" = "unknown" ; then
552 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
557 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
558 DIR_LOCALEDIR=${localedir}
560 if test "$prefix" = "NONE"; then
561 presome=${ac_default_prefix}
563 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
565 AC_SUBST(DIR_LOCALEDIR)
566 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
568 AC_CHECK_LIB(intl, gettext)
569 AC_CHECK_FUNCS(gettext)
572 AC_DEFUN(AC_STEPMAKE_MAKEINFO, [
573 AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
574 if test "$MAKEINFO" != "error"; then
575 AC_MSG_CHECKING(whether makeinfo can split html by @node)
577 makeinfo --html --output=out/split <<EOF
579 \input texinfo @c -*-texinfo-*-
580 @setfilename split.info
584 if test -d out/split; then
585 SPLITTING_MAKEINFO=yes
590 AC_STEPMAKE_WARN(your html documentation will be one large file)
594 AC_SUBST(SPLITTING_MAKEINFO)
598 AC_DEFUN(AC_STEPMAKE_MAN, [
599 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
600 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
601 AC_CHECK_PROGS(TBL, tbl, cat)
604 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
605 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
606 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
607 AC_MSG_CHECKING(whether msgfmt accepts -o)
608 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
609 if test "$msgfmt_output" = ""; then
613 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
615 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
617 if test ! -n "$MSGFMT"; then
618 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
622 #why has this been dropped?
623 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
624 AC_ARG_ENABLE(tex-prefix,
625 [ --enable-tex-prefix=DIR set the tex-directory to find TeX
626 subdirectories. Default: PREFIX],
627 [TEXPREFIX=$enableval],
630 AC_ARG_ENABLE(tex-dir,
631 [ --enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
635 AC_ARG_ENABLE(mf-dir,
636 [ --enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
640 if test "x$TEXPREFIX" = xauto ; then
641 AC_TEX_PREFIX(TEXPREFIX)
643 find_texprefix=$TEXPREFIX
646 if test "x$MFDIR" = xauto; then
650 if test "x$TEXDIR" = xauto ; then
651 AC_TEX_SUBDIR(TEXDIR)
658 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
659 AC_ARG_ENABLE(tfm-path,
660 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
661 esp.: cmr10.tfm. Default: use kpsewhich],
662 [tfm_path=$enableval],
665 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
666 AC_MSG_CHECKING(for tfm path)
670 if test "x$tfm_path" = xauto ; then
671 if test "x$KPSEWHICH" != "xno" ; then
672 for i in $TFM_FONTS; do
673 dir=`$KPSEWHICH tfm ${i}10.tfm`
674 TFM_PATH="$TFM_PATH `dirname $dir`"
677 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
678 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
684 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
685 AC_MSG_RESULT($TFM_PATH)
689 AC_DEFUN(AC_STEPMAKE_TEXMF, [
690 # urg, never know what names these teTeX guys will think up
692 AC_CHECK_PROGS(METAFONT, mf, no)
693 if test "x$METAFONT" = "xno"; then
694 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
698 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
699 if test "x$INIMETAFONT" = "xno"; then
700 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
701 INIMETAFONT=$INIMFONT
704 AC_MSG_CHECKING(for working metafont mode)
705 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
706 for MFMODE in $modelist; do
707 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
708 if test -f mfput.tfm; then
712 AC_MSG_RESULT($MFMODE)
718 AC_SUBST(INIMETAFONT)
721 AC_DEFUN(AC_STEPMAKE_WARN, [
726 AC_DEFUN(AC_STEPMAKE_YODL, [
727 if test "x$YODL" = "x"; then
728 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
729 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
730 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
731 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
732 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
733 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
734 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
735 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
736 YODL2LESS_DIR='$(bindir)/'
742 AC_SUBST(YODL2LESS_DIR)
744 AC_SUBST(YODL2MSLESS)
745 AC_SUBST(YODL2TEXINFO)
747 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
749 if test "x$YODL" = "-echo no yodl"; then
750 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
754 dnl should cache result.
755 dnl should look in $prefix first.
756 dnl should probably assume TDS
758 AC_DEFUN(AC_TEX_PREFIX, [
761 AC_MSG_CHECKING(TeX/MF root dir directory)
763 find_root_prefix="$prefix"
766 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
768 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
769 find_texprefix="$find_root_prefix$postfix"
770 if test -d $find_texprefix; then
771 find_texpostfix=$postfix
776 if test "x$find_texpostfix" = x; then
777 find_texpostfix='/lib/texmf/tex'
778 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
781 find_texprefix="$find_root_prefix/$find_texpostfix"
783 # only assign if variablename not empty
784 if test x != "x[$]$1"; then
785 $1='${prefix}'/"$find_texpostfix"
787 AC_MSG_RESULT($find_texprefix)
792 # find a directory inside a prefix,
793 # $1 the prefix (expanded version)
794 # $2 variable to assign
795 # $3 the directory name
797 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
799 AC_MSG_CHECKING($4 directory)
801 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
804 if test "x$find_dirdir" = x; then
806 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
810 AC_MSG_RESULT($1/$find_dirdir)
813 # ugh. this is hopeless
814 AC_DEFUN(AC_KPSE_TEX_DIR, [
815 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
816 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
818 if test -w "$kpse_syspaths";
820 dir=`echo $kpse_syspaths | head -1`
822 dir=`echo $kpse_paths | grep -v '!'| head -1`
824 if test "$prefix" = "NONE"; then
825 local_prefix=$ac_default_prefix
826 local_prefix_quote='${prefix}'
830 local_prefix_quote=$prefix
832 echo $local_prefix_quote = $local_prefix
834 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
837 AC_DEFUN(AC_TEX_SUBDIR, [
838 dnl AC_REQUIRE([AC_TEX_PREFIX])
839 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
843 AC_DEFUN(AC_MF_SUBDIR, [
844 dnl AC_REQUIRE([AC_TEX_PREFIX])
845 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
849 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
850 result="`echo \"$1\" | grep echo`"
851 if test "x$1" = "xerror" -o "x$result" != "x"; then
852 AC_STEPMAKE_WARN(can\'t find $2. $3)
856 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
858 dnl This macro runs the `guile-config' script, installed with Guile,
859 dnl to find out where Guile's header files and libraries are
860 dnl installed. It sets two variables, marked for substitution, as
863 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
864 dnl code that uses Guile header files. This is almost
865 dnl always just a -I flag.
867 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
868 dnl program against Guile. This includes `-lguile' for
869 dnl the Guile library itself, any libraries that Guile
870 dnl itself requires (like -lqthreads), and so on. It may
871 dnl also include a -L flag to tell the compiler where to
872 dnl find the libraries.
874 AC_DEFUN([GUILE_FLAGS],[
875 ## The GUILE_FLAGS macro.
876 AC_MSG_CHECKING(for Guile)
877 if ! $guile_config link > /dev/null ; then
878 AC_MSG_RESULT("cannot execute $guile_config")
879 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
882 GUILE_CFLAGS="`$guile_config compile`"
883 GUILE_LDFLAGS="`$guile_config link`"
884 AC_SUBST(GUILE_CFLAGS)
885 AC_SUBST(GUILE_LDFLAGS)
890 # Configure paths for GTK+
891 # Owen Taylor 97-11-3
893 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
894 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
896 AC_DEFUN(AM_PATH_GTK,
898 dnl Get the cflags and libraries from the gtk-config script
900 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
901 min_gtk_version=ifelse([$1], ,1.1.1,$1)
902 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
904 if test "$GTK_CONFIG" != "no" ; then
905 GTK_CFLAGS=`$GTK_CONFIG --cflags`
906 GTK_LIBS=`$GTK_CONFIG --libs`
907 ac_save_CFLAGS="$CFLAGS"
909 ac_save_CXXFLAGS="$CXXFLAGS"
910 CFLAGS="$CFLAGS $GTK_CFLAGS"
911 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
912 LIBS="$LIBS $GTK_LIBS"
914 dnl Now check if the installed GTK is sufficiently new. (Also sanity
915 dnl checks the results of gtk-config to some extent)
924 int major, minor, micro;
926 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
927 printf("%s, bad version string\n", "$min_gtk_version");
931 return !((gtk_major_version > major) ||
932 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
933 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
935 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
936 CFLAGS="$ac_save_CFLAGS"
937 CXXFLAGS="$ac_save_CXXFLAGS"
942 if test "x$no_gtk" = x ; then
944 ifelse([$2], , :, [$2])
949 ifelse([$3], , :, [$3])
951 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
958 # Configure paths for GTK--
959 # Erik Andersen 30 May 1998
960 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
962 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
963 dnl to be used as follows:
964 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
967 dnl Get the cflags and libraries from the gtkmm-config script
969 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
970 Prefix where GTK-- is installed (optional)],
971 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
972 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
973 Exec prefix where GTK-- is installed (optional)],
974 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
975 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
976 , enable_gtkmmtest=yes)
978 if test x$gtkmm_config_exec_prefix != x ; then
979 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
980 if test x${GTKMM_CONFIG+set} != xset ; then
981 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
984 if test x$gtkmm_config_prefix != x ; then
985 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
986 if test x${GTKMM_CONFIG+set} != xset ; then
987 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
992 AC_DEFUN(AM_PATH_GTKMM,
996 dnl Check if the installed GTK-- is sufficiently new.
998 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
999 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
1001 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
1003 if test "$GTKMM_CONFIG" = "no" ; then
1009 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1010 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1011 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1012 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1013 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1014 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1015 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1016 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1017 if test "x$enable_gtkmmtest" = "xyes" ; then
1018 ac_save_CXXFLAGS="$CXXFLAGS"
1019 ac_save_LIBS="$LIBS"
1020 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1021 LIBS="$LIBS $GTK___LIBS"
1023 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1024 dnl checks the results of gtkmm-config to some extent
1026 rm -f conf.gtkmmtest
1035 int major, minor, micro;
1038 system ("touch conf.gtkmmtest");
1040 /* HP/UX 0 (%@#!) writes to sscanf strings */
1041 tmp_version = g_strdup("$min_gtkmm_version");
1042 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1043 printf("%s, bad version string\n", "$min_gtkmm_version");
1047 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1048 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1049 (gtkmm_micro_version != $gtkmm_config_micro_version))
1051 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1052 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1053 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1054 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1055 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1056 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1057 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1058 printf("*** required on your system.\n");
1059 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1060 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1061 printf("*** before re-running configure\n");
1063 /* GTK-- does not have the GTKMM_*_VERSION constants */
1065 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1066 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1067 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1069 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1070 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1071 printf("*** library (version %d.%d.%d)\n",
1072 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1077 if ((gtkmm_major_version > major) ||
1078 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1079 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1085 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1086 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1087 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1088 major, minor, micro);
1089 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1091 printf("*** If you have already installed a sufficiently new version, this error\n");
1092 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1093 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1094 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1095 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1096 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1097 printf("*** so that the correct libraries are found at run-time))\n");
1102 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1103 CXXFLAGS="$ac_save_CXXFLAGS"
1104 LIBS="$ac_save_LIBS"
1107 if test "x$no_gtkmm" = x ; then
1109 ifelse([$2], , :, [$2])
1112 if test "$GTKMM_CONFIG" = "no" ; then
1113 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1114 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1115 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1116 echo "*** full path to gtk-config."
1117 echo "*** The gtkmm-config script was not available in GTK-- versions"
1118 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1119 echo "*** version to 0.9.12 or newer"
1121 if test -f conf.gtkmmtest ; then
1124 echo "*** Could not run GTK-- test program, checking why..."
1125 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1126 LIBS="$LIBS $GTK___LIBS"
1130 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1131 [ echo "*** The test program compiled, but did not run. This usually means"
1132 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1133 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1134 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1135 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1136 echo "*** is required on your system"
1138 echo "*** If you have an old version installed, it is best to remove it, although"
1139 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1140 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1141 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1142 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1143 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1144 CXXFLAGS="$ac_save_CXXFLAGS"
1145 LIBS="$ac_save_LIBS"
1150 ifelse([$3], , :, [$3])
1153 AC_SUBST(GTK___CFLAGS)
1154 AC_SUBST(GTK___LIBS)
1155 rm -f conf.gtkmmtest
1158 # Configure paths for GTK--DRAW
1159 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1161 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1162 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1164 AC_DEFUN(AM_PATH_GTK__DRAW,
1166 dnl Get the cflags and libraries from the gtk__-config script
1168 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1169 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1170 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1172 if test "$GTKMM_CONFIG" != "no" ; then
1173 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1174 GTK___LIBS=`$GTKMM_CONFIG --libs`
1175 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1176 GTK___LIBS="$GTK___DLIBS"
1177 ac_save_CFLAGS="$CFLAGS"
1178 ac_save_LIBS="$LIBS"
1179 ac_save_CXXFLAGS="$CXXFLAGS"
1180 CFLAGS="$CFLAGS $GTK___CFLAGS"
1181 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1182 LIBS="$LIBS $GTK___LIBS"
1184 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1185 dnl checks the results of gtk__-config to some extent)
1197 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1198 CFLAGS="$ac_save_CFLAGS"
1199 CXXFLAGS="$ac_save_CXXFLAGS"
1200 LIBS="$ac_save_LIBS"
1204 if test "x$no_gtk__" = x ; then
1206 ifelse([$2], , :, [$2])
1211 ifelse([$3], , :, [$3])
1213 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1215 AC_SUBST(GTK___CFLAGS)
1216 AC_SUBST(GTK___LIBS)