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!"`
142 AC_SUBST(DIR_DATADIR)
144 dnl yeah, so fuck me gently with a cactus: this doesnt belong here
145 dnl Please take the person responsible for inventing shell-scripts out
146 dnl and shoot him. On behalf of the sane world, thank you.
147 dnl DIR_SHAREDSTATEDIR="foobar"
148 dnl AC_SUBST(DIR_SHAREDSTATEDIR)
150 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
153 AC_DEFUN(AC_STEPMAKE_END, [
154 AC_OUTPUT($CONFIGFILE.make:config.make.in)
156 # regular in-place build
157 # test for srcdir_build = yes ?
158 if test "$builddir" = "."; then
159 rm -f $srcdir/GNUmakefile
160 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
161 chmod 444 $srcdir/GNUmakefile
162 else # --srcdir build
164 cp $srcdir/make/srcdir.make.in GNUmakefile
165 chmod 444 GNUmakefile
169 AC_DEFUN(AC_STEPMAKE_GXX, [
171 # urg, egcs: how to check for egcs >= 1.1?
172 changequote(<<, >>)dnl
173 if $CXX --version | egrep '2\.[89]' > /dev/null ||
174 $CXX --version | grep 'egcs' > /dev/null
179 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
183 AC_DEFUN(AC_STEPMAKE_GUILE, [
184 ## First, let's just see if we can find Guile at all.
185 AC_MSG_CHECKING("for guile-config")
186 for guile_config in guile-config $target-guile-config $build-guile-config; do
187 AC_MSG_RESULT("$guile_config")
188 if ! $guile_config --version > /dev/null 2>&1 ; then
189 AC_MSG_WARN("cannot execute $guile_config")
190 AC_MSG_CHECKING("if we are cross compiling")
196 if test "$guile_config" = "error"; then
197 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
200 AC_MSG_CHECKING("Guile version")
201 need_guile_version="1.3.4"
202 need_guile_version_numeric=100304
203 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
204 guile_version_numeric=`echo $guile_version | awk -F. '
205 {if ([$]3) {last = [$]3}
207 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
208 AC_MSG_RESULT("$guile_version")
209 if test $guile_version_numeric -lt $need_guile_version_numeric
211 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
214 AC_PATH_PROG(GUILE, guile, error)
218 AC_DEFUN(AC_STEPMAKE_INIT, [
221 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
222 if test x$MY_PATCH_LEVEL != x; then
223 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
226 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
227 changequote(<<, >>)dnl
228 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
229 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
232 # No versioning on directory names of sub-packages
234 stepmake=${datadir}/stepmake
236 if test "$prefix" = "NONE"; then
237 presome=${ac_default_prefix}
239 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
241 # urg, how is this supposed to work?
242 if test "$program_prefix" = "NONE"; then
245 if test "$program_suffix" = "NONE"; then
249 AC_MSG_CHECKING(Package)
250 if test "x$PACKAGE" = "xSTEPMAKE"; then
251 AC_MSG_RESULT(Stepmake package!)
253 AC_MSG_CHECKING(builddir)
254 if test "$srcdir" = "."; then
257 absolute_builddir="`pwd`"
258 package_absolute_builddir="`dirname $absolute_builddir`"
259 package_srcdir="`dirname $srcdir`"
260 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
262 AC_MSG_RESULT($builddir)
264 (cd stepmake 2>/dev/null || mkdir stepmake)
265 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
266 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
267 AC_CONFIG_AUX_DIR(bin)
270 AC_MSG_RESULT($PACKAGE)
272 AC_MSG_CHECKING(builddir)
273 if test "$srcdir" = "."; then
277 absolute_builddir="`pwd`"
278 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
279 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
282 AC_MSG_RESULT($builddir)
283 if expr "$srcdir" : '/' > /dev/null 2>&1; then
285 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
288 AC_MSG_CHECKING(for stepmake)
289 # Check for installed stepmake
290 if test -d $stepmake; then
291 AC_MSG_RESULT($stepmake)
293 if test "$absolute_srcdir" != "yes"; then
294 stepmake='$(depth)'/$srcdir/stepmake
296 stepmake=$srcdir/stepmake
298 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
302 $HOME/usr/local/share/stepmake/bin\
303 $HOME/usr/local/lib/stepmake/bin\
304 $HOME/usr/share/stepmake/bin\
305 $HOME/usr/lib/stepmake/bin\
306 /usr/local/share/stepmake/bin\
307 /usr/local/lib/stepmake/bin\
308 /usr/share/stepmake/bin\
309 /usr/lib/stepmake/bin\
311 $srcdir/stepmake/bin\
319 AC_SUBST(PACKAGE_NAME)
320 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
321 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
323 if test "$package_depth" = "" ; then
326 package_depth="../$package_depth"
329 AC_SUBST(package_depth)
331 AUTOGENERATE="This file was automatically generated by configure"
332 AC_SUBST(AUTOGENERATE)
335 AC_ARG_ENABLE(config,
336 [ enable-config=FILE put configure settings in config-FILE.make],
337 [CONFIGSUFFIX=-$enableval])
339 CONFIGFILE=config$CONFIGSUFFIX
340 AC_SUBST(CONFIGSUFFIX)
343 AC_CHECK_PROGS(MAKE, gmake make, error)
344 AC_CHECK_PROGS(FIND, find, error)
346 dnl system supplied INSTALL is unsafe; use our own install.
348 dnl if test "$INSTALL" = "bin/install-sh"; then
349 dnl export INSTALL="\$\(depth\)/bin/install-sh"
352 AC_CHECK_PROGS(TAR, tar, error)
354 if test "x`uname`" = "xHP-UX"; then
355 AC_PATH_PROG(BASH, bash, /bin/sh)
356 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
357 AC_PATH_PROG(SHELL, bash, /bin/ksh)
359 AC_PATH_PROG(BASH, bash, /bin/sh)
365 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
368 if test $MAKE != "error" ; then
369 $MAKE -v 2> /dev/null | grep GNU > /dev/null
372 AC_STEPMAKE_WARN(Please install *GNU* make)
376 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
378 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
379 LN=cp # hard link does not work under cygnus-nt
380 LN_S='cp -r' # symbolic link does not work for native nt
388 # cygwin fixes all these things.
389 # it seems these were used because of dos-style TEXINPUTS and
390 # MFINPUTS needed for miktex.
391 # but this breaks parsing of all other cygwin/unix style paths.
393 # if your (mik)tex breaks, make a:
394 # /usr/local/bin/tex:
396 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
402 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
404 # this way, you may have buildscripts/out/lilypond-profile
405 # 'automatically' sourced from /usr/etc/profile.d/ too.
410 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
418 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
420 AC_SUBST(program_prefix)
421 AC_SUBST(program_suffix)
426 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
427 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
434 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
437 AC_ARG_ENABLE(kpathsea,
438 [ enable-kpathsea use kpathsea lib. Default: on],
439 [kpathsea_b=$enableval])
441 if test $kpathsea_b = yes; then
442 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
443 AC_CHECK_LIB(kpathsea, kpse_find_file)
444 # urg: kpse_find_tfm is a #define, how to check for this?
445 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
446 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
447 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
449 AC_MSG_CHECKING(whether to use kpathsea)
450 if test $kpathsea_b = yes; then
459 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
462 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
463 # ugh, automake: we want (and check for) bison
465 # ugh, automake: we want (and check for) flex
467 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
471 ac_cv_prog_lex_root=lex.yy
473 AC_CHECK_PROGS(BISON, bison, error)
474 AC_CHECK_PROGS(FLEX, flex, error)
475 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
476 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
478 if test $BISON != "error"; then
479 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
480 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
481 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
489 AC_DEFUN(AC_STEPMAKE_LIB, [
490 AC_CHECK_PROGS(AR, ar, error)
497 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
499 # **Never** try to set library version numbers so that they correspond
500 # to the release number of your package. This is an abuse that only
501 # fosters misunderstanding of the purpose of library versions.
503 REVISION=$PATCH_LEVEL
504 # CURRENT=$MINOR_VERSION
505 CURRENT=`expr $MINOR_VERSION + 1`
506 # AGE=$(expr $MAJOR_VERSION + 1)
513 AC_DEFUN(AC_STEPMAKE_LOCALE, [
518 AC_ARG_WITH(localedir,
519 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
520 localedir=$with_localedir,
521 localedir='${prefix}/share/locale')
524 [ with-lang=LANG use LANG as language to emit messages],
528 AC_MSG_CHECKING(language)
530 En* | en* | Am* | am* | US* | us*)
532 NL | nl | Du* | du* | Ned* | ned*)
541 if test "$lang" = "unknown" ; then
542 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
547 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
548 DIR_LOCALEDIR=${localedir}
550 if test "$prefix" = "NONE"; then
551 presome=${ac_default_prefix}
553 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
555 AC_SUBST(DIR_LOCALEDIR)
556 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
558 AC_CHECK_LIB(intl, gettext)
559 AC_CHECK_FUNCS(gettext)
562 AC_DEFUN(AC_STEPMAKE_MAN, [
563 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
564 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
565 AC_CHECK_PROGS(TBL, tbl, cat)
568 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
569 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
570 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
571 AC_MSG_CHECKING(whether msgfmt accepts -o)
572 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
573 if test "$msgfmt_output" = ""; then
577 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
579 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
581 if test ! -n "$MSGFMT"; then
582 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
586 #why has this been dropped?
587 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
588 AC_ARG_ENABLE(tex-prefix,
589 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. Default: PREFIX],
590 [TEXPREFIX=$enableval],
593 AC_ARG_ENABLE(tex-dir,
594 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
598 AC_ARG_ENABLE(mf-dir,
599 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
603 if test "x$TEXPREFIX" = xauto ; then
604 AC_TEX_PREFIX(TEXPREFIX)
606 find_texprefix=$TEXPREFIX
609 if test "x$MFDIR" = xauto; then
613 if test "x$TEXDIR" = xauto ; then
614 AC_TEX_SUBDIR(TEXDIR)
621 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
622 AC_ARG_ENABLE(tfm-path,
623 [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm. Default: use kpsewhich],
624 [tfm_path=$enableval],
627 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
628 AC_MSG_CHECKING(for tfm path)
632 if test "x$tfm_path" = xauto ; then
633 if test "x$KPSEWHICH" != "xno" ; then
634 for i in $TFM_FONTS; do
635 dir=`$KPSEWHICH tfm ${i}10.tfm`
636 TFM_PATH="$TFM_PATH `dirname $dir`"
639 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
640 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
646 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
647 AC_MSG_RESULT($TFM_PATH)
651 AC_DEFUN(AC_STEPMAKE_TEXMF, [
652 # urg, never know what names these teTeX guys will think up
654 AC_CHECK_PROGS(METAFONT, mf, no)
655 if test "x$METAFONT" = "xno"; then
656 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
660 AC_CHECK_PROGS(METAPOST, mp, no)
661 if test "x$METAPOST" = "xno"; then
662 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
667 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
668 if test "x$INIMETAFONT" = "xno"; then
669 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
670 INIMETAFONT=$INIMFONT
673 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
674 if test "x$INIMETAPOST" = "xno"; then
675 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
676 INIMETAPOST=$INIMPOST
679 AC_MSG_CHECKING(for working metafont mode)
680 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
681 for MFMODE in $modelist; do
682 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
683 if test -f mfput.tfm; then
687 AC_MSG_RESULT($MFMODE)
689 AC_MSG_CHECKING(for mfplain.mp)
691 # For now let people define these in their environments
693 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
694 AC_MSG_RESULT($MFPLAIN_MP)
696 AC_MSG_CHECKING(for inimetapost flags)
697 if test ${INIMETAPOST} = "inimp" ; then
698 : ${INIMETAPOST_FLAGS=''}
700 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
702 AC_MSG_RESULT($INIMETAPOST_FLAGS)
709 AC_SUBST(INIMETAFONT)
710 AC_SUBST(INIMETAPOST)
712 AC_SUBST(INIMETAPOST_FLAGS)
715 AC_DEFUN(AC_STEPMAKE_WARN, [
720 AC_DEFUN(AC_STEPMAKE_YODL, [
721 if test "x$YODL" = "x"; then
722 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
723 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
724 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
725 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
726 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
727 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
728 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
729 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
730 YODL2LESS_DIR='$(bindir)/'
736 AC_SUBST(YODL2LESS_DIR)
738 AC_SUBST(YODL2MSLESS)
739 AC_SUBST(YODL2TEXINFO)
741 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
743 if test "x$YODL" = "-echo no yodl"; then
744 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
748 dnl should cache result.
749 dnl should look in $prefix first.
750 dnl should probably assume TDS
752 AC_DEFUN(AC_TEX_PREFIX, [
755 AC_MSG_CHECKING(TeX/MF root dir directory)
757 find_root_prefix="$prefix"
760 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
762 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
763 find_texprefix="$find_root_prefix$postfix"
764 if test -d $find_texprefix; then
765 find_texpostfix=$postfix
770 if test "x$find_texpostfix" = x; then
771 find_texpostfix='/lib/texmf/tex'
772 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
775 find_texprefix="$find_root_prefix/$find_texpostfix"
777 # only assign if variablename not empty
778 if test x != "x[$]$1"; then
779 $1='${prefix}'/"$find_texpostfix"
781 AC_MSG_RESULT($find_texprefix)
786 # find a directory inside a prefix,
787 # $1 the prefix (expanded version)
788 # $2 variable to assign
789 # $3 the directory name
791 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
793 AC_MSG_CHECKING($4 directory)
795 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
798 if test "x$find_dirdir" = x; then
800 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
804 AC_MSG_RESULT($1/$find_dirdir)
807 # ugh. this is hopeless
808 AC_DEFUN(AC_KPSE_TEX_DIR, [
809 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
810 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
812 if test -w "$kpse_syspaths";
814 dir=`echo $kpse_syspaths | head -1`
816 dir=`echo $kpse_paths | grep -v '!'| head -1`
818 if test "$prefix" = "NONE"; then
819 local_prefix=$ac_default_prefix
820 local_prefix_quote='${prefix}'
824 local_prefix_quote=$prefix
826 echo $local_prefix_quote = $local_prefix
828 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
831 AC_DEFUN(AC_TEX_SUBDIR, [
832 dnl AC_REQUIRE([AC_TEX_PREFIX])
833 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
837 AC_DEFUN(AC_MF_SUBDIR, [
838 dnl AC_REQUIRE([AC_TEX_PREFIX])
839 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
843 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
844 result="`echo \"$1\" | grep echo`"
845 if test "x$1" = "xerror" -o "x$result" != "x"; then
846 AC_STEPMAKE_WARN(can\'t find $2. $3)
850 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
852 dnl This macro runs the `guile-config' script, installed with Guile,
853 dnl to find out where Guile's header files and libraries are
854 dnl installed. It sets two variables, marked for substitution, as
857 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
858 dnl code that uses Guile header files. This is almost
859 dnl always just a -I flag.
861 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
862 dnl program against Guile. This includes `-lguile' for
863 dnl the Guile library itself, any libraries that Guile
864 dnl itself requires (like -lqthreads), and so on. It may
865 dnl also include a -L flag to tell the compiler where to
866 dnl find the libraries.
868 AC_DEFUN([GUILE_FLAGS],[
869 ## The GUILE_FLAGS macro.
870 AC_MSG_CHECKING(for Guile)
871 if ! $guile_config link > /dev/null ; then
872 AC_MSG_RESULT("cannot execute $guile_config")
873 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
876 GUILE_CFLAGS="`$guile_config compile`"
877 GUILE_LDFLAGS="`$guile_config link`"
878 AC_SUBST(GUILE_CFLAGS)
879 AC_SUBST(GUILE_LDFLAGS)
884 # Configure paths for GTK+
885 # Owen Taylor 97-11-3
887 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
888 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
890 AC_DEFUN(AM_PATH_GTK,
892 dnl Get the cflags and libraries from the gtk-config script
894 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
895 min_gtk_version=ifelse([$1], ,1.1.1,$1)
896 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
898 if test "$GTK_CONFIG" != "no" ; then
899 GTK_CFLAGS=`$GTK_CONFIG --cflags`
900 GTK_LIBS=`$GTK_CONFIG --libs`
901 ac_save_CFLAGS="$CFLAGS"
903 ac_save_CXXFLAGS="$CXXFLAGS"
904 CFLAGS="$CFLAGS $GTK_CFLAGS"
905 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
906 LIBS="$LIBS $GTK_LIBS"
908 dnl Now check if the installed GTK is sufficiently new. (Also sanity
909 dnl checks the results of gtk-config to some extent)
918 int major, minor, micro;
920 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
921 printf("%s, bad version string\n", "$min_gtk_version");
925 return !((gtk_major_version > major) ||
926 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
927 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
929 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
930 CFLAGS="$ac_save_CFLAGS"
931 CXXFLAGS="$ac_save_CXXFLAGS"
936 if test "x$no_gtk" = x ; then
938 ifelse([$2], , :, [$2])
943 ifelse([$3], , :, [$3])
945 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
952 # Configure paths for GTK--
953 # Erik Andersen 30 May 1998
954 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
956 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
957 dnl to be used as follows:
958 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
961 dnl Get the cflags and libraries from the gtkmm-config script
963 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
964 Prefix where GTK-- is installed (optional)],
965 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
966 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
967 Exec prefix where GTK-- is installed (optional)],
968 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
969 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
970 , enable_gtkmmtest=yes)
972 if test x$gtkmm_config_exec_prefix != x ; then
973 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
974 if test x${GTKMM_CONFIG+set} != xset ; then
975 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
978 if test x$gtkmm_config_prefix != x ; then
979 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
980 if test x${GTKMM_CONFIG+set} != xset ; then
981 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
986 AC_DEFUN(AM_PATH_GTKMM,
990 dnl Check if the installed GTK-- is sufficiently new.
992 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
993 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
995 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
997 if test "$GTKMM_CONFIG" = "no" ; then
1003 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1004 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1005 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1006 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1007 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1008 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1009 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1010 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1011 if test "x$enable_gtkmmtest" = "xyes" ; then
1012 ac_save_CXXFLAGS="$CXXFLAGS"
1013 ac_save_LIBS="$LIBS"
1014 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1015 LIBS="$LIBS $GTK___LIBS"
1017 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1018 dnl checks the results of gtkmm-config to some extent
1020 rm -f conf.gtkmmtest
1029 int major, minor, micro;
1032 system ("touch conf.gtkmmtest");
1034 /* HP/UX 0 (%@#!) writes to sscanf strings */
1035 tmp_version = g_strdup("$min_gtkmm_version");
1036 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1037 printf("%s, bad version string\n", "$min_gtkmm_version");
1041 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1042 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1043 (gtkmm_micro_version != $gtkmm_config_micro_version))
1045 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1046 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1047 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1048 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1049 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1050 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1051 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1052 printf("*** required on your system.\n");
1053 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1054 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1055 printf("*** before re-running configure\n");
1057 /* GTK-- does not have the GTKMM_*_VERSION constants */
1059 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1060 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1061 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1063 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1064 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1065 printf("*** library (version %d.%d.%d)\n",
1066 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1071 if ((gtkmm_major_version > major) ||
1072 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1073 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1079 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1080 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1081 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1082 major, minor, micro);
1083 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1085 printf("*** If you have already installed a sufficiently new version, this error\n");
1086 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1087 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1088 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1089 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1090 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1091 printf("*** so that the correct libraries are found at run-time))\n");
1096 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1097 CXXFLAGS="$ac_save_CXXFLAGS"
1098 LIBS="$ac_save_LIBS"
1101 if test "x$no_gtkmm" = x ; then
1103 ifelse([$2], , :, [$2])
1106 if test "$GTKMM_CONFIG" = "no" ; then
1107 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1108 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1109 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1110 echo "*** full path to gtk-config."
1111 echo "*** The gtkmm-config script was not available in GTK-- versions"
1112 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1113 echo "*** version to 0.9.12 or newer"
1115 if test -f conf.gtkmmtest ; then
1118 echo "*** Could not run GTK-- test program, checking why..."
1119 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1120 LIBS="$LIBS $GTK___LIBS"
1124 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1125 [ echo "*** The test program compiled, but did not run. This usually means"
1126 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1127 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1128 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1129 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1130 echo "*** is required on your system"
1132 echo "*** If you have an old version installed, it is best to remove it, although"
1133 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1134 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1135 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1136 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1137 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1138 CXXFLAGS="$ac_save_CXXFLAGS"
1139 LIBS="$ac_save_LIBS"
1144 ifelse([$3], , :, [$3])
1147 AC_SUBST(GTK___CFLAGS)
1148 AC_SUBST(GTK___LIBS)
1149 rm -f conf.gtkmmtest
1152 # Configure paths for GTK--DRAW
1153 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1155 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1156 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1158 AC_DEFUN(AM_PATH_GTK__DRAW,
1160 dnl Get the cflags and libraries from the gtk__-config script
1162 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1163 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1164 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1166 if test "$GTKMM_CONFIG" != "no" ; then
1167 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1168 GTK___LIBS=`$GTKMM_CONFIG --libs`
1169 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1170 GTK___LIBS="$GTK___DLIBS"
1171 ac_save_CFLAGS="$CFLAGS"
1172 ac_save_LIBS="$LIBS"
1173 ac_save_CXXFLAGS="$CXXFLAGS"
1174 CFLAGS="$CFLAGS $GTK___CFLAGS"
1175 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1176 LIBS="$LIBS $GTK___LIBS"
1178 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1179 dnl checks the results of gtk__-config to some extent)
1191 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1192 CFLAGS="$ac_save_CFLAGS"
1193 CXXFLAGS="$ac_save_CXXFLAGS"
1194 LIBS="$ac_save_LIBS"
1198 if test "x$no_gtk__" = x ; then
1200 ifelse([$2], , :, [$2])
1205 ifelse([$3], , :, [$3])
1207 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1209 AC_SUBST(GTK___CFLAGS)
1210 AC_SUBST(GTK___LIBS)