mirror of
https://github.com/tpoechtrager/osxcross.git
synced 2024-08-16 12:00:24 +03:00
Cygwin: Avoid symlinks and append .exe to executables (#91)
This commit is contained in:
parent
86879571d3
commit
98a7b55070
12
build.sh
12
build.sh
@ -168,12 +168,12 @@ CCTOOLS=($CCTOOLS)
|
||||
if [ $X86_64H_SUPPORTED -eq 1 ]; then
|
||||
for CCTOOL in ${CCTOOLS[@]}; do
|
||||
CCTOOL_X86_64H=$(echo "$CCTOOL" | $SED 's/x86_64/x86_64h/g')
|
||||
ln -sf $CCTOOL $CCTOOL_X86_64H
|
||||
create_symlink $CCTOOL $CCTOOL_X86_64H
|
||||
done
|
||||
fi
|
||||
for CCTOOL in ${CCTOOLS[@]}; do
|
||||
CCTOOL_I386=$(echo "$CCTOOL" | $SED 's/x86_64/i386/g')
|
||||
ln -sf $CCTOOL $CCTOOL_I386
|
||||
create_symlink $CCTOOL $CCTOOL_I386
|
||||
done
|
||||
popd &>/dev/null
|
||||
|
||||
@ -182,9 +182,9 @@ fi
|
||||
|
||||
# MacPorts symlinks
|
||||
pushd $TARGET_DIR/bin &>/dev/null # The BSD ln command doesn't support '-r'
|
||||
ln -sf $BASE_DIR/tools/osxcross-macports osxcross-macports
|
||||
ln -sf $BASE_DIR/tools/osxcross-macports osxcross-mp
|
||||
ln -sf $BASE_DIR/tools/osxcross-macports omp
|
||||
create_symlink $BASE_DIR/tools/osxcross-macports osxcross-macports
|
||||
create_symlink $BASE_DIR/tools/osxcross-macports osxcross-mp
|
||||
create_symlink $BASE_DIR/tools/osxcross-macports omp
|
||||
popd &>/dev/null
|
||||
|
||||
SDK=$(ls $TARBALL_DIR/MacOSX$SDK_VERSION*)
|
||||
@ -265,7 +265,7 @@ fi
|
||||
|
||||
pushd $SDK_DIR/MacOSX$SDK_VERSION.sdk &>/dev/null
|
||||
set +e
|
||||
ln -s \
|
||||
create_symlink \
|
||||
$SDK_DIR/MacOSX$SDK_VERSION.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/std*.h \
|
||||
usr/include 2>/dev/null
|
||||
[ ! -f "usr/include/float.h" ] && cp -f $BASE_DIR/oclang/quirks/float.h usr/include
|
||||
|
16
build_gcc.sh
16
build_gcc.sh
@ -128,12 +128,18 @@ source tools/tools.sh
|
||||
|
||||
pushd $OSXCROSS_TARGET_DIR/bin &>/dev/null
|
||||
|
||||
if [ ! -f i386-apple-$OSXCROSS_TARGET-base-gcc ]; then
|
||||
mv x86_64-apple-$OSXCROSS_TARGET-gcc x86_64-apple-$OSXCROSS_TARGET-base-gcc
|
||||
mv x86_64-apple-$OSXCROSS_TARGET-g++ x86_64-apple-$OSXCROSS_TARGET-base-g++
|
||||
if [ ! -f i386-apple-$OSXCROSS_TARGET-base-gcc$EXESUFFIX ]; then
|
||||
mv x86_64-apple-$OSXCROSS_TARGET-gcc$EXESUFFIX \
|
||||
x86_64-apple-$OSXCROSS_TARGET-base-gcc$EXESUFFIX
|
||||
|
||||
ln -sf x86_64-apple-$OSXCROSS_TARGET-base-gcc i386-apple-$OSXCROSS_TARGET-base-gcc
|
||||
ln -sf x86_64-apple-$OSXCROSS_TARGET-base-g++ i386-apple-$OSXCROSS_TARGET-base-g++
|
||||
mv x86_64-apple-$OSXCROSS_TARGET-g++$EXESUFFIX \
|
||||
x86_64-apple-$OSXCROSS_TARGET-base-g++$EXESUFFIX
|
||||
|
||||
create_symlink x86_64-apple-$OSXCROSS_TARGET-base-gcc$EXESUFFIX \
|
||||
i386-apple-$OSXCROSS_TARGET-base-gcc$EXESUFFIX
|
||||
|
||||
create_symlink x86_64-apple-$OSXCROSS_TARGET-base-g++$EXESUFFIX \
|
||||
i386-apple-$OSXCROSS_TARGET-base-g++$EXESUFFIX
|
||||
fi
|
||||
|
||||
echo "compiling wrapper ..."
|
||||
|
@ -149,13 +149,17 @@ function extract()
|
||||
|
||||
if [[ $PLATFORM == CYGWIN* ]]; then
|
||||
|
||||
# Work around Cygwin brokenness.
|
||||
function ln()
|
||||
function create_symlink()
|
||||
{
|
||||
[[ $1 == -* ]] && rm -f $3
|
||||
$(which ln) $@
|
||||
cp -f $1 $2
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
function create_symlink()
|
||||
{
|
||||
ln -sf $1 $2
|
||||
}
|
||||
export -f ln
|
||||
|
||||
fi
|
||||
|
||||
|
@ -16,7 +16,11 @@ if [ -z "$OSXCROSS_VERSION" ]; then
|
||||
fi
|
||||
set -e
|
||||
|
||||
EXESUFFIX=""
|
||||
if [[ $PLATFORM == CYGWIN* ]]; then
|
||||
EXESUFFIX=".exe"
|
||||
else
|
||||
EXESUFFIX=""
|
||||
fi
|
||||
|
||||
function create_wrapper_link
|
||||
{
|
||||
@ -36,31 +40,31 @@ function create_wrapper_link
|
||||
# -> x86_64h-apple-darwinXX-osxcross
|
||||
|
||||
if [ $# -ge 2 ] && [ $2 -eq 1 ]; then
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"${1}${EXESUFFIX}"
|
||||
fi
|
||||
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"i386-apple-${OSXCROSS_TARGET}-${1}${EXESUFFIX}"
|
||||
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"x86_64-apple-${OSXCROSS_TARGET}-${1}${EXESUFFIX}"
|
||||
|
||||
if [ -n "$X86_64H_SUPPORTED" ] && [ $X86_64H_SUPPORTED -eq 1 ] &&
|
||||
([[ $1 != gcc* ]] && [[ $1 != g++* ]] && [[ $1 != *gstdc++ ]]); then
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"x86_64h-apple-${OSXCROSS_TARGET}-${1}${EXESUFFIX}"
|
||||
fi
|
||||
|
||||
if [ $# -ge 2 ] && [ $2 -eq 2 ]; then
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"o32-${1}${EXESUFFIX}"
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"o64-${1}${EXESUFFIX}"
|
||||
|
||||
if [ -n "$X86_64H_SUPPORTED" ] && [ $X86_64H_SUPPORTED -eq 1 ] &&
|
||||
([[ $1 != gcc* ]] && [[ $1 != g++* ]] && [[ $1 != *gstdc++ ]]); then
|
||||
verbose_cmd ln -sf "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
verbose_cmd create_symlink "${TARGETTRIPLE}-wrapper${EXESUFFIX}" \
|
||||
"o64h-${1}${EXESUFFIX}"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user