Mercurial > hg > CbC > CbC_gcc
annotate libssp/configure.ac @ 81:dbfc0d2dde36
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 02:43:04 +0900 |
parents | f6334be47118 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 # Process this file with autoconf to produce a configure script, like so: |
2 # | |
3 # aclocal -I .. -I ../config && autoconf && autoheader && automake | |
4 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
5 AC_PREREQ(2.64) |
0 | 6 AC_INIT(libssp, 1.0) |
7 AC_CONFIG_SRCDIR(ssp.c) | |
8 AC_CANONICAL_SYSTEM | |
9 ACX_NONCANONICAL_TARGET | |
10 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
11 AM_INIT_AUTOMAKE([no-dist]) |
0 | 12 |
13 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) | |
14 AC_ARG_ENABLE(version-specific-runtime-libs, | |
15 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], | |
16 [case "$enableval" in | |
17 yes) version_specific_libs=yes ;; | |
18 no) version_specific_libs=no ;; | |
19 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; | |
20 esac], | |
21 [version_specific_libs=no]) | |
22 AC_MSG_RESULT($version_specific_libs) | |
23 | |
24 AM_MAINTAINER_MODE | |
25 | |
26 GCC_NO_EXECUTABLES | |
27 | |
28 AM_ENABLE_MULTILIB(, ..) | |
29 | |
30 target_alias=${target_alias-$host_alias} | |
31 AC_SUBST(target_alias) | |
32 | |
33 AC_CONFIG_HEADERS(config.h) | |
34 | |
35 AC_LANG_C | |
36 # The same as in boehm-gc and libstdc++. Have to borrow it from there. | |
37 # We must force CC to /not/ be precious variables; otherwise | |
38 # the wrong, non-multilib-adjusted value will be used in multilibs. | |
39 # As a side effect, we have to subst CFLAGS ourselves. | |
40 | |
41 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
42 m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
43 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
|
44 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
0 | 45 |
46 AC_SUBST(CFLAGS) | |
47 | |
48 if test "x$GCC" != "xyes"; then | |
49 AC_MSG_ERROR([libssp must be built with GCC]) | |
50 fi | |
51 AC_PROG_CPP | |
52 | |
53 AC_MSG_CHECKING([whether -fstack-protector works]) | |
54 save_CFLAGS="$CFLAGS" | |
55 CFLAGS="$CFLAGS -fstack-protector -Werror" | |
56 AC_TRY_COMPILE([ | |
57 void __attribute__((noinline)) bar (char *x) | |
58 { | |
59 __builtin_memset (x, 0, 64); | |
60 }],[char buf[64]; bar (buf);], | |
61 [AC_MSG_RESULT(yes)], | |
62 [AC_MSG_RESULT(no)]) | |
63 CFLAGS="$save_CFLAGS" | |
64 | |
65 AC_MSG_CHECKING([whether hidden visibility is supported]) | |
66 AC_TRY_COMPILE([ | |
67 void __attribute__((visibility ("hidden"))) bar (void) {}],, | |
68 [ssp_hidden=yes],[ssp_hidden=no]) | |
69 AC_MSG_RESULT($ssp_hidden) | |
70 if test x$ssp_hidden = xyes; then | |
71 AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported]) | |
72 fi | |
73 | |
74 AC_MSG_CHECKING([whether symbol versioning is supported]) | |
75 if test x$gcc_no_link = xyes; then | |
76 # If we cannot link, we cannot build shared libraries, so do not use | |
77 # symbol versioning. | |
78 ssp_use_symver=no | |
79 else | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
80 save_LDFLAGS="$LDFLAGS" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
81 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
82 cat > conftest.map <<EOF |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
83 FOO_1.0 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
84 global: *foo*; bar; local: *; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
85 }; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
86 EOF |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
87 AC_TRY_LINK([int foo;],[],[ssp_use_symver=gnu],[ssp_use_symver=no]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
88 if test x$ssp_use_symver = xno; then |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
89 case "$target_os" in |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
90 solaris2*) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
91 LDFLAGS="$save_LDFLAGS" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
92 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
93 # Sun ld cannot handle wildcards and treats all entries as undefined. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
94 cat > conftest.map <<EOF |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
95 FOO_1.0 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
96 global: foo; local: *; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
97 }; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
98 EOF |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
99 AC_TRY_LINK([int foo;],[],[ssp_use_symver=sun],[ssp_use_symver=no]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
100 ;; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
101 esac |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
102 fi |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
103 LDFLAGS="$save_LDFLAGS" |
0 | 104 fi |
105 AC_MSG_RESULT($ssp_use_symver) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
106 AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" != xno]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
107 AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
108 AM_CONDITIONAL(LIBSSP_USE_SYMVER_SUN, [test "x$ssp_use_symver" = xsun]) |
0 | 109 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
110 AC_CHECK_HEADERS(alloca.h malloc.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h) |
0 | 111 |
112 if test x$gcc_no_link = xyes; then | |
113 # Presume the ISO C functions are available; add target-specific | |
114 # configuration here if required. | |
115 AC_DEFINE(HAVE_STRNCPY) | |
116 AC_DEFINE(HAVE_STRNCAT) | |
117 else | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
118 AC_CHECK_FUNCS(memmove mempcpy strncpy strncat) |
0 | 119 fi |
120 | |
121 AC_MSG_CHECKING([whether vsnprintf is usable]) | |
122 AC_RUN_IFELSE(AC_LANG_PROGRAM([ | |
123 #include <stdarg.h> | |
124 #include <string.h> | |
125 #include <stdio.h> | |
126 int foo (char *buf, size_t n, const char *fmt, ...) | |
127 { | |
128 va_list ap; | |
129 int ret; | |
130 va_start (ap, fmt); | |
131 ret = vsnprintf (buf, n, fmt, ap); | |
132 va_end (ap); | |
133 return ret; | |
134 }], | |
135 [char buf@<:@8@:>@; memset (buf, 'A', sizeof (buf)); | |
136 if (foo (buf, 4, ".%s.", "CDEFG") != 7) | |
137 return 1; | |
138 return memcmp (buf, ".CD\0AAAA", sizeof (buf)) != 0;]), | |
139 [ssp_have_usable_vsnprintf=define], | |
140 [ssp_have_usable_vsnprintf=undef], | |
141 [ssp_have_usable_vsnprintf=undef]) | |
142 if test "x$ssp_have_usable_vsnprintf" = xdefine; then | |
143 AC_MSG_RESULT(yes) | |
144 AC_DEFINE([HAVE_USABLE_VSNPRINTF],[1],[vsnprintf is present and works]) | |
145 else | |
146 AC_MSG_RESULT(no) | |
147 fi | |
148 AC_SUBST(ssp_have_usable_vsnprintf) | |
149 | |
150 AM_PROG_LIBTOOL | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
151 ACX_LT_HOST_FLAGS |
0 | 152 AC_SUBST(enable_shared) |
153 AC_SUBST(enable_static) | |
154 | |
155 # Calculate toolexeclibdir | |
156 # Also toolexecdir, though it's only used in toolexeclibdir | |
157 case ${version_specific_libs} in | |
158 yes) | |
159 # Need the gcc compiler version to know where to install libraries | |
160 # and header files if --enable-version-specific-runtime-libs option | |
161 # is selected. | |
162 toolexecdir='$(libdir)/gcc/$(target_alias)' | |
163 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' | |
164 ;; | |
165 no) | |
166 if test -n "$with_cross_host" && | |
167 test x"$with_cross_host" != x"no"; then | |
168 # Install a library built with a cross compiler in tooldir, not libdir. | |
169 toolexecdir='$(exec_prefix)/$(target_alias)' | |
170 toolexeclibdir='$(toolexecdir)/lib' | |
171 else | |
172 toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
173 toolexeclibdir='$(libdir)' | |
174 fi | |
175 multi_os_directory=`$CC -print-multi-os-directory` | |
176 case $multi_os_directory in | |
177 .) ;; # Avoid trailing /. | |
178 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; | |
179 esac | |
180 ;; | |
181 esac | |
182 AC_SUBST(toolexecdir) | |
183 AC_SUBST(toolexeclibdir) | |
184 | |
185 if test ${multilib} = yes; then | |
186 multilib_arg="--enable-multilib" | |
187 else | |
188 multilib_arg= | |
189 fi | |
190 | |
191 AC_CONFIG_FILES([Makefile ssp/ssp.h]) | |
192 AC_OUTPUT |