Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 2019 12:39:24 +0000 (UTC)
From:      Dmitri Goutnik <dmgk@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r517743 - head/Mk/Uses
Message-ID:  <201911161239.xAGCdP6j029779@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dmgk
Date: Sat Nov 16 12:39:24 2019
New Revision: 517743
URL: https://svnweb.freebsd.org/changeset/ports/517743

Log:
  Mk/Uses/go.mk: Omit symbol table and debug information by default
  
  PR:		233335
  Reported by:	yuri
  Reviewed by:	0mp, tobik
  Approved by:	araujo (mentor)
  Differential Revision:	https://reviews.freebsd.org/D21730

Modified:
  head/Mk/Uses/go.mk

Modified: head/Mk/Uses/go.mk
==============================================================================
--- head/Mk/Uses/go.mk	Sat Nov 16 12:39:11 2019	(r517742)
+++ head/Mk/Uses/go.mk	Sat Nov 16 12:39:24 2019	(r517743)
@@ -44,7 +44,7 @@
 #	command
 #
 # GO_BUILDFLAGS
-#	Additional build arguments to be passed to the `go install` command
+#	Additional build arguments to be passed to the `go build` command
 #
 # GO_PORT
 #	The Go port to use.  By default this is lang/go but can be set
@@ -62,6 +62,7 @@ IGNORE=	USES=go has invalid arguments: ${go_ARGS:Nmodu
 .endif
 
 # Settable variables
+
 .if empty(GO_PKGNAME)
 .  if !empty(GH_SUBDIR)
 GO_PKGNAME=	${GH_SUBDIR:S|^src/||}
@@ -72,18 +73,24 @@ GO_PKGNAME=	${PORTNAME}
 .  endif
 .endif
 GO_TARGET?=	${GO_PKGNAME}
+
 GO_BUILDFLAGS+=	-v -buildmode=exe
+.if !defined(WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*)
+GO_BUILDFLAGS+=	-ldflags=-s
+.endif
+
 CGO_ENABLED?=	1
 CGO_CFLAGS+=	-I${LOCALBASE}/include
 CGO_LDFLAGS+=	-L${LOCALBASE}/lib
+
 .if ${ARCH} == armv6 || ${ARCH} == armv7
 GOARM?=		${ARCH:C/armv//}
 .endif
 
 # Read-only variables
+
 GO_CMD=		${LOCALBASE}/bin/go
 GO_WRKDIR_BIN=	${WRKDIR}/bin
-
 GO_ENV+=	CGO_ENABLED=${CGO_ENABLED} \
 		CGO_CFLAGS="${CGO_CFLAGS}" \
 		CGO_LDFLAGS="${CGO_LDFLAGS}" \



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