]> git.sesse.net Git - x264/commitdiff
Fix configure so that boolean configuration options are 1/0
authorSteven Walters <kemuri9@gmail.com>
Mon, 22 Nov 2010 01:31:05 +0000 (10:31 +0900)
committerFiona Glaser <fiona@x264.com>
Thu, 25 Nov 2010 21:46:01 +0000 (13:46 -0800)
There are many cases of 1/undef, not 1/0.

Makefile
common/arm/asm.S
common/bitstream.c
common/macroblock.h
configure

index 21f57e7c077b27fe0ca676637df7de27294fab22..6344ca4f0b622669716295d7ccba4bf3ddce61cd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,34 +25,34 @@ SRCSO =
 CONFIG := $(shell cat config.h)
 
 # GPL-only files
-ifeq ($(GPL),yes)
+ifneq ($(findstring HAVE_GPL 1, $(CONFIG)),)
 SRCCLI +=
 endif
 
 # Optional module sources
-ifneq ($(findstring HAVE_AVS, $(CONFIG)),)
+ifneq ($(findstring HAVE_AVS 1, $(CONFIG)),)
 SRCCLI += input/avs.c
 endif
 
-ifneq ($(findstring HAVE_PTHREAD, $(CONFIG)),)
+ifneq ($(findstring HAVE_PTHREAD 1, $(CONFIG)),)
 SRCCLI += input/thread.c
 SRCS   += common/threadpool.c
 endif
 
-ifneq ($(findstring HAVE_LAVF, $(CONFIG)),)
+ifneq ($(findstring HAVE_LAVF 1, $(CONFIG)),)
 SRCCLI += input/lavf.c
 endif
 
-ifneq ($(findstring HAVE_FFMS, $(CONFIG)),)
+ifneq ($(findstring HAVE_FFMS 1, $(CONFIG)),)
 SRCCLI += input/ffms.c
 endif
 
-ifneq ($(findstring HAVE_GPAC, $(CONFIG)),)
+ifneq ($(findstring HAVE_GPAC 1, $(CONFIG)),)
 SRCCLI += output/mp4.c
 endif
 
 # Visualization sources
-ifeq ($(VIS),yes)
+ifneq ($(findstring HAVE_VISUALIZE 1, $(CONFIG)),)
 SRCS   += common/visualize.c common/display-x11.c
 endif
 
index 743426224618e59136490508b67af77927a57452..1bf2a00763081ae3ba8d637f123089612b5c6322 100644 (file)
@@ -56,7 +56,7 @@ ELF     .type   \name, %function
         .endm
 
         .macro movrel rd, val
-#if defined(HAVE_ARMV6T2) && !defined(PIC)
+#if HAVE_ARMV6T2 && !defined(PIC)
         movw            \rd, #:lower16:\val
         movt            \rd, #:upper16:\val
 #else
@@ -65,7 +65,7 @@ ELF     .type   \name, %function
         .endm
 
 .macro movconst rd, val
-#ifdef HAVE_ARMV6T2
+#if HAVE_ARMV6T2
     movw        \rd, #:lower16:\val
 .if \val >> 16
     movt        \rd, #:upper16:\val
index a2d20a9c55a9a9c10d20e79cdece1374dd6aa293..243f16a99c2680721dfd50fe865e13a7b9e2f0b9 100644 (file)
@@ -39,7 +39,7 @@ static uint8_t *x264_nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )
     return dst;
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 uint8_t *x264_nal_escape_mmxext( uint8_t *dst, uint8_t *src, uint8_t *end );
 uint8_t *x264_nal_escape_sse2( uint8_t *dst, uint8_t *src, uint8_t *end );
 #endif
@@ -88,7 +88,7 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )
 void x264_bitstream_init( int cpu, x264_bitstream_function_t *pf )
 {
     pf->nal_escape = x264_nal_escape_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if( cpu&X264_CPU_MMXEXT )
         pf->nal_escape = x264_nal_escape_mmxext;
     if( (cpu&X264_CPU_SSE2) && (cpu&X264_CPU_SSE2_IS_FAST) )
index eb5b6f9a31866bbac34391d2ddc2de7feaca1491..7690e01bf840ecbdbf5021670e31b5869ff2bd82 100644 (file)
@@ -364,7 +364,7 @@ static ALWAYS_INLINE uint32_t pack16to32_mask( int a, int b )
 }
 static ALWAYS_INLINE uint64_t pack32to64( uint32_t a, uint32_t b )
 {
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
    return b + ((uint64_t)a<<32);
 #else
    return a + ((uint64_t)b<<32);
index fd623375da37c68da7aadbcf44a53f56ec464551..8ca32984fd9e751211429d99b81e852e426161c7 100755 (executable)
--- a/configure
+++ b/configure
@@ -171,6 +171,9 @@ cross_prefix=""
 
 EXE=""
 
+# list of all preprocessor HAVE values we can define
+CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON PTHREAD LOG2F VISUALIZE SWSCALE LAVF FFMS GPAC GF_MALLOC AVS GPL"
+
 # parse options
 
 for opt do
@@ -735,11 +738,12 @@ fi
 define BIT_DEPTH $bit_depth
 ASFLAGS="$ASFLAGS -DBIT_DEPTH=$bit_depth"
 
-if [ $gpl = yes ]; then
-    define HAVE_GPL 1
-else
-    define HAVE_GPL 0
-fi
+[ $gpl = yes ] && define HAVE_GPL
+
+#define undefined vars as 0
+for var in $CONFIG_HAVE; do
+    grep -q "HAVE_$var 1" config.h || define HAVE_$var 0
+done
 
 rm -f conftest*
 
@@ -763,10 +767,8 @@ STRIP=$STRIP
 AS=$AS
 ASFLAGS=$ASFLAGS
 EXE=$EXE
-VIS=$vis
 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
 DEVNULL=$DEVNULL
-GPL=$gpl
 EOF
 
 if [ "$shared" = "yes" ]; then