minimal/src/experimental/musl-busybox/05_prepare_musl.sh
Ivan Davidov 1ca057ee0b Headers are reused rom the downloaded kernel. ISO image is generated in custom shell script.
This commit is prerequisite for major switch from glibc to musl.
2016-01-24 21:15:47 +02:00

31 lines
867 B
Bash
Executable File

#!/bin/sh
cd work/kernel
cd $(ls -d *)
WORK_KERNEL_DIR=$(pwd)
cd ../../..
cd work/musl
# Change to the first directory ls finds, e.g. 'musl-1.1.11'
cd $(ls -d *)
cd musl-installed/bin
unlink musl-ar 2>/dev/null
ln -s `which ar` musl-ar
unlink musl-strip 2>/dev/null
ln -s `which strip` musl-strip
cd ../include
# Copy all kernel headers to musl's 'include' folder
cp -rf $WORK_KERNEL_DIR/usr/include/* .
# Make sure some C structs are not defined in kernel headers if thgey are already defined in musl
sed -i "s/^\#if.__UAPI_DEF_IN6_ADDR$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_IN6_ADDR)/" ./linux/in6.h
sed -i "s/^\#if.__UAPI_DEF_SOCKADDR_IN6$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_SOCKADDR_IN6)/" ./linux/in6.h
sed -i "s/^\#if.__UAPI_DEF_IPV6_MREQ$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_IPV6_MREQ)/" ./linux/in6.h