Changeset 23356 for main/trunk/greenstone2/build-src/aclocal.m4
- Timestamp:
- 2010-11-29T16:49:14+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/build-src/aclocal.m4
r16571 r23356 139 139 fi 140 140 ]) 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 )
Note:
See TracChangeset
for help on using the changeset viewer.