From e4b0a90e771b94e4b043729a6f0f5564f1d01aca Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Mon, 25 Jun 2018 19:55:15 +0000 Subject: [PATCH] Normalize the g(eom,cache,part,...) build. Rather then combining hardlink creation for the geom(8) binary with shared library build, move libraries to src/lib/geom so they are built and installed normally. Create a common Makefile.classes which is included by both lib/geom/Makefile and sbin/geom/Makefile so the symlink and libraries stay in sync. The relocation of libraries allows libraries to be build for 32-bit compat. This also reduces the number of non-standard builds in the system. This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit system out of the box as it will look in the wrong place for libraries unless GEOM_LIBRARY_PATH is set appropriatly in the environment. Reviewed by: bdrewery Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15360 --- Makefile.inc1 | 3 +- etc/mtree/BSD.lib32.dist | 2 + lib/Makefile | 2 + lib/geom/Makefile | 6 +++ {sbin/geom/class => lib/geom}/Makefile.inc | 11 ++++-- {sbin/geom/class => lib/geom}/cache/Makefile | 0 .../class => lib/geom}/cache/Makefile.depend | 0 {sbin/geom/class => lib/geom}/cache/gcache.8 | 0 .../class => lib/geom}/cache/geom_cache.c | 0 {sbin/geom/class => lib/geom}/concat/Makefile | 0 .../class => lib/geom}/concat/Makefile.depend | 0 .../geom/class => lib/geom}/concat/gconcat.8 | 0 .../class => lib/geom}/concat/geom_concat.c | 0 {sbin/geom/class => lib/geom}/eli/Makefile | 0 .../class => lib/geom}/eli/Makefile.depend | 0 {sbin/geom/class => lib/geom}/eli/geli.8 | 0 {sbin/geom/class => lib/geom}/eli/geom_eli.c | 0 .../geom/class => lib/geom}/journal/Makefile | 0 .../geom}/journal/Makefile.depend | 0 .../class => lib/geom}/journal/geom_journal.c | 0 .../class => lib/geom}/journal/geom_journal.h | 0 .../geom}/journal/geom_journal_ufs.c | 0 .../class => lib/geom}/journal/gjournal.8 | 0 {sbin/geom/class => lib/geom}/label/Makefile | 0 .../class => lib/geom}/label/Makefile.depend | 0 .../class => lib/geom}/label/geom_label.c | 0 {sbin/geom/class => lib/geom}/label/glabel.8 | 0 {sbin/geom/class => lib/geom}/mirror/Makefile | 0 .../class => lib/geom}/mirror/Makefile.depend | 0 .../class => lib/geom}/mirror/geom_mirror.c | 0 .../geom/class => lib/geom}/mirror/gmirror.8 | 0 .../geom/class => lib/geom}/mountver/Makefile | 0 .../geom}/mountver/Makefile.depend | 0 .../geom}/mountver/geom_mountver.c | 0 .../class => lib/geom}/mountver/gmountver.8 | 0 .../class => lib/geom}/multipath/Makefile | 0 .../geom}/multipath/Makefile.depend | 0 .../geom}/multipath/geom_multipath.c | 0 .../class => lib/geom}/multipath/gmultipath.8 | 0 {sbin/geom/class => lib/geom}/nop/Makefile | 0 .../class => lib/geom}/nop/Makefile.depend | 0 {sbin/geom/class => lib/geom}/nop/geom_nop.c | 0 {sbin/geom/class => lib/geom}/nop/gnop.8 | 0 {sbin/geom/class => lib/geom}/part/Makefile | 0 .../class => lib/geom}/part/Makefile.depend | 0 .../geom/class => lib/geom}/part/geom_part.c | 0 {sbin/geom/class => lib/geom}/part/gpart.8 | 0 {sbin/geom/class => lib/geom}/raid/Makefile | 0 .../class => lib/geom}/raid/Makefile.depend | 0 .../geom/class => lib/geom}/raid/geom_raid.c | 0 {sbin/geom/class => lib/geom}/raid/graid.8 | 0 {sbin/geom/class => lib/geom}/raid3/Makefile | 0 .../class => lib/geom}/raid3/Makefile.depend | 0 .../class => lib/geom}/raid3/geom_raid3.c | 0 {sbin/geom/class => lib/geom}/raid3/graid3.8 | 0 {sbin/geom/class => lib/geom}/sched/Makefile | 0 .../class => lib/geom}/sched/Makefile.depend | 0 .../class => lib/geom}/sched/geom_sched.c | 0 {sbin/geom/class => lib/geom}/sched/gsched.8 | 0 {sbin/geom/class => lib/geom}/shsec/Makefile | 0 .../class => lib/geom}/shsec/Makefile.depend | 0 .../class => lib/geom}/shsec/geom_shsec.c | 0 {sbin/geom/class => lib/geom}/shsec/gshsec.8 | 0 {sbin/geom/class => lib/geom}/stripe/Makefile | 0 .../class => lib/geom}/stripe/Makefile.depend | 0 .../class => lib/geom}/stripe/geom_stripe.c | 0 .../geom/class => lib/geom}/stripe/gstripe.8 | 0 .../geom/class => lib/geom}/virstor/Makefile | 0 .../geom}/virstor/Makefile.depend | 0 .../class => lib/geom}/virstor/geom_virstor.c | 0 .../class => lib/geom}/virstor/gvirstor.8 | 0 sbin/geom/Makefile | 38 ++++++++++--------- sbin/geom/Makefile.inc | 5 --- sbin/geom/class/Makefile | 24 ------------ sbin/geom/core/Makefile | 17 --------- targets/pseudo/userland/Makefile.depend | 16 -------- targets/pseudo/userland/lib/Makefile.depend | 16 ++++++++ 77 files changed, 55 insertions(+), 85 deletions(-) create mode 100644 lib/geom/Makefile rename {sbin/geom/class => lib/geom}/Makefile.inc (54%) rename {sbin/geom/class => lib/geom}/cache/Makefile (100%) rename {sbin/geom/class => lib/geom}/cache/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/cache/gcache.8 (100%) rename {sbin/geom/class => lib/geom}/cache/geom_cache.c (100%) rename {sbin/geom/class => lib/geom}/concat/Makefile (100%) rename {sbin/geom/class => lib/geom}/concat/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/concat/gconcat.8 (100%) rename {sbin/geom/class => lib/geom}/concat/geom_concat.c (100%) rename {sbin/geom/class => lib/geom}/eli/Makefile (100%) rename {sbin/geom/class => lib/geom}/eli/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/eli/geli.8 (100%) rename {sbin/geom/class => lib/geom}/eli/geom_eli.c (100%) rename {sbin/geom/class => lib/geom}/journal/Makefile (100%) rename {sbin/geom/class => lib/geom}/journal/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/journal/geom_journal.c (100%) rename {sbin/geom/class => lib/geom}/journal/geom_journal.h (100%) rename {sbin/geom/class => lib/geom}/journal/geom_journal_ufs.c (100%) rename {sbin/geom/class => lib/geom}/journal/gjournal.8 (100%) rename {sbin/geom/class => lib/geom}/label/Makefile (100%) rename {sbin/geom/class => lib/geom}/label/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/label/geom_label.c (100%) rename {sbin/geom/class => lib/geom}/label/glabel.8 (100%) rename {sbin/geom/class => lib/geom}/mirror/Makefile (100%) rename {sbin/geom/class => lib/geom}/mirror/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/mirror/geom_mirror.c (100%) rename {sbin/geom/class => lib/geom}/mirror/gmirror.8 (100%) rename {sbin/geom/class => lib/geom}/mountver/Makefile (100%) rename {sbin/geom/class => lib/geom}/mountver/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/mountver/geom_mountver.c (100%) rename {sbin/geom/class => lib/geom}/mountver/gmountver.8 (100%) rename {sbin/geom/class => lib/geom}/multipath/Makefile (100%) rename {sbin/geom/class => lib/geom}/multipath/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/multipath/geom_multipath.c (100%) rename {sbin/geom/class => lib/geom}/multipath/gmultipath.8 (100%) rename {sbin/geom/class => lib/geom}/nop/Makefile (100%) rename {sbin/geom/class => lib/geom}/nop/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/nop/geom_nop.c (100%) rename {sbin/geom/class => lib/geom}/nop/gnop.8 (100%) rename {sbin/geom/class => lib/geom}/part/Makefile (100%) rename {sbin/geom/class => lib/geom}/part/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/part/geom_part.c (100%) rename {sbin/geom/class => lib/geom}/part/gpart.8 (100%) rename {sbin/geom/class => lib/geom}/raid/Makefile (100%) rename {sbin/geom/class => lib/geom}/raid/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/raid/geom_raid.c (100%) rename {sbin/geom/class => lib/geom}/raid/graid.8 (100%) rename {sbin/geom/class => lib/geom}/raid3/Makefile (100%) rename {sbin/geom/class => lib/geom}/raid3/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/raid3/geom_raid3.c (100%) rename {sbin/geom/class => lib/geom}/raid3/graid3.8 (100%) rename {sbin/geom/class => lib/geom}/sched/Makefile (100%) rename {sbin/geom/class => lib/geom}/sched/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/sched/geom_sched.c (100%) rename {sbin/geom/class => lib/geom}/sched/gsched.8 (100%) rename {sbin/geom/class => lib/geom}/shsec/Makefile (100%) rename {sbin/geom/class => lib/geom}/shsec/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/shsec/geom_shsec.c (100%) rename {sbin/geom/class => lib/geom}/shsec/gshsec.8 (100%) rename {sbin/geom/class => lib/geom}/stripe/Makefile (100%) rename {sbin/geom/class => lib/geom}/stripe/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/stripe/geom_stripe.c (100%) rename {sbin/geom/class => lib/geom}/stripe/gstripe.8 (100%) rename {sbin/geom/class => lib/geom}/virstor/Makefile (100%) rename {sbin/geom/class => lib/geom}/virstor/Makefile.depend (100%) rename {sbin/geom/class => lib/geom}/virstor/geom_virstor.c (100%) rename {sbin/geom/class => lib/geom}/virstor/gvirstor.8 (100%) delete mode 100644 sbin/geom/Makefile.inc delete mode 100644 sbin/geom/class/Makefile delete mode 100644 sbin/geom/core/Makefile diff --git a/Makefile.inc1 b/Makefile.inc1 index 769441d20ec4..e20a9b343c61 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -952,7 +952,7 @@ _worldtmp: .PHONY @touch ${WORLDTMP}/${.TARGET} .for _dir in \ - lib lib/casper usr legacy/bin legacy/usr + lib lib/casper lib/geom usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} .endfor mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ @@ -2507,6 +2507,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libavl} \ ${_cddl_lib_libzfs_core} \ ${_cddl_lib_libctf} \ + lib/libufs \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ ${_secure_lib_libssh} ${_secure_lib_libssl} diff --git a/etc/mtree/BSD.lib32.dist b/etc/mtree/BSD.lib32.dist index a82368f9ef6d..3e2d80fd6cae 100644 --- a/etc/mtree/BSD.lib32.dist +++ b/etc/mtree/BSD.lib32.dist @@ -8,6 +8,8 @@ lib32 dtrace .. + geom + .. i18n .. .. diff --git a/lib/Makefile b/lib/Makefile index 82e8af3b679f..506675476078 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -24,6 +24,7 @@ SUBDIR_BOOTSTRAP= \ SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ + geom \ libalias \ libarchive \ libauditd \ @@ -100,6 +101,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. +SUBDIR_DEPEND_geom= libufs SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} diff --git a/lib/geom/Makefile b/lib/geom/Makefile new file mode 100644 index 000000000000..2a53278be92d --- /dev/null +++ b/lib/geom/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SUBDIR=${GEOM_CLASSES} + +.include "Makefile.inc" +.include diff --git a/sbin/geom/class/Makefile.inc b/lib/geom/Makefile.inc similarity index 54% rename from sbin/geom/class/Makefile.inc rename to lib/geom/Makefile.inc index 6da58bbac05c..74597f8bcacd 100644 --- a/sbin/geom/class/Makefile.inc +++ b/lib/geom/Makefile.inc @@ -1,13 +1,16 @@ # $FreeBSD$ -SHLIBDIR?=${GEOM_CLASS_DIR} +.include + +SHLIBDIR=${GEOM_CLASS_DIR} SHLIB_NAME?=geom_${GEOM_CLASS}.so -LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_CLASS} MAN= g${GEOM_CLASS}.8 SRCS+= geom_${GEOM_CLASS}.c subr.c +CFLAGS+=-I${SRCTOP}/sbin/geom + +.PATH: ${SRCTOP}/sbin/geom/misc NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+= -I${.CURDIR:H:H} - +.include "Makefile.classes" .include "../Makefile.inc" diff --git a/sbin/geom/class/cache/Makefile b/lib/geom/cache/Makefile similarity index 100% rename from sbin/geom/class/cache/Makefile rename to lib/geom/cache/Makefile diff --git a/sbin/geom/class/cache/Makefile.depend b/lib/geom/cache/Makefile.depend similarity index 100% rename from sbin/geom/class/cache/Makefile.depend rename to lib/geom/cache/Makefile.depend diff --git a/sbin/geom/class/cache/gcache.8 b/lib/geom/cache/gcache.8 similarity index 100% rename from sbin/geom/class/cache/gcache.8 rename to lib/geom/cache/gcache.8 diff --git a/sbin/geom/class/cache/geom_cache.c b/lib/geom/cache/geom_cache.c similarity index 100% rename from sbin/geom/class/cache/geom_cache.c rename to lib/geom/cache/geom_cache.c diff --git a/sbin/geom/class/concat/Makefile b/lib/geom/concat/Makefile similarity index 100% rename from sbin/geom/class/concat/Makefile rename to lib/geom/concat/Makefile diff --git a/sbin/geom/class/concat/Makefile.depend b/lib/geom/concat/Makefile.depend similarity index 100% rename from sbin/geom/class/concat/Makefile.depend rename to lib/geom/concat/Makefile.depend diff --git a/sbin/geom/class/concat/gconcat.8 b/lib/geom/concat/gconcat.8 similarity index 100% rename from sbin/geom/class/concat/gconcat.8 rename to lib/geom/concat/gconcat.8 diff --git a/sbin/geom/class/concat/geom_concat.c b/lib/geom/concat/geom_concat.c similarity index 100% rename from sbin/geom/class/concat/geom_concat.c rename to lib/geom/concat/geom_concat.c diff --git a/sbin/geom/class/eli/Makefile b/lib/geom/eli/Makefile similarity index 100% rename from sbin/geom/class/eli/Makefile rename to lib/geom/eli/Makefile diff --git a/sbin/geom/class/eli/Makefile.depend b/lib/geom/eli/Makefile.depend similarity index 100% rename from sbin/geom/class/eli/Makefile.depend rename to lib/geom/eli/Makefile.depend diff --git a/sbin/geom/class/eli/geli.8 b/lib/geom/eli/geli.8 similarity index 100% rename from sbin/geom/class/eli/geli.8 rename to lib/geom/eli/geli.8 diff --git a/sbin/geom/class/eli/geom_eli.c b/lib/geom/eli/geom_eli.c similarity index 100% rename from sbin/geom/class/eli/geom_eli.c rename to lib/geom/eli/geom_eli.c diff --git a/sbin/geom/class/journal/Makefile b/lib/geom/journal/Makefile similarity index 100% rename from sbin/geom/class/journal/Makefile rename to lib/geom/journal/Makefile diff --git a/sbin/geom/class/journal/Makefile.depend b/lib/geom/journal/Makefile.depend similarity index 100% rename from sbin/geom/class/journal/Makefile.depend rename to lib/geom/journal/Makefile.depend diff --git a/sbin/geom/class/journal/geom_journal.c b/lib/geom/journal/geom_journal.c similarity index 100% rename from sbin/geom/class/journal/geom_journal.c rename to lib/geom/journal/geom_journal.c diff --git a/sbin/geom/class/journal/geom_journal.h b/lib/geom/journal/geom_journal.h similarity index 100% rename from sbin/geom/class/journal/geom_journal.h rename to lib/geom/journal/geom_journal.h diff --git a/sbin/geom/class/journal/geom_journal_ufs.c b/lib/geom/journal/geom_journal_ufs.c similarity index 100% rename from sbin/geom/class/journal/geom_journal_ufs.c rename to lib/geom/journal/geom_journal_ufs.c diff --git a/sbin/geom/class/journal/gjournal.8 b/lib/geom/journal/gjournal.8 similarity index 100% rename from sbin/geom/class/journal/gjournal.8 rename to lib/geom/journal/gjournal.8 diff --git a/sbin/geom/class/label/Makefile b/lib/geom/label/Makefile similarity index 100% rename from sbin/geom/class/label/Makefile rename to lib/geom/label/Makefile diff --git a/sbin/geom/class/label/Makefile.depend b/lib/geom/label/Makefile.depend similarity index 100% rename from sbin/geom/class/label/Makefile.depend rename to lib/geom/label/Makefile.depend diff --git a/sbin/geom/class/label/geom_label.c b/lib/geom/label/geom_label.c similarity index 100% rename from sbin/geom/class/label/geom_label.c rename to lib/geom/label/geom_label.c diff --git a/sbin/geom/class/label/glabel.8 b/lib/geom/label/glabel.8 similarity index 100% rename from sbin/geom/class/label/glabel.8 rename to lib/geom/label/glabel.8 diff --git a/sbin/geom/class/mirror/Makefile b/lib/geom/mirror/Makefile similarity index 100% rename from sbin/geom/class/mirror/Makefile rename to lib/geom/mirror/Makefile diff --git a/sbin/geom/class/mirror/Makefile.depend b/lib/geom/mirror/Makefile.depend similarity index 100% rename from sbin/geom/class/mirror/Makefile.depend rename to lib/geom/mirror/Makefile.depend diff --git a/sbin/geom/class/mirror/geom_mirror.c b/lib/geom/mirror/geom_mirror.c similarity index 100% rename from sbin/geom/class/mirror/geom_mirror.c rename to lib/geom/mirror/geom_mirror.c diff --git a/sbin/geom/class/mirror/gmirror.8 b/lib/geom/mirror/gmirror.8 similarity index 100% rename from sbin/geom/class/mirror/gmirror.8 rename to lib/geom/mirror/gmirror.8 diff --git a/sbin/geom/class/mountver/Makefile b/lib/geom/mountver/Makefile similarity index 100% rename from sbin/geom/class/mountver/Makefile rename to lib/geom/mountver/Makefile diff --git a/sbin/geom/class/mountver/Makefile.depend b/lib/geom/mountver/Makefile.depend similarity index 100% rename from sbin/geom/class/mountver/Makefile.depend rename to lib/geom/mountver/Makefile.depend diff --git a/sbin/geom/class/mountver/geom_mountver.c b/lib/geom/mountver/geom_mountver.c similarity index 100% rename from sbin/geom/class/mountver/geom_mountver.c rename to lib/geom/mountver/geom_mountver.c diff --git a/sbin/geom/class/mountver/gmountver.8 b/lib/geom/mountver/gmountver.8 similarity index 100% rename from sbin/geom/class/mountver/gmountver.8 rename to lib/geom/mountver/gmountver.8 diff --git a/sbin/geom/class/multipath/Makefile b/lib/geom/multipath/Makefile similarity index 100% rename from sbin/geom/class/multipath/Makefile rename to lib/geom/multipath/Makefile diff --git a/sbin/geom/class/multipath/Makefile.depend b/lib/geom/multipath/Makefile.depend similarity index 100% rename from sbin/geom/class/multipath/Makefile.depend rename to lib/geom/multipath/Makefile.depend diff --git a/sbin/geom/class/multipath/geom_multipath.c b/lib/geom/multipath/geom_multipath.c similarity index 100% rename from sbin/geom/class/multipath/geom_multipath.c rename to lib/geom/multipath/geom_multipath.c diff --git a/sbin/geom/class/multipath/gmultipath.8 b/lib/geom/multipath/gmultipath.8 similarity index 100% rename from sbin/geom/class/multipath/gmultipath.8 rename to lib/geom/multipath/gmultipath.8 diff --git a/sbin/geom/class/nop/Makefile b/lib/geom/nop/Makefile similarity index 100% rename from sbin/geom/class/nop/Makefile rename to lib/geom/nop/Makefile diff --git a/sbin/geom/class/nop/Makefile.depend b/lib/geom/nop/Makefile.depend similarity index 100% rename from sbin/geom/class/nop/Makefile.depend rename to lib/geom/nop/Makefile.depend diff --git a/sbin/geom/class/nop/geom_nop.c b/lib/geom/nop/geom_nop.c similarity index 100% rename from sbin/geom/class/nop/geom_nop.c rename to lib/geom/nop/geom_nop.c diff --git a/sbin/geom/class/nop/gnop.8 b/lib/geom/nop/gnop.8 similarity index 100% rename from sbin/geom/class/nop/gnop.8 rename to lib/geom/nop/gnop.8 diff --git a/sbin/geom/class/part/Makefile b/lib/geom/part/Makefile similarity index 100% rename from sbin/geom/class/part/Makefile rename to lib/geom/part/Makefile diff --git a/sbin/geom/class/part/Makefile.depend b/lib/geom/part/Makefile.depend similarity index 100% rename from sbin/geom/class/part/Makefile.depend rename to lib/geom/part/Makefile.depend diff --git a/sbin/geom/class/part/geom_part.c b/lib/geom/part/geom_part.c similarity index 100% rename from sbin/geom/class/part/geom_part.c rename to lib/geom/part/geom_part.c diff --git a/sbin/geom/class/part/gpart.8 b/lib/geom/part/gpart.8 similarity index 100% rename from sbin/geom/class/part/gpart.8 rename to lib/geom/part/gpart.8 diff --git a/sbin/geom/class/raid/Makefile b/lib/geom/raid/Makefile similarity index 100% rename from sbin/geom/class/raid/Makefile rename to lib/geom/raid/Makefile diff --git a/sbin/geom/class/raid/Makefile.depend b/lib/geom/raid/Makefile.depend similarity index 100% rename from sbin/geom/class/raid/Makefile.depend rename to lib/geom/raid/Makefile.depend diff --git a/sbin/geom/class/raid/geom_raid.c b/lib/geom/raid/geom_raid.c similarity index 100% rename from sbin/geom/class/raid/geom_raid.c rename to lib/geom/raid/geom_raid.c diff --git a/sbin/geom/class/raid/graid.8 b/lib/geom/raid/graid.8 similarity index 100% rename from sbin/geom/class/raid/graid.8 rename to lib/geom/raid/graid.8 diff --git a/sbin/geom/class/raid3/Makefile b/lib/geom/raid3/Makefile similarity index 100% rename from sbin/geom/class/raid3/Makefile rename to lib/geom/raid3/Makefile diff --git a/sbin/geom/class/raid3/Makefile.depend b/lib/geom/raid3/Makefile.depend similarity index 100% rename from sbin/geom/class/raid3/Makefile.depend rename to lib/geom/raid3/Makefile.depend diff --git a/sbin/geom/class/raid3/geom_raid3.c b/lib/geom/raid3/geom_raid3.c similarity index 100% rename from sbin/geom/class/raid3/geom_raid3.c rename to lib/geom/raid3/geom_raid3.c diff --git a/sbin/geom/class/raid3/graid3.8 b/lib/geom/raid3/graid3.8 similarity index 100% rename from sbin/geom/class/raid3/graid3.8 rename to lib/geom/raid3/graid3.8 diff --git a/sbin/geom/class/sched/Makefile b/lib/geom/sched/Makefile similarity index 100% rename from sbin/geom/class/sched/Makefile rename to lib/geom/sched/Makefile diff --git a/sbin/geom/class/sched/Makefile.depend b/lib/geom/sched/Makefile.depend similarity index 100% rename from sbin/geom/class/sched/Makefile.depend rename to lib/geom/sched/Makefile.depend diff --git a/sbin/geom/class/sched/geom_sched.c b/lib/geom/sched/geom_sched.c similarity index 100% rename from sbin/geom/class/sched/geom_sched.c rename to lib/geom/sched/geom_sched.c diff --git a/sbin/geom/class/sched/gsched.8 b/lib/geom/sched/gsched.8 similarity index 100% rename from sbin/geom/class/sched/gsched.8 rename to lib/geom/sched/gsched.8 diff --git a/sbin/geom/class/shsec/Makefile b/lib/geom/shsec/Makefile similarity index 100% rename from sbin/geom/class/shsec/Makefile rename to lib/geom/shsec/Makefile diff --git a/sbin/geom/class/shsec/Makefile.depend b/lib/geom/shsec/Makefile.depend similarity index 100% rename from sbin/geom/class/shsec/Makefile.depend rename to lib/geom/shsec/Makefile.depend diff --git a/sbin/geom/class/shsec/geom_shsec.c b/lib/geom/shsec/geom_shsec.c similarity index 100% rename from sbin/geom/class/shsec/geom_shsec.c rename to lib/geom/shsec/geom_shsec.c diff --git a/sbin/geom/class/shsec/gshsec.8 b/lib/geom/shsec/gshsec.8 similarity index 100% rename from sbin/geom/class/shsec/gshsec.8 rename to lib/geom/shsec/gshsec.8 diff --git a/sbin/geom/class/stripe/Makefile b/lib/geom/stripe/Makefile similarity index 100% rename from sbin/geom/class/stripe/Makefile rename to lib/geom/stripe/Makefile diff --git a/sbin/geom/class/stripe/Makefile.depend b/lib/geom/stripe/Makefile.depend similarity index 100% rename from sbin/geom/class/stripe/Makefile.depend rename to lib/geom/stripe/Makefile.depend diff --git a/sbin/geom/class/stripe/geom_stripe.c b/lib/geom/stripe/geom_stripe.c similarity index 100% rename from sbin/geom/class/stripe/geom_stripe.c rename to lib/geom/stripe/geom_stripe.c diff --git a/sbin/geom/class/stripe/gstripe.8 b/lib/geom/stripe/gstripe.8 similarity index 100% rename from sbin/geom/class/stripe/gstripe.8 rename to lib/geom/stripe/gstripe.8 diff --git a/sbin/geom/class/virstor/Makefile b/lib/geom/virstor/Makefile similarity index 100% rename from sbin/geom/class/virstor/Makefile rename to lib/geom/virstor/Makefile diff --git a/sbin/geom/class/virstor/Makefile.depend b/lib/geom/virstor/Makefile.depend similarity index 100% rename from sbin/geom/class/virstor/Makefile.depend rename to lib/geom/virstor/Makefile.depend diff --git a/sbin/geom/class/virstor/geom_virstor.c b/lib/geom/virstor/geom_virstor.c similarity index 100% rename from sbin/geom/class/virstor/geom_virstor.c rename to lib/geom/virstor/geom_virstor.c diff --git a/sbin/geom/class/virstor/gvirstor.8 b/lib/geom/virstor/gvirstor.8 similarity index 100% rename from sbin/geom/class/virstor/gvirstor.8 rename to lib/geom/virstor/gvirstor.8 diff --git a/sbin/geom/Makefile b/sbin/geom/Makefile index 5ef8fb847dd8..9520483815b3 100644 --- a/sbin/geom/Makefile +++ b/sbin/geom/Makefile @@ -1,28 +1,30 @@ # $FreeBSD$ +.include + +.PATH: ${.CURDIR}/core ${.CURDIR}/misc + PACKAGE=runtime +PROG= geom +SRCS= geom.c subr.c +MAN= geom.8 +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/core +CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\" + +LIBADD= geom util + .if defined(RESCUE) || defined(RELEASE_CRUNCH) +.PATH: ${SRCTOP}/lib/geom/part \ + ${SRCTOP}/lib/geom/label -.PATH: ${.CURDIR}/class/part \ - ${.CURDIR}/class/label \ - ${.CURDIR}/core \ - ${.CURDIR}/misc - -PROG= geom -SRCS= geom.c geom_label.c geom_part.c subr.c +SRCS+= geom_label.c geom_part.c MAN= WARNS?= 2 -CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES - -LIBADD= geom util +CFLAGS+=-DSTATIC_GEOM_CLASSES +.else +.include "${SRCTOP}/lib/geom/Makefile.classes" +LINKS= ${GEOM_CLASSES:S|^|${BINDIR}/geom ${BINDIR}/g|} +.endif .include - -.else - -SUBDIR= core class - -.include - -.endif diff --git a/sbin/geom/Makefile.inc b/sbin/geom/Makefile.inc deleted file mode 100644 index 0b1f991bfb1c..000000000000 --- a/sbin/geom/Makefile.inc +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -GEOM_CLASS_DIR?=/lib/geom - -.include "../Makefile.inc" diff --git a/sbin/geom/class/Makefile b/sbin/geom/class/Makefile deleted file mode 100644 index a7ed1b9450e5..000000000000 --- a/sbin/geom/class/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# $FreeBSD$ - -.include - -SUBDIR= cache -SUBDIR+=concat -.if ${MK_OPENSSL} != "no" -SUBDIR+=eli -.endif -SUBDIR+=journal -SUBDIR+=label -SUBDIR+=mirror -SUBDIR+=mountver -SUBDIR+=multipath -SUBDIR+=nop -SUBDIR+=part -SUBDIR+=raid -SUBDIR+=raid3 -SUBDIR+=sched -SUBDIR+=shsec -SUBDIR+=stripe -SUBDIR+=virstor - -.include diff --git a/sbin/geom/core/Makefile b/sbin/geom/core/Makefile deleted file mode 100644 index d892575c595d..000000000000 --- a/sbin/geom/core/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR:H}/misc - -PACKAGE=runtime -PROG= geom -MAN= geom.8 -SRCS= geom.c subr.c - -NO_SHARED=NO - -CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\" -CFLAGS+= -I${SRCTOP}/sys -I${.CURDIR} -I${.CURDIR:H} - -LIBADD= geom util - -.include diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index 470a57d10759..685e603c5c4b 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -70,22 +70,6 @@ DIRDEPS+= \ sbin/fsdb \ sbin/fsirand \ sbin/gbde \ - sbin/geom/class/cache \ - sbin/geom/class/concat \ - sbin/geom/class/eli \ - sbin/geom/class/journal \ - sbin/geom/class/label \ - sbin/geom/class/mirror \ - sbin/geom/class/mountver \ - sbin/geom/class/multipath \ - sbin/geom/class/nop \ - sbin/geom/class/part \ - sbin/geom/class/raid \ - sbin/geom/class/raid3 \ - sbin/geom/class/sched \ - sbin/geom/class/shsec \ - sbin/geom/class/stripe \ - sbin/geom/class/virstor \ sbin/geom/core \ sbin/ggate/ggatec \ sbin/ggate/ggated \ diff --git a/targets/pseudo/userland/lib/Makefile.depend b/targets/pseudo/userland/lib/Makefile.depend index 5ff429cb6bcc..381722cb059b 100644 --- a/targets/pseudo/userland/lib/Makefile.depend +++ b/targets/pseudo/userland/lib/Makefile.depend @@ -8,6 +8,22 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/atf/libatf-c \ lib/atf/libatf-c++ \ + lib/geom/cache \ + lib/geom/concat \ + lib/geom/eli \ + lib/geom/journal \ + lib/geom/label \ + lib/geom/mirror \ + lib/geom/mountver \ + lib/geom/multipath \ + lib/geom/nop \ + lib/geom/part \ + lib/geom/raid \ + lib/geom/raid3 \ + lib/geom/sched \ + lib/geom/shsec \ + lib/geom/stripe \ + lib/geom/virstor \ lib/lib80211 \ lib/libalias/libalias \ lib/libalias/modules/cuseeme \