www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Request: How to convert to library?

reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
I have 94 D files that I'd like to convert to a library, since it's a pain
for others to compile all that. Can someone please guide me through the
process of how this works? Also, are there any tools out there to strip the
implementation from each class (for those who need just the declarations
stubs) ?

Thanks much ...
Jun 07 2004
next sibling parent reply Ilya Minkov <minkov cs.tum.edu> writes:
Kris schrieb:

 I have 94 D files that I'd like to convert to a library, since it's a pain
 for others to compile all that. Can someone please guide me through the
 process of how this works? Also, are there any tools out there to strip the
 implementation from each class (for those who need just the declarations
 stubs) ?
 
 Thanks much ...

I liked how DIG made its installation. It is distributed with full source. Then there is a batch file which compiles the compiler driver, digc, and makes digc compile the library, strip it of implementation (optionally), and puts the result into the DMD tree. A recent vesion of DIG ist "unDig" at dsource. -eye
Jun 07 2004
parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
Cheers Ilya; I'll give that a try.

- Kris

"Ilya Minkov" <minkov cs.tum.edu> wrote in message
news:ca1eeh$2bt5$2 digitaldaemon.com...
 Kris schrieb:

 I have 94 D files that I'd like to convert to a library, since it's a


 for others to compile all that. Can someone please guide me through the
 process of how this works? Also, are there any tools out there to strip


 implementation from each class (for those who need just the declarations
 stubs) ?

 Thanks much ...

I liked how DIG made its installation. It is distributed with full source. Then there is a batch file which compiles the compiler driver, digc, and makes digc compile the library, strip it of implementation (optionally), and puts the result into the DMD tree. A recent vesion of DIG ist "unDig" at dsource. -eye

Jun 07 2004
prev sibling next sibling parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Kris wrote:

I have 94 D files that I'd like to convert to a library, since it's a pain
for others to compile all that. Can someone please guide me through the
process of how this works? Also, are there any tools out there to strip the
implementation from each class (for those who need just the declarations
stubs) ?

Thanks much ...
  

to use doxygen, even if you haven't done the documentation in the right format. Although the comments may need a little tweaking to get doxygen to work correctly with it (such as telling doxygen to ignore parts of the code). -- -Anderson: http://badmama.com.au/~anderson/
Jun 07 2004
parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
Using doxygen is a fine idea. However, it barfs over all kinds of things
'D', such as nested classes/functions; and there's some D sysntax that
causes it to ignore all following methods and classes within a module ...

Thanks though;

- Kris

"J Anderson" <REMOVEanderson badmama.com.au> wrote in message
news:ca1g22$2epm$1 digitaldaemon.com...
 Kris wrote:

I have 94 D files that I'd like to convert to a library, since it's a


for others to compile all that. Can someone please guide me through the
process of how this works? Also, are there any tools out there to strip


implementation from each class (for those who need just the declarations
stubs) ?

Thanks much ...

to use doxygen, even if you haven't done the documentation in the right format. Although the comments may need a little tweaking to get doxygen to work correctly with it (such as telling doxygen to ignore parts of the code). -- -Anderson: http://badmama.com.au/~anderson/

Jun 07 2004
prev sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Kris wrote:
 I have 94 D files that I'd like to convert to a library, since it's a pain
 for others to compile all that. Can someone please guide me through the
 process of how this works? 

You'd probably want to use the Digital Mars LIB program: http://www.digitalmars.com/ctg/lib.html dmd mod1.d mod2.d mod3.d mod4.d -c lib -c mylib.lib mod1.obj mod2.obj mod3.obj mod4.obj This creates a library named mylib.lib. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 07 2004
parent reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
Thanks JCC; that looks straightforward!

Do you know of some other method to strip implementation out of modules, so
there's just the stubs left? Not that I'm against distributing source or
anything, but sometimes it's just more convenient to have the stubs instead
(otherwise, there's not much benefit over compiling the whole thing to begin
with :-)


"J C Calvarese" <jcc7 cox.net> wrote in message
news:ca2bjt$o1f$1 digitaldaemon.com...
 Kris wrote:
 I have 94 D files that I'd like to convert to a library, since it's a


 for others to compile all that. Can someone please guide me through the
 process of how this works?

