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:-""}
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!"`
131 AC_SUBST(DIR_DATADIR)
132 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
135 AC_DEFUN(AC_STEPMAKE_END, [
136 AC_OUTPUT($CONFIGFILE.make:config.make.in)
138 rm -f $srcdir/GNUmakefile
139 cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
140 chmod 444 $srcdir/GNUmakefile
141 if test "$builddir" != "."; then
143 cp $srcdir/make/srcdir.make.in GNUmakefile
144 chmod 444 GNUmakefile
148 AC_DEFUN(AC_STEPMAKE_GXX, [
150 # urg, egcs: how to check for egcs >= 1.1?
151 changequote(<<, >>)dnl
152 if $CXX --version | egrep '2\.[89]' > /dev/null ||
153 $CXX --version | grep 'egcs' > /dev/null
158 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
162 AC_DEFUN(AC_STEPMAKE_GUILE, [
163 ## First, let's just see if we can find Guile at all.
164 AC_MSG_CHECKING("for guile-config")
165 for guile_config in guile-config $target-guile-config $build-guile-config; do
166 AC_MSG_RESULT("$guile_config")
167 if ! $guile_config --version > /dev/null 2>&1 ; then
168 AC_MSG_WARN("cannot execute $guile_config")
169 AC_MSG_CHECKING("if we are cross compiling")
175 if test "$guile_config" = "error"; then
176 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
179 AC_MSG_CHECKING("Guile version")
180 need_guile_version="1.3.4"
181 need_guile_version_numeric=100304
182 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
183 guile_version_numeric=`echo $guile_version | awk -F. '
184 {if ([$]3) {last = [$]3}
186 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
187 AC_MSG_RESULT("$guile_version")
188 if test $guile_version_numeric -lt $need_guile_version_numeric
190 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
193 AC_PATH_PROG(GUILE, guile, error)
197 AC_DEFUN(AC_STEPMAKE_INIT, [
200 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
201 if test x$MY_PATCH_LEVEL != x; then
202 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
205 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
206 changequote(<<, >>)dnl
207 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
208 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
211 # No versioning on directory names of sub-packages
213 stepmake=${datadir}/stepmake
215 if test "$prefix" = "NONE"; then
216 presome=${ac_default_prefix}
218 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
220 # urg, how is this supposed to work?
221 if test "$program_prefix" = "NONE"; then
224 if test "$program_suffix" = "NONE"; then
228 AC_MSG_CHECKING(Package)
229 if test "x$PACKAGE" = "xSTEPMAKE"; then
230 AC_MSG_RESULT(Stepmake package!)
232 #if test "x$builddir" != "x"; then
233 # builddir="../$builddir"
237 if test "$srcdir" != "."; then
238 absolute_builddir="`pwd`"
239 package_absolute_builddir="`dirname $absolute_builddir`"
240 package_srcdir="`dirname $srcdir`"
241 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
246 (cd stepmake 2>/dev/null || mkdir stepmake)
247 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
248 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
249 AC_CONFIG_AUX_DIR(bin)
252 AC_MSG_RESULT($PACKAGE)
254 if test "$srcdir" != "."; then
255 absolute_builddir="`pwd`"
256 builddir="`dirname $srcdir`/`basename $absolute_builddir`"
261 AC_MSG_CHECKING(for stepmake)
262 # Check for installed stepmake
263 if test -d $stepmake; then
264 AC_MSG_RESULT($stepmake)
266 stepmake='$(depth)'/$srcdir/stepmake
267 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
270 $HOME/usr/local/share/stepmake/bin\
271 $HOME/usr/local/lib/stepmake/bin\
272 $HOME/usr/share/stepmake/bin\
273 $HOME/usr/lib/stepmake/bin\
274 /usr/local/share/stepmake/bin\
275 /usr/local/lib/stepmake/bin\
276 /usr/share/stepmake/bin\
277 /usr/lib/stepmake/bin\
279 $srcdir/stepmake/bin\
287 AC_SUBST(PACKAGE_NAME)
288 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
289 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
291 if test "$package_depth" = "" ; then
294 package_depth="../$package_depth"
297 AC_SUBST(package_depth)
299 AUTOGENERATE="This file was automatically generated by configure"
300 AC_SUBST(AUTOGENERATE)
303 AC_ARG_ENABLE(config,
304 [ enable-config=FILE put configure settings in config-FILE.make],
305 [CONFIGSUFFIX=-$enableval])
307 CONFIGFILE=config$CONFIGSUFFIX
308 AC_SUBST(CONFIGSUFFIX)
311 AC_CHECK_PROGS(MAKE, gmake make, error)
312 AC_CHECK_PROGS(FIND, find, error)
314 dnl system supplied INSTALL is unsafe; use our own install.
316 dnl if test "$INSTALL" = "bin/install-sh"; then
317 dnl export INSTALL="\$\(depth\)/bin/install-sh"
320 AC_CHECK_PROGS(TAR, tar, error)
322 if test "x`uname`" = "xHP-UX"; then
323 AC_PATH_PROG(BASH, bash, /bin/sh)
324 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
325 AC_PATH_PROG(SHELL, bash, /bin/ksh)
327 AC_PATH_PROG(BASH, bash, /bin/sh)
333 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
336 if test $MAKE != "error" ; then
337 $MAKE -v 2> /dev/null | grep GNU > /dev/null
340 AC_STEPMAKE_WARN(Please install *GNU* make)
344 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
346 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
347 LN=cp # hard link does not work under cygnus-nt
348 LN_S='cp -r' # symbolic link does not work for native nt
355 # cygwin fixes all these things.
356 # it seems these were used because of dos-style TEXINPUTS and
357 # MFINPUTS needed for miktex.
358 # but this breaks parsing of all other cygwin/unix style paths.
360 # if your (mik)tex breaks, make a:
361 # /usr/local/bin/tex:
363 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
369 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
371 # this way, you may have buildscripts/out/lilypond-profile
372 # 'automatically' sourced from /usr/etc/profile.d/ too.
376 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
383 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
385 AC_SUBST(program_prefix)
386 AC_SUBST(program_suffix)
391 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
392 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
399 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
402 AC_ARG_ENABLE(kpathsea,
403 [ enable-kpathsea use kpathsea lib. Default: on],
404 [kpathsea_b=$enableval])
406 if test $kpathsea_b = yes; then
407 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
408 AC_CHECK_LIB(kpathsea, kpse_find_file)
409 # urg: kpse_find_tfm is a #define, how to check for this?
410 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
411 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
412 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
414 AC_MSG_CHECKING(whether to use kpathsea)
415 if test $kpathsea_b = yes; then
424 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
427 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
428 # ugh, automake: we want (and check for) bison
430 # ugh, automake: we want (and check for) flex
432 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
436 ac_cv_prog_lex_root=lex.yy
438 AC_CHECK_PROGS(BISON, bison, error)
439 AC_CHECK_PROGS(FLEX, flex, error)
440 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
441 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
443 if test $BISON != "error"; then
444 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
445 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
446 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
454 AC_DEFUN(AC_STEPMAKE_LIB, [
455 AC_CHECK_PROGS(AR, ar, error)
462 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
464 # **Never** try to set library version numbers so that they correspond
465 # to the release number of your package. This is an abuse that only
466 # fosters misunderstanding of the purpose of library versions.
468 REVISION=$PATCH_LEVEL
469 # CURRENT=$MINOR_VERSION
470 CURRENT=`expr $MINOR_VERSION + 1`
471 # AGE=$(expr $MAJOR_VERSION + 1)
478 AC_DEFUN(AC_STEPMAKE_LOCALE, [
483 AC_ARG_WITH(localedir,
484 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
485 localedir=$with_localedir,
486 localedir='${prefix}/share/locale')
489 [ with-lang=LANG use LANG as language to emit messages],
493 AC_MSG_CHECKING(language)
495 En* | en* | Am* | am* | US* | us*)
497 NL | nl | Du* | du* | Ned* | ned*)
506 if test "$lang" = "unknown" ; then
507 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
512 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
513 DIR_LOCALEDIR=${localedir}
515 if test "$prefix" = "NONE"; then
516 presome=${ac_default_prefix}
518 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
520 AC_SUBST(DIR_LOCALEDIR)
521 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
523 AC_CHECK_LIB(intl, gettext)
524 AC_CHECK_FUNCS(gettext)
527 AC_DEFUN(AC_STEPMAKE_MAN, [
528 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
529 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
530 AC_CHECK_PROGS(TBL, tbl, cat)
533 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
534 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
535 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
536 AC_MSG_CHECKING(whether msgfmt accepts -o)
537 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
538 if test "$msgfmt_output" = ""; then
542 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
544 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
546 if test ! -n "$MSGFMT"; then
547 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
551 #why has this been dropped?
552 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
553 AC_ARG_ENABLE(tex-prefix,
554 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. Default: PREFIX],
555 [TEXPREFIX=$enableval],
558 AC_ARG_ENABLE(tex-dir,
559 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
563 AC_ARG_ENABLE(mf-dir,
564 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
568 if test "x$TEXPREFIX" = xauto ; then
569 AC_TEX_PREFIX(TEXPREFIX)
571 find_texprefix=$TEXPREFIX
574 if test "x$MFDIR" = xauto; then
578 if test "x$TEXDIR" = xauto ; then
579 AC_TEX_SUBDIR(TEXDIR)
586 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
587 AC_ARG_ENABLE(tfm-path,
588 [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm. Default: use kpsewhich],
589 [tfm_path=$enableval],
592 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
593 AC_MSG_CHECKING(for tfm path)
597 if test "x$tfm_path" = xauto ; then
598 if test "x$KPSEWHICH" != "xno" ; then
599 for i in $TFM_FONTS; do
600 dir=`$KPSEWHICH tfm ${i}10.tfm`
601 TFM_PATH="$TFM_PATH `dirname $dir`"
604 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
605 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
611 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
612 AC_MSG_RESULT($TFM_PATH)
616 AC_DEFUN(AC_STEPMAKE_TEXMF, [
617 # urg, never know what names these teTeX guys will think up
619 AC_CHECK_PROGS(METAFONT, mf, no)
620 if test "x$METAFONT" = "xno"; then
621 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
625 AC_CHECK_PROGS(METAPOST, mp, no)
626 if test "x$METAPOST" = "xno"; then
627 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
632 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
633 if test "x$INIMETAFONT" = "xno"; then
634 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
635 INIMETAFONT=$INIMFONT
638 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
639 if test "x$INIMETAPOST" = "xno"; then
640 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
641 INIMETAPOST=$INIMPOST
644 AC_MSG_CHECKING(for working metafont mode)
645 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
646 for MFMODE in $modelist; do
647 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
648 if test -f mfput.tfm; then
652 AC_MSG_RESULT($MFMODE)
654 AC_MSG_CHECKING(for mfplain.mp)
656 # For now let people define these in their environments
658 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
659 AC_MSG_RESULT($MFPLAIN_MP)
661 AC_MSG_CHECKING(for inimetapost flags)
662 if test ${INIMETAPOST} = "inimp" ; then
663 : ${INIMETAPOST_FLAGS=''}
665 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
667 AC_MSG_RESULT($INIMETAPOST_FLAGS)
674 AC_SUBST(INIMETAFONT)
675 AC_SUBST(INIMETAPOST)
677 AC_SUBST(INIMETAPOST_FLAGS)
680 AC_DEFUN(AC_STEPMAKE_WARN, [
685 AC_DEFUN(AC_STEPMAKE_YODL, [
686 if test "x$YODL" = "x"; then
687 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
688 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
689 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
690 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
691 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
692 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
693 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
694 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
695 YODL2LESS_DIR='$(bindir)/'
701 AC_SUBST(YODL2LESS_DIR)
703 AC_SUBST(YODL2MSLESS)
704 AC_SUBST(YODL2TEXINFO)
706 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
708 if test "x$YODL" = "-echo no yodl"; then
709 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
713 dnl should cache result.
714 dnl should look in $prefix first.
715 dnl should probably assume TDS
717 AC_DEFUN(AC_TEX_PREFIX, [
720 AC_MSG_CHECKING(TeX/MF root dir directory)
722 find_root_prefix="$prefix"
725 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
727 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
728 find_texprefix="$find_root_prefix$postfix"
729 if test -d $find_texprefix; then
730 find_texpostfix=$postfix
735 if test "x$find_texpostfix" = x; then
736 find_texpostfix='/lib/texmf/tex'
737 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
740 find_texprefix="$find_root_prefix/$find_texpostfix"
742 # only assign if variablename not empty
743 if test x != "x[$]$1"; then
744 $1='${prefix}'/"$find_texpostfix"
746 AC_MSG_RESULT($find_texprefix)
751 # find a directory inside a prefix,
752 # $1 the prefix (expanded version)
753 # $2 variable to assign
754 # $3 the directory name
756 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
758 AC_MSG_CHECKING($4 directory)
760 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
763 if test "x$find_dirdir" = x; then
765 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
769 AC_MSG_RESULT($1/$find_dirdir)
772 # ugh. this is hopeless
773 AC_DEFUN(AC_KPSE_TEX_DIR, [
774 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
775 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
777 if test -w "$kpse_syspaths";
779 dir=`echo $kpse_syspaths | head -1`
781 dir=`echo $kpse_paths | grep -v '!'| head -1`
783 if test "$prefix" = "NONE"; then
784 local_prefix=$ac_default_prefix
785 local_prefix_quote='${prefix}'
789 local_prefix_quote=$prefix
791 echo $local_prefix_quote = $local_prefix
793 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
796 AC_DEFUN(AC_TEX_SUBDIR, [
797 dnl AC_REQUIRE([AC_TEX_PREFIX])
798 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
802 AC_DEFUN(AC_MF_SUBDIR, [
803 dnl AC_REQUIRE([AC_TEX_PREFIX])
804 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
808 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
809 result="`echo \"$1\" | grep echo`"
810 if test "x$1" = "xerror" -o "x$result" != "x"; then
811 AC_STEPMAKE_WARN(can\'t find $2. $3)
815 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
817 dnl This macro runs the `guile-config' script, installed with Guile,
818 dnl to find out where Guile's header files and libraries are
819 dnl installed. It sets two variables, marked for substitution, as
822 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
823 dnl code that uses Guile header files. This is almost
824 dnl always just a -I flag.
826 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
827 dnl program against Guile. This includes `-lguile' for
828 dnl the Guile library itself, any libraries that Guile
829 dnl itself requires (like -lqthreads), and so on. It may
830 dnl also include a -L flag to tell the compiler where to
831 dnl find the libraries.
833 AC_DEFUN([GUILE_FLAGS],[
834 ## The GUILE_FLAGS macro.
835 AC_MSG_CHECKING(for Guile)
836 if ! $guile_config link > /dev/null ; then
837 AC_MSG_RESULT("cannot execute $guile_config")
838 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
841 GUILE_CFLAGS="`$guile_config compile`"
842 GUILE_LDFLAGS="`$guile_config link`"
843 AC_SUBST(GUILE_CFLAGS)
844 AC_SUBST(GUILE_LDFLAGS)
849 # Configure paths for GTK+
850 # Owen Taylor 97-11-3
852 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
853 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
855 AC_DEFUN(AM_PATH_GTK,
857 dnl Get the cflags and libraries from the gtk-config script
859 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
860 min_gtk_version=ifelse([$1], ,1.1.1,$1)
861 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
863 if test "$GTK_CONFIG" != "no" ; then
864 GTK_CFLAGS=`$GTK_CONFIG --cflags`
865 GTK_LIBS=`$GTK_CONFIG --libs`
866 ac_save_CFLAGS="$CFLAGS"
868 ac_save_CXXFLAGS="$CXXFLAGS"
869 CFLAGS="$CFLAGS $GTK_CFLAGS"
870 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
871 LIBS="$LIBS $GTK_LIBS"
873 dnl Now check if the installed GTK is sufficiently new. (Also sanity
874 dnl checks the results of gtk-config to some extent)
883 int major, minor, micro;
885 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
886 printf("%s, bad version string\n", "$min_gtk_version");
890 return !((gtk_major_version > major) ||
891 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
892 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
894 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
895 CFLAGS="$ac_save_CFLAGS"
896 CXXFLAGS="$ac_save_CXXFLAGS"
901 if test "x$no_gtk" = x ; then
903 ifelse([$2], , :, [$2])
908 ifelse([$3], , :, [$3])
910 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
917 # Configure paths for GTK--
918 # Erik Andersen 30 May 1998
919 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
921 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
922 dnl to be used as follows:
923 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
926 dnl Get the cflags and libraries from the gtkmm-config script
928 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
929 Prefix where GTK-- is installed (optional)],
930 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
931 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
932 Exec prefix where GTK-- is installed (optional)],
933 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
934 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
935 , enable_gtkmmtest=yes)
937 if test x$gtkmm_config_exec_prefix != x ; then
938 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
939 if test x${GTKMM_CONFIG+set} != xset ; then
940 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
943 if test x$gtkmm_config_prefix != x ; then
944 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
945 if test x${GTKMM_CONFIG+set} != xset ; then
946 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
951 AC_DEFUN(AM_PATH_GTKMM,
955 dnl Check if the installed GTK-- is sufficiently new.
957 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
958 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
960 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
962 if test "$GTKMM_CONFIG" = "no" ; then
968 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
969 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
970 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
971 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
972 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
973 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
974 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
975 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
976 if test "x$enable_gtkmmtest" = "xyes" ; then
977 ac_save_CXXFLAGS="$CXXFLAGS"
979 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
980 LIBS="$LIBS $GTK___LIBS"
982 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
983 dnl checks the results of gtkmm-config to some extent
994 int major, minor, micro;
997 system ("touch conf.gtkmmtest");
999 /* HP/UX 0 (%@#!) writes to sscanf strings */
1000 tmp_version = g_strdup("$min_gtkmm_version");
1001 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1002 printf("%s, bad version string\n", "$min_gtkmm_version");
1006 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1007 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1008 (gtkmm_micro_version != $gtkmm_config_micro_version))
1010 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1011 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1012 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1013 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1014 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1015 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1016 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1017 printf("*** required on your system.\n");
1018 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1019 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1020 printf("*** before re-running configure\n");
1022 /* GTK-- does not have the GTKMM_*_VERSION constants */
1024 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1025 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1026 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1028 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1029 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1030 printf("*** library (version %d.%d.%d)\n",
1031 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1036 if ((gtkmm_major_version > major) ||
1037 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1038 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1044 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1045 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1046 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1047 major, minor, micro);
1048 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1050 printf("*** If you have already installed a sufficiently new version, this error\n");
1051 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1052 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1053 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1054 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1055 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1056 printf("*** so that the correct libraries are found at run-time))\n");
1061 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1062 CXXFLAGS="$ac_save_CXXFLAGS"
1063 LIBS="$ac_save_LIBS"
1066 if test "x$no_gtkmm" = x ; then
1068 ifelse([$2], , :, [$2])
1071 if test "$GTKMM_CONFIG" = "no" ; then
1072 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1073 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1074 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1075 echo "*** full path to gtk-config."
1076 echo "*** The gtkmm-config script was not available in GTK-- versions"
1077 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1078 echo "*** version to 0.9.12 or newer"
1080 if test -f conf.gtkmmtest ; then
1083 echo "*** Could not run GTK-- test program, checking why..."
1084 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1085 LIBS="$LIBS $GTK___LIBS"
1089 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1090 [ echo "*** The test program compiled, but did not run. This usually means"
1091 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1092 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1093 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1094 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1095 echo "*** is required on your system"
1097 echo "*** If you have an old version installed, it is best to remove it, although"
1098 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1099 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1100 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1101 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1102 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1103 CXXFLAGS="$ac_save_CXXFLAGS"
1104 LIBS="$ac_save_LIBS"
1109 ifelse([$3], , :, [$3])
1112 AC_SUBST(GTK___CFLAGS)
1113 AC_SUBST(GTK___LIBS)
1114 rm -f conf.gtkmmtest
1117 # Configure paths for GTK--DRAW
1118 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1120 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1121 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1123 AC_DEFUN(AM_PATH_GTK__DRAW,
1125 dnl Get the cflags and libraries from the gtk__-config script
1127 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1128 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1129 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1131 if test "$GTKMM_CONFIG" != "no" ; then
1132 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1133 GTK___LIBS=`$GTKMM_CONFIG --libs`
1134 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1135 GTK___LIBS="$GTK___DLIBS"
1136 ac_save_CFLAGS="$CFLAGS"
1137 ac_save_LIBS="$LIBS"
1138 ac_save_CXXFLAGS="$CXXFLAGS"
1139 CFLAGS="$CFLAGS $GTK___CFLAGS"
1140 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1141 LIBS="$LIBS $GTK___LIBS"
1143 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1144 dnl checks the results of gtk__-config to some extent)
1156 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1157 CFLAGS="$ac_save_CFLAGS"
1158 CXXFLAGS="$ac_save_CXXFLAGS"
1159 LIBS="$ac_save_LIBS"
1163 if test "x$no_gtk__" = x ; then
1165 ifelse([$2], , :, [$2])
1170 ifelse([$3], , :, [$3])
1172 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1174 AC_SUBST(GTK___CFLAGS)
1175 AC_SUBST(GTK___LIBS)