2007-05-02 01:07:00 +00:00
|
|
|
#
|
2007-05-26 01:55:00 +00:00
|
|
|
# $Id: configure.ac,v 1.5 2007/05/25 07:54:15 bacon Exp $
|
2007-05-02 01:07:00 +00:00
|
|
|
#
|
|
|
|
|
2008-07-19 08:42:02 +00:00
|
|
|
AC_PREREQ(2.59)
|
2008-06-15 02:15:37 +00:00
|
|
|
AC_INIT([ase],[0.5.0],[bacon@abiyo.net])
|
2008-06-27 00:44:41 +00:00
|
|
|
AC_CONFIG_HEADER([include/ase/config.h])
|
2008-06-20 03:44:45 +00:00
|
|
|
AC_CONFIG_AUX_DIR(autoconf)
|
2008-07-19 20:59:08 +00:00
|
|
|
|
|
|
|
# Does compilation test using CC and CPP with extension .c for test programs.
|
|
|
|
AC_LANG(C)
|
|
|
|
|
|
|
|
# Initializes automake
|
2008-06-13 07:48:44 +00:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-07-20 01:29:52 +00:00
|
|
|
# Determines a C compiler to use
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
|
2008-07-19 20:59:08 +00:00
|
|
|
# Determines a C++ compiler to use
|
2008-07-19 08:56:50 +00:00
|
|
|
AC_PROG_CXX
|
2008-07-19 20:59:08 +00:00
|
|
|
# Checks the C++ compiler exists in PATH.
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
|
|
|
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_SUBST(LIBTOOL_DEPS)
|
2008-07-19 08:47:24 +00:00
|
|
|
|
2008-02-16 04:36:55 +00:00
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib)
|
|
|
|
AC_CHECK_TOOL(AR, ar)
|
|
|
|
|
2008-06-26 23:48:54 +00:00
|
|
|
AC_CHECK_TOOL(GREP, grep)
|
2008-06-27 00:44:41 +00:00
|
|
|
AC_CHECK_TOOL(RM, rm)
|
2007-12-14 08:15:05 +00:00
|
|
|
AC_CHECK_TOOL(CJ, gcj)
|
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
# Overrides the default CFLAGS setting
|
|
|
|
if test "$ac_test_CFLAGS" = "set"
|
|
|
|
then
|
|
|
|
CFLAGS=$ac_save_CFLAGS
|
|
|
|
else
|
|
|
|
if test "$GCC" = "yes"
|
|
|
|
then
|
|
|
|
CFLAGS="-O2"
|
|
|
|
else
|
|
|
|
CFLAGS=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$ac_test_CXXFLAGS" = "set"
|
|
|
|
then
|
|
|
|
CXXFLAGS=$ac_save_CXXFLAGS
|
|
|
|
else
|
|
|
|
if test "$GCC" = "yes"
|
|
|
|
then
|
|
|
|
CXXFLAGS="-O2"
|
|
|
|
else
|
|
|
|
CXXFLAGS=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-12-14 08:15:05 +00:00
|
|
|
if test "$ac_test_CJFLAGS" = "set"
|
|
|
|
then
|
|
|
|
CJFLAGS=$ac_save_CJFLAGS
|
|
|
|
else
|
2007-12-14 23:25:39 +00:00
|
|
|
if test "$CJ" = "gcj"
|
|
|
|
then
|
|
|
|
CJFLAGS="-O2"
|
|
|
|
else
|
|
|
|
CJFLAGS=
|
|
|
|
fi
|
2007-12-14 08:15:05 +00:00
|
|
|
fi
|
|
|
|
|
2008-07-20 01:29:52 +00:00
|
|
|
# Checks for the math library (is -lm needed?)
|
|
|
|
AC_CHECK_LIBM
|
|
|
|
AC_SUBST(LIBM, $LIBM)
|
2008-06-22 08:08:38 +00:00
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2008-07-21 21:03:27 +00:00
|
|
|
AC_CHECK_HEADERS([wchar.h wctype.h])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_BIGENDIAN(
|
|
|
|
[AC_DEFINE([ASE_ENDIAN_BIG],[],[Big Endian])],
|
|
|
|
[AC_DEFINE([ASE_ENDIAN_LITTLE],[],[Little Endian])],
|
|
|
|
[AC_DEFINE([ASE_ENDIAN_UNKNOWN],[],[Unknown Endian])])
|
|
|
|
|
2008-07-20 01:29:52 +00:00
|
|
|
# Checks the size of primitive data types
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_CHECK_SIZEOF(char)
|
|
|
|
AC_CHECK_SIZEOF(short)
|
|
|
|
AC_CHECK_SIZEOF(int)
|
|
|
|
AC_CHECK_SIZEOF(long)
|
|
|
|
AC_CHECK_SIZEOF(long long)
|
|
|
|
AC_CHECK_SIZEOF(__int8)
|
|
|
|
AC_CHECK_SIZEOF(__int16)
|
|
|
|
AC_CHECK_SIZEOF(__int32)
|
|
|
|
AC_CHECK_SIZEOF(__int64)
|
|
|
|
AC_CHECK_SIZEOF(__int128)
|
2008-07-21 21:49:09 +00:00
|
|
|
dnl AC_CHECK_SIZEOF doesn't work without white-space between void and *
|
|
|
|
AC_CHECK_SIZEOF(void *)
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_CHECK_SIZEOF(float)
|
|
|
|
AC_CHECK_SIZEOF(double)
|
|
|
|
AC_CHECK_SIZEOF(long double)
|
|
|
|
AC_CHECK_SIZEOF(wchar_t)
|
|
|
|
|
2008-07-16 01:40:14 +00:00
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_CHAR, ${ac_cv_sizeof_char}, [sizeof(char)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_SHORT, ${ac_cv_sizeof_short}, [sizeof(short)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_INT, ${ac_cv_sizeof_int}, [sizeof(int)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG, ${ac_cv_sizeof_long}, [sizeof(long)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long}, [sizeof(long long)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT8, ${ac_cv_sizeof___int8}, [sizeof(__int8)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT16, ${ac_cv_sizeof___int16}, [sizeof(__int16)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT32, ${ac_cv_sizeof___int32}, [sizeof(__int32)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT64, ${ac_cv_sizeof___int64}, [sizeof(__int64)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT128, ${ac_cv_sizeof___int128}, [sizeof(__int128)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_VOID_P, ${ac_cv_sizeof_void_p}, [sizeof(void*)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_FLOAT, ${ac_cv_sizeof_float}, [sizeof(float)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_DOUBLE, ${ac_cv_sizeof_double}, [sizeof(double)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG_DOUBLE, ${ac_cv_sizeof_long_double}, [sizeof(long double)])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_WCHAR_T, ${ac_cv_sizeof_wchar_t}, [sizeof(wchar_t)])
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGNAME,"${PACKAGE}", [package_name])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGVERSION,"${VERSION}", [package version])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGAUTHOR,"${PACKAGE_BUGREPORT}", [author's email address])
|
2008-06-23 01:32:26 +00:00
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-07-21 21:03:27 +00:00
|
|
|
# Defines extra options
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_ARG_ENABLE([wchar], [AC_HELP_STRING([--enable-wchar],
|
|
|
|
[use wchar_t a default charater type when enabled (default. yes)])],
|
|
|
|
enable_wchar_is=$enableval,enable_wchar_is=yes)
|
2008-07-21 21:49:09 +00:00
|
|
|
test "${ac_cv_sizeof_wchar_t}" = "0" && enable_wchar_is=no
|
2007-05-02 01:07:00 +00:00
|
|
|
if test "$enable_wchar_is" = "yes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([ASE_CHAR_IS_WCHAR],[],[char is wchar])
|
|
|
|
else
|
|
|
|
AC_DEFINE([ASE_CHAR_IS_MCHAR],[],[char is mchar])
|
|
|
|
fi
|
|
|
|
|
2007-12-07 23:58:44 +00:00
|
|
|
AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],
|
2007-05-02 01:07:00 +00:00
|
|
|
[build the library in the debug mode (default. no)])],
|
|
|
|
enable_debug_is=$enableval,enable_debug_is=no)
|
|
|
|
if test "$enable_debug_is" = "yes"
|
|
|
|
then
|
|
|
|
[CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG"]
|
2007-12-14 08:15:05 +00:00
|
|
|
[CJFLAGS="$CJFLAGS -g"]
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_SUBST(BUILD_MODE, "debug")
|
2007-05-02 01:07:00 +00:00
|
|
|
else
|
|
|
|
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG"]
|
2007-12-14 08:15:05 +00:00
|
|
|
[CJFLAGS="$CJFLAGS"]
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_SUBST(BUILD_MODE, "release")
|
2007-05-02 01:07:00 +00:00
|
|
|
fi
|
|
|
|
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_ARG_ENABLE([cxx], [AC_HELP_STRING([--enable-cxx],
|
|
|
|
[build the library for C++ if a C++ compiler is available (default. yes)])],
|
|
|
|
enable_cxx_is=$enableval,enable_cxx_is=yes)
|
|
|
|
[test "${HAVE_CXX}" = "yes" || enable_cxx_is="no"]
|
|
|
|
AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" )
|
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
# Configure makefiles
|
|
|
|
AC_ARG_ENABLE([reentrant], [AC_HELP_STRING([--enable-reentrant],
|
|
|
|
[define _REENTRANT (default. yes)])],
|
|
|
|
enable_reentrant_is=$enableval,enable_reentrant_is=yes)
|
|
|
|
if test "$enable_reentrant_is" = "yes"
|
|
|
|
then
|
|
|
|
[CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -D_REENTRANT -D_THREAD_SAFE"]
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Java & JNI Configuration
|
|
|
|
AC_PATH_PROG(JAVAC_PATH, javac, :)
|
|
|
|
AC_PATH_PROG(JAR_PATH, jar, :)
|
|
|
|
|
|
|
|
if test "$JAVAC_PATH" != ":"
|
|
|
|
then
|
|
|
|
CUR_JAVAC_PATH="$JAVAC_PATH"
|
|
|
|
|
|
|
|
while ls -ld "$CUR_JAVAC_PATH" 2>/dev/null | grep " -> " >/dev/null
|
|
|
|
do
|
|
|
|
AC_MSG_CHECKING(symlink for $CUR_JAVAC_PATH)
|
|
|
|
REAL_JAVAC_PATH=`ls -ld "$CUR_JAVAC_PATH" | sed 's/.* -> //'`
|
|
|
|
|
|
|
|
case "$REAL_JAVAC_PATH" in
|
|
|
|
/*) CUR_JAVAC_PATH="$REAL_JAVAC_PATH";;
|
|
|
|
*) CUR_JAVAC_PATH=`echo "X$CUR_JAVAC_PATH" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$REAL_JAVAC_PATH";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_MSG_RESULT($CUR_JAVAC_PATH)
|
|
|
|
done
|
|
|
|
|
2007-05-26 01:43:00 +00:00
|
|
|
# check if the javavm wrapper is in use
|
|
|
|
case "$REAL_JAVAC_PATH" in
|
|
|
|
*/javavm)
|
|
|
|
JAVA_DIR="$REAL_JAVAC_PATH"
|
|
|
|
while true
|
|
|
|
do
|
2007-05-26 01:55:00 +00:00
|
|
|
JAVA_DIR=`echo "$JAVA_DIR" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
|
2007-05-26 01:43:00 +00:00
|
|
|
if test "$JAVA_DIR" = ""
|
|
|
|
then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING($JAVA_DIR/etc/javavms)
|
|
|
|
if test -f "$JAVA_DIR/etc/javavms"
|
|
|
|
then
|
|
|
|
# takes the first jvm configured
|
|
|
|
CUR_JAVAC_PATH=`cat $JAVA_DIR/etc/javavms | head -1`
|
|
|
|
AC_MSG_RESULT($CUR_JAVAC_PATH)
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
JAVA_DIR="$CUR_JAVAC_PATH"
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
2007-05-26 01:55:00 +00:00
|
|
|
JAVA_DIR=`echo "$JAVA_DIR" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
|
2007-05-02 01:07:00 +00:00
|
|
|
if test "$JAVA_DIR" = ""
|
|
|
|
then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING($JAVA_DIR/include/jni.h)
|
|
|
|
if test -f "$JAVA_DIR/include/jni.h"
|
|
|
|
then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $JAVA_DIR/include"
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in $JNI_INCLUDE_DIRS
|
|
|
|
do
|
|
|
|
JNI_MD_H=`find "$i" -name jni_md.h -print`
|
|
|
|
if test "$JNI_MD_H" != ""
|
|
|
|
then
|
2007-05-26 01:55:00 +00:00
|
|
|
tmp=`echo "$JNI_MD_H" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
|
2007-05-02 01:07:00 +00:00
|
|
|
JNI_MD_INCLUDE_DIRS="$JNI_MD_INCLUDE_DIRS $tmp"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $JNI_MD_INCLUDE_DIRS"
|
|
|
|
|
|
|
|
for i in $JNI_INCLUDE_DIRS
|
|
|
|
do
|
|
|
|
CFLAGS_JNI="$CFLAGS_JNI -I$i"
|
|
|
|
done
|
|
|
|
|
2007-12-14 23:25:39 +00:00
|
|
|
BUILD_JNI="jni"
|
2007-05-02 01:07:00 +00:00
|
|
|
else
|
|
|
|
JAVAC_PATH=""
|
|
|
|
CFLAGS_JNI=""
|
2007-12-14 23:25:39 +00:00
|
|
|
BUILD_JNI=""
|
2007-05-02 01:07:00 +00:00
|
|
|
fi
|
|
|
|
|
2007-12-14 23:25:39 +00:00
|
|
|
if test "$CJ" != ""
|
|
|
|
then
|
|
|
|
BUILD_CJ="cj"
|
|
|
|
else
|
|
|
|
BUILD_CJ=
|
|
|
|
fi
|
2007-12-14 08:15:05 +00:00
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_SUBST(CFLAGS_JNI, $CFLAGS_JNI)
|
|
|
|
AC_SUBST(JAVAC, $JAVAC_PATH)
|
|
|
|
AC_SUBST(JAR, $JAR_PATH)
|
2007-12-14 23:25:39 +00:00
|
|
|
AC_SUBST(BUILD_JNI, $BUILD_JNI)
|
2007-12-14 08:15:05 +00:00
|
|
|
AC_SUBST(CJFLAGS, $CJFLAGS)
|
2007-12-14 23:25:39 +00:00
|
|
|
AC_SUBST(BUILD_CJ, $BUILD_CJ)
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-06-15 02:15:37 +00:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
makefile
|
2008-06-20 04:27:37 +00:00
|
|
|
include/makefile
|
|
|
|
include/ase/makefile
|
|
|
|
include/ase/cmn/makefile
|
|
|
|
include/ase/awk/makefile
|
|
|
|
include/ase/lsp/makefile
|
2008-06-27 04:46:39 +00:00
|
|
|
include/ase/tgp/makefile
|
2008-06-20 04:27:37 +00:00
|
|
|
include/ase/utl/makefile
|
2008-06-15 02:15:37 +00:00
|
|
|
lib/makefile
|
|
|
|
lib/cmn/makefile
|
|
|
|
lib/awk/makefile
|
|
|
|
lib/lsp/makefile
|
|
|
|
lib/tgp/makefile
|
2008-06-20 04:27:37 +00:00
|
|
|
lib/utl/makefile
|
2008-06-15 02:15:37 +00:00
|
|
|
cmd/makefile
|
|
|
|
cmd/awk/makefile
|
2008-06-29 00:14:04 +00:00
|
|
|
cmd/lsp/makefile
|
|
|
|
cmd/tgp/makefile])
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_OUTPUT
|
2008-07-19 08:42:02 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
echo
|
|
|
|
echo "-[SUMMARY]---------------------------------------------------------------"
|
|
|
|
echo "Configured for ${host}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " Build mode : ${BUILD_MODE}"
|
2008-07-19 08:42:02 +00:00
|
|
|
echo " Installation directory: ${prefix}"
|
|
|
|
echo " C compiler: ${CC} ${CFLAGS}"
|
|
|
|
echo " C++ compiler: ${CXX} ${CXXFLAGS}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " C++ support: ${enable_cxx_is}"
|
2008-07-21 07:03:27 +00:00
|
|
|
echo " Wide character: ${enable_wchar_is}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " Math library: ${LIBM}"
|
2008-07-19 08:42:02 +00:00
|
|
|
echo "-------------------------------------------------------------------------"
|
|
|
|
]
|