Date: Wed, 7 Oct 2009 08:57:42 GMT From: Alexander Moisseev <moiseev@mezonplus.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/139388: [maintainer-update] www/free-sa-devel: respect variables Message-ID: <200910070857.n978vg7Y039932@www.freebsd.org> Resent-Message-ID: <200910070900.n97909VT043856@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 139388 >Category: ports >Synopsis: [maintainer-update] www/free-sa-devel: respect variables >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Oct 07 09:00:09 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alexander Moisseev >Release: >Organization: >Environment: >Description: - Respect CFLAGS, СС, PREFIX and other variables - Add OPTIONS - Bump PORTREVISION >How-To-Repeat: >Fix: Patch attached with submission follows: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/www/free-sa-devel/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 27 Sep 2009 18:44:16 -0000 1.3 +++ Makefile 7 Oct 2009 08:12:11 -0000 @@ -7,6 +7,7 @@ PORTNAME= free-sa PORTVERSION= 2.0.0b2 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= SF MASTER_SITE_SUBDIR= free-sa/free-sa-dev/2.0.0b2%20_Big%20Change%20Edition_/ @@ -20,26 +21,80 @@ LATEST_LINK= free-sa-devel WWWDIR?= ${PREFIX}/www/data/${PORTNAME} -DOCSDIR= share/doc/free-sa-${DISTVERSION} +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${DISTVERSION} PORTDOCS= COPYING ChangeLog FAQ INSTALL README README.DEV THANKS MAN1= free-sa.1 MAN5= free-sa.conf.5 -.include <bsd.port.pre.mk> +MAKE_ARGS+= ETCDIR="${ETCDIR}" \ + WWWDIR="${WWWDIR}" \ + CACHEDIR="/var/cache/${PORTNAME}" \ + LOCDIR="${DATADIR}" \ + DOCDIR="${DOCSDIR}" \ + LOGFILE=/var/log/squid/access.log \ + CC="${CC}" \ + SORT=/usr/bin/sort \ + INSTALL=/usr/bin/install \ + LARGEFILE=yes \ + SATSEP="'" \ + ADDLDFLAGS="${LDFLAGS} --relax -mrelax" + +OPTIONS= OPTIMIZED_CFLAGS "Build with distribution-recommended CFLAGS" off \ + SA_DEBUG "Enable Free-SA debugging (level 1)" off + +.include <bsd.port.options.mk> + +pre-everything:: +.ifndef(WITH_OPTIMIZED_CFLAGS) + @${ECHO_MSG} ">>> This software is computationally demanding, and users are" + @${ECHO_MSG} ">>> advised to employ compiler optimizations when building it." + @${ECHO_MSG} ">>> Author of this software have used such flags as" + @${ECHO_MSG} ">>> 'CFLAGS= -O4 -pipe -march=native' and 'CC= gcc' to advantage." + @${ECHO_MSG} ">>> You can set them in make.conf, but they depends on your system and compiler." + @${ECHO_MSG} ">>> In addition, you can enable extra flags by defining WITH_OPTIMIZED_CFLAGS" + @${ECHO_MSG} ">>> For example, 'make WITH_OPTIMIZED_CFLAGS=yes'" + @${ECHO_MSG} ">>>" +.endif +.ifndef(WITH_SA_DEBUG) && (SA_DEBUG_LEVEL) + @${ECHO_MSG} ">>> You can enable Free-SA debugging (level 1) by defining WITH_SA_DEBUG" + @${ECHO_MSG} ">>> For example, 'make WITH_SA_DEBUG=yes'" + @${ECHO_MSG} ">>> Or for specific level (0-7) you can use SA_DEBUG_LEVEL" + @${ECHO_MSG} ">>> For example, 'make SA_DEBUG_LEVEL=4'" + @${ECHO_MSG} ">>> Note that SA_DEBUG_LEVEL overrides WITH_SA_DEBUG" + @${ECHO_MSG} ">>>" +.endif .if ${ARCH} == "sparc64" -BROKEN= Does not configure on sparc64 +TRYBROKEN= Does not configure on sparc64 +.endif + +.if defined(WITH_SA_DEBUG) +SA_DEBUG_LEVEL?= 1 +.else +SA_DEBUG_LEVEL?= 0 .endif .if defined(NOPORTDOCS) EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Makefile .endif -.if ${ARCH} == "i386" -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-global-i386.mk +post-patch: + @${REINPLACE_CMD} \ + -e 's,^DEBUG = .*,DEBUG = ${SA_DEBUG_LEVEL},' \ + -e 's,^include .(GMKPATH)/configs/.(OSTYPE)\.mk,,' \ + ${WRKSRC}/global.mk + +.if defined(WITH_OPTIMIZED_CFLAGS) +MAKE_ARGS+= ADDCFLAGS="${CFLAGS} \ + -fomit-frame-pointer \ + -std=c99 \ + -W -Wall -Wextra -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wreturn-type -Wswitch -Wshadow -Wcast-align -Wuninitialized \ + -Wchar-subscripts -Wuninitialized -Wbad-function-cast -Wwrite-strings" .else -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-global-native.mk +MAKE_ARGS+= ADDCFLAGS="${CFLAGS}" .endif -.include <bsd.port.post.mk> +.include <bsd.port.mk> Index: files/extra-patch-global-i386.mk =================================================================== RCS file: files/extra-patch-global-i386.mk diff -N files/extra-patch-global-i386.mk --- files/extra-patch-global-i386.mk 20 Sep 2009 01:36:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ ---- global.mk.old 2009-09-19 21:58:10.000000000 -0300 -+++ global.mk 2009-09-19 21:58:20.000000000 -0300 -@@ -1,8 +1,8 @@ - # Operating system profile --OSTYPE = generic-any-cc -+#OSTYPE = generic-any-cc - #OSTYPE = altlinux-i586-gcc4 - #OSTYPE = cygwin-native-gcc3 --#OSTYPE = freebsd-i386-gcc3 -+OSTYPE = freebsd-i386-gcc3 - #OSTYPE = freebsd-native-gcc4 - #OSTYPE = hpux-64_2.0W-cc - #OSTYPE = openbsd-i386-gcc3 Index: files/extra-patch-global-native.mk =================================================================== RCS file: files/extra-patch-global-native.mk diff -N files/extra-patch-global-native.mk --- files/extra-patch-global-native.mk 20 Sep 2009 01:36:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ ---- global.mk.orig 2009-03-23 01:39:59.000000000 +0300 -+++ global.mk 2009-04-04 14:24:39.000000000 +0400 -@@ -1,9 +1,9 @@ - # Operating system profile --OSTYPE = generic-any-cc -+#OSTYPE = generic-any-cc - #OSTYPE = altlinux-i586-gcc4 - #OSTYPE = cygwin-native-gcc3 - #OSTYPE = freebsd-i386-gcc3 --#OSTYPE = freebsd-native-gcc4 -+OSTYPE = freebsd-native-gcc4 - #OSTYPE = hpux-64_2.0W-cc - #OSTYPE = openbsd-i386-gcc3 - #OSTYPE = redhat-native-gcc4 Index: files/patch-global.mk-nodebug =================================================================== RCS file: files/patch-global.mk-nodebug diff -N files/patch-global.mk-nodebug --- files/patch-global.mk-nodebug 20 Sep 2009 01:36:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ ---- global.mk.orig 2009-07-27 16:24:04.000000000 +0400 -+++ global.mk 2009-07-27 16:24:15.000000000 +0400 -@@ -11,7 +11,7 @@ - #OSTYPE = solaris-native-cc - - # 0 - release, 1 - 7 debug level --DEBUG = 1 -+DEBUG = 0 - - ############################## - ############################## >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910070857.n978vg7Y039932>