mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Allow spl_config.h to be included by dependant packages (updated)
We need dependent packages to be able to include spl_config.h to
build properly. This was partially solved in commit 0cbaeb1 by using
AH_BOTTOM to #undef common #defines (PACKAGE, VERSION, etc) which
autoconf always adds and cannot be easily removed. This solution
works as long as the spl_config.h is included before your projects
config.h. That turns out to be easier said than done. In particular,
this is a problem when your package includes its config.h using the
-include gcc option which ensures the first thing included is your
config.h.
To handle all cases cleanly I have removed the AH_BOTTOM hack and
replaced it with an AC_CONFIG_HEADERS command. This command runs
immediately after spl_config.h is written and with a little awk-foo
it strips the offending #defines from the file. This eliminates
the problem entirely and makes header safe for inclusion.
Also in this change I have removed the few places in the code where
spl_config.h is included. It is now added to the gcc compile line
to ensure the config results are always available.
Finally, I have also disabled the verbose kernel builds. If you
want them back you can always build with 'make V=1'. Since things
are working now they don't need to be on by default.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
DEFAULT_INCLUDES = -I${top_srcdir}
|
||||
DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h
|
||||
|
||||
AM_CFLAGS = -Wall -Wstrict-prototypes -Werror -Wshadow
|
||||
AM_CFLAGS += -D__USE_LARGEFILE64
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Remove default preprocessor define's from config.h
|
||||
# PACKAGE
|
||||
# PACKAGE_BUGREPORT
|
||||
# PACKAGE_NAME
|
||||
# PACKAGE_STRING
|
||||
# PACKAGE_TARNAME
|
||||
# PACKAGE_VERSION
|
||||
# STDC_HEADERS
|
||||
# VERSION
|
||||
|
||||
BEGIN { RS = "" ; FS = "\n" } \
|
||||
!/.#define PACKAGE./ && \
|
||||
!/.#define VERSION./ && \
|
||||
!/.#define STDC_HEADERS./ \
|
||||
{ print $0"\n" }
|
||||
+2
-5
@@ -4,15 +4,12 @@ dnl #
|
||||
AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
|
||||
SPL_AC_KERNEL
|
||||
|
||||
dnl # Kernel build make options
|
||||
dnl # KERNELMAKE_PARAMS="V=1" # Enable verbose module build
|
||||
KERNELMAKE_PARAMS="V=1"
|
||||
|
||||
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 -Werror"
|
||||
KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir} -I${abs_srcdir}/include"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user