configure: misc compiler flags fixes.

- Don't use -Wp, some compilers don't understand it. Simply use -D__BLAH___.
- Check for -Wl,--export-dynamic and if that fails try -rdynamic.
This commit is contained in:
Juan RP 2011-02-24 15:33:53 +01:00
parent a252df4a8b
commit 17be7bab81
2 changed files with 9 additions and 2 deletions

9
configure vendored
View File

@ -253,7 +253,7 @@ if [ $? -eq 0 ]; then
fi
fi
if [ $? -eq 0 ]; then
check_compiler_flag "p,-D_FORTIFY_SOURCE=2" W
check_compiler_flag "_FORTIFY_SOURCE=2" D CPPFLAGS
fi
check_compiler_flag "visibility=default" f SHAREDLIB_CFLAGS
if [ $? -eq 0 ]; then
@ -264,6 +264,13 @@ check_compiler_flag "std=c99" "" CFLAGS
check_compiler_flag "l,--as-needed" W LDFLAGS
check_compiler_flag "O2" "" CFLAGS
check_compiler_flag "pipe" "" CFLAGS
#
# Check for -Wl,--export-dynamic and if it fails, try -rdynamic.
#
check_compiler_flag "l,--export-dynamic" W LIBXBPS_LDFLAGS
if [ $? -ne 0 ]; then
check_compiler_flag dynamic r LIBXBPS_LDFLAGS
fi
#
# Check if -fPIE and -pie are supported if --build-pie is set.

View File

@ -4,7 +4,7 @@ LIBXBPS_MAJOR = 0
LIBXBPS_MINOR = 0
LIBXBPS_MICRO = 0
LIBXBPS_SHLIB = libxbps.so.$(LIBXBPS_MAJOR).$(LIBXBPS_MINOR).$(LIBXBPS_MICRO)
LDFLAGS += -Wl,--export-dynamic -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR)
LDFLAGS += $(LIBXBPS_LDFLAGS) -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR)
# portableproplib
LIBPROP_OBJS = portableproplib/prop_array.o portableproplib/prop_bool.o