$NetBSD: patch-ad,v 1.15 2009/06/10 17:28:07 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_DATA_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_DATA_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