From e3fcedc0ddbbdc4fe3b1faa0c46cdf77bb4ea1a9 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 14 Mar 2012 11:57:45 +1000 Subject: Apply various Mac build patches from Mimika Oh and Nemurimasu Neiro to fix up http://redmine.kokuaviewer.org/issues/598 and http://redmine.kokuaviewer.org/issues/602 --- linden/indra/cmake/Variables.cmake | 11 ++++++++++- linden/indra/develop.py | 5 +++++ linden/indra/llui/llresmgr.cpp | 9 +++++++-- linden/indra/mac_updater/mac_updater.cpp | 6 +++--- 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/cmake/Variables.cmake b/linden/indra/cmake/Variables.cmake index 6b7ded3..25d7a17 100644 --- a/linden/indra/cmake/Variables.cmake +++ b/linden/indra/cmake/Variables.cmake @@ -80,10 +80,19 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) + + # Incorporated settings from + # http://imprudenceviewer.org/w/index.php?title=How_to_compile&oldid=1647#Mac + # so that people don't have to set them every time they run develop.py + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS '$(ARCHS_STANDARD_32_BIT)') + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS "i386 ppc") + # set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") + # set this dynamically from the build system now - # NOTE: wont have a distributable build unless you add this on the configure line with: # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc' - set(CMAKE_OSX_ARCHITECTURES i386) + set(CMAKE_OSX_ARCHITECTURES i386;ppc) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) if (CMAKE_OSX_ARCHITECTURES MATCHES "i386") set(ARCH i386) diff --git a/linden/indra/develop.py b/linden/indra/develop.py index 2f07e9e..3760609 100755 --- a/linden/indra/develop.py +++ b/linden/indra/develop.py @@ -435,7 +435,12 @@ class DarwinSetup(UnixSetup): type=self.build_type ) if self.universal == 'ON': + args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\'' + elif self.arch == 'ppc': + args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'ppc\'' + else: args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386\'' + #if simple: # return 'cmake %(opts)s %(dir)r' % args return ('cmake -G %(generator)r ' diff --git a/linden/indra/llui/llresmgr.cpp b/linden/indra/llui/llresmgr.cpp index 22610ca..a16cfdf 100644 --- a/linden/indra/llui/llresmgr.cpp +++ b/linden/indra/llui/llresmgr.cpp @@ -266,8 +266,13 @@ std::string LLResMgr::getMonetaryString( S32 input ) const default: // Unknown -- use the US defaults. case LLLOCALE_USA: case LLLOCALE_UK: // UK ends up being the same as US for the items used here. - fakeconv.negative_sign = "-"; - fakeconv.mon_grouping = "\x03\x03\x00"; // commas every 3 digits + // Mac OS X 10.6 SDK's struct lconv contains "char *" not + // "const char *" so these char arrays work around the error + // this causes in GCC 4.2, even though they won't be modified. + static char negative_sign[] = "-"; + static char mon_grouping[] = "\x03\x03\x00"; + fakeconv.negative_sign = negative_sign; + fakeconv.mon_grouping = mon_grouping; // commas every 3 digits fakeconv.n_sign_posn = 1; // negative sign before the string break; } diff --git a/linden/indra/mac_updater/mac_updater.cpp b/linden/indra/mac_updater/mac_updater.cpp index 03c6f6f..cab9e54 100644 --- a/linden/indra/mac_updater/mac_updater.cpp +++ b/linden/indra/mac_updater/mac_updater.cpp @@ -68,8 +68,8 @@ EventHandlerRef gEventHandler = NULL; OSStatus gFailure = noErr; Boolean gCancelled = false; -char *gUpdateURL; -char *gProductName; +const char *gUpdateURL; +const char *gProductName; void *updatethreadproc(void*); @@ -1032,7 +1032,7 @@ void *updatethreadproc(void*) if(!mountOutput.empty()) { const char *s = mountOutput.c_str(); - char *prefix = "/dev/"; + const char *prefix = "/dev/"; char *sub = strstr(s, prefix); if(sub != NULL) -- cgit v1.1