1 dnl Modifications for the latest version of Autoconf for kpathsea.
2 dnl These changes have all been sent back to the Autoconf maintainer via
3 dnl bug-gnu-utils@prep.ai.mit.edu.
6 dnl kb_AC_LIBTOOL_REPLACE_FUNCS(FUNCTION-NAME...)
7 AC_DEFUN(kb_AC_LIBTOOL_REPLACE_FUNCS,
10 AC_CHECK_FUNC($ac_func, , [LIBTOOL_LIBOBJS="$LIBTOOL_LIBOBJS ${ac_func}.lo"])
12 AC_SUBST(LIBTOOL_LIBOBJS)dnl
16 dnl Check if gcc asm for i386 needs external symbols with an underscore.
17 dnl Peter Breitenlohner, April 15, 1996.
18 undefine([pb_AC_ASM_UNDERSCORE])
19 AC_DEFUN(pb_AC_ASM_UNDERSCORE,
21 AC_CACHE_CHECK(whether gcc asm needs underscore, pb_cv_asm_underscore,
23 # Older versions of GCC asm for i386 need an underscore prepended to
24 # external symbols. Figure out if this is so.
25 pb_cv_asm_underscore=yes
29 #if defined (__i386__) && defined (__GNUC__)
36 void sub () { val = 1; }
37 #endif /* assembler */
39 ], [sub], pb_cv_asm_underscore=no)])
40 if test "x$pb_cv_asm_underscore" = xyes; then
41 AC_DEFINE(ASM_NEEDS_UNDERSCORE)
45 dnl Added /lib/... for A/UX.
46 dnl undefine([AC_PATH_X_DIRECT])dnl
48 dnl Changed make to ${MAKE-make}.
49 dnl undefine([AC_PATH_X_XMKMF])dnl
51 dnl Always more junk to check.
52 dnl undefine([AC_PATH_XTRA])dnl
54 dnl Added ac_include support.
55 dnl undefine([AC_OUTPUT_FILES])dnl
58 dnl From automake distribution, by Jim Meyering:
59 dnl Add --enable-maintainer-mode option to configure.
61 AC_DEFUN(AM_MAINTAINER_MODE,
62 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
63 dnl maintainer-mode is disabled by default
64 AC_ARG_ENABLE(maintainer-mode,
65 [ --enable-maintainer-mode enable make rules and dependencies not useful
66 (and sometimes confusing) to the casual installer],
67 USE_MAINTAINER_MODE=$enableval,
68 USE_MAINTAINER_MODE=no)
69 AC_MSG_RESULT($USE_MAINTAINER_MODE)
70 if test "x$USE_MAINTAINER_MODE" = xyes; then
79 dnl Following two are copied from 'acspecific.m4'. --Roozbeh Pournader
81 dnl Unset CC to run configure with cross compiler.
82 AC_DEFUN(AC_UNSET_CC, [
84 if test "$cross_compiling" = yes &&
85 (test "x$CC" = "xdos-gcc" || test "x$CC" = "xi386-mingw32-gcc" || test
86 "x$CC" = "xgnuwin32gcc"
93 dnl Restore CC that has been unset by AC_UNSET_CC
94 AC_DEFUN(AC_RESET_CC, [
95 if test "x$ZZ" = "xdos-gcc" || test "x$ZZ" = "xi386-mingw32-gcc" || test
96 "x$ZZ" = "xgnuwin32gcc"
102 dnl The following three macros are copied from Thomas Dickey's autoconf
104 dnl http://dickey.his.com/autoconf/autoconf.html
105 dnl --Roozbeh Pournader
107 define(AC_DIVERSION_HELP, 3)dnl user help-messages
108 define(ac_help_count, 0)dnl
110 dnl Send text to the user help-message list. We will expand it as a here-
111 dnl document, so we'll split it to avoid too-long strings.
112 dnl AC_DIVERT_HELP(message)
113 define(AC_DIVERT_HELP,
114 [AC_DIVERT_PUSH(AC_DIVERSION_HELP)dnl
115 ifelse(ac_help_count,0,[--enable and --with options recognized:
117 define([ac_help_count], builtin(eval, ac_help_count + 1))dnl
119 ifelse(ac_help_count,13,[EOF
121 define([ac_help_count], 1)dnl
126 # Find a program when cross-compiling, or use a default when not.
127 # $1 = variable which records the outcome
128 # $2 = program to look for when cross-compiling
129 # $3 = program to use when not cross-compiling
130 AC_DEFUN([KPSE_CROSS_PATH_PROG],
131 [if test "$cross_compiling" = yes; then
132 AC_PATH_PROG([$1], [$2])
133 if test -z "${$1}"; then
134 AC_MSG_ERROR([$2 was not found but is required when cross-compiling.
135 Install $2 or set \$$1 to the full pathname.])
141 # Set BUILD$1 to $2 when cross-compiling, to $($1) if not.
142 # Example: KPSE_CROSS_BUILD_VAR([CC], [cc]) sets 'BUILDCC' to 'cc'
143 # if cross-compiling, and to '$(CC)' if not.
144 AC_DEFUN([KPSE_CROSS_BUILD_VAR],
145 [if test "$cross_compiling" = yes; then
146 if test -z "${BUILD$1}"; then
149 AC_MSG_RESULT([setting \$BUILD$1 to ${BUILD$1}])
151 if test -n "${BUILD$1}"; then
152 AC_MSG_WARN([\$BUILD$1 set but not cross-compiling.])