Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#13 No facility for building dynamic library version

open
libmcal (9)
5
2000-02-04
2000-01-24
Ron Saad
No

As supplied, the makefile for libmcal only builds libmcal.a. To run php+mcal as a DSO for apache requires a libmcal.so. Here's a kludgy patch for creating the .so. It needs clean up to run better from configure, to use version numbers on the .so, etc. In the meantime it allows me to build and run php4beta3+mcal as a DSO on apache 1.3.9.

*** Makefile.in.orig Sun Jan 23 15:08:18 2000
--- Makefile.in Mon Jan 24 11:41:17 2000
***************
*** 10,12 ****

! CFLAGS=-O0 -Wall -g ${INCLUDE}

--- 10,12 ----

! CFLAGS=-O0 -Wall -g -fpic -fPIC ${INCLUDE}

***************
*** 16,28 ****
OTHERLIBDIR=${OTHERLIBDIR}

LIBCAL=libmcal.a

- all: libmcal.a

- install: libmcal.a
- mkdir /usr/local/mcal
- mkdir /usr/local/mcal/lib
- mkdir /usr/local/mcal/include
- cp libmcal.a /usr/local/mcal/lib
- cp mcal.h bool.h datetime.h drivers.h /usr/local/mcal/include
libmcal.a: $(LIBOBJS)
--- 16,40 ----
OTHERLIBDIR=${OTHERLIBDIR}
+ INSTALL=install
+ # This should really get cleaned up to work from configure:
+ LIBDIR=/usr/local/mcal/lib
+ INCDIR=/usr/local/mcal/include
+ LIBSODIR=/usr/local/lib

LIBCAL=libmcal.a
+ LIBCALSO=libmcal.so
+
+ all: $(LIBCAL) $(LIBCALSO)
+
+ install: $(LIBCAL) $(LIBCALSO)
+ - mkdir -p $(LIBDIR)
+ - mkdir -p $(INCDIR)
+ cp libmcal.a $(LIBDIR)
+ cp mcal.h bool.h datetime.h drivers.h $(INCDIR)
+ rm -f $(LIBSODIR)/libmcal.so.1.0 $(LIBSODIR)/libmcal.so.1 $(LIBSODIR)/libmcal.so
+ $(INSTALL) -m 644 libmcal.so.1.0 $(LIBSODIR)/libmcal.so.1.0
+ ln -s $(LIBSODIR)/libmcal.so.1.0 $(LIBSODIR)/libmcal.so.1
+ ln -s $(LIBSODIR)/libmcal.so.1 $(LIBSODIR)/libmcal.so
+ /sbin/ldconfig

libmcal.a: $(LIBOBJS)
***************
*** 31,32 ****
--- 43,51 ----

+ libmcal.so: $(LIBOBJS)
+ rm -f $@.1.0 $@.1 $@
+ $(CC) -shared -Wl,-soname,$@.1 -o $@.1.0 $(LIBOBJS)
+ ln -s $@.1.0 $@.1
+ ln -s $@.1 $@
+
+
tester: tester.o libmcal.a
***************
*** 35,37 ****
clean:
! rm -f *.o $(LIBCAL) tester

--- 54,56 ----
clean:
! rm -f *.o $(LIBCAL) libmcal.so* tester

Discussion

  • Robert Allen
    Robert Allen
    2000-02-04

    • assigned_to: nobody --> askalski
    • status: Error - status not found --> open