dnl Process this file with autoconf to produce a configure script. AC_INIT(src/clint.cc) dnl use config/ for auto* files AC_CONFIG_AUX_DIR(config) AC_ARG_ENABLE(python, [ --disable-python disable use of python scripting], python=$enableval, python=yes) dnl Every other copy of the package version number gets its value from here AM_INIT_AUTOMAKE(clint, 0.1.2) dnl create a config.h file (Automake will add -DHAVE_CONFIG_H) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_SUBST(VERSION) ISODATE=`date +%Y-%m-%d` AC_SUBST(ISODATE) AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_YACC AC_PROG_CPP dnl AM_PROG_LEX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl AC_PROG_RANLIB AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) dnl ********************************************************************* dnl ** PYTHON *********************************************************** dnl ********************************************************************* if test "$python" = yes; then AC_PATH_PROG(pythonpath, python) if test "_$pythonpath" = _ ; then python=no else AC_MSG_CHECKING(for Python compile flags) PY_PREFIX=`$pythonpath -c 'import sys ; print sys.prefix'` PY_EXEC_PREFIX=`$pythonpath -c 'import sys ; print sys.exec_prefix'` changequote(<<, >>)dnl PY_VERSION=`$pythonpath -c 'import sys ; print sys.version[0:3]'` PY_MAJOR=`$pythonpath -c 'import sys ; print sys.version[0:2]'` changequote([, ])dnl if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then PY_LIBS="-lpython$PY_VERSION" PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" CFLAGS="$CFLAGS $PY_CFLAGS" CXXFLAGS="$CXXFLAGS $PY_CFLAGS" LIBS="$LIBS $PY_LIB_LOC $PY_LIBS" dnl AC_DEFINE(USE_PYTHON) AC_MSG_RESULT(ok) AC_CHECK_LIB(pthread, pthread_create, ) if test "$PY_MAJOR" = "2."; then dnl needed for python 2.x AC_CHECK_LIB(util, openpty, ) AC_CHECK_LIB(db, dbopen, ) fi else python=no AC_MSG_RESULT([Can't find Python.h]) fi fi fi dnl AM_CHECK_PYTHON dnl AC_PROG_CC_STDC dnl AM_PATH_PYTHON(module) dnl AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) dnl check for C++ features. AC_CXX_HAVE_SSTREAM dnl Checks for libraries. dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([malloc.h unistd.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl AC_FUNC_OBSTACK AC_TYPE_SIZE_T dnl AC_CHECK_TYPES([ptrdiff_t]) dnl Checks for library functions. AC_FUNC_ALLOCA dnl AC_FUNC_ERROR_AT_LINE dnl AC_FUNC_MALLOC dnl AC_FUNC_SETVBUF_REVERSED AC_FUNC_VPRINTF AC_CHECK_FUNCS([strstr]) AC_OUTPUT(Makefile \ doc/Makefile \ plugins/Makefile \ plugins/python/Makefile \ plugins/python/python_rules/Makefile \ lib/Makefile \ lib/python/Makefile \ src/Makefile \ testsuite/Makefile \ testsuite/python/Makefile \ clint.lsm \ clint.spec)