include $(top_srcdir)/config/rpm.am
-include ${top_srcdir}/config/deb.am
-include ${top_srcdir}/config/tgz.am
+include $(top_srcdir)/config/deb.am
+include $(top_srcdir)/config/tgz.am
if CONFIG_USER
USER_DIR = lib cmd scripts
install-data-local:
destname=spl-$(SPL_META_VERSION)/$(LINUX_VERSION); \
instdest=$(DESTDIR)/usr/src/$$destname; \
- echo "${SPL_META_VERSION}" >$$instdest/spl.release; \
+ echo "$(SPL_META_VERSION)" >$$instdest/spl.release; \
for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \
$(INSTALL) -D $$instfile $$instdest/$$instfile; \
done
# Build targets for RPM packages.
###############################################################################
+###############################################################################
+# Copyright (C) 2010 Lawrence Livermore National Security, LLC.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for DEB packages.
+#
+# Long term native distro specific Debian style packaging should be added.
+# In the short term RPM packages are built and converted to DEB packages
+# using alien. If someone familiar with Debian style packaging were to
+# update the build system to correctly build Debian style packages I would
+# happily take it. Until then we will have to make due with alien.
+#
+###############################################################################
+
+###############################################################################
+# Copyright (C) 2010 Lawrence Livermore National Security, LLC.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for TGZ packages.
+#
+# Long term native distro specific Slackware style packaging should be added.
+# In the short term RPM packages are built and converted to TGZ packages
+# using alien. If someone familiar with Slackware style packaging were to
+# update the build system to correctly build Slackware style packages I would
+# happily take it. Until then we will have to make due with alien.
+#
+###############################################################################
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/spl-modules.spec.in $(srcdir)/spl.spec.in \
- $(srcdir)/spl_config.h.in $(top_srcdir)/config/rpm.am \
+ $(srcdir)/spl_config.h.in $(top_srcdir)/config/deb.am \
+ $(top_srcdir)/config/rpm.am $(top_srcdir)/config/tgz.am \
$(top_srcdir)/configure $(top_srcdir)/module/Makefile.in \
$(top_srcdir)/module/spl/Makefile.in \
$(top_srcdir)/module/splat/Makefile.in AUTHORS COPYING \
.SUFFIXES:
am--refresh:
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/rpm.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/rpm.am $(top_srcdir)/config/deb.am $(top_srcdir)/config/tgz.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
--nodeps --rebuild $$rpmpkg || exit 1; \
cp $$rpmbuild/RPMS/*/* . || exit 1; \
$(RM) -R $$rpmbuild
-include ${top_srcdir}/config/deb.am
-include ${top_srcdir}/config/tgz.am
+
+deb-local:
+ @(if test "${HAVE_DPKGBUILD}" = "no"; then \
+ echo -e "\n" \
+ "*** Required util ${DPKGBUILD} missing. Please install the\n" \
+ "*** package for your distribution which provides ${DPKGBUILD},\n" \
+ "*** re-run configure, and try again.\n"; \
+ exit 1; \
+ fi; \
+ if test "${HAVE_ALIEN}" = "no"; then \
+ echo -e "\n" \
+ "*** Required util ${ALIEN} missing. Please install the\n" \
+ "*** package for your distribution which provides ${ALIEN},\n" \
+ "*** re-run configure, and try again.\n"; \
+ exit 1; \
+ fi)
+
+deb-modules: deb-local rpm-modules
+ name=${PACKAGE}-modules; \
+ version=${SPL_META_VERSION}-${SPL_META_RELEASE}; \
+ release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
+ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch}`; \
+ pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
+ pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --scripts --to-deb $$pkg1 $$pkg2; \
+ $(RM) $$pkg1 $$pkg2
+
+deb-utils: deb-local rpm-utils
+ name=${PACKAGE}; \
+ version=${SPL_META_VERSION}-${SPL_META_RELEASE}; \
+ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch}`; \
+ pkg1=$${name}-$${version}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --scripts --to-deb $$pkg1; \
+ $(RM) $$pkg1
+
+deb: deb-modules deb-utils
+
+tgz-local:
+ @(if test "${HAVE_ALIEN}" = "no"; then \
+ echo -e "\n" \
+ "*** Required util ${ALIEN} missing. Please install the\n" \
+ "*** package for your distribution which provides ${ALIEN},\n" \
+ "*** re-run configure, and try again.\n"; \
+ exit 1; \
+ fi)
+
+tgz-modules: tgz-local rpm-modules
+ name=${PACKAGE}-modules; \
+ version=${SPL_META_VERSION}-${SPL_META_RELEASE}; \
+ release=`echo ${LINUX_VERSION} | $(SED) -e "s/-/_/g"`; \
+ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch}`; \
+ pkg1=$${name}-$${version}_$${release}.$${arch}.rpm; \
+ pkg2=$${name}-devel-$${version}_$${release}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2; \
+ $(RM) $$pkg1 $$pkg2
+
+tgz-utils: tgz-local rpm-utils
+ name=${PACKAGE}; \
+ version=${SPL_META_VERSION}-${SPL_META_RELEASE}; \
+ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch}`; \
+ pkg1=$${name}-$${version}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \
+ $(RM) $$pkg1
+
+tgz: tgz-modules tgz-utils
distclean-local::
-$(RM) -R autom4te*.cache
@CONFIG_KERNEL_TRUE@install-data-local:
@CONFIG_KERNEL_TRUE@ destname=spl-$(SPL_META_VERSION)/$(LINUX_VERSION); \
@CONFIG_KERNEL_TRUE@ instdest=$(DESTDIR)/usr/src/$$destname; \
-@CONFIG_KERNEL_TRUE@ echo "${SPL_META_VERSION}" >$$instdest/spl.release; \
+@CONFIG_KERNEL_TRUE@ echo "$(SPL_META_VERSION)" >$$instdest/spl.release; \
@CONFIG_KERNEL_TRUE@ for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \
@CONFIG_KERNEL_TRUE@ $(INSTALL) -D $$instfile $$instdest/$$instfile; \
@CONFIG_KERNEL_TRUE@ done
include $(top_srcdir)/config/Rules.am
DEFAULT_INCLUDES += \
- -I${top_srcdir}/lib
+ -I$(top_srcdir)/lib
sbin_PROGRAMS = spl splat
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h \
- -I${top_srcdir}/lib
+DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h \
+ -I$(top_srcdir)/lib
AM_LIBTOOLFLAGS = --silent
AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing \
-D__USE_LARGEFILE64 ${DEBUG_CFLAGS}
# Common rules for user space components.
###############################################################################
-DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h
+DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h
AM_LIBTOOLFLAGS = --silent
AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing
AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_KERNEL
- dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other
- dnl # compiler options are added by the kernel build system.
- abs_srcdir=`readlink -f ${srcdir}`
- KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir}/include"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -include ${abs_srcdir}/spl_config.h"
-
if test "${LINUX_OBJ}" != "${LINUX}"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
fi
-
AC_SUBST(KERNELMAKE_PARAMS)
+
+ KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
AC_SUBST(KERNELCPPFLAGS)
SPL_AC_DEBUG
- abs_srcdir=`readlink -f ${srcdir}`
- KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir}/include"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -include ${abs_srcdir}/spl_config.h"
-
if test "${LINUX_OBJ}" != "${LINUX}"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
fi
+ KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
- abs_srcdir=`readlink -f ${srcdir}`
- KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir}/include"
- KERNELCPPFLAGS="$KERNELCPPFLAGS -include ${abs_srcdir}/spl_config.h"
-
if test "${LINUX_OBJ}" != "${LINUX}"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
fi
+ KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
case $ac_file$ac_mode in
"spl_config.h":H)
(mv spl_config.h spl_config.h.tmp &&
- awk -f config/config.awk spl_config.h.tmp >spl_config.h &&
+ awk -f ${ac_srcdir}/config/config.awk spl_config.h.tmp >spl_config.h &&
rm spl_config.h.tmp) || exit 1 ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
AM_INIT_AUTOMAKE([$SPL_META_NAME], [$SPL_META_VERSION])
AC_CONFIG_HEADERS([spl_config.h], [
(mv spl_config.h spl_config.h.tmp &&
- awk -f config/config.awk spl_config.h.tmp >spl_config.h &&
+ awk -f ${ac_srcdir}/config/config.awk spl_config.h.tmp >spl_config.h &&
rm spl_config.h.tmp) || exit 1])
AC_PROG_INSTALL
# noinst_HEADERS because they are not installed in the usual include
# location. We do not want to be using $includedir for this.
# Installation is handled by the custom install-data-local rule.
-noinst_HEADERS = *.h
-noinst_HEADERS += fs/*.h
-noinst_HEADERS += linux/*.h
-noinst_HEADERS += rpc/*.h
-noinst_HEADERS += sharefs/*.h
-noinst_HEADERS += sys/fm/*.h
-noinst_HEADERS += sys/fs/*.h
-noinst_HEADERS += sys/sysevent/*.h
-noinst_HEADERS += sys/*.h
-noinst_HEADERS += util/*.h
-noinst_HEADERS += vm/*.h
+noinst_HEADERS = $(top_srcdir)/include/*.h
+noinst_HEADERS += $(top_srcdir)/include/fs/*.h
+noinst_HEADERS += $(top_srcdir)/include/linux/*.h
+noinst_HEADERS += $(top_srcdir)/include/rpc/*.h
+noinst_HEADERS += $(top_srcdir)/include/sharefs/*.h
+noinst_HEADERS += $(top_srcdir)/include/sys/fm/*.h
+noinst_HEADERS += $(top_srcdir)/include/sys/fs/*.h
+noinst_HEADERS += $(top_srcdir)/include/sys/sysevent/*.h
+noinst_HEADERS += $(top_srcdir)/include/sys/*.h
+noinst_HEADERS += $(top_srcdir)/include/util/*.h
+noinst_HEADERS += $(top_srcdir)/include/vm/*.h
install-data-local:
destname=spl-$(SPL_META_VERSION)/$(LINUX_VERSION); \
# noinst_HEADERS because they are not installed in the usual include
# location. We do not want to be using $includedir for this.
# Installation is handled by the custom install-data-local rule.
-noinst_HEADERS = *.h fs/*.h linux/*.h rpc/*.h sharefs/*.h sys/fm/*.h \
- sys/fs/*.h sys/sysevent/*.h sys/*.h util/*.h vm/*.h
+noinst_HEADERS = $(top_srcdir)/include/*.h \
+ $(top_srcdir)/include/fs/*.h $(top_srcdir)/include/linux/*.h \
+ $(top_srcdir)/include/rpc/*.h \
+ $(top_srcdir)/include/sharefs/*.h \
+ $(top_srcdir)/include/sys/fm/*.h \
+ $(top_srcdir)/include/sys/fs/*.h \
+ $(top_srcdir)/include/sys/sysevent/*.h \
+ $(top_srcdir)/include/sys/*.h $(top_srcdir)/include/util/*.h \
+ $(top_srcdir)/include/vm/*.h
all: all-am
.SUFFIXES:
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h
+DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h
AM_LIBTOOLFLAGS = --silent
AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing \
-D__USE_LARGEFILE64 ${DEBUG_CFLAGS}
if [ -f Module.markers ]; then $(RM) Module.markers; fi
modules_install:
- # Install the kernel modules
+ @# Install the kernel modules
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
INSTALL_MOD_PATH=$(DESTDIR) \
INSTALL_MOD_DIR=addon/spl $@
- find ${DESTDIR}/lib/modules/ -name 'modules.*' | xargs ${RM}
- sysmap=${DESTDIR}/boot/System.map-@LINUX_VERSION@; \
+ find $(DESTDIR)/lib/modules/ -name 'modules.*' | xargs $(RM)
+ sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \
if [ -f $$sysmap ]; then \
depmod -ae -F $$sysmap @LINUX_VERSION@; \
fi
modules_uninstall:
- # Uninstall the kernel modules
- $(RM) -R ${DESTDIR}/lib/modules/@LINUX_VERSION@/addon/spl
+ @# Uninstall the kernel modules
+ $(RM) -R $(DESTDIR)/lib/modules/@LINUX_VERSION@/addon/spl
distdir:
list='$(subdir-m)'; for subdir in $$list; do \
- (find $$subdir -name '*.c' -o -name '*.h' | \
+ (find @top_srcdir@/module/$$subdir -name '*.c' -o -name '*.h' |\
xargs /bin/cp -t $$distdir/$$subdir); \
done
# Makefile.in for spl kernel module
MODULES := spl
-EXTRA_CFLAGS = @KERNELCPPFLAGS@
+EXTRA_CFLAGS = @KERNELCPPFLAGS@
+EXTRA_CFLAGS += -I@abs_top_srcdir@/include
+EXTRA_CFLAGS += -include @abs_top_builddir@/spl_config.h
# Solaris porting layer module
obj-m := spl.o
-spl-objs += spl-debug.o
-spl-objs += spl-proc.o
-spl-objs += spl-kmem.o
-spl-objs += spl-thread.o
-spl-objs += spl-taskq.o
-spl-objs += spl-rwlock.o
-spl-objs += spl-vnode.o
-spl-objs += spl-err.o
-spl-objs += spl-time.o
-spl-objs += spl-kobj.o
-spl-objs += spl-module.o
-spl-objs += spl-generic.o
-spl-objs += spl-atomic.o
-spl-objs += spl-mutex.o
-spl-objs += spl-kstat.o
-spl-objs += spl-condvar.o
-spl-objs += spl-xdr.o
-spl-objs += spl-cred.o
+spl-objs += @top_srcdir@/module/spl/spl-debug.o
+spl-objs += @top_srcdir@/module/spl/spl-proc.o
+spl-objs += @top_srcdir@/module/spl/spl-kmem.o
+spl-objs += @top_srcdir@/module/spl/spl-thread.o
+spl-objs += @top_srcdir@/module/spl/spl-taskq.o
+spl-objs += @top_srcdir@/module/spl/spl-rwlock.o
+spl-objs += @top_srcdir@/module/spl/spl-vnode.o
+spl-objs += @top_srcdir@/module/spl/spl-err.o
+spl-objs += @top_srcdir@/module/spl/spl-time.o
+spl-objs += @top_srcdir@/module/spl/spl-kobj.o
+spl-objs += @top_srcdir@/module/spl/spl-module.o
+spl-objs += @top_srcdir@/module/spl/spl-generic.o
+spl-objs += @top_srcdir@/module/spl/spl-atomic.o
+spl-objs += @top_srcdir@/module/spl/spl-mutex.o
+spl-objs += @top_srcdir@/module/spl/spl-kstat.o
+spl-objs += @top_srcdir@/module/spl/spl-condvar.o
+spl-objs += @top_srcdir@/module/spl/spl-xdr.o
+spl-objs += @top_srcdir@/module/spl/spl-cred.o
MODULES := splat
EXTRA_CFLAGS = @KERNELCPPFLAGS@
+EXTRA_CFLAGS += -I@abs_top_srcdir@/include
+EXTRA_CFLAGS += -include @abs_top_builddir@/spl_config.h
# Solaris Porting LAyer Tests
obj-m := splat.o
-splat-objs += splat-ctl.o
-splat-objs += splat-kmem.o
-splat-objs += splat-taskq.o
-splat-objs += splat-random.o
-splat-objs += splat-mutex.o
-splat-objs += splat-condvar.o
-splat-objs += splat-thread.o
-splat-objs += splat-rwlock.o
-splat-objs += splat-time.o
-splat-objs += splat-vnode.o
-splat-objs += splat-kobj.o
-splat-objs += splat-atomic.o
-splat-objs += splat-list.o
-splat-objs += splat-generic.o
-splat-objs += splat-cred.o
+splat-objs += @top_srcdir@/module/splat/splat-ctl.o
+splat-objs += @top_srcdir@/module/splat/splat-kmem.o
+splat-objs += @top_srcdir@/module/splat/splat-taskq.o
+splat-objs += @top_srcdir@/module/splat/splat-random.o
+splat-objs += @top_srcdir@/module/splat/splat-mutex.o
+splat-objs += @top_srcdir@/module/splat/splat-condvar.o
+splat-objs += @top_srcdir@/module/splat/splat-thread.o
+splat-objs += @top_srcdir@/module/splat/splat-rwlock.o
+splat-objs += @top_srcdir@/module/splat/splat-time.o
+splat-objs += @top_srcdir@/module/splat/splat-vnode.o
+splat-objs += @top_srcdir@/module/splat/splat-kobj.o
+splat-objs += @top_srcdir@/module/splat/splat-atomic.o
+splat-objs += @top_srcdir@/module/splat/splat-list.o
+splat-objs += @top_srcdir@/module/splat/splat-generic.o
+splat-objs += @top_srcdir@/module/splat/splat-cred.o
EXTRA_DIST = check.sh
check:
- ./check.sh
+ $(top_srcdir)/scripts/check.sh
check:
- ./check.sh
+ $(top_srcdir)/scripts/check.sh
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.