struct / union in initializer, RFE #901.
[sdcc.git] / sdcc-extra / configure.in
blob613c1a3bf94fffadb29645ab63e413f11eb8f04d
1 #!/bin/sh
3 AC_PREREQ(2.54)
4 AC_INIT
5 AC_CONFIG_SRCDIR([Makefile.in])
7 # Required programs
8 # ===========================================================================
9 AC_PROG_CC
10 AC_PROG_CXX
11 AC_PROG_CPP
12 AC_CHECK_PROG(STRIP, strip, strip, :)
14 # Macro definitions
15 # ===========================================================================
17 # Check whether the compiler for the current language is SunPRO.
19 AC_DEFUN(bor_IS_SUNPRO,
20 [AC_CACHE_CHECK([whether we are using the SunPRO _AC_LANG compiler],
21 [bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro],
22 [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined __SUNPRO_C && !defined __SUNPRO_CC
23 choke me
24 #endif
25 ]])],
26 [bor_compiler_sunpro=yes],
27 [bor_compiler_sunpro=no])
28 bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=$bor_compiler_sunpro
29 ])])
31 # bor_IS_VALID_OPTION macro checks if the current compiler, selected by
32 # AC_LANG, supports option specified as the 1st parameter. The test fails if
33 # the compiler returns an error or in case something is writeen to stderr.
34 # For example: bor_VALID_OPT(fPIC)
36 AC_DEFUN(bor_IS_VALID_OPTION,
37 [ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set}
38 bor_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
39 AC_CACHE_CHECK(whether _AC_LANG accepts -$1, bor_cv_[]_AC_LANG_ABBREV[]_$1,
40 [bor_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
41 ac_[]_AC_LANG_ABBREV[]_werror_flag=yes
43 []_AC_LANG_PREFIX[]FLAGS="-$1"
44 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
45 [bor_cv_[]_AC_LANG_ABBREV[]_$1=yes],
46 [bor_cv_[]_AC_LANG_ABBREV[]_$1=no])
47 ac_[]_AC_LANG_ABBREV[]_werror_flag=$bor_save_[]_AC_LANG_ABBREV[]_werror_flag])
48 []_AC_LANG_PREFIX[]FLAGS=$bor_save_[]_AC_LANG_PREFIX[]FLAGS
51 # Checking characteristics of compilers and other programs
52 # ===========================================================================
53 if test "$ac_cv_c_compiler_gnu" = "yes"; then
54 # This is the first time when CFLAGS are set/modified!!
55 bor_IS_VALID_OPTION(ggdb)
56 if test "$bor_cv_c_ggdb" = "yes"; then
57 CXXFLAGS="-ggdb ${CXXFLAGS}"
60 WALL_FLAG="-Wall"
61 LIBSTDCXX="-lstdc++"
62 else
63 bor_IS_SUNPRO
64 if test "$bor_cv_c_compiler_sunpro" = "yes"; then
65 CFLAGS="-xO2 ${CFLAGS}"
66 CXXFLAGS="-xO2 ${CXXFLAGS}"
67 WALL_FLAG=
71 AC_SUBST(WALL_FLAG)
72 AC_SUBST(LIBSTDCXX)
74 AC_CONFIG_FILES([Makefile
75 Makefile.rules
76 emu/Makefile
77 emu/rrgb/Makefile
78 emu/rrz80/Makefile
79 emu/rrz80/cpu/Makefile
82 AC_OUTPUT