exp-run: Make ports use the libc provided iconv instead of libiconv from ports

Guido Falsi madpilot at FreeBSD.org
Sat Aug 31 00:44:33 UTC 2013


>Submitter-Id:	current-users
>Originator:	Guido Falsi
>Organization:	none
>Confidential:	no
>Synopsis:	exp-run: Make ports use the libc provided iconv instead of libiconv from ports
>Severity:	non-critical
>Priority:	low
>Category:	ports
>Class:		change-request
>Release:	FreeBSD 9.1-STABLE amd64
>Environment:
System: FreeBSD micro.madpilot.net 9.1-STABLE FreeBSD 9.1-STABLE #21 r252026: Thu Jun 20 16:27:06 CEST 2013 root at micro.madpilot.net:/usr/obj/usr/src/sys/MICRO amd64

>Description:

Since libciconv support has been enabled by default Ive started
seeing various failures in my poudriere builds due to libiconv
symbols. This is mainly due to many ports forcing software to link
to libiconv.

My idea is it would be better to have ports use the system provided
iconv instead of libiconv, so i made a patch to try to achieve this.

I started from the suggestion from Peter Wemm here:

http://lists.freebsd.org/pipermail/freebsd-ports/2013-August/085469.html

and tried to fix as many ports as possible.

The good news is that most software would happily use the system
provided iconv library, and it was our port Makefiles forcing them
to depend in libiconv. Unluckily to keep ports working on older
releases I had to put horrible conditionals around.

I also patched the virtualbox-ose and openjdk ports, but used a
brute force sed approach. I think people maintaining those ports
will want to look at the fix and perhaps implement a better one. I
was unable to do much better because those ports have quite complicated
build systems.

I think this is the correct way to tackle this problem, and, from
the experiments I made, seems quite doable.

I dont have the horsepower for a full exp-run, I'd like to test the
attached patch in an exp-run with all the ports which depend on
iconv. Im not sure if this is enough though, since some of these
ports can have depending ports which could also break.

Obviously in the patch I also fixed LIB_DEPENDS format, USES and
other small things I saw in the ports I touched.

>Fix:

Index: Mk/Uses/iconv.mk
===================================================================
--- Mk/Uses/iconv.mk	(revision 325747)
+++ Mk/Uses/iconv.mk	(working copy)
@@ -16,6 +16,8 @@
 IGNORE=	USES=iconv does not require args
 .endif
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LIB_DEPENDS+=	libiconv.so.3:${PORTSDIR}/converters/libiconv
+.endif
 
 .endif
Index: archivers/rpm/Makefile
===================================================================
--- archivers/rpm/Makefile	(revision 325747)
+++ archivers/rpm/Makefile	(working copy)
@@ -12,7 +12,7 @@
 MAINTAINER=	sylvio at FreeBSD.org
 COMMENT=	The Red Hat Package Manager
 
-LIB_DEPENDS=	popt.0:${PORTSDIR}/devel/popt
+LIB_DEPENDS=	libpopt.so:${PORTSDIR}/devel/popt
 
 CONFLICTS=	rpm-[45].*
 
@@ -28,8 +28,12 @@
 USES+=		gettext
 PLIST_SUB+=	NLS=""
 CPPFLAGS+=	-I${LOCALBASE}/include
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -lintl -liconv"
 .else
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -lintl"
+.endif
+.else
 CONFIGURE_ARGS+=	--disable-nls
 PLIST_SUB+=	NLS="@comment "
 .endif
Index: archivers/unrar/Makefile
===================================================================
--- archivers/unrar/Makefile	(revision 325747)
+++ archivers/unrar/Makefile	(working copy)
@@ -31,6 +31,10 @@
 
 .include <bsd.port.options.mk>
 
+.if ${USES:Miconv} && !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=-liconv
+.endif
+
 .if ${PORT_OPTIONS:MOPENSSL_AES}
 CPPFLAGS+=	-DOPENSSL_AES -I${OPENSSLINC}
 LDFLAGS+=	-L${OPENSSLLIB} -lcrypto
Index: archivers/unrar-iconv/Makefile
===================================================================
--- archivers/unrar-iconv/Makefile	(revision 325747)
+++ archivers/unrar-iconv/Makefile	(working copy)
@@ -14,7 +14,6 @@
 EXTRA_PATCHES=	${.CURDIR}/files/patch-iconv
 
 CPPFLAGS+=	-DWITH_ICONV -I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 USES+=		iconv
 
 CONFLICTS=	unrar-[0-9]* zh-unrar-[0-9]*
Index: archivers/unzip/Makefile
===================================================================
--- archivers/unzip/Makefile	(revision 325747)
+++ archivers/unzip/Makefile	(working copy)
@@ -48,8 +48,10 @@
 PATCH_DIST_STRIP+=	-p1
 USES=			iconv
 CFLAGS+=		-I${LOCALBASE}/include -DNATIVE
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 MAKE_ARGS+=		LFLAGS1="-L${LOCALBASE}/lib -liconv"
 .endif
+.endif
 
 MAKE_ENV=	LOCAL_UNZIP="${LOCAL_UNZIP}" \
 		D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2
Index: audio/julius/Makefile
===================================================================
--- audio/julius/Makefile	(revision 325747)
+++ audio/julius/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:   julius
-# Date created:        28 May 2009
-# Whom:                numisemis at yahoo dot com
-#
+# Created by: numisemis at yahoo dot com
 # $FreeBSD$
-#
 
 PORTNAME=	julius
 PORTVERSION=	4.1.2
@@ -21,8 +17,6 @@
 GNU_CONFIGURE=	yes
 USES=		iconv
 
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 MANLANG=	"" ja
 MAN1=	accept_check.1 \
 	adinrec.1 \
@@ -43,6 +37,13 @@
 	mkss.1 \
 	nextword.1
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 post-configure:
 	@${FIND} ${WRKSRC} -type f -name Makefile | ${XARGS} ${REINPLACE_CMD} -E -e "s|INSTALL=(\.\./)+|INSTALL=install -o root -g wheel|"
 	@${FIND} ${WRKSRC} -type f -name Makefile | ${XARGS} ${REINPLACE_CMD} -E -e "s|install  -s|install|"
@@ -65,4 +66,4 @@
 	@${STRIP_CMD} ${PREFIX}/bin/mkss
 	@${STRIP_CMD} ${PREFIX}/bin/nextword
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: audio/mp3unicode/Makefile
===================================================================
--- audio/mp3unicode/Makefile	(revision 325747)
+++ audio/mp3unicode/Makefile	(working copy)
@@ -9,13 +9,11 @@
 MAINTAINER=	makc at FreeBSD.org
 COMMENT=	ID3 tags charset converter
 
-LIB_DEPENDS=	tag.1:${PORTSDIR}/audio/taglib
+LIB_DEPENDS=	libtag.so:${PORTSDIR}/audio/taglib
 
 USE_BZIP2=	yes
 USES=		iconv pkgconfig
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	ICONV_CFLAGS="-I${LOCALBASE}/include" \
-		ICONV_LIBS="-L${LOCALBASE}/lib -liconv"
 
 MAN1=		mp3unicode.1
 PLIST_FILES=	bin/mp3unicode
@@ -25,6 +23,11 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV=	ICONV_CFLAGS="-I${LOCALBASE}/include" \
+		ICONV_LIBS="-L${LOCALBASE}/lib -liconv"
+.endif
+
 pre-configure:
 .if !${PORT_OPTIONS:MDOCS}
 	${REINPLACE_CMD} -e '/^install-data-am/s|install-dist_docDATA||' ${WRKSRC}/Makefile.in
Index: audio/mpc/Makefile
===================================================================
--- audio/mpc/Makefile	(revision 325747)
+++ audio/mpc/Makefile	(working copy)
@@ -11,7 +11,7 @@
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	mpdclient:${PORTSDIR}/audio/libmpdclient
+LIB_DEPENDS=	libmpdclient.so:${PORTSDIR}/audio/libmpdclient
 
 OPTIONS_DEFINE=	EXAMPLES DOCS ICONV
 OPTIONS_DEFAULT=	ICONV
@@ -38,7 +38,11 @@
 .endif
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's|-lintl|-liconv|g' ${WRKSRC}/configure
+.else
+	@${REINPLACE_CMD} -e 's|-lintl||g' ${WRKSRC}/configure
+.endif
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/${PORTNAME} ${PREFIX}/bin
Index: audio/mpiosh/Makefile
===================================================================
--- audio/mpiosh/Makefile	(revision 325747)
+++ audio/mpiosh/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	mpio-driver
-# Date created:				19 Jun 2003
-# Whom:					Sergey Akifyev <asa at gascom.ru>
-#
+# Created by: Sergey Akifyev <asa at gascom.ru>
 # $FreeBSD$
-#
 
 PORTNAME=	mpiosh
 PORTVERSION=	0.7.1.p2
@@ -22,11 +18,14 @@
 USE_AUTOTOOLS=	aclocal automake autoconf libtool
 ACLOCAL_ARGS=	-I . -I ${LOCALBASE}/share/aclocal
 AUTOMAKE_ARGS=	--add-missing
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
 
-.include <bsd.port.pre.mk>
-
 EXTRA_PATCHES=	${FILESDIR}/extra-patch-configure.in
 
 post-patch:
Index: audio/osd-lyrics/Makefile
===================================================================
--- audio/osd-lyrics/Makefile	(revision 325747)
+++ audio/osd-lyrics/Makefile	(working copy)
@@ -13,9 +13,9 @@
 
 LICENSE=	GPLv3
 
-LIB_DEPENDS=	notify:${PORTSDIR}/devel/libnotify \
-		dbus-glib-1:${PORTSDIR}/devel/dbus-glib \
-		curl:${PORTSDIR}/ftp/curl
+LIB_DEPENDS=	libnotify.so:${PORTSDIR}/devel/libnotify \
+		libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \
+		libcurl.so:${PORTSDIR}/ftp/curl
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	DATADIRNAME=share
@@ -27,7 +27,6 @@
 USE_SQLITE=	yes
 INSTALLS_ICONS=	yes
 PORTDOCS=	AUTHORS ChangeLog NEWS README
-LDFLAGS=	-liconv
 
 OPTIONS_DEFINE=	DOCS MPD XMMS2 AMAROK
 MPD_DESC=	Enable MPD support
@@ -42,6 +41,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 post-install:
 .if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
Index: chinese/oto/Makefile
===================================================================
--- chinese/oto/Makefile	(revision 325747)
+++ chinese/oto/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:    zh-oto
-# Date created:		8 March 2003
-# Whom:			Shen Chuan-Hsing <statue at freebsd.sinica.edu.tw>
-#
+# Created by: Shen Chuan-Hsing <statue at freebsd.sinica.edu.tw>
 # $FreeBSD$
-#
 
 PORTNAME=	oto
 PORTVERSION=	0.5
@@ -13,14 +9,18 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Show you font info and add new 'name' and 'cmap' tables
 
-USES=		iconv
+USES=		gmake iconv
 GNU_CONFIGURE=	YES
-USE_GMAKE=	YES
 CPPFLAGS+=	-I${LOCALBASE}/include
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv"
+.endif
 
 post-patch:
 	@${FIND} ${WRKSRC}/src/ -type f -print0 | \
 	    ${XARGS} -0 ${REINPLACE_CMD} -e 's,stdint.h,inttypes.h,'
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: chinese/oxim/Makefile
===================================================================
--- chinese/oxim/Makefile	(revision 325747)
+++ chinese/oxim/Makefile	(working copy)
@@ -26,7 +26,7 @@
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ARGS+=--disable-bimsphone-module \
 		--disable-static \
 		--with-conf-dir=${PREFIX}/etc/${PORTNAME} \
@@ -38,6 +38,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${PORT_OPTIONS:MGTK2}
 USE_GNOME+=	gtk20
 CONFIGURE_ARGS+=	--enable-gtk-immodule
Index: comms/anyremote/Makefile
===================================================================
--- comms/anyremote/Makefile	(revision 325747)
+++ comms/anyremote/Makefile	(working copy)
@@ -13,8 +13,6 @@
 
 USE_GNOME=	glib20
 GNU_CONFIGURE=	yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 
 OPTIONS_DEFINE=	DOCS DBUS X11
 OPTIONS_DEFAULT=	DBUS X11
@@ -21,6 +19,11 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 .if ! ${PORT_OPTIONS:MDBUS}
 CONFIGURE_ARGS+=--disable-dbus
 .else
Index: comms/minicom/Makefile
===================================================================
--- comms/minicom/Makefile	(revision 325747)
+++ comms/minicom/Makefile	(working copy)
@@ -24,12 +24,17 @@
 			--sysconfdir=${PREFIX}/etc/minicom \
 			--enable-lock-dir=/var/spool/lock \
 			--enable-dfl-port=/dev/cuau0
-MAKE_ARGS+=	LIBS+="-liconv -lcurses"
 
 MAN1=		minicom.1 runscript.1 ascii-xfr.1 xminicom.1
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+MAKE_ARGS+=	LIBS+="-liconv -lcurses"
+.else
+MAKE_ARGS+=	LIBS+="-lcurses"
+.endif
+
 .if ${PORT_OPTIONS:MLRZSZ}
 RUN_DEPENDS+=	lrz:${PORTSDIR}/comms/lrzsz
 .endif
Index: comms/obexapp/Makefile
===================================================================
--- comms/obexapp/Makefile	(revision 325747)
+++ comms/obexapp/Makefile	(working copy)
@@ -9,8 +9,8 @@
 MAINTAINER=	madpilot at FreeBSD.org
 COMMENT=	Obex application to transfer objects to mobile equipment
 
-LIB_DEPENDS=	openobex:${PORTSDIR}/comms/openobex \
-		expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	libopenobex.so:${PORTSDIR}/comms/openobex \
+		libexpat.so:${PORTSDIR}/textproc/expat2
 
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
@@ -26,4 +26,11 @@
 
 MAKE_ENV+=	NO_WERROR=yes
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+post-patch:
+.if exists(/usr/include/iconv.h) && ${OSVERSION} >= 1000043
+	@${REINPLACE_CMD} -e 's/ -liconv//' ${WRKSRC}/Makefile
+.endif
+
+.include <bsd.port.post.mk>
Index: converters/p5-Text-Iconv/Makefile
===================================================================
--- converters/p5-Text-Iconv/Makefile	(revision 325747)
+++ converters/p5-Text-Iconv/Makefile	(working copy)
@@ -12,9 +12,14 @@
 
 USES=		perl5 iconv
 USE_PERL5=	configure
+
+MAN3=		Text::Iconv.3
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ARGS+=	INC="-I${LOCALBASE}/include" \
 		LIBS="-L${LOCALBASE}/lib -liconv"
+.endif
 
-MAN3=		Text::Iconv.3
-
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: databases/postgis/Makefile
===================================================================
--- databases/postgis/Makefile	(revision 325747)
+++ databases/postgis/Makefile	(working copy)
@@ -11,8 +11,8 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Adds support for geographic objects to PostgreSQL databases
 
-LIB_DEPENDS=	proj:${PORTSDIR}/graphics/proj \
-		geos:${PORTSDIR}/graphics/geos
+LIB_DEPENDS=	libproj.so:${PORTSDIR}/graphics/proj \
+		libgeos.so:${PORTSDIR}/graphics/geos
 RUN_DEPENDS=	postmaster:${PORTSDIR}/databases/postgresql${PGSQL_VER}-server
 
 CONFLICTS=	postgis-2.*
