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
|
|
|
#
|
|
|
|
|
|
|
|
AC_PREREQ(2.53)
|
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-06-13 07:48:44 +00:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
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
|
|
|
AC_SUBST(LIBTOOL_DEPS)
|
|
|
|
|
|
|
|
# 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-06-22 08:08:38 +00:00
|
|
|
# Do we need libm for math functions?
|
|
|
|
AC_MSG_CHECKING([for libm math function in std libs])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
]], [[
|
|
|
|
double x;
|
|
|
|
pow(x, x);
|
|
|
|
return 0;
|
|
|
|
]])],[needlibm=no],[needlibm=yes])
|
|
|
|
if test "$needlibm" = "yes"; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_CHECK_LIB([m], [pow],
|
2008-06-22 08:37:03 +00:00
|
|
|
LIBM="-lm",
|
2008-06-22 08:08:38 +00:00
|
|
|
AC_MSG_ERROR([libm is needed and is not available]))
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
fi
|
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
# 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])])
|
|
|
|
|
|
|
|
# Checks for data types
|
2008-06-26 23:48:54 +00:00
|
|
|
#AC_CHECK_TYPE(long long, [AC_DEFINE([ASE_HAVE_LONG_LONG],[],[long long])])
|
|
|
|
#AC_CHECK_TYPE(long double, [AC_DEFINE([ASE_HAVE_LONG_DOUBLE],[],[long double])])
|
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)
|
|
|
|
AC_CHECK_SIZEOF(void *)
|
|
|
|
AC_CHECK_SIZEOF(float)
|
|
|
|
AC_CHECK_SIZEOF(double)
|
|
|
|
AC_CHECK_SIZEOF(long double)
|
|
|
|
AC_CHECK_SIZEOF(wchar_t)
|
|
|
|
|
2008-06-23 01:32:26 +00:00
|
|
|
AC_DEFINE([ASE_SIZEOF_CHAR], [], [sizeof(char)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_SHORT], [], [sizeof(short)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_INT], [], [sizeof(int)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_LONG], [], [sizeof(long)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_LONG_LONG], [], [sizeof(long long)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF___INT8], [], [sizeof(__int8)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF___INT16], [], [sizeof(__int16)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF___INT32], [], [sizeof(__int32)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF___INT64], [], [sizeof(__int64)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF___INT128], [], [sizeof(__int128)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_VOID_P], [], [sizeof(void*)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_FLOAT], [], [sizeof(float)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_DOUBLE], [], [sizeof(double)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_LONG_DOUBLE], [], [sizeof(long double)])
|
|
|
|
AC_DEFINE([ASE_SIZEOF_WCHAR_T], [], [sizeof(wchar_t)])
|
2008-06-13 07:48:44 +00:00
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_CHAR,${ac_cv_sizeof_char})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_SHORT,${ac_cv_sizeof_short})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_INT,${ac_cv_sizeof_int})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG,${ac_cv_sizeof_long})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG_LONG,${ac_cv_sizeof_long_long})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT8,${ac_cv_sizeof___int8})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT16,${ac_cv_sizeof___int16})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT32,${ac_cv_sizeof___int32})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT64,${ac_cv_sizeof___int64})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF___INT128,${ac_cv_sizeof___int128})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_VOID_P,${ac_cv_sizeof_void_p})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_FLOAT,${ac_cv_sizeof_float})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_DOUBLE,${ac_cv_sizeof_double})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_LONG_DOUBLE,${ac_cv_sizeof_long_double})
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_SIZEOF_WCHAR_T,${ac_cv_sizeof_wchar_t})
|
|
|
|
|
2008-06-23 01:32:26 +00:00
|
|
|
AC_DEFINE([ASE_PKGNAME], [], [package name])
|
|
|
|
AC_DEFINE([ASE_PKGVERSION], [], [package version])
|
|
|
|
AC_DEFINE([ASE_PKGAUTHOR], [], [author's email address])
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGNAME,"${PACKAGE}")
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGVERSION,"${VERSION}")
|
|
|
|
AC_DEFINE_UNQUOTED(ASE_PKGAUTHOR,"${PACKAGE_BUGREPORT}")
|
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
# Defines extra options
|
|
|
|
|
|
|
|
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)
|
|
|
|
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"]
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_SUBST(BUILDMODE, "debug")
|
|
|
|
else
|
|
|
|
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG"]
|
2007-12-14 08:15:05 +00:00
|
|
|
[CJFLAGS="$CJFLAGS"]
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_SUBST(BUILDMODE, "release")
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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
|
|
|
|
2008-06-27 00:53:19 +00:00
|
|
|
AC_SUBST(LIBM, $LIBM)
|
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
|