pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

smake/star: Honor CPPFLAGS, CFLAGS and LDFLAGS



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <michael.baeuerle%stz-e.de@localhost>
Pushed By:	micha
Date:		Tue Oct 2 18:15:33 2018 +0200
Changeset:	34cf7a4a909bd153272c673613650c8bb3e83d97

Modified Files:
	smake/Makefile
	smake/Makefile.common
	smake/TODO
	star/Makefile
	star/TODO

Log Message:
smake/star: Honor CPPFLAGS, CFLAGS and LDFLAGS

This fixes the "missing RELRO" error.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=34cf7a4a909bd153272c673613650c8bb3e83d97

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 smake/Makefile        |  9 +++++----
 smake/Makefile.common | 12 ++++++------
 smake/TODO            |  1 +
 star/Makefile         |  9 ++++++---
 star/TODO             |  1 +
 5 files changed, 19 insertions(+), 13 deletions(-)

diffs:
diff --git a/smake/Makefile b/smake/Makefile
index 8234385ff8..35a5eb9f92 100644
--- a/smake/Makefile
+++ b/smake/Makefile
@@ -14,6 +14,9 @@ MAKE_JOBS_SAFE=	no
 MAKE_FLAGS+=	GMAKE_NOWARN=true
 
 USE_TOOLS+=	gmake
+MAKE_FLAGS+=	DESTDIR=${DESTDIR:Q} INS_BASE=${PREFIX:Q} DEFMANBASE=. MANDIR=${PKGMANDIR:Q}
+# Honor CPPFLAGS, CFLAGS and LDFLAGS
+MAKE_FLAGS+=	CPPOPTX=${CPPFLAGS:Q} COPTX=${CFLAGS:Q} LDOPTX=${LDFLAGS:Q}
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -21,7 +24,7 @@ USE_TOOLS+=	gmake
 .include "../../wip/smake/Makefile.common"
 
 SUBST_CLASSES+=		man
-SUBST_STAGE.man=	post-patch
+SUBST_STAGE.man=	pre-configure
 SUBST_FILES.man=	smake/smake.1
 SUBST_SED.man=		-e "s,/opt/schily/share/lib/smake/defaults.smk,${PREFIX}/share/lib/smake/defaults.smk,g"
 SUBST_MESSAGE.man=	Fix path for default rules in manpage.
@@ -35,8 +38,6 @@ do-build:
 
 # Documentation is in ${WRKSRC}/README.compile
 do-install:
-	cd ${WRKSRC}/smake && ${MAKE_PROGRAM} ${MAKE_FLAGS}		\
-		INS_BASE=${PREFIX} DEFMANBASE=. MANDIR=${PKGMANDIR}	\
-			DESTDIR=${DESTDIR} install
+	cd ${WRKSRC}/smake && ${MAKE_PROGRAM} ${MAKE_FLAGS} install
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/smake/Makefile.common b/smake/Makefile.common
index 31b770dc6f..165cb0d2e6 100644
--- a/smake/Makefile.common
+++ b/smake/Makefile.common
@@ -24,7 +24,7 @@ pre-configure:
 	printf "Create OS rules...\n"
 	cd ${WRKSRC}/RULES && . ${WRKSRC}/RULES/MKLINKS
 	printf "Create pkgsrc OS rules...\n"
-	cd ${WRKSRC}/RULES && unset r ;				\
+	cd ${WRKSRC}/RULES && unset r ;					\
 	for i in arm mipsel x86_64 sparc64 powerpc ;			\
 	do								\
 		r="$$r i386-netbsd-gcc.rul@$$i-netbsd-gcc.rul" ;	\
@@ -45,17 +45,17 @@ pre-configure:
 		existing=`printf "%s\\n" $$i | ${SED} -e 's/@.*//'` ;	\
 		target=`printf "%s\\n" $$i | ${SED} -e 's/.*@//'` ;	\
 		printf "%s " "$$target";				\
