From f351754bf36c14a8166791d4d008523957a897e3 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Wed, 3 Jun 2020 10:22:01 -0700 Subject: [PATCH] Remove --enable-avcodec from build scripts, fix FFMPEG detection, do not link to avcodec or include avcodec headers if not detected --- build | 2 +- build-debug | 2 +- build-debug-no-avcodec | 32 -------------------------------- build-debug-no-mt32 | 2 +- build-debug-sdl2 | 2 +- build-macosx | 2 +- build-macosx-sdl2 | 2 +- build-no-avcodec | 24 ------------------------ configure.ac | 8 +++----- 9 files changed, 9 insertions(+), 67 deletions(-) delete mode 100755 build-debug-no-avcodec delete mode 100755 build-no-avcodec diff --git a/build b/build index ead6bcd0a..85359c345 100755 --- a/build +++ b/build @@ -19,6 +19,6 @@ echo Compiling our internal SDLnet 1.x # now compile ourself echo Compiling DOSBox-X chmod +x configure -./configure --enable-core-inline --disable-debug --enable-avcodec --prefix=/usr "$@" || exit 1 +./configure --enable-core-inline --disable-debug --prefix=/usr "$@" || exit 1 make -j3 || exit 1 diff --git a/build-debug b/build-debug index c7e619f20..8db6601e4 100755 --- a/build-debug +++ b/build-debug @@ -37,6 +37,6 @@ echo Compiling our internal SDLnet 1.x # now compile ourself echo Compiling DOSBox-X chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr "$@" $opt || exit 1 +./configure --enable-core-inline --enable-debug=heavy --prefix=/usr "$@" $opt || exit 1 make -j3 || exit 1 diff --git a/build-debug-no-avcodec b/build-debug-no-avcodec deleted file mode 100755 index 92e1e4302..000000000 --- a/build-debug-no-avcodec +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# allow 32-bit on 64-bit (x86) builds -if [ "$1" == "32" ]; then - export CC=`which gcc`" -m32" - export CXX=`which g++`" -m32" - shift - opt="--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu" -fi - -# I'm sick and tired of all the churn the three versions of autoconf -# are causing in this repo. Stop committing the configure scripts -# and just autoregen. -./autogen.sh || exit 1 - -# fix -chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh - -# prefer to compile against our own copy of SDL 1.x -echo Compiling our internal SDL 1.x -(cd vs2015/sdl && ./build-dosbox.sh) || exit 1 - -# prefer to compile against our own copy of SDLnet 1.x -echo Compiling our internal SDLnet 1.x -(cd vs2015/sdlnet && ./build-dosbox.sh) || exit 1 - -# now compile ourself -echo Compiling DOSBox-X -chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --disable-avcodec --prefix=/usr "$@" $opt || exit 1 -make -j3 || exit 1 - diff --git a/build-debug-no-mt32 b/build-debug-no-mt32 index 7a8782863..40cbc816e 100755 --- a/build-debug-no-mt32 +++ b/build-debug-no-mt32 @@ -26,6 +26,6 @@ echo Compiling our internal SDLnet 1.x # now compile ourself echo Compiling DOSBox-X chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr --disable-mt32 "$@" || exit 1 +./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --disable-mt32 "$@" || exit 1 make -j3 || exit 1 diff --git a/build-debug-sdl2 b/build-debug-sdl2 index aa717a1ac..879c48f8a 100755 --- a/build-debug-sdl2 +++ b/build-debug-sdl2 @@ -33,6 +33,6 @@ echo Compiling our internal SDLnet 1.x (cd vs2015/sdlnet && ./build-dosbox.sh) || exit 1 chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr --enable-sdl2 "$@" $opt || exit 1 +./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --enable-sdl2 "$@" $opt || exit 1 make -j3 || exit 1 diff --git a/build-macosx b/build-macosx index 4a569f6dc..7dc3eae2f 100755 --- a/build-macosx +++ b/build-macosx @@ -45,6 +45,6 @@ export CXXFLAGS="$new$CXXFLAGS" # now compile ourself echo Compiling DOSBox-X chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --prefix=/usr "$@" || exit 1 # --enable-avcodec +./configure --enable-core-inline --enable-debug=heavy --prefix=/usr "$@" || exit 1 make -j3 || exit 1 diff --git a/build-macosx-sdl2 b/build-macosx-sdl2 index 8ea4e8568..18caf5622 100755 --- a/build-macosx-sdl2 +++ b/build-macosx-sdl2 @@ -42,6 +42,6 @@ export CXXFLAGS="$new$CXXFLAGS" # now compile ourself echo Compiling DOSBox-X chmod +x configure -./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --enable-sdl2 "$@" || exit 1 # --enable-avcodec +./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --enable-sdl2 "$@" || exit 1 make -j3 || exit 1 diff --git a/build-no-avcodec b/build-no-avcodec deleted file mode 100755 index 85359c345..000000000 --- a/build-no-avcodec +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# I'm sick and tired of all the churn the three versions of autoconf -# are causing in this repo. Stop committing the configure scripts -# and just autoregen. -./autogen.sh || exit 1 - -# fix -chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh - -# prefer to compile against our own copy of SDL 1.x -echo Compiling our internal SDL 1.x -(cd vs2015/sdl && ./build-dosbox.sh) || exit 1 - -# prefer to compile against our own copy of SDLnet 1.x -echo Compiling our internal SDLnet 1.x -(cd vs2015/sdlnet && ./build-dosbox.sh) || exit 1 - -# now compile ourself -echo Compiling DOSBox-X -chmod +x configure -./configure --enable-core-inline --disable-debug --prefix=/usr "$@" || exit 1 -make -j3 || exit 1 - diff --git a/configure.ac b/configure.ac index edd4238d0..e7f38e742 100644 --- a/configure.ac +++ b/configure.ac @@ -947,14 +947,12 @@ fi dnl FEATURE: FFMPEG output support AH_TEMPLATE(C_AVCODEC,[Define to 1 to use FFMPEG libavcodec for video capture]) AC_ARG_ENABLE(avcodec,AC_HELP_STRING([--disable-avcodec],[Disable FFMPEG avcodec support]),,enable_ffmpeg=yes) -if test x$enable_avcodec = xyes; then - CFLAGS="$CFLAGS "`pkg-config libavcodec --cflags` - CPPFLAGS="$CPPFLAGS "`pkg-config libavcodec --cflags` - LIBS="$LIBS -lavcodec -lavformat -lavutil -lswscale "`pkg-config libavcodec --libs` -fi if test x$enable_avcodec = xyes; then if test x$have_ffmpeg = xyes; then if test x$have_avcodec_h = xyes; then + CFLAGS="$CFLAGS "`pkg-config libavcodec --cflags` + CPPFLAGS="$CPPFLAGS "`pkg-config libavcodec --cflags` + LIBS="$LIBS -lavcodec -lavformat -lavutil -lswscale "`pkg-config libavcodec --libs` AC_MSG_RESULT(yes) AC_DEFINE(C_AVCODEC,1) fi