OSDN Git Service

2004-09-06 Serge Belyshev <belyshev@lubercy.com>
[pf3gnuchains/gcc-fork.git] / libcpp / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6 AC_CONFIG_SRCDIR(ucnid.h)
7 AC_CANONICAL_SYSTEM
8 AC_PROG_MAKE_SET
9 AC_PROG_INSTALL
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_RANLIB
14
15 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
16 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
17 AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
18 AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
19
20 # Checks for header files.
21 AC_HEADER_TIME
22 ACX_HEADER_STRING
23 AC_CHECK_HEADERS(iconv.h locale.h fcntl.h limits.h stddef.h \
24         stdlib.h strings.h string.h sys/file.h unistd.h)
25
26 # Checks for typedefs, structures, and compiler characteristics.
27 AC_C_CONST
28 AC_C_INLINE
29 AC_FUNC_OBSTACK
30 AC_TYPE_OFF_T
31 AC_TYPE_SIZE_T
32 AC_STRUCT_TM
33 AC_CHECK_SIZEOF(int)
34 AC_CHECK_SIZEOF(long)
35 AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
36         fwrite_unlocked fprintf_unlocked)
37 AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked,
38         fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
39
40 # Checks for library functions.
41 AC_FUNC_ALLOCA
42 AC_HEADER_STDC
43 AM_LANGINFO_CODESET
44 ZW_GNU_GETTEXT_SISTER_DIR
45
46 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
47 [AC_TRY_COMPILE([
48 #include "ansidecl.h"
49 #include "system.h"
50 ],
51 [if ((uchar *)0) return 0;
52  if (sizeof(uchar)) return 0;],
53 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
54 if test $ac_cv_type_uchar = yes; then
55   AC_DEFINE(HAVE_UCHAR, 1,
56   [Define if <sys/types.h> defines \`uchar'.])
57 fi
58
59 AM_ICONV
60
61 # More defines and substitutions.
62 PACKAGE="$PACKAGE_TARNAME"
63 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
64 AC_SUBST(PACKAGE)
65
66 if test "x$enable_nls" != xno; then
67   USED_CATALOGS='$(CATALOGS)'
68 else
69   USED_CATALOGS=
70 fi
71 AC_SUBST(USED_CATALOGS)
72
73 AC_ARG_ENABLE(maintainer-mode,
74 [  --enable-maintainer-mode enable rules only needed by maintainers],,
75 enable_maintainer_mode=no)
76
77 if test "x$enable_maintainer_mode" = xno; then
78   MAINT='#'
79 else
80   MAINT=
81 fi
82 AC_SUBST(MAINT)
83
84 AC_ARG_ENABLE(checking,
85 [  --enable-checking      enable expensive run-time checks],,
86 enable_checking=no)
87
88 if test $enable_checking != no ; then
89   AC_DEFINE(ENABLE_CHECKING, 1,
90 [Define if you want more run-time sanity checks.])
91 fi
92
93 m4_changequote(,)
94 case $target in
95         alpha*-*-* | \
96         arm*-*-eabi* | \
97         arm*-*-symbianelf* | \
98         x86_64-*-* | \
99         ia64-*-* | \
100         hppa*64*-*-* | parisc*64*-*-* | \
101         mips*-*-* | \
102         mmix-*-* | \
103         powerpc*-*-* | \
104         rs6000*-*-* | \
105         s390*-*-* | \
106         sparc64*-*-* | ultrasparc-*-freebsd* | \
107         sparcv9-*-solaris2* | \
108         sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9] | \
109         sh[123456789l]*-*-*)
110                 need_64bit_hwint=yes ;;
111         *)
112                 need_64bit_hwint=no ;;
113 esac
114
115 case $need_64bit_hwint:$ac_cv_sizeof_long in
116         *:8 | no:*) host_wide_int=long ;;
117         *) host_wide_int='long long' ;;
118 esac
119 m4_changequote([,])
120
121 AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
122 [Define to the widest efficient host integer type at least
123    as wide as the target's size_t type.])
124
125 # Output.
126
127 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
128 AC_CONFIG_FILES(Makefile)
129 AC_OUTPUT