You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/12/22 20:54:12 UTC

svn commit: r728756 - /incubator/thrift/trunk/aclocal/ax_java.m4

Author: dreiss
Date: Mon Dec 22 11:54:12 2008
New Revision: 728756

URL: http://svn.apache.org/viewvc?rev=728756&view=rev
Log:
THRIFT-208. Fix ax_java.m4 for Ubuntu 8.10

On Ubuntu 8.10, /bin/sh is a symlink to dash (a minimal
Bourne-compatible shell).  ./configure is smart enough
to detect when the shell it is run with is missing features.
In such cases, it switches to a more capable shell (like bash).
This causes it to enable certain shell constructs that are
not supported by dash.  However, the Autoconf macro file that
we use to detect Java support interacts poorly with Autoconf
because it uses divert(-1) for large comments.  This somehow
causes configure to set SHELL to /bin/sh.  As a result, the
libtool script generated during the build process is not
compatible with the shell that is used to run it (if a recent
version of libtool is in use).

This change replaces all of the "divert(-1)" comments
with more traditional "dnl" comments.  This allows Thrift
to build on Ubuntu 8.10.

Modified:
    incubator/thrift/trunk/aclocal/ax_java.m4

Modified: incubator/thrift/trunk/aclocal/ax_java.m4
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/aclocal/ax_java.m4?rev=728756&r1=728755&r2=728756&view=diff
==============================================================================
--- incubator/thrift/trunk/aclocal/ax_java.m4 (original)
+++ incubator/thrift/trunk/aclocal/ax_java.m4 Mon Dec 22 11:54:12 2008
@@ -3,39 +3,33 @@
 dnl in support of proper thrift/autoconf extension naming rules
 dnl
 
-divert(-1)
-
-autoconf M4 macros for Java programs
-Copyright Stephane Bortzmeyer <bo...@pasteur.fr>, 1999
-Released under the GPL licence
-
-A sample configure.in is at the end of this file. Each macro is
-documented by comments before its definition. Here is a summary:
-
-AX_PROG_JAVAC: finds a Java compiler
-AX_PROG_JAVA: finds a Java virtual machine
-AX_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!)
-AX_CHECK_RQRD_CLASS: finds if we have the given class and stops otherwise
-
-divert(0)
-
-
-divert(-1)
-AX_PROG_JAVAC tests an existing Java compiler. It uses the environment
-variable JAVAC then tests in sequence various common Java compilers. For
-political reasons, it starts with the free ones.
-If you want to force a specific compiler:
- - at the configure.in level, set JAVAC=yourcompiler before calling 
-   AX_PROG_JAVAC
- - at the configure level, setenv JAVAC
-You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
-
-*Warning*: its success or failure can depend on a proper setting of the
-CLASSPATH env. variable.
-
-TODO: allow to exclude compilers (rationale: most Java programs cannot compile
-with some compilers like guavac).
-divert(0)
+dnl autoconf M4 macros for Java programs
+dnl Copyright Stephane Bortzmeyer <bo...@pasteur.fr>, 1999
+dnl Released under the GPL licence
+dnl
+dnl A sample configure.in is at the end of this file. Each macro is
+dnl documented by comments before its definition. Here is a summary:
+dnl
+dnl AX_PROG_JAVAC: finds a Java compiler
+dnl AX_PROG_JAVA: finds a Java virtual machine
+dnl AX_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!)
+dnl AX_CHECK_RQRD_CLASS: finds if we have the given class and stops otherwise
+
+
+dnl AX_PROG_JAVAC tests an existing Java compiler. It uses the environment
+dnl variable JAVAC then tests in sequence various common Java compilers. For
+dnl political reasons, it starts with the free ones.
+dnl If you want to force a specific compiler:
+dnl  - at the configure.in level, set JAVAC=yourcompiler before calling 
+dnl    AX_PROG_JAVAC
+dnl  - at the configure level, setenv JAVAC
+dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
+dnl
+dnl *Warning*: its success or failure can depend on a proper setting of the
+dnl CLASSPATH env. variable.
+dnl
+dnl TODO: allow to exclude compilers (rationale: most Java programs cannot compile
+dnl with some compilers like guavac).
 
 AC_DEFUN([AX_PROG_JAVAC],[
 test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, "gcj -C" guavac jikes javac)
@@ -44,26 +38,24 @@
 ])
 
 
