OSDN Git Service

2007-06-20 Patrick Mansfield <patmans@us.ibm.com>
[pf3gnuchains/pf3gnuchains3x.git] / libgloss / libnosys / configure.in
1 # Copyright (c) 1995, 1996 Cygnus Support
2 #
3 # The authors hereby grant permission to use, copy, modify, distribute,
4 # and license this software and its documentation for any purpose, provided
5 # that existing copyright notices are retained in all copies and that this
6 # notice is included verbatim in any distributions. No written agreement,
7 # license, or royalty fee is required for any of the authorized uses.
8 # Modifications to this software may be copyrighted by their authors
9 # and need not follow the licensing terms described here, provided that
10 # the new terms are clearly indicated on the first page of each file where
11 # they apply.
12 #
13 # Process this file with autoconf to produce a configure script.
14 #
15 AC_PREREQ(2.59)
16 AC_INIT(close.c)
17 AC_CONFIG_HEADER(config.h)
18
19 if test "${enable_shared}" = "yes" ; then
20     echo "Shared libraries not supported for cross compiling, ignored"
21 fi
22
23 if test "$srcdir" = "." ; then
24   if test "${with_target_subdir}" != "." ; then
25     libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
26   else
27     libgloss_topdir="${srcdir}/${with_multisrctop}../.."
28   fi
29 else
30   libgloss_topdir="${srcdir}/../.."
31 fi
32 AC_CONFIG_AUX_DIR($libgloss_topdir)
33
34 AC_CANONICAL_SYSTEM
35 AC_ARG_PROGRAM
36
37 AC_PROG_INSTALL
38
39 AC_DEFINE(HAVE_GNU_LD)
40 dnl Make sure syscall names match those being used by newlib
41 case "${target}" in
42   *-*-cygwin*)
43         ;;
44   a29k-amd-udi)
45         ;;
46   arc-*-*)
47         ;;
48   arm-*-pe)
49         ;;
50   arm-*-*)
51         ;;
52   strongarm-*-*)
53         ;;
54   cris-*-* | crisv32-*-*)
55         ;;
56   d10v*)
57         ;;
58   h8300*-*-*)
59         ;;      
60   h8500-*-*)
61         ;;      
62   i[3456]86-*-sco*)
63         ;;
64   m32r-*-*)
65         ;;
66   mn10?00-*-*)
67         ;;
68   powerpcle-*-pe)
69         ;;
70   sh*-*-*)
71         ;;
72   sparc-sun-sunos*)
73         ;;
74   sparc64-*-*)
75         ;;
76   thumb-*-pe)
77         ;;
78   thumb-*-*)
79         ;;
80   v850-*-*)
81         ;;
82   v850e-*-*)
83         ;;
84   v850ea-*-*)
85         ;;
86   w65-*-*)
87         ;;      
88   xstormy16-*-*)
89         ;;
90   z8k-*-*)
91         ;;
92   *)
93         AC_DEFINE(MISSING_SYSCALL_NAMES)
94         ;;
95 esac
96
97 dnl Make sure we know if elf format used
98 case "${target}" in
99   *-*-elf)
100         AC_DEFINE(HAVE_ELF)
101
102         AC_CACHE_CHECK([for .previous assembler directive],
103                          libc_cv_asm_previous_directive, [dnl
104         libc_cv_asm_previous_directive=no
105         cat > conftest.s <<EOF
106 .section foo_section
107 .previous
108 EOF
109         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
110           libc_cv_asm_previous_directive=yes
111         fi
112         rm -f conftest*])
113
114         if test "x${libc_cv_asm_previous_directive}" = "xyes"; then
115           AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
116         fi
117
118         AC_CACHE_CHECK([for .popsection assembler directive],
119                          libc_cv_asm_popsection_directive, [dnl
120         libc_cv_asm_popsection_directive=no
121         cat > conftest.s <<EOF
122 .pushsection foo_section
123 .popsection
124 EOF
125         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
126           libc_cv_asm_popsection_directive=yes
127         fi
128         rm -f conftest*])
129
130         if test "x${libc_cv_asm_popsection_directive}" = "xyes"; then
131           AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
132         fi
133
134         AC_CACHE_CHECK([for section attributes],
135                          libc_cv_section_attributes, [dnl
136         libc_cv_section_attributes=no
137         cat > conftest.c <<EOF
138 int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
139 int main() {}
140 EOF
141         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
142           libc_cv_section_attributes=yes
143         fi
144         rm -f conftest*])
145         if test "x${libc_cv_section_attributes}" = "xyes"; then
146           AC_DEFINE(HAVE_SECTION_ATTRIBUTES)
147         fi
148         ;;
149 esac
150
151 AC_CACHE_CHECK([for symbol prefix], libc_symbol_prefix, [dnl
152 cat > conftest.c <<\EOF
153 foo () { }
154 EOF
155 dnl
156 libc_symbol_prefix=none
157 if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
158 then
159   libc_symbol_prefix='$'
160 else
161   if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]);
162   then
163     libc_symbol_prefix=_
164   fi
165 fi
166 rm -f conftest* ])
167 if test $libc_symbol_prefix != none; then
168   AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_symbol_prefix")
169 else
170   AC_DEFINE(__SYMBOL_PREFIX, "")
171 fi
172
173 LIB_AC_PROG_CC
174 AS=${AS-as}
175 AC_SUBST(AS)
176 AR=${AR-ar}
177 AC_SUBST(AR)
178 LD=${LD-ld}
179 AC_SUBST(LD)
180 AC_PROG_RANLIB
181 LIB_AM_PROG_AS
182
183 host_makefile_frag=${srcdir}/../config/default.mh
184
185 dnl We have to assign the same value to other variables because autoconf
186 dnl doesn't provide a mechanism to substitute a replacement keyword with
187 dnl arbitrary data or pathnames.
188 dnl
189 host_makefile_frag_path=$host_makefile_frag
190 AC_SUBST(host_makefile_frag_path)
191 AC_SUBST_FILE(host_makefile_frag)
192
193 AC_CONFIG_FILES(Makefile,
194 ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
195 srcdir=${srcdir}
196 target=${target}
197 with_multisubdir=${with_multisubdir}
198 ac_configure_args="${ac_configure_args} --enable-multilib"
199 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
200 libgloss_topdir=${libgloss_topdir}
201 )
202 AC_OUTPUT
203
204