[x264-devel] ICL: fix out of tree building and resource file usage on Windows

Steven Walters git at videolan.org
Wed Mar 7 03:20:12 CET 2012


x264 | branch: master | Steven Walters <kemuri9 at gmail.com> | Sat Feb 11 22:56:43 2012 -0500| [1446fe7c47cf660d764b4cbf53694bc3df9b04de] | committer: Jason Garrett-Glaser

ICL: fix out of tree building and resource file usage on Windows

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1446fe7c47cf660d764b4cbf53694bc3df9b04de
---

 Makefile  |    4 ++--
 configure |   17 ++++++++++++-----
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index c735a88..5e39050 100644
--- a/Makefile
+++ b/Makefile
@@ -186,10 +186,10 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend
 	-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
 
 %.dll.o: %.rc x264.h
-	$(RC) -DDLL -o $@ $<
+	$(RC)$@ -DDLL $<
 
 %.o: %.rc x264.h
-	$(RC) -o $@ $<
+	$(RC)$@ $<
 
 .depend: config.mak
 	@rm -f .depend
diff --git a/configure b/configure
index 145d468..16970b8 100755
--- a/configure
+++ b/configure
@@ -203,7 +203,12 @@ as_check() {
 rc_check() {
     log_check "whether $RC works"
     echo "$1" > conftest.rc
-    if $RC conftest.rc -o conftest.o >conftest.log 2>&1; then
+    if [ $compiler = ICL ]; then
+        rc_cmd="$RC -foconftest.o conftest.rc"
+    else
+        rc_cmd="$RC -o conftest.o conftest.rc"
+    fi
+    if $rc_cmd >conftest.log 2>&1; then
         res=$?
         log_ok
     else
@@ -211,7 +216,7 @@ rc_check() {
         log_fail
         log_msg "Failed commandline was:"
         log_msg "--------------------------------------------------"
-        log_msg "$RC conftest.rc -o conftest.o"
+        log_msg "$rc_cmd"
         cat conftest.log >> config.log
         log_msg "--------------------------------------------------"
         log_msg "Failed program was:"
@@ -424,7 +429,7 @@ if [[ $host_os = mingw* || $host_os = cygwin* ]]; then
         # Windows Intel Compiler creates dependency generation with absolute Windows paths, Cygwin's make does not support Windows paths.
         [[ $host_os = cygwin* ]] && die "Windows Intel Compiler support requires MSYS"
         compiler=ICL
-        CFLAGS="$CFLAGS -Qstd=c99 -nologo -Qms0 -DHAVE_STRING_H -Iextras"
+        CFLAGS="$CFLAGS -Qstd=c99 -nologo -Qms0 -DHAVE_STRING_H -I\$(SRCPATH)/extras"
         QPRE="-Q"
         `$CC 2>&1 | grep -q IA-32` && host_cpu=i486
         `$CC 2>&1 | grep -q "Intel(R) 64"` && host_cpu=x86_64
@@ -631,7 +636,7 @@ esac
 
 RC=""
 if [ $SYS = WINDOWS ]; then
-    RC="${cross_prefix}windres"
+    [ $compiler = ICL ] && RC="rc" || RC="${cross_prefix}windres"
     if ! rc_check "0 RCDATA {0}" ; then
         RC=""
     fi
@@ -989,6 +994,7 @@ if [ $compiler = ICL ]; then
     LDFLAGSCLI="$(icl_ldflags $LDFLAGSCLI)"
     LIBX264=libx264.lib
     RANLIB=
+    [ -n "$RC" ] && RC="$RC -I. -I\$(SRCPATH)/extras -fo"
     STRIP=
     if [ $debug = yes ]; then
         LDFLAGS="-debug $LDFLAGS"
@@ -1002,6 +1008,7 @@ else
     DEPMT="-MT"
     LD="$CC -o "
     LIBX264=libx264.a
+    [ -n "$RC" ] && RC="$RC -I. -o "
 fi
 if [ $compiler = GNU ]; then
     PROF_GEN_CC="-fprofile-generate"
@@ -1084,7 +1091,7 @@ if [ "$shared" = "yes" ]; then
             # MSVC link does not act similarly, so it is required to make an export definition out of x264.h and use it at link time
             echo "SOFLAGS=-dll -def:x264.def -implib:\$(IMPLIBNAME) $SOFLAGS" >> config.mak
             echo "EXPORTS" > x264.def
-            grep "^\(int\|void\|x264_t\|extern\).*x264.*[\[(;]" x264.h | sed -e "s/.*\(x264.*\)[\[(].*/\1/;s/.*\(x264.*\);/\1/;s/open/open_$API/g" >> x264.def
+            grep "^\(int\|void\|x264_t\|extern\).*x264.*[\[(;]" ${SRCPATH}/x264.h | sed -e "s/.*\(x264.*\)[\[(].*/\1/;s/.*\(x264.*\);/\1/;s/open/open_$API/g" >> x264.def
         else
             echo 'IMPLIBNAME=libx264.dll.a' >> config.mak
             echo "SOFLAGS=-shared -Wl,--out-implib,\$(IMPLIBNAME) -Wl,--enable-auto-image-base $SOFLAGS" >> config.mak



More information about the x264-devel mailing list