forked from ryanscranton/astro-stomp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
165 lines (136 loc) · 4.64 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
dnl --------------------------------
dnl Initialization macros.
dnl --------------------------------
AC_INIT(stomp/stomp.h)
AM_CONFIG_HEADER(config.h)
dnl -----------------------------------------------
dnl Package name and version number (user defined)
dnl -----------------------------------------------
GENERIC_LIBRARY_NAME=stomp
#release versioning
GENERIC_MAJOR_VERSION=1
GENERIC_MINOR_VERSION=0
GENERIC_MICRO_VERSION=0
#API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
GENERIC_API_VERSION=1.0
AC_SUBST(GENERIC_API_VERSION)
#shared library versioning
GENERIC_LIBRARY_VERSION=1:0:0
dnl --------------------------------
dnl Package name and version number
dnl --------------------------------
AC_SUBST(GENERIC_LIBRARY_VERSION)
PACKAGE=$GENERIC_LIBRARY_NAME
AC_SUBST(GENERIC_LIBRARY_NAME)
GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
AC_SUBST(GENERIC_RELEASE)
AC_SUBST(GENERIC_VERSION)
VERSION=$GENERIC_VERSION
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, ryan.scranton@gmail.com)
# Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AC_LANG_CPLUSPLUS
# Checks for header files.
AC_CHECK_HEADERS([limits.h stdint.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_HEADER_STDC
AC_CHECK_FUNCS([floor gettimeofday pow sqrt])
# If we're on OS X then we need to supply an additional flag for our S2
# compilation
case "$host" in
*-apple-darwin* | *-apple-macos*)
CFLAGS="$CFLAGS -DOS_MACOSX"
CXXFLAGS="$CXXFLAGS -DOS_MACOSX"
CPPFLAGS="$CPPFLAGS -DOS_MACOSX"
CC="clang++"
CPP="clang++ -E"
CXX="clang++"
CXXCPP="clang++ -E"
;;
esac
# Location of gflags directories as input by user.
gflags_dir_given="no"
AC_ARG_WITH(gflags_dir, AC_HELP_STRING([--with-gflags-dir=PREFIX],
[prefix directory containing gflags]),
[gflags_dir_given="yes"])
# if test "$gflags_dir_given" = "yes"; then #CBM removed gflags
# GFLAGS_INCLUDE="-I$with_gflags_dir/include"
# GFLAGS_LIB="-L$with_gflags_dir/lib"
# AC_SUBST(GFLAGS_INCLUDE)
# AC_SUBST(GFLAGS_LIB)
# CFLAGS="$CFLAGS -I$with_gflags_dir/include"
# CPPFLAGS="$CPPFLAGS -I$with_gflags_dir/include"
# CXXFLAGS="$CXXFLAGS -I$with_gflags_dir/include"
# LDFLAGS="$LDFLAGS -L$with_gflags_dir/lib"
# fi
# Location of zlib directories as input by user.
zlib_dir_given="no"
AC_ARG_WITH(zlib_dir, AC_HELP_STRING([--with-zlib-dir=/usr],
[prefix directory containing zlib]),
[zlib_dir_given="yes"])
if test "$zlib_dir_given" = "yes"; then
ZLIB_INCLUDE="-I$with_zlib_dir/include"
ZLIB_LIB="-L$with_zlib_dir/lib"
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)
CFLAGS="$CFLAGS -I$with_zlib_dir/include"
CPPFLAGS="$CPPFLAGS -I$with_zlib_dir/include"
CXXFLAGS="$CXXFLAGS -I$with_zlib_dir/include"
LDFLAGS="$LDFLAGS -L$with_zlib_dir/lib"
fi
# Checks for math library.
AC_CHECK_LIB([m], [floor], [],
[AC_MSG_ERROR([cannot find required math function])])
AC_CHECK_LIB([m], [pow], [],
[AC_MSG_ERROR([cannot find required math function])])
AC_CHECK_LIB([m], [sqrt], [],
[AC_MSG_ERROR([cannot find required math function])])
# Check for C++ stl.
AC_LANG_CPLUSPLUS
AC_CHECK_HEADER([string], [], [AC_MSG_ERROR([cannot find STL string])])
AC_CHECK_HEADER([vector], [], [AC_MSG_ERROR([cannot find STL vector])])
AC_CHECK_HEADER([map], [], [AC_MSG_ERROR([cannot find STL map])])
AC_CHECK_HEADER([set], [], [AC_MSG_ERROR([cannot find STL set])])
AC_CHECK_HEADER([queue], [], [AC_MSG_ERROR([cannot find STL queue])])
AC_CHECK_HEADER([algorithm], [], [AC_MSG_ERROR([cannot find STL algorithms])])
# Check for gflags # CBM removed gflags
# AC_LANG_CPLUSPLUS
# AC_CHECK_HEADER(google/gflags.h, [], [AC_MSG_ERROR([cannot find gflags.h])])
# AC_CHECK_LIB([gflags], [main], [],
# [AC_MSG_ERROR([cannot find libgflags])])
# Check for zlib
AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(zlib.h, [], [AC_MSG_ERROR([cannot find zlib.h])])
AC_CHECK_LIB([z], [main], [],
[AC_MSG_ERROR([cannot find libgflags])])
AC_OUTPUT(Makefile \
stomp-1.0.pc \
stomp/Makefile \
s2/Makefile \
s2omp/Makefile \
examples/Makefile
)