configure.ac 5.37 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALBurst],[1.2.2.1],[lal-discuss@ligo.org])
Adam Mercer's avatar
Adam Mercer committed
3
AC_CONFIG_HEADERS([src/config.h src/LALBurstConfig.h])
4
AC_CONFIG_SRCDIR([src/EPSearch.c])
Adam Mercer's avatar
Adam Mercer committed
5 6 7 8 9
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalburst.spec \
  lalburst.pc \
10
  lalburst-uninstalled.pc \
Adam Mercer's avatar
Adam Mercer committed
11 12 13 14
  Makefile \
  debian/Makefile \
  include/Makefile \
  include/lal/Makefile \
15 16
  src/LALBurstVCSInfo.c \
  src/LALBurstVCSInfo.h \
Adam Mercer's avatar
Adam Mercer committed
17
  src/Makefile \
18
  python/Makefile \
19 20
  python/lalburst/Makefile \
  python/lalburst/__init__.py \
Karl Wette's avatar
Karl Wette committed
21
  swig/Makefile \
Adam Mercer's avatar
Adam Mercer committed
22 23
  test/Makefile
])
Karl Wette's avatar
Karl Wette committed
24
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects color-tests parallel-tests])
Adam Mercer's avatar
Adam Mercer committed
25 26 27

AC_CANONICAL_HOST

28 29
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
30
LALSUITE_CHECK_GIT_REPO
31
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
32

Adam Mercer's avatar
Adam Mercer committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46
# set library api info
# 1. start with version information of "0:0:0" for each libtool library
# 2. update the version information only immediately before a public
#    release of your software. More frequent updates are unnecessary,
#    and only guarantee that the current interface number gets larger
#    faster.
# 3. if the library source code has changed at all since the last
#    update, then increment revision ("c:r:a" becomes "c:r+1:a").
# 4. if any interfaces have been added, removed, or changed since the
#    last update, increment current, and set revision to 0.
# 5. if any interfaces have been added since the last public release,
#    then increment age.
# 6. if any interfaces have been removed since the last public release,
#    then set age to 0.
47
AC_SUBST([LIBCURRENT],[3])
48
AC_SUBST([LIBREVISION],[2])
49
AC_SUBST([LIBAGE],[0])
Adam Mercer's avatar
Adam Mercer committed
50 51
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

52 53 54
# nightly build
LALSUITE_ENABLE_NIGHTLY

55 56 57
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

Karl Wette's avatar
Karl Wette committed
58 59 60
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG

61 62
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
Adam Mercer's avatar
Adam Mercer committed
63

64 65 66
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

67 68
# use silent build rules
AM_SILENT_RULES([yes])
Adam Mercer's avatar
Adam Mercer committed
69

70 71
# check for required compilers
LALSUITE_PROG_COMPILERS
72

Adam Mercer's avatar
Adam Mercer committed
73
# checks for programs
74
AC_PROG_INSTALL
Adam Mercer's avatar
Adam Mercer committed
75
AC_PROG_LN_S
76
AC_PROG_AWK
77
AC_PROG_SED
78
LALSUITE_CHECK_PYTHON([2.6])
Adam Mercer's avatar
Adam Mercer committed
79 80

# check for supported mac os x version
81
LALSUITE_OSX_VERSION_CHECK
Adam Mercer's avatar
Adam Mercer committed
82

83 84 85
# link tests using libtool
LALSUITE_USE_LIBTOOL

Adam Mercer's avatar
Adam Mercer committed
86 87 88 89
# check for header files
AC_HEADER_STDC

# check for required libraries
90
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
Adam Mercer's avatar
Adam Mercer committed
91

92
# check for Python
93
#AX_PYTHON_DEVEL()
94 95
# hack to remove default lib dirs from PYTHON_LDFLAGS.  only tested on
# Debian and SL6.  FIXME:  find a way to do this properly
96
#PYTHON_LDFLAGS="`echo $PYTHON_LDFLAGS | sed -e 'sX-L/usr/lib\(64\)\?\(/\)\?[[:space:]]*XXg'`"
97 98

