Commit 8da85de6806e2e6425768c891ad34ca0807fc720
1 parent
72f682fa
update
Showing
3 changed files
with
44 additions
and
51 deletions
autogen.sh
configure.ac
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | # |
| 5 | 5 | # Process this file with autoconf to produce a configure script |
| 6 | 6 | |
| 7 | -AC_INIT([ctatools], [0.1.0], [knodlseder@cesr.fr], [ctatools], []) | |
| 7 | +AC_INIT([ctatools], [1.0.0], [knodlseder@cesr.fr], [ctatools], []) | |
| 8 | 8 | AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) |
| 9 | 9 | AC_CONFIG_MACRO_DIR([m4]) |
| 10 | 10 | AC_CONFIG_HEADERS([config.h]) |
| ... | ... | @@ -94,45 +94,6 @@ else |
| 94 | 94 | fi |
| 95 | 95 | |
| 96 | 96 | |
| 97 | -dnl ==================== | |
| 98 | -dnl Checks for libraries | |
| 99 | -dnl ==================== | |
| 100 | - | |
| 101 | -# Get GammaLib configuration | |
| 102 | -if test "x$prefix" = xNONE; then | |
| 103 | - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/gamma/lib/pkgconfig" | |
| 104 | -else | |
| 105 | - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig" | |
| 106 | -fi | |
| 107 | -PKG_CHECK_MODULES(GammaLib, gammalib >= 0.0,, | |
| 108 | - AC_MSG_ERROR([GammaLib library not found. Consider adjusting the PKG_CONFIG_PATH | |
| 109 | - environment variable if you installed GammaLib in a non-standard prefix.])) | |
| 110 | -CFLAGS="$CFLAGS $GammaLib_CFLAGS" | |
| 111 | -CPPFLAGS="$CPPFLAGS $GammaLib_CFLAGS" | |
| 112 | -LDFLAGS="$LDFLAGS $GammaLib_LIBS" | |
| 113 | - | |
| 114 | -# Check for GammaLib library and determine path to library | |
| 115 | -#AC_ARG_WITH([gammalib-lib-dir], | |
| 116 | -# AC_HELP_STRING([--with-gammalib-lib-dir], | |
| 117 | -# [GammaLib library directory [[/usr/(local/(gamma/))lib(64)]]]), | |
| 118 | -# [gammalib_lib_dir=$withval]) | |
| 119 | -#if test "x$gammalib_lib_dir" != "x"; then | |
| 120 | -# 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 | |
| 121 | -#else | |
| 122 | -# for i in /usr/local/gamma/lib /usr/local/gamma/lib64 /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 ; do | |
| 123 | -# test -f $i/libgamma.a -o -f $i/libgamma.so -o -f $i/libgamma.dylib && LIBDIR_GAMMALIB=$i | |
| 124 | -# done | |
| 125 | -#fi | |
| 126 | -#if test -z "$LIBDIR_GAMMALIB"; then | |
| 127 | -# if test "x$gammalib_lib_dir" != "x"; then | |
| 128 | -# AC_MSG_ERROR(Cannot find GammaLib library under $gammalib_lib_dir) | |
| 129 | -# else | |
| 130 | -# AC_MSG_ERROR(Cannot find GammaLib library. Use --with-gammalib-lib-dir= to specify non-default path.) | |
| 131 | -# fi | |
| 132 | -#fi | |
| 133 | -#AC_SUBST(LIBDIR_GAMMALIB) | |
| 134 | - | |
| 135 | - | |
| 136 | 97 | dnl ======================================================================== |
| 137 | 98 | dnl Checks for python binding. Python binding requires Python and either the |
| 138 | 99 | dnl files gammalib_wrap.cpp and gammalib.py or SWIG to create these files. |
| ... | ... | @@ -208,6 +169,30 @@ else |
| 208 | 169 | fi |
| 209 | 170 | |
| 210 | 171 | |
| 172 | +dnl =========================== | |
| 173 | +dnl Checks for GammaLib library | |
| 174 | +dnl =========================== | |
| 175 | + | |
| 176 | +# Get GammaLib configuration | |
| 177 | +if test "x$prefix" = xNONE; then | |
| 178 | + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/gamma/lib/pkgconfig" | |
| 179 | +else | |
| 180 | + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig" | |
| 181 | +fi | |
| 182 | +has_gammalib="no" | |
| 183 | +PKG_CHECK_MODULES([GammaLib], [gammalib >= 0.4.5], | |
| 184 | + [has_gammalib="yes"], | |
| 185 | + [AC_MSG_ERROR([GammaLib library not found]) | |
| 186 | + AC_MSG_ERROR([Make sure that at least version 0.4.5 of GammaLib in installed]) | |
| 187 | + AC_MSG_ERROR([If GammaLib is not installed in the default location, please adjust the PKG_CONFIG_PATH environment variable])]) | |
| 188 | +if test "x$has_gammalib" = "xyes"; then | |
| 189 | + AC_DEFINE([HAVE_LIBGAMMA], [1], [Define if gammalib is available]) | |
| 190 | +fi | |
| 191 | +CFLAGS="$CFLAGS $GammaLib_CFLAGS" | |
| 192 | +CPPFLAGS="$CPPFLAGS $GammaLib_CFLAGS" | |
| 193 | +LDFLAGS="$LDFLAGS $GammaLib_LIBS" | |
| 194 | + | |
| 195 | + | |
| 211 | 196 | dnl ================== |
| 212 | 197 | dnl Build static code? |
| 213 | 198 | dnl ================== |
| ... | ... | @@ -251,6 +236,11 @@ dnl =========================== |
| 251 | 236 | echo |
| 252 | 237 | echo " ctatools configuration summary" |
| 253 | 238 | echo " ==============================" |
| 239 | +if test "x$has_gammalib" = "xyes"; then | |
| 240 | + echo " * GammaLib support (yes)" | |
| 241 | +else | |
| 242 | + echo " - GammaLib support (no) no gammalib library found" | |
| 243 | +fi | |
| 254 | 244 | if test ! "$SWIG"; then |
| 255 | 245 | echo " - swig (no)" |
| 256 | 246 | else |
| ... | ... | @@ -280,3 +270,5 @@ fi |
| 280 | 270 | echo |
| 281 | 271 | echo "Now type 'make'" |
| 282 | 272 | echo |
| 273 | + | |
| 274 | + | ... | ... |
pyext/setup.py.in
| ... | ... | @@ -24,12 +24,13 @@ for extra_lib in extra_libs: |
| 24 | 24 | # Get extra library paths |
| 25 | 25 | extra_lib_paths = ('@LDFLAGS@').split(' ') |
| 26 | 26 | for extra_lib_path in extra_lib_paths: |
| 27 | - dir = extra_lib_path.lstrip('-L') | |
| 28 | - if len(dir) > 0: | |
| 29 | - library_dirs.append(extra_lib_path.lstrip('-L')) | |
| 30 | -print include_dirs | |
| 31 | -print libraries | |
| 32 | -print library_dirs | |
| 27 | + if extra_lib_path.lstrip().find('-L') == 0: | |
| 28 | + dir = extra_lib_path.lstrip().lstrip('-L') | |
| 29 | + if len(dir) > 0: | |
| 30 | + library_dirs.append(extra_lib_path.lstrip('-L')) | |
| 31 | +#print include_dirs | |
| 32 | +#print libraries | |
| 33 | +#print library_dirs | |
| 33 | 34 | |
| 34 | 35 | # Setup |
| 35 | 36 | setup(name='@PACKAGE_NAME@', | ... | ... |