Mercurial > hg > CbC > CbC_gcc
annotate libcpp/configure.ac @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
0 | 1 # -*- Autoconf -*- |
2 # Process this file with autoconf to produce a configure script. | |
3 | |
4 AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib) | |
5 AC_CONFIG_SRCDIR(ucnid.h) | |
6 AC_CONFIG_MACRO_DIR(../config) | |
7 AC_CANONICAL_SYSTEM | |
8 | |
9 # Checks for programs. | |
10 AC_PROG_MAKE_SET | |
11 AC_PROG_INSTALL | |
12 AC_PROG_CC | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
13 AC_PROG_CXX |
0 | 14 AC_PROG_RANLIB |
15 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
16 AC_USE_SYSTEM_EXTENSIONS |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
17 AC_SYS_LARGEFILE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
18 |
0 | 19 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing |
20 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal]) | |
21 AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf]) | |
22 AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader]) | |
23 | |
24 # Figure out what compiler warnings we can enable. | |
25 # See config/warnings.m4 for details. | |
26 | |
111 | 27 ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
28 -Wmissing-format-attribute], [warn]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
29 ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
30 -Wold-style-definition -Wc++-compat], [c_warn]) |
0 | 31 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long]) |
32 | |
111 | 33 # Disable exceptions and RTTI if building with g++ |
34 ACX_PROG_CC_WARNING_OPTS( | |
35 m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags]) | |
36 | |
0 | 37 # Only enable with --enable-werror-always until existing warnings are |
38 # corrected. | |
39 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual]) | |
40 | |
41 # Dependency checking. | |
42 ZW_CREATE_DEPDIR | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
43 AC_LANG_PUSH([C++]) |
145 | 44 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [], |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
45 [AC_MSG_ERROR([C++ compiler missing or inoperational])]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
46 AC_LANG_POP([C++]) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
47 ZW_PROG_COMPILER_DEPENDENCIES([CXX]) |
0 | 48 |
49 # Checks for header files. | |
50 AC_HEADER_TIME | |
51 ACX_HEADER_STRING | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
52 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
53 AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \ |
0 | 54 stdlib.h strings.h string.h sys/file.h unistd.h) |
55 | |
56 # Checks for typedefs, structures, and compiler characteristics. | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
57 AC_C_BIGENDIAN |
0 | 58 AC_C_CONST |
59 AC_C_INLINE | |
60 AC_FUNC_OBSTACK | |
61 AC_TYPE_OFF_T | |
62 AC_TYPE_SIZE_T | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
63 AC_TYPE_SSIZE_T |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
64 AC_TYPE_UINTPTR_T |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
65 AC_CHECK_TYPE(ptrdiff_t, int) |
111 | 66 AC_TYPE_UINT64_T |
67 if test x"$ac_cv_c_uint64_t" = x"no"; then | |
68 AC_MSG_ERROR([uint64_t not found]) | |
69 fi | |
0 | 70 AC_STRUCT_TM |
71 AC_CHECK_SIZEOF(int) | |
72 AC_CHECK_SIZEOF(long) | |
73 define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl | |
74 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl | |
75 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl | |
76 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl | |
77 putchar_unlocked putc_unlocked) | |
78 AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
79 AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
80 AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS))) |
0 | 81 |
82 # Checks for library functions. | |
83 AC_FUNC_ALLOCA | |
84 AC_HEADER_STDC | |
85 AM_LANGINFO_CODESET | |
86 ZW_GNU_GETTEXT_SISTER_DIR | |
87 | |
88 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar, | |
89 [AC_TRY_COMPILE([ | |
90 #include <sys/types.h> | |
91 ], | |
92 [if ((uchar *)0) return 0; | |
93 if (sizeof(uchar)) return 0;], | |
94 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)]) | |
95 if test $ac_cv_type_uchar = yes; then | |
96 AC_DEFINE(HAVE_UCHAR, 1, | |
97 [Define if <sys/types.h> defines \`uchar'.]) | |
98 fi | |
99 | |
111 | 100 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different |
101 # iconv() prototype. | |
102 AC_LANG_PUSH([C++]) | |
0 | 103 AM_ICONV |
111 | 104 AC_LANG_POP([C++]) |
0 | 105 |
106 # More defines and substitutions. | |
107 PACKAGE="$PACKAGE_TARNAME" | |
108 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.]) | |
109 AC_SUBST(PACKAGE) | |
110 | |
111 if test "x$enable_nls" != xno; then | |
112 USED_CATALOGS='$(CATALOGS)' | |
113 else | |
114 USED_CATALOGS= | |
115 fi | |
116 AC_SUBST(USED_CATALOGS) | |
117 | |
118 AC_ARG_ENABLE(maintainer-mode, | |
119 [ --enable-maintainer-mode enable rules only needed by maintainers],, | |
120 enable_maintainer_mode=no) | |
121 | |
122 if test "x$enable_maintainer_mode" = xno; then | |
123 MAINT='#' | |
124 else | |
125 MAINT= | |
126 fi | |
127 AC_SUBST(MAINT) | |
128 | |
111 | 129 # Enable expensive internal checks |
130 is_release= | |
131 if test -f $srcdir/../gcc/DEV-PHASE \ | |
132 && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then | |
133 is_release=yes | |
0 | 134 fi |
135 | |
111 | 136 AC_ARG_ENABLE(checking, |
137 [AS_HELP_STRING([[--enable-checking[=LIST]]], | |
138 [enable expensive run-time checks. With LIST, | |
139 enable only specific categories of checks. | |
140 Categories are: yes,no,all,none,release. | |
141 Flags are: misc,valgrind or other strings])], | |
142 [ac_checking_flags="${enableval}"],[ | |
143 # Determine the default checks. | |
144 if test x$is_release = x ; then | |
145 ac_checking_flags=yes | |
146 else | |
147 ac_checking_flags=release | |
148 fi]) | |
149 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," | |
150 for check in release $ac_checking_flags | |
151 do | |
152 case $check in | |
153 # these set all the flags to specific states | |
154 yes|all) ac_checking=1 ; ac_assert_checking=1 ; ac_valgrind_checking= ;; | |
155 no|none) ac_checking= ; ac_assert_checking= ; ac_valgrind_checking= ;; | |
156 release) ac_checking= ; ac_assert_checking=1 ; ac_valgrind_checking= ;; | |
157 # these enable particular checks | |
158 assert) ac_assert_checking=1 ;; | |
159 misc) ac_checking=1 ;; | |
160 valgrind) ac_valgrind_checking=1 ;; | |
161 # accept | |
162 *) ;; | |
163 esac | |
164 done | |
165 IFS="$ac_save_IFS" | |
166 | |
167 if test x$ac_checking != x ; then | |
168 AC_DEFINE(CHECKING_P, 1, | |
169 [Define to 1 if you want more run-time sanity checks.]) | |
170 else | |
171 AC_DEFINE(CHECKING_P, 0) | |
172 fi | |
0 | 173 |
111 | 174 if test x$ac_assert_checking != x ; then |
175 AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, | |
176 [Define if you want assertions enabled. This is a cheap check.]) | |
177 fi | |
0 | 178 |
111 | 179 if test x$ac_valgrind_checking != x ; then |
180 AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1, | |
181 [Define if you want to workaround valgrind (a memory checker) warnings about | |
182 possible memory leaks because of libcpp use of interior pointers.]) | |
183 fi | |
184 | |
185 AC_ARG_ENABLE(canonical-system-headers, | |
186 [ --enable-canonical-system-headers | |
187 enable or disable system headers canonicalization], | |
188 [], | |
189 enable_canonical_system_headers=yes) | |
190 if test $enable_canonical_system_headers != no; then | |
191 AC_DEFINE(ENABLE_CANONICAL_SYSTEM_HEADERS, | |
192 1, [Define to enable system headers canonicalization.]) | |
193 fi | |
0 | 194 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
195 case $target in |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
196 i?86-* | x86_64-*) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
197 AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))], |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
198 [AC_DEFINE([HAVE_SSE4], [1], |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
199 [Define to 1 if you can assemble SSE4 insns.])]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
200 esac |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
201 |
111 | 202 # Enable --enable-host-shared. |
203 AC_ARG_ENABLE(host-shared, | |
204 [AS_HELP_STRING([--enable-host-shared], | |
205 [build host code as shared libraries])], | |
206 [PICFLAG=-fPIC], [PICFLAG=]) | |
207 AC_SUBST(PICFLAG) | |
208 | |
209 AC_ARG_ENABLE(valgrind-annotations, | |
210 [AS_HELP_STRING([--enable-valgrind-annotations], | |
211 [enable valgrind runtime interaction])], [], | |
212 [enable_valgrind_annotations=no]) | |
213 if test x$enable_valgrind_annotations != xno \ | |
214 || test x$ac_valgrind_checking != x; then | |
215 if (test $have_valgrind_h = no \ | |
216 && test $gcc_cv_header_memcheck_h = no \ | |
217 && test $gcc_cv_header_valgrind_memcheck_h = no); then | |
218 AC_MSG_ERROR([*** Can't find valgrind/memcheck.h, memcheck.h or valgrind.h]) | |
219 fi | |
220 AC_DEFINE(ENABLE_VALGRIND_ANNOTATIONS, 1, | |
221 [Define to get calls to the valgrind runtime enabled.]) | |
222 fi | |
223 | |
0 | 224 # Output. |
225 | |
226 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1]) | |
227 AC_CONFIG_FILES(Makefile) | |
228 AC_OUTPUT |