slackbuilds_ponce/libraries/compface/compface-sharedlib.patch

47 lines
1.3 KiB
Diff
Raw Normal View History

--- compface-1.5.2.orig/Makefile.in 2005-10-04 14:59:49.000000000 +0200
+++ compface-1.5.2/Makefile.in 2013-02-28 00:12:27.888027519 +0100
@@ -24,6 +24,7 @@
EXECUTABLE = $(BINDIR)/$(NAMEEXE)
UNEXECUTABLE = $(BINDIR)/$(UNNAMEEXE)
LIBNAME = lib$(NAME).a
+SOLIBNAME = lib$(NAME).so
LIBRARY = $(LIBDIR)/$(LIBNAME)
MAN1DIR = $(MANDIR)/man1
MAN3DIR = $(MANDIR)/man3
@@ -41,15 +42,16 @@
CFLAGS = @CFLAGS@
DEFS = @DEFS@ -DHAVE_CONFIG_H
LDFLAGS = @LDFLAGS@
+SHLDFLAGS = -L. -lcompface
LIBS = @LIBS@
-all: $(NAMEEXE) $(UNNAMEEXE)
+all: shared $(NAMEEXE) $(UNNAMEEXE)
-$(NAMEEXE) : cmain.o compface.o $(LIBNAME)
- $(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)
+$(NAMEEXE) : cmain.o compface.o
+ $(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ cmain.o compface.o
$(UNNAMEEXE) : uncmain.o $(LIBNAME)
- $(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME)
+ $(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ uncmain.o
$(LIBNAME) : $(OBJECTS)
ar rc $(LIBNAME) $(OBJECTS)
@@ -92,6 +94,14 @@
shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
compress $(NAME).sh
+static: $(OBJECTS)
+ ar rc $(LIBNAME) $(OBJECTS)
+ -ranlib $(LIBNAME)
+
+shared: $(OBJECTS)
+ $(CC) -shared -Wl,-soname,$(SOLIBNAME).1 $(LDFLAGS) -o $(SOLIBNAME).1.5.2 $(OBJECTS)
+ ln -sf $(SOLIBNAME).1.5.2 $(SOLIBNAME)
+
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<