-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
184 lines (167 loc) · 4.93 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
dnl Process this file with autoconf to produce a configure script
AC_INIT(eposix, 3.2.1)
AC_CONFIG_SRCDIR(src/supportc/c_support.c)
AC_CONFIG_AUX_DIR(config)
AC_DISABLE_SHARED
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(src/supportc/config.h)
AC_CONFIG_MACRO_DIR([m4])
#
# Checks for programs.
#
AC_PROG_INSTALL
AC_PROG_CC
AC_C_CONST
AC_PROG_LIBTOOL
# check for eposix variable, should point to this directory
if test "x$EPOSIX" = "x"; then
AC_MSG_ERROR(The EPOSIX environment variable is undefined)
fi
if test "$EPOSIX/configure" != "`pwd`/configure"; then
EXPECTED_DIR=`pwd`
AC_MSG_ERROR(The EPOSIX environment variable does not point to the directory from which you run configure (expected $EXPECTED_DIR, but got $EPOSIX))
fi
# We need Gobo as well.
AC_PROG_GOBO
# Optional OS flag
AC_ARG_WITH(os,
[ --with-os=os What OS specific APIs do you want use? linux (lowercase!)],
EPOSIX_OS=$withval, EPOSIX_OS=)
# Depending on OS, we set conditionals to link in OS specific code
AM_CONDITIONAL(LINUX, test "x$EPOSIX_OS" = "xlinux")
# Optional multi-threaded flag
# --enable-multi-thread
AC_ARG_ENABLE(threads,
AC_HELP_STRING([--enable-threads],[enable multi-threading
(default=no)]),
[ multithread="${enableval}" ], [ multithread=no ] )
AC_SUBST(OPTIONAL_MULTITHREAD_FLAG)
if test "x$multithread" = "xyes"
then
# Only support ISE here...
OPTIONAL_MULTITHREAD_FLAG="-DEIF_THREADS -DEIF_POSIX_THREADS"
fi
AM_CONDITIONAL(THREADS, test "x$multithread" = "xyes")
#
# Checks for libraries.
#
#
# Checks for header files.
#
# If a test is commented out this means autoscan has detected it,
# but I've not written a test/workaround for it.
# And even if it isn't commented out, I might not have written a
# test/workaround. Systems that don't have this really standard stuff
# are getting rare I assume.
# src/capi
AC_HEADER_STDC
AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h])
# src/papi
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
# Not everyone seems to have semaphore.h
AC_CHECK_HEADERS([fcntl.h limits.h locale.h semaphore.h termios.h unistd.h utime.h])
# src/sapi
# sys/un.h is for BeOS, check for Unix socket support
# netinet/ip.h isn't in susv3 but still useful
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h netinet/in_systm.h netinet/ip.h stdlib.h sys/select.h sys/socket.h sys/time.h sys/un.h syslog.h unistd.h stropts.h sys/ioctl.h])
#
# Checks for typedefs, structures, and compiler characteristics.
#
# src/capi
AC_STRUCT_TM
# src/papi
AC_TYPE_UID_T
AC_C_VOLATILE
# src/sapi
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_CHECK_MEMBERS([struct timespec.tv_nsec])
AC_STRUCT_ST_BLOCKS
AC_HEADER_TIME
#
# Check for struct ip_mreqn
#
AC_MSG_CHECKING(for struct ip_mreqn)
AC_TRY_COMPILE([#include <netinet/in.h>], [
struct ip_mreqn mreq;
mreq.imr_address.s_addr = 0;
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
], [
# We'll just have to try and use struct ip_mreq
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for struct ip_mreq)
AC_TRY_COMPILE([#include <netinet/in.h>], [
struct ip_mreq mreq;
mreq.imr_interface.s_addr = 0;
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
], [
# No multicast support
AC_MSG_ERROR([No multicast support])
])
])
#
# Checks for library functions.
#
# if a test is commented out this means autoscan has detected it,
# but I've not written a test/workaround for it.
# src/capi
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([atexit localeconv memmove memset setlocale strerror])
# src/papi
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
#AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_GETPGRP
AC_FUNC_MMAP
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([aio_fsync alarm dup2 fdatasync getcwd mkdir mkfifo munmap pathconf rmdir uname utime])
# src/sapi
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
# getservbyport not available on BeOS?
# configure for clock_getres clock_gettime clock_settime on Linux fails
# seems I have to set _POSIX_SOURCE or so before I see them.
AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname gethostname getservbyport gettimeofday inet_ntoa memmove putenv realpath socket usleep])
#
# Automake
#
AC_OUTPUT( \
Makefile
doc/Makefile \
ise_precompile/Makefile \
src/Makefile \
src/supportc/Makefile \
src/capi/Makefile \
src/standardc/Makefile \
src/epxc/Makefile \
src/epxc/imap4/Makefile \
src/epxc/ldap/Makefile \
src/epxc/mime/Makefile \
src/papi/Makefile \
src/posix/Makefile \
src/sapi/Makefile \
src/sus/Makefile \
src/wapi/Makefile \
src/windows/Makefile \
src/epxw/Makefile \
src/spec/Makefile \
src/spec/lapi/Makefile \
test_suite/Makefile)
# Final output
AC_MSG_RESULT([Eiffel vendor : $GOBO_EIFFEL])
AC_MSG_RESULT([Eiffel compiler : $EC])
AC_MSG_RESULT([multi-threading support : $multithread])