diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2017-03-09 21:05:23 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2017-03-09 21:05:23 +0000 |
commit | d3f51cf2e6251727980c176deb6599efa7a0a520 (patch) | |
tree | 4ad74506afbaf6fd7feeba3b57eb7edf270b84ef | |
parent | 8206a384a5c61d44b7b4e52f25d5555efa7c12de (diff) | |
download | FreeBSD-ports-d3f51cf2e6251727980c176deb6599efa7a0a520.zip FreeBSD-ports-d3f51cf2e6251727980c176deb6599efa7a0a520.tar.gz |
ccache-memcached: Fix STATIC build.
Libmemcached is a C++ library, thus we need to use a C++ linker to link to it.
This is only really a problem when building a static binary since we need to
bring in various libc++ and libcxxrt symbols. The upstream ccache+memcached
patch had support for this with --enable-static but only via a hack for
GCC to force addding -lstdc++. The method in these patches works
for either compiler by using CXX to check for -lmemcached, and later using
CXX to link ccache.
-rw-r--r-- | devel/ccache/Makefile | 6 | ||||
-rw-r--r-- | devel/ccache/files/extra-patch-memcached-Makefile.in | 11 | ||||
-rw-r--r-- | devel/ccache/files/extra-patch-memcached-configure.ac | 31 |
3 files changed, 46 insertions, 2 deletions
diff --git a/devel/ccache/Makefile b/devel/ccache/Makefile index 015f4d1..2bb62d4a 100644 --- a/devel/ccache/Makefile +++ b/devel/ccache/Makefile @@ -3,7 +3,7 @@ PORTNAME= ccache PORTVERSION= 3.3.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= http://www.samba.org/ftp/ccache/ \ LOCAL/bdrewery @@ -34,7 +34,9 @@ MEMCACHED_DESC= Build in experimental Memcached support USES= compiler MEMCACHED_EXTRA_PATCHES= ${FILESDIR}/extra-patch-memcached:-p1 \ - ${FILESDIR}/extra-patch-memcached-ccache.c + ${FILESDIR}/extra-patch-memcached-ccache.c \ + ${FILESDIR}/extra-patch-memcached-configure.ac \ + ${FILESDIR}/extra-patch-memcached-Makefile.in MEMCACHED_CONFIGURE_ENABLE= memcached MEMCACHED_USES= autoreconf pkgconfig MEMCACHED_LIB_DEPENDS= libmemcached.so:databases/libmemcached diff --git a/devel/ccache/files/extra-patch-memcached-Makefile.in b/devel/ccache/files/extra-patch-memcached-Makefile.in new file mode 100644 index 0000000..2af101a --- /dev/null +++ b/devel/ccache/files/extra-patch-memcached-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig 2017-03-09 13:00:34.016595000 -0800 ++++ Makefile.in 2017-03-09 13:00:39.656086000 -0800 +@@ -74,7 +74,7 @@ files_to_distclean = Makefile config.h c + all: ccache$(EXEEXT) + + ccache$(EXEEXT): $(ccache_objs) $(extra_libs) +- $(CC) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS) ++ $(CXX) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS) + + .PHONY: install + install: all $(srcdir)/ccache.1 diff --git a/devel/ccache/files/extra-patch-memcached-configure.ac b/devel/ccache/files/extra-patch-memcached-configure.ac new file mode 100644 index 0000000..b71e2d8 --- /dev/null +++ b/devel/ccache/files/extra-patch-memcached-configure.ac @@ -0,0 +1,31 @@ +--- configure.ac.orig 2017-03-09 12:57:19.209816000 -0800 ++++ configure.ac 2017-03-09 13:00:24.478539000 -0800 +@@ -28,6 +28,10 @@ AC_PROG_CC_C99 + if test "$ac_cv_prog_cc_c99" = no; then + AC_MSG_ERROR(cannot find a C99-compatible compiler) + fi ++AC_PROG_CXX ++if test "$ac_cv_prog_cxx" = no; then ++ AC_MSG_ERROR(cannot find a C++-compatible compiler) ++fi + + AC_PROG_CPP + AC_PROG_INSTALL +@@ -97,6 +101,9 @@ AC_ARG_ENABLE(memcached, + [AS_HELP_STRING([--enable-memcached], + [enable memcached as a cache backend])]) + ++# Need to use C++ compiler for linking -lmemcached as static, rather than ++# hacking in GCC's -lstdc++, since we may be using Clang. ++AC_LANG(C++) + dnl enable-memcached: Check if -lmemcached is needed. + if test x${enable_memcached} != x; then + if test x${enable_static} != x; then +@@ -110,6 +117,7 @@ if test x${enable_memcached} != x; then + ]) + ccache_memcached='CCACHE_MEMCACHED=1 ' + fi ++AC_LANG(C) + + dnl Check for zlib + AC_ARG_WITH(bundled-zlib, |