-		if ! ${TEST} -e "$$existing" ;				\
-		then							\
+		if ${TEST} -e "$$existing" ; then : ;			\
+		else							\
 			printf "(Link target %s not present)\n"		\
 				"$$existing";				\
 			continue ;					\
 		fi;							\
-		if ! ${TEST} -e "$$target" ;				\
+		if ${TEST} -e "$$target" ;				\
 		then							\
+			printf "(already present)\n" ;			\
+		else							\
 			${LN} -s "$$existing" "$$target" ;		\
 			printf "(created)\n" ;				\
-		else							\
-			printf "(already present)\n" ;			\
 		fi;							\
 	done
diff --git a/smake/TODO b/smake/TODO
index d85fc7c976..81f9fcd67d 100644
--- a/smake/TODO
+++ b/smake/TODO
@@ -7,6 +7,7 @@
 [X] Test with clang compiler
 [X] Add smake as tool for use with USE_TOOLS
     => Idea rejected, use it via TOOL_DEPENDS.
+[X] Honor CPPFLAGS, CFLAGS and LDFLAGS
 
 [ ] Test with Intel compiler
 [ ] Test commercial UNIX compilers
diff --git a/star/Makefile b/star/Makefile
index 699200612b..2eb4b6b6d7 100644
--- a/star/Makefile
+++ b/star/Makefile
@@ -16,7 +16,9 @@ MAKE_JOBS_SAFE=	no
 USE_TOOLS+=	tbl
 TOOL_DEPENDS+=	smake-[0-9]*:../../wip/smake
 SMAKE=		MAKEFLAGS= smake
-MAKE_FLAGS+=	DESTDIR=${DESTDIR} INS_BASE=${PREFIX} DEFMANBASE=. MANDIR=${PKGMANDIR}
+MAKE_FLAGS+=	DESTDIR=${DESTDIR:Q} INS_BASE=${PREFIX:Q} DEFMANBASE=. MANDIR=${PKGMANDIR:Q}
+# Honor CPPFLAGS, CFLAGS and LDFLAGS
+MAKE_FLAGS+=	CPPOPTX=${CPPFLAGS:Q} COPTX=${CFLAGS:Q} LDOPTX=${LDFLAGS:Q}
 
 # The default location is /etc/default/star
 # We patch the documentation appropriately. Additionally, we also provide a
@@ -33,7 +35,7 @@ CONF_FILES=	${PREFIX}/share/examples/star/star ${STAR_CONF}
 AUTO_MKDIRS=	yes
 
 SUBST_CLASSES+=		fix
-SUBST_STAGE.fix=	post-patch
+SUBST_STAGE.fix=	pre-configure
 SUBST_FILES.fix+=	star/star.1
 SUBST_FILES.fix+=	star/star.dfl
 SUBST_FILES.fix+=	star/defaults.c
@@ -58,7 +60,8 @@ do-build:
 
 # Process tables in manpage
 post-build:
-	cd ${WRKSRC} && if ! ${TEST} -f star/pkgsrc_tbl.done; then	\
+	cd ${WRKSRC} && if ${TEST} -f star/pkgsrc_tbl.done; then :;	\
+	else								\
 		${TBL} star/spax.1 >star/spax.1.tmp &&			\
 		${MV} -f star/spax.1.tmp star/spax.1 &&			\
 		${TBL} star/star.4 >star/star.4.tmp &&			\
diff --git a/star/TODO b/star/TODO
index 919d8355aa..6c1e672ab2 100644
--- a/star/TODO
+++ b/star/TODO
@@ -1,3 +1,4 @@
 [X] Compilation works
 [X] Installation rule and PLIST
 [X] Use defaults file from ${PKG_SYSCONFDIR} and modify documentation
+[X] Honor CPPFLAGS, CFLAGS and LDFLAGS


Home | Main Index | Thread Index | Old Index