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 bin; ln -s ../$srcdir/bin .)
271 AC_CONFIG_AUX_DIR(bin)
274 AC_MSG_RESULT($PACKAGE)
276 AC_MSG_CHECKING(builddir)
277 if test "$srcdir" = "."; then
281 absolute_builddir="`pwd`"
282 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
283 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
286 AC_MSG_RESULT($builddir)
287 if expr "$srcdir" : '/' > /dev/null 2>&1; then
289 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
292 AC_MSG_CHECKING(for stepmake)
293 # Check for installed stepmake
294 if test -d $stepmake; then
295 AC_MSG_RESULT($stepmake)
297 if test "$absolute_srcdir" != "yes"; then
298 stepmake='$(depth)'/$srcdir/stepmake
300 stepmake=$srcdir/stepmake
302 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
306 $HOME/usr/local/share/stepmake/bin\
307 $HOME/usr/local/lib/stepmake/bin\
308 $HOME/usr/share/stepmake/bin\
309 $HOME/usr/lib/stepmake/bin\
310 /usr/local/share/stepmake/bin\
311 /usr/local/lib/stepmake/bin\
312 /usr/share/stepmake/bin\
313 /usr/lib/stepmake/bin\
315 $srcdir/stepmake/bin\
323 AC_SUBST(PACKAGE_NAME)
324 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
325 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
327 if test "$package_depth" = "" ; then
330 package_depth="../$package_depth"
333 AC_SUBST(package_depth)
335 AUTOGENERATE="This file was automatically generated by configure"
336 AC_SUBST(AUTOGENERATE)
339 AC_ARG_ENABLE(config,
340 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
341 do \`make conf=CONF' to get output in ./out-CONF],
342 [CONFIGURATION=$enableval])
344 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
345 CONFIGFILE=config$CONFIGSUFFIX
346 AC_SUBST(CONFIGSUFFIX)
349 AC_CHECK_PROGS(MAKE, gmake make, error)
350 AC_CHECK_PROGS(FIND, find, error)
352 dnl system supplied INSTALL is unsafe; use our own install.
354 dnl if test "$INSTALL" = "bin/install-sh"; then
355 dnl export INSTALL="\$\(depth\)/bin/install-sh"
358 AC_CHECK_PROGS(TAR, tar, error)
360 if test "x`uname`" = "xHP-UX"; then
361 AC_PATH_PROG(BASH, bash, /bin/sh)
362 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
363 AC_PATH_PROG(SHELL, bash, /bin/ksh)
365 AC_PATH_PROG(BASH, bash, /bin/sh)
371 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
374 if test $MAKE != "error" ; then
375 $MAKE -v 2> /dev/null | grep GNU > /dev/null
378 AC_STEPMAKE_WARN(Please install *GNU* make)
382 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
384 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
385 LN=cp # hard link does not work under cygnus-nt
386 LN_S='cp -r' # symbolic link does not work for native nt
394 # cygwin fixes all these things.
395 # it seems these were used because of dos-style TEXINPUTS and
396 # MFINPUTS needed for miktex.
397 # but this breaks parsing of all other cygwin/unix style paths.
399 # if your (mik)tex breaks, make a:
400 # /usr/local/bin/tex:
402 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
408 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
410 # this way, you may have buildscripts/out/lilypond-profile
411 # 'automatically' sourced from /usr/etc/profile.d/ too.
416 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
424 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
426 AC_SUBST(program_prefix)
427 AC_SUBST(program_suffix)
432 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
433 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
440 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
443 #FIXME --with-xxx is meant for specifying a PATH too,
444 # so this should read: --enable-kpathsea,
445 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
446 AC_ARG_WITH(kpathsea,
447 [ --with-kpathsea use kpathsea lib. Default: on],
448 [kpathsea_b=$with_kpathsea])
450 if test "$kpathsea_b" != "no"; then
451 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
452 AC_CHECK_LIB(kpathsea, kpse_find_file)
453 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.))
455 AC_MSG_CHECKING(whether to use kpathsea)
456 if test "$kpathsea_b" != no; then
465 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
468 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
469 # ugh, automake: we want (and check for) bison
471 # ugh, automake: we want (and check for) flex
473 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
477 ac_cv_prog_lex_root=lex.yy
479 AC_CHECK_PROGS(BISON, bison, error)
480 AC_CHECK_PROGS(FLEX, flex, error)
481 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
482 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
485 ## Urg. We should fix this configure test. -- so clumsy
486 if test $BISON != "error"; then
487 bison_version=`$BISON --version | head -1 | sed 's/^.* 1\.//g'`
488 if test $bison_version -lt 25; then
489 AC_STEPMAKE_WARN(The bison installed might be too old (1.$bison_version). You might have to install 1.25)
497 AC_DEFUN(AC_STEPMAKE_LIB, [
498 AC_CHECK_PROGS(AR, ar, error)
505 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
507 # **Never** try to set library version numbers so that they correspond
508 # to the release number of your package. This is an abuse that only
509 # fosters misunderstanding of the purpose of library versions.
511 REVISION=$PATCH_LEVEL
512 # CURRENT=$MINOR_VERSION
513 CURRENT=`expr $MINOR_VERSION + 1`
514 # AGE=$(expr $MAJOR_VERSION + 1)
521 AC_DEFUN(AC_STEPMAKE_LOCALE, [
526 AC_ARG_WITH(localedir,
527 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
528 PREFIX/share/locale ],
529 localedir=$with_localedir,
530 localedir='${prefix}/share/locale')
533 [ --with-lang=LANG use LANG as language to emit messages],
537 AC_MSG_CHECKING(language)
539 En* | en* | Am* | am* | US* | us*)
541 NL | nl | Du* | du* | Ned* | ned*)
550 if test "$lang" = "unknown" ; then
551 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
556 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
557 DIR_LOCALEDIR=${localedir}
559 if test "$prefix" = "NONE"; then
560 presome=${ac_default_prefix}
562 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
564 AC_SUBST(DIR_LOCALEDIR)
565 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
567 AC_CHECK_LIB(intl, gettext)
568 AC_CHECK_FUNCS(gettext)
571 AC_DEFUN(AC_STEPMAKE_MAKEINFO, [
572 AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
573 if test "$MAKEINFO" != "error"; then
574 AC_MSG_CHECKING(whether makeinfo can split html by @node)
576 makeinfo --html --output=out/split <<EOF
578 \input texinfo @c -*-texinfo-*-
579 @setfilename split.info
583 if test -d out/split; then
584 SPLITTING_MAKEINFO=yes
589 AC_STEPMAKE_WARN(your html documentation will be one large file)
593 AC_SUBST(SPLITTING_MAKEINFO)
597 AC_DEFUN(AC_STEPMAKE_MAN, [
598 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
599 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
600 AC_CHECK_PROGS(TBL, tbl, cat)
603 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
604 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
605 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
606 AC_MSG_CHECKING(whether msgfmt accepts -o)
607 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
608 if test "$msgfmt_output" = ""; then
612 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
614 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
616 if test ! -n "$MSGFMT"; then
617 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
621 #why has this been dropped?
622 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
623 AC_ARG_ENABLE(tex-prefix,
624 [ --enable-tex-prefix=DIR set the tex-directory to find TeX
625 subdirectories. Default: PREFIX],
626 [TEXPREFIX=$enableval],
629 AC_ARG_ENABLE(tex-dir,
630 [ --enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
634 AC_ARG_ENABLE(mf-dir,
635 [ --enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
639 if test "x$TEXPREFIX" = xauto ; then
640 AC_TEX_PREFIX(TEXPREFIX)
642 find_texprefix=$TEXPREFIX
645 if test "x$MFDIR" = xauto; then
649 if test "x$TEXDIR" = xauto ; then
650 AC_TEX_SUBDIR(TEXDIR)
657 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
658 AC_ARG_ENABLE(tfm-path,
659 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
660 esp.: cmr10.tfm. Default: use kpsewhich],
661 [tfm_path=$enableval],
664 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
665 AC_MSG_CHECKING(for tfm path)
669 if test "x$tfm_path" = xauto ; then
670 if test "x$KPSEWHICH" != "xno" ; then
671 for i in $TFM_FONTS; do
672 dir=`$KPSEWHICH tfm ${i}10.tfm`
673 TFM_PATH="$TFM_PATH `dirname $dir`"
676 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
677 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
683 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
684 AC_MSG_RESULT($TFM_PATH)
688 AC_DEFUN(AC_STEPMAKE_TEXMF, [
689 # urg, never know what names these teTeX guys will think up
691 AC_CHECK_PROGS(METAFONT, mf, no)
692 if test "x$METAFONT" = "xno"; then
693 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
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_MSG_CHECKING(for working metafont mode)
704 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
705 for MFMODE in $modelist; do
706 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
707 if test -f mfput.tfm; then
711 AC_MSG_RESULT($MFMODE)
717 AC_SUBST(INIMETAFONT)
720 AC_DEFUN(AC_STEPMAKE_WARN, [
725 AC_DEFUN(AC_STEPMAKE_YODL, [
726 if test "x$YODL" = "x"; then
727 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
728 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
729 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
730 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
731 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
732 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
733 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
734 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
735 YODL2LESS_DIR='$(bindir)/'
741 AC_SUBST(YODL2LESS_DIR)
743 AC_SUBST(YODL2MSLESS)
744 AC_SUBST(YODL2TEXINFO)
746 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
748 if test "x$YODL" = "-echo no yodl"; then
749 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
753 dnl should cache result.
754 dnl should look in $prefix first.
755 dnl should probably assume TDS
757 AC_DEFUN(AC_TEX_PREFIX, [
760 AC_MSG_CHECKING(TeX/MF root dir directory)
762 find_root_prefix="$prefix"
765 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
767 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
768 find_texprefix="$find_root_prefix$postfix"
769 if test -d $find_texprefix; then
770 find_texpostfix=$postfix
775 if test "x$find_texpostfix" = x; then
776 find_texpostfix='/lib/texmf/tex'
777 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
780 find_texprefix="$find_root_prefix/$find_texpostfix"
782 # only assign if variablename not empty
783 if test x != "x[$]$1"; then
784 $1='${prefix}'/"$find_texpostfix"
786 AC_MSG_RESULT($find_texprefix)
791 # find a directory inside a prefix,
792 # $1 the prefix (expanded version)
793 # $2 variable to assign
794 # $3 the directory name
796 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
798 AC_MSG_CHECKING($4 directory)
800 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
803 if test "x$find_dirdir" = x; then
805 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
809 AC_MSG_RESULT($1/$find_dirdir)
812 # ugh. this is hopeless
813 AC_DEFUN(AC_KPSE_TEX_DIR, [
814 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
815 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
817 if test -w "$kpse_syspaths";
819 dir=`echo $kpse_syspaths | head -1`
821 dir=`echo $kpse_paths | grep -v '!'| head -1`
823 if test "$prefix" = "NONE"; then
824 local_prefix=$ac_default_prefix
825 local_prefix_quote='${prefix}'
829 local_prefix_quote=$prefix
831 echo $local_prefix_quote = $local_prefix
833 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
836 AC_DEFUN(AC_TEX_SUBDIR, [
837 dnl AC_REQUIRE([AC_TEX_PREFIX])
838 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
842 AC_DEFUN(AC_MF_SUBDIR, [
843 dnl AC_REQUIRE([AC_TEX_PREFIX])
844 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
848 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
849 result="`echo \"$1\" | grep echo`"
850 if test "x$1" = "xerror" -o "x$result" != "x"; then
851 AC_STEPMAKE_WARN(can\'t find $2. $3)
855 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
857 dnl This macro runs the `guile-config' script, installed with Guile,
858 dnl to find out where Guile's header files and libraries are
859 dnl installed. It sets two variables, marked for substitution, as
862 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
863 dnl code that uses Guile header files. This is almost
864 dnl always just a -I flag.
866 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
867 dnl program against Guile. This includes `-lguile' for
868 dnl the Guile library itself, any libraries that Guile
869 dnl itself requires (like -lqthreads), and so on. It may
870 dnl also include a -L flag to tell the compiler where to
871 dnl find the libraries.
873 AC_DEFUN([GUILE_FLAGS],[
874 ## The GUILE_FLAGS macro.
875 AC_MSG_CHECKING(for Guile)
876 if ! $guile_config link > /dev/null ; then
877 AC_MSG_RESULT("cannot execute $guile_config")
878 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
881 GUILE_CFLAGS="`$guile_config compile`"
882 GUILE_LDFLAGS="`$guile_config link`"
883 AC_SUBST(GUILE_CFLAGS)
884 AC_SUBST(GUILE_LDFLAGS)
889 # Configure paths for GTK+
890 # Owen Taylor 97-11-3
892 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
893 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
895 AC_DEFUN(AM_PATH_GTK,
897 dnl Get the cflags and libraries from the gtk-config script
899 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
900 min_gtk_version=ifelse([$1], ,1.1.1,$1)
901 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
903 if test "$GTK_CONFIG" != "no" ; then
904 GTK_CFLAGS=`$GTK_CONFIG --cflags`
905 GTK_LIBS=`$GTK_CONFIG --libs`
906 ac_save_CFLAGS="$CFLAGS"
908 ac_save_CXXFLAGS="$CXXFLAGS"
909 CFLAGS="$CFLAGS $GTK_CFLAGS"
910 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
911 LIBS="$LIBS $GTK_LIBS"
913 dnl Now check if the installed GTK is sufficiently new. (Also sanity
914 dnl checks the results of gtk-config to some extent)
923 int major, minor, micro;
925 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
926 printf("%s, bad version string\n", "$min_gtk_version");
930 return !((gtk_major_version > major) ||
931 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
932 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
934 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
935 CFLAGS="$ac_save_CFLAGS"
936 CXXFLAGS="$ac_save_CXXFLAGS"
941 if test "x$no_gtk" = x ; then
943 ifelse([$2], , :, [$2])
948 ifelse([$3], , :, [$3])
950 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
957 # Configure paths for GTK--
958 # Erik Andersen 30 May 1998
959 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
961 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
962 dnl to be used as follows:
963 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
966 dnl Get the cflags and libraries from the gtkmm-config script
968 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
969 Prefix where GTK-- is installed (optional)],
970 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
971 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
972 Exec prefix where GTK-- is installed (optional)],
973 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
974 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
975 , enable_gtkmmtest=yes)
977 if test x$gtkmm_config_exec_prefix != x ; then
978 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
979 if test x${GTKMM_CONFIG+set} != xset ; then
980 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
983 if test x$gtkmm_config_prefix != x ; then
984 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
985 if test x${GTKMM_CONFIG+set} != xset ; then
986 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
991 AC_DEFUN(AM_PATH_GTKMM,
995 dnl Check if the installed GTK-- is sufficiently new.
997 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
998 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
1000 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
1002 if test "$GTKMM_CONFIG" = "no" ; then
1008 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1009 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1010 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1011 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1012 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1013 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1014 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1015 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1016 if test "x$enable_gtkmmtest" = "xyes" ; then
1017 ac_save_CXXFLAGS="$CXXFLAGS"
1018 ac_save_LIBS="$LIBS"
1019 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1020 LIBS="$LIBS $GTK___LIBS"
1022 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1023 dnl checks the results of gtkmm-config to some extent
1025 rm -f conf.gtkmmtest
1034 int major, minor, micro;
1037 system ("touch conf.gtkmmtest");
1039 /* HP/UX 0 (%@#!) writes to sscanf strings */
1040 tmp_version = g_strdup("$min_gtkmm_version");
1041 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1042 printf("%s, bad version string\n", "$min_gtkmm_version");
1046 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1047 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1048 (gtkmm_micro_version != $gtkmm_config_micro_version))
1050 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1051 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1052 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1053 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1054 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1055 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1056 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1057 printf("*** required on your system.\n");
1058 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1059 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1060 printf("*** before re-running configure\n");
1062 /* GTK-- does not have the GTKMM_*_VERSION constants */
1064 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1065 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1066 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1068 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1069 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1070 printf("*** library (version %d.%d.%d)\n",
1071 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1076 if ((gtkmm_major_version > major) ||
1077 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1078 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1084 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1085 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1086 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1087 major, minor, micro);
1088 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1090 printf("*** If you have already installed a sufficiently new version, this error\n");
1091 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1092 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1093 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1094 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1095 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1096 printf("*** so that the correct libraries are found at run-time))\n");
1101 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1102 CXXFLAGS="$ac_save_CXXFLAGS"
1103 LIBS="$ac_save_LIBS"
1106 if test "x$no_gtkmm" = x ; then
1108 ifelse([$2], , :, [$2])
1111 if test "$GTKMM_CONFIG" = "no" ; then
1112 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1113 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1114 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1115 echo "*** full path to gtk-config."
1116 echo "*** The gtkmm-config script was not available in GTK-- versions"
1117 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1118 echo "*** version to 0.9.12 or newer"
1120 if test -f conf.gtkmmtest ; then
1123 echo "*** Could not run GTK-- test program, checking why..."
1124 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1125 LIBS="$LIBS $GTK___LIBS"
1129 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1130 [ echo "*** The test program compiled, but did not run. This usually means"
1131 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1132 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1133 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1134 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1135 echo "*** is required on your system"
1137 echo "*** If you have an old version installed, it is best to remove it, although"
1138 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1139 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1140 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1141 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1142 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1143 CXXFLAGS="$ac_save_CXXFLAGS"
1144 LIBS="$ac_save_LIBS"
1149 ifelse([$3], , :, [$3])
1152 AC_SUBST(GTK___CFLAGS)
1153 AC_SUBST(GTK___LIBS)
1154 rm -f conf.gtkmmtest
1157 # Configure paths for GTK--DRAW
1158 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1160 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1161 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1163 AC_DEFUN(AM_PATH_GTK__DRAW,
1165 dnl Get the cflags and libraries from the gtk__-config script
1167 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1168 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1169 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1171 if test "$GTKMM_CONFIG" != "no" ; then
1172 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1173 GTK___LIBS=`$GTKMM_CONFIG --libs`
1174 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1175 GTK___LIBS="$GTK___DLIBS"
1176 ac_save_CFLAGS="$CFLAGS"
1177 ac_save_LIBS="$LIBS"
1178 ac_save_CXXFLAGS="$CXXFLAGS"
1179 CFLAGS="$CFLAGS $GTK___CFLAGS"
1180 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1181 LIBS="$LIBS $GTK___LIBS"
1183 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1184 dnl checks the results of gtk__-config to some extent)
1196 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1197 CFLAGS="$ac_save_CFLAGS"
1198 CXXFLAGS="$ac_save_CXXFLAGS"
1199 LIBS="$ac_save_LIBS"
1203 if test "x$no_gtk__" = x ; then
1205 ifelse([$2], , :, [$2])
1210 ifelse([$3], , :, [$3])
1212 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1214 AC_SUBST(GTK___CFLAGS)
1215 AC_SUBST(GTK___LIBS)