5 # $top_builddir = well you guessed it
10 test -d "$dir" && continue
11 echo "Error: '$dir' is not a directory"
17 # Ensure that created dirs/files have 755/644 perms
23 mkdir -p "$2" 2>/dev/null
25 die_if_not_dir "$top_builddir"
26 if ! test -x "$top_builddir/extra/scripts/unifdef"; then
27 echo "Error: need '$top_builddir/extra/scripts/unifdef' executable"
32 # Sanitize and copy uclibc headers
34 # We must cd, or else we'll prepend "$1" to filenames!
36 find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
41 while read -r filename; do
42 if test -d "$1/$filename"; then
43 mkdir -p "$2/$filename" 2>/dev/null
46 if test x"${filename##libc-*.h}" = x""; then
47 # Do not install libc-XXXX.h files
50 # NB: unifdef exits with 1 if output is not
51 # exactly the same as input. That's ok.
52 # Do not abort the script if unifdef "fails"!
53 # NB2: careful with sed command arguments, they contain tab character
54 "$top_builddir/extra/scripts/unifdef" \
56 -U__UCLIBC_GEN_LOCALE \
59 | sed -e '/^rtld_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \
60 | sed -e '/^lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \
68 chmod -R u=rwX,go=rX . >/dev/null 2>&1
69 chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` . >/dev/null 2>&1