1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
5 ### mostly interal macros
7 # Get full path of executable ($1)
8 AC_DEFUN(STEPMAKE_GET_EXECUTABLE, [
9 ## which doesn't work in ash, if /usr/bin/which isn't installed
10 ## type -p doesn't work in ash
11 ## command -v doesn't work in zsh
12 ## command -v "$1" 2>&1
13 ## this test should work in ash, bash, pdksh (ksh), zsh
14 type -p "$1" 2>/dev/null | tail -1 | awk '{print $NF}'
18 # Get version string from executable ($1)
19 AC_DEFUN(STEPMAKE_GET_VERSION, [
20 ## "$1" --version 2>&1 | grep -v '^$' | head -1 | awk '{print $NF}'
23 ## Workaround for broken Debian gcc version string:
24 ## gcc (GCC) 3.1.1 20020606 (Debian prerelease)
26 ## Assume, and hunt for, dotted version multiplet.
28 changequote(<<, >>)dnl
29 "$1" --version 2>&1 | grep '[0-9]\.[0-9]' | head -1 | \
30 sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/'
34 # Calculate simplistic numeric version from version string ($1)
35 # As yet, we have no need for something more elaborate.
36 AC_DEFUN(STEPMAKE_NUMERIC_VERSION, [
39 if ([$]3) {three = [$]3}
42 {printf "%d\n", [$]1*1000000 + [$]2*1000 + three}'
46 # Add item ($2) to list ($1, one of 'OPTIONAL', 'REQUIRED')
47 AC_DEFUN(STEPMAKE_ADD_ENTRY, [
48 eval "$1"=\"`eval echo \"'$'$1\" \"$2\"`\"
51 # Check if tested program ($2) was found ($1).
52 # If not, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED').
53 # We could abort here if a 'REQUIRED' program is not found
54 AC_DEFUN(STEPMAKE_OPTIONAL_REQUIRED, [
55 STEPMAKE_CHECK_SEARCH_RESULT($1)
56 if test $? -ne 0; then
57 STEPMAKE_ADD_ENTRY($3, $2)
58 if test "$3" = "REQUIRED"; then
59 command="echo ERROR: $2 not found"
60 # abort configure process here?
62 command="- echo $2 not found"
72 # Return if tested proram ($1) was found (true) or not (false).
73 AC_DEFUN(STEPMAKE_CHECK_SEARCH_RESULT, [
74 r="`eval echo '$'"$1"`"
75 if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
78 ##STEPMAKE_WARN(cannot find $2. $3)
84 # Check version of program ($1)
85 # If version is smaller than requested ($3),
86 # add entry to missing-list ($2, one of 'OPTIONAL', 'REQUIRED').
87 AC_DEFUN(STEPMAKE_CHECK_VERSION, [
88 r="`eval echo '$'"$1"`"
89 AC_MSG_CHECKING([$r version])
90 exe=`STEPMAKE_GET_EXECUTABLE($r)`
91 ver=`STEPMAKE_GET_VERSION($exe)`
92 num=`STEPMAKE_NUMERIC_VERSION($ver)`
93 req=`STEPMAKE_NUMERIC_VERSION($3)`
95 if test "$num" -lt "$req"; then
96 STEPMAKE_ADD_ENTRY($2, ["$r >= $3 (installed: $ver)"])
100 # Check version of program ($1)
101 # If version is greater than or equals unsupported ($3),
102 # add entry to unsupported list ($2, 'UNSUPPORTED')
103 AC_DEFUN(STEPMAKE_CHECK_VERSION_UNSUPPORTED, [
104 r="`eval echo '$'"$1"`"
105 AC_MSG_CHECKING([$r version])
106 exe=`STEPMAKE_GET_EXECUTABLE($r)`
107 ver=`STEPMAKE_GET_VERSION($exe)`
108 num=`STEPMAKE_NUMERIC_VERSION($ver)`
109 sup=`STEPMAKE_NUMERIC_VERSION($3)`
110 AC_MSG_RESULT([$ver])
111 if test "$num" -ge "$sup"; then
112 STEPMAKE_ADD_ENTRY($2, ["$r < $3 (installed: $ver)"])
116 ### Macros to build configure.in
119 AC_DEFUN(STEPMAKE_BIBTEX2HTML, [
120 STEPMAKE_PROGS(BIBTEX2HTML, bibtex2html bib2html, $1)
121 if test "$BIBTEX2HTML" = "bib2html"; then
122 BIBTEX2HTML_FLAGS='$< $(@)'
124 BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
126 AC_SUBST(BIBTEX2HTML)
127 AC_SUBST(BIBTEX2HTML_FLAGS)
131 AC_DEFUN(STEPMAKE_BISON, [
132 # ugh, automake: we want (and check for) bison
135 STEPMAKE_PROGS(BISON, bison, $1)
137 # urg. should test functionality rather than version.
138 if test "$BISON" = "bison" -a -n "$2"; then
139 STEPMAKE_CHECK_VERSION(BISON, $1, $2)
144 AC_DEFUN(STEPMAKE_COMPILE, [
145 # -O is necessary to get inlining
147 CXXFLAGS=${CXXFLAGS-$CFLAGS}
148 LDFLAGS=${LDFLAGS-""}
154 AC_ARG_ENABLE(checking,
155 [ --enable-checking set runtime checks (assert calls). Default: on],
156 [checking_b=$enableval] )
158 AC_ARG_ENABLE(debugging,
159 [ --enable-debugging compile with debugging info. Default: on],
160 [debug_b=$enableval])
162 AC_ARG_ENABLE(optimising,
163 [ --enable-optimising compile with optimising. Default: on],
164 [optimise_b=$enableval])
166 AC_ARG_ENABLE(profiling,
167 [ --enable-profiling compile with gprof support. Default: off],
168 [profile_b=$enableval])
171 if test "$checking_b" = no; then
174 DEFINES="$DEFINES -DNDEBUG"
177 if test "$optimise_b" = yes; then
178 OPTIMIZE="-O2 -finline-functions"
182 if test $profile_b = yes; then
184 OPTIMIZE="$OPTIMIZE -pg"
187 if test $debug_b = yes; then
188 OPTIMIZE="$OPTIMIZE -g"
193 STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1)
197 CFLAGS="$CFLAGS $OPTIMIZE"
198 CPPFLAGS=${CPPFLAGS-""}
200 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
201 save_cflags="$CFLAGS"
204 dnl should do compile test?
205 AC_MSG_RESULT(-mieee)
206 CFLAGS="-mieee $CFLAGS"
209 AC_MSG_RESULT([none])
212 AC_SUBST(cross_compiling)
219 AC_SUBST(EXTRA_LIBES)
222 AC_DEFUN(STEPMAKE_CXX, [
225 STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
227 CPPFLAGS="$CPPFLAGS $DEFINES"
228 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
229 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
238 AC_DEFUN(STEPMAKE_CXXTEMPLATE, [
239 AC_CACHE_CHECK([whether explicit instantiation is needed],
240 lily_cv_need_explicit_instantiation,
241 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
242 template <class T> struct foo { static int baz; };
243 template <class T> int foo<T>::baz = 1;
244 ]], [[ return foo<int>::baz; ]])],[lily_cv_need_explicit_instantiation=no],[lily_cv_need_explicit_instantiation=yes]))
245 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
246 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
251 AC_DEFUN(STEPMAKE_DATADIR, [
252 if test "$datadir" = "\${prefix}/share"; then
253 datadir='${prefix}/share'
256 if test "$prefix" = "NONE"; then
257 presome=${ac_default_prefix}
260 build_package_datadir=$ugh_ugh_autoconf250_builddir/share/$package
262 DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"`
263 BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"`
266 AC_SUBST(build_package_datadir)
267 AC_DEFINE_UNQUOTED(DATADIR, ["${DATADIR}"])
268 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, ["${BUILD_PACKAGE_DATADIR}"])
271 ## ugh: cut & paste programming from datadir.
272 AC_DEFUN(STEPMAKE_LIBDIR, [
274 if test "$libdir" = "\${exec_prefix}/lib"; then
275 libdir='${exec_prefix}/lib'
278 build_package_libdir=$ugh_ugh_autoconf250_builddir/lib/$package
280 LIBDIR=`echo ${libdir} | sed "s!\\\${exec_prefix}!$presome!"`
281 BUILD_PACKAGE_LIBDIR=`echo ${build_package_libdir} | sed "s!\\\${exec_prefix}!$presome!"`
284 AC_SUBST(build_package_libdir)
285 AC_DEFINE_UNQUOTED(LIBDIR, ["${LIBDIR}"])
286 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_LIBDIR, ["${BUILD_PACKAGE_LIBDIR}"])
290 AC_DEFUN(STEPMAKE_END, [
294 AC_CONFIG_FILES([$CONFIGFILE.make:config.make.in])
297 if test -n "$OPTIONAL"; then
299 echo "WARNING: Please consider installing optional programs: $OPTIONAL"
302 if test -n "$REQUIRED"; then
304 echo "ERROR: Please install required programs: $REQUIRED"
307 if test -n "$UNSUPPORTED"; then
309 echo "ERROR: Please use older version of programs: $UNSUPPORTED"
312 if test -n "$OPTIONAL$REQUIRED$UNSUPPORTED"; then
314 echo "See INSTALL.txt for more information on how to build $PACKAGE_NAME"
315 echo "Remove config.cache before rerunning ./configure"
318 if test -n "$REQUIRED$UNSUPPORTED"; then
319 rm -f $srcdir/GNUmakefile
323 # regular in-place build
324 # test for srcdir_build = yes ?
325 if test "$srcdir_build" = "yes"; then
326 rm -f $srcdir/GNUmakefile
327 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
328 chmod 444 $srcdir/GNUmakefile
329 else # --srcdir build
331 cp $srcdir/make/srcdir.make.in GNUmakefile
332 chmod 444 GNUmakefile
337 AC_DEFUN(STEPMAKE_FLEX, [
338 # ugh, automake: we want (and check for) flex
340 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
344 ac_cv_prog_lex_root=lex.yy
345 STEPMAKE_PROGS(FLEX, flex, $1)
349 AC_DEFUN(STEPMAKE_FLEXLEXER, [
350 AC_CHECK_HEADERS([FlexLexer.h],[true],[false])
351 if test $? -ne 0; then
352 warn='FlexLexer.h (flex package)'
353 STEPMAKE_ADD_ENTRY($1, $warn)
355 # check for yyFlexLexer.yy_current_buffer,
356 # in 2.5.4 <= flex < 2.5.29
358 AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer],
359 [stepmake_flexlexer_yy_current_buffer],
360 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
362 #include <FlexLexer.h>
363 class yy_flex_lexer: public yyFlexLexer
368 yy_current_buffer = 0;
372 [stepmake_flexlexer_yy_current_buffer=yes],
373 [stepmake_flexlexer_yy_current_buffer=no]))
374 if test $stepmake_flexlexer_yy_current_buffer = yes; then
375 AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.])
381 AC_DEFUN(STEPMAKE_GCC, [
382 if test "$GCC" = "yes"; then
383 STEPMAKE_CHECK_VERSION(CC, $1, $2)
385 warn="$CC (Please install *GNU* cc)"
386 STEPMAKE_ADD_ENTRY($1, $warn)
390 AC_DEFUN(STEPMAKE_GETTEXT, [
392 if test "$prefix" = "NONE"; then
393 presome=${ac_default_prefix}
395 LOCALEDIR=`echo ${localedir} | sed "s!\\\${prefix}!$presome!"`
398 AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"])
399 # ouch. autoconf <= 2.57's gettext check fails for
400 # g++ >= 3.3 (with -std=gnu++98, the default).
401 # While the check is OK for g++ -std=c++98,
402 # LilyPond needs GNU g++, so who is to blame here?
403 # Use a workaround until this is resolved:
404 # for g++ >= 3.3, select C language.
406 STEPMAKE_CHECK_VERSION_UNSUPPORTED(CXX, GCC_UNSUPPORTED, 3.3)
407 if test -n "$GCC_UNSUPPORTED"; then
408 AC_MSG_WARN([autoconf <= 2.57 with g++ >= 3.3 gettext test broken.])
409 AC_MSG_WARN([Trying gcc, cross thumbs.])
412 AC_CHECK_LIB(intl, gettext)
413 AC_CHECK_FUNCS(gettext)
414 if test -n "$GCC_UNSUPPORTED"; then
420 AC_DEFUN(STEPMAKE_GUILE, [
421 STEPMAKE_PATH_PROG(GUILE, guile, $1)
425 # STEPMAKE_GUILE_FLAGS --- set flags for compiling and linking with Guile
427 # This macro runs the guile-config script, installed with Guile,
428 # to find out where Guile's header files and libraries are
429 # installed. It sets two variables, marked for substitution, as
432 # GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
433 # code that uses Guile header files. This is almost
434 # always just a -I flag.
436 # GUILE_LDFLAGS --- flags to pass to the linker to link a
437 # program against Guile. This includes -lguile for
438 # the Guile library itself, any libraries that Guile
439 # itself requires (like -lqthreads), and so on. It may
440 # also include a -L flag to tell the compiler where to
441 # find the libraries.
443 AC_DEFUN([STEPMAKE_GUILE_FLAGS], [
444 exe=`STEPMAKE_GET_EXECUTABLE($guile_config)`
445 if test -x $exe; then
446 AC_MSG_CHECKING([guile compile flags])
447 GUILE_CFLAGS="`$guile_config compile`"
448 AC_MSG_RESULT($GUILE_CFLAGS)
449 AC_MSG_CHECKING([guile link flags])
450 GUILE_LDFLAGS="`$guile_config link`"
451 AC_MSG_RESULT($GUILE_LDFLAGS)
453 AC_SUBST(GUILE_CFLAGS)
454 AC_SUBST(GUILE_LDFLAGS)
458 AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
459 ## First, let's just see if we can find Guile at all.
460 AC_MSG_CHECKING([for guile-config])
461 for guile_config in $GUILE_CONFIG guile-config $target-guile-config $build-guile-config; do
462 AC_MSG_RESULT([$guile_config])
463 if ! $guile_config --version > /dev/null 2>&1 ; then
464 AC_MSG_WARN([cannot execute $guile_config])
465 AC_MSG_CHECKING([if we are cross compiling])
466 GUILE_CONFIG='echo no guile-config'
468 GUILE_CONFIG=$guile_config
472 STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
473 if test $? -ne 0; then
474 STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
477 STEPMAKE_CHECK_SEARCH_RESULT(GUILE_CONFIG)
478 # urg. should test functionality rather than version.
479 if test $? -eq 0 -a -n "$2"; then
480 STEPMAKE_CHECK_VERSION(GUILE_CONFIG, $1, $2)
483 AC_SUBST(GUILE_CONFIG)
486 changequote(<<, >>)dnl
487 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
488 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
489 GUILE_PATCH_LEVEL=`expr $guile_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
492 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
493 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
494 AC_DEFINE_UNQUOTED(GUILE_PATCH_LEVEL, $GUILE_PATCH_LEVEL)
498 AC_DEFUN(STEPMAKE_GXX, [
499 if test "$GXX" = "yes"; then
500 STEPMAKE_CHECK_VERSION(CXX, $1, $2)
502 warn="$CXX (Please install *GNU* c++)"
503 STEPMAKE_ADD_ENTRY($1, $warn)
508 AC_DEFUN(STEPMAKE_INIT, [
512 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
513 if test x$MY_PATCH_LEVEL != x; then
514 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
517 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
518 changequote(<<, >>)dnl
519 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
520 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
523 # No versioning on directory names of sub-packages
525 stepmake=${datadir}/stepmake
527 if test "$prefix" = "NONE"; then
528 presome=${ac_default_prefix}
530 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
532 # urg, how is this supposed to work?
533 if test "$program_prefix" = "NONE"; then
536 if test "$program_suffix" = "NONE"; then
540 AC_MSG_CHECKING(Package)
541 if test "$PACKAGE" = "STEPMAKE"; then
542 AC_MSG_RESULT(Stepmake package!)
544 AC_MSG_CHECKING(builddir)
546 ugh_ugh_autoconf250_builddir="`pwd`"
548 if test "$srcdir" = "."; then
552 package_builddir="`dirname $ugh_ugh_autoconf250_builddir`"
553 package_srcdir="`dirname $srcdir`"
555 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
557 (cd stepmake 2>/dev/null || mkdir stepmake)
558 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
559 # only possible with autoconf < 2.50 -- hardcoded in configure.in
560 # AC_CONFIG_AUX_DIR(bin)
563 AC_MSG_RESULT($PACKAGE)
565 AC_MSG_CHECKING(builddir)
566 ugh_ugh_autoconf250_builddir="`pwd`"
567 if test "$srcdir" = "."; then
572 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
574 AC_MSG_CHECKING(for stepmake)
575 # Check for installed stepmake
576 if test -d $stepmake; then
577 AC_MSG_RESULT($stepmake)
579 stepmake="`cd $srcdir/stepmake; pwd`"
580 AC_MSG_RESULT([$srcdir/stepmake ($datadir/stepmake not found)])
583 # only possible with autoconf < 2.50 -- hardcoded in configure.in
584 # AC_CONFIG_AUX_DIR(\
586 # $srcdir/stepmake/bin\
590 AC_SUBST(ugh_ugh_autoconf250_builddir)
594 AC_SUBST(PACKAGE_NAME)
595 # We don't need the upper case variant,
596 # so stick to macros are uppercase convention.
597 # AC_DEFINE_UNQUOTED(package, ["${package}"])
598 # AC_DEFINE_UNQUOTED(PACKAGE, ["${PACKAGE}"])
599 AC_DEFINE_UNQUOTED(PACKAGE, ["${package}"])
600 AC_DEFINE_UNQUOTED(PACKAGE_NAME, ["${PACKAGE_NAME}"])
601 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, ["${FULL_VERSION}"])
603 if test -z "$package_depth"; then
606 package_depth="../$package_depth"
609 AC_SUBST(package_depth)
611 AUTOGENERATE="This file was automatically generated by configure"
612 AC_SUBST(AUTOGENERATE)
615 AC_ARG_ENABLE(config,
616 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
617 do \`make conf=CONF' to get output in ./out-CONF],
618 [CONFIGURATION=$enableval])
622 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
623 CONFIGFILE=config$CONFIGSUFFIX
624 AC_SUBST(CONFIGSUFFIX)
627 STEPMAKE_PROGS(MAKE, gmake make, REQUIRED)
628 STEPMAKE_PROGS(FIND, find, REQUIRED)
630 STEPMAKE_PROGS(TAR, tar, REQUIRED)
632 if test "$(echo 2)" != "2" ||
633 test "x`uname`" = "xHP-UX"; then
634 AC_PATH_PROG(KSH, ksh, /bin/ksh)
635 AC_PATH_PROG(BASH, bash, $KSH)
636 STEPMAKE_WARN(avoiding buggy /bin/sh)
637 AC_PATH_PROG(SHELL, bash, $KSH)
640 AC_PATH_PROG(BASH, bash, $SHELL)
644 STEPMAKE_PATH_PROG(PYTHON, python, REQUIRED)
646 if expr "$MAKE" : '.*\(echo\)' >/dev/null; then
647 $MAKE -v 2> /dev/null | grep GNU > /dev/null
648 if test "$?" = 1; then
649 warn='make (Please install *GNU* make)'
650 # STEPMAKE_WARN($warn)
651 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
655 if test "$OSTYPE" = "cygwin" -o "$OSTYPE" = "cygwin32" -o "$OSTYPE" = "Windows_NT"; then
656 LN=cp # hard link does not work under cygnus-nt
657 LN_S='cp -r' # symbolic link does not work for native nt
663 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
671 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
673 AC_SUBST(program_prefix)
674 AC_SUBST(program_suffix)
679 AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
680 AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
690 AC_DEFUN(STEPMAKE_KPATHSEA, [
692 AC_ARG_WITH(kpathsea-include,
693 [ --with-kpathsea-include=DIR
694 location of the kpathsea include dir],[
695 if test "$withval" = "yes" -o "$withval" = "no"; then
696 AC_MSG_WARN(Usage: --with-kpathsea-include=includedir)
698 CPPFLAGS="$CPPFLAGS -I${withval}"
702 AC_ARG_WITH(kpathsea-lib,
703 [ --with-kpathsea-lib=DIR location of the kpathsea lib dir],[
704 if test "$withval" = "yes" -o "$withval" = "no"; then
705 AC_MSG_WARN(Usage: --with-kpathsea-lib=libdir)
707 LDFLAGS="$LDFLAGS -L${withval}"
712 #FIXME --with-xxx is meant for specifying a PATH too,
713 # so this should read: --enable-kpathsea,
714 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
715 AC_ARG_WITH(kpathsea,
716 [ --with-kpathsea use kpathsea lib. Default: on],
717 [kpathsea_b=$with_kpathsea])
719 if test "$kpathsea_b" != "no"; then
720 AC_CHECK_HEADERS([kpathsea/kpathsea.h])
721 AC_CHECK_LIB(kpathsea, kpse_find_file)
722 AC_CHECK_FUNCS(kpse_find_file,,kpathsea_b=no)
723 if test "$kpathsea_b" = "no"; then
724 warn='kpathsea (libkpathsea-dev, kpathsea-devel or tetex-devel
726 Else, please specify the location of your kpathsea using
727 --with-kpathsea-include and --with-kpathsea-lib options. You should
728 install kpathsea; see INSTALL.txt. Rerun ./configure
729 --without-kpathsea only if kpathsea is not available for your
731 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
734 AC_MSG_CHECKING(whether to use kpathsea)
735 if test "$kpathsea_b" != no; then
744 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
748 AC_DEFUN(STEPMAKE_LIB, [
749 STEPMAKE_PROGS(AR, ar, $1)
751 STEPMAKE_OPTIONAL_REQUIRED(RANLIB, ranlib, $1)
755 AC_DEFUN(STEPMAKE_LIBTOOL, [
757 # **Never** try to set library version numbers so that they correspond
758 # to the release number of your package. This is an abuse that only
759 # fosters misunderstanding of the purpose of library versions.
761 REVISION=$PATCH_LEVEL
762 # CURRENT=$MINOR_VERSION
763 CURRENT=`expr $MINOR_VERSION + 1`
764 # AGE=`expr $MAJOR_VERSION + 1`
772 AC_DEFUN(STEPMAKE_LOCALE, [
777 AC_ARG_WITH(localedir,
778 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
779 PREFIX/share/locale ],
780 localedir=$with_localedir,
781 localedir='${prefix}/share/locale')
784 [ --with-lang=LANG use LANG as language to emit messages],
788 AC_MSG_CHECKING(language)
790 En* | en* | Am* | am* | US* | us*)
792 NL | nl | Du* | du* | Ned* | ned*)
801 if test "$lang" = "unknown" ; then
802 STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
808 AC_DEFUN(STEPMAKE_MAKEINFO, [
809 STEPMAKE_PROGS(MAKEINFO, makeinfo, $1)
810 if test "$MAKEINFO" = "makeinfo"; then
811 AC_MSG_CHECKING(whether makeinfo can split html by @node)
813 makeinfo --html --output=out/split <<EOF
815 \input texinfo @c -*-texinfo-*-
816 @setfilename split.info
820 if test -d out/split; then
821 SPLITTING_MAKEINFO=yes
826 STEPMAKE_WARN(your html documentation will be one large file)
830 AC_SUBST(SPLITTING_MAKEINFO)
835 AC_DEFUN(STEPMAKE_MAN, [
836 STEPMAKE_PROGS(GROFF, groff ditroff, $1)
838 STEPMAKE_PROGS(TROFF, troff, $1)
840 STEPMAKE_PROGS(TBL, tbl, $1)
845 AC_DEFUN(STEPMAKE_MSGFMT, [
846 STEPMAKE_PROGS(MSGFMT, msgfmt, $1)
850 # Check for program ($2), set full path result to ($1).
851 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
852 AC_DEFUN(STEPMAKE_PATH_PROG, [
853 AC_CHECK_PROGS($1, $2, no)
854 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
855 if test $? -eq 0; then
857 if test -n "$4"; then
858 STEPMAKE_CHECK_VERSION($1, $3, $4)
864 # Check for program in set of names ($2), set result to ($1) .
865 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
866 # If exists, and a minimal version ($4) is required
867 AC_DEFUN(STEPMAKE_PROGS, [
868 AC_CHECK_PROGS($1, $2, no)
869 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
870 if test $? -eq 0 -a -n "$4"; then
871 STEPMAKE_CHECK_VERSION($1, $3, $4)
876 AC_DEFUN(STEPMAKE_PERL, [
877 STEPMAKE_PATH_PROG(PERL, perl, $1)
881 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
882 AC_CHECK_HEADERS([python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h],[PYTHON_HEADER=yes])
883 if test -z "$PYTHON_HEADER"; then
884 warn='python.h (python-devel, python-dev or libpython-dev package)'
885 STEPMAKE_ADD_ENTRY($1, $warn)
890 AC_DEFUN(STEPMAKE_TEXMF_DIRS, [
891 AC_ARG_ENABLE(tfm-path,
892 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
893 esp.: cmr10.tfm. Default: use kpsewhich],
894 [tfm_path=$enableval],
898 STEPMAKE_PROGS(KPSEWHICH, kpsewhich, OPTIONAL)
899 AC_MSG_CHECKING(for tfm path)
903 if test "x$tfm_path" = xauto ; then
904 if test "x$KPSEWHICH" != "xno" ; then
905 for i in $TFM_FONTS; do
906 dir=`$KPSEWHICH tfm ${i}10.tfm`
907 TFM_PATH="$TFM_PATH `dirname $dir`"
910 STEPMAKE_WARN(Please specify where cmr10.tfm lives:
911 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
917 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
918 AC_MSG_RESULT($TFM_PATH)
923 AC_DEFUN(STEPMAKE_TEXMF, [
924 # urg, never know what names these teTeX guys will think up
926 STEPMAKE_PROGS(METAFONT, mf mfont, $1)
927 STEPMAKE_PROGS(INIMETAFONT, inimf inimfont, $1)
929 AC_MSG_CHECKING(for working metafont mode)
930 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
931 for MFMODE in $modelist; do
932 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
933 if test -f mfput.tfm; then
937 AC_MSG_RESULT($MFMODE)
945 AC_DEFUN(STEPMAKE_WARN, [