findutils: fix compile with debugging options
[openadk.git] / scripts / create-sys
blobffa0ed70fa5963d43340078398a4645060e67dab
1 #!/usr/bin/env bash
2 topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
3 systems=$(grep -h config target/*/sys-available/*|cut -d " " -f 2)
5 while read arch; do
6 count=0
7 rm -rf $topdir/target/$arch/sys-enabled &&
8 mkdir -p $topdir/target/$arch/sys-enabled &&
9 cd $topdir/target/$arch/sys-enabled &&
10 for i in $(ls $topdir/target/$arch/sys-available/);do
11 cd $topdir/target/$arch/sys-enabled/ &&
12 ln -sf ../sys-available/$i $count-$i
13 count=$((count+1))
14 done
15 done <${topdir}/target/arch.lst
17 echo '' > $topdir/target/config/Config.in.system.default
19 for j in $systems;do
20 system=${j#ADK_TARGET_SYSTEM_}
21 systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
22 printf "config ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
23 printf "\tboolean\n\n" >> $topdir/target/config/Config.in.system.default
24 done
26 cat >> $topdir/target/config/Config.in.system.default << EOD
27 config ADK_TARGET_SYSTEM
28 string
29 EOD
30 for i in $systems;do
31 system=${i#ADK_TARGET_SYSTEM_}
32 systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
33 system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
34 system=$(echo $system|sed 's#x86-64#x86_64#')
35 if [ "${system%-*}" = "toolchain" -o "${system%-*}" = "qemu" ];then
36 printf "\tdefault \"${system%-*}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
37 else
38 printf "\tdefault \"${system}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
40 done
41 exit 0