Commit 62d7007d authored by Alexander Prikhodko's avatar Alexander Prikhodko Committed by Fiona Glaser

configure: correct use of RC variable and add --extra-rcflags

parent 70877e39
...@@ -186,10 +186,10 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend ...@@ -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 -@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
%.dll.o: %.rc x264.h %.dll.o: %.rc x264.h
$(RC)$@ -DDLL $< $(RC) $(RCFLAGS)$@ -DDLL $<
%.o: %.rc x264.h %.o: %.rc x264.h
$(RC)$@ $< $(RC) $(RCFLAGS)$@ $<
.depend: config.mak .depend: config.mak
@rm -f .depend @rm -f .depend
......
...@@ -18,6 +18,7 @@ Standard options: ...@@ -18,6 +18,7 @@ Standard options:
--extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS
--extra-rcflags=ERCFLAGS add ERCFLAGS to RCFLAGS
Configuration options: Configuration options:
--disable-cli disable cli --disable-cli disable cli
...@@ -204,9 +205,9 @@ rc_check() { ...@@ -204,9 +205,9 @@ rc_check() {
log_check "whether $RC works" log_check "whether $RC works"
echo "$1" > conftest.rc echo "$1" > conftest.rc
if [ $compiler = ICL ]; then if [ $compiler = ICL ]; then
rc_cmd="$RC -foconftest.o conftest.rc" rc_cmd="$RC $RCFLAGS -foconftest.o conftest.rc"
else else
rc_cmd="$RC -o conftest.o conftest.rc" rc_cmd="$RC $RCFLAGS -o conftest.o conftest.rc"
fi fi
if $rc_cmd >conftest.log 2>&1; then if $rc_cmd >conftest.log 2>&1; then
res=$? res=$?
...@@ -277,6 +278,7 @@ CFLAGS="$CFLAGS -Wall -I. -I\$(SRCPATH)" ...@@ -277,6 +278,7 @@ CFLAGS="$CFLAGS -Wall -I. -I\$(SRCPATH)"
LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS"
LDFLAGSCLI="$LDFLAGSCLI" LDFLAGSCLI="$LDFLAGSCLI"
ASFLAGS="$ASFLAGS" ASFLAGS="$ASFLAGS"
RCFLAGS="$RCFLAGS"
HAVE_GETOPT_LONG=1 HAVE_GETOPT_LONG=1
cross_prefix="" cross_prefix=""
...@@ -347,6 +349,9 @@ for opt do ...@@ -347,6 +349,9 @@ for opt do
--extra-ldflags=*) --extra-ldflags=*)
LDFLAGS="$LDFLAGS $optarg" LDFLAGS="$LDFLAGS $optarg"
;; ;;
--extra-rcflags=*)
RCFLAGS="$RCFLAGS $optarg"
;;
--disable-thread) --disable-thread)
thread="no" thread="no"
;; ;;
...@@ -495,12 +500,14 @@ case $host_os in ...@@ -495,12 +500,14 @@ case $host_os in
else else
SYS="WINDOWS" SYS="WINDOWS"
DEVNULL="NUL" DEVNULL="NUL"
RC="${RC-${cross_prefix}windres}"
fi fi
;; ;;
mingw*) mingw*)
SYS="WINDOWS" SYS="WINDOWS"
EXE=".exe" EXE=".exe"
DEVNULL="NUL" DEVNULL="NUL"
[ $compiler = ICL ] && RC="${RC-rc}" || RC="${RC-${cross_prefix}windres}"
;; ;;
sunos*|solaris*) sunos*|solaris*)
SYS="SunOS" SYS="SunOS"
...@@ -550,6 +557,7 @@ case $host_cpu in ...@@ -550,6 +557,7 @@ case $host_cpu in
elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
ASFLAGS="$ASFLAGS -f win32 -DPREFIX" ASFLAGS="$ASFLAGS -f win32 -DPREFIX"
LDFLAGS="$LDFLAGS -Wl,--large-address-aware" LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
[ $compiler = GNU ] && RCFLAGS="--target=pe-i386 $RCFLAGS"
else else
ASFLAGS="$ASFLAGS -f elf" ASFLAGS="$ASFLAGS -f elf"
fi fi
...@@ -567,6 +575,7 @@ case $host_cpu in ...@@ -567,6 +575,7 @@ case $host_cpu in
ASFLAGS="$ASFLAGS -f win32 -m amd64" ASFLAGS="$ASFLAGS -f win32 -m amd64"
# only the GNU toolchain is inconsistent in prefixing function names with _ # only the GNU toolchain is inconsistent in prefixing function names with _
[ $compiler = GNU ] && cc_check "" "-S" && grep -q "_main:" conftest && ASFLAGS="$ASFLAGS -DPREFIX" [ $compiler = GNU ] && cc_check "" "-S" && grep -q "_main:" conftest && ASFLAGS="$ASFLAGS -DPREFIX"
[ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
else else
ASFLAGS="$ASFLAGS -f elf -m amd64" ASFLAGS="$ASFLAGS -f elf -m amd64"
fi fi
...@@ -634,9 +643,7 @@ case $host_cpu in ...@@ -634,9 +643,7 @@ case $host_cpu in
;; ;;
esac esac
RC=""
if [ $SYS = WINDOWS ]; then if [ $SYS = WINDOWS ]; then
[ $compiler = ICL ] && RC="rc" || RC="${cross_prefix}windres"
if ! rc_check "0 RCDATA {0}" ; then if ! rc_check "0 RCDATA {0}" ; then
RC="" RC=""
fi fi
...@@ -994,7 +1001,7 @@ if [ $compiler = ICL ]; then ...@@ -994,7 +1001,7 @@ if [ $compiler = ICL ]; then
LDFLAGSCLI="$(icl_ldflags $LDFLAGSCLI)" LDFLAGSCLI="$(icl_ldflags $LDFLAGSCLI)"
LIBX264=libx264.lib LIBX264=libx264.lib
RANLIB= RANLIB=
[ -n "$RC" ] && RC="$RC -I. -I\$(SRCPATH)/extras -fo" [ -n "$RC" ] && RCFLAGS="$RCFLAGS -I. -I\$(SRCPATH)/extras -fo"
STRIP= STRIP=
if [ $debug = yes ]; then if [ $debug = yes ]; then
LDFLAGS="-debug $LDFLAGS" LDFLAGS="-debug $LDFLAGS"
...@@ -1008,7 +1015,7 @@ else ...@@ -1008,7 +1015,7 @@ else
DEPMT="-MT" DEPMT="-MT"
LD="$CC -o " LD="$CC -o "
LIBX264=libx264.a LIBX264=libx264.a
[ -n "$RC" ] && RC="$RC -I. -o " [ -n "$RC" ] && RCFLAGS="$RCFLAGS -I. -o "
fi fi
if [ $compiler = GNU ]; then if [ $compiler = GNU ]; then
PROF_GEN_CC="-fprofile-generate" PROF_GEN_CC="-fprofile-generate"
...@@ -1062,6 +1069,7 @@ STRIP=$STRIP ...@@ -1062,6 +1069,7 @@ STRIP=$STRIP
AS=$AS AS=$AS
ASFLAGS=$ASFLAGS ASFLAGS=$ASFLAGS
RC=$RC RC=$RC
RCFLAGS=$RCFLAGS
EXE=$EXE EXE=$EXE
HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
DEVNULL=$DEVNULL DEVNULL=$DEVNULL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment