Commit 77081999 authored by Vincent Castellano's avatar Vincent Castellano

Fixes to autotools for python detection

parent d001bcd2
......@@ -4,8 +4,7 @@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
#TODO re-add -Werror
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS}
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
......
aclocal ; autoheader; automake ; autoconf
......@@ -56,7 +56,8 @@
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([])
for python in python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
AC_CHECK_PROGS(PYTHON_BIN, [$python])
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then
......@@ -87,12 +88,21 @@ AC_MSG_RESULT([ Binary: $ax_python_bin])
AC_MSG_RESULT([ Library: $ax_python_lib])
AC_MSG_RESULT([ Include Dir: $ax_python_header])
PYTHON_FOUND=yes
if test x$ax_python_header != xno; then
PYTHON_INCLUDE_DIR=$ax_python_header
AC_SUBST(PYTHON_INCLUDE_DIR)
else
PYTHON_FOUND=no
fi
if test x$ax_python_lib != xno; then
PYTHON_LIB=$ax_python_lib
AC_SUBST(PYTHON_LIB)
else
PYTHON_FOUND=no
fi
AC_SUBST(PYTHON_FOUND)
])dnl
#! /bin/sh
aclocal
autoheader
automake --gnu --add-missing
autoconf
......@@ -164,12 +164,12 @@
/* use lua */
#undef USE_LUA
/* fixed for correct valgrind work */
#undef VALGRIND_FIXES
/* use python */
#undef USE_PYTHON
/* fixed for correct valgrind work */
#undef VALGRIND_FIXES
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
......
This diff is collapsed.
......@@ -94,20 +94,45 @@ AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua],
AC_MSG_ERROR([No lua found. Try --disable-liblua])
])
])
AC_MSG_CHECKING([for python])
AC_ARG_ENABLE(python,[--enable-python/--disable-python],
[
if test "x$enableval" = "xno" ; then
AC_MSG_RESULT([disabled])
else
AC_MSG_RESULT([enabled])
AX_PYTHON()
dnl python checks (you can change the required python version bellow)
AM_PATH_PYTHON(2.7.0)
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
AC_SUBST([PYTHON_FOUND])
if test $PYTHON_FOUND = no ; then
AC_MSG_ERROR([No supported python lib version found. Try --disable-python])
else
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_CFLAGS])
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
AC_DEFINE(USE_PYTHON,1,[use python])
fi
fi
],[
AC_MSG_RESULT([enabled])
AX_PYTHON()
AC_SUBST([PYTHON_FOUND])
if test $PYTHON_FOUND = no ; then
AC_MSG_ERROR([No supported python lib version found. Try --disable-python])
else
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_CFLAGS])
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
AC_DEFINE(USE_PYTHON,1,[use python])
fi
])
AC_MSG_CHECKING([for libjansson])
AC_ARG_ENABLE(json,[--enable-json/--disable-json],
[
......@@ -124,20 +149,6 @@ AC_ARG_ENABLE(json,[--enable-json/--disable-json],
AC_DEFINE(USE_JSON,1,[use json])
])
AC_ARG_ENABLE(python,[--enable-python/--disable-python],
[
AX_PYTHON()
dnl python checks (you can change the required python version bellow)
AM_PATH_PYTHON(2.7.0)
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_CFLAGS])
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
AC_DEFINE(USE_PYTHON,1,[use python])
])
#check for custom prog name
AC_MSG_CHECKING([progname])
AC_ARG_WITH(progname,[--with-progname=<name>],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment