Re: How to create a DLL ?
Re: How to create a DLL ?
- Subject: Re: How to create a DLL ?
- From: "Michael B Allen" <email@hidden>
- Date: Sat, 7 May 2005 04:44:28 -0400 (EDT)
- Importance: Normal
Brian Jorgage said:
> I have a command-line user-space application with several methods which
> I would like to put into a "DLL".
>
> How to create a DLL on Mac OS X ?
gcc -g -Wall -W -fPIC -c -o src/foo.o src/foo.c
gcc -g -Wall -W -fPIC -c -o src/bar.o src/bar.c
gcc -g -Wall -W -fPIC -c -o src/zap.o src/zap.c
gcc -dynamiclib -install_name libyoyo.0.9.dylib \
src/foo.o src/bar.o src/zap.o -o libyoyo.0.9.1.dylib
I just started compiling my stuff for OS X and wrote a simple compiler
wrapper that takes normalized compiler arguments and calls the local
compiler with appropriate transliterated arguments. It's call mktool. You
can find it on the top level directory of any of my OSS projects:
http://www.ioplex.com/~miallen/libmba/dl/mktool.c
For example if you do:
./mktool -l -libname yoyo -libvers 0.9.1 \
-shared -soname src/foo.o src/bar.o src/zap.o
this will invoke the local compiler to build a library and works equally
well on Linux, HP-UX, Tru64, and Mac OS X with gcc, DECC, and aCC.
And mktool.c is one small ANSI C file so it can be included as a source
file with your project and compiled as a "bootstrap" target like:
all: mktool
<build app with ./mktool here>
mktool: mktool.c
$(CC) -o mktool mktool.c
It's basically a /greatly/ simplified libtool.
> Is this the same thing as a .so file ?
Yes. For the Mach-O runtime it's called a dylib.
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden