Fix architecture config file make rules.
/trunk/kconfig/kconfig.mk | 2 1 1 0 +-
1 file changed, 1 insertion(+), 1 deletion(-)
3 # This script will populate the root directory with libs from the sysroot.
4 # (C) 2007 Yann E. MORIN
5 # Licensed under the GPL v2
7 # Detect where the toolchain is:
8 BIN_DIR="$(cd "$(dirname "$0")"; pwd)"
9 CT_READELF="${BIN_DIR}/@@CT_TARGET@@-readelf"
10 CT_SYSROOT_DIR="${BIN_DIR}/../@@CT_TARGET@@/sys-root"
12 myname=$(basename "$0")
16 $myname [-f] [-v] -s source_root -d destination_root
19 use 'dir' as the un-populated (source) root directory
22 use 'dir' as the place to put the populated root directory
24 -f force execution: if destination directory already exists,
25 it will be removed first.
35 while getopts ":s:d:fvh" CT_OPT; do
37 s) CT_ROOT_SRC_DIR="${OPTARG}";;
38 d) CT_ROOT_DST_DIR="${OPTARG}";;
44 :) echo "$myname: '-${OPTARG}' takes exactly one argument."
47 ?) echo "$myname: unknown option '-${OPTARG}'."
54 if [ -z "${CT_ROOT_SRC_DIR}" -o -z "${CT_ROOT_DST_DIR}" ]; then
58 if [ ! -d "${CT_ROOT_SRC_DIR}" ]; then
59 echo "$myname: '${CT_ROOT_SRC_DIR}': no such file or directory"
62 if [ -d "${CT_ROOT_DST_DIR}" -a "${CT_FORCE}" != "y" ]; then
63 echo "$myname: '${CT_ROOT_DST_DIR}': already exists"
66 src_inode=$(ls -di "${CT_ROOT_SRC_DIR}")
67 dst_inode=$(ls -di "${CT_ROOT_DST_DIR}" 2>/dev/null)
68 if [ "${src_inode}" = "${dst_inode}" ]; then
69 echo "$myname: source and destination are the same!"
73 # Get rid of potentially older destination directory
74 if [ -d "${CT_ROOT_DST_DIR}" ]; then
75 mv "${CT_ROOT_DST_DIR}" "${CT_ROOT_DST_DIR}.$$"
76 setsid nohup rm -rf "${CT_ROOT_DST_DIR}.$$" >/dev/null 2>&1 &
79 # Create the working copy
80 mkdir -p "${CT_ROOT_DST_DIR}"
82 # Make all path absolute
83 CT_ROOT_SRC_DIR=$(cd "${CT_ROOT_SRC_DIR}"; pwd)
84 CT_ROOT_DST_DIR=$(cd "${CT_ROOT_DST_DIR}"; pwd)
86 cd "${CT_ROOT_SRC_DIR}"
87 tar cf - . |(cd "${CT_ROOT_DST_DIR}"; tar xf -)
89 # Parse the working copy for executables and libraries
90 cd "${CT_ROOT_DST_DIR}"
92 while [ ${still_needed} -eq 1 ]; do
93 ${CT_ECHO} "Looping..."
95 for f in $(find . -type f -exec file {} \; |egrep ': ELF [[:digit:]]+-bit .SB (executable|shared object),' |cut -d ":" -f 1); do
96 ${CT_ECHO} "Scanning '${f}'"
97 for libname in $("${CT_READELF}" -d "${f}" |egrep '(NEEDED)' |sed -r -e 's,.+\[(.+)\] *$,\1,;'); do
98 ${CT_ECHO} " searching for '${libname}'"
99 if [ -e "lib/${libname}" \
100 -o -e "usr/lib/${libname}" ]; then
101 ${CT_ECHO} " already present"
105 ${CT_ECHO} -n " trying in '${dir}'"
106 libfile="${CT_SYSROOT_DIR}/${dir}/lib/${libname}"
107 ${CT_ECHO} ": '${libfile}'"
108 if [ -e "${libfile}" ]; then
109 mkdir -p "${dir}/lib"
110 ${CT_ECHO} " installing '${dir}/lib/${libname}'"
111 cp "${libfile}" "${dir}/lib/${libname}"