Daily bump.
[official-gcc.git] / libcpp / configure.ac
blob40f62715acdd7c4c49e6e724ef65b86d62e2bf71
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6 AC_CONFIG_SRCDIR(ucnid.h)
7 AC_CONFIG_MACRO_DIR(../config)
8 AC_CANONICAL_SYSTEM
10 # Checks for programs.
11 AC_PROG_MAKE_SET
12 AC_PROG_INSTALL
13 AC_PROG_CC
14 AC_PROG_RANLIB
16 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
17 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
18 AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
19 AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
21 # Figure out what compiler warnings we can enable.
22 # See config/warnings.m4 for details.
24 ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
25                           -Wmissing-prototypes -Wold-style-definition \
26                           -Wmissing-format-attribute])
27 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
29 # Only enable with --enable-werror-always until existing warnings are
30 # corrected.
31 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
33 # Dependency checking.
34 ZW_CREATE_DEPDIR
35 ZW_PROG_COMPILER_DEPENDENCIES([CC])
37 # Checks for header files.
38 AC_HEADER_TIME
39 ACX_HEADER_STRING
40 AC_CHECK_HEADERS(iconv.h locale.h fcntl.h limits.h stddef.h \
41         stdlib.h strings.h string.h sys/file.h unistd.h)
43 # Checks for typedefs, structures, and compiler characteristics.
44 AC_C_CONST
45 AC_C_INLINE
46 AC_FUNC_OBSTACK
47 AC_TYPE_OFF_T
48 AC_TYPE_SIZE_T
49 AC_CHECK_TYPE(ssize_t, int)
50 AC_STRUCT_TM
51 AC_CHECK_SIZEOF(int)
52 AC_CHECK_SIZEOF(long)
53 define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
54   ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
55   fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
56   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
57   putchar_unlocked putc_unlocked)
58 AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
59 AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno getopt \
60   libcpp_UNLOCKED_FUNCS vasprintf)))
62 # Checks for library functions.
63 AC_FUNC_ALLOCA
64 AC_HEADER_STDC
65 AM_LANGINFO_CODESET
66 ZW_GNU_GETTEXT_SISTER_DIR
68 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
69 [AC_TRY_COMPILE([
70 #include <sys/types.h>
72 [if ((uchar *)0) return 0;
73  if (sizeof(uchar)) return 0;],
74 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
75 if test $ac_cv_type_uchar = yes; then
76   AC_DEFINE(HAVE_UCHAR, 1,
77   [Define if <sys/types.h> defines \`uchar'.])
80 AM_ICONV
82 # More defines and substitutions.
83 PACKAGE="$PACKAGE_TARNAME"
84 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
85 AC_SUBST(PACKAGE)
87 if test "x$enable_nls" != xno; then
88   USED_CATALOGS='$(CATALOGS)'
89 else
90   USED_CATALOGS=
92 AC_SUBST(USED_CATALOGS)
94 AC_ARG_ENABLE(maintainer-mode,
95 [  --enable-maintainer-mode enable rules only needed by maintainers],,
96 enable_maintainer_mode=no)
98 if test "x$enable_maintainer_mode" = xno; then
99   MAINT='#'
100 else
101   MAINT=
103 AC_SUBST(MAINT)
105 AC_ARG_ENABLE(checking,
106 [  --enable-checking      enable expensive run-time checks],,
107 enable_checking=no)
109 if test $enable_checking != no ; then
110   AC_DEFINE(ENABLE_CHECKING, 1,
111 [Define if you want more run-time sanity checks.])
114 m4_changequote(,)
115 case $target in
116         alpha*-*-* | \
117         arm*-*-*eabi* | \
118         arm*-*-symbianelf* | \
119         x86_64-*-* | \
120         ia64-*-* | \
121         hppa*64*-*-* | parisc*64*-*-* | \
122         i[34567]86-*-darwin* | \
123         i[34567]86-*-solaris2.1[0-9]* | \
124         mips*-*-* | \
125         mmix-*-* | \
126         powerpc*-*-* | \
127         rs6000*-*-* | \
128         s390*-*-* | \
129         sparc64*-*-* | ultrasparc-*-freebsd* | \
130         sparcv9-*-solaris2* | \
131         sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9]* | \
132         spu-*-* | \
133         sh[123456789l]*-*-*)
134                 need_64bit_hwint=yes ;;
135         i[34567]86-*-linux*)
136                 if test "x$enable_targets" = xall; then
137                         need_64bit_hwint=yes
138                 else
139                         need_64bit_hwint=no
140                 fi
141                 ;;
142         *)
143                 need_64bit_hwint=no ;;
144 esac
146 case $need_64bit_hwint:$ac_cv_sizeof_long in
147         *:8 | no:*) host_wide_int=long ;;
148         *) host_wide_int='long long' ;;
149 esac
150 m4_changequote([,])
152 AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
153 [Define to the widest efficient host integer type at least
154    as wide as the target's size_t type.])
156 # Output.
158 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
159 AC_CONFIG_FILES(Makefile)
160 AC_OUTPUT