[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: expat as a shared library

  • From: Brian Hurt <bhurt@t...>
  • To: Steve Ball <Steve.Ball@z...>
  • Date: Sun, 23 Nov 2008 04:31:58 -0600 (CST)


On Tue, 16 Nov 1999, Steve Ball wrote:

> Brian Hurt wrote:
> > 
> > I'm looking at building expat as a shared library (.so) on linux
> Building a shared library is quite easy.  TclExpat builds expat in the
> usual way, but adds the -PIC flag.  It then takes the object files and
> constructs the shared library.  The know-how on how to do that on various
> platforms is actually taken from the Tcl configuration, since Tcl is
> very good at determining which compile and link flags are ncessary.
> I can dig up some more specific details if you require.

Oh, how to do it was easy (see diff file at the end of this message).  I
was more wondering if this ground had been covered before and I was just
missing it.

Here's the diff.  It's short, so I hope I don't offend people by posting
it.  I haven't actually linked the output to anything yet, and you need to
put LDFLAGS=-shared on the make command line.  But I poked through the
resultant .so and things look good.

Index: Makefile
RCS file: /UTC1/cvsroot/utc/clib/expat/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile	1999/11/15 20:23:31	1.1
+++ Makefile	1999/11/15 22:30:20	1.2
@@ -16,6 +16,10 @@
   xmlparse/xmlparse.o \
   xmlparse/hashtable.o \
+LOBJS=xmltok/xmltok.o \
+  xmltok/xmlrole.o \
+  xmlparse/xmlparse.o \
+  xmlparse/hashtable.o
 all: xmlwf/xmlwf$(EXE)
@@ -23,8 +27,16 @@
 xmlwf/xmlwf$(EXE): $(OBJS)
 	$(CC) $(CFLAGS) -o $@ $(OBJS)
+libexpat.so: $(LOBJS)
+	$(LD) $(LDFLAGS) -o $@ $(LOBJS)
+	install -m 644 -g 0 -o 0 libexpat.so /usr/lib
+	install -m 644 -g 0 -o 0 xmltok/xmltok.h /usr/include
+	install -m 644 -g 0 -o 0 xmlparse/xmlparse.h /usr/include
-	rm -f $(OBJS) xmlwf/xmlwf$(EXE)
+	rm -f $(OBJS) xmlwf/xmlwf$(EXE) libexpat.so
 xmltok/nametab.h: gennmtab/gennmtab$(EXE)
 	rm -f $@

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.