AC_INIT(src/accidence.h) AC_CANONICAL_TARGET dnl Set release number dnl This is derived from "Versioning" chapter of info libtool documentation. PACKAGE=accidence dnl 4a) Increment when removing or changing interfaces. ACCIDENCE_MAJOR_VERSION=0 dnl 4a) 5) Increment when adding interfaces. dnl 6) Set to zero when removing or changing interfaces. ACCIDENCE_MINOR_VERSION=1 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. ACCIDENCE_MICRO_VERSION=0 dnl dnl Set this too MAJOR_VERSION_PLUS_MINOR_VERSION=`expr $ACCIDENCE_MAJOR_VERSION + $ACCIDENCE_MINOR_VERSION` dnl VERSION=$ACCIDENCE_MAJOR_VERSION.$ACCIDENCE_MINOR_VERSION.$ACCIDENCE_MICRO_VERSION dnl Version info for libraries = CURRENT:REVISION:AGE VERSION_INFO=$MAJOR_VERSION_PLUS_MINOR_VERSION:$ACCIDENCE_MICRO_VERSION:$ACCIDENCE_MINOR_VERSION AC_SUBST(VERSION_INFO) AC_SUBST(ACCIDENCE_MAJOR_VERSION) AC_SUBST(ACCIDENCE_MINOR_VERSION) AC_SUBST(ACCIDENCE_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 AC_C_CONST AC_PROG_CXX() AC_PATH_PROG(PKG_CONFIG, pkg-config, no) PKG_CHECK_MODULES(ACCIDENCE, [glib-2.0 gmodule-2.0]) AC_SUBST(ACCIDENCE_CFLAGS) AC_SUBST(ACCIDENCE_LIBS) AC_MSG_CHECKING([for native Win32]) case "$target" in *-*-mingw*) native_win32=yes SOCKET_LIBS='-lws2_32 -ldnsapi' ACCIDENCE_WIN32_RESOURCE=accidence-win32res.lo ;; *) native_win32=no SOCKET_LIBS='' ACCIDENCE_WIN32_RESOURCE= ;; esac AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes") AC_SUBST([ACCIDENCE_WIN32_RESOURCE]) AC_SUBST(SOCKET_LIBS) # Courtesy of Glib: Ensure MSVC-compatible struct packing convention # is used when compiling for Win32 with gcc. # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while # gcc2 uses "-fnative-struct". if test x"$native_win32" = xyes; then if test x"$GCC" = xyes; then msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) if test -z "$ac_cv_prog_CC"; then our_gcc="$CC" else our_gcc="$ac_cv_prog_CC" fi case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in 2.) if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x ; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code]) else CFLAGS="$CFLAGS $msnative_struct" CXXFLAGS="$CXXFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi fi dnl =========================================================================== m4_copy([AC_DEFUN],[glib_DEFUN]) glib_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 binreloc AM_BINRELOC AM_CONDITIONAL(WITH_BINRELOC, test "x$br_cv_binreloc" = "xyes") relocatable_library="no" if test "x$native_win32" = "xyes" || test "x$br_cv_binreloc" = "xyes"; then relocatable_library="yes" fi dnl =========================================================================================== dnl todo build_cogroo=no check_cogroo=yes AC_ARG_ENABLE(cogroo, [ --disable-cogroo enable the cogroo backend [default=auto]], check_cogroo="$enableval", check_cogroo=yes) if test "x$check_cogroo" != "xno"; then AC_CHECK_PROG(HAVE_XMLRPC_C_CONFIG, xmlrpc-c-config, yes, no) if test "x$HAVE_XMLRPC_C_CONFIG" = "xyes"; then build_cogroo=yes COGROO_CFLAGS=`xmlrpc-c-config c++2 client --cflags` COGROO_LIBS=`xmlrpc-c-config c++2 client --ldadd` fi fi AC_SUBST(COGROO_CFLAGS) AC_SUBST(COGROO_LIBS) AM_CONDITIONAL(WITH_COGROO, test "x$build_cogroo" = "xyes") dnl =========================================================================================== build_linkgrammar=no check_linkgrammar=yes AC_ARG_ENABLE(linkgrammar, [ --disable-linkgrammar enable the linkgrammar backend [default=auto]], check_linkgrammar="$enableval", check_linkgrammar=yes) if test "x$check_linkgrammar" != "xno"; then PKG_CHECK_MODULES(LINKGRAMMAR, [link-grammar >= 4.2.4], build_linkgrammar=yes, build_linkgrammar=no) fi AC_SUBST(LINKGRAMMAR_CFLAGS) AC_SUBST(LINKGRAMMAR_LIBS) AM_CONDITIONAL(WITH_LINKGRAMMAR, test "x$build_linkgrammar" = "xyes") dnl ======================================================================================= build_languagetool=no check_languagetool=yes AC_ARG_ENABLE(languagetool, [ --disable-languagetool enable the languagetool backend [default=auto]], check_languagetool="$enableval", check_languagetool=yes) if test "x$check_languagetool" != "xno"; then AC_CHECK_PROG(HAVE_CURL_CONFIG, curl-config, yes, no) AC_CHECK_PROG(HAVE_XML_CONFIG, xml2-config, yes, no) if test "x$HAVE_CURL_CONFIG" = "xyes"; then LANGUAGETOOL_CFLAGS=`curl-config --cflags` LANGUAGETOOL_LIBS=`curl-config --libs` else AC_MSG_WARN([curl-config not found]) fi if test "x$HAVE_XML_CONFIG" = "xyes"; then build_languagetool=yes LANGUAGETOOL_CFLAGS="`xml2-config --cflags` $LANGUAGETOOL_CFLAGS" LANGUAGETOOL_LIBS="`xml2-config --libs` $LANGUAGETOOL_LIBS" else AC_MSG_WARN([xml2-config not found]) fi fi AC_SUBST(LANGUAGETOOL_CFLAGS) AC_SUBST(LANGUAGETOOL_LIBS) AM_CONDITIONAL(WITH_LANGUAGETOOL, test "x$build_languagetool" = "xyes") dnl ======================================================================================= AC_OUTPUT([ Makefile accidence.pc accidence-uninstalled.pc accidence.spec src/libaccidence.rc src/Makefile src/link-grammar/Makefile src/cogroo/Makefile src/languagetool/Makefile tests/Makefile data/Makefile ]) dnl =========================================================================================== echo " $PACKAGE-$VERSION prefix: ${prefix} compiler: ${CC} Build with link-grammar support: ${build_linkgrammar} Build with cogroo support: ${build_cogroo} Build with languagetool support ${build_languagetool} Build a relocatable library: ${relocatable_library} "