1
0
mirror of https://github.com/ilyakooo0/urbit.git synced 2024-12-22 06:11:31 +03:00
urbit/nix/nixcrpkgs/pkgs/angle/util_builder.sh
benjamin-tlon edd57d380d
Finish cc-release cross-compilation. ()
- Fixes the IPC bug
- Fixes the terminfo bug
- Moves the OSX SDK out of our nixcrpkgs fork.
- Vendor nixcrpkgs instead of having it be a submodule.
2019-04-23 19:50:38 -07:00

39 lines
983 B
Bash

source $setup
cp -r $src/util .
mkdir include
cp -r $src/util/*.h include/
cp -r $src/include/export.h include/
mkdir include/common
cp -r $src/src/common/*.h include/common/
mkdir -p include/windows/win32
cp -r $src/util/windows/*.h include/windows/
cp -r $src/util/windows/win32/*.h include/windows/win32/
mkdir -p build/{obj,lib}
cd build
source_files=../util/*.cpp
if [ "$os" == "windows" ]; then
source_files="$source_files ../util/windows/*.cpp ../util/windows/win32/*.cpp"
fi
for c in $source_files; do
echo "compiling $(basename $c)"
$host-g++ -c -g -O2 -fpermissive \
-I../include -I"$angle/include" -L"$angle/lib" \
-DGL_APICALL= -DANGLE_EXPORT= -DEGLAPI= \
-DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -DLIBANGLE_UTIL_IMPLEMENTATION \
$c -lGLESv2 -lEGL \
-o obj/$(basename $c).o
done
$host-ar r lib/libangle_util.a obj/*.o
mkdir -p $out/{license,lib}
cp $src/LICENSE $out/license/
cp lib/libangle_util.a $out/lib/
cp -r ../include $out/