SCons, D, and shared objects

Russel Winder <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <[email protected]>
In the beginning, DMD always created statically linked executables and
static libraries. Go has gone that route as well. However to interwork
with C and C++, D has had to embrace shared objects. I had begun to
hack something together in the dmd, ldc, and gdc tools sometime back.
Now for SCons 3.0 I'd like to have it working properly. On Linux and
UNIX with dmd and ldc anyway. OSX and macOS remain a problem for dmd,
and gdc hasn't really caught up yet.

There is a problem.

The C and C++ tools assume that on Linux for shared libraries creation,
the objects should have the extension .os instead of .o. The D
compilers do not accept this, they demand .o extension. So what is the
problem? SHOBJSUFFIX. This is a global value shared by all tools. The
default is .o. One of the C or C++ compiler tools sets it to .os. This
is not a problem for builds that explicitly declare environments and
limit the tools to D tools – which is what I do for all my builds which
is why the problem has only recent;y come to light. If you use not
envronment or a new environment with no tools specification you get all
the tools and so the extension is forced to .os and all D compilations
for shared libraries fail.

So my problem is how to incorporate a SHDOBJSUFFIX so as to separate D
builds to work around this problem. What I need to know is where the
TARGET symbol is construction so I can create a variant of the default
for the D tooling. All the compilation commands rely on TARGET and
SOURCE and TARGET appears always to use SHOBJSUFFIX for shared object
building.

Sorry about the long explanation. I am hoping that I have just missed
something very simple, and that someone can tell me what this is – or
at least point me int he right direction.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[email protected]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEETwDs1X+Beyaiaer41L3V0s7Np7gFAllKTP0ACgkQ1L3V0s7N
p7ghdxAAgJovgx5qWOLG/9zYEqkiHFxsJ/eisMJQhd8FXqbFxUVN4Erl+s1aK6Qm
kY3dMba6iCNiM62BNyvVlbmuey+koOX5XxaIW4euo41usz+swyt5jFz11KMVfnSI
DwKR5rZvJYSalHEGlcBt0CEipQmcM3hinr2wg1TJEI/WYnFUwLEMA15lxxR5iXYg
9g5fazhlbzV41Kaev3kub3L51bgNShnAm7mSJsNNCHxNPTNSv3pqV5SFszbfSamE
qLR012CyfqvhUnsY/Vg4P7SibOmIvmk4+gywuBAm+GuPXiovwbahJLLPvtn5DM8T
nyzHBfEA46gK2p6G9m8PG0ZDqu4Gng+93sWUS/B4HrLvO6qlM26a9RagJsdpjlo3
pIoYLl70JGW4nZLvrPEXNVVSUtPRMZtgxrwXmReJIYDdUkXotz9XWhEpwbK51wH6
PUr2uVjQ0PbSxltZ6LgqDjENH8Z6DcqoO9qT0Wb+PsYl3ssEc0YozueESb/Juk+H
58zXZsosLxsS1+xSmss1C/ppjZtD0X/wUb8NBEnE26MnMwmmVcF3ejfGnW6A+oUY
AMFpcfLu34ceoyu3L8tXRPssPC41NbQ3mK6TkWLyevshKMe5JNUqPyXUw4NgJwPN
FLo6wG6CY/5ut7O+EQkxIy1kKKD+auMBNbUhXzgU1aWXgBQR5wo=
=DEtX
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.