Commit 35675989064b0e42b971da746a4bb5701206dca5

Authored by knodlseder
1 parent f05aa7f3

install pkg-config information

Makefile.am
1 1 ## Process this file with automake to produce Makefile.in
  2 +
  3 +# Include M4 macros
2 4 ACLOCAL_AMFLAGS = -I m4
3 5  
  6 +# Subdirectories
4 7 SUBDIRS = include src test pyext
5 8  
6   -EXTRA_DIST = autogen.sh
7 9 \ No newline at end of file
  10 +# Extra files to be distributed in the tar file
  11 +EXTRA_DIST = autogen.sh \
  12 + gammalib.pc.in
  13 +
  14 +# Install pkg-config information
  15 +pkgconfigdir = $(libdir)/pkgconfig
  16 +pkgconfig_DATA = gammalib.pc
  17 +
... ...
autogen.sh
1 1 #!/bin/sh
2   -
3   -autoreconf --force --install --symlink \
4   -&& aclocal -I m4 \
5   -&& automake --add-missing \
6   -&& autoconf
  2 +autoreconf --force --install
  3 +#autoreconf --force --install --symlink \
  4 +#&& aclocal -I m4 \
  5 +#&& automake --add-missing \
  6 +#&& autoconf
7 7  
8 8  
... ...
configure.ac
... ... @@ -4,10 +4,21 @@ dnl =============================================================
4 4 AC_INIT([GammaLib], [0.3], [knodlseder@cesr.fr])
5 5 AC_CONFIG_SRCDIR(src/Makefile.am)
6 6 AC_CONFIG_MACRO_DIR([m4])
7   -
8 7 AM_INIT_AUTOMAKE([gnu no-dependencies])
9   -AM_CONFIG_HEADER([config.h])
10   -AM_MAINTAINER_MODE
  8 +AC_CONFIG_HEADERS([config.h])
  9 +dnl AM_MAINTAINER_MODE
  10 +
  11 +
  12 +dnl =========================================
  13 +dnl Library versioning (current:revision:age)
  14 +dnl See the libtool manual for an explanation
  15 +dnl
  16 +dnl gammalib-0.1 libgamma 0:0:0
  17 +dnl gammalib-0.2 libgamma 0:0:0
  18 +dnl gammalib-0.3 libgamma 0:0:0
  19 +dnl =========================================
  20 +GAMMALIB_LT_VERSION="0:0:0"
  21 +AC_SUBST(GAMMALIB_LT_VERSION)
11 22  
12 23  
13 24 dnl ===========================
... ... @@ -17,50 +28,63 @@ dnl AC_ARG_PROGRAM
17 28 AC_PROG_MAKE_SET
18 29  
19 30  
20   -dnl ======================
21   -dnl Check for which system
22   -dnl ======================
23   -dnl AC_CANONICAL_HOST
24   -
25   -
26 31 dnl ===================
27 32 dnl Checks for programs
28 33 dnl ===================
29 34 AC_PROG_CXX
30 35 AC_PROG_INSTALL
31   -dnl AC_PROG_RANLIB
32 36 AC_PROG_LIBTOOL
33 37  
  38 +# Checks for SWIG
  39 +AC_PATH_PROG([SWIG], [swig])
  40 +AM_CONDITIONAL(HAVE_SWIG, test "$SWIG")
