From 809137b02200dfffa3a7f65e68a3ebba831ce1bd Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Wed, 12 May 2010 13:48:06 +0000 Subject: [PATCH] use pkg-config information to detect GammaLib --- Makefile.am | 8 ++++---- autogen.sh | 11 +++++------ configure.ac | 97 +++++++++++++++++++++++++++++++------------------------------------------------------------------ src/ctselect/Makefile.am | 6 ++++-- 4 files changed, 44 insertions(+), 78 deletions(-) diff --git a/Makefile.am b/Makefile.am index 879befa..e6626c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ -## Process this file with automake to produce Makefile.in -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src +SUBDIRS = . src +CLEANFILES = EXTRA_DIST = autogen.sh +INCLUDES = + diff --git a/autogen.sh b/autogen.sh index 8a9d460..cf25f41 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,8 +1,7 @@ #!/bin/sh - -autoreconf --force --install --symlink \ -&& aclocal -I m4 \ -&& automake --add-missing \ -&& autoconf - +autoreconf --force --install +#autoreconf --force --install --symlink \ +#&& aclocal \ +#&& automake \ +#&& autoconf diff --git a/configure.ac b/configure.ac index cd19b89..32b142a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,71 +1,36 @@ -dnl ============================================================= -dnl Process this file with autoconf to produce a configure script -dnl ============================================================= -AC_INIT([CTATools], [0.1], [knodlseder@cesr.fr]) -AC_CONFIG_SRCDIR(src/Makefile.am) -AC_CONFIG_MACRO_DIR([m4]) +# Process this file with autoconf to produce a configure script. -AM_INIT_AUTOMAKE([gnu no-dependencies]) -AM_CONFIG_HEADER([config.h]) -AM_MAINTAINER_MODE +AC_PREREQ([2.64]) +AC_INIT([ctatools], [0.1.0], [knodlseder@cesr.fr]) +AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE - -dnl =========================== -dnl things required by automake -dnl =========================== -dnl AC_ARG_PROGRAM -AC_PROG_MAKE_SET - - -dnl ====================== -dnl Check for which system -dnl ====================== -dnl AC_CANONICAL_HOST - - -dnl =================== -dnl Checks for programs -dnl =================== +# Checks for programs. AC_PROG_CXX AC_PROG_INSTALL -dnl AC_PROG_RANLIB -AC_PROG_LIBTOOL - - -dnl ======================= -dnl Check compiler features -dnl ======================= -dnl AC_TYPE_SIZE_T -dnl AC_C_CONST -dnl AC_C_VOLATILE -dnl AC_C_INLINE - - -dnl ======================= -dnl Checks for header files -dnl ======================= - - -dnl ============================================================= -dnl Checks for typedefs, structures, and compiler characteristics -dnl ============================================================= - - -dnl ============================ -dnl Checks for library functions -dnl ============================ - - -dnl =================== -dnl Checks for gammalib -dnl =================== -AC_SEARCH_LIBS(str, gammalib, - AC_DEFINE([G_GAMMALIB], [1], [Define if gammalib is available]), ,[-lm]) - -dnl ====================================== -dnl Set list of output files to be creates -dnl ====================================== -AC_OUTPUT([Makefile - src/Makefile - src/ctselect/Makefile]) +# Checks for libraries. +if test "x$prefix" = xNONE; then + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/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" + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile + src/Makefile + src/ctselect/Makefile]) +AC_OUTPUT diff --git a/src/ctselect/Makefile.am b/src/ctselect/Makefile.am index ceeafcb..6ce670b 100644 --- a/src/ctselect/Makefile.am +++ b/src/ctselect/Makefile.am @@ -8,7 +8,9 @@ INCLUDES = -I$(top_srcdir)/include \ -I$(top_builddir)/src \ -I$(top_srcdir)/src -PROGRAMS = ctselect +bin_PROGRAMS = ctselect ctselect_SOURCES = ctselect.cpp -ctselect_LDADD = libgamma.la +#ctselect_LDADD = libgamma.la +ctselect_LDFLAGS = @LDFLAGS@ +ctselect_CPPFLAGS = @CPPFLAGS@ -- libgit2 0.21.4