| 1 | #==================================================================== |
|---|
| 2 | # NeXus - Neutron & X-ray Common Data Format |
|---|
| 3 | # |
|---|
| 4 | # $Id$ |
|---|
| 5 | # |
|---|
| 6 | # Local autoconf m4 macros - these used by configure.ac |
|---|
| 7 | # and automatically added to aclocal.m4 by running the "aclocal" |
|---|
| 8 | # command (a separate file is needed becausle automake needs to |
|---|
| 9 | # add extra stuff to aclocal.m4 as well) |
|---|
| 10 | # |
|---|
| 11 | # Copyright (C) 2004 Freddie Akeroyd |
|---|
| 12 | # |
|---|
| 13 | # This library is free software; you can redistribute it and/or |
|---|
| 14 | # modify it under the terms of the GNU Lesser General Public |
|---|
| 15 | # License as published by the Free Software Foundation; either |
|---|
| 16 | # version 2 of the License, or (at your option) any later version. |
|---|
| 17 | # |
|---|
| 18 | # This library is distributed in the hope that it will be useful, |
|---|
| 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 21 | # Lesser General Public License for more details. |
|---|
| 22 | # |
|---|
| 23 | # You should have received a copy of the GNU Lesser General Public |
|---|
| 24 | # License along with this library; if not, write to the Free |
|---|
| 25 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|---|
| 26 | # MA 02111-1307 USA |
|---|
| 27 | # |
|---|
| 28 | # For further information, see <http://www.nexusformat.org/> |
|---|
| 29 | # |
|---|
| 30 | # AC_CHECK_COMPILER_OPTION tests for a given compiler option; we need to egrep |
|---|
| 31 | # the output as well as check the status as sometimes the compiler |
|---|
| 32 | # will return success for invalid options |
|---|
| 33 | # |
|---|
| 34 | # Argument 1 is printed and is the real name of the language |
|---|
| 35 | # Argument 2 must be "Fortran 77" or "C" (language to "Push") |
|---|
| 36 | # Argument 3 must be FFLAGS or CFLAGS as appropriate for argument 2 |
|---|
| 37 | # Argument 4 is the compiler option to check |
|---|
| 38 | # Argumnet 5 is any extra program body for the test program |
|---|
| 39 | # |
|---|
| 40 | AC_DEFUN( |
|---|
| 41 | [AC_CHECK_COMPILER_OPTION], |
|---|
| 42 | [AC_MSG_CHECKING([for $1 compiler option $4]) |
|---|
| 43 | AC_LANG_PUSH($2) |
|---|
| 44 | COMPFLAGS_SAVE=[$]$3 |
|---|
| 45 | ac_compile="$ac_compile >check_compiler_option.$$ 2>&1" |
|---|
| 46 | $3="[$]$3 $4" |
|---|
| 47 | AC_COMPILE_IFELSE( |
|---|
| 48 | [AC_LANG_PROGRAM(,[$5])], |
|---|
| 49 | [COMPILER_OPTION=yes], |
|---|
| 50 | [COMPILER_OPTION=no]) |
|---|
| 51 | if test $COMPILER_OPTION = "yes"; then |
|---|
| 52 | if test `$EGREP "[Uu]nrecogni[sz]ed|[Uu]nknown|[Ii]nvalid|[Ee]rror" check_compiler_option.$$ | wc -l` -gt 0; then COMPILER_OPTION="no"; fi |
|---|
| 53 | fi |
|---|
| 54 | if test $COMPILER_OPTION = "yes"; then |
|---|
| 55 | AC_MSG_RESULT([yes]) |
|---|
| 56 | else |
|---|
| 57 | AC_MSG_RESULT([no]) |
|---|
| 58 | $3=$COMPFLAGS_SAVE |
|---|
| 59 | fi |
|---|
| 60 | rm -f check_compiler_option.$$ |
|---|
| 61 | AC_LANG_POP($2)] |
|---|
| 62 | ) |
|---|
| 63 | # |
|---|
| 64 | # AC_CHECK_C_OPTION |
|---|
| 65 | # |
|---|
| 66 | AC_DEFUN( |
|---|
| 67 | [AC_CHECK_C_OPTION], |
|---|
| 68 | [AC_CHECK_COMPILER_OPTION(C,C,CFLAGS,[$1],[$2])] |
|---|
| 69 | ) |
|---|
| 70 | # |
|---|
| 71 | # AC_CHECK_CPP_OPTION |
|---|
| 72 | # |
|---|
| 73 | AC_DEFUN( |
|---|
| 74 | [AC_CHECK_CPP_OPTION], |
|---|
| 75 | [AC_CHECK_COMPILER_OPTION(C,C,CPPFLAGS,[$1],[$2])] |
|---|
| 76 | ) |
|---|
| 77 | # |
|---|
| 78 | # AC_CHECK_F77_OPTION |
|---|
| 79 | # |
|---|
| 80 | AC_DEFUN( |
|---|
| 81 | [AC_CHECK_F77_OPTION], |
|---|
| 82 | [AC_CHECK_COMPILER_OPTION(Fortran 77,Fortran 77,FFLAGS,[$1],[$2])] |
|---|
| 83 | ) |
|---|
| 84 | # |
|---|
| 85 | # AC_CHECK_F90_OPTION |
|---|
| 86 | # We use the F77 test, but switch the name of the compiler |
|---|
| 87 | # |
|---|
| 88 | AC_DEFUN( |
|---|
| 89 | [AC_CHECK_F90_OPTION], |
|---|
| 90 | [F77_SAVE=[$]F77 |
|---|
| 91 | FFLAGS_SAVE=[$]FFLAGS |
|---|
| 92 | F77=[$]F90 |
|---|
| 93 | FFLAGS=[$]F90FLAGS |
|---|
| 94 | AC_CHECK_COMPILER_OPTION(Fortran 90,Fortran 77,FFLAGS,[$1],[$2]) |
|---|
| 95 | F77=[$]F77_SAVE |
|---|
| 96 | FFLAGS=[$]FFLAGS_SAVE |
|---|
| 97 | ] |
|---|
| 98 | ) |
|---|
| 99 | |
|---|
| 100 | AC_DEFUN([LINUX_DISTRIBUTION], |
|---|
| 101 | [ |
|---|
| 102 | AC_REQUIRE([AC_CANONICAL_TARGET]) |
|---|
| 103 | DISTRIBUTION="" |
|---|
| 104 | case "$target" in |
|---|
| 105 | i[[3456]]86-*-linux-* | i[[3456]]86-*-linux) |
|---|
| 106 | if test -f /etc/lsb-release ; then |
|---|
| 107 | DISTRIBUTION=`(. /etc/lsb-release; echo $DISTRIB_DESCRIPTION)` |
|---|
| 108 | fi |
|---|
| 109 | if test -z "$DISTRIBUTION"; then |
|---|
| 110 | for i in /etc/*-release; do |
|---|
| 111 | if test "$i" != lsb-release; then DISTRIBUTION=`cat $i | head -1`; fi |
|---|
| 112 | done |
|---|
| 113 | fi |
|---|
| 114 | ;; |
|---|
| 115 | esac |
|---|
| 116 | if test -z "$DISTRIBUTION"; then DISTRIBUTION="Unknown"; fi |
|---|
| 117 | AC_SUBST([DISTRIBUTION]) |
|---|
| 118 | ]) |
|---|
| 119 | |
|---|
| 120 | # AC_CHECK_ROOT |
|---|
| 121 | # |
|---|
| 122 | # $1 = name of arg |
|---|
| 123 | # $2 = root variable name to set |
|---|
| 124 | # $3 = list of root paths to try. If the path is a file, assume it is |
|---|
| 125 | # path/bin/files and then work out path |
|---|
| 126 | # $4 = file in path to locate |
|---|
| 127 | # $5 = default withval |
|---|
| 128 | # |
|---|
| 129 | # e.g. AC_CHECK_ROOT([tcl],[TCLROOT],[/usr /usr/local],[include/tcl.h]) |
|---|
| 130 | # |
|---|
| 131 | AC_DEFUN( |
|---|
| 132 | [AC_CHECK_ROOT], |
|---|
| 133 | [ $2="" |
|---|
| 134 | AC_SUBST([$2]) |
|---|
| 135 | AC_ARG_WITH([$1], |
|---|
| 136 | AC_HELP_STRING([--with-$1=/path/to/$1_install_directory], |
|---|
| 137 | [Specify absolute path to root of $1 install directory.]), |
|---|
| 138 | [if test x$withval != xno -a x$withval != xyes; then $2=$withval; fi], |
|---|
| 139 | [with_$1=$5]) |
|---|
| 140 | if test x$with_$1 != xno; then |
|---|
| 141 | AC_MSG_CHECKING(for $1 root installation directory) |
|---|
| 142 | # if --with secified a file, assume it is ROOT/bin/file |
|---|
| 143 | if test x[$]$2 != x; then |
|---|
| 144 | if test -f [$]$2; then |
|---|
| 145 | $2=`dirname [$]$2`/.. |
|---|
| 146 | fi |
|---|
| 147 | fi |
|---|
| 148 | # $2 should now either be empty or a valid possible root |
|---|
| 149 | for i in $3; do |
|---|
| 150 | if test x[$]$2 = x -a -r $i/$4; then $2=$i; fi |
|---|
| 151 | done |
|---|
| 152 | if test x[$]$2 = x; then |
|---|
| 153 | AC_MSG_RESULT(unknown) |
|---|
| 154 | else |
|---|
| 155 | AC_MSG_RESULT([$]$2) |
|---|
| 156 | fi |
|---|
| 157 | fi |
|---|
| 158 | ]) |
|---|
| 159 | |
|---|
| 160 | AC_DEFUN([AC_CHECK_PYTHON_MODULE], |
|---|
| 161 | [ |
|---|
| 162 | if test -z "$PYTHON"; then PYTHON="python"; fi |
|---|
| 163 | AC_MSG_CHECKING(for python module $1) |
|---|
| 164 | $PYTHON -c "import $1" 2>/dev/null |
|---|
| 165 | if test $? -eq 0; then |
|---|
| 166 | eval PYTHON_$1=1 |
|---|
| 167 | eval PYTHON_$1_found="yes" |
|---|
| 168 | AC_MSG_RESULT(found) |
|---|
| 169 | else |
|---|
| 170 | eval PYTHON_$1=0 |
|---|
| 171 | eval PYTHON_$1_found="no" |
|---|
| 172 | AC_MSG_RESULT(not found) |
|---|
| 173 | fi |
|---|
| 174 | AC_SUBST(PYTHON_$1) |
|---|
| 175 | ]) |
|---|
| 176 | |
|---|
| 177 | # http://ac-archive.sourceforge.net/ac-archive/ac_prog_java_works.html |
|---|
| 178 | |
|---|
| 179 | AC_DEFUN([AC_PROG_JAVA_WORKS], [ |
|---|
| 180 | AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes) |
|---|
| 181 | if test x$uudecode = xyes; then |
|---|
| 182 | AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [ |
|---|
| 183 | dnl /** |
|---|
| 184 | dnl * Test.java: used to test if java compiler works. |
|---|
| 185 | dnl */ |
|---|
| 186 | dnl public class Test |
|---|
| 187 | dnl { |
|---|
| 188 | dnl |
|---|
| 189 | dnl public static void |
|---|
| 190 | dnl main( String[] argv ) |
|---|
| 191 | dnl { |
|---|
| 192 | dnl System.exit (0); |
|---|
| 193 | dnl } |
|---|
| 194 | dnl |
|---|
| 195 | dnl } |
|---|
| 196 | cat << \EOF > Test.uue |
|---|
| 197 | begin-base64 644 Test.class |
|---|
| 198 | yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE |
|---|
| 199 | bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 |
|---|
| 200 | bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s |
|---|
| 201 | YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG |
|---|
| 202 | aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB |
|---|
| 203 | AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB |
|---|
| 204 | AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= |
|---|
| 205 | ==== |
|---|
| 206 | EOF |
|---|
| 207 | if uudecode$EXEEXT Test.uue; then |
|---|
| 208 | ac_cv_prog_uudecode_base64=yes |
|---|
| 209 | else |
|---|
| 210 | echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC |
|---|
| 211 | echo "configure: failed file was:" >&AC_FD_CC |
|---|
| 212 | cat Test.uue >&AC_FD_CC |
|---|
| 213 | ac_cv_prog_uudecode_base64=no |
|---|
| 214 | fi |
|---|
| 215 | rm -f Test.uue]) |
|---|
| 216 | fi |
|---|
| 217 | if test x$ac_cv_prog_uudecode_base64 != xyes; then |
|---|
| 218 | rm -f Test.class |
|---|
| 219 | AC_MSG_WARN([I have to compile Test.class from scratch]) |
|---|
| 220 | if test x$ac_cv_prog_javac_works = xno; then |
|---|
| 221 | AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly]) |
|---|
| 222 | fi |
|---|
| 223 | if test x$ac_cv_prog_javac_works = x; then |
|---|
| 224 | AC_PROG_JAVAC |
|---|
| 225 | fi |
|---|
| 226 | fi |
|---|
| 227 | AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [ |
|---|
| 228 | JAVA_TEST=Test.java |
|---|
| 229 | CLASS_TEST=Test.class |
|---|
| 230 | TEST=Test |
|---|
| 231 | changequote(, )dnl |
|---|
| 232 | cat << \EOF > $JAVA_TEST |
|---|
| 233 | /* [#]line __oline__ "configure" */ |
|---|
| 234 | public class Test { |
|---|
| 235 | public static void main (String args[]) { |
|---|
| 236 | System.exit (0); |
|---|
| 237 | } } |
|---|
| 238 | EOF |
|---|
| 239 | changequote([, ])dnl |
|---|
| 240 | if test x$ac_cv_prog_uudecode_base64 != xyes; then |
|---|
| 241 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then |
|---|
| 242 | : |
|---|
| 243 | else |
|---|
| 244 | echo "configure: failed program was:" >&AC_FD_CC |
|---|
| 245 | cat $JAVA_TEST >&AC_FD_CC |
|---|
| 246 | AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)) |
|---|
| 247 | fi |
|---|
| 248 | fi |
|---|
| 249 | if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then |
|---|
| 250 | ac_cv_prog_java_works=yes |
|---|
| 251 | else |
|---|
| 252 | echo "configure: failed program was:" >&AC_FD_CC |
|---|
| 253 | cat $JAVA_TEST >&AC_FD_CC |
|---|
| 254 | AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?)) |
|---|
| 255 | fi |
|---|
| 256 | rm -fr $JAVA_TEST $CLASS_TEST Test.uue |
|---|
| 257 | ]) |
|---|
| 258 | AC_PROVIDE([$0])dnl |
|---|
| 259 | ] |
|---|
| 260 | ) |
|---|
| 261 | |
|---|
| 262 | # http://ac-archive.sourceforge.net/ac-archive/ac_prog_java.html |
|---|
| 263 | |
|---|
| 264 | AC_DEFUN([AC_PROG_JAVA],[ |
|---|
| 265 | AC_REQUIRE([AC_EXEEXT])dnl |
|---|
| 266 | if test x$JAVAPREFIX = x; then |
|---|
| 267 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT) |
|---|
| 268 | else |
|---|
| 269 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX) |
|---|
| 270 | fi |
|---|
| 271 | test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH]) |
|---|
| 272 | AC_PROG_JAVA_WORKS |
|---|
| 273 | AC_PROVIDE([$0])dnl |
|---|
| 274 | ]) |
|---|
| 275 | |
|---|
| 276 | # http://ac-archive.sourceforge.net/ac-archive/ac_prog_javac_works.html |
|---|
| 277 | |
|---|
| 278 | AC_DEFUN([AC_PROG_JAVAC_WORKS],[ |
|---|
| 279 | AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [ |
|---|
| 280 | JAVA_TEST=Test.java |
|---|
| 281 | CLASS_TEST=Test.class |
|---|
| 282 | cat << \EOF > $JAVA_TEST |
|---|
| 283 | /* [#]line __oline__ "configure" */ |
|---|
| 284 | public class Test { |
|---|
| 285 | } |
|---|
| 286 | EOF |
|---|
| 287 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then |
|---|
| 288 | ac_cv_prog_javac_works=yes |
|---|
| 289 | else |
|---|
| 290 | AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)]) |
|---|
| 291 | echo "configure: failed program was:" >&AC_FD_CC |
|---|
| 292 | cat $JAVA_TEST >&AC_FD_CC |
|---|
| 293 | fi |
|---|
| 294 | rm -f $JAVA_TEST $CLASS_TEST |
|---|
| 295 | ]) |
|---|
| 296 | AC_PROVIDE([$0])dnl |
|---|
| 297 | ]) |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | # http://ac-archive.sourceforge.net/ac-archive/ac_prog_javac.html |
|---|
| 301 | |
|---|
| 302 | AC_DEFUN([AC_PROG_JAVAC],[ |
|---|
| 303 | AC_REQUIRE([AC_EXEEXT])dnl |
|---|
| 304 | if test "x$JAVAPREFIX" = x; then |
|---|
| 305 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT) |
|---|
| 306 | else |
|---|
| 307 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX) |
|---|
| 308 | fi |
|---|
| 309 | test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH]) |
|---|
| 310 | AC_PROG_JAVAC_WORKS |
|---|
| 311 | AC_PROVIDE([$0])dnl |
|---|
| 312 | ]) |
|---|
| 313 | |
|---|
| 314 | # http://ac-archive.sourceforge.net/ac-archive/ac_try_compile_java.html |
|---|
| 315 | |
|---|
| 316 | AC_DEFUN([AC_TRY_COMPILE_JAVA],[ |
|---|
| 317 | AC_REQUIRE([AC_PROG_JAVAC])dnl |
|---|
| 318 | cat << \EOF > Test.java |
|---|
| 319 | /* [#]line __oline__ "configure" */ |
|---|
| 320 | ifelse([$1], , , [import $1;]) |
|---|
| 321 | public class Test { |
|---|
| 322 | [$2] |
|---|
| 323 | } |
|---|
| 324 | EOF |
|---|
| 325 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class |
|---|
| 326 | then |
|---|
| 327 | dnl Don't remove the temporary files here, so they can be examined. |
|---|
| 328 | ifelse([$3], , :, [$3]) |
|---|
| 329 | else |
|---|
| 330 | echo "configure: failed program was:" >&AC_FD_CC |
|---|
| 331 | cat Test.java >&AC_FD_CC |
|---|
| 332 | ifelse([$4], , , [ rm -fr Test* |
|---|
| 333 | $4 |
|---|
| 334 | ])dnl |
|---|
| 335 | fi |
|---|
| 336 | rm -fr Test*]) |
|---|
| 337 | |
|---|
| 338 | # http://ac-archive.sourceforge.net/ac-archive/ac_check_class.html |
|---|
| 339 | |
|---|
| 340 | AC_DEFUN([AC_CHECK_CLASS],[ |
|---|
| 341 | AC_REQUIRE([AC_PROG_JAVA]) |
|---|
| 342 | ac_var_name=`echo $1 | sed 's/\./_/g'` |
|---|
| 343 | dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is |
|---|
| 344 | dnl dynamic I need an extra level of extraction |
|---|
| 345 | AC_MSG_CHECKING([for $1 class]) |
|---|
| 346 | AC_CACHE_VAL(ac_cv_class_$ac_var_name, [ |
|---|
| 347 | if test x$ac_cv_prog_uudecode_base64 = xyes; then |
|---|
| 348 | dnl /** |
|---|
| 349 | dnl * Test.java: used to test dynamicaly if a class exists. |
|---|
| 350 | dnl */ |
|---|
| 351 | dnl public class Test |
|---|
| 352 | dnl { |
|---|
| 353 | dnl |
|---|
| 354 | dnl public static void |
|---|
| 355 | dnl main( String[] argv ) |
|---|
| 356 | dnl { |
|---|
| 357 | dnl Class lib; |
|---|
| 358 | dnl if (argv.length < 1) |
|---|
| 359 | dnl { |
|---|
| 360 | dnl System.err.println ("Missing argument"); |
|---|
| 361 | dnl System.exit (77); |
|---|
| 362 | dnl } |
|---|
| 363 | dnl try |
|---|
| 364 | dnl { |
|---|
| 365 | dnl lib = Class.forName (argv[0]); |
|---|
| 366 | dnl } |
|---|
| 367 | dnl catch (ClassNotFoundException e) |
|---|
| 368 | dnl { |
|---|
| 369 | dnl System.exit (1); |
|---|
| 370 | dnl } |
|---|
| 371 | dnl lib = null; |
|---|
| 372 | dnl System.exit (0); |
|---|
| 373 | dnl } |
|---|
| 374 | dnl |
|---|
| 375 | dnl } |
|---|
| 376 | cat << \EOF > Test.uue |
|---|
| 377 | begin-base64 644 Test.class |
|---|
| 378 | yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE |
|---|
| 379 | bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 |
|---|
| 380 | bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ |
|---|
| 381 | AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt |
|---|
| 382 | ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV |
|---|
| 383 | ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp |
|---|
| 384 | VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM |
|---|
| 385 | amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi |
|---|
| 386 | AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B |
|---|
| 387 | AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA |
|---|
| 388 | AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN |
|---|
| 389 | uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK |
|---|
| 390 | AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA |
|---|
| 391 | JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA |
|---|
| 392 | JwAAAAIAKA== |
|---|
| 393 | ==== |
|---|
| 394 | EOF |
|---|
| 395 | if uudecode$EXEEXT Test.uue; then |
|---|
| 396 | : |
|---|
| 397 | else |
|---|
| 398 | echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC |
|---|
| 399 | echo "configure: failed file was:" >&AC_FD_CC |
|---|
| 400 | cat Test.uue >&AC_FD_CC |
|---|
| 401 | ac_cv_prog_uudecode_base64=no |
|---|
| 402 | fi |
|---|
| 403 | rm -f Test.uue |
|---|
| 404 | if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then |
|---|
| 405 | eval "ac_cv_class_$ac_var_name=yes" |
|---|
| 406 | else |
|---|
| 407 | eval "ac_cv_class_$ac_var_name=no" |
|---|
| 408 | fi |
|---|
| 409 | rm -f Test.class |
|---|
| 410 | else |
|---|
| 411 | AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"], |
|---|
| 412 | [eval "ac_cv_class_$ac_var_name=no"]) |
|---|
| 413 | fi |
|---|
| 414 | eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" |
|---|
| 415 | eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" |
|---|
| 416 | HAVE_LAST_CLASS=$ac_var_val |
|---|
| 417 | if test x$ac_var_val = xyes; then |
|---|
| 418 | ifelse([$2], , :, [$2]) |
|---|
| 419 | else |
|---|
| 420 | ifelse([$3], , :, [$3]) |
|---|
| 421 | fi |
|---|
| 422 | ]) |
|---|
| 423 | dnl for some reason the above statment didn't fall though here? |
|---|
| 424 | dnl do scripts have variable scoping? |
|---|
| 425 | eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" |
|---|
| 426 | AC_MSG_RESULT($ac_var_val) |
|---|
| 427 | ]) |
|---|
| 428 | |
|---|
| 429 | # =========================================================================== |
|---|
| 430 | # http://www.gnu.org/software/autoconf-archive/ax_check_junit.html |
|---|
| 431 | # =========================================================================== |
|---|
| 432 | # |
|---|
| 433 | # SYNOPSIS |
|---|
| 434 | # |
|---|
| 435 | # AX_CHECK_JUNIT |
|---|
| 436 | # |
|---|
| 437 | # DESCRIPTION |
|---|
| 438 | # |
|---|
| 439 | # AX_CHECK_JUNIT tests the availability of the Junit testing framework, |
|---|
| 440 | # and set some variables for conditional compilation of the test suite by |
|---|
| 441 | # automake. |
|---|
| 442 | # |
|---|
| 443 | # If available, JUNIT is set to a command launching the text based user |
|---|
| 444 | # interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and @TESTS_JUNIT@ |
|---|
| 445 | # is set to $TESTS_JUNIT, otherwise they are set to empty values. |
|---|
| 446 | # |
|---|
| 447 | # You can use these variables in your Makefile.am file like this : |
|---|
| 448 | # |
|---|
| 449 | # # Some of the following classes are built only if junit is available |
|---|
| 450 | # JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java |
|---|
| 451 | # |
|---|
| 452 | # noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@ |
|---|
| 453 | # |
|---|
| 454 | # EXTRA_JAVA = $(JAVA_JUNIT) |
|---|
| 455 | # |
|---|
| 456 | # TESTS_JUNIT = AllJunitTests |
|---|
| 457 | # |
|---|
| 458 | # TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@ |
|---|
| 459 | # |
|---|
| 460 | # EXTRA_TESTS = $(TESTS_JUNIT) |
|---|
| 461 | # |
|---|
| 462 | # AllJunitTests : |
|---|
| 463 | # echo "#! /bin/sh" > $@ |
|---|
| 464 | # echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@ |
|---|
| 465 | # chmod +x $@ |
|---|
| 466 | # |
|---|
| 467 | # LICENSE |
|---|
| 468 | # |
|---|
| 469 | # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org> |
|---|
| 470 | # |
|---|
| 471 | # Copying and distribution of this file, with or without modification, are |
|---|
| 472 | # permitted in any medium without royalty provided the copyright notice |
|---|
| 473 | # and this notice are preserved. This file is offered as-is, without any |
|---|
| 474 | # warranty. |
|---|
| 475 | |
|---|
| 476 | AU_ALIAS([AC_CHECK_JUNIT], [AX_CHECK_JUNIT]) |
|---|
| 477 | AC_DEFUN([AX_CHECK_JUNIT],[ |
|---|
| 478 | AC_CACHE_VAL(ac_cv_prog_JUNIT,[ |
|---|
| 479 | AC_CHECK_CLASS(junit.textui.TestRunner) |
|---|
| 480 | if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then |
|---|
| 481 | ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner' |
|---|
| 482 | fi]) |
|---|
| 483 | AC_MSG_CHECKING([for junit]) |
|---|
| 484 | if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then |
|---|
| 485 | JUNIT="$ac_cv_prog_JUNIT" |
|---|
| 486 | JAVA_JUNIT='$(JAVA_JUNIT)' |
|---|
| 487 | TESTS_JUNIT='$(TESTS_JUNIT)' |
|---|
| 488 | else |
|---|
| 489 | JUNIT= |
|---|
| 490 | JAVA_JUNIT= |
|---|
| 491 | TESTS_JUNIT= |
|---|
| 492 | fi |
|---|
| 493 | AC_MSG_RESULT($JAVA_JUNIT) |
|---|
| 494 | AC_SUBST(JUNIT) |
|---|
| 495 | AC_SUBST(JAVA_JUNIT) |
|---|
| 496 | AC_SUBST(TESTS_JUNIT)]) |
|---|