2020-03-31 16:21:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
source_dir=$1
|
|
|
|
|
build_dir=$2
|
|
|
|
|
platform=$3
|
|
|
|
|
machine=$4
|
|
|
|
|
|
|
|
|
|
echo "Building $machine-$platform sysroot"
|
|
|
|
|
mkdir -p $build_dir/sysroot/usr/include/{sys,machine}
|
|
|
|
|
|
|
|
|
|
cp $source_dir/photon/libc/include/*.h $build_dir/sysroot/usr/include
|
|
|
|
|
|
2020-03-31 18:36:58 +01:00
|
|
|
platform_headers=$(find $source_dir/photon/libc/sys/$platform -maxdepth 1 -type f \( -iname "*.h" ! -iname "__*" \))
|
|
|
|
|
platform_sys_headers=$(find $source_dir/photon/libc/sys/$platform/sys -maxdepth 1 -type f \( -iname "*.h" ! -iname "__*" \))
|
|
|
|
|
cp -t $build_dir/sysroot/usr/include $platform_headers
|
|
|
|
|
cp -t $build_dir/sysroot/usr/include/sys $platform_sys_headers
|
2020-03-31 16:21:07 +01:00
|
|
|
|
|
|
|
|
machine_arch_headers=$(find $source_dir/photon/libc/machine/$machine/ \
|
|
|
|
|
-type f \( -iname "*.h" ! -iname "__*" \))
|
|
|
|
|
machine_generic_headers=$(find $source_dir/photon/libc/include/machine/ \
|
|
|
|
|
-type f \( -iname "*.h" ! -iname "__*" \))
|
|
|
|
|
cp -t $build_dir/sysroot/usr/include/machine $machine_generic_headers $machine_arch_headers
|