libcgi/libcgi-1.0-Makefile.in.patch

88 lines
2.6 KiB
Diff
Raw Normal View History

--- libcgi-1.0-orig/Makefile.in 2008-10-26 11:28:48.000000000 +0100
+++ libcgi-1.0/Makefile.in 2008-10-26 12:09:38.000000000 +0100
@@ -5,22 +5,28 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
-SHAREDOPT = -shared
+SOVERSION = $(SOMAJOR).$(SOMINOR)
+SHAREDOPT = -shared -fPIC -Wl,-soname,libcgi.so.$(SOVERSION)
LIBDIR = $(prefix)/lib
INCDIR = $(prefix)/include
-MANDIR = $(prefix)/man/man3
+MANDIR = $(prefix)/share/man/man3
SHELL = /bin/sh
EXTRA_LIBS =
INCS = -Isrc
-FLAGS = -Wall -fpic
+CFLAGS = @CFLAGS@
OBJS = src/error.o src/cgi.o src/session.o src/base64.o src/md5.o \
src/string.o src/general.o src/list.o src/cookie.o
-.c.o: $(CC) $(FLAGS) -c $<
+%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
-all: $(OBJS) src/libcgi.so
+%.sh.o: %.c
+ $(CC) $(CFLAGS) -fPIC -o $@ -c $<
+
+
+all: src/libcgi.so.$(SOVERSION) src/libcgi.a
@echo ""
@echo ""
@@ -42,20 +48,24 @@
@echo ""
-shared: src/libcgi.so
- cp src/libcgi.so $(LIBDIR)
+shared: src/libcgi.so.$(SOVERSION)
+ cp -p src/libcgi.so.$(SOVERSION) $(LIBDIR)
src/libcgi.a: $(OBJS)
$(AR) rc src/libcgi.a $(OBJS)
-src/libcgi.so: src/libcgi.a
- $(CC) $(SHAREDOPT) -o src/libcgi.so $(OBJS) $(EXTRA_LIBS)
+src/libcgi.so.$(SOVERSION): $(SHOBJS)
+ $(CC) $(SHAREDOPT) -o src/libcgi.so.$(SOVERSION) $(SHOBJS) $(EXTRA_LIBS)
-install:
- cp src/libcgi.a $(LIBDIR)
- cp src/libcgi.so $(LIBDIR)
- cp src/cgi.h $(INCDIR)
- cp src/session.h $(INCDIR)
+install: src/libcgi.so.$(SOVERSION) src/libcgi.a
+ [ -d $(DESTDIR)/$(LIBDIR) ] || mkdir -p -m 0755 $(DESTDIR)/$(LIBDIR)
+ cp -p src/libcgi.a $(DESTDIR)$(LIBDIR)
+ cp -p src/libcgi.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)
+ ln -sf libcgi.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libcgi.so.$(SOMAJOR)
+ ln -sf libcgi.so.$(SOMAJOR) $(DESTDIR)$(LIBDIR)/libcgi.so
+ [ -d $(DESTDIR)/$(INCDIR) ] || mkdir -p -m 0755 $(DESTDIR)/$(INCDIR)
+ cp -p src/cgi.h $(DESTDIR)$(INCDIR)
+ cp -p src/session.h $(DESTDIR)$(INCDIR)
src/error.o: src/error.c src/error.h
@@ -79,10 +89,10 @@
rm -f $(MANDIR)/libcgi*
install_man:
- cp doc/man/man3/libcgi_base64.3 $(MANDIR)
- cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
- cp doc/man/man3/libcgi_general.3 $(MANDIR)
- cp doc/man/man3/libcgi_string.3 $(MANDIR)
- cp doc/man/man3/libcgi_session.3 $(MANDIR)
- cp doc/man/man3/libcgi_cookie.3 $(MANDIR)
+ [ -d $(DESTDIR)/$(MANDIR) ] || mkdir -p -m 0755 $(DESTDIR)/$(MANDIR)
+ cp -p doc/man/man3/libcgi_cgi.3 $(DESTDIR)$(MANDIR)
+ cp -p doc/man/man3/libcgi_general.3 $(DESTDIR)$(MANDIR)
+ cp -p doc/man/man3/libcgi_string.3 $(DESTDIR)$(MANDIR)
+ cp -p doc/man/man3/libcgi_session.3 $(DESTDIR)$(MANDIR)
+ cp -p doc/man/man3/libcgi_cookie.3 $(DESTDIR)$(MANDIR)