From 2234273d6fc89a6e4a851192fc2897c700700fb7 Mon Sep 17 00:00:00 2001 From: John Marino Date: Wed, 27 Jan 2016 01:24:52 +0100 Subject: [PATCH] privatize libedit (used by numerous base programs) Besides affecting far more programs than the first two conversions, this privatization requires a modification to bin/sh which is a bootstrap program. If bootstrapping, it will use libedit.* if it exists, otherwise it will use libprivate_edit.*. After "make upgrade", /usr/lib/libedit will no longer be on the system so the private version will then be used in all cases. --- Makefile_upgrade.inc | 2 ++ bin/sh/Makefile | 13 ++++++++++--- gnu/sbin/lvm/Makefile | 2 +- lib/libedit/libedit/Makefile | 2 +- sbin/fsdb/Makefile | 2 +- sbin/vinum/Makefile | 3 +-- secure/usr.bin/sftp/Makefile | 2 +- share/initrd/bin/Makefile | 2 +- share/initrd/sbin.lvm/Makefile | 2 +- share/initrd/sbin/Makefile | 4 ++-- share/mk/bsd.libnames.mk | 2 +- usr.bin/bc/Makefile | 2 +- usr.bin/crunch/examples/filesystem.conf | 2 +- usr.bin/crunch/examples/fixit.conf | 2 +- usr.bin/crunch/examples/kcopy.conf | 2 +- usr.bin/crunch/examples/really-big.conf | 2 +- usr.bin/ftp/Makefile | 2 +- usr.bin/tftp/Makefile | 2 +- usr.bin/units/Makefile | 3 +-- usr.sbin/802_11/wpa_cli/Makefile | 2 +- usr.sbin/cdcontrol/Makefile | 3 +-- usr.sbin/lpr/lpc/Makefile | 3 +-- usr.sbin/pppctl/Makefile | 3 +-- 23 files changed, 34 insertions(+), 30 deletions(-) diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index d0aa70d128..ddccc8421b 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -2271,8 +2271,10 @@ TO_REMOVE+=/usr/games/piano TO_REMOVE+=/usr/share/man/man6/piano.6.gz TO_REMOVE+=/usr/games/hide/hangman TO_REMOVE+=/usr/lib/kgzldr.o +TO_REMOVE+=/usr/lib/libedit.* TO_REMOVE+=/usr/lib/libldns.* TO_REMOVE+=/usr/lib/libssh.* +TO_REMOVE+=/usr/lib/profile/libedit.a TO_REMOVE+=/usr/lib/profile/libldns.a TO_REMOVE+=/usr/lib/profile/libssh.a diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 76bba657fa..9a16db48bc 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -22,15 +22,22 @@ WARNS?= 2 # utilities of the same name are handled with the associated manpage, # builtin.1 in share/man/man1/. -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap - CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline .if defined(BOOTSTRAPPING) CFLAGS+= -DNO_HISTORY +. if exists(/usr/lib/libedit.a) +DPADD= /usr/lib/libedit.a ${LIBTERMCAP} +LDADD= -ledit -ltermcap +. else +DPADD= ${LIBEDIT} ${LIBTERMCAP} +LDADD= -lprivate_edit -ltermcap +. endif +.else +DPADD= ${LIBEDIT} ${LIBTERMCAP} +LDADD= -lprivate_edit -ltermcap .endif .PATH: ${.CURDIR}/bltin \ diff --git a/gnu/sbin/lvm/Makefile b/gnu/sbin/lvm/Makefile index a21974bd14..acfa7cd31e 100644 --- a/gnu/sbin/lvm/Makefile +++ b/gnu/sbin/lvm/Makefile @@ -131,7 +131,7 @@ MKLINKS+= lvchange.8 lvchange.1 \ vgscan.8 vgscan.1 \ vgsplit.8 vgsplit.1 -LDADD+= -llvm -ldevmapper -lprop -ledit -ltermcap -ldevattr +LDADD+= -llvm -ldevmapper -lprop -lprivate_edit -ltermcap -ldevattr DPADD+= ${LIBLVM} ${LIBDEVMAPPER} ${LIBPROP} ${LIBEDIT} ${LIBTERMCAP} DPADD+= ${LIBDEVATTR} diff --git a/lib/libedit/libedit/Makefile b/lib/libedit/libedit/Makefile index 64d3f38997..e6eeab11ab 100644 --- a/lib/libedit/libedit/Makefile +++ b/lib/libedit/libedit/Makefile @@ -1,7 +1,7 @@ # NETBSD's libedit (BSD replacement for GNU readline) .include "../Makefile.inc" -LIB= edit +LIB= private_edit SHLIB_MAJOR= 5 # NetBSD designates SHLIB_MAJOR as 3 SHLIBDIR?= /lib diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile index 3f756e456b..ab2cd7de5c 100644 --- a/sbin/fsdb/Makefile +++ b/sbin/fsdb/Makefile @@ -8,7 +8,7 @@ SRCS= fsdb.c fsdbutil.c \ dir.c inode.c memzone.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ pass5.c preen.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck -LDADD+= -ledit -ltermcap +LDADD+= -lprivate_edit -ltermcap DPADD+= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck ${.CURDIR}/../../sys/vfs/ufs WARNS?= 1 diff --git a/sbin/vinum/Makefile b/sbin/vinum/Makefile index 7a32719bb6..010055f803 100644 --- a/sbin/vinum/Makefile +++ b/sbin/vinum/Makefile @@ -1,5 +1,4 @@ # $FreeBSD: src/sbin/vinum/Makefile,v 1.12.2.2 2001/08/01 09:13:24 obrien Exp $ -# $DragonFly: src/sbin/vinum/Makefile,v 1.9 2007/07/22 22:46:09 corecode Exp $ PROG= vinum SRCS= v.c list.c vinumparser.c vinumutil.c vext.h commands.c @@ -8,6 +7,6 @@ WARNS?= 2 CFLAGS+= -I${.CURDIR}/../../lib/libedit -I${.CURDIR}/../../sys DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} -LDADD= -ledit -ltermcap -ldevstat +LDADD= -lprivate_edit -ltermcap -ldevstat .include diff --git a/secure/usr.bin/sftp/Makefile b/secure/usr.bin/sftp/Makefile index 47cb353e96..59a17fa3f3 100644 --- a/secure/usr.bin/sftp/Makefile +++ b/secure/usr.bin/sftp/Makefile @@ -8,7 +8,7 @@ WARNS?= 0 SRCS+= fmt_scaled.c DPADD+= ${LIBEDIT} ${LIBTERMCAP} -LDADD+= -ledit -ltermcap +LDADD+= -lprivate_edit -ltermcap .include "../../Makefile.ssh.common" .include diff --git a/share/initrd/bin/Makefile b/share/initrd/bin/Makefile index db79ef0d19..4b15e0c662 100644 --- a/share/initrd/bin/Makefile +++ b/share/initrd/bin/Makefile @@ -39,7 +39,7 @@ CRUNCH_PROGS_bin= \ sync \ test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lmd -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -lprivate_edit -lkvm -ll -lmd -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs diff --git a/share/initrd/sbin.lvm/Makefile b/share/initrd/sbin.lvm/Makefile index f7ef9bdc03..132adb14d1 100644 --- a/share/initrd/sbin.lvm/Makefile +++ b/share/initrd/sbin.lvm/Makefile @@ -79,7 +79,7 @@ SYMLINKS+= lvm ${BINDIR}/lvchange \ lvm ${BINDIR}/vgscan \ lvm ${BINDIR}/vgsplit -LDADD+= -llvm -ldevmapper -lprop -ledit -ltermcap -ldevattr +LDADD+= -llvm -ldevmapper -lprop -lprivate_edit -ltermcap -ldevattr DPADD+= ${LIBLVM} ${LIBDEVMAPPER} ${LIBPROP} ${LIBEDIT} ${LIBTERMCAP} DPADD+= ${LIBDEVATTR} diff --git a/share/initrd/sbin/Makefile b/share/initrd/sbin/Makefile index 50ba6efdc1..33735df0b7 100644 --- a/share/initrd/sbin/Makefile +++ b/share/initrd/sbin/Makefile @@ -67,8 +67,8 @@ CRUNCH_ALIAS_reboot= halt CRUNCH_ALIAS_shutdown= poweroff CRUNCH_ALIAS_swapon= swapoff swapctl -CRUNCH_LIBS+= -lcam -lsbuf -lutil -lkvm -lm -lmd -lhammer -lkiconv -ledit -CRUNCH_LIBS+= -ltermcap -ldevstat -lprop -lpthread +CRUNCH_LIBS+= -lcam -lsbuf -lutil -lkvm -lm -lmd -lhammer -lkiconv +CRUNCH_LIBS+= -lprivate_edit -ltermcap -ldevstat -lprop -lpthread CRUNCH_LIBS+= -lbsdxml -lipsec CRUNCH_SRCDIRS+= usr.sbin diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 020253f54a..deb4075cbd 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -30,7 +30,7 @@ LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a LIBDM?= ${DESTDIR}${LIBDIR}/libdm.a #LIBDMSG?= ${DESTDIR}${LIBDIR}/libdmsg.a -LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a +LIBEDIT?= ${DESTDIR}${LIBDIR}/libprivate_edit.a LIBEVTR?= ${DESTDIR}${LIBDIR}/libevtr.a LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a diff --git a/usr.bin/bc/Makefile b/usr.bin/bc/Makefile index 91e6ff348e..de59ec180e 100644 --- a/usr.bin/bc/Makefile +++ b/usr.bin/bc/Makefile @@ -6,7 +6,7 @@ CFLAGS+= -I. -I${.CURDIR} WARNS?= 3 DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +LDADD= -lprivate_edit -ltermcap SCRIPTS= bc.library SCRIPTSMODE= 444 diff --git a/usr.bin/crunch/examples/filesystem.conf b/usr.bin/crunch/examples/filesystem.conf index 96d7342146..fbe9bd36de 100644 --- a/usr.bin/crunch/examples/filesystem.conf +++ b/usr.bin/crunch/examples/filesystem.conf @@ -28,4 +28,4 @@ ln gzip zcat # /usr/sbin progs bad144 -libs -ll -ledit -ltermcap -lutil -lscrypt +libs -ll -lprivate_edit -ltermcap -lutil -lscrypt diff --git a/usr.bin/crunch/examples/fixit.conf b/usr.bin/crunch/examples/fixit.conf index 80a2346e34..103ab66ad9 100644 --- a/usr.bin/crunch/examples/fixit.conf +++ b/usr.bin/crunch/examples/fixit.conf @@ -42,4 +42,4 @@ ln gzip gzcat # finally, we specify the libraries to link in with our binary libs -lcrypt -ltelnet -lutil -ll -libs -lcurses -ltermcap -ledit -lkvm +libs -lcurses -ltermcap -lprivate_edit -lkvm diff --git a/usr.bin/crunch/examples/kcopy.conf b/usr.bin/crunch/examples/kcopy.conf index dd00608e0f..8cd47ed60d 100644 --- a/usr.bin/crunch/examples/kcopy.conf +++ b/usr.bin/crunch/examples/kcopy.conf @@ -18,4 +18,4 @@ ln reboot halt ln reboot fastboot ln reboot fasthalt -libs -ll -ledit -ltermcap -lcompat -lutil -lscrypt +libs -ll -lprivate_edit -ltermcap -lcompat -lutil -lscrypt diff --git a/usr.bin/crunch/examples/really-big.conf b/usr.bin/crunch/examples/really-big.conf index d666be99de..518e0f7586 100644 --- a/usr.bin/crunch/examples/really-big.conf +++ b/usr.bin/crunch/examples/really-big.conf @@ -154,5 +154,5 @@ special cc1 objpaths /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-parse.o /usr/src/gnu/us ln gzip gunzip ln gzip gzcat -libs -ledit -lgnumalloc -lc -lcrypt -ltermcap -lcurses -ltelnet -lutil -lkvm +libs -lprivate_edit -lgnumalloc -lc -lcrypt -ltermcap -lcurses -ltelnet -lutil -lkvm libs -ll -ly -lm -lresolv -lrpcsvc -lcompat diff --git a/usr.bin/ftp/Makefile b/usr.bin/ftp/Makefile index 2cbd6981c6..ae36f0251b 100644 --- a/usr.bin/ftp/Makefile +++ b/usr.bin/ftp/Makefile @@ -16,7 +16,7 @@ SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \ CFLAGS+=-I${.CURDIR} -I${.OBJDIR} -I${CONTRIBDIR} \ -I${.CURDIR}/../../lib/libc/stdtime \ -D__dead=__dead2 -DUSE_GLOB_H -LDADD= -ledit -ltermcap -lutil +LDADD= -lprivate_edit -ltermcap -lutil DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL} .if !defined(NO_OPENSSL) diff --git a/usr.bin/tftp/Makefile b/usr.bin/tftp/Makefile index d7eccfe27b..e526e544bb 100644 --- a/usr.bin/tftp/Makefile +++ b/usr.bin/tftp/Makefile @@ -3,6 +3,6 @@ PROG= tftp SRCS= main.c tftp.c tftpsubs.c DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +LDADD= -lprivate_edit -ltermcap .include diff --git a/usr.bin/units/Makefile b/usr.bin/units/Makefile index 113b65ef1b..f64fc955f8 100644 --- a/usr.bin/units/Makefile +++ b/usr.bin/units/Makefile @@ -1,11 +1,10 @@ # $FreeBSD: src/usr.bin/units/Makefile,v 1.5.2.1 2002/02/18 16:16:57 ru Exp $ -# $DragonFly: src/usr.bin/units/Makefile,v 1.4 2007/08/27 16:51:00 pavalos Exp $ PROG= units FILES= units.lib FILESDIR= ${SHAREDIR}/misc -LDADD+= -ledit -ltermcap +LDADD+= -lprivate_edit -ltermcap DPADD+= ${LIBEDIT} ${LIBTERMCAP} .include diff --git a/usr.sbin/802_11/wpa_cli/Makefile b/usr.sbin/802_11/wpa_cli/Makefile index c8e5e922a6..ffb9a724b1 100644 --- a/usr.sbin/802_11/wpa_cli/Makefile +++ b/usr.sbin/802_11/wpa_cli/Makefile @@ -13,7 +13,7 @@ CFLAGS+= -DCONFIG_CTRL_IFACE CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX CFLAGS+= -DCONFIG_READLINE -LDADD+= -ledit -ltermcap +LDADD+= -lprivate_edit -ltermcap DPADD+= ${LIBEDIT} ${LIBTERMCAP} .include diff --git a/usr.sbin/cdcontrol/Makefile b/usr.sbin/cdcontrol/Makefile index 9111e38bdd..182aca29d1 100644 --- a/usr.sbin/cdcontrol/Makefile +++ b/usr.sbin/cdcontrol/Makefile @@ -1,9 +1,8 @@ # $FreeBSD: src/usr.sbin/cdcontrol/Makefile,v 1.2.2.2 2002/03/15 22:34:25 mikeh Exp $ -# $DragonFly: src/usr.sbin/cdcontrol/Makefile,v 1.3 2005/01/17 01:49:24 cpressey Exp $ PROG= cdcontrol DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +LDADD= -lprivate_edit -ltermcap .include diff --git a/usr.sbin/lpr/lpc/Makefile b/usr.sbin/lpr/lpc/Makefile index fcbcf1bf03..31e012f2dd 100644 --- a/usr.sbin/lpr/lpc/Makefile +++ b/usr.sbin/lpr/lpc/Makefile @@ -1,6 +1,5 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD: src/usr.sbin/lpr/lpc/Makefile,v 1.7.2.4 2002/07/26 03:12:07 gad Exp $ -# $DragonFly: src/usr.sbin/lpr/lpc/Makefile,v 1.2 2003/06/17 04:29:56 dillon Exp $ .PATH: ${.CURDIR}/../common_source @@ -13,6 +12,6 @@ BINMODE= 2555 CFLAGS+= -I${.CURDIR}/../common_source DPADD= ${LIBLPR} ${LIBEDIT} ${LIBTERMCAP} -LDADD= ${LIBLPR} -ledit -ltermcap +LDADD= ${LIBLPR} -lprivate_edit -ltermcap .include diff --git a/usr.sbin/pppctl/Makefile b/usr.sbin/pppctl/Makefile index 279f4b16a3..eb3d4dc586 100644 --- a/usr.sbin/pppctl/Makefile +++ b/usr.sbin/pppctl/Makefile @@ -1,10 +1,9 @@ # $FreeBSD: src/usr.sbin/pppctl/Makefile,v 1.5.2.1 2001/04/25 12:10:34 ru Exp $ -# $DragonFly: src/usr.sbin/pppctl/Makefile,v 1.3 2008/10/29 18:18:04 swildner Exp $ PROG= pppctl MAN= pppctl.8 WARNS?= 2 -LDADD+= -ledit -ltermcap +LDADD+= -lprivate_edit -ltermcap DPADD+= ${LIBEDIT} ${LIBTERMCAP} .include -- 2.11.4.GIT