pkgsrc-WIP-changes archive

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

posh: Use Debian code for getopt() only on GNU-based systems



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <michael.baeuerle%stz-e.de@localhost>
Pushed By:	micha
Date:		Tue Sep 25 09:54:17 2018 +0200
Changeset:	3056a30a52c6b150547aa964a3ee1ef0fe5ebcc7

Modified Files:
	posh/Makefile
	posh/TODO

Log Message:
posh: Use Debian code for getopt() only on GNU-based systems

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

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

diffstat:
 posh/Makefile | 10 +++++++++-
 posh/TODO     |  5 ++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diffs:
diff --git a/posh/Makefile b/posh/Makefile
index 641356919c..35a4f24837 100644
--- a/posh/Makefile
+++ b/posh/Makefile
@@ -19,9 +19,17 @@ PKG_SHELL=		bin/posh
 WRKSRC=			${WRKDIR}/posh
 INSTALLATION_DIRS=	share/doc/posh
 
-# Testsuite eats up all memory and never finish
 TEST_TARGET=	check
 
+.include "../../mk/bsd.prefs.mk"
+
+# On GNU based systems only: Use GNU getopt() as written by Debian
+# This Debian code leads to undefined behaviour with POSIX getopt()
+# On NetBSD e.g. "command -v ls" enters an infinite loop and eats up all memory
+.if ${OPSYS} == "Linux" || ${OPSYS} == "GNUkFreeBSD"
+CFLAGS+=	-DPKGSRC_GNU_GETOPT=1
+.endif
+
 pre-configure:
 	cd ${WRKSRC} && autoreconf
 
diff --git a/posh/TODO b/posh/TODO
index bd1f682532..e55c287110 100644
--- a/posh/TODO
+++ b/posh/TODO
@@ -1,2 +1,5 @@
-[ ] Provide PKGSRC_GNU_GETOPT for GNU systems
+[X] Removed patch for GCC 2, request a C99 compiler
+    => Other parts of the code are not C90 conformant too
+[X] Provide PKGSRC_GNU_GETOPT for GNU systems only
+    => This avoids undefined behaviour on systems with POSIX getopt()
 [ ] Analyze testsuite failures


Home | Main Index | Thread Index | Old Index