1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
4 AC_DEFUN(AC_STEPMAKE_BIBTEX2HTML, [
5 AC_CHECK_PROGS(BIBTEX2HTML, bibtex2html bib2html, error)
6 if test "$BIBTEX2HTML" = "bib2html"; then
7 BIBTEX2HTML_FLAGS='$< $(@)'
9 BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
12 AC_SUBST(BIBTEX2HTML_FLAGS)
16 AC_DEFUN(AC_STEPMAKE_COMPILE, [
17 # -O is necessary to get inlining
19 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
20 LDFLAGS=${LDFLAGS:-""}
26 AC_ARG_ENABLE(checking,
27 [ --enable-checking set runtime checks (assert calls). Default: on],
28 [checking_b=$enableval] )
30 AC_ARG_ENABLE(debugging,
31 [ --enable-debugging compile with debugging info. Default: on],
34 AC_ARG_ENABLE(profiling,
35 [ --enable-profiling compile with gprof support. Default: off],
36 [profile_b=$enableval])
39 if test "$checking_b" = no; then
42 DEFINES="$DEFINES -DNDEBUG"
45 if test "$optimise_b" = yes; then
46 OPTIMIZE="-O2 -finline-functions"
50 if test $profile_b = yes; then
52 OPTIMIZE="$OPTIMIZE -pg"
55 if test $debug_b = yes; then
56 OPTIMIZE="$OPTIMIZE -g"
64 CFLAGS="$CFLAGS $OPTIMIZE"
65 CPPFLAGS=${CPPFLAGS:-""}
67 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
71 dnl should do compile test?
73 CFLAGS="-mieee $CFLAGS"
79 AC_SUBST(cross_compiling)
89 AC_DEFUN(AC_STEPMAKE_CXX, [
93 AC_CHECK_HEADER(FlexLexer.h, true,
94 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
96 CPPFLAGS="$CPPFLAGS $DEFINES"
97 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
98 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
106 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
107 AC_CACHE_CHECK([whether explicit instantiation is needed],
108 lily_cv_need_explicit_instantiation,
110 template <class T> struct foo { static int baz; };
111 template <class T> int foo<T>::baz = 1;
112 ], [ return foo<int>::baz; ],
113 lily_cv_need_explicit_instantiation=no,
114 lily_cv_need_explicit_instantiation=yes))
115 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
116 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
120 AC_DEFUN(AC_STEPMAKE_DATADIR, [
121 if test "$datadir" = "\${prefix}/share"; then
122 datadir='${prefix}/share/'$package
124 DIR_DATADIR=${datadir}
126 if test "$prefix" = "NONE"; then
127 presome=${ac_default_prefix}
129 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
132 AC_SUBST(DIR_DATADIR)
134 dnl yeah, so fuck me gently with a cactus: this doesnt belong here
135 dnl Please take the person responsible for inventing shell-scripts out
136 dnl and shoot him. On behalf of the sane world, thank you.
137 dnl DIR_SHAREDSTATEDIR="foobar"
138 dnl AC_SUBST(DIR_SHAREDSTATEDIR)
140 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
143 AC_DEFUN(AC_STEPMAKE_END, [
144 AC_OUTPUT($CONFIGFILE.make:config.make.in)
146 # regular in-place build
147 # test for srcdir_build = yes ?
148 if test "$builddir" = "."; then
149 rm -f $srcdir/GNUmakefile
150 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
151 chmod 444 $srcdir/GNUmakefile
152 else # --srcdir build
154 cp $srcdir/make/srcdir.make.in GNUmakefile
155 chmod 444 GNUmakefile
159 AC_DEFUN(AC_STEPMAKE_GXX, [
160 AC_MSG_CHECKING("g++ version")
161 cxx_version=`$CXX --version`
162 AC_MSG_RESULT("$cxx_version")
163 changequote(<<, >>)dnl
164 # urg, egcs: how to check for egcs >= 1.1?
165 if expr "$cxx_version" : '.*2\.[89]' > /dev/null ||
166 expr "$cxx_version" : '.*egcs' > /dev/null ||
167 expr "$cxx_version" : '3\.0' > /dev/null
172 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9, 3.0 or egcs 1.1)
176 AC_DEFUN(AC_STEPMAKE_GUILE, [
177 ## First, let's just see if we can find Guile at all.
178 AC_MSG_CHECKING("for guile-config")
179 for guile_config in guile-config $target-guile-config $build-guile-config; do
180 AC_MSG_RESULT("$guile_config")
181 if ! $guile_config --version > /dev/null 2>&1 ; then
182 AC_MSG_WARN("cannot execute $guile_config")
183 AC_MSG_CHECKING("if we are cross compiling")
189 if test "$guile_config" = "error"; then
190 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
193 AC_MSG_CHECKING("Guile version")
194 need_guile_version="1.3.4"
195 need_guile_version_numeric=100304
196 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
197 guile_version_numeric=`echo $guile_version | awk -F. '
198 {if ([$]3) {last = [$]3}
200 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
201 AC_MSG_RESULT("$guile_version")
202 if test $guile_version_numeric -lt $need_guile_version_numeric
204 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
206 changequote(<<, >>)dnl
207 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
208 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
211 AC_PATH_PROG(GUILE, guile, error)
213 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
214 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
217 AC_DEFUN(AC_STEPMAKE_INIT, [
220 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
221 if test x$MY_PATCH_LEVEL != x; then
222 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
225 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
226 changequote(<<, >>)dnl
227 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
228 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
231 # No versioning on directory names of sub-packages
233 stepmake=${datadir}/stepmake
235 if test "$prefix" = "NONE"; then
236 presome=${ac_default_prefix}
238 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
240 # urg, how is this supposed to work?
241 if test "$program_prefix" = "NONE"; then
244 if test "$program_suffix" = "NONE"; then
248 AC_MSG_CHECKING(Package)
249 if test "x$PACKAGE" = "xSTEPMAKE"; then
250 AC_MSG_RESULT(Stepmake package!)
252 AC_MSG_CHECKING(builddir)
253 if test "$srcdir" = "."; then
256 absolute_builddir="`pwd`"
257 package_absolute_builddir="`dirname $absolute_builddir`"
258 package_srcdir="`dirname $srcdir`"
259 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
261 AC_MSG_RESULT($builddir)
263 (cd stepmake 2>/dev/null || mkdir stepmake)
264 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
265 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
266 AC_CONFIG_AUX_DIR(bin)
269 AC_MSG_RESULT($PACKAGE)
271 AC_MSG_CHECKING(builddir)
272 if test "$srcdir" = "."; then
276 absolute_builddir="`pwd`"
277 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
278 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
281 AC_MSG_RESULT($builddir)
282 if expr "$srcdir" : '/' > /dev/null 2>&1; then
284 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
287 AC_MSG_CHECKING(for stepmake)
288 # Check for installed stepmake
289 if test -d $stepmake; then
290 AC_MSG_RESULT($stepmake)
292 if test "$absolute_srcdir" != "yes"; then
293 stepmake='$(depth)'/$srcdir/stepmake
295 stepmake=$srcdir/stepmake
297 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
301 $HOME/usr/local/share/stepmake/bin\
302 $HOME/usr/local/lib/stepmake/bin\
303 $HOME/usr/share/stepmake/bin\
304 $HOME/usr/lib/stepmake/bin\
305 /usr/local/share/stepmake/bin\
306 /usr/local/lib/stepmake/bin\
307 /usr/share/stepmake/bin\
308 /usr/lib/stepmake/bin\
310 $srcdir/stepmake/bin\
318 AC_SUBST(PACKAGE_NAME)
319 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
320 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
322 if test "$package_depth" = "" ; then
325 package_depth="../$package_depth"
328 AC_SUBST(package_depth)
330 AUTOGENERATE="This file was automatically generated by configure"
331 AC_SUBST(AUTOGENERATE)
334 AC_ARG_ENABLE(config,
335 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
336 do \`make conf=CONF' to get output in ./out-CONF],
337 [CONFIGURATION=$enableval])
339 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
340 CONFIGFILE=config$CONFIGSUFFIX
341 AC_SUBST(CONFIGSUFFIX)
344 AC_CHECK_PROGS(MAKE, gmake make, error)
345 AC_CHECK_PROGS(FIND, find, error)
347 dnl system supplied INSTALL is unsafe; use our own install.
349 dnl if test "$INSTALL" = "bin/install-sh"; then
350 dnl export INSTALL="\$\(depth\)/bin/install-sh"
353 AC_CHECK_PROGS(TAR, tar, error)
355 if test "x`uname`" = "xHP-UX"; then
356 AC_PATH_PROG(BASH, bash, /bin/sh)
357 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
358 AC_PATH_PROG(SHELL, bash, /bin/ksh)
360 AC_PATH_PROG(BASH, bash, /bin/sh)
366 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
369 if test $MAKE != "error" ; then
370 $MAKE -v 2> /dev/null | grep GNU > /dev/null
373 AC_STEPMAKE_WARN(Please install *GNU* make)
377 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
379 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
380 LN=cp # hard link does not work under cygnus-nt
381 LN_S='cp -r' # symbolic link does not work for native nt
389 # cygwin fixes all these things.
390 # it seems these were used because of dos-style TEXINPUTS and
391 # MFINPUTS needed for miktex.
392 # but this breaks parsing of all other cygwin/unix style paths.
394 # if your (mik)tex breaks, make a:
395 # /usr/local/bin/tex:
397 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
403 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
405 # this way, you may have buildscripts/out/lilypond-profile
406 # 'automatically' sourced from /usr/etc/profile.d/ too.
411 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
419 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
421 AC_SUBST(program_prefix)
422 AC_SUBST(program_suffix)
427 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
428 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
435 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
438 #FIXME --with-xxx is meant for specifying a PATH too,
439 # so this should read: --enable-kpathsea,
440 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
441 AC_ARG_WITH(kpathsea,
442 [ --with-kpathsea use kpathsea lib. Default: on],
443 [kpathsea_b=$with_kpathsea])
445 if test "$kpathsea_b" != "no"; then
446 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
447 AC_CHECK_LIB(kpathsea, kpse_find_file)
448 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.))
450 AC_MSG_CHECKING(whether to use kpathsea)
451 if test "$kpathsea_b" != no; then
460 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
463 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
464 # ugh, automake: we want (and check for) bison
466 # ugh, automake: we want (and check for) flex
468 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
472 ac_cv_prog_lex_root=lex.yy
474 AC_CHECK_PROGS(BISON, bison, error)
475 AC_CHECK_PROGS(FLEX, flex, error)
476 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
477 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
479 if test $BISON != "error"; then
480 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
481 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
482 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
490 AC_DEFUN(AC_STEPMAKE_LIB, [
491 AC_CHECK_PROGS(AR, ar, error)
498 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
500 # **Never** try to set library version numbers so that they correspond
501 # to the release number of your package. This is an abuse that only
502 # fosters misunderstanding of the purpose of library versions.
504 REVISION=$PATCH_LEVEL
505 # CURRENT=$MINOR_VERSION
506 CURRENT=`expr $MINOR_VERSION + 1`
507 # AGE=$(expr $MAJOR_VERSION + 1)
514 AC_DEFUN(AC_STEPMAKE_LOCALE, [
519 AC_ARG_WITH(localedir,
520 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
521 PREFIX/share/locale ],
522 localedir=$with_localedir,
523 localedir='${prefix}/share/locale')
526 [ --with-lang=LANG use LANG as language to emit messages],
530 AC_MSG_CHECKING(language)
532 En* | en* | Am* | am* | US* | us*)
534 NL | nl | Du* | du* | Ned* | ned*)
543 if test "$lang" = "unknown" ; then
544 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
549 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
550 DIR_LOCALEDIR=${localedir}
552 if test "$prefix" = "NONE"; then
553 presome=${ac_default_prefix}
555 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
557 AC_SUBST(DIR_LOCALEDIR)
558 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
560 AC_CHECK_LIB(intl, gettext)
561 AC_CHECK_FUNCS(gettext)
564 AC_DEFUN(AC_STEPMAKE_MAKEINFO, [
565 AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
566 if test "$MAKEINFO" != "error"; then
567 AC_MSG_CHECKING(whether makeinfo can split html by @node)
569 makeinfo --html --output=out/split <<EOF
571 \input texinfo @c -*-texinfo-*-
572 @setfilename split.info
576 if test -d out/split; then
577 SPLITTING_MAKEINFO=yes
582 AC_STEPMAKE_WARN(your html documentation will be one large file)
586 AC_SUBST(SPLITTING_MAKEINFO)
590 AC_DEFUN(AC_STEPMAKE_MAN, [
591 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
592 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
593 AC_CHECK_PROGS(TBL, tbl, cat)
596 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
597 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
598 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
599 AC_MSG_CHECKING(whether msgfmt accepts -o)
600 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
601 if test "$msgfmt_output" = ""; then
605 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
607 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
609 if test ! -n "$MSGFMT"; then
610 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
614 #why has this been dropped?
615 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
616 AC_ARG_ENABLE(tex-prefix,
617 [ --enable-tex-prefix=DIR set the tex-directory to find TeX
618 subdirectories. Default: PREFIX],
619 [TEXPREFIX=$enableval],
622 AC_ARG_ENABLE(tex-dir,
623 [ --enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
627 AC_ARG_ENABLE(mf-dir,
628 [ --enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
632 if test "x$TEXPREFIX" = xauto ; then
633 AC_TEX_PREFIX(TEXPREFIX)
635 find_texprefix=$TEXPREFIX
638 if test "x$MFDIR" = xauto; then
642 if test "x$TEXDIR" = xauto ; then
643 AC_TEX_SUBDIR(TEXDIR)
650 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
651 AC_ARG_ENABLE(tfm-path,
652 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
653 esp.: cmr10.tfm. Default: use kpsewhich],
654 [tfm_path=$enableval],
657 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
658 AC_MSG_CHECKING(for tfm path)
662 if test "x$tfm_path" = xauto ; then
663 if test "x$KPSEWHICH" != "xno" ; then
664 for i in $TFM_FONTS; do
665 dir=`$KPSEWHICH tfm ${i}10.tfm`
666 TFM_PATH="$TFM_PATH `dirname $dir`"
669 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
670 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
676 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
677 AC_MSG_RESULT($TFM_PATH)
681 AC_DEFUN(AC_STEPMAKE_TEXMF, [
682 # urg, never know what names these teTeX guys will think up
684 AC_CHECK_PROGS(METAFONT, mf, no)
685 if test "x$METAFONT" = "xno"; then
686 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
690 AC_CHECK_PROGS(METAPOST, mp, no)
691 if test "x$METAPOST" = "xno"; then
692 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
697 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
698 if test "x$INIMETAFONT" = "xno"; then
699 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
700 INIMETAFONT=$INIMFONT
703 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
704 if test "x$INIMETAPOST" = "xno"; then
705 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
706 INIMETAPOST=$INIMPOST
709 AC_MSG_CHECKING(for working metafont mode)
710 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
711 for MFMODE in $modelist; do
712 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
713 if test -f mfput.tfm; then
717 AC_MSG_RESULT($MFMODE)
719 AC_MSG_CHECKING(for mfplain.mp)
721 # For now let people define these in their environments
723 : ${MFPLAIN_MP=`kpsewhich --format mp mfplain.mp`}
724 AC_MSG_RESULT($MFPLAIN_MP)
726 AC_MSG_CHECKING(for inimetapost flags)
727 if test ${INIMETAPOST} = "inimp" ; then
728 : ${INIMETAPOST_FLAGS=''}
730 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
732 AC_MSG_RESULT($INIMETAPOST_FLAGS)
739 AC_SUBST(INIMETAFONT)
740 AC_SUBST(INIMETAPOST)
742 AC_SUBST(INIMETAPOST_FLAGS)
745 AC_DEFUN(AC_STEPMAKE_WARN, [
750 AC_DEFUN(AC_STEPMAKE_YODL, [
751 if test "x$YODL" = "x"; then
752 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
753 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
754 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
755 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
756 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
757 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
758 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
759 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
760 YODL2LESS_DIR='$(bindir)/'
766 AC_SUBST(YODL2LESS_DIR)
768 AC_SUBST(YODL2MSLESS)
769 AC_SUBST(YODL2TEXINFO)
771 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
773 if test "x$YODL" = "-echo no yodl"; then
774 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
778 dnl should cache result.
779 dnl should look in $prefix first.
780 dnl should probably assume TDS
782 AC_DEFUN(AC_TEX_PREFIX, [
785 AC_MSG_CHECKING(TeX/MF root dir directory)
787 find_root_prefix="$prefix"
790 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
792 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
793 find_texprefix="$find_root_prefix$postfix"
794 if test -d $find_texprefix; then
795 find_texpostfix=$postfix
800 if test "x$find_texpostfix" = x; then
801 find_texpostfix='/lib/texmf/tex'
802 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
805 find_texprefix="$find_root_prefix/$find_texpostfix"
807 # only assign if variablename not empty
808 if test x != "x[$]$1"; then
809 $1='${prefix}'/"$find_texpostfix"
811 AC_MSG_RESULT($find_texprefix)
816 # find a directory inside a prefix,
817 # $1 the prefix (expanded version)
818 # $2 variable to assign
819 # $3 the directory name
821 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
823 AC_MSG_CHECKING($4 directory)
825 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
828 if test "x$find_dirdir" = x; then
830 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
834 AC_MSG_RESULT($1/$find_dirdir)
837 # ugh. this is hopeless
838 AC_DEFUN(AC_KPSE_TEX_DIR, [
839 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
840 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
842 if test -w "$kpse_syspaths";
844 dir=`echo $kpse_syspaths | head -1`
846 dir=`echo $kpse_paths | grep -v '!'| head -1`
848 if test "$prefix" = "NONE"; then
849 local_prefix=$ac_default_prefix
850 local_prefix_quote='${prefix}'
854 local_prefix_quote=$prefix
856 echo $local_prefix_quote = $local_prefix
858 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
861 AC_DEFUN(AC_TEX_SUBDIR, [
862 dnl AC_REQUIRE([AC_TEX_PREFIX])
863 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
867 AC_DEFUN(AC_MF_SUBDIR, [
868 dnl AC_REQUIRE([AC_TEX_PREFIX])
869 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
873 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
874 result="`echo \"$1\" | grep echo`"
875 if test "x$1" = "xerror" -o "x$result" != "x"; then
876 AC_STEPMAKE_WARN(can\'t find $2. $3)
880 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
882 dnl This macro runs the `guile-config' script, installed with Guile,
883 dnl to find out where Guile's header files and libraries are
884 dnl installed. It sets two variables, marked for substitution, as
887 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
888 dnl code that uses Guile header files. This is almost
889 dnl always just a -I flag.
891 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
892 dnl program against Guile. This includes `-lguile' for
893 dnl the Guile library itself, any libraries that Guile
894 dnl itself requires (like -lqthreads), and so on. It may
895 dnl also include a -L flag to tell the compiler where to
896 dnl find the libraries.
898 AC_DEFUN([GUILE_FLAGS],[
899 ## The GUILE_FLAGS macro.
900 AC_MSG_CHECKING(for Guile)
901 if ! $guile_config link > /dev/null ; then
902 AC_MSG_RESULT("cannot execute $guile_config")
903 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
906 GUILE_CFLAGS="`$guile_config compile`"
907 GUILE_LDFLAGS="`$guile_config link`"
908 AC_SUBST(GUILE_CFLAGS)
909 AC_SUBST(GUILE_LDFLAGS)
914 # Configure paths for GTK+
915 # Owen Taylor 97-11-3
917 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
918 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
920 AC_DEFUN(AM_PATH_GTK,
922 dnl Get the cflags and libraries from the gtk-config script
924 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
925 min_gtk_version=ifelse([$1], ,1.1.1,$1)
926 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
928 if test "$GTK_CONFIG" != "no" ; then
929 GTK_CFLAGS=`$GTK_CONFIG --cflags`
930 GTK_LIBS=`$GTK_CONFIG --libs`
931 ac_save_CFLAGS="$CFLAGS"
933 ac_save_CXXFLAGS="$CXXFLAGS"
934 CFLAGS="$CFLAGS $GTK_CFLAGS"
935 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
936 LIBS="$LIBS $GTK_LIBS"
938 dnl Now check if the installed GTK is sufficiently new. (Also sanity
939 dnl checks the results of gtk-config to some extent)
948 int major, minor, micro;
950 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
951 printf("%s, bad version string\n", "$min_gtk_version");
955 return !((gtk_major_version > major) ||
956 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
957 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
959 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
960 CFLAGS="$ac_save_CFLAGS"
961 CXXFLAGS="$ac_save_CXXFLAGS"
966 if test "x$no_gtk" = x ; then
968 ifelse([$2], , :, [$2])
973 ifelse([$3], , :, [$3])
975 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
982 # Configure paths for GTK--
983 # Erik Andersen 30 May 1998
984 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
986 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
987 dnl to be used as follows:
988 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
991 dnl Get the cflags and libraries from the gtkmm-config script
993 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
994 Prefix where GTK-- is installed (optional)],
995 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
996 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
997 Exec prefix where GTK-- is installed (optional)],
998 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
999 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
1000 , enable_gtkmmtest=yes)
1002 if test x$gtkmm_config_exec_prefix != x ; then
1003 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
1004 if test x${GTKMM_CONFIG+set} != xset ; then
1005 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
1008 if test x$gtkmm_config_prefix != x ; then
1009 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
1010 if test x${GTKMM_CONFIG+set} != xset ; then
1011 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
1016 AC_DEFUN(AM_PATH_GTKMM,
1020 dnl Check if the installed GTK-- is sufficiently new.
1022 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1023 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
1025 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
1027 if test "$GTKMM_CONFIG" = "no" ; then
1033 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1034 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1035 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1036 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1037 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1038 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1039 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1040 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1041 if test "x$enable_gtkmmtest" = "xyes" ; then
1042 ac_save_CXXFLAGS="$CXXFLAGS"
1043 ac_save_LIBS="$LIBS"
1044 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1045 LIBS="$LIBS $GTK___LIBS"
1047 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1048 dnl checks the results of gtkmm-config to some extent
1050 rm -f conf.gtkmmtest
1059 int major, minor, micro;
1062 system ("touch conf.gtkmmtest");
1064 /* HP/UX 0 (%@#!) writes to sscanf strings */
1065 tmp_version = g_strdup("$min_gtkmm_version");
1066 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1067 printf("%s, bad version string\n", "$min_gtkmm_version");
1071 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1072 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1073 (gtkmm_micro_version != $gtkmm_config_micro_version))
1075 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1076 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1077 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1078 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1079 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1080 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1081 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1082 printf("*** required on your system.\n");
1083 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1084 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1085 printf("*** before re-running configure\n");
1087 /* GTK-- does not have the GTKMM_*_VERSION constants */
1089 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1090 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1091 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1093 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1094 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1095 printf("*** library (version %d.%d.%d)\n",
1096 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1101 if ((gtkmm_major_version > major) ||
1102 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1103 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1109 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1110 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1111 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1112 major, minor, micro);
1113 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1115 printf("*** If you have already installed a sufficiently new version, this error\n");
1116 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1117 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1118 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1119 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1120 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1121 printf("*** so that the correct libraries are found at run-time))\n");
1126 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1127 CXXFLAGS="$ac_save_CXXFLAGS"
1128 LIBS="$ac_save_LIBS"
1131 if test "x$no_gtkmm" = x ; then
1133 ifelse([$2], , :, [$2])
1136 if test "$GTKMM_CONFIG" = "no" ; then
1137 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1138 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1139 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1140 echo "*** full path to gtk-config."
1141 echo "*** The gtkmm-config script was not available in GTK-- versions"
1142 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1143 echo "*** version to 0.9.12 or newer"
1145 if test -f conf.gtkmmtest ; then
1148 echo "*** Could not run GTK-- test program, checking why..."
1149 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1150 LIBS="$LIBS $GTK___LIBS"
1154 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1155 [ echo "*** The test program compiled, but did not run. This usually means"
1156 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1157 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1158 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1159 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1160 echo "*** is required on your system"
1162 echo "*** If you have an old version installed, it is best to remove it, although"
1163 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1164 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1165 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1166 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1167 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1168 CXXFLAGS="$ac_save_CXXFLAGS"
1169 LIBS="$ac_save_LIBS"
1174 ifelse([$3], , :, [$3])
1177 AC_SUBST(GTK___CFLAGS)
1178 AC_SUBST(GTK___LIBS)
1179 rm -f conf.gtkmmtest
1182 # Configure paths for GTK--DRAW
1183 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1185 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1186 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1188 AC_DEFUN(AM_PATH_GTK__DRAW,
1190 dnl Get the cflags and libraries from the gtk__-config script
1192 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1193 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1194 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1196 if test "$GTKMM_CONFIG" != "no" ; then
1197 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1198 GTK___LIBS=`$GTKMM_CONFIG --libs`
1199 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1200 GTK___LIBS="$GTK___DLIBS"
1201 ac_save_CFLAGS="$CFLAGS"
1202 ac_save_LIBS="$LIBS"
1203 ac_save_CXXFLAGS="$CXXFLAGS"
1204 CFLAGS="$CFLAGS $GTK___CFLAGS"
1205 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1206 LIBS="$LIBS $GTK___LIBS"
1208 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1209 dnl checks the results of gtk__-config to some extent)
1221 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1222 CFLAGS="$ac_save_CFLAGS"
1223 CXXFLAGS="$ac_save_CXXFLAGS"
1224 LIBS="$ac_save_LIBS"
1228 if test "x$no_gtk__" = x ; then
1230 ifelse([$2], , :, [$2])
1235 ifelse([$3], , :, [$3])
1237 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1239 AC_SUBST(GTK___CFLAGS)
1240 AC_SUBST(GTK___LIBS)