Don't build packages that haven't been selected.

Currently, when configure --with-config is used, selective compilation
is only effective for the simple "make" case. Package builders (e.g.
make rpm) still build everything (utils and modules). This patch fixes
that.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #851
This commit is contained in:
Etienne Dechamps 2012-07-17 11:23:09 +02:00 committed by Brian Behlendorf
parent 739a1a82e0
commit b2c5198b19
5 changed files with 59 additions and 43 deletions

View File

@ -904,20 +904,18 @@ uninstall-am:
tags tags-recursive uninstall uninstall-am
srpm-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
@CONFIG_KERNEL_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
srpm-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
@CONFIG_USER_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
srpm: srpm-modules srpm-utils
rpm-modules: srpm-modules
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
@CONFIG_KERNEL_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
rpm-utils: srpm-utils
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
rpm-modules: srpm-modules
@CONFIG_USER_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
rpm: rpm-modules rpm-utils
@ -995,25 +993,25 @@ deb-local:
fi)
deb-modules: deb-local rpm-modules
name=${PACKAGE}-modules; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2; \
$(RM) $$pkg1 $$pkg2
@CONFIG_KERNEL_TRUE@ name=${PACKAGE}-modules; \
@CONFIG_KERNEL_TRUE@ version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
@CONFIG_KERNEL_TRUE@ release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
@CONFIG_KERNEL_TRUE@ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@CONFIG_KERNEL_TRUE@ pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
@CONFIG_KERNEL_TRUE@ pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
@CONFIG_KERNEL_TRUE@ fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2; \
@CONFIG_KERNEL_TRUE@ $(RM) $$pkg1 $$pkg2
deb-utils: deb-local rpm-utils
name=${PACKAGE}; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=$${name}-$${version}.$${arch}.rpm; \
pkg2=$${name}-devel-$${version}.$${arch}.rpm; \
pkg3=$${name}-test-$${version}.$${arch}.rpm; \
pkg4=$${name}-dracut-$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2 $$pkg3 $$pkg4; \
$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4
@CONFIG_USER_TRUE@ name=${PACKAGE}; \
@CONFIG_USER_TRUE@ version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
@CONFIG_USER_TRUE@ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@CONFIG_USER_TRUE@ pkg1=$${name}-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ pkg2=$${name}-devel-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ pkg3=$${name}-test-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ pkg4=$${name}-dracut-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2 $$pkg3 $$pkg4; \
@CONFIG_USER_TRUE@ $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4
deb: deb-modules deb-utils
tgz-local:
@ -1026,24 +1024,24 @@ tgz-local:
fi)
tgz-modules: tgz-local rpm-modules
name=${PACKAGE}-modules; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2; \
$(RM) $$pkg1 $$pkg2
@CONFIG_KERNEL_TRUE@ name=${PACKAGE}-modules; \
@CONFIG_KERNEL_TRUE@ version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
@CONFIG_KERNEL_TRUE@ release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
@CONFIG_KERNEL_TRUE@ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@CONFIG_KERNEL_TRUE@ pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
@CONFIG_KERNEL_TRUE@ pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
@CONFIG_KERNEL_TRUE@ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2; \
@CONFIG_KERNEL_TRUE@ $(RM) $$pkg1 $$pkg2
tgz-utils: tgz-local rpm-utils
name=${PACKAGE}; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=$${name}-$${version}.$${arch}.rpm; \
pkg2=$${name}-devel-$${version}.$${arch}.rpm; \
pkg3=$${name}-test-$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \
$(RM) $$pkg1 $$pkg2 $$pkg3
@CONFIG_USER_TRUE@ name=${PACKAGE}; \
@CONFIG_USER_TRUE@ version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
@CONFIG_USER_TRUE@ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@CONFIG_USER_TRUE@ pkg1=$${name}-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ pkg2=$${name}-devel-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ pkg3=$${name}-test-$${version}.$${arch}.rpm; \
@CONFIG_USER_TRUE@ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \
@CONFIG_USER_TRUE@ $(RM) $$pkg1 $$pkg2 $$pkg3
tgz: tgz-modules tgz-utils
@ -1056,10 +1054,10 @@ sarch-utils:
sarch: sarch-modules sarch-utils
arch-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" arch-common
@CONFIG_KERNEL_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" arch-common
arch-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" arch-common
@CONFIG_USER_TRUE@ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" arch-common
arch: arch-modules arch-utils

View File

@ -13,10 +13,14 @@ sarch-utils:
sarch: sarch-modules sarch-utils
arch-modules:
if CONFIG_KERNEL
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" arch-common
endif
arch-utils:
if CONFIG_USER
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" arch-common
endif
arch: arch-modules arch-utils

View File

@ -15,6 +15,7 @@ deb-local:
fi)
deb-modules: deb-local rpm-modules
if CONFIG_KERNEL
name=${PACKAGE}-modules; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
@ -23,8 +24,10 @@ deb-modules: deb-local rpm-modules
pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2; \
$(RM) $$pkg1 $$pkg2
endif
deb-utils: deb-local rpm-utils
if CONFIG_USER
name=${PACKAGE}; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@ -34,5 +37,6 @@ deb-utils: deb-local rpm-utils
pkg4=$${name}-dracut-$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2 $$pkg3 $$pkg4; \
$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4
endif
deb: deb-modules deb-utils

View File

@ -1,18 +1,24 @@
srpm-modules:
if CONFIG_KERNEL
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
endif
srpm-utils:
if CONFIG_USER
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
endif
srpm: srpm-modules srpm-utils
rpm-modules: srpm-modules
if CONFIG_KERNEL
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
endif
rpm-utils: srpm-utils
if CONFIG_USER
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
rpm-modules: srpm-modules
endif
rpm: rpm-modules rpm-utils

View File

@ -8,6 +8,7 @@ tgz-local:
fi)
tgz-modules: tgz-local rpm-modules
if CONFIG_KERNEL
name=${PACKAGE}-modules; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
@ -16,8 +17,10 @@ tgz-modules: tgz-local rpm-modules
pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2; \
$(RM) $$pkg1 $$pkg2
endif
tgz-utils: tgz-local rpm-utils
if CONFIG_USER
name=${PACKAGE}; \
version=${ZFS_META_VERSION}-${ZFS_META_RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@ -26,5 +29,6 @@ tgz-utils: tgz-local rpm-utils
pkg3=$${name}-test-$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \
$(RM) $$pkg1 $$pkg2 $$pkg3
endif
tgz: tgz-modules tgz-utils