enable $(FPIC) for a few more packages
enable $(FPIC) for a few more packages


git-svn-id: svn://svn.openwrt.org/openwrt/packages@12228 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/libs/alsa-lib/Makefile
+++ b/libs/alsa-lib/Makefile
@@ -39,6 +39,7 @@
  You must have enabled the ALSA support in the kernel.
 endef
 
+TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/apr-util/Makefile
+++ b/libs/apr-util/Makefile
@@ -29,6 +29,7 @@
 endef
 
 
+TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
 	--with-pgsql=no \
 	--with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \

--- a/libs/apr/Makefile
+++ b/libs/apr/Makefile
@@ -28,17 +28,16 @@
   URL:=http://apr.apache.org/
 endef
 
+TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
 	--with-devrandom=/dev/urandom \
 	--disable-dso \
 	--enable-ipv6
 
 CONFIGURE_VARS += \
-	ac_cv_file__dev_zero=yes \
 	apr_cv_process_shared_works=no \
 	apr_cv_mutex_robust_shared=no \
 	apr_cv_tcp_nodelay_with_cork=yes \
-	ac_cv_sizeof_ssize_t=4 \
 	LDFLAGS="$$$$LDFLAGS -lpthread" \
 
 define Build/Compile

--- a/libs/argtable/Makefile
+++ b/libs/argtable/Makefile
@@ -35,6 +35,7 @@
 	each argument.
 endef
 
+TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/avahi/Makefile
+++ b/libs/avahi/Makefile
@@ -100,6 +100,7 @@
  in a DHCP-like fashion. Especially useful on IPv6.
 endef
 
+TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS+= \
 	--enable-shared \
 	--enable-static \

--- a/libs/axtls/Makefile
+++ b/libs/axtls/Makefile
@@ -41,6 +41,8 @@
 	$(MAKE) -C $(PKG_BUILD_DIR) oldconfig
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		CC="$(TARGET_CC)" \

--- a/libs/bluez-libs/Makefile
+++ b/libs/bluez-libs/Makefile
@@ -29,6 +29,8 @@
 		--enable-shared \
 		--enable-static \
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/cgilib/Makefile
+++ b/libs/cgilib/Makefile
@@ -30,6 +30,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \

--- a/libs/check/Makefile
+++ b/libs/check/Makefile
@@ -36,6 +36,8 @@
 	$(call Build/Configure/Default)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	cd $(PKG_BUILD_DIR) ; DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) all install
 	cd $(PKG_INSTALL_DIR)/usr/lib/ ; ln -s libcheck.so libcheck_pic.so

--- a/libs/clearsilver/Makefile
+++ b/libs/clearsilver/Makefile
@@ -28,6 +28,8 @@
 define Package/clearsilver/description
 Clearsilver is a fast, powerful, and language-neutral HTML template system. In both static content sites and dynamic HTML applications, it provides a separation between presentation code and application logic which makes working with your project easier.
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
   --disable-wdb \

--- a/libs/clinkc/Makefile
+++ b/libs/clinkc/Makefile
@@ -36,6 +36,8 @@
 
 # uses GNU configure
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	chmod +x $(PKG_BUILD_DIR)/config/install-sh
 	$(MAKE) -C $(PKG_BUILD_DIR) \

--- a/libs/confuse/Makefile
+++ b/libs/confuse/Makefile
@@ -37,6 +37,8 @@
 	 libConfuse was called libcfg before, but was changed to not confuse with other similar libraries. 
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/curl/Makefile
+++ b/libs/curl/Makefile
@@ -45,6 +45,8 @@
   DEPENDS:=+libopenssl +zlib
   TITLE:=A client-side URL transfer utility
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/cyrus-sasl/Makefile
+++ b/libs/cyrus-sasl/Makefile
@@ -28,48 +28,46 @@
   URL:=http://asg.web.cmu.edu/sasl/
 endef
 
-define Build/Configure
-	$(call Build/Configure/Default, \
-		--enable-shared \
-		--enable-static \
-		--disable-sample \
-		--enable-staticdlopen \
-		--disable-java \
-		--disable-alwaystrue \
-		--disable-checkapop \
-		--enable-cram \
-		--enable-digest \
-		--disable-otp \
-		--disable-srp \
-		--disable-srp-setpass \
-		--disable-krb4 \
-		--disable-gssapi \
-		--disable-gss_mutexes \
-		--enable-plain \
-		--enable-anon \
-		--disable-login \
-		--disable-ntlm \
-		--disable-sql \
-		--with-dblib="none" \
-		--without-gdbm \
-		--with-devrandom="/dev/urandom" \
-		--without-pam \
-		--without-saslauthd \
-		--without-authdaemond \
-		--without-pwcheck \
-		--with-ipctype=unix \
-		--with-openssl="$(STAGING_DIR)/usr" \
-		--without-des \
-		--without-opie \
-		--without-ldap \
-		--without-mysql \
-		--without-pgsql \
-		--without-sqlite \
-		--without-rc4 \
-		--without-dmalloc \
-		--without-sfio \
-	);
-endef
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_ARGS += \
+	--enable-shared \
+	--enable-static \
+	--disable-sample \
+	--enable-staticdlopen \
+	--disable-java \
+	--disable-alwaystrue \
+	--disable-checkapop \
+	--enable-cram \
+	--enable-digest \
+	--disable-otp \
+	--disable-srp \
+	--disable-srp-setpass \
+	--disable-krb4 \
+	--disable-gssapi \
+	--disable-gss_mutexes \
+	--enable-plain \
+	--enable-anon \
+	--disable-login \
+	--disable-ntlm \
+	--disable-sql \
+	--with-dblib="none" \
+	--without-gdbm \
+	--with-devrandom="/dev/urandom" \
+	--without-pam \
+	--without-saslauthd \
+	--without-authdaemond \
+	--without-pwcheck \
+	--with-ipctype=unix \
+	--with-openssl="$(STAGING_DIR)/usr" \
+	--without-des \
+	--without-opie \
+	--without-ldap \
+	--without-mysql \
+	--without-pgsql \
+	--without-sqlite \
+	--without-rc4 \
+	--without-dmalloc \
+	--without-sfio
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR)/include \

--- a/libs/db/Makefile
+++ b/libs/db/Makefile
@@ -74,6 +74,8 @@
 	);
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	rm -rf $(PKG_INSTALL_DIR)
 	mkdir -p $(PKG_INSTALL_DIR)

--- a/libs/dbus-glib/Makefile
+++ b/libs/dbus-glib/Makefile
@@ -27,6 +27,8 @@
  DEPENDS:= +dbus +glib2 +libiconv +libintl
 endef
 
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/expat/Makefile
+++ b/libs/expat/Makefile
@@ -33,6 +33,8 @@
 endef
 
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static

--- a/libs/faad2/Makefile
+++ b/libs/faad2/Makefile
@@ -70,6 +70,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 MAKE_FLAGS += \
 	DESTDIR="$(PKG_INSTALL_DIR)" \
 	all install \

--- a/libs/fcgi/Makefile
+++ b/libs/fcgi/Makefile
@@ -33,6 +33,8 @@
  server specific APIs.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/file/Makefile
+++ b/libs/file/Makefile
@@ -44,6 +44,8 @@
  a wrapper around the "magic" library. 
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/flac/Makefile
+++ b/libs/flac/Makefile
@@ -30,6 +30,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.lite \
 		$(TARGET_CONFIGURE_OPTS) \

--- a/libs/freetype/Makefile
+++ b/libs/freetype/Makefile
@@ -35,6 +35,8 @@
  efficient and ubiquitous products.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/gd/Makefile
+++ b/libs/gd/Makefile
@@ -26,20 +26,20 @@
   URL:=http://www.boutell.com/gd/
 endef
 
