summaryrefslogtreecommitdiff
path: root/impl/antlr/libantlr3c-3.4/configure.ac
blob: b3d9c3a838252a39c731adfb278887eed30032c8 (about) (plain)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT(libantlr3c, 3.4, jimi@temporal-wave.com)
AC_PREREQ(2.60)
AC_COPYRIGHT([
 (The "BSD licence")
 Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
 http://www.temporal-wave.com
 http://www.linkedin.com/in/jimidle
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 3. The name of the author may not be used to endorse or promote products
    derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
])
AC_CONFIG_SRCDIR(src/antlr3parser.c)


AC_ARG_ENABLE([debuginfo],
		[AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into the library (default --disable-debuginfo)])],
		[], [enable_debuginfo=no])

AC_ARG_ENABLE([64bit],
		[AS_HELP_STRING([--enable-64bit], [Turns on flags that produce 64 bit object code if any are required (default --disable-64bit)])],
		[], [enable_64bit=no])

AC_ARG_ENABLE([abiflags],
		[AS_HELP_STRING([--disable-abiflags], [Does not add ABI flags -m32 or -m64 for older versions of gcc, such as itanium 3.x (default --enable-abiflags=yes)])],
		[], [enable_abiflags=yes])

AC_ARG_ENABLE([antlrdebug],
		[AS_HELP_STRING([--disable-antlrdebug], [Turns off default flags that include the antlr debugger in the runtime. Specify to remove debugger and the socket dependancies (default --enable-antlrdebug)])],
		[], [enable_antlrdebug=yes])

AM_INIT_AUTOMAKE(foreign)
AC_LANG(C)
AC_PROG_CC([xlc aCC gcc cc])
AM_MAINTAINER_MODE
AM_PROG_LIBTOOL

AC_CANONICAL_BUILD
AC_CANONICAL_HOST

OBJECT_MODE=
# Checks for programs.
AC_MSG_CHECKING([compiler flags required for compiling ANTLR with $CC C compiler on host $host])
WARNFLAGS=
case $CC in
xlc*)
 CPPCMNTFLAGS="-qcpluscmt"
 if test x"$enable_64bit" = xyes; then
  CCFLAGS64="-q64 -Wl,-b64"
  OBJECT_MODE="64"
 else
  OBJECT_MODE="32"
 fi
 OPTIMFLAGS="-O2"
 if test x"$enable_debuginfo" = xyes; then
  DEBUGFLAGS="-g"
 fi
 ;;

aCC*)
 CPPCMNTFLAGS=
 if test x"$enable_64bit" = xyes; then
  CCFLAGS64="+DD64"
 fi
 OPTIMFLAGS="-O"
 if test $DEBUGINF = 1; then
  DEBUGFLAGS="-g"
 fi
 ;;

gcc*)
 CPPCMNTFLAGS=
 if test x"$enable_64bit" = xyes; then
  GCCABIFLAGS="-m64"
 else
  GCCABIFLAGS="-m32"
 fi
 if test x"$enable_abiflags" = xyes; then
  CCFLAGS64=$GCCABIFLAGS
 fi
 OPTIMFLAGS="-O2"
 if test x"$enable_debuginfo" = xyes; then
  DEBUGFLAGS="-g"
 fi
 WARNFLAGS=-Wall
 ;;

*)

case $host in
sparc*-*solaris*)
 CPPCMNTFLAGS=
 if test x"$enable_64bit" = xyes; then
  CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis"
 fi
 OPTIMFLAGS="-O"
 if test x"$enable_debuginfo" = xyes; then
  DEBUGFLAGS='-g'
 fi
 ;;

*)
 CPPCMNTFLAGS=
 CCFLAGS64=
 OPTIMFLAGS="-O"
 if test x"$enable_debuginfo" = xyes; then
  DEBUGFLAGS='-g'
 fi
 ;;
esac

 ;;
esac

CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS"
AC_MSG_RESULT([$CFLAGS])
AC_SUBST([OBJECT_MODE])

AS_IF([test "x$enable_antlrdebug" = xno], [AC_DEFINE([ANTLR3_NODEBUGGER], [1], [Define if ANTLR debugger not required])], [])
AS_IF([test x"$enable_64bit" = xyes], [AC_DEFINE([ANTLR3_USE_64BIT], [1], [Define if 64 bit mode required])], [])

AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

# Checks for libraries.

# Checks for header files.
AC_INCLUDES_DEFAULT()
AC_HEADER_RESOLV
AC_CHECK_HEADERS([sys/malloc.h malloc.h], [], [],
[[#ifdef HAVE_SYS_MALLOC_H
#include <sys/malloc.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
]])
AC_CHECK_HEADERS([stdarg.h], [], [],
[[#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
]])

AC_CHECK_HEADERS([sys/stat.h], [], [],
[[#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
]])

AC_CHECK_HEADERS([ctype.h], [], [],
[[#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
]])

AC_CHECK_HEADERS([netinet/tcp.h], [], [],
[[#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
]])

AC_CHECK_HEADERS([sys/socket.h socket.h], [], [],
[[#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SOCKET_H
#include <socket.h>
#endif
]])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INTPTR_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINTPTR_T
AC_C_INLINE


# Checks for library functions.
AC_CHECK_FUNCS([memmove memset strdup accept])

AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS(antlr3config.h)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT