]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tests/ts/build-sys/config
build-sys: remove duplicate includes
[thirdparty/util-linux.git] / tests / ts / build-sys / config
CommitLineData
adc8c80f
KZ
1#!/bin/bash
2
3# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
4
e130ce53 5TS_TOPDIR="${0%/*}/../.."
adc8c80f
KZ
6TS_DESC="config"
7
8# Don't execute this test by default, --force required
9TS_OPTIONAL="yes"
10
11. $TS_TOPDIR/functions.sh
12ts_init "$*"
13
12826d4c
RM
14ts_check_prog "readelf"
15ts_check_prog "file"
adc8c80f
KZ
16
17config_gen_dir="$top_srcdir/tools"
18. $config_gen_dir/config-gen-functions.sh
19
20[ -n "$CFLAGS" ] && export CFLAGS="$CFLAGS"
21
7f1f10ab 22ts_cd $top_builddir && make -j clean &> /dev/null
adc8c80f
KZ
23
24for conf in $config_gen_dir/config-gen.d/*.conf; do
25 ts_init_subtest $(basename $conf | sed 's/\.conf//')
26
27 opts=$(ul_get_configuration $conf)
28
29 olddir=$(pwd)
7f1f10ab 30 ts_cd $top_builddir
adc8c80f
KZ
31
32 ./configure $opts &> /dev/null
33 make -j &> /dev/null
9206b238 34
51658498 35 bins=$(find . -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) | sort)
adc8c80f
KZ
36 for b in $bins; do
37 libs=$(readelf --dynamic $b 2> /dev/null | \
38 awk '/NEEDED/ { print $5 }' | \
4af92de9 39 sed 's:\[::g; s:\..*::g; s:^libc$::g; s:ld\-.*::g' | \
adc8c80f
KZ
40 sort -u | tr '\n' ' ')
41
42 if [ -n "$libs" ]; then
43 echo "$(basename $b): $libs" >> $TS_OUTPUT
44 else
45 fres=$(file $b)
46 case $fres in
47 *statically*)
48 echo "$(basename $b): STATIC" >> $TS_OUTPUT
49 ;;
50 *) # ignore scripts, ...etc.
51 ;;
52 esac
53 fi
54 done
4210c47a
KZ
55
56 # clean the tree, but exclude tests/{diff,output} dirs
57 #
58 [ -d tests/diff ] && mv tests/diff tests/diff.save
59 [ -d tests/output ] && mv tests/output tests/output.save
60
adc8c80f 61 make -j clean &> /dev/null
adc8c80f 62
4210c47a
KZ
63 [ -d tests/diff.save ] && mv tests/diff.save tests/diff
64 [ -d tests/output.save ] && mv tests/output.save tests/output
65
7f1f10ab 66 ts_cd $olddir
adc8c80f
KZ
67 ts_finalize_subtest
68done
69
70ts_finalize