summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-22 03:37:56 -0500
committerAustin Foxley <austinf@cetoncorp.com>2009-11-22 11:29:29 -0800
commit8a40b252bbaa91fffae6c9ebd88dbb90867a7e2f (patch)
treebfc1f6acd5730272d4aec335499287ae8442440b
parentfed69b52ba29c50eef49dc20bba8ea85ee01bce9 (diff)
downloaduClibc-alpine-svn_nptl.tar.bz2
uClibc-alpine-svn_nptl.tar.xz
install_headers.sh: make more user friendlysvn_nptl
Make it easier to run this by hand and don't abort when recursive chown and chmod fail as these often aren't due to uClibc settings. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
-rwxr-xr-xextra/scripts/install_headers.sh27
1 files changed, 17 insertions, 10 deletions
diff --git a/extra/scripts/install_headers.sh b/extra/scripts/install_headers.sh
index 4faf04011..14d64dc9d 100755
--- a/extra/scripts/install_headers.sh
+++ b/extra/scripts/install_headers.sh
@@ -4,6 +4,10 @@
# $2 = dst dir
# $top_builddir = well you guessed it
+srcdir=${1:-include}
+dstdir=${2:-`. ./.config 2>/dev/null && echo ${DEVEL_PREFIX}/include`}
+: ${top_builddir:=.}
+
die_if_not_dir()
{
for dir in "$@"; do
@@ -19,9 +23,9 @@ umask 022
# Sanity tests
-die_if_not_dir "$1"
-mkdir -p "$2" 2>/dev/null
-die_if_not_dir "$2"
+die_if_not_dir "${srcdir}"
+mkdir -p "${dstdir}" 2>/dev/null
+die_if_not_dir "${dstdir}"
die_if_not_dir "$top_builddir"
if ! test -x "$top_builddir/extra/scripts/unifdef"; then
echo "Error: need '$top_builddir/extra/scripts/unifdef' executable"
@@ -31,16 +35,16 @@ fi
# Sanitize and copy uclibc headers
(
-# We must cd, or else we'll prepend "$1" to filenames!
-cd "$1" || exit 1
+# We must cd, or else we'll prepend "${srcdir}" to filenames!
+cd "${srcdir}" || exit 1
find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
-e '/^config$/d'
) | \
(
IFS=''
while read -r filename; do
- if test -d "$1/$filename"; then
- mkdir -p "$2/$filename" 2>/dev/null
+ if test -d "${srcdir}/$filename"; then
+ mkdir -p "${dstdir}/$filename" 2>/dev/null
continue
fi
if test x"${filename##libc-*.h}" = x""; then
@@ -55,15 +59,18 @@ while read -r filename; do
-U_LIBC \
-U__UCLIBC_GEN_LOCALE \
-U__NO_CTYPE \
- "$1/$filename" \
+ "${srcdir}/$filename" \
| sed -e '/^rtld_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \
| sed -e '/^lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \
- >"$2/$filename"
+ >"${dstdir}/$filename"
done
)
# Fix mode/owner bits
-cd "$2" || exit 1
+cd "${dstdir}" || exit 1
chmod -R u=rwX,go=rX . >/dev/null 2>&1
chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` . >/dev/null 2>&1
+
+# ignore errors on unrelated files
+exit 0