[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Generating VC6 project files for swig bindings

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-06-17 02:21:31 CEST

I finally had time to take a closer look at this patch.

> Index: build/generator/msvc_dsp.ezt
> ===================================================================
> --- build/generator/msvc_dsp.ezt (revision 6221) +++
> build/generator/msvc_dsp.ezt (working copy) @@ -46,7 +46,7 @@ # ADD
> RSC /l [if-any is_exe]0x409[else]0x424[end] /d [is configs.name
> "Debug"]"_DEBUG"[else]"NDEBUG"[end] BSC32=bscmake.exe LINK32=link.exe
> -[if-any is_exe is_apache_mod]# ADD LINK32 /nologo[if-any is_exe]
> /subsystem:console[end][if-any is_apache_mod] /dll[end] /debug
> /machine:IX86[for configs.libs] [configs.libs][end][for
> configs.libdirs] /libpath:"[configs.libdirs]"[end]
> /out:"[rootpath]\[configs.name]\[target.path]\[target.output_name]"[if-any
> instrument_purify_quantify] /fixed:no[end] +[if-any is_exe is_dll]#
> ADD LINK32 /nologo[if-any is_exe] /subsystem:console[end][if-any
> is_dll] /dll[end] /debug /machine:IX86[for configs.libs]
> [configs.libs][end][for configs.libdirs]
> /libpath:"[configs.libdirs]"[end]
> /out:"[rootpath]\[configs.name]\[target.path]\[target.output_name]"[if-any
> instrument_purify_quantify] /fixed:no[end] [end][end][end][end][end]
> !ENDIF

This looks fine at second glance. Sorry about jumping at you about the
is_dll issue before.

> Index: build/generator/gen_msvc_dsp.py
> ===================================================================
> --- build/generator/gen_msvc_dsp.py (revision 6221) +++
> build/generator/gen_msvc_dsp.py (working copy) @@ -43,6 +43,12 @@ elif
> isinstance(target, gen_base.TargetExternal): targtype = "Win32 (x86)
> External Target" targval = "0x0106" + elif isinstance(target,
> gen_base.SWIGLibrary): + targtype = "Win32 (x86) Dynamic-Link Library"
> + targval = "0x0102" + target.output_name =
> os.path.basename(target.fname) + target.desc = None +
> target.is_apache_mod = 0

Surely the last two lines aren't necessary? target.is_apache_mod should
never be set in build.conf for SWIG targets. OTOH, target.desc could be
quite useful to put version info into the Python extension DLLs.

> @@ -61,7 +67,31 @@ rsrc = string.replace(os.path.join(rootpath, src),
> os.sep, '\\') if '-' in rsrc: rsrc = '"%s"' % rsrc -
> sources.append(_item(path=rsrc, reldir=reldir)) +
> sources.append(_item(path=rsrc, reldir=reldir, custom_build=None)) + +
> if isinstance(target, gen_base.SWIGLibrary): + for obj in
> self.graph.get_sources(gen_base.DT_LINK, target): + if isinstance(obj,
> gen_base.SWIGObject): + for cobj in
> self.graph.get_sources(gen_base.DT_OBJECT, obj): + if isinstance(cobj,
> gen_base.SWIGObject): + csrc = rootpath + '\\' +
> string.replace(cobj.fname, '/', '\\') +
> sources.append(_item(path=csrc, reldir=None, custom_build=None)) + +
> for ifile in self.graph.get_sources(gen_base.DT_SWIG_C, cobj): + isrc
> = rootpath + '\\' + string.replace(ifile, '/', '\\') + + cb =
> 'InputPath=%s\r\n\r\n' \ + + '"%s" : $(SOURCE) "$(INTDIR)"
> "$(OUTDIR)"\r\n' \ + + '\tswig -%s -noproxy -I%s -I%s -I%s -o %s
> $(InputPath)' + + cb = cb % (isrc, csrc, target.lang, + rootpath +
> '\\subversion\\bindings\\swig', + rootpath + '\\subversion\\include',
> + rootpath + '\\apr\\include', + csrc)

These include paths should be generated in the template, using the
includes data item. The same probably goes for expanding target.lang,
and I suspect that isrc and csrc could be passed to EZT, too.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 17 02:22:18 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.