2 # Process this file with autoconf to produce a configure script.
4 AC_INIT(libantlr3c, 3.2, jimi@temporal-wave.com)
8 Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
9 http://www.temporal-wave.com
10 http://www.linkedin.com/in/jimidle
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
18 2. Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in the
20 documentation and/or other materials provided with the distribution.
21 3. The name of the author may not be used to endorse or promote products
22 derived from this software without specific prior written permission.
24 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 AC_CONFIG_SRCDIR(src/antlr3parser.c)
38 AC_ARG_ENABLE([debuginfo],
39 [AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into the library (default --disable-debuginfo)])],
40 [], [enable_debuginfo=no])
42 AC_ARG_ENABLE([64bit],
43 [AS_HELP_STRING([--enable-64bit], [Turns on flags that produce 64 bit object code if any are required (default --disable-64bit)])],
44 [], [enable_64bit=no])
46 AC_ARG_ENABLE([abiflags],
47 [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)])],
48 [], [enable_abiflags=yes])
50 AC_ARG_ENABLE([antlrdebug],
51 [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)])],
52 [], [enable_antlrdebug=yes])
54 AM_INIT_AUTOMAKE(foreign)
56 AC_PROG_CC([xlc aCC gcc cc])
64 # Checks for programs.
65 AC_MSG_CHECKING([compiler flags required for compiling ANTLR with $CC C compiler on host $host])
69 CPPCMNTFLAGS="-qcpluscmt"
70 if test x"$enable_64bit" = xyes; then
71 CCFLAGS64="-q64 -Wl,-b64"
77 if test x"$enable_debuginfo" = xyes; then
84 if test x"$enable_64bit" = xyes; then
88 if test $DEBUGINF = 1; then
95 if test x"$enable_64bit" = xyes; then
100 if test x"$enable_abiflags" = xyes; then
101 CCFLAGS64=$GCCABIFLAGS
104 if test x"$enable_debuginfo" = xyes; then
115 if test x"$enable_64bit" = xyes; then
116 CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis"
119 if test x"$enable_debuginfo" = xyes; then
128 if test x"$enable_debuginfo" = xyes; then
137 CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS"
138 AC_MSG_RESULT([$CFLAGS])
139 AC_SUBST([OBJECT_MODE])
141 AS_IF([test "x$enable_antlrdebug" = xno], [AC_DEFINE([ANTLR3_NODEBUGGER], [1], [Define if ANTLR debugger not required])], [])
142 AS_IF([test x"$enable_64bit" = xyes], [AC_DEFINE([ANTLR3_USE_64BIT], [1], [Define if 64 bit mode required])], [])
148 # Checks for libraries.
150 # Checks for header files.
151 AC_INCLUDES_DEFAULT()
153 AC_CHECK_HEADERS([sys/malloc.h malloc.h], [], [],
154 [[#ifdef HAVE_SYS_MALLOC_H
155 #include <sys/malloc.h>
161 AC_CHECK_HEADERS([stdarg.h], [], [],
162 [[#ifdef HAVE_STDARG_H
167 AC_CHECK_HEADERS([sys/stat.h], [], [],
168 [[#ifdef HAVE_SYS_STAT_H
169 #include <sys/stat.h>
173 AC_CHECK_HEADERS([ctype.h], [], [],
174 [[#ifdef HAVE_CTYPE_H
179 AC_CHECK_HEADERS([netinet/tcp.h], [], [],
180 [[#ifdef HAVE_NETINET_TCP_H
181 #include <netinet/tcp.h>
185 AC_CHECK_HEADERS([sys/socket.h socket.h], [], [],
186 [[#ifdef HAVE_SYS_SOCKET_H
187 #include <sys/socket.h>
194 # Checks for typedefs, structures, and compiler characteristics.
210 # Checks for library functions.
211 AC_CHECK_FUNCS([memmove memset strdup accept])
213 AC_CONFIG_MACRO_DIR([m4])
215 AC_CONFIG_HEADERS(antlr3config.h)
216 AC_CONFIG_FILES([Makefile])