From 995e1f0063b0515ed5821ebab3aff02dbbe44719 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 13 Aug 2013 07:15:01 +0000 Subject: The iconv in libc did two things - implement the standard APIs, the GNU extensions and also tried to be link time compatible with ports libiconv. This splits that functionality and enables the parts that shouldn't interfere with the port by default. WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker symbols and even a stub libiconv.so.3 that are good enough to be able to 'pkg delete -f libiconv' on a running system and reasonably expect it to work. I have tortured many machines over the last few days to try and reduce the possibilities of foot-shooting as much as I can. I've successfully recompiled to enable and disable the libiconv_compat modes, ports that use libiconv alongside system iconv etc. If you don't enable the WITH_LIBICONV_COMPAT switch, they don't share symbol space. This is an extension of behavior on other system. iconv(3) is a standard libc interface and libiconv port expects to be able to run alongside it on systems that have it. Bumped osreldate. --- include/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include/Makefile') diff --git a/include/Makefile b/include/Makefile index ae5ed7c..ba41814 100644 --- a/include/Makefile +++ b/include/Makefile @@ -72,10 +72,6 @@ _dev_ieee488= dev/ieee488 INCS+= hesiod.h .endif -.if ${MK_ICONV} != "no" -INCS+= iconv.h -.endif - .if ${MK_BLUETOOTH} != "no" LSUBSUBDIRS+= netgraph/bluetooth/include .endif @@ -85,6 +81,20 @@ LSUBSUBDIRS+= netgraph/bluetooth/include _netipx= netipx #.endif +# Handle the #define aliases for libiconv +.if ${MK_ICONV} == "yes" +CLEANFILES+= _libiconv_compat.h +INCS+= _libiconv_compat.h iconv.h +_libiconv_compat.h: ${.CURDIR}/Makefile + echo "/* Indicate whether libiconv symbols are present */" > _libiconv_compat.h +.if ${MK_LIBICONV_COMPAT} == "yes" + echo "#define __LIBICONV_COMPAT" >> _libiconv_compat.h +.else + echo "#undef __LIBICONV_COMPAT" >> _libiconv_compat.h +.endif +.endif + + # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is # probably only useful for developers and should be avoided if you do not -- cgit v1.1