[16565] | 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, , [AC_LIBOBJ([rx])])
|
---|
| 139 | fi
|
---|
| 140 | ])
|
---|
[23356] | 141 | dnl @synopsis AC_PROG_JAVAC
|
---|
| 142 | dnl
|
---|
| 143 | dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the
|
---|
| 144 | dnl environment variable JAVAC then tests in sequence various common
|
---|
| 145 | dnl Java compilers. For political reasons, it starts with the free
|
---|
| 146 | dnl ones.
|
---|
| 147 | dnl
|
---|
| 148 | dnl If you want to force a specific compiler:
|
---|
| 149 | dnl
|
---|
| 150 | dnl - at the configure.in level, set JAVAC=yourcompiler before calling
|
---|
| 151 | dnl AC_PROG_JAVAC
|
---|
| 152 | dnl
|
---|
| 153 | dnl - at the configure level, setenv JAVAC
|
---|
| 154 | dnl
|
---|
| 155 | dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
|
---|
| 156 | dnl
|
---|
| 157 | dnl *Warning*: its success or failure can depend on a proper setting of
|
---|
| 158 | dnl the CLASSPATH env. variable.
|
---|
| 159 | dnl
|
---|
| 160 | dnl TODO: allow to exclude compilers (rationale: most Java programs
|
---|
| 161 | dnl cannot compile with some compilers like guavac).
|
---|
| 162 | dnl
|
---|
| 163 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
| 164 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
| 165 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
| 166 | dnl does not support the concept of set of macros, so I had to break it
|
---|
| 167 | dnl for submission. The general documentation, as well as the sample
|
---|
| 168 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
| 169 | dnl
|
---|
| 170 | dnl @category Java
|
---|
| 171 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
| 172 | dnl @version 2000-07-19
|
---|
| 173 | dnl @license GPLWithACException
|
---|
| 174 |
|
---|
| 175 | AC_DEFUN([AC_PROG_JAVAC],[
|
---|
| 176 | if test "x$JAVAC" = x ; then
|
---|
| 177 | AC_REQUIRE([AC_EXEEXT])dnl
|
---|
| 178 | if test "x$JAVAPREFIX" = x; then
|
---|
| 179 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT)
|
---|
| 180 | else
|
---|
| 181 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT, $JAVAPREFIX)
|
---|
| 182 | fi
|
---|
| 183 | test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
|
---|
| 184 | else
|
---|
| 185 | echo "Checking for javac... $JAVAC"
|
---|
| 186 | fi
|
---|
| 187 |
|
---|
| 188 | AC_SUBST(JAVAC)
|
---|
| 189 | AC_PROG_JAVAC_WORKS
|
---|
| 190 | AC_PROVIDE([$0])dnl
|
---|
| 191 | ])
|
---|
| 192 |
|
---|
| 193 | dnl @synopsis AC_PROG_JAVAC_WORKS
|
---|
| 194 | dnl
|
---|
| 195 | dnl Internal use ONLY.
|
---|
| 196 | dnl
|
---|
| 197 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
| 198 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
| 199 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
| 200 | dnl does not support the concept of set of macros, so I had to break it
|
---|
| 201 | dnl for submission. The general documentation, as well as the sample
|
---|
| 202 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
| 203 | dnl
|
---|
| 204 | dnl @category Java
|
---|
| 205 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
| 206 | dnl @version 2000-07-19
|
---|
| 207 | dnl @license GPLWithACException
|
---|
| 208 |
|
---|
| 209 | AC_DEFUN([AC_PROG_JAVAC_WORKS],[
|
---|
| 210 | AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
|
---|
| 211 | JAVA_TEST=Test.java
|
---|
| 212 | CLASS_TEST=Test.class
|
---|
| 213 | cat << \EOF > $JAVA_TEST
|
---|
| 214 | /* [#]line __oline__ "configure" */
|
---|
| 215 | public class Test {
|
---|
| 216 | }
|
---|
| 217 | EOF
|
---|
| 218 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
|
---|
| 219 | ac_cv_prog_javac_works=yes
|
---|
| 220 | else
|
---|
| 221 | AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
|
---|
| 222 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
| 223 | cat $JAVA_TEST >&AC_FD_CC
|
---|
| 224 | fi
|
---|
| 225 | rm -f $JAVA_TEST $CLASS_TEST
|
---|
| 226 | ])
|
---|
| 227 | AC_PROVIDE([$0])dnl
|
---|
| 228 | if test "x$JAVACFLAGS" = x ; then
|
---|
| 229 | JAVACFLAGS="-source 1.4 -target 1.4"
|
---|
| 230 | fi
|
---|
| 231 | AC_SUBST(JAVACFLAGS)
|
---|
| 232 | ])
|
---|
| 233 |
|
---|
| 234 | dnl @synopsis AC_PROG_JAVA
|
---|
| 235 | dnl
|
---|
| 236 | dnl Here is a summary of the main macros:
|
---|
| 237 | dnl
|
---|
| 238 | dnl AC_PROG_JAVAC: finds a Java compiler.
|
---|
| 239 | dnl
|
---|
| 240 | dnl AC_PROG_JAVA: finds a Java virtual machine.
|
---|
| 241 | dnl
|
---|
| 242 | dnl AC_CHECK_CLASS: finds if we have the given class (beware of
|
---|
| 243 | dnl CLASSPATH!).
|
---|
| 244 | dnl
|
---|
| 245 | dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
|
---|
| 246 | dnl otherwise.
|
---|
| 247 | dnl
|
---|
| 248 | dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
|
---|
| 249 | dnl
|
---|
| 250 | dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
|
---|
| 251 | dnl
|
---|
| 252 | dnl AC_JAVA_OPTIONS: adds Java configure options.
|
---|
| 253 | dnl
|
---|
| 254 | dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the
|
---|
| 255 | dnl environment variable JAVA then tests in sequence various common
|
---|
| 256 | dnl Java virtual machines. For political reasons, it starts with the
|
---|
| 257 | dnl free ones. You *must* call [AC_PROG_JAVAC] before.
|
---|
| 258 | dnl
|
---|
| 259 | dnl If you want to force a specific VM:
|
---|
| 260 | dnl
|
---|
| 261 | dnl - at the configure.in level, set JAVA=yourvm before calling
|
---|
| 262 | dnl AC_PROG_JAVA
|
---|
| 263 | dnl
|
---|
| 264 | dnl (but after AC_INIT)
|
---|
| 265 | dnl
|
---|
| 266 | dnl - at the configure level, setenv JAVA
|
---|
| 267 | dnl
|
---|
| 268 | dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
|
---|
| 269 | dnl
|
---|
| 270 | dnl *Warning*: its success or failure can depend on a proper setting of
|
---|
| 271 | dnl the CLASSPATH env. variable.
|
---|
| 272 | dnl
|
---|
| 273 | dnl TODO: allow to exclude virtual machines (rationale: most Java
|
---|
| 274 | dnl programs cannot run with some VM like kaffe).
|
---|
| 275 | dnl
|
---|
| 276 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
| 277 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
| 278 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
| 279 | dnl does not support the concept of set of macros, so I had to break it
|
---|
| 280 | dnl for submission.
|
---|
| 281 | dnl
|
---|
| 282 | dnl A Web page, with a link to the latest CVS snapshot is at
|
---|
| 283 | dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
|
---|
| 284 | dnl
|
---|
| 285 | dnl This is a sample configure.in Process this file with autoconf to
|
---|
| 286 | dnl produce a configure script.
|
---|
| 287 | dnl
|
---|
| 288 | dnl AC_INIT(UnTag.java)
|
---|
| 289 | dnl
|
---|
| 290 | dnl dnl Checks for programs.
|
---|
| 291 | dnl AC_CHECK_CLASSPATH
|
---|
| 292 | dnl AC_PROG_JAVAC
|
---|
| 293 | dnl AC_PROG_JAVA
|
---|
| 294 | dnl
|
---|
| 295 | dnl dnl Checks for classes
|
---|
| 296 | dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
|
---|
| 297 | dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
|
---|
| 298 | dnl
|
---|
| 299 | dnl AC_OUTPUT(Makefile)
|
---|
| 300 | dnl
|
---|
| 301 | dnl @category Java
|
---|
| 302 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
| 303 | dnl @version 2000-07-19
|
---|
| 304 | dnl @license GPLWithACException
|
---|
| 305 |
|
---|
| 306 | AC_DEFUN([AC_PROG_JAVA],[
|
---|
| 307 | if test "x$JAVA" = x ; then
|
---|
| 308 | AC_REQUIRE([AC_EXEEXT])dnl
|
---|
| 309 | if test x$JAVAPREFIX = x; then
|
---|
| 310 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, java$EXEEXT)
|
---|
| 311 | else
|
---|
| 312 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, java$EXEEXT, $JAVAPREFIX)
|
---|
| 313 | fi
|
---|
| 314 | test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
|
---|
| 315 | fi
|
---|
| 316 | AC_SUBST(JAVA)
|
---|
| 317 | AC_PROG_JAVA_WORKS
|
---|
| 318 | AC_PROVIDE([$0])dnl
|
---|
| 319 | ])
|
---|
| 320 |
|
---|
| 321 | dnl @synopsis AC_PROG_JAVA_WORKS
|
---|
| 322 | dnl
|
---|
| 323 | dnl Internal use ONLY.
|
---|
| 324 | dnl
|
---|
| 325 | dnl Note: This is part of the set of autoconf M4 macros for Java
|
---|
| 326 | dnl programs. It is VERY IMPORTANT that you download the whole set,
|
---|
| 327 | dnl some macros depend on other. Unfortunately, the autoconf archive
|
---|
| 328 | dnl does not support the concept of set of macros, so I had to break it
|
---|
| 329 | dnl for submission. The general documentation, as well as the sample
|
---|
| 330 | dnl configure.in, is included in the AC_PROG_JAVA macro.
|
---|
| 331 | dnl
|
---|
| 332 | dnl @category Java
|
---|
| 333 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
| 334 | dnl @version 2000-07-19
|
---|
| 335 | dnl @license GPLWithACException
|
---|
| 336 |
|
---|
| 337 | AC_DEFUN([AC_PROG_JAVA_WORKS], [
|
---|
| 338 | AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
|
---|
| 339 | if test x$uudecode = xyes; then
|
---|
| 340 | AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
|
---|
| 341 | dnl /**
|
---|
| 342 | dnl * Test.java: used to test if java compiler works.
|
---|
| 343 | dnl */
|
---|
| 344 | dnl public class Test
|
---|
| 345 | dnl {
|
---|
| 346 | dnl
|
---|
| 347 | dnl public static void
|
---|
| 348 | dnl main( String[] argv )
|
---|
| 349 | dnl {
|
---|
| 350 | dnl System.exit (0);
|
---|
| 351 | dnl }
|
---|
| 352 | dnl
|
---|
| 353 | dnl }
|
---|
| 354 | cat << \EOF > Test.uue
|
---|
| 355 | begin-base64 644 Test.class
|
---|
| 356 | yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
|
---|
| 357 | bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
|
---|
| 358 | bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
|
---|
| 359 | YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
|
---|
| 360 | aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
|
---|
| 361 | AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
|
---|
| 362 | AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
|
---|
| 363 | ====
|
---|
| 364 | EOF
|
---|
| 365 | if uudecode$EXEEXT Test.uue; then
|
---|
| 366 | ac_cv_prog_uudecode_base64=yes
|
---|
| 367 | else
|
---|
| 368 | echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
|
---|
| 369 | echo "configure: failed file was:" >&AC_FD_CC
|
---|
| 370 | cat Test.uue >&AC_FD_CC
|
---|
| 371 | ac_cv_prog_uudecode_base64=no
|
---|
| 372 | fi
|
---|
| 373 | rm -f Test.uue])
|
---|
| 374 | fi
|
---|
| 375 | if test x$ac_cv_prog_uudecode_base64 != xyes; then
|
---|
| 376 | rm -f Test.class
|
---|
| 377 | AC_MSG_WARN([I have to compile Test.class from scratch])
|
---|
| 378 | if test x$ac_cv_prog_javac_works = xno; then
|
---|
| 379 | AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
|
---|
| 380 | fi
|
---|
| 381 | if test x$ac_cv_prog_javac_works = x; then
|
---|
| 382 | AC_PROG_JAVAC
|
---|
| 383 | fi
|
---|
| 384 | fi
|
---|
| 385 | AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
|
---|
| 386 | JAVA_TEST=Test.java
|
---|
| 387 | CLASS_TEST=Test.class
|
---|
| 388 | TEST=Test
|
---|
| 389 | changequote(, )dnl
|
---|
| 390 | cat << \EOF > $JAVA_TEST
|
---|
| 391 | /* [#]line __oline__ "configure" */
|
---|
| 392 | public class Test {
|
---|
| 393 | public static void main (String args[]) {
|
---|
| 394 | System.exit (0);
|
---|
| 395 | } }
|
---|
| 396 | EOF
|
---|
| 397 | changequote([, ])dnl
|
---|
| 398 | if test x$ac_cv_prog_uudecode_base64 != xyes; then
|
---|
| 399 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
|
---|
| 400 | :
|
---|
| 401 | else
|
---|
| 402 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
| 403 | cat $JAVA_TEST >&AC_FD_CC
|
---|
| 404 | AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
|
---|
| 405 | fi
|
---|
| 406 | fi
|
---|
| 407 | if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
|
---|
| 408 | ac_cv_prog_java_works=yes
|
---|
| 409 | else
|
---|
| 410 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
| 411 | cat $JAVA_TEST >&AC_FD_CC
|
---|
| 412 | AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
|
---|
| 413 | fi
|
---|
| 414 | rm -fr $JAVA_TEST $CLASS_TEST Test.uue
|
---|
| 415 | ])
|
---|
| 416 | AC_PROVIDE([$0])dnl
|
---|
| 417 | ]
|
---|
| 418 | )
|
---|