-define Build/Configure
-	$(call Build/Configure/Default, \
-		--enable-shared \
-		--enable-static \
-		--disable-rpath \
-		--without-x \
-		--without-freetype \
-		--with-jpeg=$(STAGING_DIR)/usr \
-		--with-png=$(STAGING_DIR)/usr \
-		--without-xpm \
-		, \
-		LIBPNG12_CONFIG="$(STAGING_DIR)/usr/bin/libpng12-config" \
-	)
-endef
+CONFIGURE_ARGS += \
+	--enable-shared \
+	--enable-static \
+	--disable-rpath \
+	--without-x \
+	--without-freetype \
+	--with-jpeg=$(STAGING_DIR)/usr \
+	--with-png=$(STAGING_DIR)/usr \
+	--without-xpm
+
+CONFIGURE_VARS += \
+	LIBPNG12_CONFIG="$(STAGING_DIR)/usr/bin/libpng12-config"
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \

--- a/libs/gdbm/Makefile
+++ b/libs/gdbm/Makefile
@@ -27,6 +27,8 @@
   URL:=http://www.gnu.org/software/gdbm/
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/gettext/Makefile
+++ b/libs/gettext/Makefile
@@ -26,6 +26,8 @@
   TITLE:=GNU Internationalization library
   URL:=http://www.gnu.org/software/gettext/
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/giflib/Makefile
+++ b/libs/giflib/Makefile
@@ -25,19 +25,8 @@
   DEPENDS:=
 endef
 
-CONFIGURE_ARGS+=--without-x
-
-define Build/Configure
-	(cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
-		if [ -x $(CONFIGURE_CMD) ]; then \
-			$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
-			$(CONFIGURE_VARS) \
-			$(CONFIGURE_CMD) \
-			$(CONFIGURE_ARGS_XTRA) \
-			$(CONFIGURE_ARGS) ;\
-		fi \
-	)
-endef
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_ARGS += --without-x
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR)

--- a/libs/glib/Makefile
+++ b/libs/glib/Makefile
@@ -35,6 +35,8 @@
  GLib is a library containing many useful C routines for things such 
  as trees, hashes, and lists.
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/glib2/Makefile
+++ b/libs/glib2/Makefile
@@ -35,6 +35,7 @@
 The GLib library of C routines
 endef
 
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Configure
 	mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)

--- a/libs/gnutls/Makefile
+++ b/libs/gnutls/Makefile
@@ -102,6 +102,8 @@
  This package contains the GnuTLS OpenSSL compatibility layer shared library.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS+= \
 	--enable-shared \
 	--enable-static \

--- a/libs/gsl/Makefile
+++ b/libs/gsl/Makefile
@@ -32,6 +32,8 @@
 	There are over 1000 functions in total with an extensive test suite.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	rm -rf $(PKG_INSTALL_DIR)
 	mkdir -p $(PKG_INSTALL_DIR)

--- a/libs/gsm/Makefile
+++ b/libs/gsm/Makefile
@@ -53,6 +53,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	rm -rf $(PKG_INSTALL_DIR)
 	mkdir -p $(PKG_INSTALL_DIR)

--- a/libs/howl/Makefile
+++ b/libs/howl/Makefile
@@ -90,6 +90,8 @@
 	);
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/id3lib/Makefile
+++ b/libs/id3lib/Makefile
@@ -28,6 +28,8 @@
   URL:=http://www.id3lib.org/
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/iksemel/Makefile
+++ b/libs/iksemel/Makefile
@@ -28,6 +28,8 @@
   DEPENDS:= +libgnutls
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/jpeg/Makefile
+++ b/libs/jpeg/Makefile
@@ -40,6 +40,8 @@
   DEPENDS:=+libjpeg
   TITLE+= manipulation tools
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libaio/Makefile
+++ b/libs/libaio/Makefile
@@ -33,6 +33,8 @@
 LIBAIO_CFLAGS:=-nostdlib -nostartfiles -I. $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
 LIBAIO_SOVER:=1.0.1
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \

