[build] add --enable-static-cxx config option
Links libstdc++ statically.
This commit is contained in:
parent
0fced25b3e
commit
20bf5bb06d
@ -110,8 +110,11 @@ CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
||||
CXXFLAGS+=@CXXDEBUG_FLAG@
|
||||
CXXFLAGS+=@CXX_STRERROR_FLAG@
|
||||
CXXFLAGS+=@LFS_FLAGS@
|
||||
CXXFLAGS+=@STATIC_LINK_FLAGS@
|
||||
LDFLAGS+=@STATIC_LINK_FLAGS@
|
||||
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
|
||||
LIBS:=-lstdc++ -laio -lexpat
|
||||
LIBS:=-laio -lexpat
|
||||
LIBS+=@DYNAMIC_LINK_FLAGS@
|
||||
INSTALL:=@INSTALL@
|
||||
PREFIX:=@prefix@
|
||||
BINDIR:=$(DESTDIR)$(PREFIX)/sbin
|
||||
|
18
configure.ac
18
configure.ac
@ -137,6 +137,22 @@ AC_ARG_ENABLE(testing,
|
||||
TESTING=$enableval, TESTING=no)
|
||||
AC_MSG_RESULT($TESTING)
|
||||
|
||||
################################################################################
|
||||
dnl -- Enable static libstdc++
|
||||
AC_MSG_CHECKING(whether to statically link libstdc++)
|
||||
AC_ARG_ENABLE(static_cxx,
|
||||
AC_HELP_STRING(--enable-static-cxx, [enable static link of libstdc++]),
|
||||
STATIC_CXX=$enableval, STATIC_CXX=no)
|
||||
AC_MSG_RESULT($STATIC_CXX)
|
||||
|
||||
if test x$STATIC_CXX = xyes; then
|
||||
STATIC_LINK_FLAGS=-static-libstdc++
|
||||
DYNAMIC_LINK_FLAGS=
|
||||
else
|
||||
STATIC_LINK_FLAGS=
|
||||
DYNAMIC_LINK_FLAGS=-lstdc++
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
dnl -- Check for getopt
|
||||
AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
|
||||
@ -164,6 +180,8 @@ AC_SUBST(RELEASE_DATE)
|
||||
AC_SUBST(RELEASE_DATE)
|
||||
AC_SUBST(TESTING)
|
||||
AC_SUBST(THIN_PROVISIONING_TOOLS_VERSION)
|
||||
AC_SUBST(STATIC_LINK_FLAGS)
|
||||
AC_SUBST(DYNAMIC_LINK_FLAGS)
|
||||
|
||||
################################################################################
|
||||
dnl -- First and last lines should not contain files to generate in order to
|
||||
|
Loading…
Reference in New Issue
Block a user