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(optimising,
35 [ --enable-optimising compile with optimising. Default: on],
36 [optimise_b=$enableval])
38 AC_ARG_ENABLE(profiling,
39 [ --enable-profiling compile with gprof support. Default: off],
40 [profile_b=$enableval])
43 if test "$checking_b" = no; then
46 DEFINES="$DEFINES -DNDEBUG"
49 if test "$optimise_b" = yes; then
50 OPTIMIZE="-O2 -finline-functions"
54 if test $profile_b = yes; then
56 OPTIMIZE="$OPTIMIZE -pg"
59 if test $debug_b = yes; then
60 OPTIMIZE="$OPTIMIZE -g"
68 CFLAGS="$CFLAGS $OPTIMIZE"
69 CPPFLAGS=${CPPFLAGS:-""}
71 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
75 dnl should do compile test?
77 CFLAGS="-mieee $CFLAGS"
83 AC_SUBST(cross_compiling)
93 AC_DEFUN(AC_STEPMAKE_CXX, [
97 AC_CHECK_HEADER(FlexLexer.h, true,
98 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
100 CPPFLAGS="$CPPFLAGS $DEFINES"
101 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
102 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
110 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
111 AC_CACHE_CHECK([whether explicit instantiation is needed],
112 lily_cv_need_explicit_instantiation,
114 template <class T> struct foo { static int baz; };
115 template <class T> int foo<T>::baz = 1;
116 ], [ return foo<int>::baz; ],
117 lily_cv_need_explicit_instantiation=no,
118 lily_cv_need_explicit_instantiation=yes))
119 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
120 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
124 AC_DEFUN(AC_STEPMAKE_DATADIR, [
125 if test "$datadir" = "\${prefix}/share"; then
126 datadir='${prefix}/share/'$package
128 DIR_DATADIR=${datadir}
130 if test "$prefix" = "NONE"; then
131 presome=${ac_default_prefix}
133 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
136 AC_SUBST(DIR_DATADIR)
138 dnl yeah, so fuck me gently with a cactus: this doesnt belong here
139 dnl Please take the person responsible for inventing shell-scripts out
140 dnl and shoot him. On behalf of the sane world, thank you.
141 dnl DIR_SHAREDSTATEDIR="foobar"
142 dnl AC_SUBST(DIR_SHAREDSTATEDIR)
144 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
147 AC_DEFUN(AC_STEPMAKE_END, [
148 AC_OUTPUT($CONFIGFILE.make:config.make.in)
150 # regular in-place build
151 # test for srcdir_build = yes ?
152 if test "$builddir" = "."; then
153 rm -f $srcdir/GNUmakefile
154 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
155 chmod 444 $srcdir/GNUmakefile
156 else # --srcdir build
158 cp $srcdir/make/srcdir.make.in GNUmakefile
159 chmod 444 GNUmakefile
163 AC_DEFUN(AC_STEPMAKE_GXX, [
164 AC_MSG_CHECKING("g++ version")
165 cxx_version=`$CXX --version`
166 AC_MSG_RESULT("$cxx_version")
167 changequote(<<, >>)dnl
168 # urg, egcs: how to check for egcs >= 1.1?
169 if expr "$cxx_version" : '.*2\.[89]' > /dev/null ||
170 expr "$cxx_version" : '.*egcs' > /dev/null ||
171 expr "$cxx_version" : '3\.0' > /dev/null
176 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9, 3.0 or egcs 1.1)
180 AC_DEFUN(AC_STEPMAKE_GUILE, [
181 ## First, let's just see if we can find Guile at all.
182 AC_MSG_CHECKING("for guile-config")
183 for guile_config in guile-config $target-guile-config $build-guile-config; do
184 AC_MSG_RESULT("$guile_config")
185 if ! $guile_config --version > /dev/null 2>&1 ; then
186 AC_MSG_WARN("cannot execute $guile_config")
187 AC_MSG_CHECKING("if we are cross compiling")
193 if test "$guile_config" = "error"; then
194 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
197 AC_MSG_CHECKING("Guile version")
198 need_guile_version="1.3.4"
199 need_guile_version_numeric=100304
200 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
201 guile_version_numeric=`echo $guile_version | awk -F. '
202 {if ([$]3) {last = [$]3}
204 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
205 AC_MSG_RESULT("$guile_version")
206 if test $guile_version_numeric -lt $need_guile_version_numeric
208 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
210 changequote(<<, >>)dnl
211 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
212 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
215 AC_PATH_PROG(GUILE, guile, error)
217 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
218 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
221 AC_DEFUN(AC_STEPMAKE_INIT, [
224 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
225 if test x$MY_PATCH_LEVEL != x; then
226 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
229 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
230 changequote(<<, >>)dnl
231 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
232 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
235 # No versioning on directory names of sub-packages
237 stepmake=${datadir}/stepmake
239 if test "$prefix" = "NONE"; then
240 presome=${ac_default_prefix}
242 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
244 # urg, how is this supposed to work?
245 if test "$program_prefix" = "NONE"; then
248 if test "$program_suffix" = "NONE"; then
252 AC_MSG_CHECKING(Package)
253 if test "x$PACKAGE" = "xSTEPMAKE"; then
254 AC_MSG_RESULT(Stepmake package!)
256 AC_MSG_CHECKING(builddir)
257 if test "$srcdir" = "."; then
260 absolute_builddir="`pwd`"
261 package_absolute_builddir="`dirname $absolute_builddir`"
262 package_srcdir="`dirname $srcdir`"
263 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
265 AC_MSG_RESULT($builddir)
267 (cd stepmake 2>/dev/null || mkdir stepmake)
268 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
269 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
270 AC_CONFIG_AUX_DIR(bin)
273 AC_MSG_RESULT($PACKAGE)
275 AC_MSG_CHECKING(builddir)
276 if test "$srcdir" = "."; then
280 absolute_builddir="`pwd`"
281 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
282 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
285 AC_MSG_RESULT($builddir)
286 if expr "$srcdir" : '/' > /dev/null 2>&1; then
288 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
291 AC_MSG_CHECKING(for stepmake)
292 # Check for installed stepmake
293 if test -d $stepmake; then
294 AC_MSG_RESULT($stepmake)
296 if test "$absolute_srcdir" != "yes"; then
297 stepmake='$(depth)'/$srcdir/stepmake
299 stepmake=$srcdir/stepmake
301 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
305 $HOME/usr/local/share/stepmake/bin\
306 $HOME/usr/local/lib/stepmake/bin\
307 $HOME/usr/share/stepmake/bin\
308 $HOME/usr/lib/stepmake/bin\
309 /usr/local/share/stepmake/bin\
310 /usr/local/lib/stepmake/bin\
311 /usr/share/stepmake/bin\
312 /usr/lib/stepmake/bin\
314 $srcdir/stepmake/bin\
322 AC_SUBST(PACKAGE_NAME)
323 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
324 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
326 if test "$package_depth" = "" ; then
329 package_depth="../$package_depth"
332 AC_SUBST(package_depth)
334 AUTOGENERATE="This file was automatically generated by configure"
335 AC_SUBST(AUTOGENERATE)
338 AC_ARG_ENABLE(config,
339 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
340 do \`make conf=CONF' to get output in ./out-CONF],
341 [CONFIGURATION=$enableval])
343 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
344 CONFIGFILE=config$CONFIGSUFFIX
345 AC_SUBST(CONFIGSUFFIX)
348 AC_CHECK_PROGS(MAKE, gmake make, error)
349 AC_CHECK_PROGS(FIND, find, error)
351 dnl system supplied INSTALL is unsafe; use our own install.
353 dnl if test "$INSTALL" = "bin/install-sh"; then
354 dnl export INSTALL="\$\(depth\)/bin/install-sh"
357 AC_CHECK_PROGS(TAR, tar, error)
359 if test "x`uname`" = "xHP-UX"; then
360 AC_PATH_PROG(BASH, bash, /bin/sh)
361 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
362 AC_PATH_PROG(SHELL, bash, /bin/ksh)
364 AC_PATH_PROG(BASH, bash, /bin/sh)
370 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
373 if test $MAKE != "error" ; then
374 $MAKE -v 2> /dev/null | grep GNU > /dev/null
377 AC_STEPMAKE_WARN(Please install *GNU* make)
381 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
383 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
384 LN=cp # hard link does not work under cygnus-nt
385 LN_S='cp -r' # symbolic link does not work for native nt
393 # cygwin fixes all these things.
394 # it seems these were used because of dos-style TEXINPUTS and
395 # MFINPUTS needed for miktex.
396 # but this breaks parsing of all other cygwin/unix style paths.
398 # if your (mik)tex breaks, make a:
399 # /usr/local/bin/tex:
401 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
407 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
409 # this way, you may have buildscripts/out/lilypond-profile
410 # 'automatically' sourced from /usr/etc/profile.d/ too.
415 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
423 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
425 AC_SUBST(program_prefix)
426 AC_SUBST(program_suffix)
431 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
432 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
439 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
442 #FIXME --with-xxx is meant for specifying a PATH too,
443 # so this should read: --enable-kpathsea,
444 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
445 AC_ARG_WITH(kpathsea,
446 [ --with-kpathsea use kpathsea lib. Default: on],
447 [kpathsea_b=$with_kpathsea])
449 if test "$kpathsea_b" != "no"; then
450 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
451 AC_CHECK_LIB(kpathsea, kpse_find_file)
452 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.))
454 AC_MSG_CHECKING(whether to use kpathsea)
455 if test "$kpathsea_b" != no; then
464 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
467 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
468 # ugh, automake: we want (and check for) bison
470 # ugh, automake: we want (and check for) flex
472 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
476 ac_cv_prog_lex_root=lex.yy
478 AC_CHECK_PROGS(BISON, bison, error)
479 AC_CHECK_PROGS(FLEX, flex, error)
480 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
481 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
483 if test $BISON != "error"; then
484 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
485 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
486 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
494 AC_DEFUN(AC_STEPMAKE_LIB, [
495 AC_CHECK_PROGS(AR, ar, error)
502 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
504 # **Never** try to set library version numbers so that they correspond
505 # to the release number of your package. This is an abuse that only
506 # fosters misunderstanding of the purpose of library versions.
508 REVISION=$PATCH_LEVEL
509 # CURRENT=$MINOR_VERSION
510 CURRENT=`expr $MINOR_VERSION + 1`
511 # AGE=$(expr $MAJOR_VERSION + 1)
518 AC_DEFUN(AC_STEPMAKE_LOCALE, [
523 AC_ARG_WITH(localedir,
524 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
525 PREFIX/share/locale ],
526 localedir=$with_localedir,
527 localedir='${prefix}/share/locale')
530 [ --with-lang=LANG use LANG as language to emit messages],
534 AC_MSG_CHECKING(language)
536 En* | en* | Am* | am* | US* | us*)
538 NL | nl | Du* | du* | Ned* | ned*)
547 if test "$lang" = "unknown" ; then
548 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
553 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
554 DIR_LOCALEDIR=${localedir}
556 if test "$prefix" = "NONE"; then
557 presome=${ac_default_prefix}
559 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
561 AC_SUBST(DIR_LOCALEDIR)
562 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
564 AC_CHECK_LIB(intl, gettext)
565 AC_CHECK_FUNCS(gettext)
568 AC_DEFUN(AC_STEPMAKE_MAKEINFO, [
569 AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
570 if test "$MAKEINFO" != "error"; then
571 AC_MSG_CHECKING(whether makeinfo can split html by @node)
573 makeinfo --html --output=out/split <<EOF
575 \input texinfo @c -*-texinfo-*-
576 @setfilename split.info
580 if test -d out/split; then
581 SPLITTING_MAKEINFO=yes
586 AC_STEPMAKE_WARN(your html documentation will be one large file)
590 AC_SUBST(SPLITTING_MAKEINFO)
594 AC_DEFUN(AC_STEPMAKE_MAN, [
595 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
596 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
597 AC_CHECK_PROGS(TBL, tbl, cat)
600 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
601 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
602 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
603 AC_MSG_CHECKING(whether msgfmt accepts -o)
604 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
605 if test "$msgfmt_output" = ""; then
609 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
611 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
613 if test ! -n "$MSGFMT"; then
614 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
618 #why has this been dropped?
619 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
620 AC_ARG_ENABLE(tex-prefix,
621 [ --enable-tex-prefix=DIR set the tex-directory to find TeX
622 subdirectories. Default: PREFIX],
623 [TEXPREFIX=$enableval],
626 AC_ARG_ENABLE(tex-dir,
627 [ --enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
631 AC_ARG_ENABLE(mf-dir,
632 [ --enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
636 if test "x$TEXPREFIX" = xauto ; then
637 AC_TEX_PREFIX(TEXPREFIX)
639 find_texprefix=$TEXPREFIX
642 if test "x$MFDIR" = xauto; then
646 if test "x$TEXDIR" = xauto ; then
647 AC_TEX_SUBDIR(TEXDIR)
654 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
655 AC_ARG_ENABLE(tfm-path,
656 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
657 esp.: cmr10.tfm. Default: use kpsewhich],
658 [tfm_path=$enableval],
661 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
662 AC_MSG_CHECKING(for tfm path)
666 if test "x$tfm_path" = xauto ; then
667 if test "x$KPSEWHICH" != "xno" ; then
668 for i in $TFM_FONTS; do
669 dir=`$KPSEWHICH tfm ${i}10.tfm`
670 TFM_PATH="$TFM_PATH `dirname $dir`"
673 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
674 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
680 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
681 AC_MSG_RESULT($TFM_PATH)
685 AC_DEFUN(AC_STEPMAKE_TEXMF, [
686 # urg, never know what names these teTeX guys will think up
688 AC_CHECK_PROGS(METAFONT, mf, no)
689 if test "x$METAFONT" = "xno"; then
690 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
694 AC_CHECK_PROGS(METAPOST, mp, no)
695 if test "x$METAPOST" = "xno"; then
696 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
701 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
702 if test "x$INIMETAFONT" = "xno"; then
703 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
704 INIMETAFONT=$INIMFONT
707 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
708 if test "x$INIMETAPOST" = "xno"; then
709 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
710 INIMETAPOST=$INIMPOST
713 AC_MSG_CHECKING(for working metafont mode)
714 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
715 for MFMODE in $modelist; do
716 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
717 if test -f mfput.tfm; then
721 AC_MSG_RESULT($MFMODE)
723 AC_MSG_CHECKING(for mfplain.mp)
725 # For now let people define these in their environments
727 : ${MFPLAIN_MP=`kpsewhich --format mp mfplain.mp`}
728 AC_MSG_RESULT($MFPLAIN_MP)
730 AC_MSG_CHECKING(for inimetapost flags)
731 if test ${INIMETAPOST} = "inimp" ; then
732 : ${INIMETAPOST_FLAGS=''}
734 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
736 AC_MSG_RESULT($INIMETAPOST_FLAGS)
743 AC_SUBST(INIMETAFONT)
744 AC_SUBST(INIMETAPOST)
746 AC_SUBST(INIMETAPOST_FLAGS)
749 AC_DEFUN(AC_STEPMAKE_WARN, [
754 AC_DEFUN(AC_STEPMAKE_YODL, [
755 if test "x$YODL" = "x"; then
756 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
757 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
758 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
759 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
760 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
761 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
762 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
763 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
764 YODL2LESS_DIR='$(bindir)/'
770 AC_SUBST(YODL2LESS_DIR)
772 AC_SUBST(YODL2MSLESS)
773 AC_SUBST(YODL2TEXINFO)
775 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
777 if test "x$YODL" = "-echo no yodl"; then
778 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
782 dnl should cache result.
783 dnl should look in $prefix first.
784 dnl should probably assume TDS
786 AC_DEFUN(AC_TEX_PREFIX, [
789 AC_MSG_CHECKING(TeX/MF root dir directory)
791 find_root_prefix="$prefix"
794 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
796 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
797 find_texprefix="$find_root_prefix$postfix"
798 if test -d $find_texprefix; then
799 find_texpostfix=$postfix
804 if test "x$find_texpostfix" = x; then
805 find_texpostfix='/lib/texmf/tex'
806 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
809 find_texprefix="$find_root_prefix/$find_texpostfix"
811 # only assign if variablename not empty
812 if test x != "x[$]$1"; then
813 $1='${prefix}'/"$find_texpostfix"
815 AC_MSG_RESULT($find_texprefix)
820 # find a directory inside a prefix,
821 # $1 the prefix (expanded version)
822 # $2 variable to assign
823 # $3 the directory name
825 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
827 AC_MSG_CHECKING($4 directory)
829 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
832 if test "x$find_dirdir" = x; then
834 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
838 AC_MSG_RESULT($1/$find_dirdir)
841 # ugh. this is hopeless
842 AC_DEFUN(AC_KPSE_TEX_DIR, [
843 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
844 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
846 if test -w "$kpse_syspaths";
848 dir=`echo $kpse_syspaths | head -1`
850 dir=`echo $kpse_paths | grep -v '!'| head -1`
852 if test "$prefix" = "NONE"; then
853 local_prefix=$ac_default_prefix
854 local_prefix_quote='${prefix}'
858 local_prefix_quote=$prefix
860 echo $local_prefix_quote = $local_prefix
862 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
865 AC_DEFUN(AC_TEX_SUBDIR, [
866 dnl AC_REQUIRE([AC_TEX_PREFIX])
867 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
871 AC_DEFUN(AC_MF_SUBDIR, [
872 dnl AC_REQUIRE([AC_TEX_PREFIX])
873 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
877 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
878 result="`echo \"$1\" | grep echo`"
879 if test "x$1" = "xerror" -o "x$result" != "x"; then
880 AC_STEPMAKE_WARN(can\'t find $2. $3)
884 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
886 dnl This macro runs the `guile-config' script, installed with Guile,
887 dnl to find out where Guile's header files and libraries are
888 dnl installed. It sets two variables, marked for substitution, as
891 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
892 dnl code that uses Guile header files. This is almost
893 dnl always just a -I flag.
895 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
896 dnl program against Guile. This includes `-lguile' for
897 dnl the Guile library itself, any libraries that Guile
898 dnl itself requires (like -lqthreads), and so on. It may
899 dnl also include a -L flag to tell the compiler where to
900 dnl find the libraries.
902 AC_DEFUN([GUILE_FLAGS],[
903 ## The GUILE_FLAGS macro.
904 AC_MSG_CHECKING(for Guile)
905 if ! $guile_config link > /dev/null ; then
906 AC_MSG_RESULT("cannot execute $guile_config")
907 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
910 GUILE_CFLAGS="`$guile_config compile`"
911 GUILE_LDFLAGS="`$guile_config link`"
912 AC_SUBST(GUILE_CFLAGS)
913 AC_SUBST(GUILE_LDFLAGS)
918 # Configure paths for GTK+
919 # Owen Taylor 97-11-3
921 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
922 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
924 AC_DEFUN(AM_PATH_GTK,
926 dnl Get the cflags and libraries from the gtk-config script
928 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
929 min_gtk_version=ifelse([$1], ,1.1.1,$1)
930 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
932 if test "$GTK_CONFIG" != "no" ; then
933 GTK_CFLAGS=`$GTK_CONFIG --cflags`
934 GTK_LIBS=`$GTK_CONFIG --libs`
935 ac_save_CFLAGS="$CFLAGS"
937 ac_save_CXXFLAGS="$CXXFLAGS"
938 CFLAGS="$CFLAGS $GTK_CFLAGS"
939 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
940 LIBS="$LIBS $GTK_LIBS"
942 dnl Now check if the installed GTK is sufficiently new. (Also sanity
943 dnl checks the results of gtk-config to some extent)
952 int major, minor, micro;
954 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
955 printf("%s, bad version string\n", "$min_gtk_version");
959 return !((gtk_major_version > major) ||
960 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
961 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
963 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
964 CFLAGS="$ac_save_CFLAGS"
965 CXXFLAGS="$ac_save_CXXFLAGS"
970 if test "x$no_gtk" = x ; then
972 ifelse([$2], , :, [$2])
977 ifelse([$3], , :, [$3])
979 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
986 # Configure paths for GTK--
987 # Erik Andersen 30 May 1998
988 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
990 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
991 dnl to be used as follows:
992 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
995 dnl Get the cflags and libraries from the gtkmm-config script
997 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
998 Prefix where GTK-- is installed (optional)],
999 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
1000 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
1001 Exec prefix where GTK-- is installed (optional)],
1002 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
1003 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
1004 , enable_gtkmmtest=yes)
1006 if test x$gtkmm_config_exec_prefix != x ; then
1007 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
1008 if test x${GTKMM_CONFIG+set} != xset ; then
1009 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
1012 if test x$gtkmm_config_prefix != x ; then
1013 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
1014 if test x${GTKMM_CONFIG+set} != xset ; then
1015 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
1020 AC_DEFUN(AM_PATH_GTKMM,
1024 dnl Check if the installed GTK-- is sufficiently new.
1026 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1027 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
1029 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
1031 if test "$GTKMM_CONFIG" = "no" ; then
1037 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1038 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1039 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1040 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1041 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1042 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1043 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1044 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1045 if test "x$enable_gtkmmtest" = "xyes" ; then
1046 ac_save_CXXFLAGS="$CXXFLAGS"
1047 ac_save_LIBS="$LIBS"
1048 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1049 LIBS="$LIBS $GTK___LIBS"
1051 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1052 dnl checks the results of gtkmm-config to some extent
1054 rm -f conf.gtkmmtest
1063 int major, minor, micro;
1066 system ("touch conf.gtkmmtest");
1068 /* HP/UX 0 (%@#!) writes to sscanf strings */
1069 tmp_version = g_strdup("$min_gtkmm_version");
1070 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1071 printf("%s, bad version string\n", "$min_gtkmm_version");
1075 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1076 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1077 (gtkmm_micro_version != $gtkmm_config_micro_version))
1079 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1080 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1081 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1082 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1083 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1084 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1085 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1086 printf("*** required on your system.\n");
1087 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1088 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1089 printf("*** before re-running configure\n");
1091 /* GTK-- does not have the GTKMM_*_VERSION constants */
1093 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1094 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1095 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1097 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1098 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1099 printf("*** library (version %d.%d.%d)\n",
1100 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1105 if ((gtkmm_major_version > major) ||
1106 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1107 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1113 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1114 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1115 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1116 major, minor, micro);
1117 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1119 printf("*** If you have already installed a sufficiently new version, this error\n");
1120 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1121 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1122 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1123 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1124 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1125 printf("*** so that the correct libraries are found at run-time))\n");
1130 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1131 CXXFLAGS="$ac_save_CXXFLAGS"
1132 LIBS="$ac_save_LIBS"
1135 if test "x$no_gtkmm" = x ; then
1137 ifelse([$2], , :, [$2])
1140 if test "$GTKMM_CONFIG" = "no" ; then
1141 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1142 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1143 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1144 echo "*** full path to gtk-config."
1145 echo "*** The gtkmm-config script was not available in GTK-- versions"
1146 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1147 echo "*** version to 0.9.12 or newer"
1149 if test -f conf.gtkmmtest ; then
1152 echo "*** Could not run GTK-- test program, checking why..."
1153 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1154 LIBS="$LIBS $GTK___LIBS"
1158 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1159 [ echo "*** The test program compiled, but did not run. This usually means"
1160 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1161 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1162 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1163 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1164 echo "*** is required on your system"
1166 echo "*** If you have an old version installed, it is best to remove it, although"
1167 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1168 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1169 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1170 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1171 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1172 CXXFLAGS="$ac_save_CXXFLAGS"
1173 LIBS="$ac_save_LIBS"
1178 ifelse([$3], , :, [$3])
1181 AC_SUBST(GTK___CFLAGS)
1182 AC_SUBST(GTK___LIBS)
1183 rm -f conf.gtkmmtest
1186 # Configure paths for GTK--DRAW
1187 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1189 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1190 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1192 AC_DEFUN(AM_PATH_GTK__DRAW,
1194 dnl Get the cflags and libraries from the gtk__-config script
1196 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1197 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1198 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1200 if test "$GTKMM_CONFIG" != "no" ; then
1201 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1202 GTK___LIBS=`$GTKMM_CONFIG --libs`
1203 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1204 GTK___LIBS="$GTK___DLIBS"
1205 ac_save_CFLAGS="$CFLAGS"
1206 ac_save_LIBS="$LIBS"
1207 ac_save_CXXFLAGS="$CXXFLAGS"
1208 CFLAGS="$CFLAGS $GTK___CFLAGS"
1209 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1210 LIBS="$LIBS $GTK___LIBS"
1212 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1213 dnl checks the results of gtk__-config to some extent)
1225 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1226 CFLAGS="$ac_save_CFLAGS"
1227 CXXFLAGS="$ac_save_CXXFLAGS"
1228 LIBS="$ac_save_LIBS"
1232 if test "x$no_gtk__" = x ; then
1234 ifelse([$2], , :, [$2])
1239 ifelse([$3], , :, [$3])
1241 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1243 AC_SUBST(GTK___CFLAGS)
1244 AC_SUBST(GTK___LIBS)