AC_INIT(link-grammar/grammar-parse.c) dnl Set release number dnl This is derived from "Versioning" chapter of info libtool documentation. PACKAGE=link-grammar dnl 4a) Increment when removing or changing interfaces. LINK_MAJOR_VERSION=4 dnl 4a) 5) Increment when adding interfaces. dnl 6) Set to zero when removing or changing interfaces. LINK_MINOR_VERSION=3 dnl 3) Increment when interfaces not changed at all, dnl only bug fixes or internal changes made. dnl 4b) Set to zero when adding, removing or changing interfaces. LINK_MICRO_VERSION=3 dnl dnl Set this too MAJOR_VERSION_PLUS_MINOR_VERSION=`expr $LINK_MAJOR_VERSION + $LINK_MINOR_VERSION` dnl VERSION=$LINK_MAJOR_VERSION.$LINK_MINOR_VERSION.$LINK_MICRO_VERSION dnl Version info for libraries = CURRENT:REVISION:AGE VERSION_INFO=$MAJOR_VERSION_PLUS_MINOR_VERSION:$LINK_MICRO_VERSION:$LINK_MINOR_VERSION AC_SUBST(VERSION_INFO) AC_SUBST(LINK_MAJOR_VERSION) AC_SUBST(LINK_MINOR_VERSION) AC_SUBST(LINK_MICRO_VERSION) AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_MAINTAINER_MODE dnl Checks for programs. AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_STDC_HEADERS AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AM_BINRELOC AC_C_CONST AC_MSG_CHECKING([for native Win32]) case "$host" in *-*-mingw*) native_win32=yes ;; *) native_win32=no ;; esac AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes") AM_CONDITIONAL(WITH_BINRELOC, test "x$br_cv_binreloc" = "xyes") AC_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) GLIB_LC_MESSAGES dnl ======================================================================================= dnl =========================================================================== dnl check compiler flags AC_DEFUN([LINK_CC_TRY_FLAG], [ AC_MSG_CHECKING([whether $CC supports $1]) link_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_COMPILE_IFELSE([ ], [link_cc_flag=yes], [link_cc_flag=no]) CFLAGS="$link_save_CFLAGS" if test "x$link_cc_flag" = "xyes"; then ifelse([$2], , :, [$2]) else ifelse([$3], , :, [$3]) fi AC_MSG_RESULT([$link_cc_flag]) ]) dnl Use lots of warning flags with with gcc and compatible compilers dnl Note: if you change the following variable, the cache is automatically dnl skipped and all flags rechecked. So there's no need to do anything dnl else. If for any reason you need to force a recheck, just change dnl MAYBE_WARN in an ignorable way (like adding whitespace) MAYBE_WARN="-Wall -Wextra \ -Wsign-compare -Werror-implicit-function-declaration \ -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ -Wpacked -Wswitch-enum -Wmissing-format-attribute \ -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \ -Wdeclaration-after-statement -Wold-style-definition \ -Wno-missing-field-initializers -Wno-unused-parameter \ -Wno-attributes -Wno-long-long -Winline" # invalidate cached value if MAYBE_WARN has changed if test "x$link_cv_warn_maybe" != "x$MAYBE_WARN"; then unset link_cv_warn_cflags fi AC_CACHE_CHECK([for supported warning flags], link_cv_warn_cflags, [ echo WARN_CFLAGS="" # Some warning options are not supported by all versions of # gcc, so test all desired options against the current # compiler. # # Note that there are some order dependencies # here. Specifically, an option that disables a warning will # have no net effect if a later option then enables that # warnings, (perhaps implicitly). So we put some grouped # options (-Wall and -Wextra) up front and the -Wno options # last. for W in $MAYBE_WARN; do LINK_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"]) done link_cv_warn_cflags=$WARN_CFLAGS link_cv_warn_maybe=$MAYBE_WARN AC_MSG_CHECKING([which warning flags were supported])]) WARN_CFLAGS="$link_cv_warn_cflags" LINK_CFLAGS="$LINK_CFLAGS $WARN_CFLAGS" LINK_CC_TRY_FLAG([-fno-strict-aliasing], [LINK_CFLAGS="$LINK_CFLAGS -fno-strict-aliasing"]) AC_SUBST(LINK_CFLAGS) dnl ===================================================================== JNI_GUESS=" \ -I/usr/include/classpath/ \ -I/opt/jdk1.5/include/ \ -I/opt/jdk1.5/include/linux \ -I/usr/lib/jvm/java-6-sun/include/ \ -I/usr/lib/jvm/java-6-sun/include/linux \ -I/c/java/jdk1.6.0/include/ \ -I/c/java/jdk1.6.0/include/win32/ " AC_MSG_CHECKING(for jni.h) AC_TRY_CPP( [#include ], [AC_MSG_RESULT([yes, will build java libs]) JNIfound=yes], [ SAVE_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} ${JNI_GUESS}" AC_MSG_WARN([Can't find jni.h header in standard locations, trying again with ${CPPFLAGS}]) AC_TRY_CPP( [#include ], [AC_MSG_RESULT([yes, will build java libs]) JNIfound=yes], [ AC_MSG_WARN([cannot find jni.h header, needed for Java bindings support.]) CPPFLAGS=${SAVE_CPPFLAGS} JNIfound=no]) ]) if test x${JNIfound} = xyes ; then CPPFLAGS="${CPPFLAGS} -DBUILD_JNI_CLIENT=1" fi AC_SUBST(CPPFLAGS) # Hmm .. there seems to be a missing pkgconfig for ordinary java ... # There's libgcj-4.2.pc and libgcj8.pc but nothing for ordinary java?? # PKG_CHECK_MODULES(LIBJDK, libjdk-1.5 >= $LIBJDK_REQUIRED) # AC_SUBST(LIBJDK_CFLAGS) # AC_SUBST(LIBJDK_LIBS) dnl ======================================================================================= AC_OUTPUT([ Makefile link-grammar.pc link-grammar.spec link-grammar/Makefile link-grammar/link-features.h data/Makefile data/en/Makefile data/en/words/Makefile data/lt/Makefile man/Makefile autopackage/default.apspec link-grammar.xcode/Makefile ]) dnl ==================================================================== echo " $PACKAGE-$VERSION prefix: ${prefix} compiler: ${CC} ${CPPFLAGS} autopackage: ${br_cv_binreloc} java interfaces: ${JNIfound} "