I've written a small patch for ports-mgmt/psearch to make it compile it with lang/gcc46. GCC g++ 4.6 seems to require <cstring> and <cstdlib> headers to put the C functions in std namespace where other compilers put them to std namespace with both <string.h> and <cstring> (same for <stdlib.h>) headers.
I have tested the patch with g++46, the standard base g++ and clang++ on FreeBSD 9-STABLE and it seems to work on all of them.
Fix: See the attached patch.
Patch attached with submission follows:
How-To-Repeat: Install lang/gcc46 and compile ports-mgmt/psearch using it as the C++ compiler.
Maintainer of ports-mgmt/psearch,
Please note that PR ports/169078 has just been submitted.
If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.
The full text of the PR can be found at:
Edwin Groothuis via the GNATS Auto Assign Tool
Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
I've rolled the patch into the distfile. Please apply the diff below to
update the port. A commit message containing something like
"Update to make gcc 4.6 compatible, thanks to Kimmo Paasiala" would be
===== START OF DIFF =====
diff -ruN psearch.old/Makefile psearch/Makefile
--- psearch.old/Makefile 2008-06-04 05:25:35.000000000 +0200
+++ psearch/Makefile 2012-06-14 23:25:04.751696140 +0200
@@ -6,7 +6,7 @@
diff -ruN psearch.old/distinfo psearch/distinfo
--- psearch.old/distinfo 2011-03-18 18:58:51.000000000 +0100
+++ psearch/distinfo 2012-06-14 23:27:43.220690707 +0200
@@ -1,2 +1,2 @@
-SHA256 (psearch-2.0.1.tar.gz) =
-SIZE (psearch-2.0.1.tar.gz) = 6563
+SHA256 (psearch-2.0.2.tar.gz) =
+SIZE (psearch-2.0.2.tar.gz) = 6549
===== END OF DIFF =====
Thank you Benjamin, version 2.0.2 of the port fetches, patches, builds
and installs correctly now with g++46 (of course works as well). There
are some linewrap (the SHA256 lines) and indentation (leading spaces
missing) problems in your patch so it doesn't apply cleanly as it is
but it's so short that it's easy to apply manually.
I'll take it.