From 8da85de6806e2e6425768c891ad34ca0807fc720 Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Mon, 31 Jan 2011 14:28:12 +0000 Subject: [PATCH] update --- autogen.sh | 10 +++++----- configure.ac | 72 ++++++++++++++++++++++++++++++++---------------------------------------- pyext/setup.py.in | 13 +++++++------ 3 files changed, 44 insertions(+), 51 deletions(-) diff --git a/autogen.sh b/autogen.sh index cf25f41..50b9b53 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ #!/bin/sh -autoreconf --force --install -#autoreconf --force --install --symlink \ -#&& aclocal \ -#&& automake \ -#&& autoconf +aclocal -I m4 +libtoolize --copy +autoconf +autoheader +automake --add-missing --copy diff --git a/configure.ac b/configure.ac index bcee803..57ab999 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ # # Process this file with autoconf to produce a configure script -AC_INIT([ctatools], [0.1.0], [knodlseder@cesr.fr], [ctatools], []) +AC_INIT([ctatools], [1.0.0], [knodlseder@cesr.fr], [ctatools], []) AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) @@ -94,45 +94,6 @@ else fi -dnl ==================== -dnl Checks for libraries -dnl ==================== - -# Get GammaLib configuration -if test "x$prefix" = xNONE; then - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/gamma/lib/pkgconfig" -else - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig" -fi -PKG_CHECK_MODULES(GammaLib, gammalib >= 0.0,, - AC_MSG_ERROR([GammaLib library not found. Consider adjusting the PKG_CONFIG_PATH - environment variable if you installed GammaLib in a non-standard prefix.])) -CFLAGS="$CFLAGS $GammaLib_CFLAGS" -CPPFLAGS="$CPPFLAGS $GammaLib_CFLAGS" -LDFLAGS="$LDFLAGS $GammaLib_LIBS" - -# Check for GammaLib library and determine path to library -#AC_ARG_WITH([gammalib-lib-dir], -# AC_HELP_STRING([--with-gammalib-lib-dir], -# [GammaLib library directory [[/usr/(local/(gamma/))lib(64)]]]), -# [gammalib_lib_dir=$withval]) -#if test "x$gammalib_lib_dir" != "x"; then -# test -f $gammalib_lib_dir/libgamma.a -o -f $gammalib_lib_dir/libgamma.so -o -f $gammalib_lib_dir/libgamma.dylib && LIBDIR_GAMMALIB=$gammalib_lib_dir -#else -# for i in /usr/local/gamma/lib /usr/local/gamma/lib64 /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 ; do -# test -f $i/libgamma.a -o -f $i/libgamma.so -o -f $i/libgamma.dylib && LIBDIR_GAMMALIB=$i -# done -#fi -#if test -z "$LIBDIR_GAMMALIB"; then -# if test "x$gammalib_lib_dir" != "x"; then -# AC_MSG_ERROR(Cannot find GammaLib library under $gammalib_lib_dir) -# else -# AC_MSG_ERROR(Cannot find GammaLib library. Use --with-gammalib-lib-dir= to specify non-default path.) -# fi -#fi -#AC_SUBST(LIBDIR_GAMMALIB) - - dnl ======================================================================== dnl Checks for python binding. Python binding requires Python and either the dnl files gammalib_wrap.cpp and gammalib.py or SWIG to create these files. @@ -208,6 +169,30 @@ else fi +dnl =========================== +dnl Checks for GammaLib library +dnl =========================== + +# Get GammaLib configuration +if test "x$prefix" = xNONE; then + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/gamma/lib/pkgconfig" +else + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig" +fi +has_gammalib="no" +PKG_CHECK_MODULES([GammaLib], [gammalib >= 0.4.5], + [has_gammalib="yes"], + [AC_MSG_ERROR([GammaLib library not found]) + AC_MSG_ERROR([Make sure that at least version 0.4.5 of GammaLib in installed]) + AC_MSG_ERROR([If GammaLib is not installed in the default location, please adjust the PKG_CONFIG_PATH environment variable])]) +if test "x$has_gammalib" = "xyes"; then + AC_DEFINE([HAVE_LIBGAMMA], [1], [Define if gammalib is available]) +fi +CFLAGS="$CFLAGS $GammaLib_CFLAGS" +CPPFLAGS="$CPPFLAGS $GammaLib_CFLAGS" +LDFLAGS="$LDFLAGS $GammaLib_LIBS" + + dnl ================== dnl Build static code? dnl ================== @@ -251,6 +236,11 @@ dnl =========================== echo echo " ctatools configuration summary" echo " ==============================" +if test "x$has_gammalib" = "xyes"; then + echo " * GammaLib support (yes)" +else + echo " - GammaLib support (no) no gammalib library found" +fi if test ! "$SWIG"; then echo " - swig (no)" else @@ -280,3 +270,5 @@ fi echo echo "Now type 'make'" echo + + diff --git a/pyext/setup.py.in b/pyext/setup.py.in index 557c5f9..4945f3e 100644 --- a/pyext/setup.py.in +++ b/pyext/setup.py.in @@ -24,12 +24,13 @@ for extra_lib in extra_libs: # Get extra library paths extra_lib_paths = ('@LDFLAGS@').split(' ') for extra_lib_path in extra_lib_paths: - dir = extra_lib_path.lstrip('-L') - if len(dir) > 0: - library_dirs.append(extra_lib_path.lstrip('-L')) -print include_dirs -print libraries -print library_dirs + if extra_lib_path.lstrip().find('-L') == 0: + dir = extra_lib_path.lstrip().lstrip('-L') + if len(dir) > 0: + library_dirs.append(extra_lib_path.lstrip('-L')) +#print include_dirs +#print libraries +#print library_dirs # Setup setup(name='@PACKAGE_NAME@', -- libgit2 0.21.4