-divert(-1)
-AX_PROG_JAVA tests an existing Java virtual machine. It uses the 
-environment variable JAVA then tests in sequence various common Java 
-virtual machines. For political reasons, it starts with the free ones.
-You *must* call [AX_PROG_JAVAC] before.
-If you want to force a specific VM:
- - at the configure.in level, set JAVA=yourvm before calling AX_PROG_JAVA
- - at the configure level, setenv JAVA
-You can use the JAVA variable in your Makefile.in, with @JAVA@.
-
-*Warning*: its success or failure can depend on a proper setting of the
-CLASSPATH env. variable.
-
-TODO: allow to exclude virtual machines (rationale: most Java programs 
-cannot run with some VM like kaffe).
-
-TODO: allow to call this macro without [AX_PROG_JAVAC] before, using a
-class included uuencoded as an here document and uudecoded on the fly
-(check uudecode first) (rationale: a Java package can have no sources).
-divert(0)
+dnl AX_PROG_JAVA tests an existing Java virtual machine. It uses the 
+dnl environment variable JAVA then tests in sequence various common Java 
+dnl virtual machines. For political reasons, it starts with the free ones.
+dnl You *must* call [AX_PROG_JAVAC] before.
+dnl If you want to force a specific VM:
+dnl  - at the configure.in level, set JAVA=yourvm before calling AX_PROG_JAVA
+dnl  - at the configure level, setenv JAVA
+dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
+dnl
+dnl *Warning*: its success or failure can depend on a proper setting of the
+dnl CLASSPATH env. variable.
+dnl
+dnl TODO: allow to exclude virtual machines (rationale: most Java programs 
+dnl cannot run with some VM like kaffe).
+dnl
+dnl TODO: allow to call this macro without [AX_PROG_JAVAC] before, using a
+dnl class included uuencoded as an here document and uudecoded on the fly
+dnl (check uudecode first) (rationale: a Java package can have no sources).
 
 AC_DEFUN([AX_PROG_JAVA],[
 test -z "$JAVA" && AC_CHECK_PROGS(JAVA, kaffe java)
@@ -72,13 +64,11 @@
 ])
 
 
-divert(-1)
-AX_CHECK_CLASS tests the existence of a given Java class, either in
-a jar or in a '.class' file. 
-
-*Warning*: its success or failure can depend on a proper setting of the
-CLASSPATH env. variable.
-divert(0)
+dnl AX_CHECK_CLASS tests the existence of a given Java class, either in
+dnl a jar or in a '.class' file. 
+dnl
+dnl *Warning*: its success or failure can depend on a proper setting of the
+dnl CLASSPATH env. variable.
 
 AC_DEFUN([AX_CHECK_CLASS],[
 CLASS=$1
@@ -103,13 +93,11 @@
 ])
 
 
-divert(-1)
-AX_CHECK_RQRD_CLASS tests the existence of a given Java class, either in
-a jar or in a '.class' file and fails if it doesn't exist.
-
-*Warning*: its success or failure can depend on a proper setting of the
-CLASSPATH env. variable.
-divert(0)
+dnl AX_CHECK_RQRD_CLASS tests the existence of a given Java class, either in
+dnl a jar or in a '.class' file and fails if it doesn't exist.
+dnl
+dnl *Warning*: its success or failure can depend on a proper setting of the
+dnl CLASSPATH env. variable.
 
 AC_DEFUN([AX_CHECK_RQRD_CLASS],[
 CLASS=`echo $1|sed 's/\./_/g'`
@@ -120,10 +108,8 @@
 ])
 
 
-divert(-1)
-AX_CHECK_CLASSPATH just displays the CLASSPATH, for the edification
-of the user.
-divert(0)
+dnl AX_CHECK_CLASSPATH just displays the CLASSPATH, for the edification
+dnl of the user.
 
 AC_DEFUN([AX_CHECK_CLASSPATH],[
 if test -z "$CLASSPATH"; then
@@ -134,9 +120,7 @@
 ])
 
 
-divert(-1)
-Internal use
-divert(0)
+dnl Internal use
 
 AC_DEFUN([AX_PROG_JAVA_WORKS],[
 echo -n "Testing if $JAVA works... "
@@ -165,9 +149,7 @@
 )
 
 
-divert(-1)
-Internal use
-divert(0)
+dnl Internal use
 
 AC_DEFUN([AX_PROG_JAVAC_WORKS],[
 echo -n "Testing if $JAVAC works... "
@@ -189,36 +171,31 @@
 
 
 
-divert(-1)
-TODO: add a AX_CHECK_JAVA_SOURCE where the user can give a complete
-Java source to compile or to compile and run.
-divert(0)
-
-
-
-divert(-1)
-dnl This is a sample configure.in
-dnl Process this file with autoconf to produce a configure script.
-dnl Drop the [] around the macro names
-
-[
-
-AC_INIT(UnTag.java)
+dnl TODO: add a AX_CHECK_JAVA_SOURCE where the user can give a complete
+dnl Java source to compile or to compile and run.
 
-dnl Checks for programs.
-AX_CHECK_CLASSPATH
-AX_PROG_JAVAC
-AX_PROG_JAVA
 
-dnl Checks for classes
-AX_CHECK_RQRD_CLASS(org.xml.sax.Parser)
-AX_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
 
-AC_OUTPUT(Makefile)
-
-]
-
-divert(0)
+dnl dnl This is a sample configure.in
+dnl dnl Process this file with autoconf to produce a configure script.
+dnl dnl Drop the [] around the macro names
+dnl
+dnl [
+dnl
+dnl AC_INIT(UnTag.java)
+dnl
+dnl dnl Checks for programs.
+dnl AX_CHECK_CLASSPATH
+dnl AX_PROG_JAVAC
+dnl AX_PROG_JAVA
+dnl
+dnl dnl Checks for classes
+dnl AX_CHECK_RQRD_CLASS(org.xml.sax.Parser)
+dnl AX_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
+dnl
+dnl AC_OUTPUT(Makefile)
+dnl
+dnl ]
 
 
 dnl @synopsis AX_CHECK_JUNIT