]> gcc.gnu.org Git - gcc.git/blame - libcpp/configure.ac
lex.c (lex_string): Return a CPP_LESS token for missing '>' in a header name.
[gcc.git] / libcpp / configure.ac
CommitLineData
4f4e53dd
PB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
2fac9c01 4AC_PREREQ(2.59)
4f4e53dd
PB
5AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6AC_CONFIG_SRCDIR(ucnid.h)
88fa57d7 7AC_CONFIG_MACRO_DIR(../config)
4f4e53dd 8AC_CANONICAL_SYSTEM
4f4e53dd
PB
9
10# Checks for programs.
018a4785
ZW
11AC_PROG_MAKE_SET
12AC_PROG_INSTALL
4f4e53dd
PB
13AC_PROG_CC
14AC_PROG_RANLIB
15
078e3ffe
PB
16MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
17AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
18AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
19AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
20
018a4785
ZW
21# Figure out what compiler warnings we can enable.
22# See config/warnings.m4 for details.
23
24ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
467129e6
KG
25 -Wmissing-prototypes -Wold-style-definition \
26 -Wmissing-format-attribute])
018a4785
ZW
27ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
28
29# Only enable with --enable-werror-always until existing warnings are
30# corrected.
31ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
32
f610dd5f
ZW
33# Dependency checking.
34ZW_CREATE_DEPDIR
35ZW_PROG_COMPILER_DEPENDENCIES([CC])
36
4f4e53dd
PB
37# Checks for header files.
38AC_HEADER_TIME
39ACX_HEADER_STRING
4f4e53dd
PB
40AC_CHECK_HEADERS(iconv.h locale.h fcntl.h limits.h stddef.h \
41 stdlib.h strings.h string.h sys/file.h unistd.h)
42
43# Checks for typedefs, structures, and compiler characteristics.
44AC_C_CONST
45AC_C_INLINE
46AC_FUNC_OBSTACK
47AC_TYPE_OFF_T
48AC_TYPE_SIZE_T
d56a25e1 49AC_CHECK_TYPE(ssize_t, int)
4f4e53dd
PB
50AC_STRUCT_TM
51AC_CHECK_SIZEOF(int)
52AC_CHECK_SIZEOF(long)
0d667716
KG
53define(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)
58AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
c3f829c1
GDR
59AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno getopt \
60 libcpp_UNLOCKED_FUNCS vasprintf)))
4f4e53dd
PB
61
62# Checks for library functions.
63AC_FUNC_ALLOCA
64AC_HEADER_STDC
65AM_LANGINFO_CODESET
66ZW_GNU_GETTEXT_SISTER_DIR
67
68AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
69[AC_TRY_COMPILE([
f78ce0c2 70#include <sys/types.h>
4f4e53dd
PB
71],
72[if ((uchar *)0) return 0;
73 if (sizeof(uchar)) return 0;],
74ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
75if test $ac_cv_type_uchar = yes; then
76 AC_DEFINE(HAVE_UCHAR, 1,
77 [Define if <sys/types.h> defines \`uchar'.])
78fi
79
80AM_ICONV
078e3ffe
PB
81
82# More defines and substitutions.
39b8ce7f 83PACKAGE="$PACKAGE_TARNAME"
078e3ffe
PB
84AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
85AC_SUBST(PACKAGE)
86
87if test "x$enable_nls" != xno; then
88 USED_CATALOGS='$(CATALOGS)'
89else
90 USED_CATALOGS=
91fi
92AC_SUBST(USED_CATALOGS)
93
94AC_ARG_ENABLE(maintainer-mode,
95[ --enable-maintainer-mode enable rules only needed by maintainers],,
96enable_maintainer_mode=no)
97
98if test "x$enable_maintainer_mode" = xno; then
99 MAINT='#'
100else
101 MAINT=
102fi
103AC_SUBST(MAINT)
104
4f4e53dd
PB
105AC_ARG_ENABLE(checking,
106[ --enable-checking enable expensive run-time checks],,
107enable_checking=no)
108
109if test $enable_checking != no ; then
110 AC_DEFINE(ENABLE_CHECKING, 1,
111[Define if you want more run-time sanity checks.])
112fi
113
963e23c5 114m4_changequote(,)
4f4e53dd
PB
115case $target in
116 alpha*-*-* | \
077fc835 117 arm*-*-*eabi* | \
b3f8d95d 118 arm*-*-symbianelf* | \
4f4e53dd
PB
119 x86_64-*-* | \
120 ia64-*-* | \
cd985f66 121 hppa*64*-*-* | \
aaf50ff2 122 i[34567]86-*-darwin* | \
a8e68029 123 i[34567]86-*-solaris2.1[0-9]* | \
4f4e53dd
PB
124 mips*-*-* | \
125 mmix-*-* | \
126 powerpc*-*-* | \
127 rs6000*-*-* | \
128 s390*-*-* | \
5f7ca34b 129 sparc*-*-* | \
85d9c13c 130 spu-*-* | \
a1fcb9a1 131 sh[123456789lbe]*-*-* | sh-*-*)
4f4e53dd 132 need_64bit_hwint=yes ;;
0f45f0f5
JM
133 i[34567]86-*-linux*)
134 if test "x$enable_targets" = xall; then
135 need_64bit_hwint=yes
136 else
137 need_64bit_hwint=no
138 fi
139 ;;
4f4e53dd
PB
140 *)
141 need_64bit_hwint=no ;;
142esac
143
144case $need_64bit_hwint:$ac_cv_sizeof_long in
145 *:8 | no:*) host_wide_int=long ;;
146 *) host_wide_int='long long' ;;
147esac
963e23c5 148m4_changequote([,])
4f4e53dd
PB
149
150AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
151[Define to the widest efficient host integer type at least
152 as wide as the target's size_t type.])
153
078e3ffe
PB
154# Output.
155
156AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
4f4e53dd
PB
157AC_CONFIG_FILES(Makefile)
158AC_OUTPUT
This page took 0.368491 seconds and 5 git commands to generate.