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
20 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
21 LDFLAGS=${LDFLAGS:-""}
27 AC_ARG_ENABLE(checking,
28 [ enable-checking set runtime checks (assert calls). Default: on],
29 [checking_b=$enableval] )
31 # actually, the default is: tja='-O' to get inlining...
34 #actually, that sucks.
35 # tja looks like a typo. Default is optimisation off. --hwn
37 AC_ARG_ENABLE(optimise,
38 [ enable-optimise use maximal speed optimisations. Default: off],
39 [optimise_b=$enableval])
41 AC_ARG_ENABLE(profiling,
42 [ enable-profiling compile with gprof support. Default: off],
43 [profile_b=$enableval])
45 AC_ARG_ENABLE(debugging,
46 [ enable-debugging set debug info. Default: on],
49 AC_ARG_ENABLE(mingw-prefix,
50 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
51 [MINGWPREFIX=$enableval],
54 if test "$checking_b" = no; then
57 DEFINES="$DEFINES -DNDEBUG"
60 if test "$optimise_b" = yes; then
61 OPTIMIZE="-O2 -finline-functions"
64 if test "$optimise_b" = no; then
68 if test $profile_b = yes; then
70 OPTIMIZE="$OPTIMIZE -pg"
73 if test $debug_b = yes; then
74 OPTIMIZE="$OPTIMIZE -g"
77 # however, C++ support in mingw32 v 0.1.4 is still flaky
78 if test x$MINGWPREFIX != xno; then
79 ICFLAGS="-I$MINGWPREFIX/include"
80 ILDFLAGS="-$MINGWPREFIX/lib"
87 CFLAGS="$CFLAGS $OPTIMIZE"
88 CPPFLAGS=${CPPFLAGS:-""}
89 AC_SUBST(cross_compiling)
99 AC_DEFUN(AC_STEPMAKE_CXX, [
103 AC_CHECK_HEADER(FlexLexer.h, true,
104 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
106 CPPFLAGS="$CPPFLAGS $DEFINES"
107 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
108 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
116 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
117 AC_CACHE_CHECK([whether explicit instantiation is needed],
118 lily_cv_need_explicit_instantiation,
120 template <class T> struct foo { static int baz; };
121 template <class T> int foo<T>::baz = 1;
122 ], [ return foo<int>::baz; ],
123 lily_cv_need_explicit_instantiation=no,
124 lily_cv_need_explicit_instantiation=yes))
125 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
126 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
130 AC_DEFUN(AC_STEPMAKE_DATADIR, [
131 if test "$datadir" = "\${prefix}/share"; then
132 datadir='${prefix}/share/'$package
134 DIR_DATADIR=${datadir}
136 if test "$prefix" = "NONE"; then
137 presome=${ac_default_prefix}
139 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
141 AC_SUBST(DIR_DATADIR)
142 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
145 AC_DEFUN(AC_STEPMAKE_END, [
146 AC_OUTPUT($CONFIGFILE.make:config.make.in)
148 rm -f $srcdir/GNUmakefile
149 cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
150 chmod 444 $srcdir/GNUmakefile
151 if test "$builddir" != "."; then
153 cp $srcdir/make/srcdir.make.in GNUmakefile
154 chmod 444 GNUmakefile
158 AC_DEFUN(AC_STEPMAKE_GXX, [
160 # urg, egcs: how to check for egcs >= 1.1?
161 changequote(<<, >>)dnl
162 if $CXX --version | egrep '2\.[89]' > /dev/null ||
163 $CXX --version | grep 'egcs' > /dev/null
168 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
172 AC_DEFUN(AC_STEPMAKE_GUILE, [
173 ## First, let's just see if we can find Guile at all.
174 AC_MSG_CHECKING("for guile-config")
175 for guile_config in guile-config $target-guile-config $build-guile-config; do
176 AC_MSG_RESULT("$guile_config")
177 if ! $guile_config --version > /dev/null 2>&1 ; then
178 AC_MSG_WARN("cannot execute $guile_config")
179 AC_MSG_CHECKING("if we are cross compiling")
185 if test "$guile_config" = "error"; then
186 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
189 AC_MSG_CHECKING("Guile version")
190 need_guile_version="1.3.4"
191 need_guile_version_numeric=100304
192 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
193 guile_version_numeric=`echo $guile_version | awk -F. '
194 {if ([$]3) {last = [$]3}
196 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
197 AC_MSG_RESULT("$guile_version")
198 if test $guile_version_numeric -lt $need_guile_version_numeric
200 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
203 AC_PATH_PROG(GUILE, guile, error)
207 AC_DEFUN(AC_STEPMAKE_INIT, [
210 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
211 if test x$MY_PATCH_LEVEL != x; then
212 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
215 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
216 changequote(<<, >>)dnl
217 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
218 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
221 # No versioning on directory names of sub-packages
223 stepmake=${datadir}/stepmake
225 if test "$prefix" = "NONE"; then
226 presome=${ac_default_prefix}
228 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
230 # urg, how is this supposed to work?
231 if test "$program_prefix" = "NONE"; then
234 if test "$program_suffix" = "NONE"; then
238 AC_MSG_CHECKING(Package)
239 if test "x$PACKAGE" = "xSTEPMAKE"; then
240 AC_MSG_RESULT(Stepmake package!)
242 #if test "x$builddir" != "x"; then
243 # builddir="../$builddir"
247 if test "$srcdir" != "."; then
248 absolute_builddir="`pwd`"
249 package_absolute_builddir="`dirname $absolute_builddir`"
250 package_srcdir="`dirname $srcdir`"
251 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
256 (cd stepmake 2>/dev/null || mkdir stepmake)
257 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
258 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
259 AC_CONFIG_AUX_DIR(bin)
262 AC_MSG_RESULT($PACKAGE)
264 if test "$srcdir" != "."; then
265 absolute_builddir="`pwd`"
266 builddir="`dirname $srcdir`/`basename $absolute_builddir`"
271 AC_MSG_CHECKING(for stepmake)
272 # Check for installed stepmake
273 if test -d $stepmake; then
274 AC_MSG_RESULT($stepmake)
276 stepmake='$(depth)'/$srcdir/stepmake
277 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
280 $HOME/usr/local/share/stepmake/bin\
281 $HOME/usr/local/lib/stepmake/bin\
282 $HOME/usr/share/stepmake/bin\
283 $HOME/usr/lib/stepmake/bin\
284 /usr/local/share/stepmake/bin\
285 /usr/local/lib/stepmake/bin\
286 /usr/share/stepmake/bin\
287 /usr/lib/stepmake/bin\
289 $srcdir/stepmake/bin\
297 AC_SUBST(PACKAGE_NAME)
298 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
299 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
301 if test "$package_depth" = "" ; then
304 package_depth="../$package_depth"
307 AC_SUBST(package_depth)
309 AUTOGENERATE="This file was automatically generated by configure"
310 AC_SUBST(AUTOGENERATE)
313 AC_ARG_ENABLE(config,
314 [ enable-config=FILE put configure settings in config-FILE.make],
315 [CONFIGSUFFIX=-$enableval])
317 CONFIGFILE=config$CONFIGSUFFIX
318 AC_SUBST(CONFIGSUFFIX)
321 AC_CHECK_PROGS(MAKE, gmake make, error)
322 AC_CHECK_PROGS(FIND, find, error)
324 dnl system supplied INSTALL is unsafe; use our own install.
326 dnl if test "$INSTALL" = "bin/install-sh"; then
327 dnl export INSTALL="\$\(depth\)/bin/install-sh"
330 AC_CHECK_PROGS(TAR, tar, error)
332 if test "x`uname`" = "xHP-UX"; then
333 AC_PATH_PROG(BASH, bash, /bin/sh)
334 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
335 AC_PATH_PROG(SHELL, bash, /bin/ksh)
337 AC_PATH_PROG(BASH, bash, /bin/sh)
343 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
346 if test $MAKE != "error" ; then
347 $MAKE -v 2> /dev/null | grep GNU > /dev/null
350 AC_STEPMAKE_WARN(Please install *GNU* make)
354 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
356 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
357 LN=cp # hard link does not work under cygnus-nt
358 LN_S='cp -r' # symbolic link does not work for native nt
365 # cygwin fixes all these things.
366 # it seems these were used because of dos-style TEXINPUTS and
367 # MFINPUTS needed for miktex.
368 # but this breaks parsing of all other cygwin/unix style paths.
370 # if your (mik)tex breaks, make a:
371 # /usr/local/bin/tex:
373 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
379 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
381 # this way, you may have buildscripts/out/lilypond-profile
382 # 'automatically' sourced from /usr/etc/profile.d/ too.
386 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
393 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
395 AC_SUBST(program_prefix)
396 AC_SUBST(program_suffix)
401 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
402 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
409 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
412 AC_ARG_ENABLE(kpathsea,
413 [ enable-kpathsea use kpathsea lib. Default: on],
414 [kpathsea_b=$enableval])
416 if test $kpathsea_b = yes; then
417 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
418 AC_CHECK_LIB(kpathsea, kpse_find_file)
419 # urg: kpse_find_tfm is a #define, how to check for this?
420 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
421 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
422 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
424 AC_MSG_CHECKING(whether to use kpathsea)
425 if test $kpathsea_b = yes; then
434 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
437 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
438 # ugh, automake: we want (and check for) bison
440 # ugh, automake: we want (and check for) flex
442 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
446 ac_cv_prog_lex_root=lex.yy
448 AC_CHECK_PROGS(BISON, bison, error)
449 AC_CHECK_PROGS(FLEX, flex, error)
450 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
451 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
453 if test $BISON != "error"; then
454 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
455 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
456 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
464 AC_DEFUN(AC_STEPMAKE_LIB, [
465 AC_CHECK_PROGS(AR, ar, error)
472 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
474 # **Never** try to set library version numbers so that they correspond
475 # to the release number of your package. This is an abuse that only
476 # fosters misunderstanding of the purpose of library versions.
478 REVISION=$PATCH_LEVEL
479 # CURRENT=$MINOR_VERSION
480 CURRENT=`expr $MINOR_VERSION + 1`
481 # AGE=$(expr $MAJOR_VERSION + 1)
488 AC_DEFUN(AC_STEPMAKE_LOCALE, [
493 AC_ARG_WITH(localedir,
494 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
495 localedir=$with_localedir,
496 localedir='${prefix}/share/locale')
499 [ with-lang=LANG use LANG as language to emit messages],
503 AC_MSG_CHECKING(language)
505 En* | en* | Am* | am* | US* | us*)
507 NL | nl | Du* | du* | Ned* | ned*)
516 if test "$lang" = "unknown" ; then
517 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
522 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
523 DIR_LOCALEDIR=${localedir}
525 if test "$prefix" = "NONE"; then
526 presome=${ac_default_prefix}
528 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
530 AC_SUBST(DIR_LOCALEDIR)
531 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
533 AC_CHECK_LIB(intl, gettext)
534 AC_CHECK_FUNCS(gettext)
537 AC_DEFUN(AC_STEPMAKE_MAN, [
538 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
539 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
540 AC_CHECK_PROGS(TBL, tbl, cat)
543 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
544 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
545 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
546 AC_MSG_CHECKING(whether msgfmt accepts -o)
547 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
548 if test "$msgfmt_output" = ""; then
552 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
554 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
556 if test ! -n "$MSGFMT"; then
557 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
561 #why has this been dropped?
562 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
563 AC_ARG_ENABLE(tex-prefix,
564 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. Default: PREFIX],
565 [TEXPREFIX=$enableval],
568 AC_ARG_ENABLE(tex-dir,
569 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
573 AC_ARG_ENABLE(mf-dir,
574 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
578 if test "x$TEXPREFIX" = xauto ; then
579 AC_TEX_PREFIX(TEXPREFIX)
581 find_texprefix=$TEXPREFIX
584 if test "x$MFDIR" = xauto; then
588 if test "x$TEXDIR" = xauto ; then
589 AC_TEX_SUBDIR(TEXDIR)
596 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
597 AC_ARG_ENABLE(tfm-path,
598 [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm. Default: use kpsewhich],
599 [tfm_path=$enableval],
602 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
603 AC_MSG_CHECKING(for tfm path)
607 if test "x$tfm_path" = xauto ; then
608 if test "x$KPSEWHICH" != "xno" ; then
609 for i in $TFM_FONTS; do
610 dir=`$KPSEWHICH tfm ${i}10.tfm`
611 TFM_PATH="$TFM_PATH `dirname $dir`"
614 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
615 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
621 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
622 AC_MSG_RESULT($TFM_PATH)
626 AC_DEFUN(AC_STEPMAKE_TEXMF, [
627 # urg, never know what names these teTeX guys will think up
629 AC_CHECK_PROGS(METAFONT, mf, no)
630 if test "x$METAFONT" = "xno"; then
631 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
635 AC_CHECK_PROGS(METAPOST, mp, no)
636 if test "x$METAPOST" = "xno"; then
637 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
642 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
643 if test "x$INIMETAFONT" = "xno"; then
644 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
645 INIMETAFONT=$INIMFONT
648 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
649 if test "x$INIMETAPOST" = "xno"; then
650 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
651 INIMETAPOST=$INIMPOST
654 AC_MSG_CHECKING(for working metafont mode)
655 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
656 for MFMODE in $modelist; do
657 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
658 if test -f mfput.tfm; then
662 AC_MSG_RESULT($MFMODE)
664 AC_MSG_CHECKING(for mfplain.mp)
666 # For now let people define these in their environments
668 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
669 AC_MSG_RESULT($MFPLAIN_MP)
671 AC_MSG_CHECKING(for inimetapost flags)
672 if test ${INIMETAPOST} = "inimp" ; then
673 : ${INIMETAPOST_FLAGS=''}
675 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
677 AC_MSG_RESULT($INIMETAPOST_FLAGS)
684 AC_SUBST(INIMETAFONT)
685 AC_SUBST(INIMETAPOST)
687 AC_SUBST(INIMETAPOST_FLAGS)
690 AC_DEFUN(AC_STEPMAKE_WARN, [
695 AC_DEFUN(AC_STEPMAKE_YODL, [
696 if test "x$YODL" = "x"; then
697 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
698 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
699 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
700 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
701 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
702 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
703 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
704 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
705 YODL2LESS_DIR='$(bindir)/'
711 AC_SUBST(YODL2LESS_DIR)
713 AC_SUBST(YODL2MSLESS)
714 AC_SUBST(YODL2TEXINFO)
716 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
718 if test "x$YODL" = "-echo no yodl"; then
719 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
723 dnl should cache result.
724 dnl should look in $prefix first.
725 dnl should probably assume TDS
727 AC_DEFUN(AC_TEX_PREFIX, [
730 AC_MSG_CHECKING(TeX/MF root dir directory)
732 find_root_prefix="$prefix"
735 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
737 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
738 find_texprefix="$find_root_prefix$postfix"
739 if test -d $find_texprefix; then
740 find_texpostfix=$postfix
745 if test "x$find_texpostfix" = x; then
746 find_texpostfix='/lib/texmf/tex'
747 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
750 find_texprefix="$find_root_prefix/$find_texpostfix"
752 # only assign if variablename not empty
753 if test x != "x[$]$1"; then
754 $1='${prefix}'/"$find_texpostfix"
756 AC_MSG_RESULT($find_texprefix)
761 # find a directory inside a prefix,
762 # $1 the prefix (expanded version)
763 # $2 variable to assign
764 # $3 the directory name
766 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
768 AC_MSG_CHECKING($4 directory)
770 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
773 if test "x$find_dirdir" = x; then
775 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
779 AC_MSG_RESULT($1/$find_dirdir)
782 # ugh. this is hopeless
783 AC_DEFUN(AC_KPSE_TEX_DIR, [
784 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
785 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
787 if test -w "$kpse_syspaths";
789 dir=`echo $kpse_syspaths | head -1`
791 dir=`echo $kpse_paths | grep -v '!'| head -1`
793 if test "$prefix" = "NONE"; then
794 local_prefix=$ac_default_prefix
795 local_prefix_quote='${prefix}'
799 local_prefix_quote=$prefix
801 echo $local_prefix_quote = $local_prefix
803 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
806 AC_DEFUN(AC_TEX_SUBDIR, [
807 dnl AC_REQUIRE([AC_TEX_PREFIX])
808 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
812 AC_DEFUN(AC_MF_SUBDIR, [
813 dnl AC_REQUIRE([AC_TEX_PREFIX])
814 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
818 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
819 result="`echo \"$1\" | grep echo`"
820 if test "x$1" = "xerror" -o "x$result" != "x"; then
821 AC_STEPMAKE_WARN(can\'t find $2. $3)
825 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
827 dnl This macro runs the `guile-config' script, installed with Guile,
828 dnl to find out where Guile's header files and libraries are
829 dnl installed. It sets two variables, marked for substitution, as
832 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
833 dnl code that uses Guile header files. This is almost
834 dnl always just a -I flag.
836 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
837 dnl program against Guile. This includes `-lguile' for
838 dnl the Guile library itself, any libraries that Guile
839 dnl itself requires (like -lqthreads), and so on. It may
840 dnl also include a -L flag to tell the compiler where to
841 dnl find the libraries.
843 AC_DEFUN([GUILE_FLAGS],[
844 ## The GUILE_FLAGS macro.
845 AC_MSG_CHECKING(for Guile)
846 if ! $guile_config link > /dev/null ; then
847 AC_MSG_RESULT("cannot execute $guile_config")
848 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
851 GUILE_CFLAGS="`$guile_config compile`"
852 GUILE_LDFLAGS="`$guile_config link`"
853 AC_SUBST(GUILE_CFLAGS)
854 AC_SUBST(GUILE_LDFLAGS)
859 # Configure paths for GTK+
860 # Owen Taylor 97-11-3
862 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
863 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
865 AC_DEFUN(AM_PATH_GTK,
867 dnl Get the cflags and libraries from the gtk-config script
869 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
870 min_gtk_version=ifelse([$1], ,1.1.1,$1)
871 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
873 if test "$GTK_CONFIG" != "no" ; then
874 GTK_CFLAGS=`$GTK_CONFIG --cflags`
875 GTK_LIBS=`$GTK_CONFIG --libs`
876 ac_save_CFLAGS="$CFLAGS"
878 ac_save_CXXFLAGS="$CXXFLAGS"
879 CFLAGS="$CFLAGS $GTK_CFLAGS"
880 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
881 LIBS="$LIBS $GTK_LIBS"
883 dnl Now check if the installed GTK is sufficiently new. (Also sanity
884 dnl checks the results of gtk-config to some extent)
893 int major, minor, micro;
895 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
896 printf("%s, bad version string\n", "$min_gtk_version");
900 return !((gtk_major_version > major) ||
901 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
902 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
904 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
905 CFLAGS="$ac_save_CFLAGS"
906 CXXFLAGS="$ac_save_CXXFLAGS"
911 if test "x$no_gtk" = x ; then
913 ifelse([$2], , :, [$2])
918 ifelse([$3], , :, [$3])
920 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
927 # Configure paths for GTK--
928 # Erik Andersen 30 May 1998
929 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
931 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
932 dnl to be used as follows:
933 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
936 dnl Get the cflags and libraries from the gtkmm-config script
938 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
939 Prefix where GTK-- is installed (optional)],
940 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
941 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
942 Exec prefix where GTK-- is installed (optional)],
943 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
944 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
945 , enable_gtkmmtest=yes)
947 if test x$gtkmm_config_exec_prefix != x ; then
948 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
949 if test x${GTKMM_CONFIG+set} != xset ; then
950 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
953 if test x$gtkmm_config_prefix != x ; then
954 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
955 if test x${GTKMM_CONFIG+set} != xset ; then
956 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
961 AC_DEFUN(AM_PATH_GTKMM,
965 dnl Check if the installed GTK-- is sufficiently new.
967 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
968 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
970 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
972 if test "$GTKMM_CONFIG" = "no" ; then
978 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
979 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
980 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
981 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
982 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
983 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
984 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
985 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
986 if test "x$enable_gtkmmtest" = "xyes" ; then
987 ac_save_CXXFLAGS="$CXXFLAGS"
989 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
990 LIBS="$LIBS $GTK___LIBS"
992 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
993 dnl checks the results of gtkmm-config to some extent
1004 int major, minor, micro;
1007 system ("touch conf.gtkmmtest");
1009 /* HP/UX 0 (%@#!) writes to sscanf strings */
1010 tmp_version = g_strdup("$min_gtkmm_version");
1011 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1012 printf("%s, bad version string\n", "$min_gtkmm_version");
1016 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1017 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1018 (gtkmm_micro_version != $gtkmm_config_micro_version))
1020 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1021 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1022 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1023 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1024 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1025 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1026 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1027 printf("*** required on your system.\n");
1028 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1029 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1030 printf("*** before re-running configure\n");
1032 /* GTK-- does not have the GTKMM_*_VERSION constants */
1034 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1035 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1036 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1038 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1039 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1040 printf("*** library (version %d.%d.%d)\n",
1041 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1046 if ((gtkmm_major_version > major) ||
1047 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1048 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1054 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1055 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1056 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1057 major, minor, micro);
1058 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1060 printf("*** If you have already installed a sufficiently new version, this error\n");
1061 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1062 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1063 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1064 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1065 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1066 printf("*** so that the correct libraries are found at run-time))\n");
1071 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1072 CXXFLAGS="$ac_save_CXXFLAGS"
1073 LIBS="$ac_save_LIBS"
1076 if test "x$no_gtkmm" = x ; then
1078 ifelse([$2], , :, [$2])
1081 if test "$GTKMM_CONFIG" = "no" ; then
1082 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1083 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1084 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1085 echo "*** full path to gtk-config."
1086 echo "*** The gtkmm-config script was not available in GTK-- versions"
1087 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1088 echo "*** version to 0.9.12 or newer"
1090 if test -f conf.gtkmmtest ; then
1093 echo "*** Could not run GTK-- test program, checking why..."
1094 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1095 LIBS="$LIBS $GTK___LIBS"
1099 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1100 [ echo "*** The test program compiled, but did not run. This usually means"
1101 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1102 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1103 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1104 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1105 echo "*** is required on your system"
1107 echo "*** If you have an old version installed, it is best to remove it, although"
1108 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1109 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1110 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1111 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1112 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1113 CXXFLAGS="$ac_save_CXXFLAGS"
1114 LIBS="$ac_save_LIBS"
1119 ifelse([$3], , :, [$3])
1122 AC_SUBST(GTK___CFLAGS)
1123 AC_SUBST(GTK___LIBS)
1124 rm -f conf.gtkmmtest
1127 # Configure paths for GTK--DRAW
1128 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1130 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1131 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1133 AC_DEFUN(AM_PATH_GTK__DRAW,
1135 dnl Get the cflags and libraries from the gtk__-config script
1137 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1138 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1139 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1141 if test "$GTKMM_CONFIG" != "no" ; then
1142 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1143 GTK___LIBS=`$GTKMM_CONFIG --libs`
1144 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1145 GTK___LIBS="$GTK___DLIBS"
1146 ac_save_CFLAGS="$CFLAGS"
1147 ac_save_LIBS="$LIBS"
1148 ac_save_CXXFLAGS="$CXXFLAGS"
1149 CFLAGS="$CFLAGS $GTK___CFLAGS"
1150 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1151 LIBS="$LIBS $GTK___LIBS"
1153 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1154 dnl checks the results of gtk__-config to some extent)
1166 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1167 CFLAGS="$ac_save_CFLAGS"
1168 CXXFLAGS="$ac_save_CXXFLAGS"
1169 LIBS="$ac_save_LIBS"
1173 if test "x$no_gtk__" = x ; then
1175 ifelse([$2], , :, [$2])
1180 ifelse([$3], , :, [$3])
1182 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1184 AC_SUBST(GTK___CFLAGS)
1185 AC_SUBST(GTK___LIBS)