OSDN Git Service

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