configure.ac 6.33 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALFrame],[1.5.0.1],[lal-discuss@ligo.org])
3 4
AC_CONFIG_HEADERS([lib/config.h lib/LALFrameConfig.h])
AC_CONFIG_SRCDIR([lib/LALFrameIO.c])
5 6 7 8 9
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  Makefile \
  debian/Makefile \
10
  debian/control \
11 12
  doxygen/Makefile \
  doxygen/doxygen.cfg \
13 14
  include/Makefile \
  include/lal/Makefile \
15 16
  lalframe.pc \
  lalframe.spec \
17
  python/Makefile \
18 19 20
  python/lalframe/Makefile \
  python/lalframe/__init__.py \
  python/lalframe/utils/Makefile \
21 22 23 24
  lib/LALFrameVCSInfo.c \
  lib/LALFrameVCSInfo.h \
  lib/Makefile \
  lib/version.c \
25
  swig/Makefile \
26
  test/Makefile \
27
  test/python/Makefile \
28
  test/python/test_python_imports.py \
29
])
30 31 32 33 34 35
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
36
  tar-pax \
37 38
  dist-xz \
  no-dist-gzip \
39
])
40

41
# version requirements
42
MIN_LAL_VERSION="6.21.0"
43
MIN_FRAMECPPC_VERSION="2.5.5"
44
AC_SUBST([MIN_LAL_VERSION])
45
AC_SUBST([MIN_FRAMECPPC_VERSION])
46

47 48
AC_CANONICAL_HOST

49 50
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
51
LALSUITE_CHECK_GIT_REPO
52
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
53

54 55 56 57 58 59 60 61 62 63 64 65 66 67
# 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.
68 69
AC_SUBST([LIBCURRENT],[11])
AC_SUBST([LIBREVISION],[0])
70
AC_SUBST([LIBAGE],[0])
71 72
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

73 74 75
# nightly build
LALSUITE_ENABLE_NIGHTLY

76 77 78 79 80 81
# enable check for framec
LALFRAME_ENABLE_FRAMEC

# enable check for framel
LALFRAME_ENABLE_FRAMEL

82 83 84
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

85 86
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG
87

88 89 90
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

91 92
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
93

94 95
# use silent build rules
AM_SILENT_RULES([yes])
96

97 98
# check for required compilers
LALSUITE_PROG_COMPILERS
99

100
# check for pthread, needed for low latency data test codes
101 102 103
AX_PTHREAD([lalframe_pthread=true],[lalframe_pthread=false])
AM_CONDITIONAL([PTHREAD],[test x$lalframe_pthread = xtrue])

104
# checks for programs
105
AC_PROG_INSTALL
106
AC_PROG_LN_S
107
AC_PROG_AWK
108
AC_PROG_SED
109
LALSUITE_CHECK_PYTHON([2.6])
110 111

# check for supported mac os x version
112
LALSUITE_OSX_VERSION_CHECK
113

114 115 116
# link tests using libtool
LALSUITE_USE_LIBTOOL

117 118
# check for header files
AC_HEADER_STDC
119
AC_CHECK_HEADERS([unistd.h])
120 121 122 123 124 125 126 127 128

# check for gethostname in unistd.h
AC_MSG_CHECKING([for gethostname prototype in unistd.h])
AC_EGREP_HEADER([gethostname],[unistd.h],[AC_MSG_RESULT([yes])]
AC_DEFINE([HAVE_GETHOSTNAME_PROTOTYPE],[1],
          [Define if gethostname prototype is in unistd.h]),
          [AC_MSG_RESULT]([no]))

# check for required libraries
129
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
130

131 132 133
# checks for library functions
AC_CHECK_FUNCS([gmtime_r localtime_r])

134 135
# check for framec or libframe libraries and headers
PKG_PROG_PKG_CONFIG
136 137 138 139
FRAMEC_AVAILABLE="no"
FRAMEL_AVAILABLE="no"

AS_IF([test "${framec}" = "true"], [
140
       FRAMEC_AVAILABLE="yes"
141
       PKG_CHECK_MODULES([FRAMECPPC],[framecppc >= ${MIN_FRAMECPPC_VERSION}],[true],[false])
142 143 144
       LALSUITE_ADD_FLAGS([C],[${FRAMECPPC_CFLAGS}],[${FRAMECPPC_LIBS}])
       AC_CHECK_LIB([framecppc],[FrameCFileOpen],,[FRAMEC_AVAILABLE="no"])
       AC_CHECK_HEADERS([framecppc/FrameC.h],,[FRAMEC_AVAILABLE="no"])
145 146 147
])

AS_IF([test "${framel}" = "true"], [
148 149 150 151 152
       FRAMEL_AVAILABLE="yes"
       PKG_CHECK_MODULES([LIBFRAME],[libframe],[true],[false])
       LALSUITE_ADD_FLAGS([C],[${LIBFRAME_CFLAGS}],[${LIBFRAME_LIBS}])
       AC_CHECK_LIB([Frame],[FrLibIni],,[FRAMEL_AVAILABLE="no"])
       AC_CHECK_HEADERS([FrameL.h],,[FRAMEL_AVAILABLE="no"])
153
])
154 155 156

# make sure a frame library was found
AS_IF([test "${FRAMEC_AVAILABLE}" = "no" -a "${FRAMEL_AVAILABLE}" = "no"], [
157
       AC_MSG_ERROR([no frame library available])
158
])
159

160
AS_IF([test "${FRAMEC_AVAILABLE}" = "yes"],
161
      [AC_SUBST([PC_REQUIRES_FRAMEC], [", framecppc >= ${MIN_FRAMECPPC_VERSION}"])],
162 163 164 165 166 167 168 169
      [AC_SUBST([PC_REQUIRES_FRAMEC], [""])]
)

AS_IF([test "${FRAMEL_AVAILABLE}" = "yes"],
      [AC_SUBST([PC_REQUIRES_FRAMEL], [", libframe"])],
      [AC_SUBST([PC_REQUIRES_FRAMEL], [""])]
)

170 171
AM_CONDITIONAL([FRAMEC],[test "${FRAMEC_AVAILABLE}" = "yes"])
AM_CONDITIONAL([FRAMEL],[test "${FRAMEL_AVAILABLE}" = "yes"])
Adam Mercer's avatar
Adam Mercer committed
172

173
# check for lal libraries and headers
174
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
175
LALSUITE_CHECK_LIB([LALSupport],[${MIN_LAL_VERSION}],[XLALCacheImport],[lal/LALCache.h])
176

177
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
178
LALSUITE_USE_SWIG
179

180 181 182
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

183
# add gcc specific flags
184
LALSUITE_ADD_GCC_FLAGS
185

186
# link any executables against LALFrame library
187
AC_SUBST([LDADD], ["\$(top_builddir)/lib/liblalframe.la"])
188

189 190 191 192
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

196 197 198 199 200
# 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}"])

201
# output
202
AC_OUTPUT
203
AC_MSG_NOTICE([
204 205
==================================================
LALFrame has now been successfully configured:
206

207
* Python support is $PYTHON_ENABLE_VAL
208 209
* FrameC availability... ${FRAMEC_AVAILABLE}
* FrameL availability... ${FRAMEL_AVAILABLE}
Karl Wette's avatar
Karl Wette committed
210 211
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
212
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
213

214
and will be installed under the directory:
215

216
${prefix}
217

218 219 220
Now run 'make' to build LALFrame,
and run 'make install' to install LALFrame.
==================================================
221
])