1 dnl -*-fundamental-*- *@--GLOB-HEADER--@*
3 dnl $Id: aclocal.glob,v 1.17 2003/09/24 22:45:57 mdw Exp $
5 dnl Common library of autoconf macros
7 dnl (c) 1997 Mark Wooding, except for macros and documentation where noted.
10 dnl----- Licensing notice ---------------------------------------------------
12 dnl This file is part of the Common Files Distribution (`common')
14 dnl `Common' is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU General Public License as published by
16 dnl the Free Software Foundation; either version 2 of the License, or
17 dnl (at your option) any later version.
19 dnl `Common' is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU General Public License for more details.
24 dnl You should have received a copy of the GNU General Public License
25 dnl along with `common'; if not, write to the Free Software Foundation,
26 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 dnl----- Revision history ---------------------------------------------------
30 dnl $Log: aclocal.glob,v $
31 dnl Revision 1.17 2003/09/24 22:45:57 mdw
32 dnl Support Automake's `aclocal' scheme. Deposit Autoconf fragments in
33 dnl `aclocal's' repository. Apply heinous bodging to `txtlib' and
36 dnl Revision 1.16 2003/04/23 12:47:22 mdw
39 dnl Revision 1.15 2002/02/19 22:50:24 mdw
40 dnl Fix spelling. Add new macro which works out where to put TeX files.
42 dnl Revision 1.14 2002/02/03 19:15:15 mdw
43 dnl Add SDL-finding equipment. Quote some macro names which need it. Add
44 dnl long-overdue macros for expanding configured paths (and do it
47 dnl Revision 1.13 2001/02/23 09:07:24 mdw
48 dnl Restore temporary variable on exit.
50 dnl Revision 1.12 2001/02/04 01:18:52 mdw
51 dnl Overhaul the mLib debugging options.
53 dnl Revision 1.11 2001/01/20 12:03:08 mdw
54 dnl Remove redundant stuff.
56 dnl Revision 1.10 2000/10/14 16:32:15 mdw
57 dnl Fixes from upstream.
59 dnl Revision 1.9 2000/08/15 21:37:49 mdw
60 dnl New initialization macro for libraries, and a new base client macro for
61 dnl finding libraries with an appropriate version.
63 dnl Revision 1.8 1999/11/26 01:23:17 mdw
64 dnl And support for MXD (not yet released).
66 dnl Revision 1.7 1999/11/11 20:03:58 mdw
67 dnl Add support for mgLib too.
69 dnl Revision 1.6 1999/11/11 17:49:33 mdw
70 dnl New macros for configuring clients of mLib and Catacomb.
72 dnl Revision 1.5 1999/07/27 18:27:37 mdw
73 dnl Fix typo in header line for mdw_DECL_ENVIRON.
75 dnl Revision 1.4 1999/07/26 23:44:32 mdw
76 dnl Reorder and tidy documentation.
78 dnl Revision 1.3 1999/07/17 10:27:44 mdw
79 dnl More useful macros added.
81 dnl Revision 1.2 1999/05/13 22:57:23 mdw
82 dnl Change `-ise' to `-ize' throughout.
84 dnl Revision 1.1.1.1 1999/05/05 19:23:47 mdw
85 dnl New import. The old CVS repository was lost in a disk disaster.
88 dnl *@--NOTICE--@* Common File Distribution
89 dnl $Id: aclocal.glob,v 1.17 2003/09/24 22:45:57 mdw Exp $
91 dnl --- *@-mdw_REQUIRE-@* ---
93 dnl Author: Mark Wooding
95 dnl Synopsis: mdw_REQUIRE(MACRO, ARGS...)
97 dnl Arguments: MACRO = name of a macro which should have been called
98 dnl ARGS = arguments to pass
100 dnl Use: Like `AC_REQUIRE', only it handles arguments.
102 AC_DEFUN([mdw_REQUIRE],
103 [ifdef([AC_PROVIDE_$1], ,
104 [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
109 dnl --- *@-mdw_CURSES-@* ---
111 dnl Author: Mark Wooding
113 dnl Synopsis: mdw_CURSES
117 dnl Use: Searches for a `curses' library (one of `ncurses' or
118 dnl `curses') using mdw_CHECK_MANYLIBS. If one is found, the
119 dnl preprocessor macro HAVE_CURSES is defined, and a search is
120 dnl made for a `curses' header file (one of <ncurses.h>,
121 dnl <ncurses/ncurses.h> or <curses.h>) using AC_CHECK_HEADERS
122 dnl and the appropriate preprocessor symbol is defined.
123 dnl Finally, a check is made for the function `wresize' using
126 AC_DEFUN([mdw_CURSES],
127 [mdw_CHECK_MANYLIBS(newwin, ncurses curses, AC_DEFINE(HAVE_CURSES))
128 if test $mdw_cv_lib_newwin != no; then
129 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h], [break])
130 if test "$ac_cv_header_ncurses_h" = "no" &&
131 test "$ac_cv_header_ncurses_ncurses_h" = "no" &&
132 test "$ac_cv_header_curses_h" = "no"; then
133 AC_MSG_WARN([couldn't find a \`curses' header. Assuming \`curses.h'.])
134 AC_DEFINE(HAVE_CURSES_H)
136 AC_CHECK_FUNCS(wresize)
139 dnl --- *@-mdw_TYPE_SSIZE_T-@* ---
141 dnl Author: Mark Wooding
143 dnl Synopsis: mdw_TYPE_SSIZE_T
147 dnl Use: Checks whether the Posix type `ssize_t' is defined. If not,
148 dnl it defaults to `int'.
150 AC_DEFUN([mdw_TYPE_SSIZE_T],
151 [AC_REQUIRE([AC_HEADER_STDC])
152 AC_CACHE_CHECK(for ssize_t, mdw_cv_ssize_t,
153 [AC_EGREP_CPP(ssize_t,
154 [#include <sys/types.h>
162 [mdw_cv_ssize_t=yes], [mdw_cv_ssize_t=no])])
163 if test $mdw_cv_ssize_t = no; then
164 AC_DEFINE(ssize_t, int)
167 dnl --- *@-mdw_DECL_ENVIRON-@* ---
169 dnl Author: Mark Wooding
171 dnl Synopsis: mdw_DECL_ENVIRON
175 dnl Use: Searches for a declaration of the global `environ' variable.
176 dnl If one is found in one of the `usual' places, DECL_ENVIRON
177 dnl is defined as a preprocessor symbol.
179 AC_DEFUN([mdw_DECL_ENVIRON],
180 [AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ,
181 [AC_EGREP_CPP(environ,
182 [#include <sys/types.h>
189 #endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])])
190 if test $mdw_cv_environ = yes; then
191 AC_DEFINE(DECL_ENVIRON)
194 dnl --- *@-mdw_CHECK_MANYLIBS-@* ---
196 dnl Author: Mark Wooding
198 dnl Synopsis: mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND],
199 dnl [INCLUDES], [ARGS])
201 dnl Arguments: FUNC = a function to try to find
202 dnl LIBS = a whitespace-separated list of libraries to search
203 dnl IF-FOUND = what to do when the function is found
204 dnl IF-NOT-FOUND = what to do when the function isn't found
205 dnl INCLUDES = other include files to add
206 dnl ARGS = arguments to pass the function
208 dnl Use: Searches for a library which defines FUNC. It first tries
209 dnl without any libraries; then it tries each library specified
210 dnl in LIBS in turn. If it finds a match, it adds the
211 dnl appropriate library to `LIBS'.
213 dnl This is particularly handy under DIREIX: if you link with
214 dnl `-lnsl' then you get non-NIS-aware versions of getpwnam and
215 dnl so on, which is clearly a Bad Thing.
217 AC_DEFUN([mdw_CHECK_MANYLIBS],
218 [AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1],
219 [mdw_save_LIBS="$LIBS"
221 AC_TRY_LINK([$5], [$1($6)], [mdw_cv_lib_$1="none required"])
222 test "$mdw_cv_lib_$1" = "no" && for i in $2; do
223 LIBS="-l$i $mdw_save_LIBS"
224 AC_TRY_LINK([$5], [$1($6)],
225 [mdw_cv_lib_$1="-l$i"
228 LIBS="$mdw_save_LIBS"])
229 if test "$mdw_cv_lib_$1" != "no"; then
230 test "$mdw_cv_lib_$1" = "none required" || LIBS="$mdw_cv_lib_$1 $LIBS"
236 dnl --- *@-mdw__PERL_VERSION-@* ---
238 dnl AC_DEFUN relies on `[', `]' being quotes, so I have to drop down a level.
241 define([mdw__PERL_VERSION], <<$1 -e 'exit ($] < $2);' >&5 2>&5>>)
244 dnl --- *@-mdw_PROG_PERL-@* ---
246 dnl Author: Mark Wooding
248 dnl Synopsis: mdw_PROG_PERL(VERSION, [IF-FOUND], [IF-NOT-FOUND])
250 dnl Arguments: VERSION = version number of Perl required
251 dnl IF-FOUND = what to do if it's found
252 dnl IF-NOT-FOUND = what to do if it isn't
254 dnl Use: Attempts to find a working version of Perl with a late
255 dnl enough version number. It supplies an option `--with-perl'
256 dnl to allow the user to provide a Perl interpreter. If one
257 dnl isn't provided explicitly, it searches for `perl' and `perl5'
258 dnl in the current PATH, asking them whether they have a late
259 dnl enough version number. The path of the working Perl is
260 dnl put into the `PERL' environment variable; `AC_SUBST' is used
261 dnl to substitute its value into Perl scripts. If there is no
262 dnl Perl to be found, the value of `PERL' is set to be `none'.
264 AC_DEFUN([mdw_PROG_PERL],
266 [ --with-perl=PERL specify path to Perl version $1 or newer],
268 if test -z "$PERL"; then
269 [AC_CACHE_CHECK([for Perl version $1 or later], mdw_cv_prog_perl,
270 [mdw_cv_prog_perl="none"
271 for p in `echo "$PATH:/usr/local/bin" | tr ":" " "`; do
272 case $p in /*) ;; *) p=`pwd`/$p ;; esac
273 if mdw__PERL_VERSION(["$p/perl"], $1); then
274 mdw_cv_prog_perl="$p/perl"
277 if mdw__PERL_VERSION(["$p/perl5"], $1); then
278 mdw_cv_prog_perl="$p/perl5"
282 PERL="$mdw_cv_prog_perl"])
286 if test "$PERL" = "none"; then :
292 dnl --- *@-mdw_CHECK_PERL-@* ---
294 dnl Author: Mark Wooding
296 dnl Synopsis: mdw_CHECK_PERL(VERSION)
298 dnl Arguments: VERSION = version number of Perl required
300 dnl Use: Verifies that the Perl interpreter in the `PERL' shell
301 dnl variable actually works and is of the right version. If it's
302 dnl not, an error is raised and configuration is aborted.
304 AC_DEFUN([mdw_CHECK_PERL],
305 [mdw_REQUIRE([mdw_PROG_PERL], [$1])
306 AC_MSG_CHECKING([whether Perl ($PERL) works])
307 if test "$PERL" != "none" && mdw__PERL_VERSION("$PERL", $1); then
311 AC_MSG_ERROR([Perl version $1 or newer not found.
312 If you have a recent enough Perl, and I just failed to find it, try using
313 the --with-perl=PERL option to give me an explicit pathname.])
316 dnl --- *@-mdw_PERLLIB_CHECK-@* ---
318 dnl Author: Mark Wooding
320 dnl Synopsis: mdw_PERLLIB_CHECK(LIBRARY)
322 dnl Arguments: LIBRARY = name of a Perl library to check for
324 dnl Use: Ensures that a Perl script can `use LIBRARY;'. If it can,
325 dnl all's well and good; if it can't, `LIBRARY.pm' is added to
326 dnl the variable `NEEDED_PERLLIBS' and a line which adds
327 dnl `pkgdatadir' to Perl's `@INC' array is placed in the
328 dnl variable `INC_PERLLIBS'; `AC_SUBST' is called for both of
329 dnl these variables. It's expected that `NEEDED_PERLLIBS' will
330 dnl be used in the `Makefile.in' to decide which versions from
331 dnl the distribution need installing.
333 dnl This macro isn't terribly useful in the general case. It
334 dnl Also implicitly assumes that `$PERL' is Perl 5 or later.
336 AC_DEFUN([mdw__PERLLIB_INIT],
337 [AC_SUBST(INC_PERLLIBS)dnl
338 AC_SUBST(NEEDED_PERLLIBS)dnl
341 AC_DEFUN([mdw_PERLLIB_CHECK],
342 [AC_REQUIRE([mdw__PERLLIB_INIT])
343 mdw_REQUIRE([mdw_CHECK_PERL], 5)
344 AC_CACHE_CHECK([for Perl library $1], mdw_cv_perllib_$1,
345 [if $PERL -e 'use $1;' >&5 2>&5; then
346 mdw_cv_perllib_$1="yes"
348 mdw_cv_perllib_$1="no"
351 if test "$mdw_cv_perllib_$1" = "no"; then
352 NEEDED_PERLLIBS="$NEEDED_PERLLIBS $1.pm"
354 # --- Deal with autoconf lossage ---
356 # It doesn't want to define `prefix' until rather later on, so I have
359 if test -z "$INC_PERLLIBS"; then
360 mdw_old_prefix="$prefix"
361 test "$prefix" = "NONE" && prefix="$ac_default_prefix";
362 INC_PERLLIBS="BEGIN { push @INC, \"`eval echo $datadir/$PACKAGE`\"; }"
363 prefix="$mdw_old_prefix";
367 dnl --- *@-mdw_GCC_FLAGS-@* ---
369 dnl Author: Mark Wooding
371 dnl Synopsis: mdw_GCC_FLAGS([FLAGS], [CFLAGS], [C++FLAGS])
373 dnl Arguments: FLAGS = GCC compiler flags to add (default is
374 dnl `-pedantic -Wall')
375 dnl CFLAGS = GCC C compiler flags to add (default is empty)
376 dnl C++FLAGS = GCC C++ compiler flags to add (default is
377 dnl `-fhandle-exceptions').
379 dnl Use: If the C compiler is GCC, add the compiler flags.
381 AC_DEFUN([mdw_GCC_FLAGS],
382 [if test "$GCC" = "yes"; then
383 CFLAGS="$CFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
384 CFLAGS="$CFLAGS ifelse([$2], [], [], [$2])"
386 if test "$GXX" = "yes"; then
387 CXXFLAGS="$CXXFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
388 CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"
391 dnl --- *@-mdw_INIT_LIB-@* ---
393 dnl Author: Mark Wooding
395 dnl Synopsis: mdw_INIT_LIB(LIB, NAME, VERSION, [PACKAGE])
397 dnl Arguments: LIB = the name of the library (and the package)
398 dnl NAME = a presentable version of the library's name
399 dnl VERSION = version of the library
400 dnl PACKAGE = package name to pass on to AM_INIT_AUTOMAKE
402 dnl Use: Sets up various useful variables. This macro calls
403 dnl AM_INIT_AUTOMAKE, which might be considered useful. It also
404 dnl provides variables for the use of `lib-config.in'.
406 AC_DEFUN([mdw_INIT_LIB],
407 [AM_INIT_AUTOMAKE(ifelse([$4], [], [$1], [$4]), [$3])
408 LIBRARY="$1" AC_SUBST(LIBRARY)
409 LIBNAME="$2" AC_SUBST(LIBNAME)])
411 dnl --- *@-mdw_LIB_CONFIG-@* ---
413 dnl Author: Mark Wooding
415 dnl Synopsis: mdw_LIB_CONFIG(LIB, NAME, VERSION, IF-FOUND, IF-NOT-FOUND)
417 dnl Arguments: LIB = the name of the library (and its configuration program)
418 dnl NAME = a presentable version of the library's name
419 dnl VERSION = version of library required
420 dnl IF-FOUND = what to do if found
421 dnl IF-NOT-FOUND = what to do if not found
423 dnl Use: Configures a library client program, using a configuration
424 dnl script provided by the library maintainer.
426 dnl The default version is 1.0.0pre0; the default action is to
427 dnl add everything to the CFLAGS and LIBS variables, and complain
428 dnl if the library couldn't be found.
430 dnl The variable LIB_VERSION contains the version number of
431 dnl the library; LIB_CFLAGS is the C compiler flags required
432 dnl and LIB_LIBS is the linker flags.
434 AC_DEFUN([mdw_LIB_CONFIG],
435 [pushdef([upname], translit([$1], [a-z], [A-Z]))dnl
436 AC_MSG_CHECKING([for $2 library])
437 if $1-config --check $3 >/dev/null 2>&1; then
438 upname[]_VERSION=`$1-config --version`
439 upname[]_CFLAGS=`$1-config --cflags`
440 upname[]_LIBS=`$1-config --libs`
441 AC_SUBST(upname[]_VERSION)
442 AC_SUBST(upname[]_CFLAGS)
443 AC_SUBST(upname[]_LIBS)
445 [CFLAGS="$CFLAGS $upname[]_CFLAGS"
446 LIBS="$upname[]_LIBS $LIBS"],
448 AC_MSG_RESULT([$upname[]_VERSION])
451 AC_MSG_ERROR([$2 library not found or too old.]),
453 AC_MSG_RESULT([not found])
457 dnl --- *@-mdw_MLIB-@* ---
459 dnl Author: Mark Wooding
461 dnl Synopsis: mdw_MLIB(VERSION, IF-FOUND, IF-NOT-FOUND
463 dnl Arguments: VERSION = version of library required
464 dnl IF-FOUND = what to do if found
465 dnl IF-NOT-FOUND = what to do if not found
467 dnl Use: Configures an mLib client program.
469 AC_DEFUN([mdw_MLIB], [mdw_LIB_CONFIG(mLib, mLib, $@)])
471 dnl --- *@-mdw_MGLIB-@* ---
473 dnl Author: Mark Wooding
475 dnl Synopsis: mdw_MGLIB(VERSION, IF-FOUND, IF-NOT-FOUND
477 dnl Arguments: VERSION = version of library required
478 dnl IF-FOUND = what to do if found
479 dnl IF-NOT-FOUND = what to do if not found
481 dnl Use: Configures an mgLib client program.
483 AC_DEFUN([mdw_MGLIB],
484 [mdw_REQUIRE([mdw_MLIB], [1.6.0])
485 mdw_LIB_CONFIG(mgLib, mgLib, $@)])
487 dnl --- *@-mdw_CATACOMB-@* ---
489 dnl Author: Mark Wooding
491 dnl Synopsis: mdw_CATACOMB([VERSION], [IF-FOUND], [IF-NOT-FOUND])
493 dnl Arguments: VERSION = version of Catacomb required
494 dnl IF-FOUND = what to do if found
495 dnl IF-NOT-FOUND = what to do if not found
497 dnl Use: Configures the program as a Catacomb client.
499 AC_DEFUN([mdw_CATACOMB],
500 [mdw_REQUIRE([mdw_MLIB], [1.6.0])
501 mdw_LIB_CONFIG(catacomb, Catacomb, $@)])
503 dnl --- *@-mdw_PK-@* ---
505 dnl Author: Mark Wooding
507 dnl Synopsis: mdw_PK([VERSION], [IF-FOUND], [IF-NOT-FOUND])
509 dnl Arguments: VERSION = version of PK required
510 dnl IF-FOUND = what to do if found
511 dnl IF-NOT-FOUND = what to do if not found
513 dnl Use: Configures the program as a PK client.
516 [mdw_REQUIRE([mdw_MLIB], [1.6.0])
517 mdw_LIB_CONFIG(pk, PK, $@)])
519 dnl --- *@-mdw_OPT_NDEBUG-@* ---
521 dnl Author: Mark Wooding
523 dnl Synopsis: mdw_OPT_NDEBUG
527 dnl Use: Turns on the `NDEBUG' flag, to disable useful things like
530 AC_DEFUN([mdw_OPT_NDEBUG],
531 [AC_ARG_ENABLE(debugging,
532 [ --disable-debugging spews vast swathes of useless information],
533 [if test "$enableval" = "no"; then
537 dnl --- *@-mdw_OPT_EFENCE-@* ---
539 dnl Author: Mark Wooding
541 dnl Synopsis: mdw_OPT_EFENCE
545 dnl Use: Links with the Electric Fence library.
547 AC_DEFUN([mdw_OPT_EFENCE],
548 [AC_ARG_WITH(electric-fence,
549 [ --with-electric-fence link programs with Electric Fence],
550 [if test "$withval" = "yes"; then
551 AC_CHECK_LIB(efence, malloc)
554 dnl --- *@-mdw_OPT_TRACE-@* ---
556 dnl Author: Mark Wooding
558 dnl Synopsis: mdw_OPT_TRACE
562 dnl Use: Turns on the `NTRACE' flag, to disable useful things like
565 AC_DEFUN([mdw_OPT_TRACE],
566 [AC_ARG_ENABLE(tracing,
567 [ --disable-tracing disable output of trace information],
568 [if test "$enableval" = "no"; then
572 dnl --- *@-mdw_OPT_mLib_TRACK-@* ---
574 dnl Author: Mark Wooding
576 dnl Synopsis: mdw_OPT_mLib_TRACK(PROGRAM)
578 dnl Arguments: PROGRAM = name of this program or package.
580 dnl Use: Controls the unsupported mLib memory tracker. The
581 dnl following are defined:
583 dnl --enable-track turns on malloc tracking
584 dnl --enable-blame-PROGRAM tracks malloc contexts in PROGRAM
586 dnl There must be a separate `blame' option for each program,
587 dnl so that the various blame options in a hierarchy get
588 dnl propagated properly. This is an obsolete feature from the
589 dnl days when mLib was provided as a subdirectory of other
592 AC_DEFUN([mdw_OPT_mLib_TRACK],
593 [AC_REQUIRE([mdw_OPT_TRACE])
595 [ --enable-track enable tracking of malloc and free],
596 [AC_DEFINE(TRACK_ENABLE, 1)])
597 AC_ARG_ENABLE(blame-$1,
599 track malloc contexts while in $1],
600 [AC_DEFINE(TRACK_BLAME, 1)])])
602 dnl --- *@-mdw_OPT_mLib_DEBUG-@* ---
604 dnl Author: Mark Wooding
606 dnl Synopsis: mdw_OPT_mLib_DEBUG(PROGRAM)
608 dnl Arguments: PROGRAM = name of this program or package.
610 dnl Use: Provides all of the above debugging options.
612 AC_DEFUN([mdw_OPT_mLib_DEBUG],
613 [mdw_REQUIRE([mdw_OPT_NDEBUG])
614 mdw_REQUIRE([mdw_OPT_mLib_TRACK], [$1])])
616 dnl --- *@-mdw_DEFINE_PATHS-@*
618 dnl Author: Mark Wooding
620 dnl Synopsis: mdw_DEFINE_FILES(CODE)
622 dnl Arguments: CODE = shell script code to execute
624 dnl Use: Fixes up various variables so that pathname defines can be
625 dnl defined. Within CODE, you may use the following macros:
627 dnl mdw_PROG(NAME) Transformed program name
629 dnl mdw_PATH(PATH) Expanded path (may contain variables)
631 dnl mdw_DEFINE_PROG(SYMBOL, PROG)
632 dnl Define a symbol as a transformed
635 dnl mdw_DEFINE_PATH(SYMBOL, NAME)
636 dnl Define a symbol as an expanded path
638 AC_DEFUN([mdw_DEFINE_PATHS],
639 [mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
640 mdw_transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
641 test "$prefix" = "NONE" && prefix=$ac_default_prefix
642 test "$exec_prefix" = "NONE" && exec_prefix=$prefix
644 prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix])
646 AC_DEFUN([mdw_PROG], [`echo "$1"|sed "$mdw_transform"`])
647 AC_DEFUN([mdw_PATH], [dnl
651 *\\$[]*) t=\`eval echo "$t"\`;; dnl
655 AC_DEFUN([mdw_DEFINE_PROG], [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"])])
656 AC_DEFUN([mdw_DEFINE_PATH], [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"])])
658 dnl --- *@-mdw_DIR_TEXMF-@* ---
660 dnl Author: Mark Wooding
662 dnl Synopsis: mdw_DIR_TEXMF
666 dnl Use: Sets the substitution `texmfdir' as a sensible TeX install
669 AC_DEFUN([mdw_DIR_TEXMF], [
670 AC_ARG_WITH([texmfdir],
671 [ --with-texmfdir=DIR set the TeX install directory to DIR],
673 [AC_MSG_CHECKING([where to put installed TeX files])
675 texmfdir='${datadir}/texmf'
677 '${datadir}/texmf' '${prefix}/lib/texmf' \
678 '${prefix}/texmf' '${libdir}/lib/texmf'; do
679 if test -d "mdw_PATH([$d])"; then
684 AC_MSG_RESULT([$texmfdir])])])
687 dnl --- *@-mdw_MANEXT-@* ---
689 dnl Author: Mark Wooding
691 dnl Synopsis: mdw_MANEXT
695 dnl Use: Sets the substitution `manext' for man page extensions.
697 AC_DEFUN([mdw_MANEXT], [
698 AC_ARG_WITH([man-ext],
699 [ --with-man-ext=EXT give manpages the EXT extension (e.g., foo.3EXT)],
700 [manext=$withval], [manext=mLib])
703 dnl----- That's all, folks --------------------------------- *@--GLOB-END--@*