mirror of
https://github.com/tpoechtrager/osxcross.git
synced 2024-09-11 08:45:25 +03:00
ogcc wrapper: don't append '-arch' when '-arch' is already given through the invocation command
minimial build_gcc.sh cleanup
This commit is contained in:
parent
962e6acdfc
commit
5a74122c92
@ -31,7 +31,7 @@ Basically everything you can build on OS X with clang/gcc should build with this
|
||||
|
||||
### INSTALLATION: ###
|
||||
|
||||
Download the SDK version you want to the tarball/ (important!) directory.
|
||||
Download the SDK version (links below) you want to the tarball/ (important!) directory.
|
||||
|
||||
Then assure you have the following installed on your Linux box:
|
||||
|
||||
|
@ -43,7 +43,7 @@ BASE_DIR=`pwd`
|
||||
|
||||
pushd $OSXCROSS_BUILD_DIR
|
||||
|
||||
if [ ! -f "have_gcc_${GCC_VERSION}" ]; then
|
||||
if [ ! -f "have_gcc_${GCC_VERSION}_${OSXCROSS_TARGET}" ]; then
|
||||
|
||||
pushd $OSXCROSS_TARBALL_DIR
|
||||
wget -c "$GCC_MIRROR/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2"
|
||||
@ -56,6 +56,9 @@ tar xf "$OSXCROSS_TARBALL_DIR/gcc-$GCC_VERSION.tar.bz2"
|
||||
|
||||
pushd gcc*$GCC_VERSION*
|
||||
|
||||
rm -f $OSXCROSS_TARGET_DIR/bin/*-gcc*
|
||||
rm -f $OSXCROSS_TARGET_DIR/bin/*-g++*
|
||||
|
||||
patch -p0 < $OSXCROSS_PATCH_DIR/gcc-dsymutil.patch
|
||||
|
||||
mkdir -p build
|
||||
@ -79,7 +82,7 @@ make install -j$JOBS
|
||||
popd #build
|
||||
popd #gcc
|
||||
|
||||
touch "have_gcc_${GCC_VERSION}"
|
||||
touch "have_gcc_${GCC_VERSION}_${OSXCROSS_TARGET}"
|
||||
|
||||
fi #have gcc
|
||||
|
||||
|
20
ogcc/ogcc
20
ogcc/ogcc
@ -18,10 +18,26 @@ fi
|
||||
|
||||
if [ "$type" != "${type/++/}" ]; then
|
||||
COMPILER="$OSXCROSS_TARGET_DIR/bin/$ARCH1-apple-$OSXCROSS_TARGET-base-g++"
|
||||
OSXCROSS_OPT_ARGS+=" -static-libgcc -static-libstdc++ -arch $ARCH1"
|
||||
OSXCROSS_OPT_ARGS+=" -static-libgcc -static-libstdc++"
|
||||
else
|
||||
COMPILER="$OSXCROSS_TARGET_DIR/bin/$ARCH1-apple-$OSXCROSS_TARGET-base-gcc"
|
||||
OSXCROSS_OPT_ARGS+=" -static-libgcc -arch $ARCH1"
|
||||
OSXCROSS_OPT_ARGS+=" -static-libgcc"
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
ARCHGIVEN=0
|
||||
|
||||
for p in "$@"
|
||||
do
|
||||
if [ "$p" == "-arch" ]; then
|
||||
ARCHGIVEN=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $ARCHGIVEN -eq 0 ]; then
|
||||
OSXCROSS_OPT_ARGS+=" -arch $ARCH1"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OSXCROSS_OSX_VERSION_MIN" != "default" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user