Hello, this patch fixes install_headers.sh problem that this script
doesn't copy "include/bits|sys" headers in out-of-tree build directory
($top_builddir) when "make O=".../my/build/dir"".

Masahiko Sakamoto, sakamoto.gsyc...@gmail.com

diff to install_headers.sh in uClibc-0.9.31:
===================================================================
--- install_headers.sh.bak      2011-04-10 16:16:42.000000000 +0900
+++ install_headers.sh  2011-04-10 17:41:30.000000000 +0900
@@ -32,19 +32,27 @@
        exit 1
 fi

+include_srcdir=`pwd`/${srcdir}
+include_srcdir=`readlink -f ${include_srcdir}`
+include_builddir=`readlink -f ${top_builddir}/include`
+
+function copy_ulibc_headers()
+{
+local srcdir_a=$1
+local dstdir_a=$2

 # Sanitize and copy uclibc headers
 (
 # We must cd, or else we'll prepend "${srcdir}" to filenames!
-cd "${srcdir}" || exit 1
+cd "${srcdir_a}" || exit 1
 find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
        -e '/^config$/d'
 ) | \
 (
 IFS=''
 while read -r filename; do
-       if test -d "${srcdir}/$filename"; then
-               mkdir -p "${dstdir}/$filename" 2>/dev/null
+       if test -d "${srcdir_a}/$filename"; then
+               mkdir -p "${dstdir_a}/$filename" 2>/dev/null
                continue
        fi
        if test x"${filename##libc-*.h}" = x""; then
@@ -59,13 +67,18 @@
                -U_LIBC \
                -U__UCLIBC_GEN_LOCALE \
                -U__NO_CTYPE \
-               "${srcdir}/$filename" \
+               "${srcdir_a}/$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' \
-       >"${dstdir}/$filename"
+       >"${dstdir_a}/$filename"
 done
 )
+}

+copy_ulibc_headers ${srcdir} ${dstdir}
+if test x"${include_srcdir}" != x"${include_builddir}"; then
+    copy_ulibc_headers ${include_builddir} ${dstdir}
+fi

 # Fix mode/owner bits
 cd "${dstdir}" || exit 1
===================================================================
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to