1 | # Local additions to Autoconf macros.
|
---|
2 | # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
|
---|
3 | # François Pinard <[email protected]>, 1992.
|
---|
4 |
|
---|
5 | # [TS:Aug/95] - chopped out the NLS stuff which I don't support
|
---|
6 |
|
---|
7 | ## ------------------------------- ##
|
---|
8 | ## Check for function prototypes. ##
|
---|
9 | ## ------------------------------- ##
|
---|
10 |
|
---|
11 | AC_DEFUN(fp_C_PROTOTYPES,
|
---|
12 | [AC_REQUIRE([fp_PROG_CC_STDC])
|
---|
13 | AC_MSG_CHECKING([for function prototypes])
|
---|
14 | if test "$ac_cv_prog_cc_stdc" != no; then
|
---|
15 | AC_MSG_RESULT(yes)
|
---|
16 | AC_DEFINE(PROTOTYPES)
|
---|
17 | U= ANSI2KNR=
|
---|
18 | else
|
---|
19 | AC_MSG_RESULT(no)
|
---|
20 | U=_ ANSI2KNR=ansi2knr
|
---|
21 | fi
|
---|
22 | AC_SUBST(U)dnl
|
---|
23 | AC_SUBST(ANSI2KNR)dnl
|
---|
24 | ])
|
---|
25 |
|
---|
26 | ## ----------------------------------------- ##
|
---|
27 | ## ANSIfy the C compiler whenever possible. ##
|
---|
28 | ## ----------------------------------------- ##
|
---|
29 |
|
---|
30 | # @defmac AC_PROG_CC_STDC
|
---|
31 | # @maindex PROG_CC_STDC
|
---|
32 | # @ovindex CC
|
---|
33 | # If the C compiler in not in ANSI C mode by default, try to add an option
|
---|
34 | # to output variable @code{CC} to make it so. This macro tries various
|
---|
35 | # options that select ANSI C on some system or another. It considers the
|
---|
36 | # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
|
---|
37 | # handles function prototypes correctly.
|
---|
38 | #
|
---|
39 | # If you use this macro, you should check after calling it whether the C
|
---|
40 | # compiler has been set to accept ANSI C; if not, the shell variable
|
---|
41 | # @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
---|
42 | # code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
---|
43 | # program @code{ansi2knr}, which comes with Ghostscript.
|
---|
44 | # @end defmac
|
---|
45 |
|
---|
46 | AC_DEFUN(fp_PROG_CC_STDC,
|
---|
47 | [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
---|
48 | AC_CACHE_VAL(ac_cv_prog_cc_stdc,
|
---|
49 | [ac_cv_prog_cc_stdc=no
|
---|
50 | ac_save_CFLAGS="$CFLAGS"
|
---|
51 | # Don't try gcc -ansi; that turns off useful extensions and
|
---|
52 | # breaks some systems' header files.
|
---|
53 | # AIX -qlanglvl=ansi
|
---|
54 | # Ultrix and OSF/1 -std1
|
---|
55 | # HP-UX -Aa -D_HPUX_SOURCE
|
---|
56 | # SVR4 -Xc
|
---|
57 | for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
|
---|
58 | do
|
---|
59 | CFLAGS="$ac_save_CFLAGS $ac_arg"
|
---|
60 | AC_TRY_COMPILE(
|
---|
61 | [#if !defined(__STDC__) || __STDC__ != 1
|
---|
62 | choke me
|
---|
63 | #endif
|
---|
64 | ], [int test (int i, double x);
|
---|
65 | struct s1 {int (*f) (int a);};
|
---|
66 | struct s2 {int (*f) (double a);};],
|
---|
67 | [ac_cv_prog_cc_stdc="$ac_arg"; break])
|
---|
68 | done
|
---|
69 | CFLAGS="$ac_save_CFLAGS"
|
---|
70 | ])
|
---|
71 | AC_MSG_RESULT($ac_cv_prog_cc_stdc)
|
---|
72 | case "x$ac_cv_prog_cc_stdc" in
|
---|
73 | x|xno) ;;
|
---|
74 | *) CC="$CC $ac_cv_prog_cc_stdc" ;;
|
---|
75 | esac
|
---|
76 | ])
|
---|
77 |
|
---|
78 | ## --------------------------------------------------------- ##
|
---|
79 | ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
|
---|
80 | ## substitution. ##
|
---|
81 | ## --------------------------------------------------------- ##
|
---|
82 |
|
---|
83 | AC_DEFUN(fp_PROG_INSTALL,
|
---|
84 | [AC_PROG_INSTALL
|
---|
85 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
|
---|
86 | AC_SUBST(INSTALL_SCRIPT)dnl
|
---|
87 | ])
|
---|
88 |
|
---|
89 | ## ----------------------------------- ##
|
---|
90 | ## Check if --with-dmalloc was given. ##
|
---|
91 | ## ----------------------------------- ##
|
---|
92 |
|
---|
93 | # I just checked, and GNU rx seems to work fine with a slightly
|
---|
94 | # modified GNU m4. So, I put out the test below in my aclocal.m4,
|
---|
95 | # and will try to use it in my things. The idea is to distribute
|
---|
96 | # rx.[hc] and regex.[hc] together, for a while. The WITH_REGEX symbol
|
---|
97 | # (which should also be documented in acconfig.h) is used to decide
|
---|
98 | # which of regex.h or rx.h should be included in the application.
|
---|
99 | #
|
---|
100 | # If `./configure --with-regex' is given, the package will use
|
---|
101 | # the older regex. Else, a check is made to see if rx is already
|
---|
102 | # installed, as with newer Linux'es. If not found, the package will
|
---|
103 | # use the rx from the distribution. If found, the package will use
|
---|
104 | # the system's rx which, on Linux at least, will result in a smaller
|
---|
105 | # executable file.
|
---|
106 |
|
---|
107 | AC_DEFUN(fp_WITH_DMALLOC,
|
---|
108 | [AC_MSG_CHECKING(if malloc debugging is wanted)
|
---|
109 | AC_ARG_WITH(dmalloc,
|
---|
110 | [ --with-dmalloc use dmalloc, as in
|
---|
111 | ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
|
---|
112 | [if test "$withval" = yes; then
|
---|
113 | AC_MSG_RESULT(yes)
|
---|
114 | AC_DEFINE(WITH_DMALLOC)
|
---|
115 | LIBS="$LIBS -ldmalloc"
|
---|
116 | LDFLAGS="$LDFLAGS -g"
|
---|
117 | else
|
---|
118 | AC_MSG_RESULT(no)
|
---|
119 | fi], [AC_MSG_RESULT(no)])
|
---|
120 | ])
|
---|
121 |
|
---|
122 | ## --------------------------------- ##
|
---|
123 | ## Check if --with-regex was given. ##
|
---|
124 | ## --------------------------------- ##
|
---|
125 |
|
---|
126 | AC_DEFUN(fp_WITH_REGEX,
|
---|
127 | [AC_MSG_CHECKING(which of rx or regex is wanted)
|
---|
128 | AC_ARG_WITH(regex,
|
---|
129 | [ --with-regex use older regex in lieu of GNU rx for matching],
|
---|
130 | [if test "$withval" = yes; then
|
---|
131 | ac_with_regex=1
|
---|
132 | AC_MSG_RESULT(regex)
|
---|
133 | AC_DEFINE(WITH_REGEX)
|
---|
134 | AC_LIBOBJ([regex])
|
---|
135 | fi])
|
---|
136 | if test -z "$ac_with_regex"; then
|
---|
137 | AC_MSG_RESULT(rx)
|
---|
138 | AC_CHECK_FUNC(re_rx_search, ,
|
---|
139 | [AC_CHECK_SIZEOF(unsigned char *, unsigned char *)
|
---|
140 | if test "$ac_cv_sizeof_unsigned_char_p" = 8
|
---|
141 | then
|
---|
142 | AC_MSG_WARN(I'm forcing you to use regex because I can't
|
---|
143 | find a local rx library and the one included with this
|
---|
144 | distribution doesn't work on 64-bit machines like yours)
|
---|
145 | AC_LIBOBJ([regex])
|
---|
146 | else
|
---|
147 | AC_LIBOBJ([rx])
|
---|
148 | fi]
|
---|
149 | )
|
---|
150 | fi
|
---|
151 | ])
|
---|
152 |
|
---|
153 |
|
---|
154 | ## --------------------------------------- ##
|
---|
155 | ## Check if --with-gnu-readline was given. ##
|
---|
156 | ## --------------------------------------- ##
|
---|
157 |
|
---|
158 | AC_DEFUN(fp_WITH_GNU_READLINE,
|
---|
159 | [AC_MSG_CHECKING(whether GNU readline requested)
|
---|
160 | AC_ARG_WITH(gnu_readline,
|
---|
161 | [ --with-gnu-readline compile with GNU readline support],
|
---|
162 | [if test "$withval" = yes; then
|
---|
163 | AC_MSG_RESULT(yes)
|
---|
164 | ac_with_gnu_readline=1
|
---|
165 | else
|
---|
166 | AC_MSG_RESULT(no)
|
---|
167 | fi],
|
---|
168 | AC_MSG_RESULT(no))
|
---|
169 |
|
---|
170 | if test -n "$ac_with_gnu_readline"; then
|
---|
171 | AC_CHECK_HEADER(readline/readline.h, ac_mg_readline_header_found=1,
|
---|
172 | AC_MSG_WARN(Can't find GNU readline headers; configuring without \
|
---|
173 | GNU readline support))
|
---|
174 | if test -n "$ac_mg_readline_header_found"; then
|
---|
175 | # first check whether we can find the readline library itself
|
---|
176 | AC_CHECK_LIB(readline, main,
|
---|
177 | [ac_mg_readline_lib_found=1
|
---|
178 | AC_DEFINE(WITH_GNU_READLINE)
|
---|
179 | LIBS="$LIBS -lreadline"],
|
---|
180 | AC_MSG_WARN(Can't find GNU readline library; configuring without \
|
---|
181 | GNU readline support))
|
---|
182 | if test -n "$ac_mg_readline_lib_found"; then
|
---|
183 | # on some systems, readline needs curses. It is difficult to
|
---|
184 | # determine whether this is necessary on the current system,
|
---|
185 | # since other undefined symbols can be turned up by an
|
---|
186 | # AC_CHECK_LIB(readline, readline) test that are actually defined
|
---|
187 | # by mg itself (e.g. xmalloc, xrealloc). So, if we find libcurses,
|
---|
188 | # we just bung it on and hope for the best.
|
---|
189 | AC_CHECK_LIB(curses, main,
|
---|
190 | LIBS="$LIBS -lcurses")
|
---|
191 | fi
|
---|
192 | fi
|
---|
193 | fi
|
---|
194 | ])
|
---|
195 |
|
---|
196 |
|
---|
197 |
|
---|
198 | #AC_DEFUN(fp_WITH_GNU_READLINE,
|
---|
199 | #[AC_MSG_CHECKING(whether GNU readline requested)
|
---|
200 | # AC_ARG_WITH(gnu-readline,
|
---|
201 | # [ --with-gnu-readline compile with GNU readline support],
|
---|
202 | # [if test "$withval" = yes; then
|
---|
203 | # AC_MSG_RESULT(yes)
|
---|
204 | # ac_with_gnu_readline=1
|
---|
205 | # else
|
---|
206 | # AC_MSG_RESULT(no)
|
---|
207 | # fi],
|
---|
208 | # AC_MSG_RESULT(no))
|
---|
209 | # if test -n "$ac_with_gnu_readline"; then
|
---|
210 | # AC_CHECK_LIB(readline, main,
|
---|
211 | # AC_CHECK_HEADER(readline/readline.h,
|
---|
212 | # [AC_DEFINE(WITH_GNU_READLINE)
|
---|
213 | ## curses required on some systems (DEC OSF/1), but not on others (GNU/Linux,
|
---|
214 | ## Solaris 2.6). Forcing its inclusion is unsophisticated; if it causes
|
---|
215 | ## any actual problems on any UNIX platforms, let the maintainer know.
|
---|
216 | # LIBS="$LIBS -lreadline -lcurses"],
|
---|
217 | # AC_MSG_WARN(Can't find GNU readline headers: configuring \
|
---|
218 | #without GNU readline support)
|
---|
219 | # ),
|
---|
220 | # AC_MSG_WARN(Can't find GNU readline library: configuring \
|
---|
221 | #without GNU readline support)
|
---|
222 | # )
|
---|
223 | # fi
|
---|
224 | #])
|
---|
225 | dnl @synopsis AC_PROG_JAVAC
|
---|
226 | dnl
|
---|
227 | dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the
|
---|
228 | dnl environment variable JAVAC then tests in sequence various common
|
---|
229 | dnl Java compilers. For political reasons, it starts with the free
|
---|
230 | dnl ones.
|
---|
231 | dnl
|
---|
232 | dnl If you want to force a specific compiler:
|
---|
233 | dnl
|
---|
234 | dnl - at the configure.in level, set JAVAC=yourcompiler before calling
|
---|
235 | dnl AC_PROG_JAVAC
|
---|
236 | dnl
|
---|
237 | dnl - at the configure level, setenv JAVAC
|
---|
238 | dnl
|
---|
239 | dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
|
---|
240 | dnl
|
---|
241 | dnl *Warning*: its success or failure can depend on a proper setting of
|
---|
242 | dnl the CLASSPATH env. variable.
|
---|
243 | dnl
|
---|
244 | dnl TODO: allow to exclude compilers (rationale: most Java programs
|
---|
245 | dnl cannot compile with some compilers like guavac).
|
---|
246 | dnl
|
---|
247 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
248 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
249 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
250 | dnl does not support the concept of set of macros, so I had to break it
|
---|
251 | dnl for submission. The general documentation, as well as the sample
|
---|
252 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
253 | dnl
|
---|
254 | dnl @category Java
|
---|
255 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
256 | dnl @version 2000-07-19
|
---|
257 | dnl @license GPLWithACException
|
---|
258 |
|
---|
259 | AC_DEFUN([AC_PROG_JAVAC],[
|
---|
260 | if test "x$JAVAC" = x ; then
|
---|
261 | AC_REQUIRE([AC_EXEEXT])dnl
|
---|
262 | if test "x$JAVAPREFIX" = x; then
|
---|
263 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT)
|
---|
264 | else
|
---|
265 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT, $JAVAPREFIX)
|
---|
266 | fi
|
---|
267 | test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
|
---|
268 | else
|
---|
269 | echo "Checking for javac... $JAVAC"
|
---|
270 | fi
|
---|
271 | AC_SUBST(JAVAC)
|
---|
272 | AC_PROG_JAVAC_WORKS
|
---|
273 | AC_PROVIDE([$0])dnl
|
---|
274 | ])
|
---|
275 |
|
---|
276 | dnl @synopsis AC_PROG_JAVAC_WORKS
|
---|
277 | dnl
|
---|
278 | dnl Internal use ONLY.
|
---|
279 | dnl
|
---|
280 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
281 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
282 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
283 | dnl does not support the concept of set of macros, so I had to break it
|
---|
284 | dnl for submission. The general documentation, as well as the sample
|
---|
285 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
286 | dnl
|
---|
287 | dnl @category Java
|
---|
288 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
289 | dnl @version 2000-07-19
|
---|
290 | dnl @license GPLWithACException
|
---|
291 |
|
---|
292 | AC_DEFUN([AC_PROG_JAVAC_WORKS],[
|
---|
293 | AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
|
---|
294 | JAVA_TEST=Test.java
|
---|
295 | CLASS_TEST=Test.class
|
---|
296 | cat << \EOF > $JAVA_TEST
|
---|
297 | /* [#]line __oline__ "configure" */
|
---|
298 | public class Test {
|
---|
299 | }
|
---|
300 | EOF
|
---|
301 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
|
---|
302 | ac_cv_prog_javac_works=yes
|
---|
303 | else
|
---|
304 | AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
|
---|
305 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
306 | cat $JAVA_TEST >&AC_FD_CC
|
---|
307 | fi
|
---|
308 | rm -f $JAVA_TEST $CLASS_TEST
|
---|
309 | ])
|
---|
310 | AC_PROVIDE([$0])dnl
|
---|
311 | if test "x$JAVACFLAGS" = x ; then
|
---|
312 | JAVACFLAGS="-source 1.4 -target 1.4"
|
---|
313 | fi
|
---|
314 | AC_SUBST(JAVACFLAGS)
|
---|
315 | ])
|
---|
316 |
|
---|
317 | dnl @synopsis AC_PROG_JAVA
|
---|
318 | dnl
|
---|
319 | dnl Here is a summary of the main macros:
|
---|
320 | dnl
|
---|
321 | dnl AC_PROG_JAVAC: finds a Java compiler.
|
---|
322 | dnl
|
---|
323 | dnl AC_PROG_JAVA: finds a Java virtual machine.
|
---|
324 | dnl
|
---|
325 | dnl AC_CHECK_CLASS: finds if we have the given class (beware of
|
---|
326 | dnl CLASSPATH!).
|
---|
327 | dnl
|
---|
328 | dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
|
---|
329 | dnl otherwise.
|
---|
330 | dnl
|
---|
331 | dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
|
---|
332 | dnl
|
---|
333 | dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
|
---|
334 | dnl
|
---|
335 | dnl AC_JAVA_OPTIONS: adds Java configure options.
|
---|
336 | dnl
|
---|
337 | dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the
|
---|
338 | dnl environment variable JAVA then tests in sequence various common
|
---|
339 | dnl Java virtual machines. For political reasons, it starts with the
|
---|
340 | dnl free ones. You *must* call [AC_PROG_JAVAC] before.
|
---|
341 | dnl
|
---|
342 | dnl If you want to force a specific VM:
|
---|
343 | dnl
|
---|
344 | dnl - at the configure.in level, set JAVA=yourvm before calling
|
---|
345 | dnl AC_PROG_JAVA
|
---|
346 | dnl
|
---|
347 | dnl (but after AC_INIT)
|
---|
348 | dnl
|
---|
349 | dnl - at the configure level, setenv JAVA
|
---|
350 | dnl
|
---|
351 | dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
|
---|
352 | dnl
|
---|
353 | dnl *Warning*: its success or failure can depend on a proper setting of
|
---|
354 | dnl the CLASSPATH env. variable.
|
---|
355 | dnl
|
---|
356 | dnl TODO: allow to exclude virtual machines (rationale: most Java
|
---|
357 | dnl programs cannot run with some VM like kaffe).
|
---|
358 | dnl
|
---|
359 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
360 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
361 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
362 | dnl does not support the concept of set of macros, so I had to break it
|
---|
363 | dnl for submission.
|
---|
364 | dnl
|
---|
365 | dnl A Web page, with a link to the latest CVS snapshot is at
|
---|
366 | dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
|
---|
367 | dnl
|
---|
368 | dnl This is a sample configure.in Process this file with autoconf to
|
---|
369 | dnl produce a configure script.
|
---|
370 | dnl
|
---|
371 | dnl AC_INIT(UnTag.java)
|
---|
372 | dnl
|
---|
373 | dnl dnl Checks for programs.
|
---|
374 | dnl AC_CHECK_CLASSPATH
|
---|
375 | dnl AC_PROG_JAVAC
|
---|
376 | dnl AC_PROG_JAVA
|
---|
377 | dnl
|
---|
378 | dnl dnl Checks for classes
|
---|
379 | dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
|
---|
380 | dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
|
---|
381 | dnl
|
---|
382 | dnl AC_OUTPUT(Makefile)
|
---|
383 | dnl
|
---|
384 | dnl @category Java
|
---|
385 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
386 | dnl @version 2000-07-19
|
---|
387 | dnl @license GPLWithACException
|
---|
388 |
|
---|
389 | AC_DEFUN([AC_PROG_JAVA],[
|
---|
390 | if test "x$JAVA" = x ; then
|
---|
391 | AC_REQUIRE([AC_EXEEXT])dnl
|
---|
392 | if test x$JAVAPREFIX = x; then
|
---|
393 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, java$EXEEXT)
|
---|
394 | else
|
---|
395 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, java$EXEEXT, $JAVAPREFIX)
|
---|
396 | fi
|
---|
397 | test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
|
---|
398 | fi
|
---|
399 | AC_SUBST(JAVA)
|
---|
400 | AC_PROG_JAVA_WORKS
|
---|
401 | AC_PROVIDE([$0])dnl
|
---|
402 | ])
|
---|
403 |
|
---|
404 | dnl @synopsis AC_PROG_JAVA_WORKS
|
---|
405 | dnl
|
---|
406 | dnl Internal use ONLY.
|
---|
407 | dnl
|
---|
408 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
409 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
410 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
411 | dnl does not support the concept of set of macros, so I had to break it
|
---|
412 | dnl for submission. The general documentation, as well as the sample
|
---|
413 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
414 | dnl
|
---|
415 | dnl @category Java
|
---|
416 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
417 | dnl @version 2000-07-19
|
---|
418 | dnl @license GPLWithACException
|
---|
419 |
|
---|
420 | AC_DEFUN([AC_PROG_JAVA_WORKS], [
|
---|
421 | AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
|
---|
422 | if test x$uudecode = xyes; then
|
---|
423 | AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
|
---|
424 | dnl /**
|
---|
425 | dnl * Test.java: used to test if java compiler works.
|
---|
426 | dnl */
|
---|
427 | dnl public class Test
|
---|
428 | dnl {
|
---|
429 | dnl
|
---|
430 | dnl public static void
|
---|
431 | dnl main( String[] argv )
|
---|
432 | dnl {
|
---|
433 | dnl System.exit (0);
|
---|
434 | dnl }
|
---|
435 | dnl
|
---|
436 | dnl }
|
---|
437 | cat << \EOF > Test.uue
|
---|
438 | begin-base64 644 Test.class
|
---|
439 | yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
|
---|
440 | bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
|
---|
441 | bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
|
---|
442 | YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
|
---|
443 | aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
|
---|
444 | AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
|
---|
445 | AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
|
---|
446 | ====
|
---|
447 | EOF
|
---|
448 | if uudecode$EXEEXT Test.uue; then
|
---|
449 | ac_cv_prog_uudecode_base64=yes
|
---|
450 | else
|
---|
451 | echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
|
---|
452 | echo "configure: failed file was:" >&AC_FD_CC
|
---|
453 | cat Test.uue >&AC_FD_CC
|
---|
454 | ac_cv_prog_uudecode_base64=no
|
---|
455 | fi
|
---|
456 | rm -f Test.uue])
|
---|
457 | fi
|
---|
458 | if test x$ac_cv_prog_uudecode_base64 != xyes; then
|
---|
459 | rm -f Test.class
|
---|
460 | AC_MSG_WARN([I have to compile Test.class from scratch])
|
---|
461 | if test x$ac_cv_prog_javac_works = xno; then
|
---|
462 | AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
|
---|
463 | fi
|
---|
464 | if test x$ac_cv_prog_javac_works = x; then
|
---|
465 | AC_PROG_JAVAC
|
---|
466 | fi
|
---|
467 | fi
|
---|
468 | AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
|
---|
469 | JAVA_TEST=Test.java
|
---|
470 | CLASS_TEST=Test.class
|
---|
471 | TEST=Test
|
---|
472 | changequote(, )dnl
|
---|
473 | cat << \EOF > $JAVA_TEST
|
---|
474 | /* [#]line __oline__ "configure" */
|
---|
475 | public class Test {
|
---|
476 | public static void main (String args[]) {
|
---|
477 | System.exit (0);
|
---|
478 | } }
|
---|
479 | EOF
|
---|
480 | changequote([, ])dnl
|
---|
481 | if test x$ac_cv_prog_uudecode_base64 != xyes; then
|
---|
482 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
|
---|
483 | :
|
---|
484 | else
|
---|
485 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
486 | cat $JAVA_TEST >&AC_FD_CC
|
---|
487 | AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
|
---|
488 | fi
|
---|
489 | fi
|
---|
490 | if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
|
---|
491 | ac_cv_prog_java_works=yes
|
---|
492 | else
|
---|
493 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
494 | cat $JAVA_TEST >&AC_FD_CC
|
---|
495 | AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
|
---|
496 | fi
|
---|
497 | rm -fr $JAVA_TEST $CLASS_TEST Test.uue
|
---|
498 | ])
|
---|
499 | AC_PROVIDE([$0])dnl
|
---|
500 | ]
|
---|
501 | )
|
---|