From 785071a91d157b825f4186b481d75d12edb93467 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 18 Aug 2004 00:13:37 +0000 Subject: [PATCH] Add support for the darwin (Mac OS X) platform. (James Juhasz) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1036 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 5 ++++ src/engine/SCons/Platform/__init__.py | 2 ++ src/engine/SCons/Platform/darwin.py | 38 +++++++++++++++++++++++++++ src/engine/SCons/Tool/gnulink.py | 2 ++ 4 files changed, 47 insertions(+) create mode 100644 src/engine/SCons/Platform/darwin.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ad02a851..3f80fdad 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -62,6 +62,11 @@ RELEASE 0.95 - XXX - Initialize the name of a Scanner.Classic scanner correctly. + From James Juhasz: + + - Add support for the .dylib shared library suffix and the -dynamiclib + linker option on Mac OS X. + From Steven Knight: - Add an Execute() method for executing actions directly. diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py index e8a4a19a..0856775a 100644 --- a/src/engine/SCons/Platform/__init__.py +++ b/src/engine/SCons/Platform/__init__.py @@ -73,6 +73,8 @@ def platform_default(): return 'hpux' elif string.find(sys.platform, 'aix') != -1: return 'aix' + elif string.find(sys.platform, 'darwin') != -1: + return 'darwin' else: return 'posix' elif os.name == 'os2': diff --git a/src/engine/SCons/Platform/darwin.py b/src/engine/SCons/Platform/darwin.py new file mode 100644 index 00000000..c239c4aa --- /dev/null +++ b/src/engine/SCons/Platform/darwin.py @@ -0,0 +1,38 @@ +"""engine.SCons.Platform.darwin + +Platform-specific initialization for Mac OS X systems. + +There normally shouldn't be any need to import this module directly. It +will usually be imported through the generic SCons.Platform.Platform() +selection method. +""" + +# +# Copyright (c) 2001, 2002, 2003, 2004 Steven Knight +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +import posix +import os + +def generate(env): + posix.generate(env) + env['SHLIBSUFFIX'] = '.dylib' diff --git a/src/engine/SCons/Tool/gnulink.py b/src/engine/SCons/Tool/gnulink.py index b900202f..6276fbe3 100644 --- a/src/engine/SCons/Tool/gnulink.py +++ b/src/engine/SCons/Tool/gnulink.py @@ -45,6 +45,8 @@ def generate(env): if env['PLATFORM'] == 'hpux': env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared -fPIC') + elif env['PLATFORM'] == 'darwin': + env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib') # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. -- 2.26.2