summaryrefslogtreecommitdiff
path: root/graphics/lib3ds/patches/patch-ab
blob: c19833201fe7c598b7d26d646b4a61adb4d26492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$NetBSD: patch-ab,v 1.1 2003/05/24 09:32:34 salo Exp $

--- lib3ds/Makefile.in.orig	2002-01-14 15:24:32.000000000 +0100
+++ lib3ds/Makefile.in	2003-05-24 10:45:16.000000000 +0200
@@ -85,6 +85,7 @@
 INCLUDES = -I$(top_srcdir)
 
 lib_LIBRARIES = lib3ds.a
+lib_SHLIBRARIES= lib3ds.so.1
 
 lib3ds_a_SOURCES = \
   io.c \
@@ -139,7 +140,7 @@
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
-LIBRARIES =  $(lib_LIBRARIES)
+LIBRARIES =  $(lib_LIBRARIES) $(lib_SHLIBRARIES)
 
 
 DEFS = @DEFS@ -I. -I$(srcdir) -I..
@@ -150,6 +151,7 @@
 lib3ds_a_OBJECTS =  io.o float.o vector.o matrix.o quat.o tcb.o ease.o \
 chunk.o file.o background.o atmosphere.o shadow.o viewport.o material.o \
 mesh.o camera.o light.o tracks.o node.o
+lib3ds_so_OBJECTS = $(lib3ds_a_OBJECTS:S/.o$/.so/)
 AR = ar
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -169,7 +171,7 @@
 
 all: all-redirect
 .SUFFIXES:
-.SUFFIXES: .S .c .o .s
+.SUFFIXES: .S .c .o .s .so
 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
 	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib3ds/Makefile
 
@@ -187,10 +189,10 @@
 
 maintainer-clean-libLIBRARIES:
 
-install-libLIBRARIES: $(lib_LIBRARIES)
+install-libLIBRARIES: $(lib_LIBRARIES) $(lib_SHLIBRARIES)
 	@$(NORMAL_INSTALL)
 	$(mkinstalldirs) $(DESTDIR)$(libdir)
-	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	@list='$(lib_LIBRARIES) $(lib_SHLIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
 	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
 	    $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
@@ -203,6 +205,8 @@
 	    $(RANLIB) $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
+	cd $(DESTDIR)$(libdir); \
+	  ln -sf $(lib_SHLIBRARIES) $(lib_SHLIBRARIES:S/.1$//)
 
 uninstall-libLIBRARIES:
 	@$(NORMAL_UNINSTALL)
@@ -219,6 +223,9 @@
 .S.o:
 	$(COMPILE) -c $<
 
+.c.so:
+	$(COMPILE) -fpic -DPIC -c $< -o $(.TARGET)
+
 mostlyclean-compile:
 	-rm -f *.o core *.core
 
@@ -234,6 +241,10 @@
 	$(AR) cru lib3ds.a $(lib3ds_a_OBJECTS) $(lib3ds_a_LIBADD)
 	$(RANLIB) lib3ds.a
 
+lib3ds.so.1: $(lib3ds_so_OBJECTS) $(lib3ds_a_DEPENDENCIES)
+	$(CC) -shared -o lib3ds.so.1 -Wl,-soname=lib3ds.so.1 $(lib3ds_so_OBJECTS) $(lib3ds_a_LIBADD)
+	ln -sf lib3ds.so.1 lib3ds.so
+
 install-lib3dsHEADERS: $(lib3ds_HEADERS)
 	@$(NORMAL_INSTALL)
 	$(mkinstalldirs) $(DESTDIR)$(lib3dsdir)