configure.ac 5.99 KB
Newer Older
1
AC_INIT([lalpulsar],[1.1.0.3],[lal-discuss@gravity.phys.uwm.edu])
Adam Mercer's avatar
Adam Mercer committed
2
AM_CONFIG_HEADER([include/config.h src/LALPulsarConfig.h])
3
AC_CONFIG_SRCDIR([src/ComputeFstat.c])
Adam Mercer's avatar
Adam Mercer committed
4
5
6
7
8
9
10
11
12
13
14
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalpulsar.spec \
  lalpulsar.pc \
  Makefile \
  gnuscripts/Makefile \
  debian/Makefile \
  include/Makefile \
  include/lal/Makefile \
  src/Makefile \
15
16
17
  swig/Makefile \
  swig/octave/Makefile \
  swig/python/Makefile \
Adam Mercer's avatar
Adam Mercer committed
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

Adam Mercer's avatar
Adam Mercer committed
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.
Adam Mercer's avatar
Adam Mercer committed
41
AC_SUBST([LIBCURRENT],[1])
Adam Mercer's avatar
Adam Mercer committed
42
43
44
45
46
47
48
AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[0])
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

# default install path
AC_PREFIX_DEFAULT([/opt/lscsoft/lalpulsar])

49
50
51
# nightly build
LALSUITE_ENABLE_NIGHTLY

Adam Mercer's avatar
Adam Mercer committed
52
53
54
# enable LALXML support
LALSUITE_ENABLE_LALXML

Adam Mercer's avatar
Adam Mercer committed
55
56
57
# debug
LALSUITE_ENABLE_DEBUG

Adam Mercer's avatar
Adam Mercer committed
58
# put version/configure info in config header
59
60
61
62
63
64
lalpulsar_version_major=`echo "$VERSION" | cut -d. -f1`
lalpulsar_version_minor=`echo "$VERSION" | cut -d. -f2`
lalpulsar_version_micro=`echo "$VERSION" | cut -d. -f3`
lalpulsar_version_devel=`echo "$VERSION" | cut -d. -f4-`
test -z "$lalpulsar_version_micro" && lalpulsar_version_micro=0
test -z "$lalpulsar_version_devel" && lalpulsar_version_devel=0
Adam Mercer's avatar
Adam Mercer committed
65
66
lalpulsar_configure_date=`date +"%Y-%m-%dT%H:%M:%S%z"`
AC_DEFINE_UNQUOTED([LALPULSAR_VERSION],["$VERSION"],[LALPulsar Version])
67
68
69
70
71
72
73
74
AC_DEFINE_UNQUOTED([LALPULSAR_VERSION_MAJOR],[$lalpulsar_version_major],
                   [LALPulsar Version Major Number])
AC_DEFINE_UNQUOTED([LALPULSAR_VERSION_MINOR],[$lalpulsar_version_minor],
                   [LALPulsar Version Minor Number])
AC_DEFINE_UNQUOTED([LALPULSAR_VERSION_MICRO],[$lalpulsar_version_micro],
                   [LALPulsar Version Micro Number])
AC_DEFINE_UNQUOTED([LALPULSAR_VERSION_DEVEL],[$lalpulsar_version_devel],
                   [LALPulsar Version Devel Number])
Adam Mercer's avatar
Adam Mercer committed
75
76
77
78
79
AC_DEFINE_UNQUOTED([LALPULSAR_CONFIGURE_ARGS],["$ac_configure_args"],
                   [LALPulsar Configure Arguments])
AC_DEFINE_UNQUOTED([LALPULSAR_CONFIGURE_DATE],["$lalpulsar_configure_date"],
                   [LALPulsar Configure Date])

80
# boinc
Adam Mercer's avatar
Adam Mercer committed
81
LALSUITE_ENABLE_BOINC
82

Adam Mercer's avatar
Adam Mercer committed
83
# enable strict gcc flags
Adam Mercer's avatar
Adam Mercer committed
84
LALSUITE_ENABLE_GCC_FLAGS
Adam Mercer's avatar
Adam Mercer committed
85
86
87
88
89

# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99])

90
# boinc requires a c++ compiler
91
AC_PROG_CXX
92

Adam Mercer's avatar
Adam Mercer committed
93
94
95
96
97
98
99
# use silent build rules if available
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)

# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
100
AC_PROG_AWK
Adam Mercer's avatar
Adam Mercer committed
101
LT_INIT
Adam Mercer's avatar
Adam Mercer committed
102
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
Adam Mercer's avatar
Adam Mercer committed
103
104

# check for supported mac os x version
105
LALSUITE_OSX_VERSION_CHECK
Adam Mercer's avatar
Adam Mercer committed
106

107
108
109
# link tests using libtool
LALSUITE_USE_LIBTOOL

Adam Mercer's avatar
Adam Mercer committed
110
111
112
113
114
115
116
117
118
119
120
121
# check for header files
AC_HEADER_STDC

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

# check for gsl
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
CPPFLAGS="$CPPFLAGS $GSL_CFLAGS"
LIBS="$LIBS $GSL_LIBS"
AC_CHECK_LIB([gslcblas],[main],,[AC_MSG_ERROR([could not find the gsl library])])
AC_CHECK_LIB([gsl],[gsl_strerror],,[AC_MSG_ERROR([could not find the gsl library])])
122
LALSUITE_ENABLE_FAST_GSL
Adam Mercer's avatar
Adam Mercer committed
123
124
125
126

# check for gsl headers
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
127
128
129
130
131
132
133
134
if test "$lalxml" = "true"; then
  # check for libxml2
  PKG_CHECK_MODULES([LIBXML2],[libxml-2.0 >= 2.6],[true],[false])
  CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS"
  LIBS="$LIBS $LIBXML2_LIBS"
  AC_CHECK_LIB([xml2],[xmlInitParser],,[AC_MSG_WARN([cannot find the xml2 library])])
fi

135
136
137
138
139
# for boinc enabled build do checks for lal in c++ mode
if test "${boinc}" = "true" ; then
  AC_LANG_PUSH([C++])
fi

140
# check for lal libraries and headers
Adam Mercer's avatar
Adam Mercer committed
141
LALSUITE_CHECK_LIB([LAL],[6.5.0.3],[LALVersion],[lal/LALStdio.h])
Adam Mercer's avatar
Adam Mercer committed
142

143
144
# check that lal has been buil with boinc support, for boinc build
if test "${boinc}" = "true" ; then
Adam Mercer's avatar
Adam Mercer committed
145
  LALSUITE_CHECK_BOINC
146
147
fi

Adam Mercer's avatar
Adam Mercer committed
148
# check for lalsupport, needed for test suite
149
LALSUITE_CHECK_LIB([LALSupport],[6.5.0],[LALOpenDataFile],[lal/FileIO.h])
Adam Mercer's avatar
Adam Mercer committed
150

151
152
153
154
155
# back to c mode
if test "${boinc}" = "true" ; then
  AC_LANG_POP([C++])
fi

Adam Mercer's avatar
Adam Mercer committed
156
# check for lalxml
Adam Mercer's avatar
Adam Mercer committed
157
LALSUITE_CHECK_OPT_LIB([LALXML],[1.1.0.3],[XLALXMLFilePrintElements],[lal/LALXML.h])
Adam Mercer's avatar
Adam Mercer committed
158

159
160
161
162
163
164
# check for SWIG wrapping
LALSUITE_ENABLE_SWIG
if test "$lalxml" = "true"; then
   LALSUITE_SWIG_USE([LALXML])
fi

Adam Mercer's avatar
Adam Mercer committed
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# 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
AC_SUBST_FILE([LAL_HEADER_LINK])
AC_PROG_MAKE_SET
AC_OUTPUT
echo "
================================================================

Adam Mercer's avatar
Adam Mercer committed
183
184
185
        LALPulsar has now been successfully configured:

                LAL XML library support is $LALXML_ENABLE_VAL
186
187
                SWIG wrappings for Octave are $SWIG_OCTAVE_ENABLE_VAL
                SWIG wrappings for Python are $SWIG_PYTHON_ENABLE_VAL
Adam Mercer's avatar
Adam Mercer committed
188

Adam Mercer's avatar
Adam Mercer committed
189
190
191
192
        and will be installed under the directory:

          ${prefix}

Adam Mercer's avatar
Adam Mercer committed
193
194
        Now run 'make' to build LALPulsar
        and run 'make install' to install LALPulsar
Adam Mercer's avatar
Adam Mercer committed
195
196

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