[build] g++ versions prior to 4.5 don't support the --static-libstdc++ flag so hack around it

This commit is contained in:
Joe Thornber 2016-02-08 11:58:19 +00:00
parent ebd4981271
commit 244405ed5d
2 changed files with 8 additions and 13 deletions

View File

@ -110,11 +110,15 @@ CXXFLAGS+=@CXXOPTIMISE_FLAG@
CXXFLAGS+=@CXXDEBUG_FLAG@ CXXFLAGS+=@CXXDEBUG_FLAG@
CXXFLAGS+=@CXX_STRERROR_FLAG@ CXXFLAGS+=@CXX_STRERROR_FLAG@
CXXFLAGS+=@LFS_FLAGS@ CXXFLAGS+=@LFS_FLAGS@
CXXFLAGS+=@STATIC_LINK_FLAGS@
LDFLAGS+=@STATIC_LINK_FLAGS@
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
LIBS:=-laio -lexpat LIBS:=-laio -lexpat
LIBS+=@DYNAMIC_LINK_FLAGS@
ifeq ("@STATIC_CXX@", "yes")
LIBS+=$(shell g++ -print-file-name=libstdc++.a)
else
LIBS+=-lstdc++
endif
INSTALL:=@INSTALL@ INSTALL:=@INSTALL@
PREFIX:=@prefix@ PREFIX:=@prefix@
BINDIR:=$(DESTDIR)$(PREFIX)/sbin BINDIR:=$(DESTDIR)$(PREFIX)/sbin

View File

@ -145,14 +145,6 @@ AC_ARG_ENABLE(static_cxx,
STATIC_CXX=$enableval, STATIC_CXX=no) STATIC_CXX=$enableval, STATIC_CXX=no)
AC_MSG_RESULT($STATIC_CXX) 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 dnl -- Check for getopt
AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
@ -180,8 +172,7 @@ AC_SUBST(RELEASE_DATE)
AC_SUBST(RELEASE_DATE) AC_SUBST(RELEASE_DATE)
AC_SUBST(TESTING) AC_SUBST(TESTING)
AC_SUBST(THIN_PROVISIONING_TOOLS_VERSION) AC_SUBST(THIN_PROVISIONING_TOOLS_VERSION)
AC_SUBST(STATIC_LINK_FLAGS) AC_SUBST(STATIC_CXX)
AC_SUBST(DYNAMIC_LINK_FLAGS)
################################################################################ ################################################################################
dnl -- First and last lines should not contain files to generate in order to dnl -- First and last lines should not contain files to generate in order to