diff --git a/program/acinclude.m4 b/program/acinclude.m4
index 062216a2b689aed8355d73ff1da4ef4d56d89f9c..936739577c05fdafaa20a1d7928c0655bfc48733 100644 (file)
--- a/program/acinclude.m4
+++ b/program/acinclude.m4
dnl and prints out a helful message
dnl
dnl
dnl and prints out a helful message
dnl
dnl
-dnl EX_CHECK_ALL(library, function, header, pkgconf name, tested-version, homepage)
-dnl $1 $2 $3 $4 $5 $6
+dnl EX_CHECK_ALL(library, function, header, pkgconf name, tested-version, homepage, cppflags)
+dnl $1 $2 $3 $4 $5 $6 $7
dnl
dnl
AC_DEFUN([EX_CHECK_ALL],
dnl
dnl
AC_DEFUN([EX_CHECK_ALL],
EX_CHECK_STATE=NO
ex_check_save_LIBS=${LIBS}
ex_check_save_CPPFLAGS=${CPPFLAGS}
EX_CHECK_STATE=NO
ex_check_save_LIBS=${LIBS}
ex_check_save_CPPFLAGS=${CPPFLAGS}
- ex_check_save_LDFLAGS=${LDPFLAGS}
+ ex_check_save_LDFLAGS=${LDFLAGS}
+ if test "x$7" != "x"; then
+ CPPFLAGS="$CPPFLAGS -I$7"
+ fi
dnl try compiling naked first
AC_CHECK_LIB($1,$2, [
AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}";EX_CHECK_STATE=YES],[])],[])
dnl try compiling naked first
AC_CHECK_LIB($1,$2, [
AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}";EX_CHECK_STATE=YES],[])],[])
LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l $4`
dnl remove the cached value and test again
unset ac_cv_lib_$1_$2
LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l $4`
dnl remove the cached value and test again
unset ac_cv_lib_$1_$2
- AC_CHECK_LIB($1,$2,[ AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[])],[])
+ AC_CHECK_LIB($1,$2,[
+ unset ac_cv_header_`echo $3 | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+ AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[])
+ ],[])
else
AC_MSG_WARN([
----------------------------------------------------------------------------
else
AC_MSG_WARN([
----------------------------------------------------------------------------
You can find also find an archive copy on
You can find also find an archive copy on
- http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs
+ http://oss.oetiker.ch/rrdtool/pub/libs
The last tested version of $4 is $5.
The last tested version of $4 is $5.
AC_LANG_POP(C)
]
)
AC_LANG_POP(C)
]
)
+
dnl
dnl Ptherad check from http://autoconf-archive.cryp.to/acx_pthread.m4
dnl
dnl
dnl Ptherad check from http://autoconf-archive.cryp.to/acx_pthread.m4
dnl
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) x_rflag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) x_rflag="-D_REENTRANT";;
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) x_rflag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) x_rflag="-D_REENTRANT";;
+ *-linux*)
+ if test x"$PTHREAD_CFLAGS" = "x-pthread"; then
+ # For Linux/gcc "-pthread" implies "-lpthread". We need, however, to make this explicit
+ # in PTHREAD_LIBS such that a shared library to be built properly depends on libpthread.
+ PTHREAD_LIBS="-lpthread $PTHREAD_LIBS"
+ fi;;
esac
AC_MSG_RESULT(${x_rflag})
if test "x$x_rflag" != xno; then
esac
AC_MSG_RESULT(${x_rflag})
if test "x$x_rflag" != xno; then
PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"],
AC_MSG_ERROR([
Your Compiler does not do propper IEEE math ... Please find out how to
PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"],
AC_MSG_ERROR([
Your Compiler does not do propper IEEE math ... Please find out how to
-make IEEE math work with your compiler and let me know (oetiker@ee.ethz.ch).
+make IEEE math work with your compiler and let me know (tobi@oetiker.ch).
Check config.log to see what went wrong ...
]))])])])])])])])])])
AC_LANG_POP(C)
])
Check config.log to see what went wrong ...
]))])])])])])])])])])
AC_LANG_POP(C)
])
+
+
+dnl a macro to check for ability to create python extensions
+dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl a macro to add some color to the build process.
+dnl CONFIGURE_PART(MESSAGE)
+
+AC_DEFUN([CONFIGURE_PART],[
+case $TERM in
+ # for the most important terminal types we directly know the sequences
+ xterm|xterm*|vt220|vt220*)
+ T_MD=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
+ T_ME=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
+ ;;
+ vt100|vt100*|cygwin)
+ T_MD=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
+ T_ME=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
+ ;;
+ *)
+ T_MD=''
+ T_ME=''
+ ;;
+esac
+ AC_MSG_RESULT()
+ AC_MSG_RESULT([${T_MD}$1${T_ME}])
+])
+
+