dnl Process this file with autoconf to produce a configure script. AC_INIT(fugu.py.in) AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC dnl Checks for header files. AC_HEADER_STDC dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl AC_HEADER_TIME dnl AC_STRUCT_TM dnl -- find the python executable AC_PATH_PROG(vi_cv_path_python, python) if test "X$vi_cv_path_python" != "X"; then dnl -- get its version number AC_CACHE_CHECK(Python version,vi_cv_var_python_version, [[vi_cv_var_python_version=` ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` ]]) dnl -- it must be at least version 1.5 AC_MSG_CHECKING(Python is 1.5 or better) if ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 1.5)" then AC_MSG_RESULT(yep) dnl -- find where python thinks it was installed (prefix) AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx, [ vi_cv_path_python_pfx=` ${vi_cv_path_python} -c \ "import sys; print sys.prefix"` ]) dnl -- and where it thinks it runs (exec-prefix) AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx, [ vi_cv_path_python_epfx=` ${vi_cv_path_python} -c \ "import sys; print sys.exec_prefix"` ]) PYTHONDIR="${vi_cv_path_python_epfx}/lib/python${vi_cv_var_python_version}/config" dnl -- and whether the build system is installed AC_MSG_CHECKING(whether Python development environment is installed) if test ! -f "${PYTHONDIR}/Makefile"; then AC_MSG_RESULT(not found) AC_MSG_ERROR(Perhaps you need to install the Python development tools?) else AC_MSG_RESULT(found it) fi else AC_MSG_RESULT(too old) fi else AC_MSG_ERROR(Python executable not found) fi dnl Check for gale-config dnl AC_PATH_PROG(vi_cv_path_gale_config, gale-config) dnl if test "X$vi_cv_path_gale_config" != "X"; then dnl If it exists, use it dnl LDFLAGS="`gale-config --libs` $LDFLAGS" dnl Urk---this gives us a bunch of stuff we don't actually need dnl Check for local copy of RSAREF library dnl AC_MSG_CHECKING([for local copy of RSAREF source]) dnl if test -f "${srcdir}/rsaref/source/rsa.c"; then dnl AC_MSG_RESULT(yes) dnl CPPFLAGS="-I./source $CPPFLAGS" dnl RSAREF_LIBS="" dnl RSAREF_SOURCES="source/desc.c source/digit.c source/md2c.c source/md5c.c \ dnl source/nn.c source/prime.c source/rsa.c \ source/r_encode.c \ dnl source/r_dh.c source/r_enhanc.c source/r_keygen.c source/r_random.c \ dnl source/r_stdlib.c" dnl else dnl AC_MSG_RESULT(no) dnl AC_CHECK_HEADERS(rsaref.h,, [ dnl AC_MSG_ERROR(unable to locate RSAREF headers; see README directions) dnl ]) dnl AC_CHECK_LIB(rsaref,R_RandomInit,[:],[ dnl AC_MSG_ERROR(cannot find RSAREF library, see README directions) dnl ]) dnl RSAREF_LIBS="-lrsaref" dnl RSAREF_SOURCES="" dnl fi dnl dnl RSAREF_CFLAGS=$CPPFLAGS dnl RSAREF_LDFLAGS=$LDFLAGS dnl Check for OpenSSL library AC_CHECK_LIB(crypto, EVP_SealInit, [:], [ AC_MSG_ERROR(cannot find crypto library; is OpenSSL installed?) ]) SETUP_SHARED="*shared*" MAKE_TARGET="sharedmods" AC_ARG_ENABLE(shared, [ --disable-shared Build statically-linked python binary --enable-shared Build rsaref as a shared module (default)], [case "${enableval}" in yes) SETUP_SHARED="*shared*"; MAKE_TARGET="sharedmods";; no) SETUP_SHARED=""; MAKE_TARGET="static";; *) AC_MSG_ERROR(bad value ${enableval} for --enable-shared);; esac]) PYTHON="${vi_cv_path_python}" dnl Expand exec_prefix here, not in Makefiles! if test "x$exec_prefix" = xNONE ; then if test "x$prefix" = xNONE ; then exec_prefix=$ac_default_prefix else exec_prefix=$prefix fi fi FUGUVERSION=`cat .version` # Substitute variables AC_SUBST(PYTHON) AC_SUBST(PYTHONDIR) AC_SUBST(SETUP_SHARED) AC_SUBST(MAKE_TARGET) AC_SUBST(FUGUVERSION) AC_OUTPUT( Makefile fugu.py pygale-config.py pygale/version.py )