diff options
author | Matt Turner <mattst88@gmail.com> | 2012-09-13 10:45:01 -0700 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2012-12-06 11:53:39 +0100 |
commit | 72055496c9577a2b08022d1862700b541bc81acf (patch) | |
tree | 076fa3d67bb7250bbcbebe627fc1ffaebcaa7f29 | |
parent | 97e0015b11d51aee26d6cea1ab5aa3a8a23cc7b5 (diff) |
targets/pipe-loader: Convert to automake
C++ linking (controlled by the nodist_EXTRA idiom) is needed
unconditionally for:
nouveau (uses C++ in the driver)
r300 (since LLVM is always required)
radeonsi (since LLVM is always required)
swrast (if builting LLVM pipe)
and conditionally (depends whether LLVM is enabled) for
i915
r600
vmwgfx
and never needed for swrast (softpipe).
Unfortunately, automake seems to *always* link with C++ if nodist_EXTRA
is specified, even inside a false conditional. Not sure if this is a
bug, but it does seem to be weird behavior.
v2: Johannes Obermayr <johannesobermayr@gmx.de>
- Fix some undefined symbols.
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/gallium/targets/pipe-loader/.gitignore | 1 | ||||
-rw-r--r-- | src/gallium/targets/pipe-loader/Makefile | 179 | ||||
-rw-r--r-- | src/gallium/targets/pipe-loader/Makefile.am | 152 |
4 files changed, 154 insertions, 179 deletions
diff --git a/configure.ac b/configure.ac index 2a0f7f212b..d6616d1fd2 100644 --- a/configure.ac +++ b/configure.ac @@ -2061,6 +2061,7 @@ AC_CONFIG_FILES([configs/current src/gallium/targets/egl-static/Makefile src/gallium/targets/gbm/Makefile src/gallium/targets/opencl/Makefile + src/gallium/targets/pipe-loader/Makefile src/gallium/targets/libgl-xlib/Makefile src/gallium/targets/vdpau-nouveau/Makefile src/gallium/targets/vdpau-r300/Makefile diff --git a/src/gallium/targets/pipe-loader/.gitignore b/src/gallium/targets/pipe-loader/.gitignore new file mode 100644 index 0000000000..f3c7a7c5da --- /dev/null +++ b/src/gallium/targets/pipe-loader/.gitignore @@ -0,0 +1 @@ +Makefile diff --git a/src/gallium/targets/pipe-loader/Makefile b/src/gallium/targets/pipe-loader/Makefile deleted file mode 100644 index 7c17866667..0000000000 --- a/src/gallium/targets/pipe-loader/Makefile +++ /dev/null @@ -1,179 +0,0 @@ -# Makefile for building pipe driver shared libraries. -# -# Input variables: PIPE_INSTALL_DIR, PIPE_PREFIX (optional) -# -TOP = ../../../.. -include $(TOP)/configs/current - -PIPE_PREFIX ?= pipe_ - -PIPE_CPPFLAGS = \ - -DGALLIUM_RBUG \ - -DGALLIUM_TRACE \ - -DGALLIUM_GALAHAD \ - -I$(TOP)/include \ - -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/winsys - -PIPE_LIBS = \ - $(TOP)/src/gallium/drivers/identity/libidentity.a \ - $(TOP)/src/gallium/drivers/galahad/libgalahad.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(GALLIUM_AUXILIARIES) - -PIPE_SYS = $(LIBDRM_LIBS) -lm -lpthread $(CLOCK_LIB) $(DLOPEN_LIBS) - -PIPE_CFLAGS = $(LIBDRM_CFLAGS) - -PIPE_LDFLAGS = -Wl,--no-undefined - -# i915 pipe driver -i915_LIBS = \ - $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \ - $(TOP)/src/gallium/drivers/i915/libi915.a -i915_SYS = $(INTEL_LIBS) - -# nouveau pipe driver -nouveau_LIBS = \ - $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \ - $(TOP)/src/gallium/drivers/nv30/libnv30.a \ - $(TOP)/src/gallium/drivers/nv50/libnv50.a \ - $(TOP)/src/gallium/drivers/nvc0/libnvc0.a \ - $(TOP)/src/gallium/drivers/nouveau/libnouveau.a -nouveau_SYS = $(NOUVEAU_LIBS) - -# r300 pipe driver -r300_LIBS = \ - $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ - $(TOP)/src/gallium/drivers/r300/libr300-helper.a \ - $(TOP)/src/gallium/drivers/r300/libr300.a -r300_SYS += $(RADEON_LIBS) - -# r600 pipe driver -r600_LIBS = \ - $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ - $(TOP)/src/gallium/drivers/r600/libr600.a -r600_SYS += $(RADEON_LIBS) - -# radeonsi pipe driver -radeonsi_LIBS = \ - $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ - $(TOP)/src/gallium/drivers/radeonsi/libradeonsi.a -radeonsi_SYS += $(RADEON_LIBS) - -# vmwgfx pipe driver -vmwgfx_LIBS = \ - $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \ - $(TOP)/src/gallium/drivers/svga/libsvga.a - -ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),) - swrast_LIBS = $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a - PIPE_CFLAGS += -DGALLIUM_LLVMPIPE -else ifneq ($(findstring softpipe,$(GALLIUM_DRIVERS_DIRS)),) - swrast_LIBS = $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a - PIPE_CFLAGS += -DGALLIUM_SOFTPIPE -endif - -# LLVM -ifeq ($(MESA_LLVM),1) - PIPE_SYS += $(LLVM_LIBS) - PIPE_LDFLAGS += $(LLVM_LDFLAGS) -endif - -# determine the targets/sources -_PIPE_TARGETS_CC = -_PIPE_TARGETS_CXX = -PIPE_SOURCES = - -ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)i915.so - PIPE_SOURCES += pipe_i915.c -endif - -ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),) - _PIPE_TARGETS_CXX += $(PIPE_PREFIX)nouveau.so - PIPE_SOURCES += pipe_nouveau.c -endif - -ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),) -ifneq ($(findstring r300,$(GALLIUM_DRIVERS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)r300.so - PIPE_SOURCES += pipe_r300.c -endif -endif - -ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),) -ifneq ($(findstring r600,$(GALLIUM_DRIVERS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)r600.so - PIPE_SOURCES += pipe_r600.c -endif -endif - -ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),) -ifneq ($(findstring radeonsi,$(GALLIUM_DRIVERS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)radeonsi.so - PIPE_SOURCES += pipe_radeonsi.c -endif -endif - -ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)vmwgfx.so - PIPE_SOURCES += pipe_vmwgfx.c -endif - -ifneq ($(filter llvmpipe softpipe,$(GALLIUM_DRIVERS_DIRS)),) - _PIPE_TARGETS_CC += $(PIPE_PREFIX)swrast.so - PIPE_SOURCES += pipe_swrast.c -endif - -PIPE_OBJECTS := $(PIPE_SOURCES:.c=.o) - -ifeq ($(MESA_LLVM),1) - PIPE_TARGETS_CXX = $(_PIPE_TARGETS_CXX) $(_PIPE_TARGETS_CC) - PIPE_TARGETS_CC = -else - PIPE_TARGETS_CXX = $(_PIPE_TARGETS_CXX) - PIPE_TARGETS_CC = $(_PIPE_TARGETS_CC) -endif - -PIPE_TARGETS = $(PIPE_TARGETS_CC) $(PIPE_TARGETS_CXX) - -default: depend $(PIPE_TARGETS) - -.SECONDEXPANSION: - -$(PIPE_TARGETS_CC): $(PIPE_PREFIX)%.so: pipe_%.o $(PIPE_LIBS) $$(%_LIBS) - $(MKLIB) -o $@ -noprefix -linker '$(CC)' \ - -ldflags '-L$(TOP)/$(LIB_DIR) $(PIPE_LDFLAGS) $(LDFLAGS)' \ - $(MKLIB_OPTIONS) $< \ - -Wl,--start-group $(PIPE_LIBS) $($*_LIBS) -Wl,--end-group \ - $(PIPE_SYS) $($*_SYS) - -$(PIPE_TARGETS_CXX): $(PIPE_PREFIX)%.so: pipe_%.o $(PIPE_LIBS) $$(%_LIBS) - $(MKLIB) -o $@ -noprefix -linker '$(CXX)' \ - -ldflags '-L$(TOP)/$(LIB_DIR) $(PIPE_LDFLAGS) $(LDFLAGS)' \ - $(MKLIB_OPTIONS) $< \ - -Wl,--start-group $(PIPE_LIBS) $($*_LIBS) -Wl,--end-group \ - $(PIPE_SYS) $($*_SYS) - -$(PIPE_OBJECTS): %.o: %.c - $(CC) -c -o $@ $< $(PIPE_CPPFLAGS) $(PIPE_CFLAGS) $(CFLAGS) - -install: $(PIPE_TARGETS) - $(INSTALL) -d $(DESTDIR)/$(PIPE_INSTALL_DIR) - for tgt in $(PIPE_TARGETS); do \ - $(MINSTALL) "$$tgt" $(DESTDIR)/$(PIPE_INSTALL_DIR); \ - done - -clean: - rm -f $(PIPE_TARGETS) $(PIPE_OBJECTS) depend depend.bak - -depend: $(PIPE_SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(PIPE_CPPFLAGS) $(PIPE_SOURCES) 2>/dev/null - -sinclude depend diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am new file mode 100644 index 0000000000..2b6e34fc5c --- /dev/null +++ b/src/gallium/targets/pipe-loader/Makefile.am @@ -0,0 +1,152 @@ +include $(top_srcdir)/src/gallium/Automake.inc + +AM_CPPFLAGS = \ + $(GALLIUM_CFLAGS) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/gallium/drivers \ + -I$(top_srcdir)/src/gallium/winsys \ + $(LIBDRM_CFLAGS) \ + -DGALLIUM_RBUG \ + -DGALLIUM_TRACE \ + -DGALLIUM_GALAHAD + +gbmdir = $(libdir)/gbm +gbm_LTLIBRARIES = + +PIPE_LIBS = \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/drivers/rbug/librbug.la \ + $(top_builddir)/src/gallium/drivers/trace/libtrace.la \ + $(DLOPEN_LIBS) \ + $(CLOCK_LIB) \ + -lpthread \ + -lm + +if HAVE_GALAHAD_GALLIUM +PIPE_LIBS += $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la +endif + + +if HAVE_GALLIUM_I915 +gbm_LTLIBRARIES += pipe_i915.la +pipe_i915_la_SOURCES = pipe_i915.c +pipe_i915_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \ + $(top_builddir)/src/gallium/drivers/i915/libi915.la \ + $(LIBDRM_LIBS) \ + $(INTEL_LIBS) +pipe_i915_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +nodist_EXTRA_pipe_i915_la_SOURCES = dummy.cpp +pipe_i915_la_LIBADD += $(LLVM_LIBS) +pipe_i915_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_NOUVEAU +gbm_LTLIBRARIES += pipe_nouveau.la +pipe_nouveau_la_SOURCES = pipe_nouveau.c +nodist_EXTRA_pipe_nouveau_la_SOURCES = dummy.cpp +pipe_nouveau_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ + $(top_builddir)/src/gallium/drivers/nv30/libnv30.la \ + $(top_builddir)/src/gallium/drivers/nv50/libnv50.la \ + $(top_builddir)/src/gallium/drivers/nvc0/libnvc0.la \ + $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ + $(NOUVEAU_LIBS) +pipe_nouveau_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +pipe_nouveau_la_LIBADD += $(LLVM_LIBS) +pipe_nouveau_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_R300 +gbm_LTLIBRARIES += pipe_r300.la +pipe_r300_la_SOURCES = pipe_r300.c +nodist_EXTRA_pipe_r300_la_SOURCES = dummy.cpp +pipe_r300_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \ + $(top_builddir)/src/gallium/drivers/r300/libr300-helper.la \ + $(top_builddir)/src/gallium/drivers/r300/libr300.la \ + $(LIBDRM_LIBS) \ + $(RADEON_LIBS) +pipe_r300_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +pipe_r300_la_LIBADD += $(LLVM_LIBS) +pipe_r300_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_R600 +gbm_LTLIBRARIES += pipe_r600.la +pipe_r600_la_SOURCES = pipe_r600.c +pipe_r600_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \ + $(top_builddir)/src/gallium/drivers/r600/libr600.la \ + $(LIBDRM_LIBS) \ + $(RADEON_LIBS) +pipe_r600_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +nodist_EXTRA_pipe_r600_la_SOURCES = dummy.cpp +pipe_r600_la_LIBADD += $(LLVM_LIBS) +pipe_r600_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_RADEONSI +gbm_LTLIBRARIES += pipe_radeonsi.la +pipe_radeonsi_la_SOURCES = pipe_radeonsi.c +nodist_EXTRA_pipe_radeonsi_la_SOURCES = dummy.cpp +pipe_radeonsi_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \ + $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \ + $(LIBDRM_LIBS) \ + $(RADEON_LIBS) +pipe_radeonsi_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +pipe_radeonsi_la_LIBADD += $(LLVM_LIBS) +pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_SVGA +gbm_LTLIBRARIES += pipe_vmwgfx.la +pipe_vmwgfx_la_SOURCES = pipe_vmwgfx.c +pipe_vmwgfx_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \ + $(top_builddir)/src/gallium/drivers/svga/libsvga.la \ + $(LIBDRM_LIBS) +pipe_vmwgfx_la_LDFLAGS = -no-undefined -avoid-version -module +if HAVE_MESA_LLVM +nodist_EXTRA_pipe_vmwgfx_la_SOURCES = dummy.cpp +pipe_vmwgfx_la_LIBADD += $(LLVM_LIBS) +pipe_vmwgfx_la_LDFLAGS += $(LLVM_LDFLAGS) +endif +endif + +if HAVE_GALLIUM_LLVMPIPE +gbm_LTLIBRARIES += pipe_swrast.la +pipe_swrast_la_SOURCES = pipe_swrast.c +nodist_EXTRA_pipe_swrast_la_SOURCES = dummy.cpp +pipe_swrast_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la \ + $(LLVM_LIBS) +pipe_swrast_la_LDFLAGS = -no-undefined -avoid-version -module $(LLVM_LDFLAGS) +else +if HAVE_GALLIUM_SOFTPIPE +gbm_LTLIBRARIES += pipe_swrast.la +pipe_swrast_la_SOURCES = pipe_swrast.c +pipe_swrast_la_LIBADD = \ + $(PIPE_LIBS) \ + $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la +pipe_swrast_la_LDFLAGS = -no-undefined -avoid-version -module +endif +endif |