configure.ac 6.69 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALFrame],[1.5.2.1],[lal-discuss@ligo.org])
3 4
AC_CONFIG_HEADERS([lib/config.h lib/LALFrameConfig.h])
AC_CONFIG_SRCDIR([lib/LALFrameIO.c])
5 6
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

# 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.
AC_SUBST([LIBCURRENT],[11])
AC_SUBST([LIBREVISION],[1])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])
AS_CASE([${host_os}],
  [freebsd-aout|qnx|sco|sunos], [AC_SUBST([LIBMAJOR],[${LIBCURRENT}])],
  [AC_SUBST([LIBMAJOR],[$((LIBCURRENT-LIBAGE))])]
)

31 32
AC_CONFIG_FILES([ \
  Makefile \
33 34
  conda/Makefile \
  conda/meta.yaml.in \
35
  debian/Makefile \
36
  debian/control \
37
  debian/liblalframe${LIBMAJOR}.install:debian/liblalframe.install.in \
38 39
  doxygen/Makefile \
  doxygen/doxygen.cfg \
40 41
  include/Makefile \
  include/lal/Makefile \
42 43
  lalframe.pc \
  lalframe.spec \
44
  python/Makefile \
45 46 47
  python/lalframe/Makefile \
  python/lalframe/__init__.py \
  python/lalframe/utils/Makefile \
48 49 50
  lib/LALFrameVCSInfo.c \
  lib/LALFrameVCSInfo.h \
  lib/Makefile \
51 52
  bin/Makefile \
  bin/version.c \
53
  swig/Makefile \
54
  test/Makefile \
55
  test/python/Makefile \
56
  test/python/test_python_imports.py \
57
  test/python/test_python_scripts.py \
58
])
59 60 61 62 63 64
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
65
  tar-pax \
66 67
  dist-xz \
  no-dist-gzip \
68
])
69

70
# version requirements
71
MIN_LAL_VERSION="7.1.0"
72
MIN_FRAMECPPC_VERSION="2.5.5"
73
MIN_FRAMEL_VERSION="8.39.2"
74
AC_SUBST([MIN_LAL_VERSION])
75
AC_SUBST([MIN_FRAMECPPC_VERSION])
76
AC_SUBST([MIN_FRAMEL_VERSION])
77

78 79
AC_CANONICAL_HOST

80 81
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
82
LALSUITE_CHECK_GIT_REPO
83
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
84

85 86 87
# nightly build
LALSUITE_ENABLE_NIGHTLY

88 89 90 91 92 93
# enable check for framec
LALFRAME_ENABLE_FRAMEC

# enable check for framel
LALFRAME_ENABLE_FRAMEL

94 95 96
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

97 98
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG
99

100 101 102
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

103 104
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
Adam Mercer's avatar
Adam Mercer committed
105

106 107
# use silent build rules
AM_SILENT_RULES([yes])
108

109 110
# check for required compilers
LALSUITE_PROG_COMPILERS
111

112
# check for pthread, needed for low latency data test codes
113 114 115
AX_PTHREAD([lalframe_pthread=true],[lalframe_pthread=false])
AM_CONDITIONAL([PTHREAD],[test x$lalframe_pthread = xtrue])

116
# checks for programs
117
AC_PROG_INSTALL
118
AC_PROG_LN_S
119
AC_PROG_AWK
120
AC_PROG_SED
121
LALSUITE_CHECK_PYTHON([2.6])
122 123

# check for supported mac os x version
124
LALSUITE_OSX_VERSION_CHECK
125

126 127 128
# link tests using libtool
LALSUITE_USE_LIBTOOL

129 130
# check for header files
AC_HEADER_STDC
131
AC_CHECK_HEADERS([unistd.h])
132 133 134 135 136 137 138 139 140

# 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
141
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
142

143 144 145
# checks for library functions
AC_CHECK_FUNCS([gmtime_r localtime_r])

146 147
# check for framec or libframe libraries and headers
PKG_PROG_PKG_CONFIG
148 149 150 151
FRAMEC_AVAILABLE="no"
FRAMEL_AVAILABLE="no"

AS_IF([test "${framec}" = "true"], [
152
       FRAMEC_AVAILABLE="yes"
153
       PKG_CHECK_MODULES([FRAMECPPC],[framecppc >= ${MIN_FRAMECPPC_VERSION}],[true],[false])
154 155 156
       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"])
157 158 159
])

AS_IF([test "${framel}" = "true"], [
160
       FRAMEL_AVAILABLE="yes"
161 162 163
       PKG_CHECK_MODULES([FRAMEL],[framel],[true],[false])
       LALSUITE_ADD_FLAGS([C],[${FRAMEL_CFLAGS}],[${FRAMEL_LIBS}])
       AC_CHECK_LIB([framel],[FrLibIni],,[FRAMEL_AVAILABLE="no"])
164
       AC_CHECK_HEADERS([FrameL.h],,[FRAMEL_AVAILABLE="no"])
165
])
166 167 168

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

172
AS_IF([test "${FRAMEC_AVAILABLE}" = "yes"],
173
      [AC_SUBST([PC_REQUIRES_FRAMEC], [", framecppc >= ${MIN_FRAMECPPC_VERSION}"])],
174 175 176 177
      [AC_SUBST([PC_REQUIRES_FRAMEC], [""])]
)

AS_IF([test "${FRAMEL_AVAILABLE}" = "yes"],
178
      [AC_SUBST([PC_REQUIRES_FRAMEL], [", framel"])],
179 180 181
      [AC_SUBST([PC_REQUIRES_FRAMEL], [""])]
)

182 183
AM_CONDITIONAL([FRAMEC],[test "${FRAMEC_AVAILABLE}" = "yes"])
AM_CONDITIONAL([FRAMEL],[test "${FRAMEL_AVAILABLE}" = "yes"])
Adam Mercer's avatar
Adam Mercer committed
184

185
# check for lal libraries and headers
186
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
187
LALSUITE_CHECK_LIB([LALSupport],[${MIN_LAL_VERSION}],[XLALCacheImport],[lal/LALCache.h])
188

189
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
190
LALSUITE_USE_SWIG
191

192 193 194
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

195
# add gcc specific flags
196
LALSUITE_ADD_GCC_FLAGS
197

198
# link any executables against LALFrame library
199
AC_SUBST([LDADD], ["\$(top_builddir)/lib/liblalframe.la"])
200

201 202 203 204
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

208 209 210 211 212
# 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}"])

213
# output
214
AC_OUTPUT
215
AC_MSG_NOTICE([
216 217
==================================================
LALFrame has now been successfully configured:
218

219
* Python support is $PYTHON_ENABLE_VAL
220 221
* FrameC availability... ${FRAMEC_AVAILABLE}
* FrameL availability... ${FRAMEL_AVAILABLE}
Karl Wette's avatar
Karl Wette committed
222 223
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
224
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
225

226
and will be installed under the directory:
227

228
${prefix}
229

230 231 232
Now run 'make' to build LALFrame,
and run 'make install' to install LALFrame.
==================================================
233
])