summaryrefslogtreecommitdiffstats
path: root/include/Makefile
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2013-08-13 07:15:01 +0000
committerpeter <peter@FreeBSD.org>2013-08-13 07:15:01 +0000
commit995e1f0063b0515ed5821ebab3aff02dbbe44719 (patch)
tree9bba3bf02dbd5d242b50c29cd7221d5ae286e560 /include/Makefile
parentd9e76bbffc59d724ea0ffe9896012f4ac0859bc7 (diff)
downloadFreeBSD-src-995e1f0063b0515ed5821ebab3aff02dbbe44719.zip
FreeBSD-src-995e1f0063b0515ed5821ebab3aff02dbbe44719.tar.gz
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.
Diffstat (limited to 'include/Makefile')
-rw-r--r--include/Makefile18
1 files changed, 14 insertions, 4 deletions
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
OpenPOWER on IntegriCloud