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.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    - Install pipe_* to $(libdir)/gallium-pipe.

v4: Johannes Obermayr <johannesobermayr@gmx.de>
    - Build it only once on --enable-gallium-gbm / --enable-opencl.
diff --git a/configure.ac b/configure.ac
index 3c328b6..5922654 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1493,6 +1493,10 @@
     enable_gallium_loader=yes
 fi
 
+if test "x$enable_gallium_gbm" = xyes || test "x$enable_opencl" = xyes; then
+    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
+fi
+
 dnl
 dnl Gallium configuration
 dnl
@@ -2078,6 +2082,7 @@
 		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