summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/patches/patch-ad
blob: 651a0631cdac1df8bd81e619cbb37ed10fb9b3b9 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$NetBSD: patch-ad,v 1.14 2009/06/05 11:10:35 wiz Exp $

--- src/mesa/Makefile.orig	2009-03-13 05:28:49 +0200
+++ src/mesa/Makefile	2009-05-17 16:29:41 +0300
@@ -9,19 +9,22 @@ include sources
 .SUFFIXES : .cpp
 
 .c.o:
-	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+	$(LIBTOOL) --mode=compile --tag=CC \
+	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(COPTS) $< -o $(@:.o=.lo)
 
 .cpp.o:
-	$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
+	$(LIBTOOL) --mode=compile --tag=CXX \
+	$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $(@:.o=.lo)
 
 .S.o:
-	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+	$(LIBTOOL) --mode=compile --tag=CC \
+	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(COPTS) $< -o $(@:.o=.lo)
 
 
 
 # Default: build dependencies, then asm_subdirs, then convenience
 # libs (.a) and finally the device drivers:
-default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
+default: depend asm_subdirs libmesa.la libglapi.la driver_subdirs
 
 
 
@@ -29,17 +32,19 @@ default: depend asm_subdirs libmesa.a li
 # Helper libraries used by many drivers:
 
 # Make archive of core mesa object files
-libmesa.a: $(MESA_OBJECTS)
-	@ $(MKLIB) -o mesa -static $(MESA_OBJECTS)
+libmesa.la: $(MESA_OBJECTS)
+	$(LIBTOOL) --mode=link $(CC) -o $@ $(MESA_OBJECTS:.o=.lo) \
+	-static -avoid-version
 
 # Make archive of gl* API dispatcher functions only
-libglapi.a: $(GLAPI_OBJECTS)
-	@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
+libglapi.la: $(GLAPI_OBJECTS)
+	$(LIBTOOL) --mode=link $(CC) -o $@ $(GLAPI_OBJECTS:.o=.lo) \
+	-static -avoid-version
 
 
 ######################################################################
 # Device drivers
-driver_subdirs: libmesa.a libglapi.a
+driver_subdirs: libmesa.la libglapi.la
 	(cd drivers && $(MAKE))
 
 
@@ -113,23 +118,27 @@ osmesa.pc: osmesa.pc.in
 	$(osmesa_pcedit) $< > $@
 
 install-headers:
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
-	$(INSTALL) -m 644 $(TOP)/include/GL/*.h \
-		$(DESTDIR)$(INSTALL_INC_DIR)/GL
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/include/GL
 
 install-libgl: default gl.pc install-headers
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
-	$(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \
-		$(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+	$(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/lib
+	$(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/lib/pkgconfig
+	@if [ -f "$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la)" ]; then \
+		$(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) \
+			$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) \
+			$(DESTDIR)$(INSTALL_DIR)/lib; \
+	fi
+	$(BSD_INSTALL_DATA) gl.pc $(DESTDIR)$(INSTALL_DIR)/lib/pkgconfig
 
 install-osmesa: default osmesa.pc
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
-	$(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \
-		$(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -m 644 osmesa.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+	$(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/lib
+	$(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/lib/pkgconfig
+	@if [ -f "$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la)" ]; then \
+		$(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) \
+			$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la) \
+			$(DESTDIR)$(INSTALL_DIR)/lib; \
+	fi
+	$(BSD_INSTALL_DATA) osmesa.pc $(DESTDIR)$(INSTALL_DIR)/lib/pkgconfig
 
 install-dri: default
 	cd drivers/dri && $(MAKE) install
@@ -144,7 +153,7 @@ tags:
 clean:
 	-rm -f */*.o
 	-rm -f */*/*.o
-	-rm -f depend depend.bak libmesa.a libglapi.a
+	-rm -f depend depend.bak libmesa* libglapi*
 	-rm -f drivers/*/*.o
 	-rm -f *.pc
 	-@cd drivers/dri && $(MAKE) clean