Add configure switches for libbfd and bfd extra debug info.

This commit is contained in:
Jonathan G Rennison
2015-09-09 20:19:26 +01:00
parent eaf9aa6571
commit d7853db2fd

View File

@@ -95,6 +95,8 @@ set_default() {
with_nforenum="1" with_nforenum="1"
with_grfcodec="1" with_grfcodec="1"
with_sse="1" with_sse="1"
with_libbfd="1"
with_bfd_extra_debug="1"
save_params_array=" save_params_array="
build build
@@ -172,6 +174,8 @@ set_default() {
with_grfcodec with_grfcodec
with_nforenum with_nforenum
with_sse with_sse
with_libbfd
with_bfd_extra_debug
CC CXX CFLAGS CXXFLAGS LDFLAGS CFLAGS_BUILD CXXFLAGS_BUILD LDFLAGS_BUILD" CC CXX CFLAGS CXXFLAGS LDFLAGS CFLAGS_BUILD CXXFLAGS_BUILD LDFLAGS_BUILD"
} }
@@ -465,6 +469,14 @@ detect_params() {
--with-sse) with_sse="1";; --with-sse) with_sse="1";;
--with-sse=*) with_sse="$optarg";; --with-sse=*) with_sse="$optarg";;
--without-libbfd) with_libbfd="0";;
--with-libbfd) with_libbfd="1";;
--with-libbfd=*) with_libbfd="$optarg";;
--without-bfd-extra-debug) with_bfd_extra_debug="0";;
--with-bfd-extra-debug) with_bfd_extra_debug="1";;
--with-bfd-extra-debug=*) with_bfd_extra_debug="$optarg";;
CC=* | --CC=*) CC="$optarg";; CC=* | --CC=*) CC="$optarg";;
CXX=* | --CXX=*) CXX="$optarg";; CXX=* | --CXX=*) CXX="$optarg";;
CFLAGS=* | --CFLAGS=*) CFLAGS="$optarg";; CFLAGS=* | --CFLAGS=*) CFLAGS="$optarg";;
@@ -1571,29 +1583,31 @@ EOL
fi fi
rm -f tmp.config.libdl rm -f tmp.config.libdl
"$cc_host" $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - -lbfd 2> /dev/null << EOL if [ "$with_libbfd" = "1" ]; then
#define PACKAGE 1 "$cc_host" $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - -lbfd 2> /dev/null << EOL
#define PACKAGE_VERSION 1 #define PACKAGE 1
#include <bfd.h> #define PACKAGE_VERSION 1
int main() { #include <bfd.h>
bfd_init(); int main() {
unsigned int size; bfd_init();
asymbol *syms = 0; unsigned int size;
long symcount = bfd_read_minisymbols((bfd *) 0, false, (void**) &syms, &size); asymbol *syms = 0;
return 0; long symcount = bfd_read_minisymbols((bfd *) 0, false, (void**) &syms, &size);
} return 0;
}
EOL EOL
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
log 1 "checking libbfd... no" log 1 "checking libbfd... no"
else else
log 1 "checking libbfd... found" log 1 "checking libbfd... found"
LIBS="$LIBS -lbfd" LIBS="$LIBS -lbfd"
CFLAGS="$CFLAGS -DWITH_BFD" CFLAGS="$CFLAGS -DWITH_BFD"
if [ $enable_debug -lt 1 ]; then if [ $enable_debug -lt 1 ] && [ "$with_bfd_extra_debug" = "1" ]; then
CFLAGS="$CFLAGS -g1" CFLAGS="$CFLAGS -g1"
fi
fi fi
rm -f tmp.config.bfd
fi fi
rm -f tmp.config.bfd
fi fi
if [ "$os" = "MINGW" ]; then if [ "$os" = "MINGW" ]; then
@@ -1614,30 +1628,32 @@ EOL
log 1 "checking dbghelp... found" log 1 "checking dbghelp... found"
CFLAGS="$CFLAGS -DWITH_DBGHELP" CFLAGS="$CFLAGS -DWITH_DBGHELP"
"$cc_host" $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - -lbfd -liberty -lintl 2> /dev/null << EOL if [ "$with_libbfd" = "1" ]; then
#define PACKAGE 1 "$cc_host" $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - -lbfd -liberty -lintl 2> /dev/null << EOL
#define PACKAGE_VERSION 1 #define PACKAGE 1
#include <bfd.h> #define PACKAGE_VERSION 1
int main() { #include <bfd.h>
bfd_init(); int main() {
unsigned int size; bfd_init();
asymbol *syms = 0; unsigned int size;
long symcount = bfd_read_minisymbols((bfd *) 0, false, (void**) &syms, &size); asymbol *syms = 0;
return 0; long symcount = bfd_read_minisymbols((bfd *) 0, false, (void**) &syms, &size);
} return 0;
}
EOL EOL
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
log 1 "checking libbfd... no" log 1 "checking libbfd... no"
else else
log 1 "checking libbfd... found" log 1 "checking libbfd... found"
LIBS="$LIBS -lbfd -liberty -lintl" LIBS="$LIBS -lbfd -liberty -lintl"
CFLAGS="$CFLAGS -DWITH_BFD" CFLAGS="$CFLAGS -DWITH_BFD"
if [ $enable_debug -lt 1 ]; then if [ $enable_debug -lt 1 ] && [ "$with_bfd_extra_debug" = "1" ]; then
CFLAGS="$CFLAGS -g1" CFLAGS="$CFLAGS -g1"
fi
fi fi
rm -f tmp.config.bfd
fi fi
rm -f tmp.config.bfd
fi fi
rm -f tmp.config.dbghelp rm -f tmp.config.dbghelp
fi fi
@@ -3652,6 +3668,8 @@ showhelp() {
echo " --without-grfcodec disable usage of grfcodec and re-generation of base sets" echo " --without-grfcodec disable usage of grfcodec and re-generation of base sets"
echo " --without-threads disable threading support" echo " --without-threads disable threading support"
echo " --without-sse disable SSE support (x86/x86_64 only)" echo " --without-sse disable SSE support (x86/x86_64 only)"
echo " --without-libbfd disable libbfd support, used for improved crash logs (MinGW and Unix/glibc only)"
echo " --without-bfd-extra-debug disable extra debugging information when using libbfd (MinGW and Unix/glibc only)"
echo "" echo ""
echo "Some influential environment variables:" echo "Some influential environment variables:"
echo " CC C compiler command" echo " CC C compiler command"