tentative fix for issue 3 (ex 53)
[mplib] / src / texk / etc / autoconf / acsite.m4
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.
4
5
6 dnl kb_AC_LIBTOOL_REPLACE_FUNCS(FUNCTION-NAME...)
7 AC_DEFUN(kb_AC_LIBTOOL_REPLACE_FUNCS,
8 [for ac_func in $1
9 do
10 AC_CHECK_FUNC($ac_func, , [LIBTOOL_LIBOBJS="$LIBTOOL_LIBOBJS ${ac_func}.lo"])
11 done
12 AC_SUBST(LIBTOOL_LIBOBJS)dnl
13 ])
14
15
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,
20 [AC_REQUIRE_CPP()dnl
21 AC_CACHE_CHECK(whether gcc asm needs underscore, pb_cv_asm_underscore,
22 [
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
26 AC_TRY_LINK([
27 extern char val ;
28 extern void sub () ;
29 #if defined (__i386__) && defined (__GNUC__) 
30 asm("        .align 4\n"
31 ".globl sub\n"
32 "sub:\n"
33 "        movb \$][1,val\n"
34 "        ret\n");
35 #else
36 void sub () { val = 1; }
37 #endif /* assembler */
38 char val ;
39 ], [sub], pb_cv_asm_underscore=no)])
40 if test "x$pb_cv_asm_underscore" = xyes; then
41   AC_DEFINE(ASM_NEEDS_UNDERSCORE)
42 fi
43 ])
44
45 dnl Added /lib/... for A/UX.
46 dnl undefine([AC_PATH_X_DIRECT])dnl
47
48 dnl Changed make to ${MAKE-make}.
49 dnl undefine([AC_PATH_X_XMKMF])dnl
50
51 dnl Always more junk to check.
52 dnl undefine([AC_PATH_XTRA])dnl
53
54 dnl Added ac_include support.
55 dnl undefine([AC_OUTPUT_FILES])dnl
56
57
58 dnl From automake distribution, by Jim Meyering:
59 dnl Add --enable-maintainer-mode option to configure.
60
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
71     MAINT=
72   else
73     MAINT='#M#'
74   fi
75   AC_SUBST(MAINT)dnl
76 ]
77 )
78
79 dnl Following two are copied from 'acspecific.m4'. --Roozbeh Pournader
80
81 dnl Unset CC to run configure with cross compiler.
82 AC_DEFUN(AC_UNSET_CC, [
83 ZZ=
84 if test "$cross_compiling" = yes &&
85    (test "x$CC" = "xdos-gcc" || test "x$CC" = "xi386-mingw32-gcc" || test
86 "x$CC" = "xgnuwin32gcc"
87 ZZ=$CC
88 unset CC
89 cross_compiling=no
90 fi
91 ])
92
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"
97 CC=$ZZ
98 cross_compiling=yes
99 fi               
100 ])               
101
102 dnl The following three macros are copied from Thomas Dickey's autoconf
103 dnl patches at:
104 dnl     http://dickey.his.com/autoconf/autoconf.html
105 dnl --Roozbeh Pournader
106
107 define(AC_DIVERSION_HELP, 3)dnl                user help-messages
108 define(ac_help_count, 0)dnl
109
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:
116 ])dnl
117 define([ac_help_count], builtin(eval, ac_help_count + 1))dnl
118 [$1]
119 ifelse(ac_help_count,13,[EOF
120 cat <<EOF
121 define([ac_help_count], 1)dnl
122 ])dnl
123 AC_DIVERT_POP()dnl
124 ])
125
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.])
136 fi
137 else
138   $1=$3
139 fi])
140
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
147     BUILD$1='$2'
148   fi
149   AC_MSG_RESULT([setting \$BUILD$1 to ${BUILD$1}])
150 else
151   if test -n "${BUILD$1}"; then
152     AC_MSG_WARN([\$BUILD$1 set but not cross-compiling.])
153   fi
154   BUILD$1='$($1)'
155 fi
156 AC_SUBST(BUILD$1)
157 ])