[vlc-commits] contrib: add HOSTVARS_PIC to force PIC build (for CMake)
Rémi Denis-Courmont
git at videolan.org
Mon Aug 8 17:33:24 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi.denis-courmont at nokia.com> | Mon Aug 8 18:31:10 2011 +0300| [17b1d24de07a20cace32f76b558135ab7969f022] | committer: Rémi Denis-Courmont
contrib: add HOSTVARS_PIC to force PIC build (for CMake)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=17b1d24de07a20cace32f76b558135ab7969f022
---
contrib/src/main.mak | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 3012420..974cbf1 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -147,19 +147,6 @@ endif
#
# Common helpers
#
-HOSTVARS := CPPFLAGS="$(CPPFLAGS)"
-HOSTVARS += CC="$(CC)"
-HOSTVARS += CFLAGS="$(CFLAGS)"
-HOSTVARS += CXX="$(CXX)"
-HOSTVARS += CXXFLAGS="$(CXXFLAGS)"
-HOSTVARS += LD="$(LD)"
-HOSTVARS += LDFLAGS="$(LDFLAGS)"
-HOSTVARS += AR="$(AR)"
-HOSTVARS += RANLIB="$(RANLIB)"
-HOSTVARS += STRIP="$(STRIP)"
-HOSTVARS += PATH="$(PREFIX)/bin:$(PATH)"
-HOSTVARS_AR += AR="$(AR) rcvu"
-
HOSTCONF := --prefix="$(PREFIX)"
HOSTCONF += --build="$(BUILD)" --host="$(HOST)" --target="$(HOST)"
HOSTCONF += --program-prefix=""
@@ -167,10 +154,27 @@ HOSTCONF += --program-prefix=""
HOSTCONF += --enable-static --disable-shared --disable-dependency-tracking
ifdef HAVE_WIN32
HOSTCONF += --without-pic
+PIC :=
else
HOSTCONF += --with-pic
+PIC := -fPIC
endif
+HOSTTOOLS := \
+ CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \
+ AR="$(AR)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \
+ PATH="$(PREFIX)/bin:$(PATH)"
+HOSTVARS := $(HOSTTOOLS) \
+ CPPFLAGS="$(CPPFLAGS)" \
+ CFLAGS="$(CFLAGS)" \
+ CXXFLAGS="$(CXXFLAGS)" \
+ LDFLAGS="$(LDFLAGS)"
+HOSTVARS_PIC := $(HOSTTOOLS) \
+ CPPFLAGS="$(CPPFLAGS) $(PIC)" \
+ CFLAGS="$(CFLAGS) $(PIC)" \
+ CXXFLAGS="$(CXXFLAGS) $(PIC)" \
+ LDFLAGS="$(LDFLAGS)"
+
download_git = \
rm -Rf $(@:.tar.xz=) && \
$(GIT) clone $(2:%=--branch %) $(1) $(@:.tar.xz=) && \
More information about the vlc-commits
mailing list