config: Use --static as necessary when autodetecting libs:

libdl, libbfd and dependecies, and cpp symbol demangler support.
This commit is contained in:
Jonathan G Rennison 2015-12-23 00:45:37 +00:00
parent 897744ab47
commit 42a55f9500

View File

@ -1450,8 +1450,8 @@ make_compiler_cflags() {
} }
test_compile_libbfd() { test_compile_libbfd() {
log 2 "executing $cc_host $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - $1" log 2 "executing $cc_host $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.bfd -x c++ - $1"
"$cc_host" $CFLAGS $LDFLAGS -o tmp.config.bfd -x c++ - $1 2> /dev/null << EOL "$cc_host" $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.bfd -x c++ - $1 2> /dev/null << EOL
#define PACKAGE 1 #define PACKAGE 1
#define PACKAGE_VERSION 1 #define PACKAGE_VERSION 1
#include <bfd.h> #include <bfd.h>
@ -1503,6 +1503,12 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -D$os" CFLAGS="$CFLAGS -D$os"
CFLAGS_BUILD="$CFLAGS_BUILD -D$os" CFLAGS_BUILD="$CFLAGS_BUILD -D$os"
if [ "$enable_static" != "0" ]; then
STATIC_FLAGS="--static"
else
STATIC_FLAGS=""
fi
if [ "$enable_debug" = "0" ]; then if [ "$enable_debug" = "0" ]; then
# No debug, add default stuff # No debug, add default stuff
OBJS_SUBDIR="release" OBJS_SUBDIR="release"
@ -1602,8 +1608,8 @@ make_cflags_and_ldflags() {
LIBS="$LIBS -lpthread" LIBS="$LIBS -lpthread"
fi fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
log 2 "executing $cc_host $CFLAGS $LDFLAGS -o tmp.config.libdl -x c++ - -ldl" log 2 "executing $cc_host $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.libdl -x c++ - -ldl"
"$cc_host" $CFLAGS $LDFLAGS -o tmp.config.libdl -x c++ - -ldl 2> /dev/null << EOL "$cc_host" $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.libdl -x c++ - -ldl 2> /dev/null << EOL
#include <dlfcn.h> #include <dlfcn.h>
int main() { int main() {
Dl_info info; Dl_info info;
@ -1684,8 +1690,8 @@ EOL
fi fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
log 2 "executing $cc_host $CFLAGS $LDFLAGS -o tmp.config.demangle -x c++ - -lstdc++" log 2 "executing $cc_host $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.demangle -x c++ - -lstdc++"
"$cc_host" $CFLAGS $LDFLAGS -o tmp.config.demangle -x c++ - -lstdc++ 2> /dev/null << EOL "$cc_host" $CFLAGS $LDFLAGS $STATIC_FLAGS -o tmp.config.demangle -x c++ - -lstdc++ 2> /dev/null << EOL
#include <cxxabi.h> #include <cxxabi.h>
int main() { int main() {
int status = -1; int status = -1;