configure.ac 4.99 KB
Newer Older
1
AC_INIT([lalstochastic],[1.1.3.1],[lal-discuss@gravity.phys.uwm.edu])
2
AM_CONFIG_HEADER([include/config.h src/LALStochasticConfig.h])
3
AC_CONFIG_SRCDIR([src/StochasticOmegaGW.c])
4
5
6
7
8
9
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalstochastic.spec \
  lalstochastic.pc \
  Makefile \
10
  gnuscripts/Makefile \
11
  debian/Makefile \
12
13
14
15
16
17
18
19
20
  include/Makefile \
  include/lal/Makefile \
  src/Makefile \
  test/Makefile
])
AM_INIT_AUTOMAKE([foreign])

AC_CANONICAL_HOST

21
LALSUITE_ARG_VAR
22
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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
38
AC_SUBST([LIBCURRENT],[2])
39
AC_SUBST([LIBREVISION],[1])
Adam Mercer's avatar
Adam Mercer committed
40
AC_SUBST([LIBAGE],[2])
41
42
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

43
44
45
# nightly build
LALSUITE_ENABLE_NIGHTLY

Adam Mercer's avatar
Adam Mercer committed
46
47
48
# debug
LALSUITE_ENABLE_DEBUG

49
# put version/configure info in config header
50
51
52
53
54
55
lalstochastic_version_major=`echo "$VERSION" | cut -d. -f1`
lalstochastic_version_minor=`echo "$VERSION" | cut -d. -f2`
lalstochastic_version_micro=`echo "$VERSION" | cut -d. -f3`
lalstochastic_version_devel=`echo "$VERSION" | cut -d. -f4-`
test -z "$lalstochastic_version_micro" && lalstochastic_version_micro=0
test -z "$lalstochastic_version_devel" && lalstochastic_version_devel=0
56
57
lalstochastic_configure_date=`date +"%Y-%m-%dT%H:%M:%S%z"`
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_VERSION],["$VERSION"],[LALStochastic Version])
58
59
60
61
62
63
64
65
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_VERSION_MAJOR],[$lalstochastic_version_major],
                   [LALStochastic Version Major Number])
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_VERSION_MINOR],[$lalstochastic_version_minor],
                   [LALStochastic Version Minor Number])
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_VERSION_MICRO],[$lalstochastic_version_micro],
                   [LALStochastic Version Micro Number])
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_VERSION_DEVEL],[$lalstochastic_version_devel],
                   [LALStochastic Version Devel Number])
66
67
68
69
70
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_CONFIGURE_ARGS],["$ac_configure_args"],
                   [LALStochastic Configure Arguments])
AC_DEFINE_UNQUOTED([LALSTOCHASTIC_CONFIGURE_DATE],["$lalstochastic_configure_date"],
                   [LALStochastic Configure Date])

71
# enable strict gcc flags
Adam Mercer's avatar
Adam Mercer committed
72
LALSUITE_ENABLE_GCC_FLAGS
73

74
75
76
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

77
78
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
79
m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99])
80
81
82
83

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

84
85
86
# check for c++ compiler
AC_PROG_CXX

87
88
89
90
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
91
AC_PROG_AWK
92
LT_INIT
93
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
94

95
# check for supported mac os x version
96
LALSUITE_OSX_VERSION_CHECK
97

98
99
100
# link tests using libtool
LALSUITE_USE_LIBTOOL

101
102
103
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES

104
105
106
107
# check for header files
AC_HEADER_STDC

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

110
111
112
113
114
115
116
117
# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
CPPFLAGS="$CPPFLAGS $METAIO_CFLAGS"
LIBS="$LIBS $METAIO_LIBS"
AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio library])])

# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
118

119
# check for lal libraries and headers
120
121
122
LALSUITE_CHECK_LIB([LAL],[6.6.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.6.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
123
124
125
126

# add gcc specific flags
if test "$GCC" = yes; then
  CFLAGS="$CFLAGS $lal_gcc_flags"
127
128
129
130
131

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

# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
Adam Mercer's avatar
Adam Mercer committed
136
AC_SUBST_FILE([LAL_HEADER_LINK])
137
138
139
140
141
AC_PROG_MAKE_SET
AC_OUTPUT
echo "
================================================================

Adam Mercer's avatar
Adam Mercer committed
142
        LALStochastic has now been successfully configured
143
144
145
146
        and will be installed under the directory:

          ${prefix}

Adam Mercer's avatar
Adam Mercer committed
147
148
        Now run 'make' to build LALStochastic
        and run 'make install' to install LALStochastic
149
150

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