@@ -58,8 +58,13 @@
 .endif
 
 post-extract:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's#@ICONV_LDFLAGS@#-liconv -L${LOCALBASE}/lib#g' \
 		${WRKSRC}/loader/Makefile.in
+.else
+	@${REINPLACE_CMD} -e 's#@ICONV_LDFLAGS@##g' \
+		${WRKSRC}/loader/Makefile.in
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's#%PERL%#${PERL}#g' \
Index: databases/qdbm/Makefile
===================================================================
--- databases/qdbm/Makefile	(revision 325747)
+++ databases/qdbm/Makefile	(working copy)
@@ -1,7 +1,4 @@
-# New ports collection makefile for:	QDBM
-# Date created:				18 October 2003
-# Whom:					Kimura Fuyuki <fuyuki at nigredo.org>
-#
+# Created by: Kimura Fuyuki <fuyuki at nigredo.org>
 # $FreeBSD$
 #    $MCom: ports-stable/databases/qdbm/Makefile,v 1.6 2008/03/29 20:07:25 ahze Exp $
 
@@ -26,9 +23,8 @@
 LDFLAGS+=	${PTHREAD_LIBS} -L${LOCALBASE}/lib
 MAKE_ARGS=	RELCFLAGS="${CFLAGS}" \
 		MYDATADIR="${DOCSDIR}" MYDOCS="${PORTDOCS}"
-.if !defined(NOPORTDOCS)
+
 PORTDOCS=	ChangeLog NEWS
-.endif
 
 MAN1=	cbcodec.1 cbtest.1 crmgr.1 crtest.1 crtsv.1 dpmgr.1 dptest.1 \
 	dptsv.1 hvmgr.1 hvtest.1 odidx.1 odmgr.1 odtest.1 qmttest.1 \
@@ -44,8 +40,13 @@
 		${WRKSRC}/Makefile.in
 
 post-build:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	cd ${WRKSRC}/lab; \
 	${MAKE} CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -liconv" fmtcnv031127
+.else
+	cd ${WRKSRC}/lab; \
+	${MAKE} CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" fmtcnv031127
+.endif
 
 post-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/lab/fmtcnv031127 ${PREFIX}/bin
Index: databases/spatialite_gui/Makefile
===================================================================
--- databases/spatialite_gui/Makefile	(revision 325747)
+++ databases/spatialite_gui/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	spatialite-gui
-# Date created:		2012-06-14
-# Whom:			lbartoletti <coder at tuxfamily.org>
-#
+# Created by: lbartoletti <coder at tuxfamily.org>
 # $FreeBSD$
-#
 
 PORTNAME=	spatialite_gui
 PORTVERSION=	1.5.0
@@ -14,20 +10,26 @@
 MAINTAINER=	coder at tuxfamily.org
 COMMENT=	Graphical User Interface (GUI) tool supporting SpatiaLite
 
-LIB_DEPENDS=	gaiagraphics:${PORTSDIR}/graphics/libgaiagraphics \
-		freexl:${PORTSDIR}/textproc/freexl \
-		spatialite:${PORTSDIR}/databases/spatialite
+LIB_DEPENDS=	libgaiagraphics.so:${PORTSDIR}/graphics/libgaiagraphics \
+		libfreexl.so:${PORTSDIR}/textproc/freexl \
+		libspatialite.so:${PORTSDIR}/databases/spatialite
 
 USE_WX=		2.8
 WANT_UNICODE=	yes
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		pkgconfig iconv
+USES=		gmake pkgconfig iconv
 CPPFLAGS+=	-I${LOCALBASE}/include `${WX_CONFIG} --cppflags`
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv `${WX_CONFIG} --libs`
 CONFIGURE_ARGS+=CFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
 USE_LDCONFIG=	yes
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv `${WX_CONFIG} --libs`
+.else
+LDFLAGS+=	-L${LOCALBASE}/lib `${WX_CONFIG} --libs`
+.endif
+
 PLIST_FILES=	bin/spatialite_gui
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: deskutils/adesklets/Makefile
===================================================================
--- deskutils/adesklets/Makefile	(revision 325747)
+++ deskutils/adesklets/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	adesklets
-# Date created:		2005-05-25
-# Whom:			Roman Bogorodskiy <novel at FreeBSD.org>
-#
+# Created by: Roman Bogorodskiy <novel at FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	adesklets
 PORTVERSION=	0.6.1
@@ -18,11 +14,9 @@
 
 GNU_CONFIGURE=	yes
 USE_PYTHON=	yes
-USE_GMAKE=	yes
 USE_BZIP2=	yes
 USE_EFL=	imlib2
-USES=		iconv
-WANT_PERL=	yes
+USES=		gmake iconv
 
 MAN1=		adesklets.1 \
 		adesklets_checkin.1 \
@@ -33,7 +27,6 @@
 
 SUB_FILES=	pkg-message
 INSTALLS_EGGINFO=	yes
-LDFLAGS+=	-liconv
 
 .if !defined(WITHOUT_PERL)
 USE_PERL5=	yes
@@ -47,6 +40,12 @@
 CONFIGURE_ARGS+=	--without-history
 .endif
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 pre-everything::
 	@${ECHO_MSG} "You may specify the following on the command line:"
 	@${ECHO_MSG} ""
@@ -60,4 +59,4 @@
 post-install:
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: deskutils/fbreader/Makefile
===================================================================
--- deskutils/fbreader/Makefile	(revision 325747)
+++ deskutils/fbreader/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	fbreader
-# Date created:		29 March 2007
-# Whom:			Andrew Pantyukhin <infofarmer at FreeBSD.org>
-#
+# Created by: Andrew Pantyukhin <infofarmer at FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	fbreader
 PORTVERSION=	0.12.10
@@ -17,27 +13,17 @@
 MAINTAINER=	fluffy at FreeBSD.org
 COMMENT=	Powerful e-book reader
 
-LIB_DEPENDS=	curl:${PORTSDIR}/ftp/curl \
-		expat.6:${PORTSDIR}/textproc/expat2 \
-		fribidi.3:${PORTSDIR}/converters/fribidi \
-		linebreak.2:${PORTSDIR}/textproc/liblinebreak
+LIB_DEPENDS=	libcurl.so:${PORTSDIR}/ftp/curl \
+		libexpat.so:${PORTSDIR}/textproc/expat2 \
+		libfribidi.so:${PORTSDIR}/converters/fribidi \
+		liblinebreak.so:${PORTSDIR}/textproc/liblinebreak
 
-.if defined(WITH_GTK2)
-UI=		gtk
-USE_GNOME=	gtk20
-.else
-UI=		qt4
-USE_QT4=	gui corelib imageformats network moc_build
-LDFLAGS+=	-L${QT_LIBDIR}
-.endif
+OPTIONS_DEFINE=	DEBUG
+OPTIONS_SINGLE=	TKIT
+OPTIONS_SINGLE_TKIT=	GTK2 QT4
+OPTIONS_DEFAULT=	QT4
 
-.if defined(WITH_DEBUG)
-STATUS=		debug
-.else
-STATUS=		release
-.endif
-
-USE_GMAKE=	yes
+USES=		gmake
 USE_SQLITE=	yes
 USE_LDCONFIG=	yes
 
@@ -52,12 +38,36 @@
 		LD="${CXX}"
 MAKE_ARGS+=	MAKE=${GMAKE} LIBDIR=${PREFIX}/lib
 
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MGTK2}
+UI=		gtk
+USE_GNOME=	gtk20
+.endif
+
+.if ${PORT_OPTIONS:MQT4}
+UI=		qt4
+USE_QT4=	gui corelib imageformats network moc_build
+LDFLAGS+=	-L${QT_LIBDIR}
+.endif
+
+.if ${PORT_OPTIONS:MDEBUG}
+STATUS=		debug
+.else
+STATUS=		release
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e '/^CFLAGS/s,-pipe.*$$,${CFLAGS} -DDO_ICONV_CAST -DLIBICONV_PLUG,' \
 		-e '/^CC/d;/^LD/d;/QTINCLUDE/s,-I.*$$,-I${QT_INCDIR},;s,libpng ,libpng15 ,' \
 		${WRKSRC}/makefiles/arch/desktop.mk
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's,-O3,,;s,-ldl,-liconv,' \
 		${WRKSRC}/makefiles/config.mk ${WRKSRC}/zlibrary/core/Makefile
+.else
+	@${REINPLACE_CMD} -e 's,-O3,,;s,-ldl,-liconv,' \
+		${WRKSRC}/makefiles/config.mk ${WRKSRC}/zlibrary/core/Makefile
+.endif
 	@${REINPLACE_CMD} -e 's,/usr,${PREFIX},' ${WRKSRC}/fbreader/desktop/Makefile
 	@${FIND} ${WRKSRC} -name Makefile | ${XARGS} ${REINPLACE_CMD} \
 		-e 's,make ,gmake ,'
Index: devel/doxygen/Makefile
===================================================================
--- devel/doxygen/Makefile	(revision 325747)
+++ devel/doxygen/Makefile	(working copy)
@@ -16,13 +16,11 @@
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	tmake:${PORTSDIR}/devel/tmake
-LIB_DEPENDS=	png15:${PORTSDIR}/graphics/png
+LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png
 
-USES=		bison iconv
+USES=		bison gmake iconv perl5
 ALL_TARGET=	all
-USE_PERL5=	yes
 HAS_CONFIGURE=	yes
-USE_GMAKE=	yes
 QT_NONSTANDARD=	yes	# non-standard configure arguments
 CONFIGURE_ARGS=	--prefix ${PREFIX} --perl ${PERL} --make ${GMAKE} \
 		--install "${INSTALL}"