You'd probably want to use the Digital Mars LIB program: http://www.digitalmars.com/ctg/lib.html dmd mod1.d mod2.d mod3.d mod4.d -c lib -c mylib.lib mod1.obj mod2.obj mod3.obj mod4.obj This creates a library named mylib.lib. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/

Jun 07 2004
next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Kris wrote:
 Thanks JCC; that looks straightforward!
 
 Do you know of some other method to strip implementation out of modules, so
 there's just the stubs left? Not that I'm against distributing source or
 anything, but sometimes it's just more convenient to have the stubs instead
 (otherwise, there's not much benefit over compiling the whole thing to begin
 with :-)

The strip.d code in DIG is the best I know of, but it doesn't work in all cases. Particular rough spots include things that have changed to D since Burton's last release. WYSIWYG strings used to be 'someString' and now they're `someString` or r"someString". Well, IIRC, there are 3 different functions that have to be adjusted to fix this. I'm sure it can be improved, but whenever I look at it my head starts to hurt. For example, it uses all kinds of pointer tricks for manipulating strings. I'm sure it makes sense for someone who's used to C/C++, but it just seems like a very un-D way of doing things to me.
 "J C Calvarese" <jcc7 cox.net> wrote in message
 news:ca2bjt$o1f$1 digitaldaemon.com...
 
Kris wrote:

I have 94 D files that I'd like to convert to a library, since it's a


pain
for others to compile all that. Can someone please guide me through the
process of how this works?

You'd probably want to use the Digital Mars LIB program: http://www.digitalmars.com/ctg/lib.html dmd mod1.d mod2.d mod3.d mod4.d -c lib -c mylib.lib mod1.obj mod2.obj mod3.obj mod4.obj This creates a library named mylib.lib. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/


-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 07 2004
parent J C Calvarese <jcc7 cox.net> writes:
J C Calvarese wrote:
 Kris wrote:
 
 Thanks JCC; that looks straightforward!

 Do you know of some other method to strip implementation out of 
 modules, so
 there's just the stubs left? Not that I'm against distributing source or
 anything, but sometimes it's just more convenient to have the stubs 
 instead
 (otherwise, there's not much benefit over compiling the whole thing to 
 begin
 with :-)

The strip.d code in DIG is the best I know of, but it doesn't work in all cases. Particular rough spots include things that have changed to D since Burton's last release. WYSIWYG strings used to be 'someString' and now they're `someString` or r"someString". Well, IIRC, there are 3 different functions that have to be adjusted to fix this. I'm sure it can be improved, but whenever I look at it my head starts to hurt. For example, it uses all kinds of pointer tricks for manipulating strings. I'm sure it makes sense for someone who's used to C/C++, but it just seems like a very un-D way of doing things to me.

Okay, I just committed some improvements to SVN. I'm sure there are still some weakness in the way it works (it could malfunction on certain r"soemString" strings). I haven't tested it thoroughly, but it now passes some tests that it failed before. I haven't made a new .zip file, but you can just grab the source file or binary file out of the SVN browser, as I explain in the thread: http://www.dsource.org/forums/viewtopic.php?t=196 -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 07 2004
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Kris" <someidiot earthlink.dot.dot.dot.net> wrote in message
news:ca2ioc$13d6$1 digitaldaemon.com...
 Thanks JCC; that looks straightforward!

 Do you know of some other method to strip implementation out of modules,

 there's just the stubs left? Not that I'm against distributing source or
 anything, but sometimes it's just more convenient to have the stubs

 (otherwise, there's not much benefit over compiling the whole thing to

 with :-)

When importing a file, it doesn't do a full compile on it unless it is in the command line to DMD. Otherwise, it just does a parse, which is pretty quick.
Jun 09 2004
parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
"Walter"  wrote
 When importing a file, it doesn't do a full compile on it unless it is in
 the command line to DMD. Otherwise, it just does a parse, which is pretty
 quick.

Thanks Walter; that's good to know.
Jun 09 2004