# check for NumPy
99 100 101 102 103 104 105 106 107
#AX_PYTHON_MODULE(numpy, fatal)
#NUMPY_CFLAGS=-I`$PYTHON -c "import numpy;print (numpy.get_include());"`
#old_CFLAGS="$CFLAGS"
#CFLAGS="$CFLAGS ${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}"
#AC_CHECK_HEADER([numpy/arrayobject.h],
#	[PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}"],
#	[AC_MSG_ERROR([Numpy extension header not found])],
#	[#include "Python.h"])
#CFLAGS="$old_CFLAGS"
108

Adam Mercer's avatar
Adam Mercer committed
109 110
# check for gsl
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
111
LALSUITE_ADD_FLAGS([C],[${GSL_CFLAGS}],[${GSL_LIBS}])
112
AC_CHECK_LIB([gslcblas],[main],,[AC_MSG_ERROR([could not find the gsl library])])
Karl Wette's avatar
Karl Wette committed
113
AC_CHECK_LIB([gsl],[gsl_version],,[AC_MSG_ERROR([could not find the gsl library])])
114
LALSUITE_CHECK_GSL_VERSION([1.13])
115
LALSUITE_ENABLE_FAST_GSL
Adam Mercer's avatar
Adam Mercer committed
116

Adam Mercer's avatar
Adam Mercer committed
117
# check for gsl headers
118
AC_CHECK_HEADERS([gsl/gsl_errno.h],,[AC_MSG_ERROR([could not find the gsl/gsl_errno.h header])])
Adam Mercer's avatar
Adam Mercer committed
119

Adam Mercer's avatar
Adam Mercer committed
120 121
# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
122
LALSUITE_ADD_FLAGS([C],[${METAIO_CFLAGS}],[${METAIO_LIBS}])
Adam Mercer's avatar
Adam Mercer committed
123 124 125 126 127
AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio library])])

# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])

128
# check for lal libraries and headers
129
LALSUITE_CHECK_LIB([LAL],[6.12.0],[LALVersion],[lal/LALStdio.h])
Karl Wette's avatar
Karl Wette committed
130
LALSUITE_CHECK_LIB([LALSupport],[6.12.0],[XLALCacheImport],[lal/LALCache.h])
131 132
LALSUITE_CHECK_LIB([LALMetaIO],[1.2.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_LIB([LALSimulation],[1.1.0],[XLALSimDetectorStrainREAL8TimeSeries],[lal/LALSimulation.h])
Adam Mercer's avatar
Adam Mercer committed
133

Karl Wette's avatar
Karl Wette committed
134
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
135
LALSUITE_USE_SWIG
Karl Wette's avatar
Karl Wette committed
136

Adam Mercer's avatar
Adam Mercer committed
137
# add gcc specific flags
138
LALSUITE_ADD_GCC_FLAGS
Adam Mercer's avatar
Adam Mercer committed
139

140 141 142
# link any executables against LALBurst library
AC_SUBST([LDADD], ["\$(top_builddir)/src/liblalburst.la"])

143 144 145 146
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

147 148 149
# force headers to be installed in ${includedir}/lal, ignoring library name
AC_SUBST([pkgincludedir], ["\${includedir}/lal"])

150 151 152 153 154
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
# RedHat-derived systems.
AC_SUBST([pkgpythondir], ["\${pkgpyexecdir}"])

155
# output
Adam Mercer's avatar
Adam Mercer committed
156
AC_OUTPUT
157
AC_MSG_NOTICE([
158
==================================================
Karl Wette's avatar
Karl Wette committed
159 160
LALBurst has now been successfully configured:

161
* Python support is $PYTHON_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
162 163 164
* SWIG binding generation is $SWIG_GENERATE_ENABLE_VAL
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
165

166
and will be installed under the directory:
Adam Mercer's avatar
Adam Mercer committed
167

168
${prefix}
Adam Mercer's avatar
Adam Mercer committed
169

170 171 172
Now run 'make' to build LALBurst,
and run 'make install' to install LALBurst.
==================================================
173
])