1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
6 expr "$1" : "\(/[^/]*\)"
11 expr "$1" : "/[^/]*\(.*\)"
16 from=`(cd "$1" && pwd)`
20 while [ -n "$t" -a "$t" = "$f" ]; do
29 AC_DEFUN(AC_STEPMAKE_BIBTEX2HTML, [
30 AC_CHECK_PROGS(BIBTEX2HTML, bibtex2html bib2html, error)
31 if test "$BIBTEX2HTML" = "bib2html"; then
32 BIBTEX2HTML_FLAGS='$< $(@)'
34 BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
37 AC_SUBST(BIBTEX2HTML_FLAGS)
41 AC_DEFUN(AC_STEPMAKE_COMPILE, [
42 # -O is necessary to get inlining
45 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
46 LDFLAGS=${LDFLAGS:-""}
52 AC_ARG_ENABLE(checking,
53 [ enable-checking set runtime checks (assert calls). Default: on],
54 [checking_b=$enableval] )
56 # actually, the default is: tja='-O' to get inlining...
59 #actually, that sucks.
60 # tja looks like a typo. Default is optimisation off. --hwn
62 AC_ARG_ENABLE(optimise,
63 [ enable-optimise use maximal speed optimisations. Default: off],
64 [optimise_b=$enableval])
66 AC_ARG_ENABLE(profiling,
67 [ enable-profiling compile with gprof support. Default: off],
68 [profile_b=$enableval])
70 AC_ARG_ENABLE(debugging,
71 [ enable-debugging set debug info. Default: on],
74 AC_ARG_ENABLE(mingw-prefix,
75 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
76 [MINGWPREFIX=$enableval],
79 if test "$checking_b" = no; then
82 DEFINES="$DEFINES -DNDEBUG"
85 if test "$optimise_b" = yes; then
86 OPTIMIZE="-O2 -finline-functions"
89 if test "$optimise_b" = no; then
93 if test $profile_b = yes; then
95 OPTIMIZE="$OPTIMIZE -pg"
98 if test $debug_b = yes; then
99 OPTIMIZE="$OPTIMIZE -g"
102 # however, C++ support in mingw32 v 0.1.4 is still flaky
103 if test x$MINGWPREFIX != xno; then
104 ICFLAGS="-I$MINGWPREFIX/include"
105 ILDFLAGS="-$MINGWPREFIX/lib"
112 CFLAGS="$CFLAGS $OPTIMIZE"
113 CPPFLAGS=${CPPFLAGS:-""}
114 AC_SUBST(cross_compiling)
121 AC_SUBST(EXTRA_LIBES)
124 AC_DEFUN(AC_STEPMAKE_CXX, [
128 AC_CHECK_HEADER(FlexLexer.h, true,
129 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
131 CPPFLAGS="$CPPFLAGS $DEFINES"
132 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
133 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
141 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
142 AC_CACHE_CHECK([whether explicit instantiation is needed],
143 lily_cv_need_explicit_instantiation,
145 template <class T> struct foo { static int baz; };
146 template <class T> int foo<T>::baz = 1;
147 ], [ return foo<int>::baz; ],
148 lily_cv_need_explicit_instantiation=no,
149 lily_cv_need_explicit_instantiation=yes))
150 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
151 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
155 AC_DEFUN(AC_STEPMAKE_DATADIR, [
156 if test "$datadir" = "\${prefix}/share"; then
157 datadir='${prefix}/share/'$package
159 DIR_DATADIR=${datadir}
161 if test "$prefix" = "NONE"; then
162 presome=${ac_default_prefix}
164 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
166 AC_SUBST(DIR_DATADIR)
167 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
170 AC_DEFUN(AC_STEPMAKE_END, [
171 AC_OUTPUT($CONFIGFILE.make:config.make.in)
173 # regular in-place build
174 # test for srcdir_build = yes ?
175 if test "$builddir" = "."; then
176 rm -f $srcdir/GNUmakefile
177 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
178 chmod 444 $srcdir/GNUmakefile
179 else # --srcdir build
181 cp $srcdir/make/srcdir.make.in GNUmakefile
182 chmod 444 GNUmakefile
186 AC_DEFUN(AC_STEPMAKE_GXX, [
188 # urg, egcs: how to check for egcs >= 1.1?
189 changequote(<<, >>)dnl
190 if $CXX --version | egrep '2\.[89]' > /dev/null ||
191 $CXX --version | grep 'egcs' > /dev/null
196 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
200 AC_DEFUN(AC_STEPMAKE_GUILE, [
201 ## First, let's just see if we can find Guile at all.
202 AC_MSG_CHECKING("for guile-config")
203 for guile_config in guile-config $target-guile-config $build-guile-config; do
204 AC_MSG_RESULT("$guile_config")
205 if ! $guile_config --version > /dev/null 2>&1 ; then
206 AC_MSG_WARN("cannot execute $guile_config")
207 AC_MSG_CHECKING("if we are cross compiling")
213 if test "$guile_config" = "error"; then
214 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
217 AC_MSG_CHECKING("Guile version")
218 need_guile_version="1.3.4"
219 need_guile_version_numeric=100304
220 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
221 guile_version_numeric=`echo $guile_version | awk -F. '
222 {if ([$]3) {last = [$]3}
224 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
225 AC_MSG_RESULT("$guile_version")
226 if test $guile_version_numeric -lt $need_guile_version_numeric
228 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
231 AC_PATH_PROG(GUILE, guile, error)
235 AC_DEFUN(AC_STEPMAKE_INIT, [
238 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
239 if test x$MY_PATCH_LEVEL != x; then
240 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
243 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
244 changequote(<<, >>)dnl
245 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
246 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
249 # No versioning on directory names of sub-packages
251 stepmake=${datadir}/stepmake
253 if test "$prefix" = "NONE"; then
254 presome=${ac_default_prefix}
256 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
258 # urg, how is this supposed to work?
259 if test "$program_prefix" = "NONE"; then
262 if test "$program_suffix" = "NONE"; then
266 AC_MSG_CHECKING(Package)
267 if test "x$PACKAGE" = "xSTEPMAKE"; then
268 AC_MSG_RESULT(Stepmake package!)
270 AC_MSG_CHECKING(builddir)
271 if test "$srcdir" = "."; then
274 absolute_builddir="`pwd`"
275 package_absolute_builddir="`dirname $absolute_builddir`"
276 package_srcdir="`dirname $srcdir`"
277 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
279 AC_MSG_RESULT($builddir)
281 (cd stepmake 2>/dev/null || mkdir stepmake)
282 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
283 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
284 AC_CONFIG_AUX_DIR(bin)
287 AC_MSG_RESULT($PACKAGE)
289 AC_MSG_CHECKING(builddir)
290 if test "$srcdir" = "."; then
294 absolute_builddir="`pwd`"
295 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
296 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
299 AC_MSG_RESULT($builddir)
300 if expr "$srcdir" : '/' > /dev/null 2>&1; then
302 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
305 AC_MSG_CHECKING(for stepmake)
306 # Check for installed stepmake
307 if test -d $stepmake; then
308 AC_MSG_RESULT($stepmake)
310 if test "$absolute_srcdir" != "yes"; then
311 stepmake='$(depth)'/$srcdir/stepmake
313 stepmake=$srcdir/stepmake
315 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
319 $HOME/usr/local/share/stepmake/bin\
320 $HOME/usr/local/lib/stepmake/bin\
321 $HOME/usr/share/stepmake/bin\
322 $HOME/usr/lib/stepmake/bin\
323 /usr/local/share/stepmake/bin\
324 /usr/local/lib/stepmake/bin\
325 /usr/share/stepmake/bin\
326 /usr/lib/stepmake/bin\
328 $srcdir/stepmake/bin\
336 AC_SUBST(PACKAGE_NAME)
337 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
338 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
340 if test "$package_depth" = "" ; then
343 package_depth="../$package_depth"
346 AC_SUBST(package_depth)
348 AUTOGENERATE="This file was automatically generated by configure"
349 AC_SUBST(AUTOGENERATE)
352 AC_ARG_ENABLE(config,
353 [ enable-config=FILE put configure settings in config-FILE.make],
354 [CONFIGSUFFIX=-$enableval])
356 CONFIGFILE=config$CONFIGSUFFIX
357 AC_SUBST(CONFIGSUFFIX)
360 AC_CHECK_PROGS(MAKE, gmake make, error)
361 AC_CHECK_PROGS(FIND, find, error)
363 dnl system supplied INSTALL is unsafe; use our own install.
365 dnl if test "$INSTALL" = "bin/install-sh"; then
366 dnl export INSTALL="\$\(depth\)/bin/install-sh"
369 AC_CHECK_PROGS(TAR, tar, error)
371 if test "x`uname`" = "xHP-UX"; then
372 AC_PATH_PROG(BASH, bash, /bin/sh)
373 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
374 AC_PATH_PROG(SHELL, bash, /bin/ksh)
376 AC_PATH_PROG(BASH, bash, /bin/sh)
382 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
385 if test $MAKE != "error" ; then
386 $MAKE -v 2> /dev/null | grep GNU > /dev/null
389 AC_STEPMAKE_WARN(Please install *GNU* make)
393 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
395 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
396 LN=cp # hard link does not work under cygnus-nt
397 LN_S='cp -r' # symbolic link does not work for native nt
404 # cygwin fixes all these things.
405 # it seems these were used because of dos-style TEXINPUTS and
406 # MFINPUTS needed for miktex.
407 # but this breaks parsing of all other cygwin/unix style paths.
409 # if your (mik)tex breaks, make a:
410 # /usr/local/bin/tex:
412 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
418 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
420 # this way, you may have buildscripts/out/lilypond-profile
421 # 'automatically' sourced from /usr/etc/profile.d/ too.
425 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
432 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
434 AC_SUBST(program_prefix)
435 AC_SUBST(program_suffix)
440 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
441 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
448 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
451 AC_ARG_ENABLE(kpathsea,
452 [ enable-kpathsea use kpathsea lib. Default: on],
453 [kpathsea_b=$enableval])
455 if test $kpathsea_b = yes; then
456 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
457 AC_CHECK_LIB(kpathsea, kpse_find_file)
458 # urg: kpse_find_tfm is a #define, how to check for this?
459 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
460 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
461 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
463 AC_MSG_CHECKING(whether to use kpathsea)
464 if test $kpathsea_b = yes; then
473 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
476 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
477 # ugh, automake: we want (and check for) bison
479 # ugh, automake: we want (and check for) flex
481 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
485 ac_cv_prog_lex_root=lex.yy
487 AC_CHECK_PROGS(BISON, bison, error)
488 AC_CHECK_PROGS(FLEX, flex, error)
489 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
490 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
492 if test $BISON != "error"; then
493 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
494 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
495 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
503 AC_DEFUN(AC_STEPMAKE_LIB, [
504 AC_CHECK_PROGS(AR, ar, error)
511 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
513 # **Never** try to set library version numbers so that they correspond
514 # to the release number of your package. This is an abuse that only
515 # fosters misunderstanding of the purpose of library versions.
517 REVISION=$PATCH_LEVEL
518 # CURRENT=$MINOR_VERSION
519 CURRENT=`expr $MINOR_VERSION + 1`
520 # AGE=$(expr $MAJOR_VERSION + 1)
527 AC_DEFUN(AC_STEPMAKE_LOCALE, [
532 AC_ARG_WITH(localedir,
533 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
534 localedir=$with_localedir,
535 localedir='${prefix}/share/locale')
538 [ with-lang=LANG use LANG as language to emit messages],
542 AC_MSG_CHECKING(language)
544 En* | en* | Am* | am* | US* | us*)
546 NL | nl | Du* | du* | Ned* | ned*)
555 if test "$lang" = "unknown" ; then
556 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
561 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
562 DIR_LOCALEDIR=${localedir}
564 if test "$prefix" = "NONE"; then
565 presome=${ac_default_prefix}
567 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
569 AC_SUBST(DIR_LOCALEDIR)
570 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
572 AC_CHECK_LIB(intl, gettext)
573 AC_CHECK_FUNCS(gettext)
576 AC_DEFUN(AC_STEPMAKE_MAN, [
577 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
578 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
579 AC_CHECK_PROGS(TBL, tbl, cat)
582 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
583 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
584 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
585 AC_MSG_CHECKING(whether msgfmt accepts -o)
586 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
587 if test "$msgfmt_output" = ""; then
591 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
593 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
595 if test ! -n "$MSGFMT"; then
596 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
600 #why has this been dropped?
601 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
602 AC_ARG_ENABLE(tex-prefix,
603 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. Default: PREFIX],
604 [TEXPREFIX=$enableval],
607 AC_ARG_ENABLE(tex-dir,
608 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
612 AC_ARG_ENABLE(mf-dir,
613 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
617 if test "x$TEXPREFIX" = xauto ; then
618 AC_TEX_PREFIX(TEXPREFIX)
620 find_texprefix=$TEXPREFIX
623 if test "x$MFDIR" = xauto; then
627 if test "x$TEXDIR" = xauto ; then
628 AC_TEX_SUBDIR(TEXDIR)
635 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
636 AC_ARG_ENABLE(tfm-path,
637 [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm. Default: use kpsewhich],
638 [tfm_path=$enableval],
641 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
642 AC_MSG_CHECKING(for tfm path)
646 if test "x$tfm_path" = xauto ; then
647 if test "x$KPSEWHICH" != "xno" ; then
648 for i in $TFM_FONTS; do
649 dir=`$KPSEWHICH tfm ${i}10.tfm`
650 TFM_PATH="$TFM_PATH `dirname $dir`"
653 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
654 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
660 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
661 AC_MSG_RESULT($TFM_PATH)
665 AC_DEFUN(AC_STEPMAKE_TEXMF, [
666 # urg, never know what names these teTeX guys will think up
668 AC_CHECK_PROGS(METAFONT, mf, no)
669 if test "x$METAFONT" = "xno"; then
670 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
674 AC_CHECK_PROGS(METAPOST, mp, no)
675 if test "x$METAPOST" = "xno"; then
676 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
681 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
682 if test "x$INIMETAFONT" = "xno"; then
683 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
684 INIMETAFONT=$INIMFONT
687 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
688 if test "x$INIMETAPOST" = "xno"; then
689 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
690 INIMETAPOST=$INIMPOST
693 AC_MSG_CHECKING(for working metafont mode)
694 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
695 for MFMODE in $modelist; do
696 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
697 if test -f mfput.tfm; then
701 AC_MSG_RESULT($MFMODE)
703 AC_MSG_CHECKING(for mfplain.mp)
705 # For now let people define these in their environments
707 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
708 AC_MSG_RESULT($MFPLAIN_MP)
710 AC_MSG_CHECKING(for inimetapost flags)
711 if test ${INIMETAPOST} = "inimp" ; then
712 : ${INIMETAPOST_FLAGS=''}
714 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
716 AC_MSG_RESULT($INIMETAPOST_FLAGS)
723 AC_SUBST(INIMETAFONT)
724 AC_SUBST(INIMETAPOST)
726 AC_SUBST(INIMETAPOST_FLAGS)
729 AC_DEFUN(AC_STEPMAKE_WARN, [
734 AC_DEFUN(AC_STEPMAKE_YODL, [
735 if test "x$YODL" = "x"; then
736 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
737 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
738 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
739 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
740 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
741 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
742 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
743 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
744 YODL2LESS_DIR='$(bindir)/'
750 AC_SUBST(YODL2LESS_DIR)
752 AC_SUBST(YODL2MSLESS)
753 AC_SUBST(YODL2TEXINFO)
755 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
757 if test "x$YODL" = "-echo no yodl"; then
758 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
762 dnl should cache result.
763 dnl should look in $prefix first.
764 dnl should probably assume TDS
766 AC_DEFUN(AC_TEX_PREFIX, [
769 AC_MSG_CHECKING(TeX/MF root dir directory)
771 find_root_prefix="$prefix"
774 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
776 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
777 find_texprefix="$find_root_prefix$postfix"
778 if test -d $find_texprefix; then
779 find_texpostfix=$postfix
784 if test "x$find_texpostfix" = x; then
785 find_texpostfix='/lib/texmf/tex'
786 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
789 find_texprefix="$find_root_prefix/$find_texpostfix"
791 # only assign if variablename not empty
792 if test x != "x[$]$1"; then
793 $1='${prefix}'/"$find_texpostfix"
795 AC_MSG_RESULT($find_texprefix)
800 # find a directory inside a prefix,
801 # $1 the prefix (expanded version)
802 # $2 variable to assign
803 # $3 the directory name
805 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
807 AC_MSG_CHECKING($4 directory)
809 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
812 if test "x$find_dirdir" = x; then
814 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
818 AC_MSG_RESULT($1/$find_dirdir)
821 # ugh. this is hopeless
822 AC_DEFUN(AC_KPSE_TEX_DIR, [
823 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
824 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
826 if test -w "$kpse_syspaths";
828 dir=`echo $kpse_syspaths | head -1`
830 dir=`echo $kpse_paths | grep -v '!'| head -1`
832 if test "$prefix" = "NONE"; then
833 local_prefix=$ac_default_prefix
834 local_prefix_quote='${prefix}'
838 local_prefix_quote=$prefix
840 echo $local_prefix_quote = $local_prefix
842 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
845 AC_DEFUN(AC_TEX_SUBDIR, [
846 dnl AC_REQUIRE([AC_TEX_PREFIX])
847 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
851 AC_DEFUN(AC_MF_SUBDIR, [
852 dnl AC_REQUIRE([AC_TEX_PREFIX])
853 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
857 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
858 result="`echo \"$1\" | grep echo`"
859 if test "x$1" = "xerror" -o "x$result" != "x"; then
860 AC_STEPMAKE_WARN(can\'t find $2. $3)
864 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
866 dnl This macro runs the `guile-config' script, installed with Guile,
867 dnl to find out where Guile's header files and libraries are
868 dnl installed. It sets two variables, marked for substitution, as
871 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
872 dnl code that uses Guile header files. This is almost
873 dnl always just a -I flag.
875 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
876 dnl program against Guile. This includes `-lguile' for
877 dnl the Guile library itself, any libraries that Guile
878 dnl itself requires (like -lqthreads), and so on. It may
879 dnl also include a -L flag to tell the compiler where to
880 dnl find the libraries.
882 AC_DEFUN([GUILE_FLAGS],[
883 ## The GUILE_FLAGS macro.
884 AC_MSG_CHECKING(for Guile)
885 if ! $guile_config link > /dev/null ; then
886 AC_MSG_RESULT("cannot execute $guile_config")
887 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
890 GUILE_CFLAGS="`$guile_config compile`"
891 GUILE_LDFLAGS="`$guile_config link`"
892 AC_SUBST(GUILE_CFLAGS)
893 AC_SUBST(GUILE_LDFLAGS)
898 # Configure paths for GTK+
899 # Owen Taylor 97-11-3
901 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
902 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
904 AC_DEFUN(AM_PATH_GTK,
906 dnl Get the cflags and libraries from the gtk-config script
908 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
909 min_gtk_version=ifelse([$1], ,1.1.1,$1)
910 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
912 if test "$GTK_CONFIG" != "no" ; then
913 GTK_CFLAGS=`$GTK_CONFIG --cflags`
914 GTK_LIBS=`$GTK_CONFIG --libs`
915 ac_save_CFLAGS="$CFLAGS"
917 ac_save_CXXFLAGS="$CXXFLAGS"
918 CFLAGS="$CFLAGS $GTK_CFLAGS"
919 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
920 LIBS="$LIBS $GTK_LIBS"
922 dnl Now check if the installed GTK is sufficiently new. (Also sanity
923 dnl checks the results of gtk-config to some extent)
932 int major, minor, micro;
934 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
935 printf("%s, bad version string\n", "$min_gtk_version");
939 return !((gtk_major_version > major) ||
940 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
941 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
943 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
944 CFLAGS="$ac_save_CFLAGS"
945 CXXFLAGS="$ac_save_CXXFLAGS"
950 if test "x$no_gtk" = x ; then
952 ifelse([$2], , :, [$2])
957 ifelse([$3], , :, [$3])
959 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
966 # Configure paths for GTK--
967 # Erik Andersen 30 May 1998
968 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
970 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
971 dnl to be used as follows:
972 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
975 dnl Get the cflags and libraries from the gtkmm-config script
977 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
978 Prefix where GTK-- is installed (optional)],
979 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
980 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
981 Exec prefix where GTK-- is installed (optional)],
982 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
983 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
984 , enable_gtkmmtest=yes)
986 if test x$gtkmm_config_exec_prefix != x ; then
987 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
988 if test x${GTKMM_CONFIG+set} != xset ; then
989 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
992 if test x$gtkmm_config_prefix != x ; then
993 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
994 if test x${GTKMM_CONFIG+set} != xset ; then
995 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
1000 AC_DEFUN(AM_PATH_GTKMM,
1004 dnl Check if the installed GTK-- is sufficiently new.
1006 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1007 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
1009 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
1011 if test "$GTKMM_CONFIG" = "no" ; then
1017 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1018 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1019 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1020 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1021 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1022 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1023 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1024 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1025 if test "x$enable_gtkmmtest" = "xyes" ; then
1026 ac_save_CXXFLAGS="$CXXFLAGS"
1027 ac_save_LIBS="$LIBS"
1028 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1029 LIBS="$LIBS $GTK___LIBS"
1031 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1032 dnl checks the results of gtkmm-config to some extent
1034 rm -f conf.gtkmmtest
1043 int major, minor, micro;
1046 system ("touch conf.gtkmmtest");
1048 /* HP/UX 0 (%@#!) writes to sscanf strings */
1049 tmp_version = g_strdup("$min_gtkmm_version");
1050 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1051 printf("%s, bad version string\n", "$min_gtkmm_version");
1055 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1056 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1057 (gtkmm_micro_version != $gtkmm_config_micro_version))
1059 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1060 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1061 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1062 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1063 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1064 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1065 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1066 printf("*** required on your system.\n");
1067 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1068 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1069 printf("*** before re-running configure\n");
1071 /* GTK-- does not have the GTKMM_*_VERSION constants */
1073 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1074 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1075 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1077 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1078 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1079 printf("*** library (version %d.%d.%d)\n",
1080 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1085 if ((gtkmm_major_version > major) ||
1086 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1087 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1093 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1094 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1095 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1096 major, minor, micro);
1097 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1099 printf("*** If you have already installed a sufficiently new version, this error\n");
1100 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1101 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1102 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1103 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1104 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1105 printf("*** so that the correct libraries are found at run-time))\n");
1110 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1111 CXXFLAGS="$ac_save_CXXFLAGS"
1112 LIBS="$ac_save_LIBS"
1115 if test "x$no_gtkmm" = x ; then
1117 ifelse([$2], , :, [$2])
1120 if test "$GTKMM_CONFIG" = "no" ; then
1121 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1122 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1123 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1124 echo "*** full path to gtk-config."
1125 echo "*** The gtkmm-config script was not available in GTK-- versions"
1126 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1127 echo "*** version to 0.9.12 or newer"
1129 if test -f conf.gtkmmtest ; then
1132 echo "*** Could not run GTK-- test program, checking why..."
1133 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1134 LIBS="$LIBS $GTK___LIBS"
1138 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1139 [ echo "*** The test program compiled, but did not run. This usually means"
1140 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1141 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1142 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1143 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1144 echo "*** is required on your system"
1146 echo "*** If you have an old version installed, it is best to remove it, although"
1147 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1148 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1149 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1150 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1151 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1152 CXXFLAGS="$ac_save_CXXFLAGS"
1153 LIBS="$ac_save_LIBS"
1158 ifelse([$3], , :, [$3])
1161 AC_SUBST(GTK___CFLAGS)
1162 AC_SUBST(GTK___LIBS)
1163 rm -f conf.gtkmmtest
1166 # Configure paths for GTK--DRAW
1167 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1169 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1170 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1172 AC_DEFUN(AM_PATH_GTK__DRAW,
1174 dnl Get the cflags and libraries from the gtk__-config script
1176 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1177 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1178 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1180 if test "$GTKMM_CONFIG" != "no" ; then
1181 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1182 GTK___LIBS=`$GTKMM_CONFIG --libs`
1183 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1184 GTK___LIBS="$GTK___DLIBS"
1185 ac_save_CFLAGS="$CFLAGS"
1186 ac_save_LIBS="$LIBS"
1187 ac_save_CXXFLAGS="$CXXFLAGS"
1188 CFLAGS="$CFLAGS $GTK___CFLAGS"
1189 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1190 LIBS="$LIBS $GTK___LIBS"
1192 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1193 dnl checks the results of gtk__-config to some extent)
1205 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1206 CFLAGS="$ac_save_CFLAGS"
1207 CXXFLAGS="$ac_save_CXXFLAGS"
1208 LIBS="$ac_save_LIBS"
1212 if test "x$no_gtk__" = x ; then
1214 ifelse([$2], , :, [$2])
1219 ifelse([$3], , :, [$3])
1221 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1223 AC_SUBST(GTK___CFLAGS)
1224 AC_SUBST(GTK___LIBS)