@@ -76,8 +74,10 @@
 .endif # QT4
 
 pre-configure:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@cd ${WRKSRC};for pro in src/*.pro.in addon/doxywizard/doxywizard.pro.in;do \
 		${ECHO} "unix:LIBS += -liconv" >> $$pro; done
+.endif
 	@${CHMOD} +x ${WRKSRC}/configure
 
 post-configure:
Index: devel/gdb66/Makefile
===================================================================
--- devel/gdb66/Makefile	(revision 325747)
+++ devel/gdb66/Makefile	(working copy)
@@ -21,8 +21,7 @@
 CONFLICTS?=	gdb-[7-9]*
 USE_BZIP2=	yes
 USE_GCC=	any
-USE_GMAKE=	yes
-USES=		gettext iconv
+USES=		gettext gmake iconv
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV+=	CONFIGURED_M4=m4 CONFIGURED_BISON=byacc
 CONFIGURE_ARGS=	--program-suffix=${PORTVERSION:S/.//g} \
@@ -85,10 +84,17 @@
 post-patch:
 	@${REINPLACE_CMD} -e 's/$$/ [GDB v${PORTVERSION} for FreeBSD]/' \
 		${WRKSRC}/gdb/version.in
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's/^READLINE/#READLINE/' \
 		-e 's/^readline/#readline/' \
 		-e 's,^LIBICONV =.*,LIBICONV=-L${LOCALBASE}/lib -liconv,' \
 		${WRKSRC}/gdb/Makefile.in
+.else
+	@${REINPLACE_CMD} -e 's/^READLINE/#READLINE/' \
+		-e 's/^readline/#readline/' \
+		-e 's,^LIBICONV =.*,LIBICONV=,' \
+		${WRKSRC}/gdb/Makefile.in
+.endif
 	${ECHO} 'READLINE = -lreadline' >> ${WRKSRC}/gdb/Makefile.in
 
 do-install:
Index: devel/glib20/Makefile
===================================================================
--- devel/glib20/Makefile	(revision 325747)
+++ devel/glib20/Makefile	(working copy)
@@ -25,11 +25,10 @@
 
 USE_AUTOTOOLS=	libtool
 USE_LDCONFIG=	yes
-USES=		gettext gmake iconv pathfix pkgconfig shebangfix
+USES=		gettext gmake iconv pathfix pkgconfig shebangfix perl5
 USE_GNOME=	ltverhack
 USE_PYTHON=	2.5+
-USE_PERL5=	yes
-CONFIGURE_ARGS=	--enable-static --with-libiconv=gnu \
+CONFIGURE_ARGS=	--enable-static \
 		--disable-gtk-doc --with-html-dir=${PREFIX}/share/doc \
 		--disable-man --without-xml-catalog \
 		--with-pcre=system \
@@ -54,6 +53,12 @@
 #CONFIGURE_ARGS+=--enable-dtrace
 #.endif
 
+.if exists(/usr/include/iconv.h) && ${OSVERSION} >= 1000043 
+CONFIGURE_ARGS+=	--with-libiconv=native
+.else
+CONFIGURE_ARGS+=	--with-libiconv=gnu
+.endif
+
 .if ${ARCH} == powerpc64
 EXTRA_PATCHES=	${FILESDIR}/extra-arch-powerpc64
 .endif
Index: devel/glib20/files/patch-ae
===================================================================
--- devel/glib20/files/patch-ae	(revision 325747)
+++ devel/glib20/files/patch-ae	(working copy)
@@ -1,43 +0,0 @@
---- configure.orig	2013-03-28 02:59:16.000000000 +0000
-+++ configure	2013-03-28 03:00:20.000000000 +0000
-@@ -603,6 +603,9 @@
- #ifdef HAVE_SYS_TYPES_H
- # include <sys/types.h>
- #endif
-+#ifdef HAVE_SYS_PARAM_H
-+# include <sys/param.h>
-+#endif
- #ifdef HAVE_SYS_STAT_H
- # include <sys/stat.h>
- #endif
-@@ -5699,7 +5702,7 @@
- fi
- 
- GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
--ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
-+ABS_GLIB_RUNTIME_LIBDIR="`readlink $libdir/$with_runtime_libdir`"
- 
- 
-  if test "x$with_runtime_libdir" != "x"; then
-@@ -23089,7 +23092,7 @@
- fi
- done
- 
--for ac_func in chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid
-+for ac_func in chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid sysctlbyname
- do :
-   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
- ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-@@ -26629,10 +26632,10 @@
- #  b) FreeBSD doesn't do this either.
- #
- case $host in
--  *-*-freebsd*|*-*-linux*)
-+  *-*-linux*)
-     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
-     ;;
--  *-*-openbsd*)
-+  *-*-openbsd*|*-*-freebsd*)
-     LDFLAGS="$LDFLAGS -pthread"
-     ;;
-   *)
Index: devel/glib20/files/patch-configure
===================================================================
--- devel/glib20/files/patch-configure	(revision 325747)
+++ devel/glib20/files/patch-configure	(working copy)
@@ -1,5 +1,5 @@
---- configure.orig	2013-03-28 02:59:16.000000000 +0000
-+++ configure	2013-03-28 03:00:20.000000000 +0000
+--- configure.orig	2013-08-29 23:29:13.255661322 +0200
++++ configure	2013-08-29 23:48:08.845647995 +0200
 @@ -603,6 +603,9 @@
  #ifdef HAVE_SYS_TYPES_H
  # include <sys/types.h>
@@ -10,7 +10,7 @@
  #ifdef HAVE_SYS_STAT_H
  # include <sys/stat.h>
  #endif
-@@ -5699,7 +5702,7 @@
+@@ -5778,7 +5781,7 @@
  fi
  
  GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
@@ -19,7 +19,31 @@
  
  
   if test "x$with_runtime_libdir" != "x"; then
-@@ -23089,7 +23092,7 @@
+@@ -7444,13 +7447,12 @@
+ 
+       ;;
+     native)
+-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5
+-$as_echo_n "checking for iconv_open in -liconv... " >&6; }
++      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open" >&5
++$as_echo_n "checking for iconv_open... " >&6; }
+ if ${ac_cv_lib_iconv_iconv_open+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-liconv  $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -8648,6 +8650,7 @@
+     ;;
+   native)
+ 
++ICONV_LIBS=""
+ $as_echo "#define USE_LIBICONV_NATIVE 1" >>confdefs.h
+ 
+     ;;
+@@ -23201,7 +23204,7 @@
  fi
  done
  
@@ -28,7 +52,7 @@
  do :
    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-@@ -26629,10 +26632,10 @@
+@@ -26741,10 +26744,10 @@
  #  b) FreeBSD doesn't do this either.
  #
  case $host in
Index: devel/libhtp/Makefile
===================================================================
--- devel/libhtp/Makefile	(revision 325747)
+++ devel/libhtp/Makefile	(working copy)
@@ -19,11 +19,16 @@
 USES=		pkgconfig pathfix iconv
 
 CONFIGURE_ARGS=	--with-libiconv-prefix=${LOCALBASE}
-CFLAGS+=	-I${LOCALBASE}/include -L${LOCALBASE}/lib \
-		-liconv
+CFLAGS+=	-I${LOCALBASE}/include -L${LOCALBASE}/lib
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CFLAGS+=	-liconv
+.endif
+
 pre-configure:
 	@${REINPLACE_CMD} -Ee 's,^(pkgconfigdir = ).*,\1$$(exec_prefix)/libdata/pkgconfig,' ${WRKSRC}/Makefile.am
 	@cd ${WRKSRC} && ${SH} ./autogen.sh
 
-.include <bsd.port.mk>
+.include <bsd.port.post..mk>
Index: devel/libparserutils/Makefile
===================================================================
--- devel/libparserutils/Makefile	(revision 325747)
+++ devel/libparserutils/Makefile	(working copy)
@@ -11,7 +11,7 @@
 MAINTAINER=	unobe at cpan.org
 COMMENT=	Library useful when writing parsers (formerly a part of NetSurf)
 
-USE_GMAKE=	yes
+USES=		gmake
 
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
@@ -25,13 +25,16 @@
 
 .if ${PORT_OPTIONS:MICONV}
 CFLAGS+=	-DWITH_ICONV_FILTER
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LDFLAGS+=	-liconv
 .endif
+.endif
 
 .if ${PORT_OPTIONS:MSTATIC}
 PLIST_SUB+=	NO_STATIC="@comment " STATIC=""
 .else
-USE_PERL5_BUILD=yes
+USES+=		perl5
+USE_PERL5=	build
 USE_LDCONFIG=	yes
 COMPONENT_TYPE=	lib-shared
 MAKE_ENV+=	COMPONENT_TYPE=${COMPONENT_TYPE}
@@ -39,7 +42,8 @@
 .endif
 
 .if ${PORT_OPTIONS:MTEST}
-USE_PERL5_BUILD=yes
+USES+=		perl5
+USE_PERL5=	build
 ALL_TARGET+=	test
 .endif
 
Index: devel/py-fusefs/Makefile
===================================================================
--- devel/py-fusefs/Makefile	(revision 325747)
+++ devel/py-fusefs/Makefile	(working copy)
@@ -23,16 +23,20 @@
 DOCSDIR?=	${PREFIX}/share/doc/py-fusefs
 EXAMPLESDIR?=	${PREFIX}/share/examples/py-fusefs
 
+.include <bsd.port.options.mk>
+
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e '/libs =/s|$$| + " -liconv"|'\
 		${WRKSRC}/setup.py
+.endif
 
 post-install:
-.ifndef NOPORTDOCS
+.if ${PORT_OPTIONS:MDOCS}
 	@${INSTALL} -d ${DOCSDIR}/
 	@cd ${WRKSRC}/&&${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}/
 .endif
-.ifndef NOPORTEXAMPLES
+.if ${PORT_OPTIONS:MEXAMPLES}
 	@${INSTALL} -d ${EXAMPLESDIR}/
 	@cd ${WRKSRC}/example/&&${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}/
 .endif
Index: devel/styx/Makefile
===================================================================
--- devel/styx/Makefile	(revision 325747)
+++ devel/styx/Makefile	(working copy)
@@ -1,10 +1,5 @@
-# ex:ts=8
-# New ports collection makefile for:	styx
-# Date created:			Apr 17, 2001
-# Whom:				Ying-Chieh Liao <ijliao at FreeBSD.org>
-#
+# Created by: Ying-Chieh Liao <ijliao at FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	styx
 PORTVERSION=	1.6.1
@@ -16,21 +11,25 @@
 COMMENT=	A scanner/parser generator
 
 USE_AUTOTOOLS=	libtool
-USES=		iconv
-USE_GMAKE=	yes
+USES=		gmake iconv
 GNU_CONFIGURE=	yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 CONFIGURE_ARGS=	--includedir=${PREFIX}/include/${PORTNAME}
 USE_LDCONFIG=	yes
 
+.include <bsd.port.options.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 post-patch:
-.if defined(NOPORTEXAMPLES)
+.if ! ${PORT_OPTIONS:MEXAMPLES}
 	${REINPLACE_CMD} -e '/SUBDIRS/s|spexml||' ${WRKSRC}/Makefile.in
 .endif
 
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 	${TAR} -C ${WRKSRC}/doc \
 		--exclude "*.in" --exclude "*Makefile*" -cf - . | \
@@ -37,7 +36,7 @@
 			${TAR} -C ${DOCSDIR} --unlink -xf -
 	@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR}
 .endif
-.if !defined(NOPORTEXAMPLES)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${EXAMPLESDIR}
 	${TAR} -C ${WRKSRC} \
 		--exclude "*.in" --exclude "*Makefile*" -cf - spe pat | \
Index: editors/joe/Makefile
===================================================================
--- editors/joe/Makefile	(revision 325747)
+++ editors/joe/Makefile	(working copy)
@@ -17,11 +17,8 @@
 CONFLICTS=	joe-2.*
 
 LICENSE=	GPLv1
-USE_GMAKE=	yes
-USES=		iconv ncurses
+USES=		gmake iconv ncurses
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv"
-CPPFLAGS+=	-I${LOCALBASE}/include
 
 ALL_TARGET=	${PORTNAME}
 MAN1=		${PORTNAME}.1
@@ -30,6 +27,11 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv"
+CPPFLAGS+=	-I${LOCALBASE}/include
+.endif
+
 .if ! ${PORT_OPTIONS:MDOCS}
 post-patch:
 	${REINPLACE_CMD} 's,install-data-am: install-data_charmapsDATA install-data_docDATA,install-data-am: install-data_charmapsDATA,' \
Index: editors/joe2/Makefile
===================================================================
--- editors/joe2/Makefile	(revision 325747)
+++ editors/joe2/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	joe
-# Date created:		01 Jul 1995
-# Whom:			torstenb at FreeBSD.org
-#
+# Created by: torstenb at FreeBSD.org
 # $FreeBSD$
-#
 
 PORTNAME=	joe
 PORTVERSION=	2.9.8
@@ -19,16 +15,20 @@
 CONFLICTS=	joe-3*
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		iconv
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv"
-CPPFLAGS+=	-I${LOCALBASE}/include
+USES=		gmake iconv
 
 ALL_TARGET=	${PORTNAME}
 MAN1=		${PORTNAME}.1
 
+.include <bsd.port.options.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv"
+CPPFLAGS+=	-I${LOCALBASE}/include
+.endif
+
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/README.cvs ${WRKSRC}/ChangeLog\
 		 ${WRKSRC}/INFO ${WRKSRC}/NEWS ${DOCSDIR}
Index: editors/texmacs/Makefile
===================================================================
--- editors/texmacs/Makefile	(revision 325747)
+++ editors/texmacs/Makefile	(working copy)
@@ -14,10 +14,9 @@
 
 LIB_DEPENDS=	guile.21:${PORTSDIR}/lang/guile
 
-
 USE_PYTHON=	yes
 USE_TEX=	tex
-USE_GMAKE=	yes
+USES=		gmake
 GNU_CONFIGURE=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
@@ -56,7 +55,7 @@
 
 .if ${PORT_OPTIONS:MICONV}
 USES+=			iconv
-CONFIGURE_ARGS+=	--with-iconv="${LOCALBASE}"
+CONFIGURE_ARGS+=	--with-iconv
 .else
 CONFIGURE_ARGS+=	--without-iconv
 .endif
Index: emulators/mtools/Makefile
===================================================================
--- emulators/mtools/Makefile	(revision 325747)
+++ emulators/mtools/Makefile	(working copy)
@@ -14,7 +14,7 @@
 CONFLICTS_INSTALL=	multimarkdown-*
 
 USE_BZIP2=	yes
-USE_GMAKE=	yes
+USES=		gmake
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	ac_cv_header_malloc_h=no
 CONFIGURE_ARGS=	--enable-xdf
@@ -36,8 +36,10 @@
 
 .if ${PORT_OPTIONS:MICONV}
 USES+=		iconv
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
 .else
 CONFIGURE_ENV+=	ac_cv_header_iconv_h=no
 .endif
Index: emulators/virtualbox-ose/Makefile
===================================================================
--- emulators/virtualbox-ose/Makefile	(revision 325747)
+++ emulators/virtualbox-ose/Makefile	(working copy)
@@ -244,6 +244,9 @@
 		${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
 		${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py
 	@${REINPLACE_CMD} -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' ${WRKSRC}/configure
+.if exists(/usr/include/iconv.h) && ${OSVERSION} >= 1000043
+	@${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk ${WRKSRC}/src/VBox/Runtime/Makefile.kmk
+.endif
 
 pre-build:
 	@${REINPLACE_CMD} -e 's|/bin/bash|/bin/sh|' \
Index: games/pokerth/Makefile
===================================================================
--- games/pokerth/Makefile	(revision 325747)
+++ games/pokerth/Makefile	(working copy)
@@ -14,13 +14,13 @@
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	boost_thread:${PORTSDIR}/devel/boost-libs \
-		mikmod:${PORTSDIR}/audio/libmikmod \
-		gnutls:${PORTSDIR}/security/gnutls \
-		curl:${PORTSDIR}/ftp/curl \
-		gsasl:${PORTSDIR}/security/gsasl \
-		tinyxml:${PORTSDIR}/textproc/tinyxml \
-		protobuf:${PORTSDIR}/devel/protobuf
+LIB_DEPENDS=	libboost_thread.so:${PORTSDIR}/devel/boost-libs \
+		libmikmod.so:${PORTSDIR}/audio/libmikmod \
+		libgnutls.so:${PORTSDIR}/security/gnutls \
+		libcurl.so:${PORTSDIR}/ftp/curl \
+		libgsasl.so:${PORTSDIR}/security/gsasl \
+		libtinyxml.so:${PORTSDIR}/textproc/tinyxml \
+		libprotobuf.so:${PORTSDIR}/devel/protobuf
 BUILD_DEPENDS=	${LOCALBASE}/include/libircclient.h:${PORTSDIR}/irc/libircclient
 
 USES=		iconv gmake
@@ -37,6 +37,7 @@
 .include <bsd.port.options.mk>
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -E \
 		-e 's|/usr([a-z|/]*)|${LOCALBASE}/\1|g' \
 		-e 's|(-lcurl)|\1 -liconv|g' \
@@ -44,6 +45,14 @@
 		-e 's|LIB_DIRS =.*|LIB_DIRS = ${LOCALBASE}/lib|g' \
 		-e '/.*QMAKE_CXXFLAGS.*/d' \
 		${WRKSRC}/*.pro
