configure.ac 5.72 KB
Newer Older
1
AC_INIT([lalframe],[1.0.4.1],[lal-discuss@gravity.phys.uwm.edu])
Adam Mercer's avatar
Adam Mercer committed
2
AM_CONFIG_HEADER([include/config.h src/LALFrameConfig.h])
3
AC_CONFIG_SRCDIR([src/LALFrameIO.c])
4
5
6
7
8
9
10
11
12
13
14
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalframe.spec \
  lalframe.pc \
  Makefile \
  gnuscripts/Makefile \
  debian/Makefile \
  include/Makefile \
  include/lal/Makefile \
  src/Makefile \
15
16
17
  swig/Makefile \
  swig/octave/Makefile \
  swig/python/Makefile \
18
19
20
21
22
23
  test/Makefile
])
AM_INIT_AUTOMAKE([foreign])

AC_CANONICAL_HOST

24
LALSUITE_ARG_VAR
25
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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.
41
42
43
AC_SUBST([LIBCURRENT],[3])
AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[3])
44
45
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

46
47
48
# nightly build
LALSUITE_ENABLE_NIGHTLY

Adam Mercer's avatar
Adam Mercer committed
49
50
51
# debug
LALSUITE_ENABLE_DEBUG

52
53
54
# enable check for inotify
LALFRAME_ENABLE_INOTIFY

Adam Mercer's avatar
Adam Mercer committed
55
# put version/configure info in config header
56
57
58
59
60
61
lalframe_version_major=`echo "$VERSION" | cut -d. -f1`
lalframe_version_minor=`echo "$VERSION" | cut -d. -f2`
lalframe_version_micro=`echo "$VERSION" | cut -d. -f3`
lalframe_version_devel=`echo "$VERSION" | cut -d. -f4-`
test -z "$lalframe_version_micro" && lalframe_version_micro=0
test -z "$lalframe_version_devel" && lalframe_version_devel=0
Adam Mercer's avatar
Adam Mercer committed
62
63
lalframe_configure_date=`date +"%Y-%m-%dT%H:%M:%S%z"`
AC_DEFINE_UNQUOTED([LALFRAME_VERSION],["$VERSION"],[LALFrame Version])
64
65
66
67
68
69
70
71
AC_DEFINE_UNQUOTED([LALFRAME_VERSION_MAJOR],[$lalframe_version_major],
                   [LALFrame Version Major Number])
AC_DEFINE_UNQUOTED([LALFRAME_VERSION_MINOR],[$lalframe_version_minor],
                   [LALFrame Version Minor Number])
AC_DEFINE_UNQUOTED([LALFRAME_VERSION_MICRO],[$lalframe_version_micro],
                   [LALFrame Version Micro Number])
AC_DEFINE_UNQUOTED([LALFRAME_VERSION_DEVEL],[$lalframe_version_devel],
                   [LALFrame Version Devel Number])
Adam Mercer's avatar
Adam Mercer committed
72
73
74
75
76
AC_DEFINE_UNQUOTED([LALFRAME_CONFIGURE_ARGS],["$ac_configure_args"],
                   [LALFrame Configure Arguments])
AC_DEFINE_UNQUOTED([LALFRAME_CONFIGURE_DATE],["$lalframe_configure_date"],
                   [LALFrame Configure Date])

77
# enable strict gcc flags
Adam Mercer's avatar
Adam Mercer committed
78
LALSUITE_ENABLE_GCC_FLAGS
79

80
81
82
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

83
84
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
85
m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99])
86
87
88
89

# use silent build rules if available
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)

90
# check for c++ compiler
91
92
AC_PROG_CXX

93
94
95
96
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
97
AC_PROG_AWK
98
LT_INIT
Adam Mercer's avatar
Adam Mercer committed
99
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
100
101
102
AC_CHECK_PROGS([M4],[gm4 m4],[m4])

# check for supported mac os x version
103
LALSUITE_OSX_VERSION_CHECK
104

105
106
107
# link tests using libtool
LALSUITE_USE_LIBTOOL

108
109
110
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES

111
112
113
114
115
116
117
118
119
120
121
# 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
122
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
123

Adam Mercer's avatar
comment    
Adam Mercer committed
124
# check for frame library
Adam Mercer's avatar
Adam Mercer committed
125
PKG_CHECK_MODULES([LIBFRAME],[libframe],[true],[false])
126
127
CPPFLAGS="$CPPFLAGS $LIBFRAME_CFLAGS"
LIBS="$LIBS $LIBFRAME_LIBS"
Adam Mercer's avatar
Adam Mercer committed
128
AC_CHECK_LIB([Frame],[FrLibIni],,[AC_MSG_ERROR([could not find the frame library])])
129

Adam Mercer's avatar
Adam Mercer committed
130
# check for frame library headers
131
AC_CHECK_HEADERS([FrameL.h],,[AC_MSG_ERROR([could not find the FrameL.h header])])
Adam Mercer's avatar
Adam Mercer committed
132

133
# check for lal libraries and headers
134
135
LALSUITE_CHECK_LIB([LAL],[6.6.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.6.0],[LALOpenDataFile],[lal/FileIO.h])
136

137
138
139
140
141
142
143
144
# 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"`"

145
146
147
# check for SWIG wrapping
LALSUITE_ENABLE_SWIG

148
149
150
151
152
153
154
155
156
157
158
159
# add gcc specific flags
if test "$GCC" = yes; then
  CFLAGS="$CFLAGS $lal_gcc_flags"

  # add mac os x specific flags
  if test "x$MACOSX_VERSION" != "x"; then
    CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
  fi
fi

# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
Adam Mercer's avatar
Adam Mercer committed
160
AC_SUBST_FILE([LAL_HEADER_LINK])
161
162
163
164
165
AC_PROG_MAKE_SET
AC_OUTPUT
echo "
================================================================

166
167
        LALFrame has now been successfully configured:

168
                inotify support is $INOTIFY_ENABLE_VAL
169
170
171
                SWIG wrappings for Octave are $SWIG_OCTAVE_ENABLE_VAL
                SWIG wrappings for Python are $SWIG_PYTHON_ENABLE_VAL

172
173
174
175
        and will be installed under the directory:

          ${prefix}

Adam Mercer's avatar
Adam Mercer committed
176
177
        Now run 'make' to build LALFrame
        and run 'make install' to install LALFrame
178
179

================================================================="