~ubuntu-branches/ubuntu/vivid/musl/vivid

« back to all changes in this revision

Viewing changes to configure

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2014-05-26 22:45:52 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140526224552-qrtsct934q29xo0x
Tags: 1.1.4-1
* Import upstream version 1.1.4. (Closes: #754758)
* Fixes possible stack-based buffer overflow CVE-2014-3484 (Closes: #750815) 
* Includes fix for build regression on armhf and armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
optimize=auto
124
124
debug=no
125
125
warnings=no
126
 
shared=yes
 
126
shared=auto
127
127
static=yes
 
128
wrapper=auto
128
129
 
129
130
for arg ; do
130
131
case "$arg" in
189
190
printf "%s\n" "$CC"
190
191
test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
191
192
 
192
 
#
193
 
# Only build musl-gcc wrapper if toolchain does not already target musl
194
 
#
195
 
if test -z "$wrapper" ; then
 
193
printf "checking whether C compiler works... "
 
194
echo "typedef int x;" > "$tmpc"
 
195
if output=$($CC $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then
 
196
printf "yes\n"
 
197
else
 
198
printf "no; compiler output follows:\n%s\n" "$output"
 
199
exit 1
 
200
fi
 
201
 
 
202
#
 
203
# Need to know if the compiler is gcc to decide whether to build the
 
204
# musl-gcc wrapper, and for critical bug detection in some gcc versions.
 
205
#
196
206
printf "checking whether compiler is gcc... "
197
207
if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then
198
 
echo yes
 
208
cc_is_gcc=yes
 
209
else
 
210
cc_is_gcc=no
 
211
fi
 
212
echo "$cc_is_gcc"
 
213
 
 
214
#
 
215
# Only build musl-gcc wrapper if toolchain does not already target musl
 
216
#
 
217
if test "$wrapper" = auto ; then
199
218
printf "checking whether to build musl-gcc wrapper... "
 
219
if test "$cc_is_gcc" = yes ; then
200
220
wrapper=yes
201
221
while read line ; do
202
222
case "$line" in */ld-musl-*) wrapper=no ;; esac
203
223
done <<EOF
204
224
$($CC -dumpspecs)
205
225
EOF
206
 
echo $wrapper
207
226
else
208
 
echo no
 
227
wrapper=no
209
228
fi
 
229
echo "$wrapper"
210
230
fi
211
231
 
212
232
 
230
250
x86_64*) ARCH=x86_64 ;;
231
251
mips*) ARCH=mips ;;
232
252
microblaze*) ARCH=microblaze ;;
 
253
or1k*) ARCH=or1k ;;
233
254
powerpc*) ARCH=powerpc ;;
234
255
sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
235
256
unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
278
299
tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
279
300
 
280
301
#
281
 
# If debugging is explicitly enabled, don't auto-enable optimizations
 
302
# Enable debugging if requessted.
282
303
#
283
 
if test "$debug" = yes ; then
284
 
CFLAGS_AUTO=-g
285
 
test "$optimize" = auto && optimize=no
286
 
fi
 
304
test "$debug" = yes && CFLAGS_AUTO=-g
287
305
 
288
306
#
289
307
# Possibly add a -O option to CFLAGS and select modules to optimize with
392
410
tryflag CFLAGS_AUTO -fno-stack-protector
393
411
tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
394
412
 
 
413
test "$shared" = "no" || {
395
414
# Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions
396
415
LDFLAGS_DUMMY=
397
416
tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || {
 
417
test "$shared" = "yes" && fail "$0: error: linker cannot build shared library"
398
418
printf "warning: disabling dynamic linking support\n"
399
419
shared=no
400
420
}
 
421
}
401
422
 
402
423
# Find compiler runtime library
403
424
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
429
450
 
430
451
if test "$ARCH" = "sh" ; then
431
452
trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb
432
 
if trycppif __SH_FPU_ANY__ "$t" ; then
 
453
if trycppif "__SH_FPU_ANY__ || __SH4__" "$t" ; then
433
454
# Some sh configurations are broken and replace double with float
434
455
# rather than using softfloat when the fpu is present but only
435
456
# supports single precision. Reject them.
497
518
includedir = $includedir
498
519
syslibdir = $syslibdir
499
520
CC = $CC
500
 
CFLAGS= $CFLAGS_AUTO $CFLAGS
 
521
CFLAGS = $CFLAGS_AUTO $CFLAGS
501
522
CFLAGS_C99FSE = $CFLAGS_C99FSE
502
523
CFLAGS_MEMOPS = $CFLAGS_MEMOPS
503
524
CPPFLAGS = $CPPFLAGS