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 ## -V: Workaround for python
28 ## Assume, and hunt for, dotted version multiplet.
30 changequote(<<, >>)dnl
31 ("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' | head -1 | \
32 sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/'
36 # Calculate simplistic numeric version from version string ($1)
37 # As yet, we have no need for something more elaborate.
38 AC_DEFUN(STEPMAKE_NUMERIC_VERSION, [
41 if ([$]3) {three = [$]3}
44 {printf "%d\n", [$]1*1000000 + [$]2*1000 + three}'
48 # Add item ($2) to list ($1, one of 'OPTIONAL', 'REQUIRED')
49 AC_DEFUN(STEPMAKE_ADD_ENTRY, [
50 eval "$1"=\"`eval echo \"'$'$1\" \"$2\"`\"
53 # Check if tested program ($2) was found ($1).
54 # If not, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED').
55 # We could abort here if a 'REQUIRED' program is not found
56 AC_DEFUN(STEPMAKE_OPTIONAL_REQUIRED, [
57 STEPMAKE_CHECK_SEARCH_RESULT($1)
58 if test $? -ne 0; then
59 STEPMAKE_ADD_ENTRY($3, $2)
60 if test "$3" = "REQUIRED"; then
61 command="echo ERROR: $2 not found"
62 # abort configure process here?
64 command="- echo $2 not found"
74 # Return if tested proram ($1) was found (true) or not (false).
75 AC_DEFUN(STEPMAKE_CHECK_SEARCH_RESULT, [
76 r="`eval echo '$'"$1"`"
77 if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
80 ##STEPMAKE_WARN(cannot find $2. $3)
86 # Check version of program ($1)
87 # If version is smaller than requested ($3),
88 # add entry to missing-list ($2, one of 'OPTIONAL', 'REQUIRED').
89 AC_DEFUN(STEPMAKE_CHECK_VERSION, [
90 r="`eval echo '$'"$1"`"
91 AC_MSG_CHECKING([$r version])
92 exe=`STEPMAKE_GET_EXECUTABLE($r)`
93 ver=`STEPMAKE_GET_VERSION($exe)`
94 num=`STEPMAKE_NUMERIC_VERSION($ver)`
95 req=`STEPMAKE_NUMERIC_VERSION($3)`
97 if test "$num" -lt "$req"; then
98 STEPMAKE_ADD_ENTRY($2, ["$r >= $3 (installed: $ver)"])
102 # Check version of program ($1)
103 # If version is greater than or equals unsupported ($3),
104 # add entry to unsupported list ($2, 'UNSUPPORTED')
105 AC_DEFUN(STEPMAKE_CHECK_VERSION_UNSUPPORTED, [
106 r="`eval echo '$'"$1"`"
107 AC_MSG_CHECKING([$r version])
108 exe=`STEPMAKE_GET_EXECUTABLE($r)`
109 ver=`STEPMAKE_GET_VERSION($exe)`
110 num=`STEPMAKE_NUMERIC_VERSION($ver)`
111 sup=`STEPMAKE_NUMERIC_VERSION($3)`
112 AC_MSG_RESULT([$ver])
113 if test "$num" -ge "$sup"; then
114 STEPMAKE_ADD_ENTRY($2, ["$r < $3 (installed: $ver)"])
118 ### Macros to build configure.in
121 AC_DEFUN(STEPMAKE_BIBTEX2HTML, [
122 STEPMAKE_PROGS(BIBTEX2HTML, bibtex2html bib2html, $1)
123 if test "$BIBTEX2HTML" = "bib2html"; then
124 BIBTEX2HTML_FLAGS='$< $(@)'
126 BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
128 AC_SUBST(BIBTEX2HTML)
129 AC_SUBST(BIBTEX2HTML_FLAGS)
133 AC_DEFUN(STEPMAKE_BISON, [
134 # ugh, automake: we want (and check for) bison
137 STEPMAKE_PROGS(BISON, bison, $1)
139 # urg. should test functionality rather than version.
140 if test "$BISON" = "bison" -a -n "$2"; then
141 STEPMAKE_CHECK_VERSION(BISON, $1, $2)
146 AC_DEFUN(STEPMAKE_COMPILE, [
147 # -O is necessary to get inlining
149 CXXFLAGS=${CXXFLAGS-$CFLAGS}
150 LDFLAGS=${LDFLAGS-""}
156 AC_ARG_ENABLE(checking,
157 [ --enable-checking set runtime checks (assert calls). Default: on],
158 [checking_b=$enableval] )
160 AC_ARG_ENABLE(debugging,
161 [ --enable-debugging compile with debugging info. Default: on],
162 [debug_b=$enableval])
164 AC_ARG_ENABLE(optimising,
165 [ --enable-optimising compile with optimising. Default: on],
166 [optimise_b=$enableval])
168 AC_ARG_ENABLE(profiling,
169 [ --enable-profiling compile with gprof support. Default: off],
170 [profile_b=$enableval])
173 if test "$checking_b" = no; then
176 DEFINES="$DEFINES -DNDEBUG"
179 if test "$optimise_b" = yes; then
180 OPTIMIZE="-O2 -finline-functions"
184 if test $profile_b = yes; then
186 OPTIMIZE="$OPTIMIZE -pg"
189 if test $debug_b = yes; then
190 OPTIMIZE="$OPTIMIZE -g"
195 STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1)
199 CFLAGS="$CFLAGS $OPTIMIZE"
200 CPPFLAGS=${CPPFLAGS-""}
202 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
203 save_cflags="$CFLAGS"
206 dnl should do compile test?
207 AC_MSG_RESULT(-mieee)
208 CFLAGS="-mieee $CFLAGS"
211 AC_MSG_RESULT([none])
214 AC_SUBST(cross_compiling)
221 AC_SUBST(EXTRA_LIBES)
224 AC_DEFUN(STEPMAKE_CXX, [
227 STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
229 CPPFLAGS="$CPPFLAGS $DEFINES"
230 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
231 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
240 AC_DEFUN(STEPMAKE_CXXTEMPLATE, [
241 AC_CACHE_CHECK([whether explicit instantiation is needed],
242 lily_cv_need_explicit_instantiation,
243 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
244 template <class T> struct foo { static int baz; };
245 template <class T> int foo<T>::baz = 1;
246 ]], [[ return foo<int>::baz; ]])],[lily_cv_need_explicit_instantiation=no],[lily_cv_need_explicit_instantiation=yes]))
247 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
248 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
253 AC_DEFUN(STEPMAKE_DATADIR, [
254 if test "$datadir" = "\${prefix}/share"; then
255 datadir='${prefix}/share'
258 if test "$prefix" = "NONE"; then
259 presome=${ac_default_prefix}
262 build_package_datadir=$ugh_ugh_autoconf250_builddir/share/$package
264 DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"`
265 BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"`
268 AC_SUBST(build_package_datadir)
269 AC_DEFINE_UNQUOTED(DATADIR, ["${DATADIR}"])
270 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, ["${BUILD_PACKAGE_DATADIR}"])
273 ## ugh: cut & paste programming from datadir.
274 AC_DEFUN(STEPMAKE_LIBDIR, [
276 if test "$libdir" = "\${exec_prefix}/lib"; then
277 libdir='${exec_prefix}/lib'
280 build_package_libdir=$ugh_ugh_autoconf250_builddir/lib/$package
282 LIBDIR=`echo ${libdir} | sed "s!\\\${exec_prefix}!$presome!"`
283 BUILD_PACKAGE_LIBDIR=`echo ${build_package_libdir} | sed "s!\\\${exec_prefix}!$presome!"`
286 AC_SUBST(build_package_libdir)
287 AC_DEFINE_UNQUOTED(LIBDIR, ["${LIBDIR}"])
288 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_LIBDIR, ["${BUILD_PACKAGE_LIBDIR}"])
292 AC_DEFUN(STEPMAKE_END, [
296 AC_CONFIG_FILES([$CONFIGFILE.make:config.make.in])
299 if test -n "$OPTIONAL"; then
301 echo "WARNING: Please consider installing optional programs: $OPTIONAL"
304 if test -n "$REQUIRED"; then
306 echo "ERROR: Please install required programs: $REQUIRED"
309 if test -n "$UNSUPPORTED"; then
311 echo "ERROR: Please use older version of programs: $UNSUPPORTED"
314 if test -n "$OPTIONAL$REQUIRED$UNSUPPORTED"; then
316 echo "See INSTALL.txt for more information on how to build $PACKAGE_NAME"
317 echo "Remove config.cache before rerunning ./configure"
320 if test -n "$REQUIRED$UNSUPPORTED"; then
321 rm -f $srcdir/GNUmakefile
325 # regular in-place build
326 # test for srcdir_build = yes ?
327 if test "$srcdir_build" = "yes"; then
328 rm -f $srcdir/GNUmakefile
329 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
330 chmod 444 $srcdir/GNUmakefile
331 else # --srcdir build
333 cp $srcdir/make/srcdir.make.in GNUmakefile
334 chmod 444 GNUmakefile
339 AC_DEFUN(STEPMAKE_FLEX, [
340 # ugh, automake: we want (and check for) flex
342 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
346 ac_cv_prog_lex_root=lex.yy
347 STEPMAKE_PROGS(FLEX, flex, $1)
351 AC_DEFUN(STEPMAKE_FLEXLEXER, [
352 AC_CHECK_HEADERS([FlexLexer.h],[true],[false])
353 if test $? -ne 0; then
354 warn='FlexLexer.h (flex package)'
355 STEPMAKE_ADD_ENTRY($1, $warn)
357 # check for yyFlexLexer.yy_current_buffer,
358 # in 2.5.4 <= flex < 2.5.29
360 AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer],
361 [stepmake_flexlexer_yy_current_buffer],
362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
364 #include <FlexLexer.h>
365 class yy_flex_lexer: public yyFlexLexer
370 yy_current_buffer = 0;
374 [stepmake_flexlexer_yy_current_buffer=yes],
375 [stepmake_flexlexer_yy_current_buffer=no]))
376 if test $stepmake_flexlexer_yy_current_buffer = yes; then
377 AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.])
383 AC_DEFUN(STEPMAKE_GCC, [
384 if test "$GCC" = "yes"; then
385 STEPMAKE_CHECK_VERSION(CC, $1, $2)
387 warn="$CC (Please install *GNU* cc)"
388 STEPMAKE_ADD_ENTRY($1, $warn)
392 AC_DEFUN(STEPMAKE_GETTEXT, [
394 if test "$prefix" = "NONE"; then
395 presome=${ac_default_prefix}
397 LOCALEDIR=`echo ${localedir} | sed "s!\\\${prefix}!$presome!"`
400 AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"])
401 # ouch. autoconf <= 2.57's gettext check fails for
402 # g++ >= 3.3 (with -std=gnu++98, the default).
403 # While the check is OK for g++ -std=c++98,
404 # LilyPond needs GNU g++, so who is to blame here?
405 # Use a workaround until this is resolved:
406 # for g++ >= 3.3, select C language.
408 STEPMAKE_CHECK_VERSION_UNSUPPORTED(CXX, GCC_UNSUPPORTED, 3.3)
409 if test -n "$GCC_UNSUPPORTED"; then
410 AC_MSG_WARN([autoconf <= 2.57 with g++ >= 3.3 gettext test broken.])
411 AC_MSG_WARN([Trying gcc, cross thumbs.])
414 AC_CHECK_LIB(intl, gettext)
415 AC_CHECK_FUNCS(gettext)
416 if test -n "$GCC_UNSUPPORTED"; then
422 AC_DEFUN(STEPMAKE_GUILE, [
423 STEPMAKE_PATH_PROG(GUILE, guile, $1)
427 # STEPMAKE_GUILE_FLAGS --- set flags for compiling and linking with Guile
429 # This macro runs the guile-config script, installed with Guile,
430 # to find out where Guile's header files and libraries are
431 # installed. It sets two variables, marked for substitution, as
434 # GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
435 # code that uses Guile header files. This is almost
436 # always just a -I flag.
438 # GUILE_LDFLAGS --- flags to pass to the linker to link a
439 # program against Guile. This includes -lguile for
440 # the Guile library itself, any libraries that Guile
441 # itself requires (like -lqthreads), and so on. It may
442 # also include a -L flag to tell the compiler where to
443 # find the libraries.
445 AC_DEFUN([STEPMAKE_GUILE_FLAGS], [
446 exe=`STEPMAKE_GET_EXECUTABLE($guile_config)`
447 if test -x $exe; then
448 AC_MSG_CHECKING([guile compile flags])
449 GUILE_CFLAGS="`$guile_config compile`"
450 AC_MSG_RESULT($GUILE_CFLAGS)
451 AC_MSG_CHECKING([guile link flags])
452 GUILE_LDFLAGS="`$guile_config link`"
453 AC_MSG_RESULT($GUILE_LDFLAGS)
455 AC_SUBST(GUILE_CFLAGS)
456 AC_SUBST(GUILE_LDFLAGS)
460 AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
461 ## First, let's just see if we can find Guile at all.
462 AC_MSG_CHECKING([for guile-config])
463 for guile_config in $GUILE_CONFIG guile-config $target-guile-config $build-guile-config; do
464 AC_MSG_RESULT([$guile_config])
465 if ! $guile_config --version > /dev/null 2>&1 ; then
466 AC_MSG_WARN([cannot execute $guile_config])
467 AC_MSG_CHECKING([if we are cross compiling])
468 GUILE_CONFIG='echo no guile-config'
470 GUILE_CONFIG=$guile_config
474 STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
475 if test $? -ne 0; then
476 STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
479 STEPMAKE_CHECK_SEARCH_RESULT(GUILE_CONFIG)
480 # urg. should test functionality rather than version.
481 if test $? -eq 0 -a -n "$2"; then
482 STEPMAKE_CHECK_VERSION(GUILE_CONFIG, $1, $2)
485 AC_SUBST(GUILE_CONFIG)
488 changequote(<<, >>)dnl
489 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
490 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
491 GUILE_PATCH_LEVEL=`expr $guile_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
494 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
495 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
496 AC_DEFINE_UNQUOTED(GUILE_PATCH_LEVEL, $GUILE_PATCH_LEVEL)
500 AC_DEFUN(STEPMAKE_GXX, [
501 if test "$GXX" = "yes"; then
502 STEPMAKE_CHECK_VERSION(CXX, $1, $2)
504 warn="$CXX (Please install *GNU* c++)"
505 STEPMAKE_ADD_ENTRY($1, $warn)
510 AC_DEFUN(STEPMAKE_INIT, [
513 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
514 if test x$MY_PATCH_LEVEL != x; then
515 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
518 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
519 changequote(<<, >>)dnl
520 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
521 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
524 # No versioning on directory names of sub-packages
526 stepmake=${datadir}/stepmake
528 if test "$prefix" = "NONE"; then
529 presome=${ac_default_prefix}
531 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
533 # urg, how is this supposed to work?
534 if test "$program_prefix" = "NONE"; then
537 if test "$program_suffix" = "NONE"; then
541 AC_MSG_CHECKING(Package)
542 if test "$PACKAGE" = "STEPMAKE"; then
543 AC_MSG_RESULT(Stepmake package!)
545 AC_MSG_CHECKING(builddir)
547 ugh_ugh_autoconf250_builddir="`pwd`"
549 if test "$srcdir" = "."; then
553 package_builddir="`dirname $ugh_ugh_autoconf250_builddir`"
554 package_srcdir="`dirname $srcdir`"
556 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
558 (cd stepmake 2>/dev/null || mkdir stepmake)
559 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
560 # only possible with autoconf < 2.50 -- hardcoded in configure.in
561 # AC_CONFIG_AUX_DIR(bin)
564 AC_MSG_RESULT($PACKAGE)
566 AC_MSG_CHECKING(builddir)
567 ugh_ugh_autoconf250_builddir="`pwd`"
568 if test "$srcdir" = "."; then
573 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
575 AC_MSG_CHECKING(for stepmake)
576 # Check for installed stepmake
577 if test -d $stepmake; then
578 AC_MSG_RESULT($stepmake)
580 stepmake="`cd $srcdir/stepmake; pwd`"
581 AC_MSG_RESULT([$srcdir/stepmake ($datadir/stepmake not found)])
584 # only possible with autoconf < 2.50 -- hardcoded in configure.in
585 # AC_CONFIG_AUX_DIR(\
587 # $srcdir/stepmake/bin\
591 AC_SUBST(ugh_ugh_autoconf250_builddir)
595 AC_SUBST(PACKAGE_NAME)
596 # We don't need the upper case variant,
597 # so stick to macros are uppercase convention.
598 # AC_DEFINE_UNQUOTED(package, ["${package}"])
599 # AC_DEFINE_UNQUOTED(PACKAGE, ["${PACKAGE}"])
600 AC_DEFINE_UNQUOTED(PACKAGE, ["${package}"])
601 AC_DEFINE_UNQUOTED(PACKAGE_NAME, ["${PACKAGE_NAME}"])
602 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, ["${FULL_VERSION}"])
604 if test -z "$package_depth"; then
607 package_depth="../$package_depth"
610 AC_SUBST(package_depth)
612 AUTOGENERATE="This file was automatically generated by configure"
613 AC_SUBST(AUTOGENERATE)
616 AC_ARG_ENABLE(config,
617 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
618 do \`make conf=CONF' to get output in ./out-CONF],
619 [CONFIGURATION=$enableval])
623 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
624 CONFIGFILE=config$CONFIGSUFFIX
625 AC_SUBST(CONFIGSUFFIX)
628 STEPMAKE_PROGS(MAKE, gmake make, REQUIRED)
629 STEPMAKE_PROGS(FIND, find, REQUIRED)
631 STEPMAKE_PROGS(TAR, tar, REQUIRED)
633 if test "$(echo 2)" != "2" ||
634 test "x`uname`" = "xHP-UX"; then
635 AC_PATH_PROG(KSH, ksh, /bin/ksh)
636 AC_PATH_PROG(BASH, bash, $KSH)
637 STEPMAKE_WARN(avoiding buggy /bin/sh)
638 AC_PATH_PROG(SHELL, bash, $KSH)
641 AC_PATH_PROG(BASH, bash, $SHELL)
645 STEPMAKE_PYTHON(REQUIRED, 1.5)
647 if expr "$MAKE" : '.*\(echo\)' >/dev/null; then
648 $MAKE -v 2> /dev/null | grep GNU > /dev/null
649 if test "$?" = 1; then
650 warn='make (Please install *GNU* make)'
651 # STEPMAKE_WARN($warn)
652 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
656 if test "$OSTYPE" = "cygwin" -o "$OSTYPE" = "cygwin32" -o "$OSTYPE" = "Windows_NT"; then
657 LN=cp # hard link does not work under cygnus-nt
658 LN_S='cp -r' # symbolic link does not work for native nt
664 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
672 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
674 AC_SUBST(program_prefix)
675 AC_SUBST(program_suffix)
680 AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
681 AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
691 AC_DEFUN(STEPMAKE_KPATHSEA, [
693 AC_ARG_WITH(kpathsea-include,
694 [ --with-kpathsea-include=DIR
695 location of the kpathsea include dir],[
696 if test "$withval" = "yes" -o "$withval" = "no"; then
697 AC_MSG_WARN(Usage: --with-kpathsea-include=includedir)
699 CPPFLAGS="$CPPFLAGS -I${withval}"
703 AC_ARG_WITH(kpathsea-lib,
704 [ --with-kpathsea-lib=DIR location of the kpathsea lib dir],[
705 if test "$withval" = "yes" -o "$withval" = "no"; then
706 AC_MSG_WARN(Usage: --with-kpathsea-lib=libdir)
708 LDFLAGS="$LDFLAGS -L${withval}"
713 #FIXME --with-xxx is meant for specifying a PATH too,
714 # so this should read: --enable-kpathsea,
715 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
716 AC_ARG_WITH(kpathsea,
717 [ --with-kpathsea use kpathsea lib. Default: on],
718 [kpathsea_b=$with_kpathsea])
720 if test "$kpathsea_b" != "no"; then
721 AC_CHECK_HEADERS([kpathsea/kpathsea.h])
722 AC_CHECK_LIB(kpathsea, kpse_find_file)
723 AC_CHECK_FUNCS(kpse_find_file,,kpathsea_b=no)
724 if test "$kpathsea_b" = "no"; then
725 warn='kpathsea (libkpathsea-dev, kpathsea-devel or tetex-devel
727 Else, please specify the location of your kpathsea using
728 --with-kpathsea-include and --with-kpathsea-lib options. You should
729 install kpathsea; see INSTALL.txt. Rerun ./configure
730 --without-kpathsea only if kpathsea is not available for your
732 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
735 AC_MSG_CHECKING(whether to use kpathsea)
736 if test "$kpathsea_b" != no; then
745 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
749 AC_DEFUN(STEPMAKE_LIB, [
750 STEPMAKE_PROGS(AR, ar, $1)
752 STEPMAKE_OPTIONAL_REQUIRED(RANLIB, ranlib, $1)
756 AC_DEFUN(STEPMAKE_LIBTOOL, [
758 # **Never** try to set library version numbers so that they correspond
759 # to the release number of your package. This is an abuse that only
760 # fosters misunderstanding of the purpose of library versions.
762 REVISION=$PATCH_LEVEL
763 # CURRENT=$MINOR_VERSION
764 CURRENT=`expr $MINOR_VERSION + 1`
765 # AGE=`expr $MAJOR_VERSION + 1`
773 AC_DEFUN(STEPMAKE_LOCALE, [
778 AC_ARG_WITH(localedir,
779 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
780 PREFIX/share/locale ],
781 localedir=$with_localedir,
782 localedir='${prefix}/share/locale')
785 [ --with-lang=LANG use LANG as language to emit messages],
789 AC_MSG_CHECKING(language)
791 En* | en* | Am* | am* | US* | us*)
793 NL | nl | Du* | du* | Ned* | ned*)
802 if test "$lang" = "unknown" ; then
803 STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
809 AC_DEFUN(STEPMAKE_MAKEINFO, [
810 STEPMAKE_PROGS(MAKEINFO, makeinfo, $1)
811 if test "$MAKEINFO" = "makeinfo"; then
812 AC_MSG_CHECKING(whether makeinfo can split html by @node)
814 makeinfo --html --output=out/split <<EOF
816 \input texinfo @c -*-texinfo-*-
817 @setfilename split.info
821 if test -d out/split; then
822 SPLITTING_MAKEINFO=yes
827 STEPMAKE_WARN(your html documentation will be one large file)
831 AC_SUBST(SPLITTING_MAKEINFO)
836 AC_DEFUN(STEPMAKE_MAN, [
837 STEPMAKE_PROGS(GROFF, groff ditroff, $1)
839 STEPMAKE_PROGS(TROFF, troff, $1)
841 STEPMAKE_PROGS(TBL, tbl, $1)
846 AC_DEFUN(STEPMAKE_MSGFMT, [
847 STEPMAKE_PROGS(MSGFMT, msgfmt, $1)
851 # Check for program ($2), set full path result to ($1).
852 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
853 AC_DEFUN(STEPMAKE_PATH_PROG, [
854 AC_CHECK_PROGS($1, $2, no)
855 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
856 if test $? -eq 0; then
858 if test -n "$4"; then
859 STEPMAKE_CHECK_VERSION($1, $3, $4)
865 # Check for program in set of names ($2), set result to ($1) .
866 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
867 # If exists, and a minimal version ($4) is required
868 AC_DEFUN(STEPMAKE_PROGS, [
869 AC_CHECK_PROGS($1, $2, no)
870 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
871 if test $? -eq 0 -a -n "$4"; then
872 STEPMAKE_CHECK_VERSION($1, $3, $4)
877 AC_DEFUN(STEPMAKE_PERL, [
878 STEPMAKE_PATH_PROG(PERL, perl, $1)
882 AC_DEFUN(STEPMAKE_PYTHON, [
884 AC_MSG_CHECKING([for python])
885 for python in $PYTHON python python2 python2.3 python2.2 python2.1 python2.0; do
886 AC_MSG_RESULT([$python])
887 if ! $python -V > /dev/null 2>&1 ; then
888 #AC_MSG_WARN([cannot execute $python])
889 PYTHON='echo no python'
892 STEPMAKE_CHECK_VERSION(python, pv, $2)
893 if test -z "$pv"; then
899 if test -n "$pv"; then
900 STEPMAKE_ADD_ENTRY($1, $pv)
902 AC_PATH_PROG(PYTHON, $PYTHON)
906 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
907 unset PYTHON_HEADER PYTHON_INCLUDE
908 if test -n "$PYTHON"; then
909 changequote(<<, >>)dnl
910 # alternatively, for python >= 2.0
911 # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
912 PYTHON_INCLUDE=`$PYTHON -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'`
916 ##AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
917 if test -z "$PYTHON_HEADER"; then
918 #URG -- how to extend include path?
919 ac_compile="$ac_compile -I$PYTHON_INCLUDE"
920 ac_cpp="$ac_cpp -I$PYTHON_INCLUDE"
921 CPPFLAGS="$CPPFLAGS -I$PYTHON_INCLUDE"
922 AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
925 if test -z "$PYTHON_HEADER"; then
926 warn="$PYTHON_INCLUDE/Python.h (python-devel, python-dev or libpython-dev package)"
927 STEPMAKE_ADD_ENTRY($1, $warn)
932 AC_DEFUN(STEPMAKE_TEXMF_DIRS, [
933 AC_ARG_ENABLE(tfm-path,
934 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
935 esp.: cmr10.tfm. Default: use kpsewhich],
936 [tfm_path=$enableval],
940 STEPMAKE_PROGS(KPSEWHICH, kpsewhich, OPTIONAL)
941 AC_MSG_CHECKING(for tfm path)
945 if test "x$tfm_path" = xauto ; then
946 if test "x$KPSEWHICH" != "xno" ; then
947 for i in $TFM_FONTS; do
948 dir=`$KPSEWHICH tfm ${i}10.tfm`
949 TFM_PATH="$TFM_PATH `dirname $dir`"
952 STEPMAKE_WARN(Please specify where cmr10.tfm lives:
953 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
959 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
960 AC_MSG_RESULT($TFM_PATH)
965 AC_DEFUN(STEPMAKE_TEXMF, [
966 # urg, never know what names these teTeX guys will think up
968 STEPMAKE_PROGS(METAFONT, mf mfont, $1)
969 STEPMAKE_PROGS(INIMETAFONT, inimf inimfont, $1)
971 AC_MSG_CHECKING(for working metafont mode)
972 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
973 for MFMODE in $modelist; do
974 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
975 if test -f mfput.tfm; then
979 AC_MSG_RESULT($MFMODE)
987 AC_DEFUN(STEPMAKE_WARN, [