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
|
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
|
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
|
AC_INIT(objfw, 0.1, js@webkeks.org)
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_OBJC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_EGREP
CFLAGS="$CFLAGS -Wall"
OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
LIBS="$LIBS -lobjc"
AX_CHECK_COMPILER_FLAGS(-pipe, [
AX_CHECK_COMPILER_FLAGS(-pipe, [CFLAGS="$CFLAGS -pipe"])
CFLAGS="$CFLAGS -pipe"
OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [
AX_CHECK_COMPILER_FLAGS(-fno-common, [CFLAGS="$CFLAGS -fno-common"])
CFLAGS="$CFLAGS -fno-common"
OBJCFLAGS="$OBJCFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings,
[OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])
AC_DEFINE(OF_CONFIG_H, 1, [Define so that we know we got our config.h])
BUILDSYS_LIB
AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins])
if test x"$PLUGIN_SUFFIX" != "x"; then
AC_SUBST(OFPLUGIN_M, "OFPlugin.m")
AC_SUBST(OFPLUGIN, "OFPlugin")
fi
AC_C_BIGENDIAN([AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])])
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-
-
-
|
size_max="SIZE_T_MAX"], [
AC_MSG_RESULT(no)
size_max="((size_t)-1)"])
AC_DEFINE_UNQUOTED(SIZE_MAX, $size_max, [Maximum value for size_t])])
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
AC_CHECK_HEADER(objc/runtime.h,
[AC_DEFINE(HAVE_OBJC_RUNTIME_H, 1, [Whether we have objc/runtime.h])])
AC_CHECK_FUNC(asprintf, [
have_asprintf="yes"
AC_DEFINE(HAVE_ASPRINTF, 1, "Whether we have asprintf")], [
have_asprintf="no"
AC_SUBST(ASPRINTF_C, "asprintf.c")])
AC_MSG_CHECKING(whether snprintf returns something useful)
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
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
|
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
ac_cv_have_ipv6="no")])
AC_MSG_RESULT($ac_cv_have_ipv6)
test x"$ac_cv_have_ipv6" = x"yes" && \
AC_DEFINE(HAVE_IPV6, 1, "Whether we have IPv6 support")
AC_CHECK_HEADERS(sys/mman.h)
AC_LANG([Objective C])
AC_PROG_OBJC
if test x"$GCC" = x"yes"; then
CFLAGS="$CFLAGS -Werror"
OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
LIBS="$LIBS -lobjc"
AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings,
[OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])
AC_CHECK_HEADER(objc/runtime.h,
[AC_DEFINE(HAVE_OBJC_RUNTIME_H, 1, [Whether we have objc/runtime.h])])
test x"$GCC" = x"yes" && CFLAGS="$CFLAGS -Werror"
if test x"$GOBJC" = x"yes"; then
old_OBJCFLAGS="$OBJCFLAGS"
OBJCFLAGS="$OBJCFLAGS -Werror"
AC_MSG_CHECKING(whether gcc has bug objc/27438)
AC_TRY_COMPILE([
#import <objc/objc.h>
@interface OFConstString
{
Class isa;
const char *string;
unsigned long size;
}
@end
void *_OFConstStringClassReference;
], [
OFConstString *test = @"";
test++; /* Get rid of unused variable warning */
], [AC_MSG_RESULT(no)], [
AC_MSG_RESULT([yes, disabling -Werror])
OBJCFLAGS="$old_OBJCFLAGS"])
fi
if test x"$cross_compiling" = x"yes"; then
case "$host" in
*-*-mingw*)
AC_PATH_PROG(WINE, wine)
|