34 41  
35   -dnl =========================================
36   -dnl Library versioning (current:revision:age)
37   -dnl See the libtool manual for an explanation
38   -dnl
39   -dnl gammalib-0.1 libgamma 0:0:0
40   -dnl gammalib-0.2 libgamma 0:0:0
41   -dnl gammalib-0.3 libgamma 0:0:0
42   -dnl =========================================
43   -GAMMALIB_LT_VERSION="0:0:0"
44   -AC_SUBST(GAMMALIB_LT_VERSION)
  42 +# Checks for Python
  43 +AM_PATH_PYTHON([2.2],
  44 + [],
  45 + [AC_MSG_WARN([Python not found. Python is required to build python binding. Python can be obtained from http://www.python.org])])
  46 +AM_CONDITIONAL(HAVE_PYTHON, test "$PYTHON")
  47 +
  48 +AC_ARG_ENABLE([python-binding],
  49 + AS_HELP_STRING([--enable-python-binding],
  50 + [build python binding (default=yes)]),
  51 + [ac_enable_python_binding=no],
  52 + [ac_enable_python_binding=yes])
  53 +if test "x$ac_enable_python_binding" = "xyes"
  54 +then
  55 + if test ! "$SWIG" -a ! "$PYTHON"
  56 + then
  57 + AC_MSG_WARN([Python binding for gammalib cannot be built. Ensure that SWIG and Python packages are available.])
  58 + fi
  59 +else
  60 + AC_MSG_NOTICE([Python binding for gammalib will not be built.])
  61 + AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding])
  62 +fi
  63 +AM_CONDITIONAL(ENABLE_PYTHON_BINDING, test "x$ac_enable_python_binding" = "xyes")
45 64  
46 65  
47   -dnl =======================
48   -dnl Check compiler features
49   -dnl =======================
50   -dnl AC_TYPE_SIZE_T
51   -dnl AC_C_CONST
52   -dnl AC_C_VOLATILE
53   -dnl AC_C_INLINE
  66 +dnl ====================
  67 +dnl Checks for libraries
  68 +dnl ====================
  69 +# Checks for cfitsio
  70 +AC_SEARCH_LIBS(ffpss, cfitsio,
  71 + AC_DEFINE([G_CFITSIO], [1], [Define if cfitsio is available]), ,[-lm])
54 72  
55 73  
56 74 dnl =======================
57 75 dnl Checks for header files
58 76 dnl =======================
  77 +AC_STDC_HEADERS
59 78  
60 79  
61 80 dnl =============================================================
62 81 dnl Checks for typedefs, structures, and compiler characteristics
63 82 dnl =============================================================
  83 +dnl AC_TYPE_SIZE_T
  84 +dnl AC_C_CONST
  85 +dnl AC_C_VOLATILE
  86 +dnl AC_C_INLINE
  87 +
64 88  
65 89  
66 90 dnl ============================
... ... @@ -68,6 +92,12 @@ dnl Checks for library functions
68 92 dnl ============================
69 93  
70 94  
  95 +dnl =========================
  96 +dnl Check for system services
  97 +dnl =========================
  98 +dnl AC_CANONICAL_HOST
  99 +
  100 +
71 101 dnl ==============================
72 102 dnl Check for range cheking option
73 103 dnl ==============================
... ... @@ -80,60 +110,22 @@ if test "x$RANGE_CHECK" = "xyes"; then
80 110 fi
81 111  
82 112  
83   -dnl ===============
84   -dnl Checks for SWIG
85   -dnl ===============
86   -AC_PATH_PROG([SWIG], [swig])
87   -AM_CONDITIONAL(HAVE_SWIG, test "$SWIG")
88   -
89   -
90   -dnl =================
91   -dnl Checks for Python
92   -dnl =================
93   -AM_PATH_PYTHON([2.2],
94   - [],
95   - [AC_MSG_WARN([Python not found. Python is required to build python binding. Python can be obtained from http://www.python.org])])
96   -AM_CONDITIONAL(HAVE_PYTHON, test "$PYTHON")
97   -
98   -AC_ARG_ENABLE([python-binding],
99   - AS_HELP_STRING([--enable-python-binding],
100   - [build python binding (default=yes)]),
101   - [ac_enable_python_binding=no],
102   - [ac_enable_python_binding=yes])
103   -if test "x$ac_enable_python_binding" = "xyes"
104   -then
105   - if test ! "$SWIG" -a ! "$PYTHON"
106   - then
107   - AC_MSG_WARN([Python binding for gammalib cannot be built. Ensure that SWIG and Python packages are available.])
108   - fi
109   -else
110   - AC_MSG_NOTICE([Python binding for gammalib will not be built.])
111   - AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding])
112   -fi
113   -AM_CONDITIONAL(ENABLE_PYTHON_BINDING, test "x$ac_enable_python_binding" = "xyes")
114   -
115   -
116   -dnl ==================
117   -dnl Checks for cfitsio
118   -dnl ==================
119   -AC_SEARCH_LIBS(ffpss, cfitsio,
120   - AC_DEFINE([G_CFITSIO], [1], [Define if cfitsio is available]), ,[-lm])
121   -
122   -
123 113 dnl ======================================
124 114 dnl Set list of output files to be creates
125 115 dnl ======================================
126   -AC_OUTPUT([Makefile
127   - src/Makefile
128   - src/support/Makefile
129   - src/linalg/Makefile
130   - src/fits/Makefile
131   - src/sky/Makefile
132   - src/opt/Makefile
133   - src/obs/Makefile
134   - src/model/Makefile
135   - src/lat/Makefile
136   - include/Makefile
137   - test/Makefile
138   - pyext/Makefile
139   - pyext/setup.py])
  116 +AC_CONFIG_FILES([Makefile
  117 + src/Makefile
  118 + src/support/Makefile
  119 + src/linalg/Makefile
  120 + src/fits/Makefile
  121 + src/sky/Makefile
  122 + src/opt/Makefile
  123 + src/obs/Makefile
  124 + src/model/Makefile
  125 + src/lat/Makefile
  126 + include/Makefile
  127 + test/Makefile
  128 + pyext/Makefile
  129 + pyext/setup.py
  130 + gammalib.pc])
  131 +AC_OUTPUT
140 132 \ No newline at end of file
... ...