Make RPM_DEFINE_KMOD conditional on CONFIG_KERNEL

The configure variables won't be defined if CONFIG_KERNEL is disabled
and defining empty macros causes errors. The spec files do provide some
defaults if the macros are undefined.

Remove config conditionals in the tgz Makefile.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10564
This commit is contained in:
Arvind Sankar 2020-07-13 19:20:27 -04:00 committed by Brian Behlendorf
parent e6c093dd94
commit bdb518c13a
2 changed files with 11 additions and 9 deletions

View File

@ -10,17 +10,14 @@ tgz-local:
fi) fi)
tgz-kmod: tgz-local rpm-kmod tgz-kmod: tgz-local rpm-kmod
if CONFIG_KERNEL
name=${PACKAGE}; \ name=${PACKAGE}; \
version=${VERSION}-${RELEASE}; \ version=${VERSION}-${RELEASE}; \
arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \ arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \ pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \
$(RM) $$pkg1 $(RM) $$pkg1
endif
tgz-utils: tgz-local rpm-utils tgz-utils: tgz-local rpm-utils
if CONFIG_USER
name=${PACKAGE}; \ name=${PACKAGE}; \
version=${VERSION}-${RELEASE}; \ version=${VERSION}-${RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@ -29,6 +26,5 @@ if CONFIG_USER
pkg3=$${name}-test-$${version}.$${arch}.rpm; \ pkg3=$${name}-test-$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \
$(RM) $$pkg1 $$pkg2 $$pkg3 $(RM) $$pkg1 $$pkg2 $$pkg3
endif
tgz: tgz-kmod tgz-utils tgz: tgz-kmod tgz-utils

View File

@ -261,9 +261,9 @@ AC_DEFUN([ZFS_AC_RPM], [
]) ])
RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"' RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUGINFO_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_ZFS) 1"' RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"' RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUGINFO_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"' RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"'
RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"' RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
@ -303,10 +303,16 @@ AC_DEFUN([ZFS_AC_RPM], [
AC_SUBST(MULTIARCH_LIBDIR) AC_SUBST(MULTIARCH_LIBDIR)
]) ])
RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"' dnl # Make RPM_DEFINE_KMOD additions conditional on CONFIG_KERNEL,
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "ksrc $(LINUX)"' dnl # since the values will not be set otherwise. The spec files
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kobj $(LINUX_OBJ)"' dnl # provide defaults for them.
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "_wrong_version_format_terminate_build 0"' dnl #
RPM_DEFINE_KMOD='--define "_wrong_version_format_terminate_build 0"'
AM_COND_IF([CONFIG_KERNEL], [
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernels $(LINUX_VERSION)"'
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "ksrc $(LINUX)"'
RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kobj $(LINUX_OBJ)"'
])
RPM_DEFINE_DKMS='' RPM_DEFINE_DKMS=''