source: vis_dev/vl2mv-2.3/configure.in @ 54

Last change on this file since 54 was 18, checked in by cecile, 13 years ago

vl2mv added

  • Property svn:executable set to *
File size: 9.9 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.11)
3AC_INIT(src/parser/main.c)
4
5# Look for install.sh, config.guess, and config.sub in the "helpers" dir
6AC_CONFIG_AUX_DIR(helpers)
7
8#----------------------------------------------------------------------
9# Configuration options
10#----------------------------------------------------------------------
11
12# Give the configurer a chance to set the location of the GLU tree
13
14AC_SUBST(glulibdir)
15AC_ARG_WITH(glu-libdir,
16[  --with-glu-libdir=<libdir> Specify directories to search for the GLU library.                          Expects to find <libdir>/libglu.a],
17[glulibdir=$withval], [glulibdir=""])
18
19AC_SUBST(gluincdir)
20AC_ARG_WITH(glu-incdir,
21[  --with-glu-incdir=<incdir> Specify directories to search for the GLU headers],
22[gluincdir=$withval], [gluincdir=""])
23
24# Give the configurer a chance to set a different location for the VIS
25# headers and library
26
27AC_SUBST(vl2mvlibdir)
28AC_ARG_WITH(vl2mv-libdir,
29[  --with-vl2mv-libdir=<libdir> Specify directories to search for the vl2mv
30                          library and headers.  Defaults to \".\".
31                          Expects to find <libdir>/libvl2mv.a],
32[vl2mvlibdir=$withval],
33[vl2mvlibdir="."])
34
35# Give the configurer a chance to set a different location for the vl2mv
36# source.  When specified, "srcdir" points to "master" source, and
37# "local_srcdir" points to the source under local development.
38
39AC_SUBST(local_srcdir)
40AC_ARG_WITH(local-srcdir,
41[  --with-local-srcdir=<srcdir> Specify the root directory to search for
42                          source for packages (the PKGS list).
43                          Expects to find, e.g., <srcdir>/parser/main.c],
44[local_srcdir=$withval],
45[local_srcdir=$srcdir])
46
47dnl Checks for programs.
48
49#----------------------------------------------------------------------
50# Checks for programs we need
51#----------------------------------------------------------------------
52
53AC_PATH_PROG(AR, ar, ar)
54AC_PROG_RANLIB
55AC_PROG_AWK
56AC_PATH_PROG(SED, sed, sed)
57
58AC_CANONICAL_SYSTEM
59AC_SUBST(target)
60
61# Balakrisha Kumthekar (kumtheka@colorado.edu): making a special case
62# for ultrix install, since its annoying about setting groupids.
63case "$target" in
64  mips-dec-ultrix*)
65    INSTALL="helpers/install-sh -c"
66    INSTALL_PROGRAM="\${INSTALL}"
67    INSTALL_DATA="\${INSTALL} -m 644";;
68
69  *)
70  AC_PROG_INSTALL ;;
71esac
72
73# Determine the name of the C compiler we're going to use
74
75AC_ARG_ENABLE(gcc,
76  [  --enable-gcc            Allow use of gcc if available],
77  [gcc_ok=$enableval], [gcc_ok=no])
78
79if test "$gcc_ok" != no; then
80  case "$gcc_ok" in
81    yes)
82      CC=gcc ;;
83    *)
84      CC=$gcc_ok
85  esac
86else
87# Balakrishna Kumthekar <kumtheka@colorado.edu>
88# As we do not support cc on RS6000, Cygwin and SunOS.
89   case "$target" in
90     rs6000-ibm-aix* | *-pc-cygwin32 | sparc-sun-sunos*)
91       CC=gcc ;;
92     *)
93       CC=cc ;;
94   esac
95fi
96
97AC_PROG_CC
98
99AC_ARG_ENABLE(64,
100  [  --enable-64             Use 64-bit pointers on 64-bit Alpha machines],
101  [use_sixty_four=$enableval], [use_sixty_four=no])
102
103if test "$gcc_ok" != no; then
104  use_sixty_four=yes
105fi
106
107
108# Determine the compiler flags to use
109
110DEBUG_CFLAGS="-g"
111DEBUG_LDFLAGS=""
112
113case "$target" in
114
115  sparc-sun-solaris* | i386-pc-solaris*)
116        # Sparc and X86 Solaris:
117        # -xO3: Highest safe level of optimization
118        # -native: Optimize for the native processor (if supported)
119        # -dalign: Generate double-word load/store for performance
120        #          (only for SPARC)
121        # and other arcane compilation flags.
122        if test "$GCC" = yes; then
123          OPTIMIZE_CFLAGS="-O"
124        else
125          case "$target" in
126            sparc-sun-solaris*)
127              ALIGN=" -dalign" ;;
128            *)
129              ALIGN="" ;;
130          esac
131          AC_MSG_CHECKING([for -native])
132          CFLAGS="-xO3 -native$ALIGN"
133          AC_CACHE_VAL(ac_cv_have_native,
134          [ AC_TRY_RUN([
135          main(){exit(0);}
136          ],ac_cv_have_native=yes,ac_cv_have_native=no,ac_cv_have_native=no)])
137          if test $ac_cv_have_native = yes ; then
138            AC_MSG_RESULT(working)
139            OPTIMIZE_CFLAGS="-xO3 -native$ALIGN"
140          else
141            AC_MSG_RESULT(broken)
142            AC_MSG_CHECKING([for fallback optimization flags])
143            CFLAGS="-xO3 -fns -fsimple=2$ALIGN -ftrap=%none -xlibmil"
144            AC_CACHE_VAL(ac_cv_have_fallback,
145            [ AC_TRY_RUN([
146            main(){exit(0);}
147            ],ac_cv_have_fallback=yes,ac_cv_have_fallback=no,ac_cv_have_fallback=no)])
148            if test $ac_cv_have_fallback = yes ; then
149              AC_MSG_RESULT(working)
150              OPTIMIZE_CFLAGS="-xO3 -fns -fsimple=2$ALIGN -ftrap=%none -xlibmil"
151            else
152              AC_MSG_RESULT(broken)
153              OPTIMIZE_CFLAGS="-O"
154            fi
155          fi
156        fi
157        ;;
158
159  mips-dec-ultrix*)
160        # MIPS-based DECstations running Ultrix:
161        # -std1: Produce non-ANSI code warnings, and define __STDC__
162        # -O: Use the global "ucode" optimizer
163        # -Olimit 5000: Don't optimize routines bigger than 5000 basic blocks
164        OPTIMIZE_CFLAGS="-std1 -O -Olimit 5000" ;;
165
166  alpha-dec-osf*)
167        # DEC Alpha running OSF:
168
169        # 64-bit mode:
170        # -g3: Produce symbol table information for optimized code
171        # -O4: Enable every optimization
172        # -std: Enforce the ANSI standard with extensions, define __STDC__
173        # -ieee_with_no_inexact: Disable (potentially slow) signaling
174        #   for inexact floating-point results
175        # -tune host: Tune instructions for the compilation host machine
176
177        OPTIMIZE_CFLAGS="-g3 -O4 -std -ieee_with_no_inexact -tune host"
178        DEBUG_CFLAGS="-g -std -ieee_with_no_inexact"
179
180        # -non_shared: Do not use shared libraries
181        # -om: Generate an OMAGIC file for the om optimizer
182        OPTIMIZE_LDFLAGS="-non_shared"
183
184        if test "$use_sixty_four" = "no"; then
185          # 32-bit mode:
186          # -xtaso: Make the compiler respond to #pragma pointer_size directives
187          OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -xtaso"
188          DEBUG_CFLAGS="$DEBUG_CFLAGS -xtaso"
189
190          # -taso: Load the executable into the lower 31-bit address space
191          OPTIMIZE_LDFLAGS="$OPTIMIZE_LDFLAGS -om -taso"
192          DEBUG_LDFLAGS="$DEBUG_LDFLAGS -taso"
193
194          AC_DEFINE(SIZEOF_VOID_P, 4)
195          ac_sizeof_voidp=4
196        fi
197        ;;
198
199  hppa*-*-hpux*)
200        # HP running HPUX
201        # -Aa: Behave as an ANSI compiler
202        # -D_HPUX_SOURCE: Include "HP-specific" symbols in the header
203        #   files (e.g., this means sys/resource.h has struct rusage)
204        OPTIMIZE_CFLAGS="-O -Aa -D_HPUX_SOURCE"
205        DEBUG_CFLAGS="-g -Aa -D_HPUX_SOURCE" ;;
206
207     *)
208        # Other systems:
209        OPTIMIZE_CFLAGS="-O" ;;
210
211esac
212
213if test "$GCC" = yes; then
214  case "$target" in
215    i686-pc-linux-gnu | i386-pc-solaris* | i386-pc-cygwin32)
216      AC_MSG_CHECKING([for -mcpu and -malign compiler options])
217      CFLAGS="-g -O6 -mcpu=pentiumpro -malign-double"
218      AC_TRY_COMPILE(,,ac_have_mcpu=yes,ac_have_mcpu=no)
219      if test "$ac_have_mcpu" = yes; then
220        AC_MSG_RESULT(working)
221        OPTIMIZE_CFLAGS="-g -O6 -mcpu=pentiumpro -malign-double"
222      else
223        AC_MSG_RESULT(broken)
224        OPTIMIZE_CFLAGS="-g -O3"
225      fi
226      ;;
227    sparc-sun-solaris*)
228      AC_MSG_CHECKING([for -mtune compiler option])
229      CFLAGS="-g -O6 -mtune=ultrasparc"
230      AC_TRY_COMPILE(,,ac_have_mtune=yes,ac_have_mtune=no)
231      if test "$ac_have_mtune" = yes; then
232        AC_MSG_RESULT(working)
233        OPTIMIZE_CFLAGS="-g -O6 -mtune=ultrasparc"
234      else
235        AC_MSG_RESULT(not working)
236        OPTIMIZE_CFLAGS="-g -O3"
237      fi
238      ;;
239    *)
240      OPTIMIZE_CFLAGS="-g -O3"
241      ;;
242  esac
243  OPTIMIZE_LDFLAGS=""
244  DEBUG_CFLAGS="-g"
245  DEBUG_LDFLAGS=""
246fi
247
248AC_ARG_WITH(comp-mode,
249[  --with-comp-mode=<mode> Specify a special compilation mode:
250                          optimize (the default): Produce optimized
251                                code, with symbol table information
252                                if supported on the platform/compiler,
253                                and without asserts.
254                          debug: Produce unoptimized code with symbol table
255                                information and asserts enabled
256                          purify: Unoptimized code linked with purify
257                          quantify: Optimized code without asserts
258                                linked with quantify],
259[comp_mode=$withval],
260[comp_mode=optimize])
261AC_SUBST(LINKER)
262
263LINKER="$CC"
264
265case "$comp_mode" in
266  debug)
267       CFLAGS="$DEBUG_CFLAGS"
268       LDFLAGS="$DEBUG_LDFLAGS" ;;
269  purify)
270       CFLAGS="$DEBUG_CFLAGS"
271       LDFLAGS="$DEBUG_LDFLAGS"
272       AC_DEFINE(PURIFY)
273       LINKER="purify -cache-dir=/tmp $CC" ;;
274  quantify)
275       CFLAGS="$OPTIMIZE_CFLAGS"
276       LDFLAGS="$OPTIMIZE_LDFLAGS"
277       AC_DEFINE(QUANTIFY)
278       AC_DEFINE(NDEBUG)
279       LINKER="quantify $CC" ;;
280  optimize | *)
281       CFLAGS="$OPTIMIZE_CFLAGS"
282       LDFLAGS="$OPTIMIZE_LDFLAGS"
283       AC_DEFINE(NDEBUG) ;;
284esac
285
286AC_PROG_LEX
287AC_MSG_CHECKING(if $LEX accepts the -o and -P options)
288
289AC_CACHE_VAL(ac_cv_flex_accepts_op,
290[ ac_cv_flex_accepts_op=yes ;
291echo "%%\
292%%" | $LEX -Ptest -o/dev/null >/dev/null 2>&1 || ac_cv_flex_accepts_op=no ])
293if test $ac_cv_flex_accepts_op = yes ; then
294  AC_MSG_RESULT(yes)
295else
296  AC_MSG_RESULT(no)
297  AC_MSG_WARN([You either need a newer version of flex, or need to modify
298the defintion of LEX in the Makefile to point to a version that does
299accept -p -t and -o.])
300fi
301
302AC_PROG_LN_S
303AC_PROG_MAKE_SET
304AC_PATH_PROG(AR, ar, ar)
305AC_PROG_RANLIB
306AC_PROG_YACC
307AC_MSG_CHECKING([if $YACC accepts the -p, -t, and -o options])
308AC_CACHE_VAL(ac_cv_yacc_accepts_pto,
309[ ac_cv_yacc_accepts_pto=yes ;
310echo "%token terminal\
311%%\
312nonterminal: terminal\
313%%" > config.in
314$YACC -ptest -o /dev/null config.in >/dev/null 2>&1 || ac_cv_yacc_accepts_pto=norm -f config.in ])
315if test $ac_cv_yacc_accepts_pto = yes ; then
316  AC_MSG_RESULT(yes)
317else
318  AC_MSG_RESULT(no)
319  AC_MSG_WARN([You either need a newer version of bison, or need to modify
320the defintion of YACC in the Makefile to point to a version that does
321accept -p -t and -o.])
322fi
323
324dnl Checks for libraries.
325
326AC_SUBST(LIBDIRS)
327
328# add -lucb to LIBS and set LIBDIRS to -L/usr/ucblib
329# if there's a libucb.a available
330# (Solaris needs this for signals)
331
332ac_save_ldflags="$LDFLAGS"
333LDFLAGS=-L/usr/ucblib
334AC_CHECK_LIB(ucb,main,LIBDIRS=-L/usr/ucblib)
335LDFLAGS="$ac_save_ldflags"
336
337# add -lbsd if there's a libbsd.a available
338# (e.g., Linux needs this for bsd_ioctl)
339AC_CHECK_LIB(bsd,main)
340
341dnl Replace `main' with a function in -lglu:
342AC_CHECK_LIB(glu, main)
343dnl Replace `main' with a function in -lm:
344AC_CHECK_LIB(m, main)
345
346dnl Checks for header files.
347AC_CHECK_HEADERS(sys/time.h)
348
349dnl Checks for typedefs, structures, and compiler characteristics.
350AC_HEADER_TIME
351AC_STRUCT_TM
352
353dnl Checks for library functions.
354AC_HEADER_STDC
355AC_FUNC_STRFTIME
356AC_FUNC_VPRINTF
357AC_CHECK_FUNCS(getcwd gettimeofday strstr)
358
359
360AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.