+.else
+	@${REINPLACE_CMD} -E \
+		-e 's|/usr([a-z|/]*)|${LOCALBASE}/\1|g' \
+		-e 's:boost_([a-z]+)-[-|a-z|0-9|_]*:boost_\1:g' \
+		-e 's|LIB_DIRS =.*|LIB_DIRS = ${LOCALBASE}/lib|g' \
+		-e '/.*QMAKE_CXXFLAGS.*/d' \
+		${WRKSRC}/*.pro
+.endif
 
 do-configure:
 	@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${QMAKE} ${QMAKE_ARGS} pokerth.pro
Index: games/stepmania-devel/Makefile
===================================================================
--- games/stepmania-devel/Makefile	(revision 325747)
+++ games/stepmania-devel/Makefile	(working copy)
@@ -16,8 +16,8 @@
 LICENSE_FILE=	${WRKSRC}/Docs/Licenses.txt
 
 BUILD_DEPENDS=	zip:${PORTSDIR}/archivers/zip
-LIB_DEPENDS=	mad:${PORTSDIR}/audio/libmad \
-		GLEW:${PORTSDIR}/graphics/glew
+LIB_DEPENDS=	libmad.so:${PORTSDIR}/audio/libmad \
+		libGLEW.so:${PORTSDIR}/graphics/glew
 
 OPTIONS_DEFINE=	PULSEAUDIO VORBIS DOCS
 OPTIONS_DEFAULT=VORBIS
@@ -55,8 +55,13 @@
 .endif
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e \
 		'/^LIBS/s|-lpthread|-liconv|' ${WRKSRC}/src/Makefile.in
+.else
+	@${REINPLACE_CMD} -e \
+		'/^LIBS/s|-lpthread||' ${WRKSRC}/src/Makefile.in
+.endif
 
 pre-build:
 	@${ECHO_CMD} -n > ${WRKDIR}/stepmania.sh
Index: games/tuxmath/Makefile
===================================================================
--- games/tuxmath/Makefile	(revision 325747)
+++ games/tuxmath/Makefile	(working copy)
@@ -31,7 +31,7 @@
 
 CPPFLAGS+=	$$(pkg-config --cflags SDL_Pango) -I${LOCALBASE}/include \
 		-DHAVE_ALPHASORT -DHAVE_SCANDIR -DHAVE_FSYNC -DICONV_CONST=""
-LDFLAGS+=	$$(pkg-config --libs SDL_Pango) -L${LOCALBASE}/lib -liconv -lpng15
+LDFLAGS+=	$$(pkg-config --libs SDL_Pango) -L${LOCALBASE}/lib -lpng15
 
 T4K_NAME=	t4k_common
 T4K_VERSION=	0.1.1
@@ -40,6 +40,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${PORT_OPTIONS:MNLS}
 USES+=		gettext
 PLIST_SUB+=	NLS=""
Index: graphics/graphite2/Makefile
===================================================================
--- graphics/graphite2/Makefile	(revision 325747)
+++ graphics/graphite2/Makefile	(working copy)
@@ -11,10 +11,15 @@
 
 USES=		cmake iconv
 USE_LDCONFIG=	yes
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's,/pkgconfig,data/pkgconfig,g' ${WRKSRC}/CMakeLists.txt
 	@${REINPLACE_CMD} -e 's/.$${GRAPHITE_API_REVISION}.$${GRAPHITE_API_AGE}//g' ${WRKSRC}/src/CMakeLists.txt
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: graphics/ida/Makefile
===================================================================
--- graphics/ida/Makefile	(revision 325747)
+++ graphics/ida/Makefile	(working copy)
@@ -13,8 +13,8 @@
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	jpeg:${PORTSDIR}/graphics/jpeg \
-		exif:${PORTSDIR}/graphics/libexif
+LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
+		libexif.so:${PORTSDIR}/graphics/libexif
 
 OPTIONS_DEFINE=	GIF PCF PNG SANE TIFF WEBP DOCS
 OPTIONS_DEFAULT=	GIF PNG TIFF
@@ -26,8 +26,6 @@
 MAKEFILE=	GNUmakefile
 MAKE_ARGS=	JPEG_VER=80 verbose=yes
 
-LDFLAGS+=	-liconv
-
 MAN1=		exiftran.1 ida.1
 PORTDOCS=	README TODO INSTALL
 PLIST_FILES=	bin/exiftran bin/ida lib/X11/app-defaults/Ida \
@@ -36,6 +34,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${PORT_OPTIONS:MGIF}
 LIB_DEPENDS+=	gif.5:${PORTSDIR}/graphics/giflib
 .else
Index: graphics/ipe/Makefile
===================================================================
--- graphics/ipe/Makefile	(revision 325747)
+++ graphics/ipe/Makefile	(working copy)
@@ -12,8 +12,8 @@
 
 LICENSE=	GPLv3 # (or later)
 
-LIB_DEPENDS=	cairo:${PORTSDIR}/graphics/cairo \
-		lua-5.2:${PORTSDIR}/lang/lua52
+LIB_DEPENDS=	libcairo.so:${PORTSDIR}/graphics/cairo \
+		liblua-5.2.so:${PORTSDIR}/lang/lua52
 RUN_DEPENDS=	xdg-open:${PORTSDIR}/devel/xdg-utils
 
 OPTIONS_DEFINE=	DOCS
@@ -20,13 +20,10 @@
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}/src
 
-USES=		pkgconfig
+USES=		gmake pkgconfig
 USE_QT4=	gui moc_build qmake_build rcc_build uic_build
 USE_TEX=	latex
-USE_GMAKE=	yes
 MAKE_ENV=	DLL_CFLAGS="-fPIC" \
-		ICONV_CFLAGS="-I${LOCALBASE}/include" \
-		ICONV_LIBS="-L${LOCALBASE}/lib -liconv" \
 		INSTALL_DIR="${MKDIR}" \
 		INSTALL_FILES="${INSTALL_DATA}" \
 		INSTALL_SCRIPTS="${INSTALL_SCRIPT}" \
@@ -51,6 +48,11 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+MAKE_ENV+=	ICONV_CFLAGS="-I${LOCALBASE}/include" \
+		ICONV_LIBS="-L${LOCALBASE}/lib -liconv"
+.endif
+
 post-patch:
 	@cd ${WRKSRC}/../fontmaps && ${SED} -e \
 		's|/usr/share|${LOCALBASE}/share| ; \
Index: graphics/libgaiagraphics/Makefile
===================================================================
--- graphics/libgaiagraphics/Makefile	(revision 325747)
+++ graphics/libgaiagraphics/Makefile	(working copy)
@@ -13,23 +13,27 @@
 MAINTAINER=	coder at tuxfamily.org
 COMMENT=	Library supporting common-utility raster handling methods
 
-LIB_DEPENDS=	png15:${PORTSDIR}/graphics/png \
-		tiff:${PORTSDIR}/graphics/tiff \
-		geotiff:${PORTSDIR}/graphics/libgeotiff \
-		jpeg:${PORTSDIR}/graphics/jpeg \
-		cairo:${PORTSDIR}/graphics/cairo
+LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png \
+		libtiff.so:${PORTSDIR}/graphics/tiff \
+		libgeotiff.so:${PORTSDIR}/graphics/libgeotiff \
+		libjpeg.so:${PORTSDIR}/graphics/jpeg \
+		libcairo.so:${PORTSDIR}/graphics/cairo
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		iconv
+USES=		gmake iconv
 
+USE_LDCONFIG=	yes
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 CONFIGURE_ARGS+=CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
-USE_LDCONFIG=	yes
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|g' \
 		${WRKSRC}/Makefile.in
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: graphics/netpbm/Makefile
===================================================================
--- graphics/netpbm/Makefile	(revision 325747)
+++ graphics/netpbm/Makefile	(working copy)
@@ -22,8 +22,7 @@
 
 MAKE_JOBS_UNSAFE=	yes
 
-USE_PERL5=	yes
-USE_GMAKE=	yes
+USES=		gmake perl5
 CFLAGS+=	-DPNG_DEPSTRUCT= -Iutil
 MAKE_ENV=	LN="${LN}" RANLIB="${RANLIB}"
 MAKEFILE=	GNUmakefile
Index: graphics/netpbm/files/patch-lib-util-pm_c_util.h
===================================================================
--- graphics/netpbm/files/patch-lib-util-pm_c_util.h	(revision 0)
+++ graphics/netpbm/files/patch-lib-util-pm_c_util.h	(working copy)
@@ -0,0 +1,10 @@
+--- lib/util/pm_c_util.h.orig	2006-08-19 05:12:28.000000000 +0200
++++ lib/util/pm_c_util.h	2013-08-30 13:58:20.918173431 +0200
+@@ -50,6 +50,7 @@
+ #ifndef __cplusplus
+   #ifndef HAVE_BOOL
+     #define HAVE_BOOL 1
++    #undef bool
+     typedef int bool;
+     #endif
+   #ifndef true

Property changes on: graphics/netpbm/files/patch-lib-util-pm_c_util.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: graphics/oyranos/Makefile
===================================================================
--- graphics/oyranos/Makefile	(revision 325747)
+++ graphics/oyranos/Makefile	(working copy)
@@ -11,18 +11,18 @@
 BUILD_DEPENDS=	${LOCALBASE}/bin/doxygen:${PORTSDIR}/devel/doxygen
 RUN_DEPENDS=	${LOCALBASE}/share/color/icc/OpenICC/sRGB.icc:${PORTSDIR}/graphics/icc-profiles-openicc \
 		${LOCALBASE}/share/color/icc/basICColor/ISOcoated_v2_300_bas.ICC:${PORTSDIR}/graphics/icc-profiles-basiccolor
-LIB_DEPENDS=	raw:${PORTSDIR}/graphics/libraw \
-		xml2:${PORTSDIR}/textproc/libxml2 \
-		exiv2:${PORTSDIR}/graphics/exiv2 \
-		png15:${PORTSDIR}/graphics/png \
-		cairo:${PORTSDIR}/graphics/cairo \
-		yajl:${PORTSDIR}/devel/yajl \
-		fltk:${PORTSDIR}/x11-toolkits/fltk \
-		cups:${PORTSDIR}/print/cups-client \
-		xdot:${PORTSDIR}/graphics/graphviz \
-		lcms:${PORTSDIR}/graphics/lcms \
-		lcms2:${PORTSDIR}/graphics/lcms2 \
-		Xcm:${PORTSDIR}/x11/libXcm
+LIB_DEPENDS=	libraw.so:${PORTSDIR}/graphics/libraw \
+		libxml2.so:${PORTSDIR}/textproc/libxml2 \
+		libexiv2.so:${PORTSDIR}/graphics/exiv2 \
+		libpng15.so:${PORTSDIR}/graphics/png \
+		libcairo.so:${PORTSDIR}/graphics/cairo \
+		libyajl.so:${PORTSDIR}/devel/yajl \
+		libfltk.so:${PORTSDIR}/x11-toolkits/fltk \
+		libcups.so:${PORTSDIR}/print/cups-client \
+		libxdot.so:${PORTSDIR}/graphics/graphviz \
+		liblcms.so:${PORTSDIR}/graphics/lcms \
+		liblcms2.so:${PORTSDIR}/graphics/lcms2 \
+		libXcm.so:${PORTSDIR}/x11/libXcm
 
 USES=		cmake gettext pkgconfig
 USE_BZIP2=	yes
@@ -32,7 +32,6 @@
 USE_QT4=	gui moc_build qmake_build rcc_build uic_build
 USE_XORG=	xfixes xinerama xrandr xxf86vm
 CMAKE_ARGS+=	-DXDG_CONFIG_DIR=${PREFIX}/etc/xdg
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 
 MAN1=		oyranos-config-fltk.1 oyranos-monitor-daemon.1 oyranos-monitor.1 \
 		oyranos-policy.1 oyranos-profile-graph.1 oyranos-profile-install.1 \
@@ -41,6 +40,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 .if exists(/usr/bin/clang) && ${OSVERSION} > 901502
 CC=		/usr/bin/clang
 CXX=		/usr/bin/clang++
Index: irc/xchat1/Makefile
===================================================================
--- irc/xchat1/Makefile	(revision 325747)
+++ irc/xchat1/Makefile	(working copy)
@@ -16,13 +16,11 @@
 # contact its maintainer.
 
 USE_BZIP2=		yes
-USE_GMAKE=		yes
-USES=			iconv perl5
+USES=			gmake iconv perl5
 USE_GNOME=		gtk12
 WANT_GNOME=		yes
 GNU_CONFIGURE=		yes
 # Assign with `+=' for slave ports
-CONFIGURE_ENV+=		LIBS="-L${LOCALBASE}/lib -lintl -liconv"
 CPPFLAGS+=		-I${LOCALBASE}/include
 CONFIGURE_ARGS+=	--without-included-gettext \
 			--enable-nls \
@@ -45,6 +43,12 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV+=		LIBS="-L${LOCALBASE}/lib -lintl -liconv"
+.else
+CONFIGURE_ENV+=		LIBS="-L${LOCALBASE}/lib -lintl"
+.endif
+
 .if defined(WITH_TRANSPARENCY)
 BUILD_DEPENDS+=		${LOCALBASE}/bin/gdk-pixbuf-config:${PORTSDIR}/graphics/gdk-pixbuf
 CONFIGURE_ARGS+=	--enable-gdk-pixbuf
Index: japanese/groff/Makefile
===================================================================
--- japanese/groff/Makefile	(revision 325747)
+++ japanese/groff/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	ja-groff
-# Date created:		14 April 1995
-# Whom:			Nobuhiro Yasutomi <nobu at psrc.isac.co.jp>
-#
+# Created by: Nobuhiro Yasutomi <nobu at psrc.isac.co.jp>
 # $FreeBSD$
-#
 
 PORTNAME=	groff
 PORTVERSION=	1.18.1
@@ -32,8 +28,7 @@
 
 USE_GCC=	any
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		iconv
+USES=		gmake iconv
 
 CONFLICTS=	groff-[0-9]*
 
@@ -40,9 +35,7 @@
 MAKE_JOBS_UNSAFE=	yes
 
 CONFIGURE_ARGS=	--enable-multibyte
-CONFIGURE_ENV=	INSTALL_MAN="${INSTALL_MAN}" \
-		LIBS="-L${LOCALBASE}/lib -liconv"
-CFLAGS+=	-I${LOCALBASE}/include
+CONFIGURE_ENV=	INSTALL_MAN="${INSTALL_MAN}"
 
 TMACBASE=	${WRKDIR}/${TMAC_DISTNAME}
 TMACDIR=	share/groff/${PORTVERSION}/tmac
@@ -72,9 +65,9 @@
 		groff_me.7 groff_mm.7 groff_mmse.7 groff_mom.7 groff_ms.7 \
 		groff_trace.7 groff_www.7 roff.7
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 INSTALL_TARGET=	install install_doc
 PORTDOCS=	${PORTVERSION}
 .endif
@@ -98,10 +91,17 @@
 .endif
 
 POST_INSTALL_SEQ=	install-links
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 POST_INSTALL_SEQ+=	install-documents
 .endif
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV+=	LIBS="-L${LOCALBASE}/lib -liconv"
+CFLAGS+=	-I${LOCALBASE}/include
+.endif
+
 post-patch:
 	${REINPLACE_CMD} -e 's|\(install_data\)|\1 install_doc|g;' \
 		${WRKSRC}/Makefile.in
Index: java/openjdk6/Makefile
===================================================================
--- java/openjdk6/Makefile	(revision 325747)
+++ java/openjdk6/Makefile	(working copy)
@@ -240,6 +240,13 @@
 	@${REINPLACE_CMD} 's|build-policy install-limited|build-policy install-unlimited|' \
 		${WRKSRC}/jdk/make/javax/crypto/Makefile
 .endif
+.if exists(/usr/include/iconv.h) && ${OSVERSION} >= 1000043
+	@${REINPLACE_CMD} 's| -liconv||' \
+		${WRKSRC}/Makefile \
+		${WRKSRC}/jdk/make/sun/splashscreen/Makefile \
+		${WRKSRC}/jdk/make/java/npt/Makefile \
+		${WRKSRC}/jdk/make/java/instrument/Makefile
+.endif
 
 post-build:
 .if ${PORT_OPTIONS:MTZUPDATE}
Index: java/openjdk7/Makefile
===================================================================
--- java/openjdk7/Makefile	(revision 325747)
+++ java/openjdk7/Makefile	(working copy)
@@ -159,7 +159,15 @@
 	@${REINPLACE_CMD} 's|build-policy install-limited|build-policy install-unlimited|' \
 		${WRKSRC}/jdk/make/javax/crypto/Makefile
 .endif
+.if exists(/usr/include/iconv.h) && ${OSVERSION} >= 1000043
+	@${REINPLACE_CMD} 's| -liconv||' \
+		${WRKSRC}/Makefile \
+		${WRKSRC}/jdk/make/sun/splashscreen/Makefile \
+		${WRKSRC}/jdk/make/java/npt/Makefile \
+		${WRKSRC}/jdk/make/java/instrument/Makefile
+.endif
 
+
 .if ${PORT_OPTIONS:MTZUPDATE}
 pre-install:
 	@# Update time zones
Index: lang/php5/Makefile.ext
===================================================================
--- lang/php5/Makefile.ext	(revision 325747)
+++ lang/php5/Makefile.ext	(working copy)
@@ -126,7 +126,7 @@
 .endif
 
 .if ${PHP_MODNAME} == "iconv"
-CONFIGURE_ARGS+=--with-iconv=${LOCALBASE}
+CONFIGURE_ARGS+=--with-iconv
 
 USES+=	iconv
 .endif
@@ -424,8 +424,7 @@
 
 .if ${PHP_MODNAME} == "xmlrpc"
 CONFIGURE_ARGS+=--with-xmlrpc \
-		--with-libxml-dir=${LOCALBASE} \
-		--with-iconv-dir=${LOCALBASE}
+		--with-libxml-dir=${LOCALBASE}
 
 USES+=		iconv
 USE_GNOME=	libxml2
Index: lang/php52/Makefile.ext
===================================================================
--- lang/php52/Makefile.ext	(revision 325747)
+++ lang/php52/Makefile.ext	(working copy)
@@ -135,8 +135,7 @@
 .endif
 
 .if ${PHP_MODNAME} == "iconv"
-CONFIGURE_ARGS+=--with-iconv=${LOCALBASE} \
-		--with-iconv-dir=${LOCALBASE}
+CONFIGURE_ARGS+=--with-iconv
 
 USES+=		iconv
 .endif
@@ -482,8 +481,7 @@
 
 .if ${PHP_MODNAME} == "xmlrpc"
 CONFIGURE_ARGS+=--with-xmlrpc \
-		--with-libxml-dir=${LOCALBASE} \
-		--with-iconv-dir=${LOCALBASE}
+		--with-libxml-dir=${LOCALBASE}
 
 USES+=		iconv
 USE_GNOME=	libxml2
Index: lang/php53/Makefile.ext
===================================================================
--- lang/php53/Makefile.ext	(revision 325747)
+++ lang/php53/Makefile.ext	(working copy)
@@ -125,7 +125,7 @@
 .endif
 
 .if ${PHP_MODNAME} == "iconv"
-CONFIGURE_ARGS+=--with-iconv=${LOCALBASE}
+CONFIGURE_ARGS+=--with-iconv
 
 USES+=	iconv
 .endif
@@ -429,8 +429,7 @@
 
 .if ${PHP_MODNAME} == "xmlrpc"
 CONFIGURE_ARGS+=--with-xmlrpc \
-		--with-libxml-dir=${LOCALBASE} \
-		--with-iconv-dir=${LOCALBASE}
+		--with-libxml-dir=${LOCALBASE}
 
 USES+=		iconv
 USE_GNOME=	libxml2
Index: lang/php55/Makefile.ext
===================================================================
--- lang/php55/Makefile.ext	(revision 325747)
+++ lang/php55/Makefile.ext	(working copy)
@@ -126,7 +126,7 @@
 .endif
 
 .if ${PHP_MODNAME} == "iconv"
-CONFIGURE_ARGS+=--with-iconv=${LOCALBASE}
+CONFIGURE_ARGS+=--with-iconv
 
 USES+=	iconv
 .endif
@@ -424,8 +424,7 @@
 
 .if ${PHP_MODNAME} == "xmlrpc"
 CONFIGURE_ARGS+=--with-xmlrpc \
-		--with-libxml-dir=${LOCALBASE} \
-		--with-iconv-dir=${LOCALBASE}
+		--with-libxml-dir=${LOCALBASE}
 
 USES+=		iconv
 USE_GNOME=	libxml2
Index: mail/balsa/Makefile
===================================================================
--- mail/balsa/Makefile	(revision 325747)
+++ mail/balsa/Makefile	(working copy)
@@ -12,20 +12,18 @@
 MAINTAINER=	gnome at FreeBSD.org
 COMMENT=	A mail reader for the GNOME 2 desktop
 
-LIB_DEPENDS=	aspell:${PORTSDIR}/textproc/aspell \
-		pcre:${PORTSDIR}/devel/pcre \
-		esmtp:${PORTSDIR}/mail/libesmtp \
-		gmime-2.4:${PORTSDIR}/mail/gmime24 \
-		gnome-keyring:${PORTSDIR}/security/gnome-keyring \
-		canberra-gtk:${PORTSDIR}/audio/libcanberra
+LIB_DEPENDS=	libaspell.so:${PORTSDIR}/textproc/aspell \
+		libpcre.so:${PORTSDIR}/devel/pcre \
+		libesmtp.so:${PORTSDIR}/mail/libesmtp \
+		libgmime-2.4.so:${PORTSDIR}/mail/gmime24 \
+		libgnome-keyring.so:${PORTSDIR}/security/gnome-keyring \
+		libcanberra-gtk.so:${PORTSDIR}/audio/libcanberra
 
-USE_GMAKE=	yes
 USE_BZIP2=	yes
 INSTALLS_OMF=	yes
 INSTALLS_ICONS=	yes
-USE_PERL5=	yes
 USE_OPENSSL=	yes
-USES=		pathfix gettext iconv
+USES=		gmake pathfix gettext iconv perl5
 USE_GNOME=	gnomeprefix intlhack libgnomeui gtkhtml3 \
 		libgnomeprintui
 USE_AUTOTOOLS=	libltdl
@@ -35,7 +33,6 @@
 		--with-ssl \
 		--without-nm \
 		--with-canberra
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv ${PTHREAD_LIBS}"
 CPPFLAGS+=	-I${LOCALBASE}/include ${PTHREAD_CFLAGS}
 
 MAN1=		balsa.1
@@ -48,6 +45,12 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib -liconv ${PTHREAD_LIBS}"
+.else
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
+.endif
+
 .if ${PORT_OPTIONS:MGPG}
 LIB_DEPENDS+=		gpgme:${PORTSDIR}/security/gpgme
 CONFIGURE_ARGS+=	--with-gpgme=${LOCALBASE}/bin/gpgme-config
Index: mail/bogofilter/Makefile
===================================================================
--- mail/bogofilter/Makefile	(revision 325747)
+++ mail/bogofilter/Makefile	(working copy)
@@ -43,8 +43,10 @@
 CONFIGURE_ARGS+=	--sysconfdir=${PREFIX}/etc
 .if ${PORT_OPTIONS:MUNICODE}
 CONFIGURE_ARGS+=	--enable-unicode
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 BF_LIBS+=		-liconv
 .endif
+.endif
 .if ${PORT_OPTIONS:MGSL}
 LIB_DEPENDS+=		libgsl.so:${PORTSDIR}/math/gsl
 .else
Index: mail/claws-mail/Makefile
===================================================================
--- mail/claws-mail/Makefile	(revision 325747)
+++ mail/claws-mail/Makefile	(working copy)
@@ -67,8 +67,13 @@
 .endif
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's|-lresolv||g; s|-lpisock\"|-liconv &|g' \
 		${WRKSRC}/configure
+.else
+	@${REINPLACE_CMD} -e 's|-lresolv||g' \
+		${WRKSRC}/configure
+.endif
 	@${REINPLACE_CMD} -e 's|/etc|${LOCALBASE}&|g ; s|/usr/share|${LOCALBASE}/share|g' \
 		${WRKSRC}/src/procmime.c
 	@${REINPLACE_CMD} -e "/(GPGME_LIBS)/d" \
Index: mail/crm114/Makefile
===================================================================
--- mail/crm114/Makefile	(revision 325747)
+++ mail/crm114/Makefile	(working copy)
@@ -17,7 +17,7 @@
 MAINTAINER=	chalpin at cs.wisc.edu
 COMMENT=	A Markov based SpamFilter
 
-LIB_DEPENDS=	tre.5:${PORTSDIR}/textproc/libtre
+LIB_DEPENDS=	libtre.so:${PORTSDIR}/textproc/libtre
 
 CRM114RELEASENAME=BlameMichelson
 
@@ -30,7 +30,6 @@
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
-LIBS+=		-L${LOCALBASE}/lib -liconv -lintl
 
 CFLAGS+=	-DVERSION='\"${PORTVERSION}-${CRM114RELEASENAME}\"'
 CFLAGS+=	-DNO_LOGL
@@ -47,6 +46,12 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LIBS+=		-L${LOCALBASE}/lib -liconv -lintl
+.else
+LIBS+=		-L${LOCALBASE}/lib -lintl
+.endif
+
 .if ${PORT_OPTIONS:MPGO}
 MAKE_ARGS+=	CFLAGS="${CFLAGS} -fprofile-use" \
 		LDFLAGS="${LDFLAGS} -fprofile-use"
Index: mail/exim/Makefile
===================================================================
--- mail/exim/Makefile	(revision 325747)
+++ mail/exim/Makefile	(working copy)
@@ -235,8 +235,10 @@
 
 .if ${PORT_OPTIONS:MICONV}
 USES=		iconv
-SEDLIST+=	-e 's,XX_ICONV_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -liconv,' \
-		-e 's,^\# (HAVE_ICONV=),\1,'
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+SEDLIST+=	-e 's,XX_ICONV_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -liconv,'
+.endif
+SEDLIST+=	-e 's,^\# (HAVE_ICONV=),\1,'
 .else
 SEDLIST+=	-e 's,XX_ICONV_LIBS_XX,,'
 .endif
Index: mail/libpst/Makefile
===================================================================
--- mail/libpst/Makefile	(revision 325747)
+++ mail/libpst/Makefile	(working copy)
@@ -12,13 +12,10 @@
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	gsf-1:${PORTSDIR}/devel/libgsf
+LIB_DEPENDS=	libgsf-1.so:${PORTSDIR}/devel/libgsf
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		iconv pathfix
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+USES=		gmake iconv pathfix
 CONFIGURE_ARGS+=	--disable-python --enable-libpst-shared
 USE_LDCONFIG=	yes
 
@@ -32,6 +29,11 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 .if ${PORT_OPTIONS:MPST2DII}
 CONFIGURE_ARGS+=	--enable-dii=yes
 BUILD_DEPENDS+=	${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick
Index: mail/mmr/Makefile
===================================================================
--- mail/mmr/Makefile	(revision 325747)
+++ mail/mmr/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	mmr
-# Date created:				23 October 1997
-# Whom:					Andrey Zakhvatov
-#
+# Created by: Andrey Zakhvatov
 # $FreeBSD$
-#
 
 PORTNAME=	mmr
 PORTVERSION=	1.6.0
@@ -29,7 +25,14 @@
 		-DMAILPATH=\"/var/mail\" \
 		-DMAILER=\"/usr/sbin/sendmail\ -t\" \
 		-I${LOCALBASE}/include
+
+.include <bsd.port.options.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv -lcurses -lmd
+.else
+LDFLAGS+=	-L${LOCALBASE}/lib -lcurses -lmd
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|md5/libmd5.a||g' ${WRKSRC}/Makefile
@@ -36,13 +39,13 @@
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/mmr ${PREFIX}/bin
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 .for file in ${PORTDOCS}
 	${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
 .endfor
 .endif
-.if !defined(NOPORTEXAMPLES)
+.if ${PORT_OPTIONS:MEXAMPLES}
 	@${MKDIR} ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/DOT-mmrc ${EXAMPLESDIR}/dot.mmrc.sample
 .endif
Index: mail/normalizemime/Makefile
===================================================================
--- mail/normalizemime/Makefile	(revision 325747)
+++ mail/normalizemime/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	normalize mime
-# Date created:		Wed Aug 31 00:24:53 UTC 2005
-# Whom:			Mario Sergio Fujikawa Ferreira <lioux at FreeBSD.org>
-#
+# Created by: Mario Sergio Fujikawa Ferreira <lioux at FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	normalizemime
 PORTVERSION=	1.19
@@ -21,11 +17,15 @@
 USES=		iconv
 NO_WRKSUBDIR=	yes
 
+PLIST_FILES=	bin/${DISTNAME:R}
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CXXFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
 
-PLIST_FILES=	bin/${DISTNAME:R}
-
 post-extract:
 	@${INSTALL_DATA} ${DISTDIR}/${DISTNAME} ${WRKSRC}
 
@@ -36,4 +36,4 @@
 do-install:
 	@${INSTALL_PROGRAM} ${WRKSRC}/${DISTNAME:R} ${PREFIX}/bin
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: mail/sylpheed/Makefile
===================================================================
--- mail/sylpheed/Makefile	(revision 325747)
+++ mail/sylpheed/Makefile	(working copy)
@@ -100,9 +100,15 @@
 		src/icons/Makefile.in
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS:S/"//g}|g; \
 		s|-lresolv||g; s|-lpisock\"|-liconv &|g;' \
 		${WRKSRC}/configure
+.else
+	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS:S/"//g}|g; \
+		s|-lresolv||g;' \
+		${WRKSRC}/configure
+.endif
 	@${REINPLACE_CMD} -e 's|/etc|${LOCALBASE}&|g' \
 		${WRKSRC}/libsylph/procmime.c
 
Index: multimedia/libxine/Makefile
===================================================================
--- multimedia/libxine/Makefile	(revision 325747)
+++ multimedia/libxine/Makefile	(working copy)
@@ -12,24 +12,24 @@
 MAINTAINER=	nox at FreeBSD.org
 COMMENT=	Libraries for xine multimedia player
 
-LIB_DEPENDS=	FLAC:${PORTSDIR}/audio/flac \
-		a52:${PORTSDIR}/audio/liba52 \
-		vorbis:${PORTSDIR}/audio/libvorbis \
-		speex:${PORTSDIR}/audio/speex \
-		mng:${PORTSDIR}/graphics/libmng \
-		png15:${PORTSDIR}/graphics/png \
-		dvdread:${PORTSDIR}/multimedia/libdvdread \
-		freetype:${PORTSDIR}/print/freetype2 \
-		fame-0:${PORTSDIR}/multimedia/libfame \
-		cdio:${PORTSDIR}/sysutils/libcdio \
-		modplug:${PORTSDIR}/audio/libmodplug \
-		vcdinfo:${PORTSDIR}/multimedia/vcdimager \
-		theora:${PORTSDIR}/multimedia/libtheora \
-		mad:${PORTSDIR}/audio/libmad \
-		dca:${PORTSDIR}/multimedia/libdca \
-		avcodec:${PORTSDIR}/multimedia/ffmpeg \
-		faad:${PORTSDIR}/audio/faad \
-		vdpau:${PORTSDIR}/multimedia/libvdpau
+LIB_DEPENDS=	libFLAC.so:${PORTSDIR}/audio/flac \
+		liba52.so:${PORTSDIR}/audio/liba52 \
+		libvorbis.so:${PORTSDIR}/audio/libvorbis \
+		libspeex.so:${PORTSDIR}/audio/speex \
+		libmng.so:${PORTSDIR}/graphics/libmng \
+		libpng15.so:${PORTSDIR}/graphics/png \
+		libdvdread.so:${PORTSDIR}/multimedia/libdvdread \
+		libfreetype.so:${PORTSDIR}/print/freetype2 \
+		libfame-0.so:${PORTSDIR}/multimedia/libfame \
+		libcdio.so:${PORTSDIR}/sysutils/libcdio \
+		libmodplug.so:${PORTSDIR}/audio/libmodplug \
+		libvcdinfo.so:${PORTSDIR}/multimedia/vcdimager \
+		libtheora.so:${PORTSDIR}/multimedia/libtheora \
+		libmad.so:${PORTSDIR}/audio/libmad \
+		libdca.so:${PORTSDIR}/multimedia/libdca \
+		libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \
+		libfaad.so:${PORTSDIR}/audio/faad \
+		libvdpau.so:${PORTSDIR}/multimedia/libvdpau
 
 BUILD_DEPENDS+=	v4l_compat>=1.0.20100321:${PORTSDIR}/multimedia/v4l_compat
 
@@ -37,14 +37,13 @@
 LIB_DEPENDS+=	dvdcss.${DVDCSS_LIBVERSION}:${PORTSDIR}/multimedia/libdvdcss
 .endif
 
-USES=		pathfix pkgconfig iconv
+USES=		gmake pathfix pkgconfig iconv perl5
+USE_PERL5=	build
 USE_XZ=		yes
 GNU_CONFIGURE=	yes
 WANT_GNOME=	yes
-USE_GMAKE=	yes
 USE_XORG=	sm x11 xv xinerama
 USE_GL=		gl glu
-USE_PERL5_BUILD=yes
 USE_SDL=	sdl
 USE_LDCONFIG=	yes
 CONFIGURE_ENV=	THREAD_CFLAGS="${PTHREAD_CFLAGS}" \
@@ -237,6 +236,8 @@
 CONFIGURE_ARGS+=	--disable-vidix
 .endif
 
+.include <bsd.port.pre.mk>
+
 post-patch:
 .if ${PORT_OPTIONS:MVAAPI}
 	@${PATCH} ${PATCH_DIST_ARGS} <${FILESDIR}/ffmpeg-vaapi_xine-lib-1.2.2-defaultoff.diff
@@ -257,6 +258,7 @@
 		${WRKSRC}/src/demuxers/demux_qt.c
 
 pre-configure:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e \
 		's|THREAD_LIBS=".*"|THREAD_LIBS="\$$THREAD_LIBS"|g ; \
 		 s|THREAD_CFLAGS=".*"|THREAD_CFLAGS="\$$THREAD_CFLAGS"|g ; \
@@ -266,7 +268,18 @@
 		 s|-funroll-loops||g ; \
 		 s|LIBFFMPEG_CFLAGS|LIBFFMPEG_CPPFLAGS|g ; \
 		 s|echo aout|echo elf|g' ${WRKSRC}/configure
+.else
 	@${REINPLACE_CMD} -e \
+		's|THREAD_LIBS=".*"|THREAD_LIBS="\$$THREAD_LIBS"|g ; \
+		 s|THREAD_CFLAGS=".*"|THREAD_CFLAGS="\$$THREAD_CFLAGS"|g ; \
+		 s|-L/usr/local/lib||g ; \
+		 s|-I/usr/local/include||g ; \
+		 s|-lgiconv||g ; \
+		 s|-funroll-loops||g ; \
+		 s|LIBFFMPEG_CFLAGS|LIBFFMPEG_CPPFLAGS|g ; \
+		 s|echo aout|echo elf|g' ${WRKSRC}/configure
+.endif
+	@${REINPLACE_CMD} -e \
 		 's|-malign-loops|-falign-loops|g ; \
 		  s|-malign-jumps|-falign-jumps|g ; \
 		  s|-malign-functions|-falign-functions|g ; \
@@ -273,4 +286,4 @@
 		  s|{libdir}/pkgconfig|{prefix}/libdata/pkgconfig|g' \
 		${WRKSRC}/configure
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: multimedia/mkclean/Makefile
===================================================================
--- multimedia/mkclean/Makefile	(revision 325747)
+++ multimedia/mkclean/Makefile	(working copy)
@@ -16,7 +16,7 @@
 USES=		iconv gmake
 
 CFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 
 MAKE_ENV+=	"LFLAGS=${LDFLAGS}"
 MAKEFILE=	GNUmakefile
@@ -31,6 +31,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${ARCH} == "sparc64"
 BROKEN=		Does not install on sparc64: gmake: GNUmakefile: No such file or directory
 .endif
Index: multimedia/mkvalidator/Makefile
===================================================================
--- multimedia/mkvalidator/Makefile	(revision 325747)
+++ multimedia/mkvalidator/Makefile	(working copy)
@@ -16,7 +16,7 @@
 USES=		iconv gmake
 
 CFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 
 MAKE_ENV+=	"LFLAGS=${LDFLAGS}"
 MAKEFILE=	GNUmakefile
@@ -30,6 +30,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${ARCH} == "sparc64"
 BROKEN=		Does not install on sparc64: gmake: GNUmakefile: No such file or directory
 .endif
Index: multimedia/w_scan/Makefile
===================================================================
--- multimedia/w_scan/Makefile	(revision 325747)
+++ multimedia/w_scan/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	w_scan
-# Date created:		Wed Apr 14 18:11:42 CEST 2010
-# Whom:			Juergen Lock <nox at freebsd.org>
-#
+# Created by: Juergen Lock <nox at freebsd.org>
 # $FreeBSD$
-#
 
 PORTNAME=	w_scan
 PORTVERSION=	20120415
@@ -25,7 +21,9 @@
 PATCH_STRIP=	-lp1
 USES+=		gettext
 CPPFLAGS+=	-I"${LOCALBASE}/include"
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LDFLAGS+=	-L"${LOCALBASE}/lib\ -liconv"
+.endif
 PORTDOCS=	COPYING ChangeLog README
 PLIST_FILES=	bin/${PORTNAME}
 MAN1=		w_scan.1
Index: net/afpfs-ng/Makefile
===================================================================
--- net/afpfs-ng/Makefile	(revision 325747)
+++ net/afpfs-ng/Makefile	(working copy)
@@ -17,7 +17,7 @@
 
 USE_BZIP2=	yes
 USE_GCC=	any
-USE_GMAKE=	yes
+USES=		gmake
 USE_AUTOTOOLS=	aclocal autoheader automake autoconf libtoolize
 ACLOCAL_ARGS=	-I.
 AUTOMAKE_ARGS=	--add-missing
@@ -53,7 +53,9 @@
 		${WRKSRC}/Makefile.am
 
 post-configure: .SILENT
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	${REINPLACE_CMD} 's|LIBS = |LIBS = -liconv |' \
 		${WRKSRC}/cmdline/Makefile
+.endif
 
 .include <bsd.port.post.mk>
Index: net/xmlrpc-epi/Makefile
===================================================================
--- net/xmlrpc-epi/Makefile	(revision 325747)
+++ net/xmlrpc-epi/Makefile	(working copy)
@@ -11,15 +11,14 @@
 
 LICENSE=	MIT
 
-LIB_DEPENDS=	expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2
 
-USES=		iconv
+USES=		gmake iconv
 USE_AUTOTOOLS=	libtool
 USE_BZIP2=	yes
-USE_GMAKE=	yes
 USE_LDCONFIG=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ARGS=	--program-transform="s|^|xre-|"
 
 PORTDOCS=	AUTHORS ChangeLog NEWS README
@@ -31,6 +30,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 post-install:
 .if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
Index: net-im/libpurple/Makefile
===================================================================
--- net-im/libpurple/Makefile	(revision 325747)
+++ net-im/libpurple/Makefile	(working copy)
@@ -13,7 +13,7 @@
 COMMENT?=	Backend library for the Pidgin multi-protocol messaging client
 
 USE_BZIP2=	yes
-USE_GMAKE=	yes
+USES=		gmake
 USE_GNOME?=	gnomeprefix gnomehack intlhack glib20 libxml2
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS?=--disable-gtkui \
@@ -29,7 +29,7 @@
 .if !defined(PIDGIN_SLAVE)
 # Pidgin slave ports that require the following functionality, must explicitly
 # set these macros themselves.
-USES=		gettext iconv
+USES+=		gettext iconv
 USE_LDCONFIG=	yes
 WANT_GNOME=	yes
 USE_PYTHON=	yes
@@ -307,6 +307,7 @@
 .endif
 
 post-patch:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e 's|-lpthreads|${PTHREAD_LIBS:S/"//g}|g' \
 		-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 		-e 's|-lpanel |-lpanel -lncurses|g' \
@@ -315,6 +316,16 @@
 		-e 's|TCL_VERSION found but 8.3 required|TCL_VERSION found but ${TCLTK_VER} required|g' \
 		-e 's|TCL_MINOR_VERSION" -ne 3|TCL_MINOR_VERSION" -ne ${TCLTK_VER:E}|' \
 			${WRKSRC}/configure
+.else
+	@${REINPLACE_CMD} -e 's|-lpthreads|${PTHREAD_LIBS:S/"//g}|g' \
+		-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
+		-e 's|-lpanel |-lpanel -lncurses|g' \
+		-e 's|-lpthread|${PTHREAD_LIBS:S/"//g}|g' \
+		-e 's|-lsilc -lsilcclient ${PTHREAD_LIBS} $$LIBDL|-lsilc -lsilcclient ${PTHREAD_LIBS}|' \
+		-e 's|TCL_VERSION found but 8.3 required|TCL_VERSION found but ${TCLTK_VER} required|g' \
+		-e 's|TCL_MINOR_VERSION" -ne 3|TCL_MINOR_VERSION" -ne ${TCLTK_VER:E}|' \
+			${WRKSRC}/configure
+.endif
 	@${REINPLACE_CMD} -e 's|/bin/bash|${SH}|' \
 			${WRKSRC}/libpurple/purple-send \
 			${WRKSRC}/libpurple/purple-send-async
Index: net-im/licq/Makefile
===================================================================
--- net-im/licq/Makefile	(revision 325747)
+++ net-im/licq/Makefile	(working copy)
@@ -10,7 +10,7 @@
 MAINTAINER=	dinoex at FreeBSD.org
 COMMENT=	A popular ICQ-compatible plugin-based program
 
-LIB_DEPENDS=	boost_regex:${PORTSDIR}/devel/boost-libs
+LIB_DEPENDS=	libboost_regex.so:${PORTSDIR}/devel/boost-libs
 
 LICENSE=	GPLv2
 
@@ -19,7 +19,6 @@
 LICQ_PORT?=	net-im/licq
 
 # workaround for installed autoconf/automake
-LDFLAGS+=	${PTHREAD_LIBS} -L${LOCALBASE}/lib -liconv -Wl,--export-dynamic
 CPPFLAGS+=	-I${LOCALBASE}/include
 CFLAGS+=	-I${LOCALBASE}/include
 CXXFLAGS+=	-Wl,--export-dynamic
@@ -31,6 +30,11 @@
 .endif
 
 .include <bsd.port.options.mk>
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	${PTHREAD_LIBS} -L${LOCALBASE}/lib -liconv -Wl,--export-dynamic
+.else
+LDFLAGS+=	${PTHREAD_LIBS} -L${LOCALBASE}/lib -Wl,--export-dynamic
+.endif
 
 .if ${PORT_OPTIONS:MNLS}
 CMAKE_ARGS+=	-DENABLE_NLS:BOOL=OFF
Index: net-im/ysm/Makefile
===================================================================
--- net-im/ysm/Makefile	(revision 325747)
+++ net-im/ysm/Makefile	(working copy)
@@ -16,14 +16,19 @@
 USES=		iconv gmake
 USE_BZIP2=	yes
 GNU_CONFIGURE=	yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 
 MAN1=		ysm.1
 PLIST_FILES=	bin/ysm
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e \
 		's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: news/pan/Makefile
===================================================================
--- news/pan/Makefile	(revision 325747)
+++ news/pan/Makefile	(working copy)
@@ -18,12 +18,11 @@
 		gmime-2.6:${PORTSDIR}/mail/gmime26
 
 USE_BZIP2=	yes
-USE_GMAKE=	yes
-USES=		pathfix gettext
+USES=		gmake pathfix gettext
 USE_GNOME=	intlhack
 GNU_CONFIGURE=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -lgnuregex -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib -lgnuregex
 
 OPTIONS_DEFINE=	GTKSPELL GTK3
 OPTIONS_DEFAULT=GTKSPELL
@@ -32,6 +31,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 .if ${PORT_OPTIONS:MGTK3}
 USE_GNOME+=	gtk30
 CONFIGURE_ARGS+=--with-gtk3
Index: print/gv/Makefile
===================================================================
--- print/gv/Makefile	(revision 325747)
+++ print/gv/Makefile	(working copy)
@@ -10,17 +10,15 @@
 MAINTAINER=	bf at FreeBSD.org
 COMMENT=	A PostScript and PDF previewer
 
-LIB_DEPENDS=	Xaw3d:${PORTSDIR}/x11-toolkits/Xaw3d
+LIB_DEPENDS=	libXaw3d.so:${PORTSDIR}/x11-toolkits/Xaw3d
 
 USE_XORG=	xpm ice sm xext xmu x11
 USE_GHOSTSCRIPT=	yes
-USE_GMAKE=	yes
-USES=		iconv
-USE_PERL5_BUILD=	yes
+USES=		gmake iconv perl5
+USE_PERL5=	build
 GNU_CONFIGURE=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
-CONFIGURE_ENV +=	LDFLAGS="${LDFLAGS}" LIBS="-liconv"
 CONFIGURE_ARGS+=	--libdir=${PREFIX}/lib/X11 \
 			--enable-setenv-code \
 			--enable-SIGCHLD-fallback
@@ -35,7 +33,13 @@
 PLIST_DIRS=	%%DATADIR%%/safe-gs-workdir \
 		%%DATADIR%%
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV +=	LDFLAGS="${LDFLAGS}" LIBS="-liconv"
+.endif
+
 post-install:
 	@${TOUCH} ${DATADIR}/safe-gs-workdir/.keep_me
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: print/pdftk/Makefile
===================================================================
--- print/pdftk/Makefile	(revision 325747)
+++ print/pdftk/Makefile	(working copy)
@@ -21,8 +21,7 @@
 CSUFF=		${_USE_GCC:S/.//}
 
 USE_GCC=	yes
-USE_GMAKE=	yes
-USES=		iconv
+USES=		gmake iconv
 USE_LDCONFIG=	${PREFIX}/lib/gcc${CSUFF}
 
 # gcj/libgcj don't exist on some platforms
@@ -39,6 +38,8 @@
 MAN1=		${PORTNAME}.1
 PLIST_FILES=	bin/pdftk
 
+.include <bsd.port.pre.mk>
+
 post-patch:
 	@${REINPLACE_CMD} -e "s|TOOLPATH=|TOOLPATH=${LOCALBASE}/bin/|g" ${WRKSRC}/${MAKEFILE}
 	@${REINPLACE_CMD} -e "s|VERSUFF=|VERSUFF=${CSUFF}|g" ${WRKSRC}/${MAKEFILE}
@@ -52,11 +53,16 @@
 #
 
 	@${REINPLACE_CMD} -e "s|GCJFLAGS=|GCJFLAGS= -L${LOCALBASE}/lib -Wl,-rpath=${LOCALBASE}/lib/gcc${CSUFF} -w|g" ${WRKSRC}/${MAKEFILE}
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -e "s|LDLIBS= -lgcj|LDLIBS= -lgcj ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} -liconv -lz -L${LOCALBASE}/lib -Wl,-rpath=${LOCALBASE}/lib/gcc${CSUFF} -w|g" \
 			${WRKSRC}/${MAKEFILE}
+.else
+	@${REINPLACE_CMD} -e "s|LDLIBS= -lgcj|LDLIBS= -lgcj ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} -lz -L${LOCALBASE}/lib -Wl,-rpath=${LOCALBASE}/lib/gcc${CSUFF} -w|g" \
+			${WRKSRC}/${MAKEFILE}
+.endif
 
 do-install:
 	@${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
 	@${INSTALL_MAN} ${WRKSRC}/../${PORTNAME}.1 ${PREFIX}/man/man1
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: security/tpm-tools/Makefile
===================================================================
--- security/tpm-tools/Makefile	(revision 325747)
+++ security/tpm-tools/Makefile	(working copy)
@@ -15,7 +15,7 @@
 LICENSE_FILE=	${WRKSRC}/LICENSE
 LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
-LIB_DEPENDS=	tspi:${PORTSDIR}/security/trousers
+LIB_DEPENDS=	libtspi.so:${PORTSDIR}/security/trousers
 BUILD_DEPENDS=	pkcsconf:${PORTSDIR}/security/opencryptoki
 RUN_DEPENDS=	${LOCALBASE}/sbin/tcsd:${PORTSDIR}/security/trousers \
 		${LOCALBASE}/lib/pkcs11/libopencryptoki.so:${PORTSDIR}/security/opencryptoki
@@ -24,7 +24,7 @@
 USE_LDCONFIG=	YES
 USE_AUTOTOOLS=	autoconf
 GNU_CONFIGURE=	YES
-LDFLAGS+=	-L${LOCALBASE}/lib -lintl -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib -lintl
 
 MAN1=		tpm_sealdata.1 tpm_version.1				\
 		tpmtoken_import.1 tpmtoken_init.1 tpmtoken_objects.1	\
@@ -38,4 +38,10 @@
 		tpm_setclearable.8 tpm_setenable.8 tpm_setoperatorauth.8 \
 		tpm_setownable.8 tpm_setpresence.8 tpm_takeownership.8
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
+.include <bsd.port.post.mk>
Index: sysutils/fusefs-gunzip/Makefile
===================================================================
--- sysutils/fusefs-gunzip/Makefile	(revision 325747)
+++ sysutils/fusefs-gunzip/Makefile	(working copy)
@@ -16,14 +16,24 @@
 
 NO_INSTALL_MANPAGES=	yes
 
+.include <bsd.port.pre.mk>
+
 do-build:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	(cd ${WRKSRC} && \
 	${CC} ${CFLAGS} -I${LOCALBASE}/include -I${LOCALBASE}/include/fuse \
 	-D_FILE_OFFSET_BITS=64 \
 	-o fuse.gunzip fuse.gunzip.c -L${LOCALBASE}/lib \
 	-lulockmgr -lz -lfuse -liconv -lm)
+.else
+	(cd ${WRKSRC} && \
+	${CC} ${CFLAGS} -I${LOCALBASE}/include -I${LOCALBASE}/include/fuse \
+	-D_FILE_OFFSET_BITS=64 \
+	-o fuse.gunzip fuse.gunzip.c -L${LOCALBASE}/lib \
+	-lulockmgr -lz -lfuse -lm)
+.endif
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/fuse.gunzip ${PREFIX}/bin
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: sysutils/libcdio/Makefile
===================================================================
--- sysutils/libcdio/Makefile	(revision 325747)
+++ sysutils/libcdio/Makefile	(working copy)
@@ -11,20 +11,18 @@
 MAINTAINER=	arved at FreeBSD.org
 COMMENT=	Compact Disc Input and Control Library
 
-LIB_DEPENDS=	cddb.4:${PORTSDIR}/audio/libcddb \
-		cdda_paranoia.0:${PORTSDIR}/audio/cdparanoia
+LIB_DEPENDS=	libcddb.so:${PORTSDIR}/audio/libcddb \
+		libcdda_paranoia.so:${PORTSDIR}/audio/cdparanoia
 
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/COPYING
 
 GNU_CONFIGURE=	yes
-USES=		pathfix pkgconfig iconv ncurses
-USE_GMAKE=	yes
+USES=		gmake pathfix pkgconfig iconv ncurses perl5
+USE_PERL5=	build
 USE_LDCONFIG=	yes
 CONFIGURE_ARGS+=--with-libiconv-prefix=${LOCALBASE}
-USE_PERL5_BUILD=yes
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 MAN1=	cd-drive.1 cd-info.1 iso-read.1 iso-info.1 cd-read.1
 
 INFO=		libcdio
@@ -31,6 +29,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 _MANLANG=	"" ja
 _MAN1=	cd-paranoia.1
 .for lang in ${_MANLANG}
Index: sysutils/mapchan/Makefile
===================================================================
--- sysutils/mapchan/Makefile	(revision 325747)
+++ sysutils/mapchan/Makefile	(working copy)
@@ -14,7 +14,7 @@
 WRKSRC=		${WRKDIR}/${PORTNAME}
 MAKE_ENV=	MAPDIR=${PREFIX}/etc/${PORTNAME}
 CFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 ETCDAT=		*.map default.sample
 MAN8=		mapchan.8
 PORTDOCS=	README
@@ -25,6 +25,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 post-install:
 .if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
Index: textproc/exempi/Makefile
===================================================================
--- textproc/exempi/Makefile	(revision 325747)
+++ textproc/exempi/Makefile	(working copy)
@@ -1,10 +1,6 @@
-# New ports collection makefile for:	exempi
-# Date created:		2008-02-26
-# Whom:			Michael Johnson <ahze at FreeBSD.org>
-#
+# Created by: Michael Johnson <ahze at FreeBSD.org>
 # $FreeBSD$
 #   $MCom: ports/textproc/exempi/Makefile,v 1.1 2008/02/26 18:50:26 ahze Exp $
-#
 
 PORTNAME=	exempi
 PORTVERSION=	2.1.1
@@ -14,19 +10,24 @@
 MAINTAINER=	gnome at FreeBSD.org
 COMMENT=	A port of Adobe XMP SDK to work on UNIX
 
-LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2
 
 USE_AUTOTOOLS=	libtool
 USE_GNOME=	ltverhack
 CONFIGURE_ARGS=	--enable-unittest=no
+USES=		pathfix iconv
+USE_LDCONFIG=	yes
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ENV=	LIBS="-liconv"
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
-USES=		pathfix iconv
-USE_LDCONFIG=	yes
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|$${libdir}/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
 		${WRKSRC}/configure
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: textproc/freexl/Makefile
===================================================================
--- textproc/freexl/Makefile	(revision 325747)
+++ textproc/freexl/Makefile	(working copy)
@@ -10,16 +10,20 @@
 COMMENT=	Library to extract valid data from within an Excel (.xls) spreadsheet
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
-USES=		iconv
+USES=		gmake iconv
 
+USE_LDCONFIG=	yes
+
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 CONFIGURE_ARGS+=CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
-USE_LDCONFIG=	yes
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|g' \
 		${WRKSRC}/Makefile.in
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: textproc/kmflcomp/Makefile
===================================================================
--- textproc/kmflcomp/Makefile	(revision 325747)
+++ textproc/kmflcomp/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:    kmflcomp
-# Date created:		10 October 2007
-# Whom:			Nikola Lecic <nikola.lecic at anthesphoria.net>
-#
+# Created by: Nikola Lecic <nikola.lecic at anthesphoria.net>
 # $FreeBSD$
-#
 
 PORTNAME=	kmflcomp
 PORTVERSION=	0.9.9
@@ -25,8 +21,6 @@
 USE_LDCONFIG=	yes
 USES=		iconv
 GNU_CONFIGURE=	yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 
 DOCSDIR=	${PREFIX}/share/doc/kmfl/${PORTNAME}
 DOCS=		${DISTDIR}/${DIST_SUBDIR}/KMFL-Compiler.sxw \
@@ -36,6 +30,13 @@
 
 SUB_FILES=	pkg-message
 
+.include <bsd.port.options.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|^install-data-am: install-kmflcompdocDATA|install-data-am:|' \
 		${WRKSRC}/Makefile.in
@@ -45,7 +46,7 @@
 		${WRKSRC}/kmfl_compiler/kmfl_compiler.c
 
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}
 	@${INSTALL_DATA} -v ${DOCS} ${DOCSDIR}
 .endif
Index: textproc/p5-XML-Sablotron/Makefile
===================================================================
--- textproc/p5-XML-Sablotron/Makefile	(revision 325747)
+++ textproc/p5-XML-Sablotron/Makefile	(working copy)
@@ -10,12 +10,11 @@
 MAINTAINER=	perl at FreeBSD.org
 COMMENT=	Perl interface to the Sablotron XSLT processor
 
-LIB_DEPENDS=	sablot.70:${PORTSDIR}/textproc/sablotron
+LIB_DEPENDS=	libsablot.so:${PORTSDIR}/textproc/sablotron
 
 USES=		iconv perl5
 USE_PERL5=	configure
-CONFIGURE_ARGS=	LIBS='-L${LOCALBASE}/lib -lexpat -lsablot -liconv' \
-		INC='-I${LOCALBASE}/include' \
+CONFIGURE_ARGS=	INC='-I${LOCALBASE}/include' \
 		EXPATLIBPATH='${LOCALBASE}/lib' \
 		EXPATINCPATH='${LOCALBASE}/include' \
 		SABLOTLIBPATH='${LOCALBASE}/lib' \
@@ -26,7 +25,15 @@
 		XML::Sablotron::Situation::DOMHandlerDispatcher.3
 
 .include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ARGS+=	LIBS='-L${LOCALBASE}/lib -lexpat -lsablot -liconv'
+.else
+CONFIGURE_ARGS+=	LIBS='-L${LOCALBASE}/lib -lexpat -lsablot'
+.endif
+
 .if ${PERL_LEVEL} > 501400
 BROKEN=	POLLUTE is gone, does not compile, no release since 2005, textproc/p5-XML-SAXDriver-Sablotron&www/p5-HTML-Webmake depend on me
 .endif
+
 .include <bsd.port.post.mk>
Index: textproc/sablotron/Makefile
===================================================================
--- textproc/sablotron/Makefile	(revision 325747)
+++ textproc/sablotron/Makefile	(working copy)
@@ -9,7 +9,7 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	XML toolkit implementing XSLT 1.0, XPath 1.0 and DOM Level2
 
-LIB_DEPENDS=	expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2
 
 OPTIONS_DEFINE=	DISABLE_META ICONV_TYPECAST DOM DOCUMENT_ERRORS CHECK_LEAKS DEBUGGER DOCS
 DISABLE_META_DESC=	Do not output the META html tag
@@ -36,10 +36,9 @@
 
 CONFIGURE_ENV=	LIBTOOL=${LIBTOOL}
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -lexpat -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib -lexpat
 USE_AUTOTOOLS=	libtool
-USE_GMAKE=	yes
-USES=		iconv perl5
+USES=		gmake iconv perl5
 GNU_CONFIGURE=	yes
 USE_PERL5=	build patch
 
@@ -47,6 +46,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 DOCSLIST=	README README_JS RELEASE doc/misc/DEBUGGER doc/misc/NOTES
 
 post-patch:
Index: textproc/unrtf/Makefile
===================================================================
--- textproc/unrtf/Makefile	(revision 325747)
+++ textproc/unrtf/Makefile	(working copy)
@@ -26,8 +26,12 @@
 		%%DATADIR%%/vt.conf
 PLIST_DIRS=	%%DATADIR%%
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
 
 post-patch:
 	@${FIND} -X ${WRKSRC} -type f -and -name "*.[1h]" | ${XARGS} \
@@ -39,4 +43,4 @@
 check regression-test test: build
 	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} check)
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: textproc/xalan-c/Makefile
===================================================================
--- textproc/xalan-c/Makefile	(revision 325747)
+++ textproc/xalan-c/Makefile	(working copy)
@@ -46,35 +46,35 @@
 WRKSRC=			${WRKDIR}/xml-xalan/c
 
 USE_GMAKE=		yes
-MAKE_ENV+=		XALANCROOT=${WRKSRC}
-MAKE_ENV+=		XERCESCROOT=${XERCESCROOT}
+MAKE_ENV+=		XALANCROOT=${WRKSRC} \
+			XERCESCROOT=${XERCESCROOT}
 
 HAS_CONFIGURE=		yes
 CONFIGURE_SCRIPT=	runConfigure
-CONFIGURE_ENV+=		XALANCROOT=${WRKSRC}
-CONFIGURE_ENV+=		XERCESCROOT=${XERCESCROOT}
-CONFIGURE_ENV+=		PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+CONFIGURE_ENV+=		XALANCROOT=${WRKSRC} \
+			XERCESCROOT=${XERCESCROOT} \
+			PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 			PTHREAD_LIBS="${PTHREAD_LIBS}"
 CONFIGURE_ARGS+=	-p freebsd -c ${CC} -x ${CXX} -l ${PTHREAD_LIBS} \
-				-z ${EXTRA_CFLAGS} -I${LOCALBASE}/include -C --prefix=${PREFIX}
+			-z ${EXTRA_CFLAGS} -I${LOCALBASE}/include -C --prefix=${PREFIX}
 
 .if ${PORT_OPTIONS:MICULOC}
 CONFIGURE_ARGS+=	-m icu
-PLIST_SUB+=		LOCALSYS_INMEMLOC=""
-PLIST_SUB+=		LOCALSYS_NLSLOC="@comment "
+PLIST_SUB+=		LOCALSYS_INMEMLOC="" \
+			LOCALSYS_NLSLOC="@comment "
 PORT_OPTIONS+=		TRANSCODER_ICU
 .endif
 
 .if ${PORT_OPTIONS:MNLSLOC}
 CONFIGURE_ARGS+=	-m nls
-PLIST_SUB+=		LOCALSYS_INMEMLOC="@comment "
-PLIST_SUB+=		LOCALSYS_NLSLOC=""
+PLIST_SUB+=		LOCALSYS_INMEMLOC="@comment " \
+			LOCALSYS_NLSLOC=""
 .endif
 
 .if ${PORT_OPTIONS:MINMEMLOC}
 CONFIGURE_ARGS+=	-m inmem
-PLIST_SUB+=		LOCALSYS_INMEMLOC=""
-PLIST_SUB+=		LOCALSYS_NLSLOC="@comment "
+PLIST_SUB+=		LOCALSYS_INMEMLOC="" \
+			LOCALSYS_NLSLOC="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MTRANSCODER_ICU}
@@ -81,15 +81,17 @@
 PKGNAMESUFFIX+=		-icu
 LIB_DEPENDS+=		icuuc:${PORTSDIR}/devel/icu
 ICUROOT?=		${LOCALBASE}
-CONFIGURE_ENV+=		XALAN_USE_ICU=1
-CONFIGURE_ENV+=		ICUROOT=${ICUROOT}
+CONFIGURE_ENV+=		XALAN_USE_ICU=1 \
+			ICUROOT=${ICUROOT}
 CONFIGURE_ARGS+=	-t icu
-MAKE_ENV+=		XALAN_USE_ICU=1
-MAKE_ENV+=		ICUROOT=${ICUROOT}
+MAKE_ENV+=		XALAN_USE_ICU=1 \
+			ICUROOT=${ICUROOT}
 PLIST_SUB+=		ICUDEP=""
 .else
 USES+=			iconv
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 LDFLAGS+=		-L${LOCALBASE}/lib -liconv
+.endif
 PLIST_SUB+=		ICUDEP="@comment "
 .endif
 
@@ -110,8 +112,8 @@
 XALANC_LIB=		libxalan-c.so.${PORTVERSION:S/.//}
 XALANMSG_LIB=		libxalanMsg.so.${PORTVERSION:S/.//}
 PLIST_SUB+=		XALANC_LIB=${XALANC_LIB} \
-				XALANMSG_LIB=${XALANMSG_LIB} \
-				XALANC_LIB_VERSION=${XALANC_LIB_VERSION}
+			XALANMSG_LIB=${XALANMSG_LIB} \
+			XALANC_LIB_VERSION=${XALANC_LIB_VERSION}
 
 .if ${PORT_OPTIONS:MEXAMPLES}
 ALL_TARGET?=	all samples
@@ -122,9 +124,7 @@
 		XalanTransform XalanTransformerCallback ThreadSafe
 .endif
 
-.if ${PORT_OPTIONS:MDOCS}
 PORTDOCS=	*
-.endif
 
 post-patch:
 	${RM} -f ${WRKSRC}/src/xalanc/ICUBridge/ICUFormatNumberFunctor.hpp.orig \
Index: textproc/xmlppm/Makefile
===================================================================
--- textproc/xmlppm/Makefile	(revision 325747)
+++ textproc/xmlppm/Makefile	(working copy)
@@ -1,10 +1,5 @@
-# ex:ts=8
-# New ports collection makefile for:	xmlppm
-# Date created:			May 15, 2001
-# Whom:				ijliao
-#
+# Created by: ijliao
 # $FreeBSD$
-#
 
 PORTNAME=	xmlppm
 PORTVERSION=	0.98.3
@@ -12,29 +7,32 @@
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-src/${PORTVERSION} \
 		http://www.cs.cornell.edu/People/jcheney/xmlppm/
 
-
 MAINTAINER=	hsmtkk at gmail.com
 COMMENT=	XML-Conscious PPM Compression
 
-LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2
 
-USES=		iconv
-USE_GMAKE=	yes
+USES=		gmake iconv
 MAKE_ARGS=	CC="${CXX}" CFLAGS="${CXXFLAGS}" \
-		CPPFLAGS="-I${LOCALBASE}/include" \
-		LDFLAGS="-L${LOCALBASE}/lib -lexpat -liconv"
+		CPPFLAGS="-I${LOCALBASE}/include"
 GNU_CONFIGURE=	yes
 
-.if !defined(NOPORTDOCS)
 PORTDOCS=	README
-.endif
 
 PLIST_FILES=	bin/xmlppm bin/xmlunppm
 
+.include <bsd.port.options.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+MAKE_ARGS+=	LDFLAGS="-L${LOCALBASE}/lib -lexpat -liconv"
+.else
+MAKE_ARGS+=	LDFLAGS="-L${LOCALBASE}/lib -lexpat"
+.endif
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/xmlppm ${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKSRC}/src/xmlunppm ${PREFIX}/bin
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
 .endif
Index: www/sarg/Makefile
===================================================================
--- www/sarg/Makefile	(revision 325747)
+++ www/sarg/Makefile	(working copy)
@@ -19,7 +19,7 @@
 PHP_DESC=	Install PHP for reporting generating
 
 USE_AUTOTOOLS=	autoconf aclocal
-USE_GMAKE=	yes
+USES=		gmake
 GNU_CONFIGURE=	yes
 LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ARGS=	CPPFLAGS=-I${LOCALBASE}/include \
@@ -72,7 +72,9 @@
 .if ${PORT_OPTIONS:MICONV}
 CONFIGURE_ARGS+=--with-iconv
 USES+=	iconv
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 EXTRA_LDFLAGS+=	-liconv
+.endif
 .else
 CONFIGURE_ARGS+=--without-iconv
 .endif
Index: www/webalizer/Makefile
===================================================================
--- www/webalizer/Makefile	(revision 325747)
+++ www/webalizer/Makefile	(working copy)
@@ -129,9 +129,11 @@
 #	see http://tyche.pu-toyama.ac.jp/~a-urasim/webalizer/
 EXTRA_PATCHES+=		${FILESDIR}/webalizer-a-urasim_2.patch
 CONFIGURE_ARGS+=	--enable-mininls
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ENV+=		LIBS="-L${LOCALBASE}/lib -liconv"
 CFLAGS+=		-I${LOCALBASE}/include
 .endif
+.endif
 
 .if ${PORT_OPTIONS:MFULL_CGI_REFS}
 CFLAGS+=	-DUSE_FULL_CGI_REFS
Index: x11/gdkxft/Makefile
===================================================================
--- x11/gdkxft/Makefile	(revision 325747)
+++ x11/gdkxft/Makefile	(working copy)
@@ -10,13 +10,13 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	An anti-aliased font support for gtk+
 
-LIB_DEPENDS=	Xft.2:${PORTSDIR}/x11-fonts/libXft
+LIB_DEPENDS=	libXft.so:${PORTSDIR}/x11-fonts/libXft
 
 USE_AUTOTOOLS=	libtool
 USE_GNOME=	gtk12
 USES=		iconv
 GNU_CONFIGURE=	yes
-LDFLAGS+=	-L${LOCALBASE}/lib -lgnuregex -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib -lgnuregex
 CFLAGS+=	`pkg-config xft --cflags`
 CONFIGURE_ARGS=	--sbindir=${PREFIX}/bin \
 		--without-gnome
@@ -26,6 +26,10 @@
 
 .include <bsd.port.options.mk>
 
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|gtk-config --prefix|$$GTK_CONFIG --prefix|g ; \
 		 s|libgdk.la|libgdk-12.so|g ; \
Index: x11/i3lock/Makefile
===================================================================
--- x11/i3lock/Makefile	(revision 325747)
+++ x11/i3lock/Makefile	(working copy)
@@ -27,10 +27,15 @@
 
 MAN1=	i3lock.1
 
-LDFLAGS+=	-liconv
 USE_XORG=	x11 xcb xt xproto xext
 USE_BZIP2=	yes
 USE_GMAKE=	yes
-USES=		iconv
+USES=		gmake iconv
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
+.include <bsd.port.post.mk>
Index: x11-fm/nautilus/Makefile
===================================================================
--- x11-fm/nautilus/Makefile	(revision 325747)
+++ x11-fm/nautilus/Makefile	(working copy)
@@ -13,22 +13,20 @@
 COMMENT?=	File manager for the GNOME desktop
 
 BUILD_DEPENDS=	g-ir-compiler:${PORTSDIR}/devel/gobject-introspection
-LIB_DEPENDS=	exif:${PORTSDIR}/graphics/libexif \
-		unique-1.0:${PORTSDIR}/x11-toolkits/unique \
-		exempi:${PORTSDIR}/textproc/exempi
+LIB_DEPENDS=	libexif.so:${PORTSDIR}/graphics/libexif \
+		libunique-1.0.so:${PORTSDIR}/x11-toolkits/unique \
+		libexempi.so:${PORTSDIR}/textproc/exempi
 
 CONFLICTS=	nautilus-3.[0-9]*
 
 INSTALLS_ICONS=	yes
 USE_BZIP2=	yes
-USE_GMAKE=	yes
-USES=		gettext desktop-file-utils shared-mime-info
+USES=		gmake gettext desktop-file-utils shared-mime-info
 USE_GNOME=	gnomeprefix gnomehack intlhack gnomedesktop \
 		librsvg2 ltverhack gvfs ltasneededhack
 USE_LDCONFIG=	yes
 USE_AUTOTOOLS=	libtool
-CONFIGURE_ENV=	LIBS="${PTHREAD_LIBS} -L${LOCALBASE}/lib -liconv" \
-		LIBPNG="-L${LOCALBASE}/lib -lpng -lz"
+CONFIGURE_ENV=	LIBPNG="-L${LOCALBASE}/lib -lpng -lz"
 CPPFLAGS+=	-I${LOCALBASE}/include
 CONFIGURE_ARGS=	--enable-static --disable-packagekit
 MAKE_ENV=	G_CHARSET_ALIAS="${LOCALBASE}/libdata/charset.alias"
@@ -38,6 +36,14 @@
 MAN1=		nautilus-connect-server.1 nautilus-file-management-properties.1 \
 		nautilus.1
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CONFIGURE_ENV+=	LIBS="${PTHREAD_LIBS} -L${LOCALBASE}/lib -liconv"
+.else
+CONFIGURE_ENV+=	LIBS="${PTHREAD_LIBS}"
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|G_CONST_RETURN|const|g' \
 		${WRKSRC}/eel/eel-*.[ch] \
@@ -49,4 +55,4 @@
 post-install:
 	@${MKDIR} ${PREFIX}/lib/nautilus/extensions-2.0
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: x11-toolkits/open-motif/Makefile
===================================================================
--- x11-toolkits/open-motif/Makefile	(revision 325747)
+++ x11-toolkits/open-motif/Makefile	(working copy)
@@ -30,7 +30,6 @@
 USE_LDCONFIG=	yes
 MAKE_ENV=	LANG=C
 CPPFLAGS+=	-DCSRG_BASED -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI -I${PREFIX}/include
-LDFLAGS+=	-L${PREFIX}/lib -liconv
 USE_CSTD=	gnu89
 
 DEMOS_SRC=	${WRKSRC}/demos/programs
Index: x11-toolkits/wxgtk26/Makefile
===================================================================
--- x11-toolkits/wxgtk26/Makefile	(revision 325747)
+++ x11-toolkits/wxgtk26/Makefile	(working copy)
@@ -12,17 +12,16 @@
 MAINTAINER?=	fjoe at FreeBSD.org
 COMMENT?=	The wxWidgets GUI toolkit with GTK+ bindings
 
-LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png\
-		jpeg.11:${PORTSDIR}/graphics/jpeg\
-		tiff.4:${PORTSDIR}/graphics/tiff\
-		expat.6:${PORTSDIR}/textproc/expat2\
-		mspack.1:${PORTSDIR}/archivers/libmspack
+LIB_DEPENDS+=	libpng15.so:${PORTSDIR}/graphics/png \
+		libjpeg.so:${PORTSDIR}/graphics/jpeg \
+		libtiff.so:${PORTSDIR}/graphics/tiff \
+		libexpat.so:${PORTSDIR}/textproc/expat2 \
+		libmspack.so:${PORTSDIR}/archivers/libmspack
 
-USES=		iconv
+USES=		gmake iconv
 USE_BZIP2=	yes
 USE_XORG=	x11 sm xxf86vm xinerama
 USE_GL=		glu
-USE_GMAKE=	yes
 USE_GNOME=	gtk20 pangox-compat
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-libpng=sys\
@@ -38,7 +37,7 @@
 		PTHREAD_LIBS="${PTHREAD_LIBS}"\
 		X11BASE="${LOCALBASE}"
 CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+LDFLAGS+=	-L${LOCALBASE}/lib
 NO_LATEST_LINK=	yes
 PLIST=		${.CURDIR}/pkg-plist
 
@@ -71,6 +70,12 @@
 WX_UNICODE=	yes
 .endif
 
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+LDFLAGS+=	-liconv
+.endif
+
 pre-configure:
 	@${FIND} ${BUILD_WRKSRC} -name Makefile.in -print0 | ${XARGS} -0 ${REINPLACE_CMD} \
 		-e "s|@CXXFLAGS@|${CFLAGS} `${WX_CONFIG} --cxxflags`|" \
@@ -90,4 +95,4 @@
 		s|png_check_sig|png_sig_cmp|g' \
 			${WRKSRC}/configure
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: x11-wm/awesome2/Makefile
===================================================================
--- x11-wm/awesome2/Makefile	(revision 325747)
+++ x11-wm/awesome2/Makefile	(working copy)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:   awesome2
-# Date created:                February 26, 2009
-# Whom:                        Nikos Ntarmos <ntarmos at cs.uoi.gr>
-#
+# Created by: Nikos Ntarmos <ntarmos at cs.uoi.gr>
 # $FreeBSD$
-#
 
 PORTNAME=	awesome2
 PORTVERSION=	2.3.6
@@ -17,9 +13,9 @@
 
 BUILD_DEPENDS=	asciidoc:${PORTSDIR}/textproc/asciidoc \
 		xmlto:${PORTSDIR}/textproc/xmlto
-LIB_DEPENDS=	confuse.0:${PORTSDIR}/devel/libconfuse \
-		cairo.2:${PORTSDIR}/graphics/cairo \
-		freetype.9:${PORTSDIR}/print/freetype2
+LIB_DEPENDS=	libconfuse.so.0:${PORTSDIR}/devel/libconfuse \
+		libcairo.so.2:${PORTSDIR}/graphics/cairo \
+		libfreetype.so.9:${PORTSDIR}/print/freetype2
 
 USES=		iconv
 GNU_CONFIGURE=	yes
@@ -35,6 +31,8 @@
 PORTDOCS=	AUTHORS LICENSE README STYLE UPGRADE
 PORTEXAMPLES=	awesomerc
 
+.include <bsd.port.options.mk>
+
 post-patch:
 	@${REINPLACE_CMD} -e 's, "$$(DESTDIR)$$(docdir)";,;,g' \
 			  -e 's,\([[:space:]]\)install-docDATA ,\1,g' \
@@ -53,12 +51,17 @@
 .	endfor
 
 post-configure:
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 	@${REINPLACE_CMD} -E '/^awesome2_(message_)?LDADD/s/$$/ -liconv/g; \
 			      /^doc_DATA/s/=.*$$/=/g' \
 		${WRKSRC}/Makefile
+.else
+	@${REINPLACE_CMD} -E '/^doc_DATA/s/=.*$$/=/g' \
+		${WRKSRC}/Makefile
+.endif
 
 post-install:
-.	if !defined(NOPORTDOCS)
+.	if ${PORT_OPTIONS:MDOCS}
 		@${ECHO_MSG} "installing additional documentation to ${DOCSDIR}"
 		@${MKDIR} ${DOCSDIR}
 .		for doc in ${PORTDOCS}
@@ -65,7 +68,7 @@
 			${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
 .		endfor
 .	endif
-.	if !defined(NOPORTEXAMPLES)
+.	if ${PORT_OPTIONS:MEXAMPLES}
 		@${ECHO_MSG} "installing example config file to ${EXAMPLESDIR}"
 		@${MKDIR} ${EXAMPLESDIR}
 .		for example in ${PORTEXAMPLES}
Index: x11-wm/fluxbox/Makefile
===================================================================
--- x11-wm/fluxbox/Makefile	(revision 325747)
+++ x11-wm/fluxbox/Makefile	(working copy)
@@ -16,11 +16,11 @@
 RUN_DEPENDS=	xmessage:${PORTSDIR}/x11/xmessage
 
 USE_XORG=	xextproto xft xpm xrandr
-USE_GMAKE=	yes
+USES=		gmake
 WANT_GNOME=	yes
 GNU_CONFIGURE=	yes
 
-PORTDOCS=		AUTHORS ChangeLog NEWS README TODO
+PORTDOCS=	AUTHORS ChangeLog NEWS README TODO
 MAN1=		fbrun.1 fbsetbg.1 fbsetroot.1 fluxbox.1 \
 		startfluxbox.1 fluxbox-remote.1
 MAN5=		fluxbox-apps.5 fluxbox-keys.5 fluxbox-menu.5 \
@@ -79,7 +79,11 @@
 
 .if ${PORT_OPTIONS:MNLS}
 USES+=			iconv
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 CONFIGURE_ENV=		LIBS="-L${LOCALBASE}/lib -liconv"
+.else
+CONFIGURE_ENV=		LIBS="-L${LOCALBASE}/lib"
+.endif
 CPPFLAGS+=		-I${LOCALBASE}/include
 CONFIGURE_ARGS+=	--enable-nls
 PLIST_SUB+=		NLS=""
Index: x11-wm/pekwm/Makefile
===================================================================
--- x11-wm/pekwm/Makefile	(revision 325747)
+++ x11-wm/pekwm/Makefile	(working copy)
@@ -10,12 +10,11 @@
 MAINTAINER=	bapt at FreeBSD.org
 COMMENT=	Light, Unobtrusive, and configurable windowmanager
 
-LIB_DEPENDS=	jpeg:${PORTSDIR}/graphics/jpeg \
-		png15:${PORTSDIR}/graphics/png
+LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
+		libpng15.so:${PORTSDIR}/graphics/png
 
-USES=		pkgconfig iconv
+USES=		gmake pkgconfig iconv
 USE_XORG=	xft xpm x11
-USE_GMAKE=	yes
 USE_BZIP2=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=--enable-shape --enable-xinerama --enable-xrandr \
@@ -22,9 +21,14 @@
 		--enable-xft --enable-image-xpm --enable-image-jpeg \
 		--enable-image-png --disable-debug \
 		--disable-pedantic
-CFLAGS+=	-DICONV_CONST -I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -liconv
 MAN1=		pekwm.1
 MANCOMPRESSED=	no
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
+CFLAGS+=	-DICONV_CONST -I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib -liconv
+.endif
+
+.include <bsd.port.post.mk>
Index: x11-wm/wmii/Makefile
===================================================================
--- x11-wm/wmii/Makefile	(revision 325747)
+++ x11-wm/wmii/Makefile	(working copy)
@@ -10,7 +10,7 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Dynamic, minimalist window manager for X11
 
-LIB_DEPENDS=	ixp:${PORTSDIR}/devel/libixp
+LIB_DEPENDS=	libixp.so:${PORTSDIR}/devel/libixp
 RUN_DEPENDS=	dmenu:${PORTSDIR}/x11/dmenu
 
 CONFLICTS=	wmii-3.9*
@@ -32,7 +32,9 @@
 
 .if ${PORT_OPTIONS:MUTF8}
 USES+=		iconv
+.if !exists(/usr/include/iconv.h) && ${OSVERSION} < 1000043
 MAKE_ARGS+=	LIBICONV="-liconv"
+.endif
 .else
 MAKE_ARGS+=	-DNO_UTF8
 .endif


More information about the freebsd-java mailing list