Commit 3145e67d authored by James Darnley's avatar James Darnley Committed by Fiona Glaser

Add --disable-gpl option to configure

Used for commercially-licensed versions of x264.
Doesn't currently change anything, but may be used to disable GPL-only CLI tools, such as video filters, in the future.
Also print the x264 license and libavformat license in version info.
parent 213a99d0
......@@ -24,6 +24,11 @@ SRCSO =
CONFIG := $(shell cat config.h)
# GPL-only files
ifeq ($(GPL),yes)
SRCCLI +=
endif
# Optional module sources
ifneq ($(findstring HAVE_AVS, $(CONFIG)),)
SRCCLI += input/avs.c
......
......@@ -11,6 +11,7 @@ echo " --disable-avs disables avisynth support (windows only)"
echo " --disable-lavf disables libavformat support"
echo " --disable-ffms disables ffmpegsource support"
echo " --disable-gpac disables gpac support"
echo " --disable-gpl disables GPL-only features"
echo " --disable-pthread disables multithreaded encoding"
echo " --disable-swscale disables swscale support"
echo " --disable-asm disables platform-specific assembly optimizations"
......@@ -138,6 +139,7 @@ avs="auto"
lavf="auto"
ffms="auto"
gpac="auto"
gpl="yes"
pthread="auto"
swscale="auto"
asm="auto"
......@@ -192,6 +194,9 @@ for opt do
--disable-gpac)
gpac="no"
;;
--disable-gpl)
gpl="no"
;;
--extra-asflags=*)
ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
;;
......@@ -709,6 +714,12 @@ fi
define BIT_DEPTH $bit_depth
if [ $gpl = yes ]; then
define HAVE_GPL 1
else
define HAVE_GPL 0
fi
rm -f conftest*
# generate config files
......@@ -734,6 +745,7 @@ EXE=$EXE
VIS=$vis
HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
DEVNULL=$DEVNULL
GPL=$gpl
EOF
if [ "$shared" = "yes" ]; then
......@@ -776,7 +788,9 @@ Cflags: -I$includedir
EOF
filters="crop select_every"
gpl_filters=""
[ $swscale = yes ] && filters="resize $filters"
[ $gpl = yes ] && filters="$filters $gpl_filters"
cat > conftest.log <<EOF
Platform: $ARCH
......@@ -786,6 +800,7 @@ avs: $avs
lavf: $lavf
ffms: $ffms
gpac: $gpac
gpl: $gpl
pthread: $pthread
filters: $filters
debug: $debug
......
......@@ -51,6 +51,8 @@ void x264_register_vid_filters()
REGISTER_VFILTER( fix_vfr_pts );
REGISTER_VFILTER( resize );
REGISTER_VFILTER( select_every );
#if HAVE_GPL
#endif
}
int x264_init_vid_filter( const char *name, hnd_t *handle, cli_vid_filter_t *filter,
......
......@@ -49,6 +49,8 @@
#endif
#if HAVE_LAVF
#undef DECLARE_ALIGNED
#include <libavformat/avformat.h>
#include <libavutil/pixfmt.h>
#include <libavutil/pixdesc.h>
#endif
......@@ -199,6 +201,36 @@ void x264_cli_printf( int i_level, const char *fmt, ... )
va_end( arg );
}
static void print_version_info()
{
#ifdef X264_POINTVER
printf( "x264 "X264_POINTVER"\n" );
#else
printf( "x264 0.%d.X\n", X264_BUILD );
#endif
printf( "built on " __DATE__ ", " );
#ifdef __GNUC__
printf( "gcc: " __VERSION__ "\n" );
#else
printf( "using a non-gcc compiler\n" );
#endif
printf( "configuration: --bit-depth=%d\n", BIT_DEPTH );
printf( "x264 license: " );
#if HAVE_GPL
printf( "GPL version 2 or later\n" );
#else
printf( "Non-GPL commercial\n" );
#endif
#if HAVE_LAVF
const char *license = avformat_license();
printf( "libavformat license: %s\n", license );
if( !strcmp( license, "nonfree and unredistributable" ) ||
(!HAVE_GPL && (!strcmp( license, "GPL version 2 or later" )
|| !strcmp( license, "GPL version 3 or later" ))))
printf( "WARNING: This binary is unredistributable!\n" );
#endif
}
/****************************************************************************
* main:
****************************************************************************/
......@@ -1153,18 +1185,7 @@ static int Parse( int argc, char **argv, x264_param_t *param, cli_opt_t *opt )
Help( &defaults, 2 );
exit(0);
case 'V':
#ifdef X264_POINTVER
printf( "x264 "X264_POINTVER"\n" );
#else
printf( "x264 0.%d.X\n", X264_BUILD );
#endif
printf( "built on " __DATE__ ", " );
#ifdef __GNUC__
printf( "gcc: " __VERSION__ "\n" );
#else
printf( "using a non-gcc compiler\n" );
#endif
printf( "configuration: --bit-depth=%d\n", BIT_DEPTH );
print_version_info();
exit(0);
case OPT_FRAMES:
param->i_frame_total = X264_MAX( atoi( optarg ), 0 );
......
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