Adjust libtool and linker flags

Since we use libtool, -static-libgcc and -static-libstdc++ are
stripped by libtool and not used. We just use -all-static libtool flag
for this purpose.

To create windows dll, it turns out that we need -no-undefined flag.
pull/150/head
Tatsuhiro Tsujikawa 2013-10-24 00:13:05 +09:00
parent 1cf03bdada
commit cdbd4f0095
1 changed files with 8 additions and 1 deletions

View File

@ -959,13 +959,20 @@ AM_CONDITIONAL([ANDROID_MIPS], [test "x$android_mips" = "xyes"])
AM_CONDITIONAL([ANDROID_X86], [test "x$android_x86" = "xyes"])
if test "x$ARIA2_STATIC" = "xyes"; then
LDFLAGS="$LDFLAGS -all-static -static-libgcc -static-libstdc++"
# -static-libgcc and -static-libstdc++ are linker flags and not for
# libtool.
LDFLAGS="$LDFLAGS -all-static"
dnl For non-MinGW build, we need additional libs for static build.
if test "x$win_build" != "xyes"; then
LIBS="$LIBS -lpthread -ldl -lrt"
fi
fi
if test "x$win_build" = "xyes" && test "x$enable_libaria2" = "xyes"; then
# Creating dll needs this
LDFLAGS="$LDFLAGS -no-undefined"
fi
AC_CONFIG_FILES([Makefile
src/Makefile
src/libaria2.pc