--- a/libs/libamsel/Makefile
+++ b/libs/libamsel/Makefile
@@ -32,6 +32,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 MAKE_FLAGS += \
 	CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR) -fPIC" \
 	LDIR=$(PKG_BUILD_DIR) \

--- a/libs/libao/Makefile
+++ b/libs/libao/Makefile
@@ -31,16 +31,15 @@
 	output audio using a simple API on a wide variety of platforms.
 endef
 
-define Build/Configure
-	$(call Build/Configure/Default, \
-		--enable-shared \
-		--enable-static \
-		--disable-esd \
-		--disable-arts \
-		--disable-nas \
-		--disable-polyp \
-	)
-endef
+CONFIGURE_ARGS += \
+	--enable-shared \
+	--enable-static \
+	--disable-esd \
+	--disable-arts \
+	--disable-nas \
+	--disable-polyp
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \

--- a/libs/libart/Makefile
+++ b/libs/libart/Makefile
@@ -36,6 +36,8 @@
 	especially suitable for embedded applications.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static

--- a/libs/libatomicops/Makefile
+++ b/libs/libatomicops/Makefile
@@ -38,6 +38,8 @@
   architectures.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libaudiofile/Makefile
+++ b/libs/libaudiofile/Makefile
@@ -30,6 +30,8 @@
 	files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun, BICS, 
 	and raw data).
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Configure
 	$(call Build/Configure/Default, \

--- a/libs/libbfd/Makefile
+++ b/libs/libbfd/Makefile
@@ -32,6 +32,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR)/bfd \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libcli/Makefile
+++ b/libs/libcli/Makefile
@@ -32,6 +32,8 @@
 	authentication and callbacks for a user-definable function tree.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 MAKE_FLAGS += \
 	OPTIM="$(TARGET_CFLAGS)" \
 	CFLAGS="$(TARGET_CFLAGS)" \

--- a/libs/libdaemon/Makefile
+++ b/libs/libdaemon/Makefile
@@ -46,6 +46,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libdlna/Makefile
+++ b/libs/libdlna/Makefile
@@ -52,6 +52,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libdnet/Makefile
+++ b/libs/libdnet/Makefile
@@ -43,6 +43,8 @@
 	low-level networking routines.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libdvbpsi4/Makefile
