From: Jack Jansen Date: Thu, 23 May 2002 22:34:18 +0000 (+0000) Subject: Allow the shared library initialization routine to be overridden with an initialize... X-Git-Tag: v2.3c1~5595 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b66e1a3dd2ca81c793c84ab436e08670980ac73d;p=python Allow the shared library initialization routine to be overridden with an initialize=xxx argument. Should fix #492465. --- diff --git a/Mac/Lib/mkcwproject/cwxmlgen.py b/Mac/Lib/mkcwproject/cwxmlgen.py index e80cfa7a8b..0ffe12fb40 100644 --- a/Mac/Lib/mkcwproject/cwxmlgen.py +++ b/Mac/Lib/mkcwproject/cwxmlgen.py @@ -53,6 +53,8 @@ class ProjectBuilder: dict['stdlibraryflags'] = 'Debug' if not dict.has_key('libraryflags'): dict['libraryflags'] = 'Debug' + if not dict.has_key('initialize'): + dict['initialize'] = '__initialize' if not dict.has_key('mac_sysprefixtype'): if os.path.isabs(dict['sysprefix']): dict['mac_sysprefixtype'] = 'Absolute' diff --git a/Mac/Lib/mkcwproject/template-carbon/template.prj.xml b/Mac/Lib/mkcwproject/template-carbon/template.prj.xml index d0550f5918..5c426a19b3 100644 --- a/Mac/Lib/mkcwproject/template-carbon/template.prj.xml +++ b/Mac/Lib/mkcwproject/template-carbon/template.prj.xml @@ -558,7 +558,7 @@ MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__initialize + MWLinker_PPC_initname%(initialize)s MWLinker_PPC_mainname MWLinker_PPC_termname__terminate diff --git a/Mac/Lib/mkcwproject/template-ppc/template.prj.xml b/Mac/Lib/mkcwproject/template-ppc/template.prj.xml index 0c79f67824..65ca175ec3 100644 --- a/Mac/Lib/mkcwproject/template-ppc/template.prj.xml +++ b/Mac/Lib/mkcwproject/template-ppc/template.prj.xml @@ -549,7 +549,7 @@ MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__initialize + MWLinker_PPC_initname%(initialize)s MWLinker_PPC_mainname MWLinker_PPC_termname__terminate diff --git a/Mac/scripts/genpluginprojects.py b/Mac/scripts/genpluginprojects.py index 1286993b0f..3e2e443473 100644 --- a/Mac/scripts/genpluginprojects.py +++ b/Mac/scripts/genpluginprojects.py @@ -36,16 +36,17 @@ def genpluginproject(architecture, module, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", - libraryflags=None, stdlibraryflags=None, prefixname=None): + libraryflags=None, stdlibraryflags=None, prefixname=None, + initialize=None): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir, libraryflags, - stdlibraryflags, prefixname) + stdlibraryflags, prefixname, initialize) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir, libraryflags, - stdlibraryflags, prefixname) + stdlibraryflags, prefixname, initialize) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) @@ -99,6 +100,8 @@ def genpluginproject(architecture, module, dict['libraryflags'] = libraryflags if stdlibraryflags: dict['stdlibraryflags'] = stdlibraryflags + if initialize: + dict['initialize'] = initialize mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename)