#!/bin/sh
export C_INCLUDE_PATH="$(rpm --eval %{uclibc_root}%{_includedir}):$(gcc -print-search-dirs|grep install:|cut -d\  -f2)include"
#XXX: this should add rpath, but for some reason it no longer happens and we
# have to pass the -rpath option to the linker as well
export LD_RUN_PATH="$(rpm --eval %{uclibc_root}/%{_lib}:%{uclibc_root}%{_libdir})"
export LIBRARY_PATH="$LD_RUN_PATH"
exec g++ -muclibc -I/usr/uclibc/usr/include -I/usr/uclibc/usr/include/c++ -Wl,-rpath="$LD_RUN_PATH" -Wl,-nostdlib -nodefaultlibs -DGCC_HASCLASSVISIBILITY "$@"  -lc -luClibc++ -lgcc -lgcc_eh
