]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/libantlr3c-3.2/configure.ac
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / libantlr3c-3.2 / configure.ac
1 #                                               -*- Autoconf -*-\r
2 # Process this file with autoconf to produce a configure script.\r
3 \r
4 AC_INIT(libantlr3c, 3.2, jimi@temporal-wave.com)\r
5 AC_PREREQ(2.60)\r
6 AC_COPYRIGHT([\r
7  (The "BSD licence")\r
8  Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC\r
9  http://www.temporal-wave.com\r
10  http://www.linkedin.com/in/jimidle\r
11  All rights reserved.\r
12 \r
13  Redistribution and use in source and binary forms, with or without\r
14  modification, are permitted provided that the following conditions\r
15  are met:\r
16  1. Redistributions of source code must retain the above copyright\r
17     notice, this list of conditions and the following disclaimer.\r
18  2. Redistributions in binary form must reproduce the above copyright\r
19     notice, this list of conditions and the following disclaimer in the\r
20     documentation and/or other materials provided with the distribution.\r
21  3. The name of the author may not be used to endorse or promote products\r
22     derived from this software without specific prior written permission.\r
23 \r
24  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
25  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
26  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
27  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
28  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
29  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
30  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
31  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
32  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
33  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
34 ])\r
35 AC_CONFIG_SRCDIR(src/antlr3parser.c)\r
36 \r
37 \r
38 AC_ARG_ENABLE([debuginfo],\r
39                 [AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into the library (default --disable-debuginfo)])],\r
40                 [], [enable_debuginfo=no])\r
41 \r
42 AC_ARG_ENABLE([64bit],\r
43                 [AS_HELP_STRING([--enable-64bit], [Turns on flags that produce 64 bit object code if any are required (default --disable-64bit)])],\r
44                 [], [enable_64bit=no])\r
45 \r
46 AC_ARG_ENABLE([abiflags],\r
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)])],\r
48                 [], [enable_abiflags=yes])\r
49 \r
50 AC_ARG_ENABLE([antlrdebug],\r
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)])],\r
52                 [], [enable_antlrdebug=yes])\r
53 \r
54 AM_INIT_AUTOMAKE(foreign)\r
55 AC_LANG(C)\r
56 AC_PROG_CC([xlc aCC gcc cc])\r
57 AM_MAINTAINER_MODE\r
58 AM_PROG_LIBTOOL\r
59 \r
60 AC_CANONICAL_BUILD\r
61 AC_CANONICAL_HOST\r
62 \r
63 OBJECT_MODE=\r
64 # Checks for programs.\r
65 AC_MSG_CHECKING([compiler flags required for compiling ANTLR with $CC C compiler on host $host])\r
66 WARNFLAGS=\r
67 case $CC in\r
68 xlc*)\r
69  CPPCMNTFLAGS="-qcpluscmt"\r
70  if test x"$enable_64bit" = xyes; then\r
71   CCFLAGS64="-q64 -Wl,-b64"\r
72   OBJECT_MODE="64"\r
73  else\r
74   OBJECT_MODE="32"\r
75  fi\r
76  OPTIMFLAGS="-O2"\r
77  if test x"$enable_debuginfo" = xyes; then\r
78   DEBUGFLAGS="-g"\r
79  fi\r
80  ;;\r
81 \r
82 aCC*)\r
83  CPPCMNTFLAGS=\r
84  if test x"$enable_64bit" = xyes; then\r
85   CCFLAGS64="+DD64"\r
86  fi\r
87  OPTIMFLAGS="-O"\r
88  if test $DEBUGINF = 1; then\r
89   DEBUGFLAGS="-g"\r
90  fi\r
91  ;;\r
92 \r
93 gcc*)\r
94  CPPCMNTFLAGS=\r
95  if test x"$enable_64bit" = xyes; then\r
96   GCCABIFLAGS="-m64"\r
97  else\r
98   GCCABIFLAGS="-m32"\r
99  fi\r
100  if test x"$enable_abiflags" = xyes; then\r
101   CCFLAGS64=$GCCABIFLAGS\r
102  fi\r
103  OPTIMFLAGS="-O2"\r
104  if test x"$enable_debuginfo" = xyes; then\r
105   DEBUGFLAGS="-g"\r
106  fi\r
107  WARNFLAGS=-Wall\r
108  ;;\r
109 \r
110 *)\r
111 \r
112 case $host in\r
113 sparc*-*solaris*)\r
114  CPPCMNTFLAGS=\r
115  if test x"$enable_64bit" = xyes; then\r
116   CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis"\r
117  fi\r
118  OPTIMFLAGS="-O"\r
119  if test x"$enable_debuginfo" = xyes; then\r
120   DEBUGFLAGS='-g'\r
121  fi\r
122  ;;\r
123 \r
124 *)\r
125  CPPCMNTFLAGS=\r
126  CCFLAGS64=\r
127  OPTIMFLAGS="-O"\r
128  if test x"$enable_debuginfo" = xyes; then\r
129   DEBUGFLAGS='-g'\r
130  fi\r
131  ;;\r
132 esac\r
133 \r
134  ;;\r
135 esac\r
136 \r
137 CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS"\r
138 AC_MSG_RESULT([$CFLAGS])\r
139 AC_SUBST([OBJECT_MODE])\r
140 \r
141 AS_IF([test "x$enable_antlrdebug" = xno], [AC_DEFINE([ANTLR3_NODEBUGGER], [1], [Define if ANTLR debugger not required])], [])\r
142 AS_IF([test x"$enable_64bit" = xyes], [AC_DEFINE([ANTLR3_USE_64BIT], [1], [Define if 64 bit mode required])], [])\r
143 \r
144 AC_PROG_INSTALL\r
145 AC_PROG_LN_S\r
146 AC_PROG_MAKE_SET\r
147 \r
148 # Checks for libraries.\r
149 \r
150 # Checks for header files.\r
151 AC_INCLUDES_DEFAULT()\r
152 AC_HEADER_RESOLV\r
153 AC_CHECK_HEADERS([sys/malloc.h malloc.h], [], [],\r
154 [[#ifdef HAVE_SYS_MALLOC_H\r
155 #include <sys/malloc.h>\r
156 #endif\r
157 #ifdef HAVE_MALLOC_H\r
158 #include <malloc.h>\r
159 #endif\r
160 ]])\r
161 AC_CHECK_HEADERS([stdarg.h], [], [],\r
162 [[#ifdef HAVE_STDARG_H\r
163 #include <stdarg.h>\r
164 #endif\r
165 ]])\r
166 \r
167 AC_CHECK_HEADERS([sys/stat.h], [], [],\r
168 [[#ifdef HAVE_SYS_STAT_H\r
169 #include <sys/stat.h>\r
170 #endif\r
171 ]])\r
172 \r
173 AC_CHECK_HEADERS([ctype.h], [], [],\r
174 [[#ifdef HAVE_CTYPE_H\r
175 #include <ctype.h>\r
176 #endif\r
177 ]])\r
178 \r
179 AC_CHECK_HEADERS([netinet/tcp.h], [], [],\r
180 [[#ifdef HAVE_NETINET_TCP_H\r
181 #include <netinet/tcp.h>\r
182 #endif\r
183 ]])\r
184 \r
185 AC_CHECK_HEADERS([sys/socket.h socket.h], [], [],\r
186 [[#ifdef HAVE_SYS_SOCKET_H\r
187 #include <sys/socket.h>\r
188 #endif\r
189 #ifdef HAVE_SOCKET_H\r
190 #include <socket.h>\r
191 #endif\r
192 ]])\r
193 \r
194 # Checks for typedefs, structures, and compiler characteristics.\r
195 AC_C_CONST\r
196 AC_TYPE_SIZE_T\r
197 AC_TYPE_INT8_T\r
198 AC_TYPE_INT16_T\r
199 AC_TYPE_INT32_T\r
200 AC_TYPE_INT64_T\r
201 AC_TYPE_INTPTR_T\r
202 AC_TYPE_UINT8_T\r
203 AC_TYPE_UINT16_T\r
204 AC_TYPE_UINT32_T\r
205 AC_TYPE_UINT64_T\r
206 AC_TYPE_UINTPTR_T\r
207 AC_C_INLINE\r
208 \r
209 \r
210 # Checks for library functions.\r
211 AC_CHECK_FUNCS([memmove memset strdup accept])\r
212 \r
213 AC_CONFIG_MACRO_DIR([m4])\r
214 \r
215 AC_CONFIG_HEADERS(antlr3config.h)\r
216 AC_CONFIG_FILES([Makefile])\r
217 AC_OUTPUT\r