* Makefile.in (PICFLAG, PICFLAG_FOR_TARGET): New macros.
(FLAGS_TO_PASS): Pass them.
(EXTRA_TARGET_FLAGS): Ditto.
* config/m?-*pic: Define PICFLAG* instead of LIB*FLAGS*.
Support building both shared and archive libraries.
-LIBCFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) -fPIC
-LIBCXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET) -fPIC -fno-implicit-templates
+PICFLAG_FOR_TARGET=-fPIC
-LIBCFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) -fpic
-LIBCXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET) -fpic -fno-implicit-templates
+PICFLAG_FOR_TARGET=-fPIC
-LIBCFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) -fpic
-LIBCXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET) -fpic -fno-implicit-templates
+PICFLAG_FOR_TARGET=-fpic