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>
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)
# 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)
$(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