aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/free-sa-devel/Makefile69
-rw-r--r--www/free-sa-devel/files/extra-patch-global-i386.mk13
-rw-r--r--www/free-sa-devel/files/extra-patch-global-native.mk14
-rw-r--r--www/free-sa-devel/files/patch-global.mk-nodebug11
4 files changed, 62 insertions, 45 deletions
diff --git a/www/free-sa-devel/Makefile b/www/free-sa-devel/Makefile
index 0a87b982cc40..344a816ee355 100644
--- a/www/free-sa-devel/Makefile
+++ b/www/free-sa-devel/Makefile
@@ -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 @@ CONFLICTS= free-sa-[0-9]*
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>
diff --git a/www/free-sa-devel/files/extra-patch-global-i386.mk b/www/free-sa-devel/files/extra-patch-global-i386.mk
deleted file mode 100644
index 02c30628fbe1..000000000000
--- a/www/free-sa-devel/files/extra-patch-global-i386.mk
+++ /dev/null
@@ -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
diff --git a/www/free-sa-devel/files/extra-patch-global-native.mk b/www/free-sa-devel/files/extra-patch-global-native.mk
deleted file mode 100644
index 9f04346156f7..000000000000
--- a/www/free-sa-devel/files/extra-patch-global-native.mk
+++ /dev/null
@@ -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
diff --git a/www/free-sa-devel/files/patch-global.mk-nodebug b/www/free-sa-devel/files/patch-global.mk-nodebug
deleted file mode 100644
index d6bca9b093e6..000000000000
--- a/www/free-sa-devel/files/patch-global.mk-nodebug
+++ /dev/null
@@ -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
-
- ##############################
- ##############################