(svn r13852) -Fix (r13849): [OSX] fixed universal binary building without breaking anything this time

This commit is contained in:
bjarni 2008-07-27 20:43:21 +00:00
parent 1aa6e00b48
commit 78730d4c71
2 changed files with 26 additions and 18 deletions

View File

@ -594,7 +594,6 @@ check_params() {
detect_png detect_png
detect_freetype detect_freetype
detect_fontconfig detect_fontconfig
detect_iconv
detect_pspconfig detect_pspconfig
detect_libtimidity detect_libtimidity
@ -893,6 +892,10 @@ check_params() {
fi fi
fi fi
# "set_universal_binary_flags" needs to be before "detect_iconv"
set_universal_binary_flags
detect_iconv
if [ -n "$personal_dir" ] if [ -n "$personal_dir" ]
then then
log 1 "personal home directory... $personal_dir" log 1 "personal home directory... $personal_dir"
@ -1284,11 +1287,6 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt" CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
fi fi
if [ "$with_osx_sysroot" != "0" ] && [ "$with_osx_sysroot" != "3" ]; then
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX$with_osx_sysroot.sdk"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$with_osx_sysroot.sdk -mmacosx-version-min=10.4"
fi
if [ -n "$personal_dir" ]; then if [ -n "$personal_dir" ]; then
CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\"" CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
fi fi
@ -1505,6 +1503,24 @@ check_lipo() {
fi fi
} }
set_universal_binary_flags() {
if [ -n "osx_target_version" ]; then
# if we don't speficy a target version then we presume 10.4
osx_target_version=10.4
fi
if [ "$osx_target_version" = "10.4" ]; then
osx_sysroot_version=10.4u
else
osx_sysroot_version="$osx_target_version"
fi
if [ "$with_osx_sysroot" = "3" ]; then
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX$osx_sysroot_version.sdk -mmacosx-version-min=$osx_target_version"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$osx_sysroot_version.sdk -mmacosx-version-min=$osx_target_version"
fi
}
check_direct_music() { check_direct_music() {
echo " echo "
#include <windows.h> #include <windows.h>
@ -2229,6 +2245,8 @@ detect_cputype() {
} }
make_sed() { make_sed() {
T_CFLAGS="$CFLAGS"
# We check here if we are PPC, because then we need to enable FOUR_BYTE_BOOL # We check here if we are PPC, because then we need to enable FOUR_BYTE_BOOL
# We do this here, and not sooner, so universal builds also have this # We do this here, and not sooner, so universal builds also have this
# automatically correct # automatically correct
@ -2237,17 +2255,7 @@ make_sed() {
# bytes too, but only for PPC. # bytes too, but only for PPC.
ppc=`$cc_host -dumpmachine | egrep "powerpc|ppc"` ppc=`$cc_host -dumpmachine | egrep "powerpc|ppc"`
if [ -n "$ppc" ]; then if [ -n "$ppc" ]; then
T_CFLAGS="$CFLAGS -DFOUR_BYTE_BOOL" T_CFLAGS="$T_CFLAGS -DFOUR_BYTE_BOOL"
osx_sysroot_version=10.4u
else
T_CFLAGS="$CFLAGS"
osx_sysroot_version=10.4u
fi
T_LDFLAGS="$LDFLAGS"
if [ "$with_osx_sysroot" = "3" ]; then
T_CFLAGS="$T_CFLAGS -isysroot /Developer/SDKs/MacOSX$osx_sysroot_version.sdk"
T_LDFLAGS="$T_LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$osx_sysroot_version.sdk -mmacosx-version-min=10.4"
fi fi
SRC_OBJS_DIR="$BASE_SRC_OBJS_DIR/$OBJS_SUBDIR" SRC_OBJS_DIR="$BASE_SRC_OBJS_DIR/$OBJS_SUBDIR"

View File

@ -144,7 +144,7 @@ static const char *convert_tofrom_fs(iconv_t convd, const char *name)
/* Work around buggy iconv implementation where inbuf is wrongly typed as /* Work around buggy iconv implementation where inbuf is wrongly typed as
* non-const. Correct implementation is at * non-const. Correct implementation is at
* http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html */ * http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html */
#if defined(HAVE_BROKEN_ICONV) && !defined(__APPLE__) #ifdef HAVE_BROKEN_ICONV
char *inbuf = (char*)name; char *inbuf = (char*)name;
#else #else
const char *inbuf = name; const char *inbuf = name;