initial commit
[glibc.git] / sysdeps / arm / preconfigure
1 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
2 # Local preconfigure fragment for sysdeps/arm
3
4 case "$machine" in
5 arm*)
6 # If the compiler enables unwind tables by default, this causes
7 # problems with undefined symbols in -nostdlib link tests. To
8 # avoid this, add -fno-unwind-tables here and remove it in
9 # sysdeps/arm/configure.ac after those tests have been run.
10 if test "${CFLAGS+set}" != "set"; then
11 CFLAGS="-g -O2"
12 fi
13 CFLAGS="$CFLAGS -fno-unwind-tables"
14
15 base_machine=arm
16 # Lets ask the compiler which ARM family we've got
17 # Unfortunately it doesn't define any flags for implementations
18 # that you might pass to -mcpu or -mtune
19 # Note if you add patterns here you must ensure that
20 # an appropriate directory exists in sysdeps/arm
21 archcppflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
22 sed -n 's/^#define \(__ARM_ARCH_[0-9].*__\) .*$/\1/p'`
23
24 case "x$archcppflag" in
25 x__ARM_ARCH_89*__)
26 machine=armv7
27 { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for something newer than v7 - using v7" >&5
28 $as_echo "$as_me: Found compiler is configured for something newer than v7 - using v7" >&6;}
29 ;;
30
31 x__ARM_ARCH_7A__)
32 machine=armv7
33 { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
34 $as_echo "$as_me: Found compiler is configured for $machine" >&6;}
35 ;;
36
37 x__ARM_ARCH_6T2__)
38 machine=armv6t2
39 { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
40 $as_echo "$as_me: Found compiler is configured for $machine" >&6;}
41 ;;
42 x__ARM_ARCH_6*__)
43 machine=armv6
44 { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
45 $as_echo "$as_me: Found compiler is configured for $machine" >&6;}
46 ;;
47 *)
48 machine=arm
49 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&5
50 $as_echo "$as_me: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&2;}
51 ;;
52 esac
53
54
55
56 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
57 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
58 if ${ac_cv_path_GREP+:} false; then :
59 $as_echo_n "(cached) " >&6
60 else
61 if test -z "$GREP"; then
62 ac_path_GREP_found=false
63 # Loop through the user's path and test for each of PROGNAME-LIST
64 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
65 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
66 do
67 IFS=$as_save_IFS
68 test -z "$as_dir" && as_dir=.
69 for ac_prog in grep ggrep; do
70 for ac_exec_ext in '' $ac_executable_extensions; do
71 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
72 as_fn_executable_p "$ac_path_GREP" || continue
73 # Check for GNU ac_path_GREP and select it if it is found.
74 # Check for GNU $ac_path_GREP
75 case `"$ac_path_GREP" --version 2>&1` in
76 *GNU*)
77 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
78 *)
79 ac_count=0
80 $as_echo_n 0123456789 >"conftest.in"
81 while :
82 do
83 cat "conftest.in" "conftest.in" >"conftest.tmp"
84 mv "conftest.tmp" "conftest.in"
85 cp "conftest.in" "conftest.nl"
86 $as_echo 'GREP' >> "conftest.nl"
87 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
88 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
89 as_fn_arith $ac_count + 1 && ac_count=$as_val
90 if test $ac_count -gt ${ac_path_GREP_max-0}; then
91 # Best one so far, save it but keep looking for a better one
92 ac_cv_path_GREP="$ac_path_GREP"
93 ac_path_GREP_max=$ac_count
94 fi
95 # 10*(2^10) chars as input seems more than enough
96 test $ac_count -gt 10 && break
97 done
98 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
99 esac
100
101 $ac_path_GREP_found && break 3
102 done
103 done
104 done
105 IFS=$as_save_IFS
106 if test -z "$ac_cv_path_GREP"; then
107 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
108 fi
109 else
110 ac_cv_path_GREP=$GREP
111 fi
112
113 fi
114 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
115 $as_echo "$ac_cv_path_GREP" >&6; }
116 GREP="$ac_cv_path_GREP"
117
118
119 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
120 $as_echo_n "checking for egrep... " >&6; }
121 if ${ac_cv_path_EGREP+:} false; then :
122 $as_echo_n "(cached) " >&6
123 else
124 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
125 then ac_cv_path_EGREP="$GREP -E"
126 else
127 if test -z "$EGREP"; then
128 ac_path_EGREP_found=false
129 # Loop through the user's path and test for each of PROGNAME-LIST
130 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
131 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
132 do
133 IFS=$as_save_IFS
134 test -z "$as_dir" && as_dir=.
135 for ac_prog in egrep; do
136 for ac_exec_ext in '' $ac_executable_extensions; do
137 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
138 as_fn_executable_p "$ac_path_EGREP" || continue
139 # Check for GNU ac_path_EGREP and select it if it is found.
140 # Check for GNU $ac_path_EGREP
141 case `"$ac_path_EGREP" --version 2>&1` in
142 *GNU*)
143 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
144 *)
145 ac_count=0
146 $as_echo_n 0123456789 >"conftest.in"
147 while :
148 do
149 cat "conftest.in" "conftest.in" >"conftest.tmp"
150 mv "conftest.tmp" "conftest.in"
151 cp "conftest.in" "conftest.nl"
152 $as_echo 'EGREP' >> "conftest.nl"
153 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
154 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
155 as_fn_arith $ac_count + 1 && ac_count=$as_val
156 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
157 # Best one so far, save it but keep looking for a better one
158 ac_cv_path_EGREP="$ac_path_EGREP"
159 ac_path_EGREP_max=$ac_count
160 fi
161 # 10*(2^10) chars as input seems more than enough
162 test $ac_count -gt 10 && break
163 done
164 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
165 esac
166
167 $ac_path_EGREP_found && break 3
168 done
169 done
170 done
171 IFS=$as_save_IFS
172 if test -z "$ac_cv_path_EGREP"; then
173 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
174 fi
175 else
176 ac_cv_path_EGREP=$EGREP
177 fi
178
179 fi
180 fi
181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
182 $as_echo "$ac_cv_path_EGREP" >&6; }
183 EGREP="$ac_cv_path_EGREP"
184
185
186 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
187 /* end confdefs.h. */
188 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
189 yes
190 #endif
191
192 _ACEOF
193 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
194 $EGREP "yes" >/dev/null 2>&1; then :
195 endianness=le
196 else
197 endianness=be
198 fi
199 rm -f conftest*
200
201
202 machine=arm/$endianness/$machine
203 with_fp_cond="!defined __SOFTFP__"
204 esac