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 -n 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 -n 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 -n 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-""}
157 AC_ARG_ENABLE(checking,
158 [ --enable-checking set runtime checks (assert calls). Default: on],
159 [checking_b=$enableval] )
161 AC_ARG_ENABLE(debugging,
162 [ --enable-debugging compile with debugging info. Default: on],
163 [debug_b=$enableval])
165 AC_ARG_ENABLE(optimising,
166 [ --enable-optimising compile with optimising. Default: on],
167 [optimise_b=$enableval])
169 AC_ARG_ENABLE(profiling,
170 [ --enable-profiling compile with gprof support. Default: off],
171 [profile_b=$enableval])
174 [ --enable-pipe compile with -pipe. Default: on],
177 if test "$checking_b" = no; then
180 DEFINES="$DEFINES -DNDEBUG"
183 if test "$optimise_b" = yes; then
184 OPTIMIZE="-O2 -finline-functions"
187 if test $profile_b = yes; then
189 OPTIMIZE="$OPTIMIZE -pg"
192 if test $debug_b = yes; then
193 OPTIMIZE="$OPTIMIZE -g"
197 STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1)
201 # If -pipe requested, test if it works and add to CFLAGS.
202 if test "$pipe_b" = yes; then
203 save_cflags="$CFLAGS"
204 CFLAGS="-pipe $CFLAGS";
205 AC_CACHE_CHECK([whether compiler understands -pipe],
206 [stepmake_cflags_pipe],
207 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[/* -pipe test */]])],
208 [stepmake_cflags_pipe=yes],
209 [stepmake_cflags_pipe=no]))
211 if test $stepmake_cflags_pipe = yes; then
212 OPTIMIZE="$OPTIMIZE -pipe"
216 CFLAGS="$CFLAGS $OPTIMIZE"
217 CPPFLAGS=${CPPFLAGS-""}
219 AC_MSG_CHECKING([for IEEE-conformance compiler flags])
220 save_cflags="$CFLAGS"
223 dnl should do compile test?
224 AC_MSG_RESULT(-mieee)
225 CFLAGS="-mieee $CFLAGS"
228 AC_MSG_RESULT([none])
232 AC_SUBST(cross_compiling)
239 AC_SUBST(EXTRA_LIBES)
242 AC_DEFUN(STEPMAKE_CXX, [
245 STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
247 CPPFLAGS="$CPPFLAGS $DEFINES"
248 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
249 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
258 AC_DEFUN(STEPMAKE_CXXTEMPLATE, [
259 AC_CACHE_CHECK([whether explicit instantiation is needed],
260 lily_cv_need_explicit_instantiation,
261 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
262 template <class T> struct foo { static int baz; };
263 template <class T> int foo<T>::baz = 1;
264 ]], [[ return foo<int>::baz; ]])],[lily_cv_need_explicit_instantiation=no],[lily_cv_need_explicit_instantiation=yes]))
265 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
266 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
271 AC_DEFUN(STEPMAKE_DATADIR, [
272 if test "$datadir" = "\${prefix}/share"; then
273 datadir='${prefix}/share'
276 if test "$prefix" = "NONE"; then
277 presome=${ac_default_prefix}
280 build_package_datadir=$ugh_ugh_autoconf250_builddir/share/$package
282 DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"`
283 BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"`
286 AC_SUBST(build_package_datadir)
287 AC_DEFINE_UNQUOTED(DATADIR, ["${DATADIR}"])
288 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, ["${BUILD_PACKAGE_DATADIR}"])
291 ## ugh: cut & paste programming from datadir.
292 AC_DEFUN(STEPMAKE_LIBDIR, [
294 if test "$libdir" = "\${exec_prefix}/lib"; then
295 libdir='${exec_prefix}/lib'
298 build_package_libdir=$ugh_ugh_autoconf250_builddir/lib/$package
300 LIBDIR=`echo ${libdir} | sed "s!\\\${exec_prefix}!$presome!"`
301 BUILD_PACKAGE_LIBDIR=`echo ${build_package_libdir} | sed "s!\\\${exec_prefix}!$presome!"`
304 AC_SUBST(build_package_libdir)
305 AC_DEFINE_UNQUOTED(LIBDIR, ["${LIBDIR}"])
306 AC_DEFINE_UNQUOTED(BUILD_PACKAGE_LIBDIR, ["${BUILD_PACKAGE_LIBDIR}"])
310 AC_DEFUN(STEPMAKE_END, [
314 AC_CONFIG_FILES([$CONFIGFILE.make:config.make.in])
317 if test -n "$OPTIONAL"; then
319 echo "WARNING: Please consider installing optional programs: $OPTIONAL"
322 if test -n "$REQUIRED"; then
324 echo "ERROR: Please install required programs: $REQUIRED"
327 if test -n "$UNSUPPORTED"; then
329 echo "ERROR: Please use older version of programs: $UNSUPPORTED"
332 if test -n "$OPTIONAL$REQUIRED$UNSUPPORTED"; then
334 echo "See INSTALL.txt for more information on how to build $PACKAGE_NAME"
335 if test -f config.cache ; then
336 echo "Remove config.cache before rerunning ./configure"
340 if test -n "$REQUIRED$UNSUPPORTED"; then
341 rm -f $srcdir/GNUmakefile
345 # regular in-place build
346 # test for srcdir_build = yes ?
347 if test "$srcdir_build" = "yes"; then
348 rm -f $srcdir/GNUmakefile
349 cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
350 chmod 444 $srcdir/GNUmakefile
351 else # --srcdir build
353 cp $srcdir/make/srcdir.make.in GNUmakefile
354 chmod 444 GNUmakefile
359 AC_DEFUN(STEPMAKE_FLEX, [
360 # ugh, automake: we want (and check for) flex
362 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
366 ac_cv_prog_lex_root=lex.yy
367 STEPMAKE_PROGS(FLEX, flex, $1)
371 AC_DEFUN(STEPMAKE_FLEXLEXER, [
372 AC_CHECK_HEADERS([FlexLexer.h],[true],[false])
373 if test $? -ne 0; then
374 warn='FlexLexer.h (flex package)'
375 STEPMAKE_ADD_ENTRY($1, $warn)
377 # check for yyFlexLexer.yy_current_buffer,
378 # in 2.5.4 <= flex < 2.5.29
380 AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer],
381 [stepmake_flexlexer_yy_current_buffer],
382 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
384 #include <FlexLexer.h>
385 class yy_flex_lexer: public yyFlexLexer
390 yy_current_buffer = 0;
394 [stepmake_flexlexer_yy_current_buffer=yes],
395 [stepmake_flexlexer_yy_current_buffer=no]))
396 if test $stepmake_flexlexer_yy_current_buffer = yes; then
397 AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.])
403 AC_DEFUN(STEPMAKE_GCC, [
404 if test "$GCC" = "yes"; then
405 STEPMAKE_CHECK_VERSION(CC, $1, $2)
407 warn="$CC (Please install *GNU* cc)"
408 STEPMAKE_ADD_ENTRY($1, $warn)
412 AC_DEFUN(STEPMAKE_GETTEXT, [
414 if test "$prefix" = "NONE"; then
415 presome=${ac_default_prefix}
417 LOCALEDIR=`echo ${localedir} | sed "s!\\\${prefix}!$presome!"`
420 AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"])
421 # ouch. autoconf <= 2.57's gettext check fails for
422 # g++ >= 3.3 (with -std=gnu++98, the default).
423 # While the check is OK for g++ -std=c++98,
424 # LilyPond needs GNU g++, so who is to blame here?
425 # Use a workaround until this is resolved:
426 # for g++ >= 3.3, select C language.
428 STEPMAKE_CHECK_VERSION_UNSUPPORTED(CXX, GCC_UNSUPPORTED, 3.3)
429 if test -n "$GCC_UNSUPPORTED"; then
430 AC_MSG_WARN([autoconf <= 2.57 with g++ >= 3.3 gettext test broken.])
431 AC_MSG_WARN([Trying gcc, cross thumbs.])
434 AC_CHECK_LIB(intl, gettext)
435 AC_CHECK_FUNCS(gettext)
436 if test -n "$GCC_UNSUPPORTED"; then
442 AC_DEFUN(STEPMAKE_GUILE, [
443 STEPMAKE_PATH_PROG(GUILE, guile, $1)
447 # STEPMAKE_GUILE_FLAGS --- set flags for compiling and linking with Guile
449 # This macro runs the guile-config script, installed with Guile,
450 # to find out where Guile's header files and libraries are
451 # installed. It sets two variables, marked for substitution, as
454 # GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
455 # code that uses Guile header files. This is almost
456 # always just a -I flag.
458 # GUILE_LDFLAGS --- flags to pass to the linker to link a
459 # program against Guile. This includes -lguile for
460 # the Guile library itself, any libraries that Guile
461 # itself requires (like -lqthreads), and so on. It may
462 # also include a -L flag to tell the compiler where to
463 # find the libraries.
465 AC_DEFUN([STEPMAKE_GUILE_FLAGS], [
466 exe=`STEPMAKE_GET_EXECUTABLE($guile_config)`
467 if test -x $exe; then
468 AC_MSG_CHECKING([guile compile flags])
469 GUILE_CFLAGS="`$guile_config compile`"
470 AC_MSG_RESULT($GUILE_CFLAGS)
471 AC_MSG_CHECKING([guile link flags])
472 GUILE_LDFLAGS="`$guile_config link`"
473 AC_MSG_RESULT($GUILE_LDFLAGS)
475 AC_SUBST(GUILE_CFLAGS)
476 AC_SUBST(GUILE_LDFLAGS)
480 AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
481 ## First, let's just see if we can find Guile at all.
482 AC_MSG_CHECKING([for guile-config])
483 for guile_config in $GUILE_CONFIG guile-config $target-guile-config $build-guile-config; do
484 AC_MSG_RESULT([$guile_config])
485 if ! $guile_config --version > /dev/null 2>&1 ; then
486 AC_MSG_WARN([cannot execute $guile_config])
487 AC_MSG_CHECKING([if we are cross compiling])
488 GUILE_CONFIG='echo no guile-config'
490 GUILE_CONFIG=$guile_config
494 STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
495 if test $? -ne 0; then
496 STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
499 STEPMAKE_CHECK_SEARCH_RESULT(GUILE_CONFIG)
500 # urg. should test functionality rather than version.
501 if test $? -eq 0 -a -n "$2"; then
502 STEPMAKE_CHECK_VERSION(GUILE_CONFIG, $1, $2)
505 AC_SUBST(GUILE_CONFIG)
508 changequote(<<, >>)dnl
509 GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
510 GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
511 GUILE_PATCH_LEVEL=`expr $guile_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
514 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
515 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
516 AC_DEFINE_UNQUOTED(GUILE_PATCH_LEVEL, $GUILE_PATCH_LEVEL)
520 AC_DEFUN(STEPMAKE_GXX, [
521 if test "$GXX" = "yes"; then
522 STEPMAKE_CHECK_VERSION(CXX, $1, $2)
524 warn="$CXX (Please install *GNU* c++)"
525 STEPMAKE_ADD_ENTRY($1, $warn)
530 AC_DEFUN(STEPMAKE_INIT, [
534 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
535 if test x$MY_PATCH_LEVEL != x; then
536 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
539 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
540 changequote(<<, >>)dnl
541 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
542 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
545 # No versioning on directory names of sub-packages
547 stepmake=${datadir}/stepmake
549 if test "$prefix" = "NONE"; then
550 presome=${ac_default_prefix}
552 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
554 # urg, how is this supposed to work?
555 if test "$program_prefix" = "NONE"; then
558 if test "$program_suffix" = "NONE"; then
562 AC_MSG_CHECKING(Package)
563 if test "$PACKAGE" = "STEPMAKE"; then
564 AC_MSG_RESULT(Stepmake package!)
566 AC_MSG_CHECKING(builddir)
568 ugh_ugh_autoconf250_builddir="`pwd`"
570 if test "$srcdir" = "."; then
574 package_builddir="`dirname $ugh_ugh_autoconf250_builddir`"
575 package_srcdir="`dirname $srcdir`"
577 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
579 (cd stepmake 2>/dev/null || mkdir stepmake)
580 (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
581 # only possible with autoconf < 2.50 -- hardcoded in configure.in
582 # AC_CONFIG_AUX_DIR(bin)
585 AC_MSG_RESULT($PACKAGE)
587 AC_MSG_CHECKING(builddir)
588 ugh_ugh_autoconf250_builddir="`pwd`"
589 if test "$srcdir" = "."; then
594 AC_MSG_RESULT($ugh_ugh_autoconf250_builddir)
596 AC_MSG_CHECKING(for stepmake)
597 # Check for installed stepmake
598 if test -d $stepmake; then
599 AC_MSG_RESULT($stepmake)
601 stepmake="`cd $srcdir/stepmake; pwd`"
602 AC_MSG_RESULT([$srcdir/stepmake ($datadir/stepmake not found)])
605 # only possible with autoconf < 2.50 -- hardcoded in configure.in
606 # AC_CONFIG_AUX_DIR(\
608 # $srcdir/stepmake/bin\
612 AC_SUBST(ugh_ugh_autoconf250_builddir)
616 AC_SUBST(PACKAGE_NAME)
617 # We don't need the upper case variant,
618 # so stick to macros are uppercase convention.
619 # AC_DEFINE_UNQUOTED(package, ["${package}"])
620 # AC_DEFINE_UNQUOTED(PACKAGE, ["${PACKAGE}"])
621 AC_DEFINE_UNQUOTED(PACKAGE, ["${package}"])
622 AC_DEFINE_UNQUOTED(PACKAGE_NAME, ["${PACKAGE_NAME}"])
623 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, ["${FULL_VERSION}"])
625 if test -z "$package_depth"; then
628 package_depth="../$package_depth"
631 AC_SUBST(package_depth)
633 AUTOGENERATE="This file was automatically generated by configure"
634 AC_SUBST(AUTOGENERATE)
637 AC_ARG_ENABLE(config,
638 [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
639 do \`make conf=CONF' to get output in ./out-CONF],
640 [CONFIGURATION=$enableval])
644 test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
645 CONFIGFILE=config$CONFIGSUFFIX
646 AC_SUBST(CONFIGSUFFIX)
649 STEPMAKE_PROGS(MAKE, gmake make, REQUIRED)
650 STEPMAKE_PROGS(FIND, find, REQUIRED)
652 STEPMAKE_PROGS(TAR, tar, REQUIRED)
654 if test "$(echo 2)" != "2" ||
655 test "x`uname`" = "xHP-UX"; then
656 AC_PATH_PROG(KSH, ksh, /bin/ksh)
657 AC_PATH_PROG(BASH, bash, $KSH)
658 STEPMAKE_WARN(avoiding buggy /bin/sh)
659 AC_PATH_PROG(SHELL, bash, $KSH)
662 AC_PATH_PROG(BASH, bash, $SHELL)
666 STEPMAKE_PYTHON(REQUIRED, 1.5)
668 if expr "$MAKE" : '.*\(echo\)' >/dev/null; then
669 $MAKE -v 2> /dev/null | grep GNU > /dev/null
670 if test "$?" = 1; then
671 warn='make (Please install *GNU* make)'
672 # STEPMAKE_WARN($warn)
673 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
677 if test "$OSTYPE" = "cygwin" -o "$OSTYPE" = "cygwin32" -o "$OSTYPE" = "Windows_NT"; then
678 LN=cp # hard link does not work under cygnus-nt
679 LN_S='cp -r' # symbolic link does not work for native nt
685 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
693 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
695 AC_SUBST(program_prefix)
696 AC_SUBST(program_suffix)
701 AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
702 AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
712 AC_DEFUN(STEPMAKE_KPATHSEA, [
714 AC_ARG_WITH(kpathsea-include,
715 [ --with-kpathsea-include=DIR
716 location of the kpathsea include dir],[
717 if test "$withval" = "yes" -o "$withval" = "no"; then
718 AC_MSG_WARN(Usage: --with-kpathsea-include=includedir)
720 CPPFLAGS="$CPPFLAGS -I${withval}"
724 AC_ARG_WITH(kpathsea-lib,
725 [ --with-kpathsea-lib=DIR location of the kpathsea lib dir],[
726 if test "$withval" = "yes" -o "$withval" = "no"; then
727 AC_MSG_WARN(Usage: --with-kpathsea-lib=libdir)
729 LDFLAGS="$LDFLAGS -L${withval}"
734 #FIXME --with-xxx is meant for specifying a PATH too,
735 # so this should read: --enable-kpathsea,
736 # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
737 AC_ARG_WITH(kpathsea,
738 [ --with-kpathsea use kpathsea lib. Default: on],
739 [kpathsea_b=$with_kpathsea])
741 if test "$kpathsea_b" != "no"; then
742 AC_CHECK_HEADERS([kpathsea/kpathsea.h])
743 AC_CHECK_LIB(kpathsea, kpse_find_file)
744 AC_CHECK_FUNCS(kpse_find_file,,kpathsea_b=no)
745 if test "$kpathsea_b" = "no"; then
746 warn='kpathsea (libkpathsea-dev, kpathsea-devel or tetex-devel
748 Else, please specify the location of your kpathsea using
749 --with-kpathsea-include and --with-kpathsea-lib options. You should
750 install kpathsea; see INSTALL.txt. Rerun ./configure
751 --without-kpathsea only if kpathsea is not available for your
753 STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
756 AC_MSG_CHECKING(whether to use kpathsea)
757 if test "$kpathsea_b" != no; then
766 AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
770 AC_DEFUN(STEPMAKE_LIB, [
771 STEPMAKE_PROGS(AR, ar, $1)
773 STEPMAKE_OPTIONAL_REQUIRED(RANLIB, ranlib, $1)
777 AC_DEFUN(STEPMAKE_LIBTOOL, [
779 # **Never** try to set library version numbers so that they correspond
780 # to the release number of your package. This is an abuse that only
781 # fosters misunderstanding of the purpose of library versions.
783 REVISION=$PATCH_LEVEL
784 # CURRENT=$MINOR_VERSION
785 CURRENT=`expr $MINOR_VERSION + 1`
786 # AGE=`expr $MAJOR_VERSION + 1`
794 AC_DEFUN(STEPMAKE_LOCALE, [
799 AC_ARG_WITH(localedir,
800 [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
801 PREFIX/share/locale ],
802 localedir=$with_localedir,
803 localedir='${prefix}/share/locale')
806 [ --with-lang=LANG use LANG as language to emit messages],
810 AC_MSG_CHECKING(language)
812 En* | en* | Am* | am* | US* | us*)
814 NL | nl | Du* | du* | Ned* | ned*)
823 if test "$lang" = "unknown" ; then
824 STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
830 AC_DEFUN(STEPMAKE_MAKEINFO, [
831 STEPMAKE_PROGS(MAKEINFO, makeinfo, $1)
832 if test "$MAKEINFO" = "makeinfo"; then
833 AC_MSG_CHECKING(whether makeinfo can split html by @node)
835 makeinfo --html --output=out/split <<EOF
837 \input texinfo @c -*-texinfo-*-
838 @setfilename split.info
842 if test -d out/split; then
843 SPLITTING_MAKEINFO=yes
848 STEPMAKE_WARN(your html documentation will be one large file)
852 AC_SUBST(SPLITTING_MAKEINFO)
857 AC_DEFUN(STEPMAKE_MAN, [
858 STEPMAKE_PROGS(GROFF, groff ditroff, $1)
860 STEPMAKE_PROGS(TROFF, troff, $1)
862 STEPMAKE_PROGS(TBL, tbl, $1)
867 AC_DEFUN(STEPMAKE_MSGFMT, [
868 STEPMAKE_PROGS(MSGFMT, msgfmt, $1)
872 # Check for program ($2), set full path result to ($1).
873 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
874 AC_DEFUN(STEPMAKE_PATH_PROG, [
875 AC_CHECK_PROGS($1, $2, no)
876 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
877 if test $? -eq 0; then
879 if test -n "$4"; then
880 STEPMAKE_CHECK_VERSION($1, $3, $4)
886 # Check for program in set of names ($2), set result to ($1) .
887 # If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
888 # If exists, and a minimal version ($4) is required
889 AC_DEFUN(STEPMAKE_PROGS, [
890 AC_CHECK_PROGS($1, $2, no)
891 STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
892 if test $? -eq 0 -a -n "$4"; then
893 STEPMAKE_CHECK_VERSION($1, $3, $4)
898 AC_DEFUN(STEPMAKE_PERL, [
899 STEPMAKE_PATH_PROG(PERL, perl, $1)
903 AC_DEFUN(STEPMAKE_PYTHON, [
905 AC_MSG_CHECKING([for python])
906 for python in $PYTHON python python2 python2.3 python2.2 python2.1 python2.0; do
907 AC_MSG_RESULT([$python])
908 if ! $python -V > /dev/null 2>&1 ; then
909 #AC_MSG_WARN([cannot execute $python])
910 PYTHON='echo no python'
913 STEPMAKE_CHECK_VERSION(python, pv, $2)
914 if test -z "$pv"; then
920 if test -n "$pv"; then
921 STEPMAKE_ADD_ENTRY($1, $pv)
923 AC_PATH_PROG(PYTHON, $PYTHON)
927 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
928 unset PYTHON_HEADER PYTHON_INCLUDE
929 if test -n "$PYTHON"; then
930 changequote(<<, >>)dnl
931 # alternatively, for python >= 2.0
932 # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
933 PYTHON_INCLUDE=`$PYTHON -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'`
937 ##AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
938 if test -z "$PYTHON_HEADER"; then
939 #URG -- how to extend include path?
940 ac_compile="$ac_compile -I$PYTHON_INCLUDE"
941 ac_cpp="$ac_cpp -I$PYTHON_INCLUDE"
942 CPPFLAGS="$CPPFLAGS -I$PYTHON_INCLUDE"
943 AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
946 if test -z "$PYTHON_HEADER"; then
947 warn="$PYTHON_INCLUDE/Python.h (python-devel, python-dev or libpython-dev package)"
948 STEPMAKE_ADD_ENTRY($1, $warn)
953 AC_DEFUN(STEPMAKE_TEXMF_DIRS, [
954 AC_ARG_ENABLE(tfm-path,
955 [ --enable-tfm-path=PATH set path of tex directories where tfm files live,
956 esp.: cmr10.tfm. Default: use kpsewhich],
957 [tfm_path=$enableval],
961 STEPMAKE_PROGS(KPSEWHICH, kpsewhich, OPTIONAL)
962 AC_MSG_CHECKING(for tfm path)
966 if test "x$tfm_path" = xauto ; then
967 if test "x$KPSEWHICH" != "xno" ; then
968 for i in $TFM_FONTS; do
969 dir=`$KPSEWHICH tfm ${i}10.tfm`
970 TFM_PATH="$TFM_PATH `dirname $dir`"
973 STEPMAKE_WARN(Please specify where cmr10.tfm lives:
974 ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
980 TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
981 AC_MSG_RESULT($TFM_PATH)
986 AC_DEFUN(STEPMAKE_TEXMF, [
987 # urg, never know what names these teTeX guys will think up
989 STEPMAKE_PROGS(METAFONT, mf mfont, $1)
990 STEPMAKE_PROGS(INIMETAFONT, inimf inimfont, $1)
992 AC_MSG_CHECKING(for working metafont mode)
993 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
994 for MFMODE in $modelist; do
995 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
996 if test -f mfput.tfm; then
1000 AC_MSG_RESULT($MFMODE)
1008 AC_DEFUN(STEPMAKE_WARN, [