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

AC_CANONICAL_HOST

29 30
LALSUITE_ARG_VAR

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

34 35 36 37 38 39 40 41 42 43 44 45 46 47
# 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.
48
AC_SUBST([LIBCURRENT],[7])
49
AC_SUBST([LIBREVISION],[1])
50
AC_SUBST([LIBAGE],[0])
51 52
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

53 54 55
# nightly build
LALSUITE_ENABLE_NIGHTLY

56 57 58
# enable check for FrameC
LALFRAME_ENABLE_FRAMEC

59 60 61
# enable check for inotify
LALFRAME_ENABLE_INOTIFY

62 63 64
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

65 66
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG
67

68 69
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
Adam Mercer's avatar
Adam Mercer committed
70

71 72 73
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

74 75
# use silent build rules
AM_SILENT_RULES([yes])
76

77 78
# check for required compilers
LALSUITE_PROG_COMPILERS
79

80 81 82 83
# check for pythread, needed for low latency data test codes
AX_PTHREAD([lalframe_pthread=true],[lalframe_pthread=false])
AM_CONDITIONAL([PTHREAD],[test x$lalframe_pthread = xtrue])

84
# checks for programs
85
AC_PROG_INSTALL
86
AC_PROG_LN_S
87
AC_PROG_AWK
88
AC_PROG_SED
89
LALSUITE_CHECK_PYTHON([2.6])
90 91

# check for supported mac os x version
92
LALSUITE_OSX_VERSION_CHECK
93

94 95 96
# link tests using libtool
LALSUITE_USE_LIBTOOL

97 98 99 100 101 102 103 104 105 106 107
# check for header files
AC_HEADER_STDC

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

110 111 112
# checks for library functions
AC_CHECK_FUNCS([gmtime_r localtime_r])

113
# check for framec or libframe libraries and headers
114
FRAMEC_AVAILABLE="no"
115
FRAMEL_AVAILABLE="yes"
116
PKG_PROG_PKG_CONFIG
117 118 119 120 121 122
AS_IF([test "${framec}" = "true"],[
	FRAMEC_AVAILABLE="yes"
	PKG_CHECK_MODULES([FRAMECPPC],[framecppc >= 1.19.32],[true],[false])
	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"])])
123 124 125 126 127 128 129 130 131 132 133
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"])

# make sure a frame library was found
AS_IF([test "${FRAMEC_AVAILABLE}" = "no" -a "${FRAMEL_AVAILABLE}" = "no"], [
	AC_MSG_ERROR([no frame library available])
])
AM_CONDITIONAL([FRAMEC],[test "${FRAMEC_AVAILABLE}" = "yes"])
AM_CONDITIONAL([FRAMEL],[test "${FRAMEL_AVAILABLE}" = "yes"])
Adam Mercer's avatar
Adam Mercer committed
134

135
# check for lal libraries and headers
136
LALSUITE_CHECK_LIB([LAL],[6.12.0],[LALVersion],[lal/LALStdio.h])
Karl Wette's avatar
Karl Wette committed
137
LALSUITE_CHECK_LIB([LALSupport],[6.12.0],[XLALCacheImport],[lal/LALCache.h])
138

139 140 141 142 143 144 145 146
# check for inotify
if test "${inotify}" = "true"; then
  AC_CHECK_HEADER([sys/inotify.h],
                  [AC_DEFINE([HAVE_INOTIFY],[1],[Define if you have inotify])],
                  [inotify=false])
fi
INOTIFY_ENABLE_VAL="`eval test x$inotify = xtrue && echo "ENABLED" || echo "DISABLED"`"

147
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
148
LALSUITE_USE_SWIG
149

150
# add gcc specific flags
151
LALSUITE_ADD_GCC_FLAGS
152

153 154 155
# link any executables against LALFrame library
AC_SUBST([LDADD], ["\$(top_builddir)/src/liblalframe.la"])

156 157 158 159
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

163 164 165 166 167
# 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}"])

168
# output
169
AC_OUTPUT
170
AC_MSG_NOTICE([
171 172
==================================================
LALFrame has now been successfully configured:
173

174
* Python support is $PYTHON_ENABLE_VAL
175
* using the $FRAME_LIBRARY frame library
176 177
* FrameC availability... ${FRAMEC_AVAILABLE}
* FrameL availability... ${FRAMEL_AVAILABLE}
178
* inotify support is $INOTIFY_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
179 180 181
* 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
182

183
and will be installed under the directory:
184

185
${prefix}
186

187 188 189
Now run 'make' to build LALFrame,
and run 'make install' to install LALFrame.
==================================================
190
])