diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2009-12-04 21:14:58 -0200 |
---|---|---|
committer | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2009-12-04 21:14:58 -0200 |
commit | 8fb9c3d6136c533cb5f240740f357647019b22ab (patch) | |
tree | d377aa717c5df7859a962dfd051aa6a40ffb4229 /m4 | |
parent | 35c657537049f36e2d6fa445008a498dde4c8423 (diff) |
Completed importing and refactoring of EmpathyLogStore
* removed any call which would make TPL depending on libempathy
* copied empathy-time.[hc]
* added some empathy's utility function to tpl_utils.[ch]
* added support for automake/autoconf using empathy's one as basis:
currently TPL depends on telepathy-glib and libxmp-2.0 (and theirs
deps)
* added AUTHORS COPYING INSTALL README and NEWS files (empty)
Diffstat (limited to 'm4')
-rw-r--r-- | m4/.gitignore | 9 | ||||
-rw-r--r-- | m4/as-compiler-flag.m4 | 33 | ||||
-rw-r--r-- | m4/empathy-args.m4 | 19 | ||||
-rw-r--r-- | m4/empathy-valgrind.m4 | 31 | ||||
-rw-r--r-- | m4/python.m4 | 66 | ||||
-rw-r--r-- | m4/shave.m4 | 77 |
6 files changed, 235 insertions, 0 deletions
diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 000000000..46125d52e --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,9 @@ +gtk-doc.m4 +intltool.m4 +gnome-doc-utils.m4 +libtool.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 + diff --git a/m4/as-compiler-flag.m4 b/m4/as-compiler-flag.m4 new file mode 100644 index 000000000..605708a5a --- /dev/null +++ b/m4/as-compiler-flag.m4 @@ -0,0 +1,33 @@ +dnl as-compiler-flag.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flags + +dnl David Schleef <ds@schleef.org> + +dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ + +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING([to see if compiler understands $1]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/m4/empathy-args.m4 b/m4/empathy-args.m4 new file mode 100644 index 000000000..3daacbaba --- /dev/null +++ b/m4/empathy-args.m4 @@ -0,0 +1,19 @@ +dnl configure-time options for Empathy + +dnl EMPATHY_ARG_VALGRIND + +AC_DEFUN([EMPATHY_ARG_VALGRIND], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--enable-valgrind],[enable valgrind checking and run-time detection]), + [ + case "${enableval}" in + yes|no) enable="${enableval}" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac + ], + [enable=no]) + + EMPATHY_VALGRIND($enable, [2.1]) +]) diff --git a/m4/empathy-valgrind.m4 b/m4/empathy-valgrind.m4 new file mode 100644 index 000000000..7a44e103f --- /dev/null +++ b/m4/empathy-valgrind.m4 @@ -0,0 +1,31 @@ +dnl Detect Valgrind location and flags + +AC_DEFUN([EMPATHY_VALGRIND], +[ + enable=$1 + if test -n "$2"; then + valgrind_req=$2 + else + valgrind_req="2.1" + fi + + PKG_CHECK_MODULES(VALGRIND, valgrind > "$valgrind_req", + have_valgrind_runtime="yes", have_valgrind_runtime="no") + + AC_PATH_PROG(VALGRIND_PATH, valgrind) + + # Compile the instrumentation for valgrind only if the valgrind + # libraries are installed and the valgrind executable is found + if test "x$enable" = xyes && + test "$have_valgrind_runtime" = yes && + test -n "$VALGRIND_PATH" ; + then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(using compile-time instrumentation for valgrind) + fi + + AC_SUBST(VALGRIND_CFLAGS) + AC_SUBST(VALGRIND_LIBS) + + AM_CONDITIONAL(HAVE_VALGRIND, test -n "$VALGRIND_PATH") +]) diff --git a/m4/python.m4 b/m4/python.m4 new file mode 100644 index 000000000..fe901562d --- /dev/null +++ b/m4/python.m4 @@ -0,0 +1,66 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +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"` +if test -x "$PYTHON-config"; then +PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +else +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 +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" +]) diff --git a/m4/shave.m4 b/m4/shave.m4 new file mode 100644 index 000000000..0a3509e59 --- /dev/null +++ b/m4/shave.m4 @@ -0,0 +1,77 @@ +dnl Make automake/libtool output more friendly to humans +dnl Damien Lespiau <damien.lespiau@gmail.com> +dnl +dnl SHAVE_INIT([shavedir],[default_mode]) +dnl +dnl shavedir: the directory where the shave scripts are, it defaults to +dnl $(top_builddir) +dnl default_mode: (enable|disable) default shave mode. This parameter +dnl controls shave's behaviour when no option has been +dnl given to configure. It defaults to disable. +dnl +dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just +dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and +dnl LIBTOOL, you don't want the configure tests to have these variables +dnl re-defined. +dnl * This macro requires GNU make's -s option. + +AC_DEFUN([_SHAVE_ARG_ENABLE], +[ + AC_ARG_ENABLE([shave], + AS_HELP_STRING( + [--enable-shave], + [use shave to make the build pretty [[default=$1]]]),, + [enable_shave=$1] + ) +]) + +AC_DEFUN([SHAVE_INIT], +[ + dnl you can tweak the default value of enable_shave + m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) + + if test x"$enable_shave" = xyes; then + dnl where can we find the shave scripts? + m4_if([$1],, + [shavedir="$ac_pwd"], + [shavedir="$ac_pwd/$1"]) + AC_SUBST(shavedir) + + dnl make is now quiet + AC_SUBST([MAKEFLAGS], [-s]) + AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`']) + + dnl we need sed + AC_CHECK_PROG(SED,sed,sed,false) + + dnl substitute libtool + SHAVE_SAVED_LIBTOOL=$LIBTOOL + LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" + AC_SUBST(LIBTOOL) + + dnl substitute cc/cxx + SHAVE_SAVED_CC=$CC + SHAVE_SAVED_CXX=$CXX + SHAVE_SAVED_FC=$FC + SHAVE_SAVED_F77=$F77 + SHAVE_SAVED_OBJC=$OBJC + CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" + CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" + FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" + F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" + OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}" + AC_SUBST(CC) + AC_SUBST(CXX) + AC_SUBST(FC) + AC_SUBST(F77) + AC_SUBST(OBJC) + + V=@ + else + V=1 + fi + Q='$(V:1=)' + AC_SUBST(V) + AC_SUBST(Q) +]) + |