chore: better use of configure features

This commit is contained in:
Stéphane Lesimple
2021-01-17 11:34:37 +01:00
parent c72b85bb9a
commit 9e5ba80e29
39 changed files with 550 additions and 525 deletions

58
configure vendored
View File

@@ -4,26 +4,10 @@
BASH_BASED_CONFIGURE=./scripts/bash-based-configure
BASH_BASED_CONFIGURE_OPTS="--buildtmp=$(pwd)/build $@"
REQUIRED_CFLAGS="-DPATCHLEVEL=5 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I. -pipe"
REQUIRED_CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I. -pipe"
RECOMMENDED_CFLAGS="-O2 -fomit-frame-pointer -Wall -Wno-unknown-warning-option -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-format-zero-length"
DEBUG_CFLAGS="-ggdb -Wall"
if [ "$CLI_ONLY" = 1 ]; then
REQUIRED_CFLAGS="-DCLI $REQUIRED_CFLAGS"
fi
if [ "$DEBUG_PRINTF_FORMAT" = 1 ]; then
# don't use the binary compiled with this,
# it's only useful to properly get all the build-time
# warnings around printf-errors, that are otherwise
# not catched by the compiler because of the _() macro
REQUIRED_CFLAGS="-DDEBUG_PRINTF_FORMAT $REQUIRED_CFLAGS"
else
# warnings given by -Wformat-security are bogus because of _(),
# see above comment if you actually want to check for format errors
RECOMMENDED_CFLAGS="$RECOMMENDED_CFLAGS -Wno-format-security"
fi
CFG_USE_CYGWIN="no" # do not change
if test -e $BASH_BASED_CONFIGURE; then
@@ -37,8 +21,8 @@ fi
# Set the package name and version
PACKAGE dvdisaster 0.79.6
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_UNSTABLE_RELEASE"
DEFINE_INT PATCHLEVEL 5
DEFINE_STRING HAVE_UNSTABLE_RELEASE 1
# Check for some essential tools.
@@ -60,12 +44,22 @@ GET_LOCALEDIR
GET_BUILDROOT
GET_BUILDTMP
PRINT_MESSAGE "\nDetermining build flavor:"
# old way of specifying --with-cli-only
if [ "$CLI_ONLY" = 1 ]; then
cfg_with_cli_only=yes
unset CLI_ONLY
fi
WITH_OPTION cli-only no "[yes | no]"
# Look for required libraries
PRINT_MESSAGE "\nLooking for includes and libraries:"
REQUIRE_GLIB2 2 32 0
if [ "$CLI_ONLY" != 1 ]; then
if test "$cfg_with_cli_only" != "yes"; then
REQUIRE_GTK2 2 6 0 WITH_THREADS
fi
echo
@@ -129,7 +123,7 @@ if ! EXECUTE_PROGRAM "xgettext --help" xgettext \
cfg_force_with_nls=no
fi
if [ "$CLI_ONLY" != 1 ]; then
if test "$cfg_with_cli_only" != "yes"; then
if ! EXECUTE_PROGRAM "gdk-pixbuf-csource --help" gdk_pixbuf_csource ; then
echo "* gdk-pixbuf not installed"
echo "* or path to gdk-pixbuf-csource is missing."
@@ -147,6 +141,24 @@ WITH_OPTION embedded-src-path yes "[yes | no]"
PRINT_MESSAGE "\nDebugging options (do not use in production system):"
WITH_OPTION memdebug no "[no | yes]"
WITH_OPTION debug-printf-format no "[no | yes]"
WITH_OPTION werror no "[no | yes]"
if test "$cfg_with_debug_printf_format" == "yes"; then
# don't use the binary compiled with this,
# it's only useful to properly get all the build-time
# warnings around printf-errors, that are otherwise
# not catched by the compiler because of the _() macro
DEFINE_STRING DEBUG_PRINTF_FORMAT 1
else
# warnings given by -Wformat-security are bogus because of _(),
# see above comment if you actually want to check for format errors
CFG_CFLAGS="$CFG_CFLAGS -Wno-format-security"
fi
if test "$cfg_with_werror" == "yes"; then
CFG_CFLAGS="$CFG_CFLAGS -Werror"
fi
if test "$cfg_with_efence" == "yes"; then
if ! CHECK_LIBRARY efence malloc efence; then
@@ -172,7 +184,7 @@ cfiles="src/method-link.c"
ofiles="$BUILDTMP/method-link.o"
for cfile in src/*.c; do
if [ "$CLI_ONLY" = 1 ]; then
if test "$cfg_with_cli_only" == "yes"; then
grep -q 'DVDISASTER_GUI_FILE' "$cfile" && continue
fi
cfile_prefix=`echo $cfile | sed -e 's/\.c//'`
@@ -184,7 +196,7 @@ done
echo
echo -e "\nCFG_CFILES = $cfiles" >> Makefile.config
echo "CFG_OFILES = $ofiles" >> Makefile.config
if [ "$CLI_ONLY" != 1 ]; then
if test "$cfg_with_cli_only" != "yes"; then
echo "ICONS = src/inlined-icons.h" >> Makefile.config
fi