OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libssp/] [configure.ac] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 jlechner
# Process this file with autoconf to produce a configure script, like so:
2
#
3
# aclocal -I .. -I ../config && autoconf && autoheader && automake
4
 
5
AC_PREREQ(2.59)
6
AC_INIT(libssp, 1.0)
7
AC_CONFIG_SRCDIR(ssp.c)
8
AC_CANONICAL_SYSTEM
9
ACX_NONCANONICAL_TARGET
10
 
11
AM_INIT_AUTOMAKE
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
AC_EXEEXT
26
 
27
AM_ENABLE_MULTILIB(, ..)
28
 
29
target_alias=${target_alias-$host_alias}
30
AC_SUBST(target_alias)
31
 
32
AC_CONFIG_HEADERS(config.h)
33
 
34
AC_LANG_C
35
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
36
# We must force CC to /not/ be precious variables; otherwise
37
# the wrong, non-multilib-adjusted value will be used in multilibs.
38
# As a side effect, we have to subst CFLAGS ourselves.
39
 
40
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
41
m4_define([_AC_ARG_VAR_PRECIOUS],[])
42
AC_PROG_CC
43
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
44
 
45
AC_SUBST(CFLAGS)
46
 
47
if test "x$GCC" != "xyes"; then
48
  AC_MSG_ERROR([libssp must be built with GCC])
49
fi
50
AC_PROG_CPP
51
 
52
AC_MSG_CHECKING([whether -fstack-protector works])
53
save_CFLAGS="$CFLAGS"
54
CFLAGS="$CFLAGS -fstack-protector -Werror"
55
AC_TRY_COMPILE([
56
void __attribute__((noinline)) bar (char *x)
57
{
58
  __builtin_memset (x, 0, 64);
59
}],[char buf[64]; bar (buf);],
60
[AC_MSG_RESULT(yes)],
61
[AC_MSG_RESULT(no)])
62
CFLAGS="$save_CFLAGS"
63
 
64
AC_MSG_CHECKING([whether hidden visibility is supported])
65
AC_TRY_COMPILE([
66
void __attribute__((visibility ("hidden"))) bar (void) {}],,
67
[ssp_hidden=yes],[ssp_hidden=no])
68
AC_MSG_RESULT($ssp_hidden)
69
if test x$ssp_hidden = xyes; then
70
  AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported])
71
fi
72
 
73
AC_MSG_CHECKING([whether symbol versioning is supported])
74
cat > conftest.map <
75
FOO_1.0 {
76
  global: *foo*; bar; local: *;
77
};
78
EOF
79
save_LDFLAGS="$LDFLAGS"
80
LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
81
AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no])
82
LDFLAGS="$save_LDFLAGS"
83
AC_MSG_RESULT($ssp_use_symver)
84
AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" = xyes])
85
 
86
AC_CHECK_HEADERS(alloca.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h)
87
 
88
AC_CHECK_FUNCS(mempcpy strncpy strncat)
89
 
90
AC_MSG_CHECKING([whether vsnprintf is usable])
91
AC_RUN_IFELSE(AC_LANG_PROGRAM([
92
#include 
93
#include 
94
#include 
95
int foo (char *buf, size_t n, const char *fmt, ...)
96
{
97
  va_list ap;
98
  int ret;
99
  va_start (ap, fmt);
100
  ret = vsnprintf (buf, n, fmt, ap);
101
  va_end (ap);
102
  return ret;
103
}],
104
[char buf@<:@8@:>@; memset (buf, 'A', sizeof (buf));
105
 if (foo (buf, 4, ".%s.", "CDEFG") != 7)
106
   return 1;
107
 return memcmp (buf, ".CD\0AAAA", sizeof (buf)) != 0;]),
108
[ssp_have_usable_vsnprintf=define],
109
[ssp_have_usable_vsnprintf=undef],
110
[ssp_have_usable_vsnprintf=undef])
111
if test "x$ssp_have_usable_vsnprintf" = xdefine; then
112
  AC_MSG_RESULT(yes)
113
  AC_DEFINE([HAVE_USABLE_VSNPRINTF],[1],[vsnprintf is present and works])
114
else
115
  AC_MSG_RESULT(no)
116
fi
117
AC_SUBST(ssp_have_usable_vsnprintf)
118
 
119
AM_PROG_LIBTOOL
120
AC_SUBST(enable_shared)
121
AC_SUBST(enable_static)
122
 
123
# Calculate toolexeclibdir
124
# Also toolexecdir, though it's only used in toolexeclibdir
125
case ${version_specific_libs} in
126
  yes)
127
    # Need the gcc compiler version to know where to install libraries
128
    # and header files if --enable-version-specific-runtime-libs option
129
    # is selected.
130
    toolexecdir='$(libdir)/gcc/$(target_alias)'
131
    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
132
    ;;
133
  no)
134
    if test -n "$with_cross_host" &&
135
       test x"$with_cross_host" != x"no"; then
136
      # Install a library built with a cross compiler in tooldir, not libdir.
137
      toolexecdir='$(exec_prefix)/$(target_alias)'
138
      toolexeclibdir='$(toolexecdir)/lib'
139
    else
140
      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
141
      toolexeclibdir='$(libdir)'
142
    fi
143
    multi_os_directory=`$CC -print-multi-os-directory`
144
    case $multi_os_directory in
145
      .) ;; # Avoid trailing /.
146
      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
147
    esac
148
    ;;
149
esac
150
AC_SUBST(toolexecdir)
151
AC_SUBST(toolexeclibdir)
152
 
153
if test ${multilib} = yes; then
154
  multilib_arg="--enable-multilib"
155
else
156
  multilib_arg=
157
fi
158
 
159
AC_CONFIG_FILES([Makefile ssp/ssp.h])
160
AC_OUTPUT

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.