libafs: Create debug KMODDIR for FBSD debug inst 90/13690/5
authorAndrew Deason <adeason@dson.org>
Sun, 23 Jun 2019 22:48:53 +0000 (17:48 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 30 Aug 2019 06:27:32 +0000 (02:27 -0400)
Commit 99418024 (libafs: Create $(DESTDIR)$(KMODDIR) on FBSD inst)
made it so we create the kmod installation dir before copying our
module into it. However, if we build a 'debug' variant of our module,
the FreeBSD build process also installs debug symbols in a different
directory, ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}, which may not exist.
So do the same thing for that dir too, if --enable-debug-kernel is
turned on, so the build still works.

To do this, introduce the LIBAFS_REQ_DIRS var, to make it easier to
keep track of which dirs we may need to create.

Change-Id: Id1ad72f6c19d5949d38ee97334b4014ae6ef16ad
Reviewed-on: https://gerrit.openafs.org/13690
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Andrew Deason <adeason@sinenomine.net>

src/libafs/MakefileProto.FBSD.in

index 26e86ea..4cdec2d 100644 (file)
@@ -41,10 +41,15 @@ AFS_OS_NONFSOBJS = \
 KSRC = @BSD_KERNEL_PATH@
 KBLD = @BSD_KERNEL_BUILD@
 
+LIBAFS_REQ_DIRS = $(DESTDIR)$(KMODDIR)/
+
 # keep symbols if --enable-debug-kernel
 AC_DEBUG_FLAGS = @DEBUG_FLAGS@
 .if !empty(AC_DEBUG_FLAGS)
 DEBUG_FLAGS=   ${AC_DEBUG_FLAGS}
+
+# For debug builds, we also need /usr/lib/debug/* dirs to exist
+LIBAFS_REQ_DIRS += ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/
 .endif
 
 # We are not doing very well (WARNS=2 brings in printf format type checking)
@@ -55,6 +60,7 @@ CWARNFLAGS+= -Wno-redundant-decls
 # setup for bsd.kmod.mk infrastructure
 .PATH: ${TOP_SRCDIR}/afs/FBSD
 KMODDIR=/boot/modules
+KERN_DEBUGDIR=/usr/lib/debug
 KMOD=  libafs
 SYSDIR= ${KSRC}
 .if !empty(KBLD)
@@ -103,7 +109,10 @@ DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
 $(DESTDIR)$(KMODDIR)/:
        $(INSTALL) -d $@
 
-install_libafs:        $(LIBAFSNONFS) $(DESTDIR)$(KMODDIR)/ install
+${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/:
+       $(INSTALL) -d $@
+
+install_libafs:        $(LIBAFSNONFS) $(LIBAFS_REQ_DIRS) install
 
 dest_libafs: $(LIBAFSNONFS)
        ${INSTALL} -d ${DEST}/root.client/bin