-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
193 lines (165 loc) · 4 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
dnl vim:ts=2:sw=2:et:
dnl Process this file with autoconf to produce a configure script.
dnl Some intro checks and defines
AC_PREREQ(2.50)
AC_INIT([atomicparsley],[0.9.7],
[http://bitbucket.org/wez/atomicparsley/issues/new/])
dnl Need to disable dependency tracking option so that the universal
dnl build option works for OSX
AM_INIT_AUTOMAKE([dist-bzip2 foreign no-dependencies subdir-objects -Wall])
AC_CANONICAL_HOST
AC_ARG_ENABLE(universal, dnl
[ --enable-universal build a universal binary on Mac OS X [default=no]],
universal=$enableval, universal=no)
case $host in
*darwin*)
AP_NATIVE_ARCH=`arch`
AP_64_ARCH="x86_64"
case $AP_NATIVE_ARCH in
ppc*)
AP_CROSS_ARCH="i386"
;;
*)
AP_CROSS_ARCH="ppc"
;;
esac
AC_SUBST(AP_CROSS_ARCH)
AC_SUBST(AP_NATIVE_ARCH)
AC_SUBST(AP_64_ARCH)
HAVE_DARWIN_PLATFORM="true"
AC_SUBST(HAVE_DARWIN_PLATFORM)
AC_MSG_CHECKING([if we are os/x universal])
if test "$universal" = "yes" ; then
AC_MSG_RESULT([building for $AP_NATIVE_ARCH, $AP_CROSS_ARCH, and $AP_64_ARCH])
UNIVERSAL_FLAGS="-arch $AP_NATIVE_ARCH -arch $AP_CROSS_ARCH -arch $AP_64_ARCH"
AC_SUBST(UNIVERSAL_FLAGS)
fi
AC_MSG_RESULT([no])
;;
*)
universal="no"
HAVE_DARWIN_PLATFORM="false"
;;
esac
AC_SUBST(universal)
AC_CONFIG_SRCDIR(src/parsley.cpp)
AC_CONFIG_HEADER(src/config.h)
AM_PROG_CC_C_O
AC_PROG_CXX
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
fi
AC_PROG_OBJC
# Thanks automake; we MUST invoke AC_PROG_OBJCXX even though
# we roll our own objc++ build support, because automake 1.12.1
# throws a fatal error when it finds our .mm sources.
# We do this because there is no good reason to bump the minimum
# autoconf and automake dependencies.
m4_ifdef([AC_PROG_OBJCXX], [
AC_PROG_OBJCXX
])
AC_C_BIGENDIAN
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([\
fcntl.h \
inttypes.h \
io.h \
getopt.h \
linux/cdrom.h \
math.h \
signal.h \
stddef.h \
stdint.h \
stdio.h \
stdlib.h \
string.h \
sys/ioctl.h \
sys/param.h \
sys/mount.h \
sys/stat.h \
sys/types.h \
sys/time.h \
time.h \
errno.h \
zlib.h \
linux/cdrom.h \
unistd.h \
wchar.h \
windows.h \
])
AC_CHECK_HEADERS(getopt.h, [HAVE_GETOPT_H=1; AC_SUBST(HAVE_GETOPT_H)])
AC_C_CONST
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINTMAX_T
AC_TYPE_UINTPTR_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT16_T
AC_CHECK_FUNCS([\
fseeko \
fsetpos \
lroundf \
memset \
memcmp \
remove \
rename \
sranddev \
sscanf \
strdup \
strerror \
strftime \
strncmp \
strncasecmp \
strrchr \
strsep \
strstr \
strtol \
wmemset \
])
AC_FUNC_MALLOC
AC_CHECK_LIB(z, deflateEnd, [
HAVE_LIBZ=1
AC_SUBST(HAVE_LIBZ)
LIBS="$LIBS -lz"
],[
AC_MSG_ERROR([zlib is required])
]
)
CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
AC_ARG_ENABLE(debug, dnl
[ --disable-debug do not build a debug version [default=yes]],
debug=$enableval, debug=no)
if test "$debug" = "yes" ; then
AC_DEFINE_UNQUOTED(DEBUG, $debug, [build binary with debug output])
AC_SUBST(debug)
fi
AM_CONDITIONAL([NEED_GETOPT], [test x$HAVE_GETOPT_H = x])
AM_CONDITIONAL([DARWIN], [test x$HAVE_DARWIN_PLATFORM = xtrue])
AM_CONDITIONAL([UNIVERSAL], [test x$universal = xyes])
AC_OUTPUT([Makefile])
echo "+----------------------------------------------+"
echo "| SUCCESS |"
echo "+----------------------------------------------+"
echo " AtomicParsley has been configured, you should"
echo " now type 'make' to compile AtomicParsley."
echo
echo "+----------------------------------------------+"
echo "| YOUR CONFIGURATION |"
echo "+----------------------------------------------+"
echo " Version: $PACKAGE_VERSION"
if test "$universal" = "yes" ; then
echo " universal build: enabled"
fi
if test "$debug" = "no" ; then
echo " debug build: disabled"
else
echo " debug build: enabled"
fi
echo