configure.ac 4.82 KB
Newer Older
1
AC_INIT([lalmetaio],[1.0.3.1],[lal-discuss@gravity.phys.uwm.edu])
Adam Mercer's avatar
Adam Mercer committed
2
AM_CONFIG_HEADER([include/config.h src/LALMetaIOConfig.h])
3
AC_CONFIG_SRCDIR([src/LIGOLwXML.c])
Adam Mercer's avatar
Adam Mercer committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalmetaio.spec \
  lalmetaio.pc \
  Makefile \
  gnuscripts/Makefile \
  debian/Makefile \
  include/Makefile \
  include/lal/Makefile \
  src/Makefile
])
AM_INIT_AUTOMAKE([foreign])

AC_CANONICAL_HOST

20
LALSUITE_ARG_VAR
21
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
22

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

42
43
44
# nightly build
LALSUITE_ENABLE_NIGHTLY

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

Adam Mercer's avatar
Adam Mercer committed
48
# put version/configure info in config header
49
50
51
52
53
54
lalmetaio_version_major=`echo "$VERSION" | cut -d. -f1`
lalmetaio_version_minor=`echo "$VERSION" | cut -d. -f2`
lalmetaio_version_micro=`echo "$VERSION" | cut -d. -f3`
lalmetaio_version_devel=`echo "$VERSION" | cut -d. -f4-`
test -z "$lalmetaio_version_micro" && lalmetaio_version_micro=0
test -z "$lalmetaio_version_devel" && lalmetaio_version_devel=0
Adam Mercer's avatar
Adam Mercer committed
55
56
lalmetaio_configure_date=`date +"%Y-%m-%dT%H:%M:%S%z"`
AC_DEFINE_UNQUOTED([LALMETAIO_VERSION],["$VERSION"],[LALMetaIO Version])
57
58
59
60
61
62
63
64
AC_DEFINE_UNQUOTED([LALMETAIO_VERSION_MAJOR],[$lalmetaio_version_major],
                   [LALMetaIO Version Major Number])
AC_DEFINE_UNQUOTED([LALMETAIO_VERSION_MINOR],[$lalmetaio_version_minor],
                   [LALMetaIO Version Minor Number])
AC_DEFINE_UNQUOTED([LALMETAIO_VERSION_MICRO],[$lalmetaio_version_micro],
                   [LALMetaIO Version Micro Number])
AC_DEFINE_UNQUOTED([LALMETAIO_VERSION_DEVEL],[$lalmetaio_version_devel],
                   [LALMetaIO Version Devel Number])
Adam Mercer's avatar
Adam Mercer committed
65
66
67
68
69
AC_DEFINE_UNQUOTED([LALMETAIO_CONFIGURE_ARGS],["$ac_configure_args"],
                   [LALMetaIO Configure Arguments])
AC_DEFINE_UNQUOTED([LALMETAIO_CONFIGURE_DATE],["$lalmetaio_configure_date"],
                   [LALMetaIO Configure Date])

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

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

Adam Mercer's avatar
Adam Mercer committed
76
77
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
78
m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99])
Adam Mercer's avatar
Adam Mercer committed
79
80
81
82

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

83
84
85
# check for c++ compiler
AC_PROG_CXX

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

# check for supported mac os x version
95
LALSUITE_OSX_VERSION_CHECK
Adam Mercer's avatar
Adam Mercer committed
96

97
98
99
# link tests using libtool
LALSUITE_USE_LIBTOOL

100
101
102
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES

Adam Mercer's avatar
Adam Mercer committed
103
104
105
106
# check for header files
AC_HEADER_STDC

# check for required libraries
107
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
108
AC_CHECK_LIB([z],[compress],,[AC_MSG_ERROR([could not find the zlib library])])
Adam Mercer's avatar
Adam Mercer committed
109
110
111
112
113

# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
CPPFLAGS="$CPPFLAGS $METAIO_CFLAGS"
LIBS="$LIBS $METAIO_LIBS"
Adam Mercer's avatar
Adam Mercer committed
114
AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio library])])
Adam Mercer's avatar
Adam Mercer committed
115

Adam Mercer's avatar
Adam Mercer committed
116
# check for libmetaio headers
117
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
Adam Mercer's avatar
Adam Mercer committed
118

119
# check for lal libraries and headers
120
121
LALSUITE_CHECK_LIB([LAL],[6.6.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.6.0],[LALOpenDataFile],[lal/FileIO.h])
Adam Mercer's avatar
Adam Mercer committed
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

# 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
141
        LALMetaIO has now been successfully configured
Adam Mercer's avatar
Adam Mercer committed
142
143
144
145
        and will be installed under the directory:

          ${prefix}

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

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