Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -383,7 +383,7 @@ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ - MAN= -DNO_SHARED \ + MAN= MK_SHARED=no \ -DNO_CPU_CFLAGS -DNO_WERROR \ -DNO_SUBDIR \ DESTDIR= PROGNAME=${MYMAKE:T} Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -525,7 +525,7 @@ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no MK_SHARED=no \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ @@ -563,7 +563,7 @@ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no MK_SHARED=no \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no # world stage @@ -2086,7 +2086,7 @@ MK_GDB=no MK_TESTS=no \ SSP_CFLAGS= \ MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no MK_SHARED=no \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_DEBUG_FILES=no Index: bin/Makefile.inc =================================================================== --- bin/Makefile.inc +++ bin/Makefile.inc @@ -7,5 +7,5 @@ WARNS?= 6 .if ${MK_DYNAMICROOT} == "no" -NO_SHARED?= YES +MK_SHARED= no .endif Index: bin/rmail/Makefile =================================================================== --- bin/rmail/Makefile +++ bin/rmail/Makefile @@ -6,7 +6,7 @@ .PATH: ${SENDMAIL_DIR}/rmail # Not much point this being static. It calls a shared sendmail... -NO_SHARED?= NO +MK_SHARED= yes PROG= rmail SRCS= rmail.c Index: gnu/usr.bin/binutils/as/Makefile =================================================================== --- gnu/usr.bin/binutils/as/Makefile +++ gnu/usr.bin/binutils/as/Makefile @@ -89,7 +89,7 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?= yes +MK_SHARED= no .endif DPADD= ${RELTOP}/libbfd/libbfd.a Index: gnu/usr.bin/binutils/ld/Makefile =================================================================== --- gnu/usr.bin/binutils/ld/Makefile +++ gnu/usr.bin/binutils/ld/Makefile @@ -39,7 +39,7 @@ CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?= yes +MK_SHARED= no .endif DPADD= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a Index: gnu/usr.bin/cc/cc/Makefile =================================================================== --- gnu/usr.bin/cc/cc/Makefile +++ gnu/usr.bin/cc/cc/Makefile @@ -10,7 +10,7 @@ SRCS+= gccspec.c .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?=yes +MK_SHARED= no .endif MLINKS= gcc.1 g++.1 Index: gnu/usr.bin/cc/cc1/Makefile =================================================================== --- gnu/usr.bin/cc/cc1/Makefile +++ gnu/usr.bin/cc/cc1/Makefile @@ -11,7 +11,7 @@ SRCS= main.c c-parser.c c-lang.c BINDIR= ${LIBEXECDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?=yes +MK_SHARED= no .endif OBJS+= ${PROG}-checksum.o Index: gnu/usr.bin/cc/cc1plus/Makefile =================================================================== --- gnu/usr.bin/cc/cc1plus/Makefile +++ gnu/usr.bin/cc/cc1plus/Makefile @@ -17,7 +17,7 @@ BINDIR= ${LIBEXECDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?=yes +MK_SHARED= no .endif CFLAGS+= -I${GCCDIR}/cp -I. Index: sbin/Makefile.inc =================================================================== --- sbin/Makefile.inc +++ sbin/Makefile.inc @@ -7,5 +7,5 @@ WARNS?= 6 .if ${MK_DYNAMICROOT} == "no" -NO_SHARED?= YES +MK_SHARED= no .endif Index: sbin/devd/Makefile =================================================================== --- sbin/devd/Makefile +++ sbin/devd/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +MK_SHARED= no + .include PACKAGE=runtime @@ -8,8 +10,6 @@ MAN= devd.8 devd.conf.5 WARNS?= 3 - -NO_SHARED?=YES LIBADD= l util Index: sbin/geom/core/Makefile =================================================================== --- sbin/geom/core/Makefile +++ sbin/geom/core/Makefile @@ -7,7 +7,7 @@ MAN= geom.8 SRCS= geom.c subr.c -NO_SHARED=NO +MK_SHARED= yes CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\" CFLAGS+= -I${SRCTOP}/sys -I${.CURDIR} -I${.CURDIR:H} Index: sbin/init/Makefile =================================================================== --- sbin/init/Makefile +++ sbin/init/Makefile @@ -15,6 +15,6 @@ CFLAGS+=-I${MOUNT} .PATH: ${MOUNT} -NO_SHARED?= YES +MK_SHARED= no .include Index: sbin/mount_cd9660/Makefile =================================================================== --- sbin/mount_cd9660/Makefile +++ sbin/mount_cd9660/Makefile @@ -12,7 +12,7 @@ # Needs to be dynamically linked for optional dlopen() access to # userland libiconv -NO_SHARED?= NO +MK_SHARED= yes .PATH: ${MOUNT} Index: sbin/mount_msdosfs/Makefile =================================================================== --- sbin/mount_msdosfs/Makefile +++ sbin/mount_msdosfs/Makefile @@ -13,7 +13,7 @@ # Needs to be dynamically linked for optional dlopen() access to # userland libiconv -NO_SHARED?= NO +MK_SHARED= yes .PATH: ${MOUNT} Index: sbin/mount_udf/Makefile =================================================================== --- sbin/mount_udf/Makefile +++ sbin/mount_udf/Makefile @@ -12,6 +12,6 @@ # Needs to be dynamically linked for optional dlopen() access to # userland libiconv -NO_SHARED?= NO +MK_SHARED= yes .include Index: share/examples/etc/make.conf =================================================================== --- share/examples/etc/make.conf +++ share/examples/etc/make.conf @@ -113,9 +113,9 @@ #ENABLE_SUID_NEWGRP= # # To avoid building various parts of the base system: +#MK_SHARED= yes # build /bin and /sbin statically linked (bad idea) #NO_MODULES= # do not build modules with the kernel #NO_SHARE= # do not go into the share subdir -#NO_SHARED= # build /bin and /sbin statically linked (bad idea) # # Variables that control how ppp(8) is built. #PPP_NO_NAT= # do not build with NAT support (see make.conf(5)) Index: share/mk/bsd.opts.mk =================================================================== --- share/mk/bsd.opts.mk +++ share/mk/bsd.opts.mk @@ -61,6 +61,7 @@ NLS \ OPENSSH \ PROFILE \ + SHARED \ SSP \ SYMVER \ TOOLCHAIN \ Index: share/mk/bsd.prog.mk =================================================================== --- share/mk/bsd.prog.mk +++ share/mk/bsd.prog.mk @@ -55,7 +55,7 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif -.if defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO") +.if ${MK_SHARED} == "no" LDFLAGS+= -static .endif Index: share/mk/src.libnames.mk =================================================================== --- share/mk/src.libnames.mk +++ share/mk/src.libnames.mk @@ -364,8 +364,7 @@ LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} .endif # Add in all dependencies for static linkage. -.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \ - (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO"))) +.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || ${MK_SHARED} != "yes") .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} LDADD_${_l}+= ${LDADD_${_d}} Index: sys/boot/i386/kgzldr/Makefile =================================================================== --- sys/boot/i386/kgzldr/Makefile +++ sys/boot/i386/kgzldr/Makefile @@ -9,7 +9,7 @@ SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP -NO_SHARED= +MK_SHARED= no LDFLAGS=-Wl,-r .PATH: ${.CURDIR}/../../../kern Index: targets/pseudo/bootstrap-tools/Makefile =================================================================== --- targets/pseudo/bootstrap-tools/Makefile +++ targets/pseudo/bootstrap-tools/Makefile @@ -38,7 +38,7 @@ BWPHASE=${.TARGET} \ SSP_CFLAGS= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no MK_SHARED=no \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ Index: tools/build/options/WITHOUT_SHARED =================================================================== --- /dev/null +++ tools/build/options/WITHOUT_SHARED @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to link binaries statically. Index: usr.bin/ar/Makefile =================================================================== --- usr.bin/ar/Makefile +++ usr.bin/ar/Makefile @@ -12,7 +12,7 @@ CFLAGS+=-I. -I${.CURDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?= yes +MK_SHARED= no .endif LINKS= ${BINDIR}/ar ${BINDIR}/ranlib MLINKS= ar.1 ranlib.1 Index: usr.bin/bmake/Makefile.inc =================================================================== --- usr.bin/bmake/Makefile.inc +++ usr.bin/bmake/Makefile.inc @@ -12,7 +12,7 @@ .endif .if !defined(MK_SHARED_TOOLCHAIN) || ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?= YES +MK_SHARED= no .endif # hack to not add tests to tests subdir since this is included from Index: usr.bin/clang/clang/Makefile =================================================================== --- usr.bin/clang/clang/Makefile +++ usr.bin/clang/clang/Makefile @@ -10,7 +10,7 @@ SRCS+= driver.cpp .if ${MK_SHARED_TOOLCHAIN} == "no" -NO_SHARED?= yes +MK_SHARED= no .if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -mlong-calls Index: usr.bin/dtc/Makefile =================================================================== --- usr.bin/dtc/Makefile +++ usr.bin/dtc/Makefile @@ -8,6 +8,6 @@ CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions -NO_SHARED?=NO +MK_SHARED= yes .include Index: usr.bin/mkcsmapper_static/Makefile =================================================================== --- usr.bin/mkcsmapper_static/Makefile +++ usr.bin/mkcsmapper_static/Makefile @@ -6,7 +6,7 @@ SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \ citrus_lookup_factory.c citrus_pivot_factory.c MAN= -NO_SHARED= yes +MK_SHARED= no NO_WMISSING_VARIABLE_DECLARATIONS= build-tools: mkcsmapper_static Index: usr.bin/mkesdb_static/Makefile =================================================================== --- usr.bin/mkesdb_static/Makefile +++ usr.bin/mkesdb_static/Makefile @@ -6,7 +6,7 @@ SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \ citrus_lookup_factory.c MAN= -NO_SHARED= yes +MK_SHARED= no NO_WMISSING_VARIABLE_DECLARATIONS= build-tools: mkesdb_static Index: usr.sbin/nologin/Makefile =================================================================== --- usr.sbin/nologin/Makefile +++ usr.sbin/nologin/Makefile @@ -11,6 +11,6 @@ # libc by setting LD_LIBRARY_PATH appropriately. Both sshd(8) and # login(1) make it possible to log in with an unsanitized environment, # rendering a dynamic nologin binary virtually useless. -NO_SHARED= YES +MK_SHARED= no .include