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 AC_ARG_ENABLE(debugging,
32 [ --enable-debugging compile with debugging info. Default: on],
35 AC_ARG_ENABLE(optimise,
36 [ --enable-optimise use maximal speed optimisations. Default: off],
37 [optimise_b=$enableval])
39 AC_ARG_ENABLE(profiling,
40 [ --enable-profiling compile with gprof support. Default: off],
41 [profile_b=$enableval])
43 AC_ARG_ENABLE(mingw-prefix,
44 [ --enable-mingw-prefix=DIR
45 set the mingw32 directory (standalone windows32 exes)],
46 [MINGWPREFIX=$enableval],
49 if test "$checking_b" = no; then
52 DEFINES="$DEFINES -DNDEBUG"
55 if test "$optimise_b" = yes; then
56 OPTIMIZE="-O2 -finline-functions"
59 if test "$optimise_b" = no; then
63 if test $profile_b = yes; then
65 OPTIMIZE="$OPTIMIZE -pg"
68 if test $debug_b = yes; then
69 OPTIMIZE="$OPTIMIZE -g"
72 # however, C++ support in mingw32 v 0.1.4 is still flaky
73 if test x$MINGWPREFIX != xno; then
74 ICFLAGS="-I$MINGWPREFIX/include"
75 ILDFLAGS="-$MINGWPREFIX/lib"
82 CFLAGS="$CFLAGS $OPTIMIZE"
83 CPPFLAGS=${CPPFLAGS:-""}
84 AC_SUBST(cross_compiling)
94 AC_DEFUN(AC_STEPMAKE_CXX, [
98 AC_CHECK_HEADER(FlexLexer.h, true,
99 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
101 CPPFLAGS="$CPPFLAGS $DEFINES"
102 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
103 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
111 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
112 AC_CACHE_CHECK([whether explicit instantiation is needed],
113 lily_cv_need_explicit_instantiation,
115 template <class T> struct foo { static int baz; };
116 template <class T> int foo<T>::baz = 1;
117 ], [ return foo<int>::baz; ],
118 lily_cv_need_explicit_instantiation=no,
119 lily_cv_need_explicit_instantiation=yes))
120 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
121 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
125 AC_DEFUN(AC_STEPMAKE_DATADIR, [
126 if test "$datadir" = "\${prefix}/share"; then
127 datadir='${prefix}/share/'$package
129 DIR_DATADIR=${datadir}
131 if test "$prefix" = "NONE"; then
132 presome=${ac_default_prefix}
134 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
137 AC_SUBST(DIR_DATADIR)
139 dnl yeah, so fuck me gently with a cactus: this doesnt belong here
140 dnl Please take the person responsible for inventing shell-scripts out
141 dnl and shoot him. On behalf of the sane world, thank you.
142 dnl DIR_SHAREDSTATEDIR="foobar"
143 dnl AC_SUBST(DIR_SHAREDSTATEDIR)
145 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
148 AC_DEFUN(AC_STEPMAKE_END, [
149 AC_OUTPUT($CONFIGFILE.make:config.make.in)
151 # regular in-place build
152 # test for srcdir_build = yes ?
153 if test "$builddir" = "."; then
154 rm -f $srcdir/GNUmakefile
155 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
156 chmod 444 $srcdir/GNUmakefile
157 else # --srcdir build
159 cp $srcdir/make/srcdir.make.in GNUmakefile
160 chmod 444 GNUmakefile
164 AC_DEFUN(AC_STEPMAKE_GXX, [
166 # urg, egcs: how to check for egcs >= 1.1?
167 changequote(<<, >>)dnl
168 if $CXX --version | egrep '2\.[89]' > /dev/null ||
169 $CXX --version | grep 'egcs' > /dev/null
174 AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
178 AC_DEFUN(AC_STEPMAKE_GUILE, [
179 ## First, let's just see if we can find Guile at all.
180 AC_MSG_CHECKING("for guile-config")
181 for guile_config in guile-config $target-guile-config $build-guile-config; do
182 AC_MSG_RESULT("$guile_config")
183 if ! $guile_config --version > /dev/null 2>&1 ; then
184 AC_MSG_WARN("cannot execute $guile_config")
185 AC_MSG_CHECKING("if we are cross compiling")
191 if test "$guile_config" = "error"; then
192 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
195 AC_MSG_CHECKING("Guile version")
196 need_guile_version="1.3.4"
197 need_guile_version_numeric=100304
198 guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
199 guile_version_numeric=`echo $guile_version | awk -F. '
200 {if ([$]3) {last = [$]3}
202 {printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
203 AC_MSG_RESULT("$guile_version")
204 if test $guile_version_numeric -lt $need_guile_version_numeric
206 AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
209 AC_PATH_PROG(GUILE, guile, error)
213 AC_DEFUN(AC_STEPMAKE_INIT, [
216 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
217 if test x$MY_PATCH_LEVEL != x; then
218 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
221 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
222 changequote(<<, >>)dnl
223 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
224 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
227 # No versioning on directory names of sub-packages
229 stepmake=${datadir}/stepmake
231 if test "$prefix" = "NONE"; then
232 presome=${ac_default_prefix}
234 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
236 # urg, how is this supposed to work?
237 if test "$program_prefix" = "NONE"; then
240 if test "$program_suffix" = "NONE"; then
244 AC_MSG_CHECKING(Package)
245 if test "x$PACKAGE" = "xSTEPMAKE"; then
246 AC_MSG_RESULT(Stepmake package!)
248 AC_MSG_CHECKING(builddir)
249 if test "$srcdir" = "."; then
252 absolute_builddir="`pwd`"
253 package_absolute_builddir="`dirname $absolute_builddir`"
254 package_srcdir="`dirname $srcdir`"
255 builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
257 AC_MSG_RESULT($builddir)
259 (cd stepmake 2>/dev/null || mkdir stepmake)
260 (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
261 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
262 AC_CONFIG_AUX_DIR(bin)
265 AC_MSG_RESULT($PACKAGE)
267 AC_MSG_CHECKING(builddir)
268 if test "$srcdir" = "."; then
272 absolute_builddir="`pwd`"
273 # builddir="`dirname $srcdir`/`basename $absolute_builddir`"
274 builddir="`bash $srcdir/buildscripts/walk.sh \"$srcdir\"`"
277 AC_MSG_RESULT($builddir)
278 if expr "$srcdir" : '/' > /dev/null 2>&1; then
280 AC_STEPMAKE_WARN(Absolute --srcdir specified: $srcdir)
283 AC_MSG_CHECKING(for stepmake)
284 # Check for installed stepmake
285 if test -d $stepmake; then
286 AC_MSG_RESULT($stepmake)
288 if test "$absolute_srcdir" != "yes"; then
289 stepmake='$(depth)'/$srcdir/stepmake
291 stepmake=$srcdir/stepmake
293 AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
297 $HOME/usr/local/share/stepmake/bin\
298 $HOME/usr/local/lib/stepmake/bin\
299 $HOME/usr/share/stepmake/bin\
300 $HOME/usr/lib/stepmake/bin\
301 /usr/local/share/stepmake/bin\
302 /usr/local/lib/stepmake/bin\
303 /usr/share/stepmake/bin\
304 /usr/lib/stepmake/bin\
306 $srcdir/stepmake/bin\
314 AC_SUBST(PACKAGE_NAME)
315 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
316 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
318 if test "$package_depth" = "" ; then
321 package_depth="../$package_depth"
324 AC_SUBST(package_depth)
326 AUTOGENERATE="This file was automatically generated by configure"
327 AC_SUBST(AUTOGENERATE)
330 AC_ARG_ENABLE(config,
331 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
332 do \`make conf=CONF' to get output in ./out-CONF],
333 [CONFIGSUFFIX=-$enableval])
335 CONFIGFILE=config$CONFIGSUFFIX
336 AC_SUBST(CONFIGSUFFIX)
339 AC_CHECK_PROGS(MAKE, gmake make, error)
340 AC_CHECK_PROGS(FIND, find, error)
342 dnl system supplied INSTALL is unsafe; use our own install.
344 dnl if test "$INSTALL" = "bin/install-sh"; then
345 dnl export INSTALL="\$\(depth\)/bin/install-sh"
348 AC_CHECK_PROGS(TAR, tar, error)
350 if test "x`uname`" = "xHP-UX"; then
351 AC_PATH_PROG(BASH, bash, /bin/sh)
352 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
353 AC_PATH_PROG(SHELL, bash, /bin/ksh)
355 AC_PATH_PROG(BASH, bash, /bin/sh)
361 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
364 if test $MAKE != "error" ; then
365 $MAKE -v 2> /dev/null | grep GNU > /dev/null
368 AC_STEPMAKE_WARN(Please install *GNU* make)
372 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
374 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
375 LN=cp # hard link does not work under cygnus-nt
376 LN_S='cp -r' # symbolic link does not work for native nt
384 # cygwin fixes all these things.
385 # it seems these were used because of dos-style TEXINPUTS and
386 # MFINPUTS needed for miktex.
387 # but this breaks parsing of all other cygwin/unix style paths.
389 # if your (mik)tex breaks, make a:
390 # /usr/local/bin/tex:
392 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
398 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
400 # this way, you may have buildscripts/out/lilypond-profile
401 # 'automatically' sourced from /usr/etc/profile.d/ too.
406 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
414 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
416 AC_SUBST(program_prefix)
417 AC_SUBST(program_suffix)
422 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
423 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
430 AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
433 AC_ARG_WITH(kpathsea,
434 [ --with-kpathsea use kpathsea lib. Default: on],
435 [kpathsea_b=$enableval])
437 if test $kpathsea_b = yes; then
438 AC_HAVE_HEADERS(kpathsea/kpathsea.h)
439 AC_CHECK_LIB(kpathsea, kpse_find_file)
440 # urg: kpse_find_tfm is a #define, how to check for this?
441 # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
442 # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
443 AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
445 AC_MSG_CHECKING(whether to use kpathsea)
446 if test $kpathsea_b = yes; then
455 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
458 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
459 # ugh, automake: we want (and check for) bison
461 # ugh, automake: we want (and check for) flex
463 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
467 ac_cv_prog_lex_root=lex.yy
469 AC_CHECK_PROGS(BISON, bison, error)
470 AC_CHECK_PROGS(FLEX, flex, error)
471 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
472 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
474 if test $BISON != "error"; then
475 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
476 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
477 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
485 AC_DEFUN(AC_STEPMAKE_LIB, [
486 AC_CHECK_PROGS(AR, ar, error)
493 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
495 # **Never** try to set library version numbers so that they correspond
496 # to the release number of your package. This is an abuse that only
497 # fosters misunderstanding of the purpose of library versions.
499 REVISION=$PATCH_LEVEL
500 # CURRENT=$MINOR_VERSION
501 CURRENT=`expr $MINOR_VERSION + 1`
502 # AGE=$(expr $MAJOR_VERSION + 1)
509 AC_DEFUN(AC_STEPMAKE_LOCALE, [
514 AC_ARG_WITH(localedir,
515 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
516 PREFIX/share/locale ],
517 localedir=$with_localedir,
518 localedir='${prefix}/share/locale')
521 [ --with-lang=LANG use LANG as language to emit messages],
525 AC_MSG_CHECKING(language)
527 En* | en* | Am* | am* | US* | us*)
529 NL | nl | Du* | du* | Ned* | ned*)
538 if test "$lang" = "unknown" ; then
539 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
544 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
545 DIR_LOCALEDIR=${localedir}
547 if test "$prefix" = "NONE"; then
548 presome=${ac_default_prefix}
550 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
552 AC_SUBST(DIR_LOCALEDIR)
553 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
555 AC_CHECK_LIB(intl, gettext)
556 AC_CHECK_FUNCS(gettext)
559 AC_DEFUN(AC_STEPMAKE_MAN, [
560 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
561 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
562 AC_CHECK_PROGS(TBL, tbl, cat)
565 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
566 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
567 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
568 AC_MSG_CHECKING(whether msgfmt accepts -o)
569 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
570 if test "$msgfmt_output" = ""; then
574 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
576 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
578 if test ! -n "$MSGFMT"; then
579 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
583 #why has this been dropped?
584 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
585 AC_ARG_ENABLE(tex-prefix,
586 [ --enable-tex-prefix=DIR set the tex-directory to find TeX
587 subdirectories. Default: PREFIX],
588 [TEXPREFIX=$enableval],
591 AC_ARG_ENABLE(tex-dir,
592 [ --enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
596 AC_ARG_ENABLE(mf-dir,
597 [ --enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
601 if test "x$TEXPREFIX" = xauto ; then
602 AC_TEX_PREFIX(TEXPREFIX)
604 find_texprefix=$TEXPREFIX
607 if test "x$MFDIR" = xauto; then
611 if test "x$TEXDIR" = xauto ; then
612 AC_TEX_SUBDIR(TEXDIR)
619 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
620 AC_ARG_ENABLE(tfm-path,
621 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
622 esp.: cmr10.tfm. Default: use kpsewhich],
623 [tfm_path=$enableval],
626 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
627 AC_MSG_CHECKING(for tfm path)
631 if test "x$tfm_path" = xauto ; then
632 if test "x$KPSEWHICH" != "xno" ; then
633 for i in $TFM_FONTS; do
634 dir=`$KPSEWHICH tfm ${i}10.tfm`
635 TFM_PATH="$TFM_PATH `dirname $dir`"
638 AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
639 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
645 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
646 AC_MSG_RESULT($TFM_PATH)
650 AC_DEFUN(AC_STEPMAKE_TEXMF, [
651 # urg, never know what names these teTeX guys will think up
653 AC_CHECK_PROGS(METAFONT, mf, no)
654 if test "x$METAFONT" = "xno"; then
655 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
659 AC_CHECK_PROGS(METAPOST, mp, no)
660 if test "x$METAPOST" = "xno"; then
661 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
666 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
667 if test "x$INIMETAFONT" = "xno"; then
668 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
669 INIMETAFONT=$INIMFONT
672 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
673 if test "x$INIMETAPOST" = "xno"; then
674 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
675 INIMETAPOST=$INIMPOST
678 AC_MSG_CHECKING(for working metafont mode)
679 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
680 for MFMODE in $modelist; do
681 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
682 if test -f mfput.tfm; then
686 AC_MSG_RESULT($MFMODE)
688 AC_MSG_CHECKING(for mfplain.mp)
690 # For now let people define these in their environments
692 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
693 AC_MSG_RESULT($MFPLAIN_MP)
695 AC_MSG_CHECKING(for inimetapost flags)
696 if test ${INIMETAPOST} = "inimp" ; then
697 : ${INIMETAPOST_FLAGS=''}
699 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
701 AC_MSG_RESULT($INIMETAPOST_FLAGS)
708 AC_SUBST(INIMETAFONT)
709 AC_SUBST(INIMETAPOST)
711 AC_SUBST(INIMETAPOST_FLAGS)
714 AC_DEFUN(AC_STEPMAKE_WARN, [
719 AC_DEFUN(AC_STEPMAKE_YODL, [
720 if test "x$YODL" = "x"; then
721 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
722 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
723 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
724 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
725 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
726 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
727 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
728 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
729 YODL2LESS_DIR='$(bindir)/'
735 AC_SUBST(YODL2LESS_DIR)
737 AC_SUBST(YODL2MSLESS)
738 AC_SUBST(YODL2TEXINFO)
740 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
742 if test "x$YODL" = "-echo no yodl"; then
743 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
747 dnl should cache result.
748 dnl should look in $prefix first.
749 dnl should probably assume TDS
751 AC_DEFUN(AC_TEX_PREFIX, [
754 AC_MSG_CHECKING(TeX/MF root dir directory)
756 find_root_prefix="$prefix"
759 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
761 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
762 find_texprefix="$find_root_prefix$postfix"
763 if test -d $find_texprefix; then
764 find_texpostfix=$postfix
769 if test "x$find_texpostfix" = x; then
770 find_texpostfix='/lib/texmf/tex'
771 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
774 find_texprefix="$find_root_prefix/$find_texpostfix"
776 # only assign if variablename not empty
777 if test x != "x[$]$1"; then
778 $1='${prefix}'/"$find_texpostfix"
780 AC_MSG_RESULT($find_texprefix)
785 # find a directory inside a prefix,
786 # $1 the prefix (expanded version)
787 # $2 variable to assign
788 # $3 the directory name
790 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
792 AC_MSG_CHECKING($4 directory)
794 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
797 if test "x$find_dirdir" = x; then
799 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
803 AC_MSG_RESULT($1/$find_dirdir)
806 # ugh. this is hopeless
807 AC_DEFUN(AC_KPSE_TEX_DIR, [
808 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
809 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
811 if test -w "$kpse_syspaths";
813 dir=`echo $kpse_syspaths | head -1`
815 dir=`echo $kpse_paths | grep -v '!'| head -1`
817 if test "$prefix" = "NONE"; then
818 local_prefix=$ac_default_prefix
819 local_prefix_quote='${prefix}'
823 local_prefix_quote=$prefix
825 echo $local_prefix_quote = $local_prefix
827 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
830 AC_DEFUN(AC_TEX_SUBDIR, [
831 dnl AC_REQUIRE([AC_TEX_PREFIX])
832 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
836 AC_DEFUN(AC_MF_SUBDIR, [
837 dnl AC_REQUIRE([AC_TEX_PREFIX])
838 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
842 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
843 result="`echo \"$1\" | grep echo`"
844 if test "x$1" = "xerror" -o "x$result" != "x"; then
845 AC_STEPMAKE_WARN(can\'t find $2. $3)
849 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
851 dnl This macro runs the `guile-config' script, installed with Guile,
852 dnl to find out where Guile's header files and libraries are
853 dnl installed. It sets two variables, marked for substitution, as
856 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
857 dnl code that uses Guile header files. This is almost
858 dnl always just a -I flag.
860 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
861 dnl program against Guile. This includes `-lguile' for
862 dnl the Guile library itself, any libraries that Guile
863 dnl itself requires (like -lqthreads), and so on. It may
864 dnl also include a -L flag to tell the compiler where to
865 dnl find the libraries.
867 AC_DEFUN([GUILE_FLAGS],[
868 ## The GUILE_FLAGS macro.
869 AC_MSG_CHECKING(for Guile)
870 if ! $guile_config link > /dev/null ; then
871 AC_MSG_RESULT("cannot execute $guile_config")
872 AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
875 GUILE_CFLAGS="`$guile_config compile`"
876 GUILE_LDFLAGS="`$guile_config link`"
877 AC_SUBST(GUILE_CFLAGS)
878 AC_SUBST(GUILE_LDFLAGS)
883 # Configure paths for GTK+
884 # Owen Taylor 97-11-3
886 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
887 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
889 AC_DEFUN(AM_PATH_GTK,
891 dnl Get the cflags and libraries from the gtk-config script
893 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
894 min_gtk_version=ifelse([$1], ,1.1.1,$1)
895 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
897 if test "$GTK_CONFIG" != "no" ; then
898 GTK_CFLAGS=`$GTK_CONFIG --cflags`
899 GTK_LIBS=`$GTK_CONFIG --libs`
900 ac_save_CFLAGS="$CFLAGS"
902 ac_save_CXXFLAGS="$CXXFLAGS"
903 CFLAGS="$CFLAGS $GTK_CFLAGS"
904 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
905 LIBS="$LIBS $GTK_LIBS"
907 dnl Now check if the installed GTK is sufficiently new. (Also sanity
908 dnl checks the results of gtk-config to some extent)
917 int major, minor, micro;
919 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
920 printf("%s, bad version string\n", "$min_gtk_version");
924 return !((gtk_major_version > major) ||
925 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
926 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
928 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
929 CFLAGS="$ac_save_CFLAGS"
930 CXXFLAGS="$ac_save_CXXFLAGS"
935 if test "x$no_gtk" = x ; then
937 ifelse([$2], , :, [$2])
942 ifelse([$3], , :, [$3])
944 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
951 # Configure paths for GTK--
952 # Erik Andersen 30 May 1998
953 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
955 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
956 dnl to be used as follows:
957 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
960 dnl Get the cflags and libraries from the gtkmm-config script
962 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
963 Prefix where GTK-- is installed (optional)],
964 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
965 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
966 Exec prefix where GTK-- is installed (optional)],
967 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
968 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
969 , enable_gtkmmtest=yes)
971 if test x$gtkmm_config_exec_prefix != x ; then
972 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
973 if test x${GTKMM_CONFIG+set} != xset ; then
974 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
977 if test x$gtkmm_config_prefix != x ; then
978 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
979 if test x${GTKMM_CONFIG+set} != xset ; then
980 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
985 AC_DEFUN(AM_PATH_GTKMM,
989 dnl Check if the installed GTK-- is sufficiently new.
991 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
992 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
994 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
996 if test "$GTKMM_CONFIG" = "no" ; then
1002 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
1003 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
1004 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1005 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1006 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1007 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1008 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
1009 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1010 if test "x$enable_gtkmmtest" = "xyes" ; then
1011 ac_save_CXXFLAGS="$CXXFLAGS"
1012 ac_save_LIBS="$LIBS"
1013 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1014 LIBS="$LIBS $GTK___LIBS"
1016 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
1017 dnl checks the results of gtkmm-config to some extent
1019 rm -f conf.gtkmmtest
1028 int major, minor, micro;
1031 system ("touch conf.gtkmmtest");
1033 /* HP/UX 0 (%@#!) writes to sscanf strings */
1034 tmp_version = g_strdup("$min_gtkmm_version");
1035 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1036 printf("%s, bad version string\n", "$min_gtkmm_version");
1040 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
1041 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
1042 (gtkmm_micro_version != $gtkmm_config_micro_version))
1044 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
1045 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
1046 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1047 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
1048 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
1049 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1050 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1051 printf("*** required on your system.\n");
1052 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
1053 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
1054 printf("*** before re-running configure\n");
1056 /* GTK-- does not have the GTKMM_*_VERSION constants */
1058 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
1059 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
1060 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
1062 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
1063 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
1064 printf("*** library (version %d.%d.%d)\n",
1065 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1070 if ((gtkmm_major_version > major) ||
1071 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
1072 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
1078 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
1079 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
1080 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
1081 major, minor, micro);
1082 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
1084 printf("*** If you have already installed a sufficiently new version, this error\n");
1085 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
1086 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1087 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
1088 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
1089 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1090 printf("*** so that the correct libraries are found at run-time))\n");
1095 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1096 CXXFLAGS="$ac_save_CXXFLAGS"
1097 LIBS="$ac_save_LIBS"
1100 if test "x$no_gtkmm" = x ; then
1102 ifelse([$2], , :, [$2])
1105 if test "$GTKMM_CONFIG" = "no" ; then
1106 echo "*** The gtkmm-config script installed by GTK-- could not be found"
1107 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
1108 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1109 echo "*** full path to gtk-config."
1110 echo "*** The gtkmm-config script was not available in GTK-- versions"
1111 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
1112 echo "*** version to 0.9.12 or newer"
1114 if test -f conf.gtkmmtest ; then
1117 echo "*** Could not run GTK-- test program, checking why..."
1118 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
1119 LIBS="$LIBS $GTK___LIBS"
1123 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1124 [ echo "*** The test program compiled, but did not run. This usually means"
1125 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1126 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1127 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1128 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1129 echo "*** is required on your system"
1131 echo "*** If you have an old version installed, it is best to remove it, although"
1132 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1133 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1134 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1135 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1136 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1137 CXXFLAGS="$ac_save_CXXFLAGS"
1138 LIBS="$ac_save_LIBS"
1143 ifelse([$3], , :, [$3])
1146 AC_SUBST(GTK___CFLAGS)
1147 AC_SUBST(GTK___LIBS)
1148 rm -f conf.gtkmmtest
1151 # Configure paths for GTK--DRAW
1152 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1154 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1155 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1157 AC_DEFUN(AM_PATH_GTK__DRAW,
1159 dnl Get the cflags and libraries from the gtk__-config script
1161 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1162 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1163 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1165 if test "$GTKMM_CONFIG" != "no" ; then
1166 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1167 GTK___LIBS=`$GTKMM_CONFIG --libs`
1168 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1169 GTK___LIBS="$GTK___DLIBS"
1170 ac_save_CFLAGS="$CFLAGS"
1171 ac_save_LIBS="$LIBS"
1172 ac_save_CXXFLAGS="$CXXFLAGS"
1173 CFLAGS="$CFLAGS $GTK___CFLAGS"
1174 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1175 LIBS="$LIBS $GTK___LIBS"
1177 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1178 dnl checks the results of gtk__-config to some extent)
1190 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1191 CFLAGS="$ac_save_CFLAGS"
1192 CXXFLAGS="$ac_save_CXXFLAGS"
1193 LIBS="$ac_save_LIBS"
1197 if test "x$no_gtk__" = x ; then
1199 ifelse([$2], , :, [$2])
1204 ifelse([$3], , :, [$3])
1206 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1208 AC_SUBST(GTK___CFLAGS)
1209 AC_SUBST(GTK___LIBS)