INTEGRATION: CWS gcj1 (1.77.4); FILE MERGED

2005/01/07 08:56:08 cmc 1.77.4.6: RESYNC: (1.77-1.80); FILE MERGED
2005/01/06 14:10:11 cmc 1.77.4.5: #i38188# don't poke CLASSPATH with gcj and require javadoc
2004/12/10 23:23:41 cmc 1.77.4.4: #i34439# backout AC_path_PROG idocy
2004/12/10 08:47:25 cmc 1.77.4.3: #i38188# little tweak
2004/12/03 08:47:23 cmc 1.77.4.2: #i38188# don't need xsltproc with gcj, search seperately for javadoc, and don't get too excited if it is missing
2004/12/01 08:24:13 cmc 1.77.4.1: #i38188# convert --enable-java/--disable-java into --with[out]java=foo where --without-java is like --disable-java, --with-java is like --enable-java, and --with-java=foo where foo is specified overrides the default java interpreter, e.g. --with-java=gij
This commit is contained in:
Oliver Bolte 2005-01-25 15:54:53 +00:00
parent e2ecbf12ae
commit 5f2105e471

View file

@ -3,7 +3,7 @@ dnl * vi:set sw=3 ts=3 et:
dnl * dnl *
dnl * Name: configure.in dnl * Name: configure.in
dnl * Auth: Willem van Dorp, Ross Nicholson, Oisin Boydell - Sun Microsystems Ireland dnl * Auth: Willem van Dorp, Ross Nicholson, Oisin Boydell - Sun Microsystems Ireland
dnl * Date: $Date: 2005-01-25 12:42:58 $ dnl * Date: $Date: 2005-01-25 16:54:53 $
dnl * dnl *
dnl * Desc: This file serves as input for the GNU autoconf package dnl * Desc: This file serves as input for the GNU autoconf package
dnl * in order to create a configure script. dnl * in order to create a configure script.
@ -12,7 +12,7 @@ dnl * necessary to build OpenOffice.org
dnl * dnl *
dnl * dnl *
dnl ******************************************************************/ dnl ******************************************************************/
AC_REVISION( $Revision: 1.86 $ ) AC_REVISION( $Revision: 1.87 $ )
AC_PREREQ(2.50) AC_PREREQ(2.50)
AC_INIT() AC_INIT()
echo "$@" >config.parms echo "$@" >config.parms
@ -202,11 +202,12 @@ AC_ARG_WITH(gxx_include_path,
Usage: --with-gxx-include-path=<absolute path to g++ include dir> Usage: --with-gxx-include-path=<absolute path to g++ include dir>
],,) ],,)
AC_ARG_ENABLE(java, AC_ARG_WITH(java,
[ --disable-java Build without Java support. Use if there is no supported JDK [ --with-java Build with[out] Java support. If you use --without-java then
for your platform. The build will have no support for Java the build will have no support for Java components, applets,
components, applets, accessibility or XML filters. accessibility or XML filters. Use --with-java=gij to enable gij/gcj
],,) as java/javac replacements
], WITH_JAVA=$withval, WITH_JAVA=java)
AC_ARG_WITH(ant-home, AC_ARG_WITH(ant-home,
[ --with-ant-home If you have installed Jakarta Ant on your system, [ --with-ant-home If you have installed Jakarta Ant on your system,
please supply the path here. please supply the path here.
@ -1566,60 +1567,49 @@ dnl ===================================================================
dnl Java support enable dnl Java support enable
dnl =================================================================== dnl ===================================================================
AC_MSG_CHECKING([whether to build with Java support]) AC_MSG_CHECKING([whether to build with Java support])
if test "$enable_java" != "no"; then if test "$WITH_JAVA" != "no"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
SOLAR_JAVA="TRUE" SOLAR_JAVA="TRUE"
NEEDXSLTPROC="no"
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
SOLAR_JAVA="" SOLAR_JAVA=""
NEEDXSLTPROC="yes"
AC_MSG_WARN([building without java will mean some features will not be available])
echo "building without java will mean some features will not be available" >>warn
fi fi
AC_SUBST(SOLAR_JAVA) AC_SUBST(SOLAR_JAVA)
dnl =================================================================== dnl ===================================================================
dnl Checks for JDK. dnl Checks for java
dnl =================================================================== dnl ===================================================================
if test "$enable_java" != "no"; then if test "$SOLAR_JAVA" != ""; then
JAVA_HOME=; export JAVA_HOME JAVA_HOME=; export JAVA_HOME
if test -z "$with_jdk_home"; then if test -z "$with_jdk_home"; then
AC_PATH_PROG(JAVAC, javac) AC_PATH_PROG(JAVAINTERPRETER, $WITH_JAVA)
AC_PATH_PROG(JAVA, java)
else else
_javac_path="$with_jdk_home/bin/javac" _java_path="$with_jdk_home/bin/$WITH_JAVA"
dnl Check if there is a java compiler at all.
if test -x "$_javac_path"; then
JAVAC=$_javac_path
else
_javac_path="$with_jdk_home/gcj"
dnl Check for gcj
if test -x "$_javac_path"; then
JAVAC=$_javac_path
else
AC_MSG_ERROR([$_javac_path not found set with_jdk_home])
fi
fi
_java_path="$with_jdk_home/bin/java"
dnl Check if there is a java interpreter at all. dnl Check if there is a java interpreter at all.
if test -x "$_java_path"; then if test -x "$_java_path"; then
JAVA=$_java_path JAVAINTERPRETER=$_java_path
else else
_java_path="$with_jdk_home/gij" AC_MSG_ERROR([$_java_path not found set with_jdk_home])
dnl Check for gcj
if test -x "$_java_path"; then
JAVA=$_java_path
else
AC_MSG_ERROR([$_java_path not found set with_jdk_home])
fi
fi fi
fi fi
fi
dnl ===================================================================
dnl Checks for JDK.
dnl ===================================================================
if test "$SOLAR_JAVA" != ""; then
AC_MSG_CHECKING([the installed JDK]) AC_MSG_CHECKING([the installed JDK])
if test "$JAVA"; then if test "$JAVAINTERPRETER"; then
dnl java -version sends output to stderr! dnl java -version sends output to stderr!
if test `$JAVA -version 2>&1 | grep -c "Kaffe"` -gt 0; then if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
dnl Kaffe specific tests dnl Kaffe specific tests
KAFFE_VER=`$JAVA -version 2>&1 | $EGREP " Version:" | $SED -r "s/.* Version: ([[0-9\.]]*).*/\1/"` KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP " Version:" | $SED -r "s/.* Version: ([[0-9\.]]*).*/\1/"`
if test -z "$KAFFE_VER"; then if test -z "$KAFFE_VER"; then
AC_MSG_ERROR([looks like Kaffe but version detection failed]) AC_MSG_ERROR([looks like Kaffe but version detection failed])
fi fi
@ -1634,46 +1624,118 @@ if test "$enable_java" != "no"; then
AC_MSG_RESULT([checked (Kaffe $KAFFE_VER)]) AC_MSG_RESULT([checked (Kaffe $KAFFE_VER)])
AC_MSG_WARN([EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile]) AC_MSG_WARN([EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile])
echo "EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile" >>warn echo "EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile" >>warn
JAVA_HOME=`echo $JAVAC | $SED -n "s,//*bin//*javac,,p"` JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
elif test `$JAVAC -v 2>&1 | grep -c "gcc version"` -gt 0; then elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
dnl gcj specific tests
GCJ_VER=`$JAVAC -dumpversion 2>&1`
if test -z "$GCJ_VER"; then
AC_MSG_ERROR([looks like gcj but version detection failed])
fi
_gcj_ver=$GCJ_VER
JDK=gcj JDK=gcj
AC_MSG_RESULT([checked (gcj $GCJ_VER)]) AC_MSG_RESULT([checked (gcj)])
AC_MSG_WARN([EXPERIMENTAL: gcj is not a full JDK replacement - some projects will fail to compile]) AC_MSG_WARN([EXPERIMENTAL: gij/gcj is not a full JDK replacement - some projects will fail to compile])
echo "EXPERIMENTAL: gcj is not a full JDK replacement - some projects will fail to compile" >>warn echo "EXPERIMENTAL: gij/gcj is not a full JDK replacement - some projects will fail to compile" >>warn
JAVA_HOME=`echo $JAVAC | $SED -n "s,//*gcj,,p"` JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*gij,,p"`
else else
dnl SUN JDK specific tests dnl SUN JDK specific tests
_jdk=`$JAVAC -J-version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//` _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
_jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
if test "$_jdk_ver" -lt 10300; then if test "$_jdk_ver" -lt 10300; then
AC_MSG_ERROR([JDK is too old, you need at least 1.3]) AC_MSG_ERROR([JDK is too old, you need at least 1.3])
fi fi
AC_MSG_RESULT([checked (JDK $_jdk)]) AC_MSG_RESULT([checked (JDK $_jdk)])
JAVA_HOME=`echo $JAVAC | $SED -n "s,//*bin//*javac,,p"` JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
fi fi
else else
AC_MSG_ERROR([JAVA not found. You need at least jdk-1.3, Kaffee 1.01, or gcj]) AC_MSG_ERROR([JAVA not found. You need at least jdk-1.3, Kaffee 1.01, or gcj])
fi fi
dnl xsltproc not needed with JDK present.
XSLTPROC=NO_XSLTPROC
else else
dnl Java disabled dnl Java disabled
JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
fi
dnl ===================================================================
dnl Checks for javac
dnl ===================================================================
if test "$SOLAR_JAVA" != ""; then
if test "$JDK" == "gcj"; then
javacompiler="gcj"
else
javacompiler="javac"
fi
if test -z "$with_jdk_home"; then
AC_PATH_PROG(JAVACOMPILER, $javacompiler)
else
_javac_path="$with_jdk_home/bin/$javacompiler"
dnl Check if there is a java compiler at all.
if test -x "$_javac_path"; then
JAVACOMPILER=$_javac_path
fi
fi
if test -z "$JAVACOMPILER"; then
AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
fi
fi
dnl ===================================================================
dnl Checks for javadoc
dnl ===================================================================
if test "$SOLAR_JAVA" != ""; then
if test -z "$with_jdk_home"; then
AC_PATH_PROG(JAVADOC, javadoc)
else
_javadoc_path="$with_jdk_home/bin/javadoc"
dnl Check if there is a javadoc at all.
if test -x "$_javadoc_path"; then
JAVADOC=$_javadoc_path
else
AC_PATH_PROG(JAVADOC, javadoc)
fi
fi
if test -z "$JAVADOC"; then
AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
fi
fi
if test "$SOLAR_JAVA" != ""; then
if test "$JDK" != "gcj"; then
# check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
if test "$JAVA_HOME" == "/usr" -a "x$with_jdk_home" == "x"; then
if basename $(readlink $(readlink $JAVAC)) >/dev/null 2>/dev/null; then
# try to recover first by looking whether we have a alternatives
# system as in Debian or newer SuSEs where following /usr/bin/javac
# over /etc/alternatives/javac leads to the right bindir where we
# just need to strip a bit away to get a valid JAVA_HOME
JAVA_HOME=$(readlink $(readlink $JAVAC) | $SED -e s,/bin/javac$,,)
else
# else warn
AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
fi
fi
# now check if $JAVA_HOME is really valid
if test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" == "x"; then
AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
fi
fi
fi
AC_SUBST(JAVA_HOME)
AC_SUBST(JDK)
AC_SUBST(JAVAINTERPRETER)
AC_SUBST(JAVACOMPILER)
AC_SUBST(JAVADOC)
if test "$NEEDXSLTPROC" = "no"; then
XSLTPROC=NO_XSLTPROC
else
dnl Check for xsltproc dnl Check for xsltproc
AC_PATH_PROG(XSLTPROC, xsltproc, no) AC_PATH_PROG(XSLTPROC, xsltproc, no)
if test "$XSLTPROC" = "no"; then if test "$XSLTPROC" = "no"; then
AC_MSG_ERROR([xsltproc is required when building with --disable-java.]) AC_MSG_ERROR([xsltproc is required])
fi fi
fi fi
# check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
@ -2929,7 +2991,8 @@ AC_SUBST(XINERAMA_LINK)
dnl =================================================================== dnl ===================================================================
dnl Test for the presence of Ant and that it works dnl Test for the presence of Ant and that it works
dnl =================================================================== dnl ===================================================================
if test "$enable_java" != "no"; then
if test "$SOLAR_JAVA" != ""; then
ANT_HOME=; export ANT_HOME ANT_HOME=; export ANT_HOME
WITH_ANT_HOME=; export WITH_ANT_HOME WITH_ANT_HOME=; export WITH_ANT_HOME
if test -z "$with_ant_home"; then if test -z "$with_ant_home"; then
@ -2939,7 +3002,6 @@ else
WITH_ANT_HOME=$with_ant_home WITH_ANT_HOME=$with_ant_home
fi fi
if test -z "$ANT"; then if test -z "$ANT"; then
AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home]) AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
else else
@ -2971,7 +3033,11 @@ cat > conftest.xml << EOF
</project> </project>
EOF EOF
ant_cmd="$ANT -buildfile conftest.xml 1>&2" if test "$JDK" == "gcj"; then
ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
else
ant_cmd="$ANT -buildfile conftest.xml 1>&2"
fi
AC_TRY_EVAL(ant_cmd) AC_TRY_EVAL(ant_cmd)
if test $? = 0 && test -f ./conftest.class ; then if test $? = 0 && test -f ./conftest.class ; then
AC_MSG_RESULT([Ant works]) AC_MSG_RESULT([Ant works])
@ -3008,7 +3074,11 @@ if test "$ANT_HOME" != "NO_ANT_HOME"; then
if test -f /usr/share/java/ant.jar; then if test -f /usr/share/java/ant.jar; then
ANT_LIB=/usr/share/java ANT_LIB=/usr/share/java
else else
AC_MSG_ERROR([Ant libraries not found!]) if test -f /usr/share/ant-core/lib/ant.jar; then
ANT_LIB=/usr/share/ant-core/lib
else
AC_MSG_ERROR([Ant libraries not found!])
fi
fi fi
fi fi
fi fi