+++ b/libs/libdvbpsi4/Makefile
@@ -30,6 +30,8 @@
 	decoding and generating.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(call Build/Compile/Default, \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libelf/Makefile
+++ b/libs/libelf/Makefile
@@ -24,6 +24,8 @@
   TITLE:=ELF object file access library
   URL:=http://www.stud.uni-hannover.de/~michael/software/
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libevent/Makefile
+++ b/libs/libevent/Makefile
@@ -38,6 +38,8 @@
 	the event loop.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libexif/Makefile
+++ b/libs/libexif/Makefile
@@ -35,6 +35,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libffi-sable/Makefile
+++ b/libs/libffi-sable/Makefile
@@ -33,6 +33,8 @@
 	time.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	$(call Build/Configure/Default, \
 		--enable-shared \

--- a/libs/libgcrypt/Makefile
+++ b/libs/libgcrypt/Makefile
@@ -39,6 +39,8 @@
  RC2, SEED, Camellia, CRC, MD4, TIGER-192, Whirlpool, ElGamal, ECC).
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS+= \
 	--enable-shared \
 	--enable-static \

--- a/libs/libgpg-error/Makefile
+++ b/libs/libgpg-error/Makefile
@@ -38,6 +38,8 @@
 	future.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	$(call Build/Configure/Default, \
 		--enable-shared \

--- a/libs/libgphoto2/Makefile
+++ b/libs/libgphoto2/Makefile
@@ -38,6 +38,8 @@
   DEPENDS:=libgphoto2
   TITLE:=Gphoto2 drivers for various cameras
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libgssapi/Makefile
+++ b/libs/libgssapi/Makefile
@@ -29,7 +29,7 @@
  Support libraries - for newer nfs mount command (nfs4)
 endef
 
-TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
+TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib $(FPIC)
 
 MAKE_FLAGS += \
 	OPT="$(TARGET_CFLAGS)" \

--- a/libs/libiconv/Makefile
+++ b/libs/libiconv/Makefile
@@ -27,14 +27,12 @@
   URL:=http://www.gnu.org/software/libiconv/
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \
 	--disable-rpath \
-
-define Build/Configure
-	$(call Build/Configure/Default)
-endef
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) CC="$(TARGET_CC)"

--- a/libs/libid3tag/Makefile
+++ b/libs/libid3tag/Makefile
@@ -31,6 +31,8 @@
 	ID3v1 and the various versions of ID3v2.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	$(call Build/Configure/Default, \
 		--enable-shared \

--- a/libs/libjson-c/Makefile
+++ b/libs/libjson-c/Makefile
@@ -29,6 +29,8 @@
  This package contains a library for javascript object notation backends.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libmad/Makefile
+++ b/libs/libmad/Makefile
@@ -44,6 +44,8 @@
 	Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libmcrypt/Makefile
+++ b/libs/libmcrypt/Makefile
@@ -37,6 +37,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libmpcdec/Makefile
+++ b/libs/libmpcdec/Makefile
@@ -29,9 +29,7 @@
 	Musepack decoder library
 endef
 
-define Build/Configure
-	$(call Build/Configure/Default)
-endef
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Compile
 	$(call Build/Compile/Default,\

--- a/libs/libmpd/Makefile
+++ b/libs/libmpd/Makefile
@@ -29,6 +29,8 @@
 It's wraps around libmpdclient and provides a higher level api.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 	DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libnet-1.0.x/Makefile
+++ b/libs/libnet-1.0.x/Makefile
@@ -32,6 +32,8 @@
 ifeq ($(CONFIG_BIG_ENDIAN),y)
   ENDIANESS:=big
 endif
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libnet-1.1.x/Makefile
+++ b/libs/libnet-1.1.x/Makefile
@@ -32,6 +32,8 @@
 ifeq ($(CONFIG_BIG_ENDIAN),y)
   ENDIANESS:=big
 endif
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libnetfilter-queue/Makefile
+++ b/libs/libnetfilter-queue/Makefile
@@ -30,6 +30,8 @@
 	that have been queued by the kernel packet filter. It is is part of a system 
 	that deprecates the old ip_queue / libipq mechanism.
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-static \

--- a/libs/libnfnetlink/Makefile
+++ b/libs/libnfnetlink/Makefile
@@ -33,6 +33,8 @@
  and/or management tools in userspace.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-static \
 	--enable-shared

--- a/libs/libnfsidmap/Makefile
+++ b/libs/libnfsidmap/Makefile
@@ -29,6 +29,8 @@
  needed for nfs-utils
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
 
 MAKE_FLAGS += \

--- a/libs/libnids/Makefile
+++ b/libs/libnids/Makefile
@@ -42,6 +42,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		LNETLIB="-L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib -lnet" \

--- a/libs/libnotimpl/Makefile
+++ b/libs/libnotimpl/Makefile
@@ -34,6 +34,8 @@
 	mkdir -p $(PKG_BUILD_DIR)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(call cc,math)
 	$(TARGET_CROSS)ar rc $(PKG_BUILD_DIR)/libnotimpl.a $(PKG_BUILD_DIR)/*.o

--- a/libs/liboil/Makefile
+++ b/libs/liboil/Makefile
@@ -37,6 +37,8 @@
   provided by modern CPUs (Altivec, MMX, SSE, etc.).
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libol/Makefile
+++ b/libs/libol/Makefile
@@ -32,6 +32,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	# pass CFLAGS again to override -O2 set by configure
 	$(MAKE) -C $(PKG_BUILD_DIR) \

--- a/libs/libosip2/Makefile
+++ b/libs/libosip2/Makefile
@@ -32,6 +32,8 @@
  GNU oSIP library, a Session Initiation Protocol (SIP) implementation.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS+= \
 	--enable-shared \
 	--enable-static \

--- a/libs/libpam/Makefile
+++ b/libs/libpam/Makefile
@@ -32,6 +32,8 @@
 	Linux-PAM is a free implementation of the following DCE-RFC from Sunsoft. 
 
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Configure
 	$(call Build/Configure/Default, \

--- a/libs/libpng/Makefile
+++ b/libs/libpng/Makefile
@@ -34,6 +34,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libreadline/Makefile
+++ b/libs/libreadline/Makefile
@@ -44,6 +44,8 @@
 
 TARGET_CPPFLAGS:=-I. -I.. $(TARGET_CPPFLAGS)
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/librpcsecgss/Makefile
+++ b/libs/librpcsecgss/Makefile
@@ -31,7 +31,7 @@
  Support libraries - for newer nfs mount command (nfs4)
 endef
 
-TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib -I$(STAGING_DIR)/usr/include/gssglue/
+TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib -I$(STAGING_DIR)/usr/include/gssglue/ $(FPIC)
 
 MAKE_FLAGS += \
 	OPT="$(TARGET_CFLAGS)" \

--- a/libs/librsync/Makefile
+++ b/libs/librsync/Makefile
@@ -38,6 +38,8 @@
 	);
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libsamplerate/Makefile
+++ b/libs/libsamplerate/Makefile
@@ -33,6 +33,8 @@
  Converter for audio.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--disable-fftw \
 

--- a/libs/libshout/Makefile
+++ b/libs/libshout/Makefile
@@ -45,6 +45,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libsigc++/Makefile
+++ b/libs/libsigc++/Makefile
@@ -34,6 +34,8 @@
  whether it is static or virtual.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/libsndfile/Makefile
+++ b/libs/libsndfile/Makefile
@@ -32,6 +32,8 @@
  containing sampled audio data.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--disable-flac
 

--- a/libs/libtasn1/Makefile
+++ b/libs/libtasn1/Makefile
@@ -36,6 +36,8 @@
  Distinguish Encoding Rules (DER) manipulation.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 		--enable-shared \
 		--enable-static

--- a/libs/libtorrent/Makefile
+++ b/libs/libtorrent/Makefile
@@ -36,6 +36,8 @@
  the speed of the official client.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 # XXX: rtorrent needs encryption (--enable-openssl)
 CONFIGURE_ARGS+= \
 	--enable-shared \

--- a/libs/libupnp/Makefile
+++ b/libs/libupnp/Makefile
@@ -57,6 +57,8 @@
 	);
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		CCOPT="$(TARGET_CFLAGS)" \

--- a/libs/libusb/Makefile
+++ b/libs/libusb/Makefile
@@ -32,6 +32,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/libvorbisidec/Makefile
+++ b/libs/libvorbisidec/Makefile
@@ -34,6 +34,8 @@
 	Tremor is a decoder only.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	(cd $(PKG_BUILD_DIR); ./autogen.sh );
 	$(call Build/Configure/Default, \

--- a/libs/libxml2/Makefile
+++ b/libs/libxml2/Makefile
@@ -34,6 +34,7 @@
  A library for manipulating XML and HTML resources.
 endef
 
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/libxslt/Makefile
+++ b/libs/libxslt/Makefile
@@ -60,6 +60,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/lzo/Makefile
+++ b/libs/lzo/Makefile
@@ -38,6 +38,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		CFLAGS_O="$(TARGET_CFLAGS)" \

--- a/libs/matrixssl/Makefile
+++ b/libs/matrixssl/Makefile
@@ -31,6 +31,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR)/src \
 		$(TARGET_CONFIGURE_OPTS) \

--- a/libs/mysql/Makefile
+++ b/libs/mysql/Makefile
@@ -66,6 +66,8 @@
 	);
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	rm -rf $(PKG_INSTALL_DIR)
 	mkdir -p $(PKG_INSTALL_DIR)

--- a/libs/neon/Makefile
+++ b/libs/neon/Makefile
@@ -28,6 +28,8 @@
   DEPENDS:=+libopenssl +libexpat
 endef
 
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/net-snmp/Makefile
+++ b/libs/net-snmp/Makefile
@@ -139,6 +139,8 @@
 
 SNMP_TRANSPORTS_EXCLUDED = TCP TCPv6 UDPv6 Unix
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/opal/Makefile
+++ b/libs/opal/Makefile
@@ -38,6 +38,8 @@
 	supports not only the H.323 protocol but also SIP and IAX2.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-audio \
 	--disable-video \

--- a/libs/opencdk/Makefile
+++ b/libs/opencdk/Makefile
@@ -38,6 +38,8 @@
 	messages with earlier PGP version < 7, you should use the compat mode.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	$(call Build/Configure/Default, \
 		--enable-shared \

--- a/libs/openh323/Makefile
+++ b/libs/openh323/Makefile
@@ -27,9 +27,7 @@
   URL:=http://openh323.sourceforge.net/
 endef
 
-ifeq ($(ARCH),x86_64)
-  FPIC:=-fPIC
-endif
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-minsize \

--- a/libs/openldap/Makefile
+++ b/libs/openldap/Makefile
@@ -62,6 +62,8 @@
 	This package contains client programs required to access LDAP servers.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/ossp-js/Makefile
+++ b/libs/ossp-js/Makefile
@@ -41,6 +41,8 @@
  CATEGORY:=Libraries
  TITLE+= (library)
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/pcre/Makefile
+++ b/libs/pcre/Makefile
@@ -27,6 +27,8 @@
   URL:=http://www.pcre.org/
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/popt/Makefile
+++ b/libs/popt/Makefile
@@ -32,6 +32,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/postgresql/Makefile
+++ b/libs/postgresql/Makefile
@@ -160,6 +160,8 @@
 	#$(SED) 's@US/Eastern@America/New_York@' $(PKG_BUILD_DIR)/src/timezone/Makefile
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C "$(PKG_BUILD_DIR)" \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/ptlib/Makefile
+++ b/libs/ptlib/Makefile
@@ -34,6 +34,8 @@
  functions have long been removed as other class libraries such as wxWidgets were
  much more advanced.
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-minsize \

--- a/libs/pwlib/Makefile
+++ b/libs/pwlib/Makefile
@@ -33,9 +33,7 @@
  System.
 endef
 
-ifeq ($(ARCH),x86_64)
-  FPIC:=-fPIC
-endif
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-minsize \
@@ -82,7 +80,7 @@
 	--disable-xmlrpc \
 
 CONFIGURE_VARS += \
-	STDCXXFLAGS="$(TARGET_CFLAGS) $(FPIC) -fno-builtin" \
+	STDCXXFLAGS="$(TARGET_CFLAGS) -fno-builtin" \
 
 MAKE_FLAGS += optnoshared
 

--- a/libs/radiusclient-ng/Makefile
+++ b/libs/radiusclient-ng/Makefile
@@ -60,6 +60,8 @@
  This package contains a RADIUS client.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \

--- a/libs/rrdtool-1.0.x/Makefile
+++ b/libs/rrdtool-1.0.x/Makefile
@@ -98,6 +98,8 @@
 	This package contains command line tools used to manage RRDs.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += \
 	$(DISABLE_LARGEFILE) \
 	$(DISABLE_NLS) \

--- a/libs/serdisplib/Makefile
+++ b/libs/serdisplib/Makefile
@@ -38,9 +38,11 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
-		CFLAGS="$(TARGET_CFLAGS) -Wall -Wno-implicit -fPIC -I../include -I.." \
+		CFLAGS="$(TARGET_CFLAGS) -Wall -Wno-implicit -I../include -I.." \
 		all
 endef
 

--- a/libs/speex/Makefile
+++ b/libs/speex/Makefile
@@ -39,6 +39,8 @@
 	This package contains the shared codec library, needed by other programs.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 TARGET_LDFLAGS:=$(TARGET_LDFLAGS) -lnotimpl
 
 define Build/Configure

--- a/libs/sqlite2/Makefile
+++ b/libs/sqlite2/Makefile
@@ -74,6 +74,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		DESTDIR="$(PKG_INSTALL_DIR)" \

--- a/libs/sqlite3/Makefile
+++ b/libs/sqlite3/Makefile
@@ -56,6 +56,8 @@
 	multiple formats.
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
 	$(call Build/Configure/Default, \
 		--enable-shared \

--- a/libs/st2205tool/Makefile
+++ b/libs/st2205tool/Makefile
@@ -33,6 +33,8 @@
   mplayer or LCD4Linux
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 MAKE_FLAGS += \
 	CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/libst2205/" \
 	LDFLAGS="-L$(STAGING_DIR)/usr/lib" \

--- a/libs/taglib/Makefile
+++ b/libs/taglib/Makefile
@@ -25,6 +25,8 @@
   TITLE:=Audio output library
   URL:=http://developer.kde.org/~wheeler/taglib.html
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--enable-shared \

--- a/libs/tcp_wrappers/Makefile
+++ b/libs/tcp_wrappers/Makefile
@@ -26,6 +26,8 @@
   TITLE:=Security wrapper library for TCP services
   URL:=ftp://ftp.porcupine.org/pub/security/index.html
 endef
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/Compile	
 	$(MAKE) -C $(PKG_BUILD_DIR) \

--- a/libs/tiff/Makefile
+++ b/libs/tiff/Makefile
@@ -25,6 +25,8 @@
   DEPENDS:=+zlib +libjpeg
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 CONFIGURE_ARGS += --without-x
 MAKE_FLAGS += all install DESTDIR=$(PKG_INSTALL_DIR)
 

--- a/libs/uclibc++/Makefile
+++ b/libs/uclibc++/Makefile
@@ -40,6 +40,8 @@
 	-e 's/mipsel.*/mips/' \
 	-e 's/cris.*/cris/' \
 )
+
+TARGET_CFLAGS += $(FPIC)
 
 MAKE_FLAGS:= \
 	TOPDIR="$(PKG_BUILD_DIR)/" \

--- a/libs/ustl/Makefile
+++ b/libs/ustl/Makefile
@@ -40,6 +40,8 @@
 	$(CP) ./files/Common.mk $(PKG_BUILD_DIR)/
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	rm -rf $(PKG_INSTALL_DIR)
 	mkdir -p $(PKG_INSTALL_DIR)

--- a/libs/wnck/Makefile
+++ b/libs/wnck/Makefile
@@ -44,6 +44,8 @@
 	)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	cd $(PKG_BUILD_DIR) ; DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) all install
 endef

--- a/libs/wxbase/Makefile
+++ b/libs/wxbase/Makefile
@@ -36,6 +36,7 @@
  etc.) allowing you to write portable programs easily.
 endef
 
+TARGET_CFLAGS += $(FPIC)
 
 # XXX: aMule *needs* the following configure options to be enabled:
 #	--enable-intl

--- a/libs/xyssl/Makefile
+++ b/libs/xyssl/Makefile
@@ -46,6 +46,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \

--- a/libs/zaptel/Makefile
+++ b/libs/zaptel/Makefile
@@ -34,6 +34,8 @@
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \

comments