Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 2017 21:05:24 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r435800 - in head/devel/ccache: . files
Message-ID:  <201703092105.v29L5Onh055619@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Mar  9 21:05:23 2017
New Revision: 435800
URL: https://svnweb.freebsd.org/changeset/ports/435800

Log:
  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.

Added:
  head/devel/ccache/files/extra-patch-memcached-Makefile.in   (contents, props changed)
  head/devel/ccache/files/extra-patch-memcached-configure.ac   (contents, props changed)
Modified:
  head/devel/ccache/Makefile

Modified: head/devel/ccache/Makefile
==============================================================================
--- head/devel/ccache/Makefile	Thu Mar  9 20:29:24 2017	(r435799)
+++ head/devel/ccache/Makefile	Thu Mar  9 21:05:23 2017	(r435800)
@@ -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 Me
 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

Added: head/devel/ccache/files/extra-patch-memcached-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ccache/files/extra-patch-memcached-Makefile.in	Thu Mar  9 21:05:23 2017	(r435800)
@@ -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

Added: head/devel/ccache/files/extra-patch-memcached-configure.ac
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ccache/files/extra-patch-memcached-configure.ac	Thu Mar  9 21:05:23 2017	(r435800)
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703092105.v29L5Onh055619>