Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
db44f4f5
Commit
db44f4f5
authored
Jun 25, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around libtool dropping -stdlib from CXXFLAGS when linking by putting it in CXX instead.
parent
451223a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
15 deletions
+24
-15
configure.ac
c++/configure.ac
+4
-3
ax_cxx_compile_stdcxx_11.m4
c++/m4/ax_cxx_compile_stdcxx_11.m4
+20
-12
No files found.
c++/configure.ac
View file @
db44f4f5
...
@@ -26,14 +26,15 @@ AC_PROG_CXX
...
@@ -26,14 +26,15 @@ AC_PROG_CXX
AC_LANG([C++])
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_11([noext])
AX_CXX_COMPILE_STDCXX_11([noext])
ACX_PTHREAD
ACX_PTHREAD
AC_PROG_LIBTOOL
AC_PROG_LIBTOOL
LIBS="$PTHREAD_LIBS $LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
#
We need gtest to use the same CXXFLAGS, especially -std and -stdlib, so export them before
#
AX_CXX_COMPILE_STDCXX_11 may have modified CXX, and we need gtest to use these modifications as
#
configuring gtest
.
#
well (especially -stdlib)
.
export CXX
FLAGS
export CXX
AC_CONFIG_SUBDIRS([gtest])
AC_CONFIG_SUBDIRS([gtest])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile])
...
...
c++/m4/ax_cxx_compile_stdcxx_11.m4
View file @
db44f4f5
# ============================================================================
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# Additionally modified to detect -stdlib by Kenton Varda.
# ============================================================================
# ============================================================================
#
#
# SYNOPSIS
# SYNOPSIS
...
@@ -21,6 +22,13 @@
...
@@ -21,6 +22,13 @@
# on Mac OSX 10.8, which ships with a very old libstdc++ but a relatively
# on Mac OSX 10.8, which ships with a very old libstdc++ but a relatively
# new libc++.
# new libc++.
#
#
# Both flags are actually added to CXX rather than CXXFLAGS to work around
# a bug in libtool: -stdlib is stripped from CXXFLAGS when linking dynamic
# libraries because it is not recognized. A patch was committed to mainline
# libtool in February 2012 but as of June 2013 there has not yet been a
# release containing this patch.
# http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=commit;h=c0c49f289f22ae670066657c60905986da3b555f
#
# LICENSE
# LICENSE
#
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
...
@@ -80,14 +88,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
...
@@ -80,14 +88,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
$cachevar,
$cachevar,
[ac_save_CXX
FLAGS="$CXXFLAGS
"
[ac_save_CXX
="$CXX
"
CXX
FLAGS="$CXXFLAGS
$switch"
CXX
="$CXX
$switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
[eval $cachevar=yes],
[eval $cachevar=yes],
[eval $cachevar=no])
[eval $cachevar=no])
CXX
FLAGS="$ac_save_CXXFLAGS
"])
CXX
="$ac_save_CXX
"])
if eval test x\$$cachevar = xyes; then
if eval test x\$$cachevar = xyes; then
CXX
FLAGS="$CXXFLAGS
$switch"
CXX
="$CXX
$switch"
ac_success=yes
ac_success=yes
break
break
fi
fi
...
@@ -100,14 +108,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
...
@@ -100,14 +108,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
$cachevar,
$cachevar,
[ac_save_CXX
FLAGS="$CXXFLAGS
"
[ac_save_CXX
="$CXX
"
CXX
FLAGS="$CXXFLAGS
$switch"
CXX
="$CXX
$switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
[eval $cachevar=yes],
[eval $cachevar=yes],
[eval $cachevar=no])
[eval $cachevar=no])
CXX
FLAGS="$ac_save_CXXFLAGS
"])
CXX
="$ac_save_CXX
"])
if eval test x\$$cachevar = xyes; then
if eval test x\$$cachevar = xyes; then
CXX
FLAGS="$CXXFLAGS
$switch"
CXX
="$CXX
$switch"
ac_success=yes
ac_success=yes
break
break
fi
fi
...
@@ -130,14 +138,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
...
@@ -130,14 +138,14 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
# Try with -stdlib=libc++
# Try with -stdlib=libc++
AC_CACHE_CHECK(whether $CXX supports C++11 library features with -stdlib=libc++,
AC_CACHE_CHECK(whether $CXX supports C++11 library features with -stdlib=libc++,
ax_cv_cxx_compile_cxx11_lib_libcxx,
ax_cv_cxx_compile_cxx11_lib_libcxx,
[ac_save_CXX
FLAGS="$CXXFLAGS
"
[ac_save_CXX
="$CXX
"
CXX
FLAGS="$CXXFLAGS
-stdlib=libc++"
CXX
="$CXX
-stdlib=libc++"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody_lib])],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody_lib])],
[eval ax_cv_cxx_compile_cxx11_lib_libcxx=yes],
[eval ax_cv_cxx_compile_cxx11_lib_libcxx=yes],
[eval ax_cv_cxx_compile_cxx11_lib_libcxx=no])
[eval ax_cv_cxx_compile_cxx11_lib_libcxx=no])
CXX
FLAGS="$ac_save_CXXFLAGS
"])
CXX
="$ac_save_CXX
"])
if eval test x$ax_cv_cxx_compile_cxx11_lib_libcxx = xyes; then
if eval test x$ax_cv_cxx_compile_cxx11_lib_libcxx = xyes; then
CXX
FLAGS="$CXXFLAGS
-stdlib=libc++"
CXX
="$CXX
-stdlib=libc++"
ac_success=yes
ac_success=yes
break
break
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment