2 # This file is part of the ZFS Linux port.
4 # Copyright (c) 2008 Lawrence Livermore National Security, LLC.
5 # Produced at Lawrence Livermore National Laboratory
7 # Brian Behlendorf <behlendorf1@llnl.gov>,
8 # Herb Wartens <wartens2@llnl.gov>,
9 # Jim Garlick <garlick@llnl.gov>
14 # The contents of this file are subject to the terms of the
15 # Common Development and Distribution License, Version 1.0 only
16 # (the "License"). You may not use this file except in compliance
19 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
20 # or http://www.opensolaris.org/os/licensing.
21 # See the License for the specific language governing permissions
22 # and limitations under the License.
24 # When distributing Covered Code, include this CDDL HEADER in each
25 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
26 # If applicable, add the following below this CDDL HEADER, with the
27 # fields enclosed by brackets "[]" replaced with your own identifying
28 # information: Portions Copyright [yyyy] [name of copyright owner]
36 AC_CONFIG_AUX_DIR([config])
38 AM_INIT_AUTOMAKE([$META_NAME], [$META_VERSION])
39 AC_CONFIG_HEADERS([zfs_config.h])
58 ZFS_AC_2ARGS_BIO_END_IO_T
60 # Check for needed userspace bits
61 AC_CHECK_HEADERS(sys/types.h sys/byteorder.h sys/isa_defs.h \
62 sys/systeminfo.h sys/u8_textprep.h libdiskmgt.h)
64 AC_CHECK_FUNCS(strlcat strlcpy strnlen issetugid setmntent getexecname)
66 AC_CHECK_LIB([diskmgt], [libdiskmgt_error],
67 [AC_DEFINE([HAVE_LIBDISKMGT], 1,
68 [Define to 1 if 'libdiskmgt' library available])])
70 AC_CHECK_LIB([efi], [efi_alloc_and_init],
71 [AC_DEFINE([HAVE_LIBEFI], 1,
72 [Define to 1 if 'libefi' library available])])
74 AC_CHECK_LIB([share], [sa_init],
75 [AC_DEFINE([HAVE_LIBSHARE], 1,
76 [Define to 1 if 'libshare' library available])])
78 AC_EGREP_HEADER(ioctl, unistd.h,
79 [AC_DEFINE([HAVE_IOCTL_IN_UNISTD_H], 1,
80 [Define to 1 if ioctl() is defined in <unistd.h> header file])])
82 AC_EGREP_HEADER(ioctl, sys/ioctl.h,
83 [AC_DEFINE([HAVE_IOCTL_IN_SYS_IOCTL_H], 1,
84 [Define to 1 if ioctl() is defined in <sys/ioctl.h> header file])])
86 AC_EGREP_HEADER(ioctl, stropts.h,
87 [AC_DEFINE([HAVE_IOCTL_IN_STROPTS_H], 1,
88 [Define to 1 if ioctl() is defined in <stropts.h> header file])])
90 AC_EGREP_HEADER(strcmp, strings.h,
91 [AC_DEFINE([HAVE_STRCMP_IN_STRINGS_H], 1,
92 [Define to 1 if strcmpl() is defined in <strings.h> header file])])
94 AC_EGREP_HEADER(sysinfo, sys/systeminfo.h,
95 [AC_DEFINE([HAVE_SYSINFO_IN_SYS_SYSTEMINFO_H], 1,
96 [Define to 1 if sysinfo() is defined in <sys/systeminfo.h> header file])])
98 #AC_DEFINE([HAVE_ZVOL], 1, ["Define to 1 to include ZVOL support"])
99 #AC_DEFINE([HAVE_ZPL], 1, ["Define to 1 to include ZPL support"])
100 #AC_DEFINE([WANT_FAKE_IOCTL], 1, ["Define to 1 to use fake ioctl() support"])
101 #AC_DEFINE([HAVE_DM_INUSE_SWAP], 1, ["None"])
102 #AC_DEFINE([HAVE_UNICODE], 1, ["None"])
103 #AC_DEFINE([HAVE_INTTYPES], 1, [Define to 1 if unint16 defined in <sys/types.h> header file])
105 # Add "V=1" to KERNELMAKE_PARAMS to enable verbose module build
107 KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL -I$splsrc -I$splsrc/include -I$TOPDIR"
109 # Minimally required for pread() functionality an other GNU goodness
110 HOSTCFLAGS="$HOSTCFLAGS -ggdb -O2 -std=c99 -D_GNU_SOURCE -D__EXTENSIONS__ "
111 # Quiet warnings not covered by the gcc-* patches
112 HOSTCFLAGS="$HOSTCFLAGS -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses "
113 HOSTCFLAGS="$HOSTCFLAGS -Wno-uninitialized -fno-strict-aliasing "
114 # Expected defines not covered by zfs_config.h
115 HOSTCFLAGS="$HOSTCFLAGS -DHAVE_SPL -D_POSIX_PTHREAD_SEMANTICS "
116 HOSTCFLAGS="$HOSTCFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT "
117 HOSTCFLAGS="$HOSTCFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\" "
118 # Expected default include paths additional paths added by Makefiles
119 HOSTCFLAGS="$HOSTCFLAGS -I$TOPDIR "
121 if test "$kernelbuild" != "$kernelsrc"; then
122 KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$kernelbuild"
125 AC_SUBST(KERNELMAKE_PARAMS)
126 AC_SUBST(KERNELCPPFLAGS)
129 AC_CONFIG_FILES([ Makefile
134 zfs/lib/libudmu/include/Makefile
135 zfs/lib/libudmu/Makefile
137 zfs/lib/libnvpair/include/sys/Makefile
138 zfs/lib/libnvpair/include/Makefile
139 zfs/lib/libnvpair/Makefile
140 zfs/lib/libsolcompat/sparc64/Makefile
141 zfs/lib/libsolcompat/Makefile
142 zfs/lib/libsolcompat/include/tsol/Makefile
143 zfs/lib/libsolcompat/include/sparc64/sys/Makefile
144 zfs/lib/libsolcompat/include/sparc64/Makefile
145 zfs/lib/libsolcompat/include/rpc/Makefile
146 zfs/lib/libsolcompat/include/i386/sys/Makefile
147 zfs/lib/libsolcompat/include/i386/Makefile
148 zfs/lib/libsolcompat/include/ia32/sys/Makefile
149 zfs/lib/libsolcompat/include/ia32/Makefile
150 zfs/lib/libsolcompat/include/amd64/sys/Makefile
151 zfs/lib/libsolcompat/include/amd64/Makefile
152 zfs/lib/libsolcompat/include/sys/sysevent/Makefile
153 zfs/lib/libsolcompat/include/sys/fm/Makefile
154 zfs/lib/libsolcompat/include/sys/Makefile
155 zfs/lib/libsolcompat/include/Makefile
156 zfs/lib/libsolcompat/i386/Makefile
157 zfs/lib/libsolcompat/amd64/Makefile
158 zfs/lib/libavl/include/sys/Makefile
159 zfs/lib/libavl/include/Makefile
160 zfs/lib/libavl/Makefile
161 zfs/lib/libuutil/include/Makefile
162 zfs/lib/libuutil/Makefile
163 zfs/lib/libzfs/include/Makefile
164 zfs/lib/libzfs/Makefile
165 zfs/lib/libumem/include/Makefile
166 zfs/lib/libumem/Makefile
167 zfs/lib/libumem/sys/Makefile
168 zfs/lib/libzcommon/include/Makefile
169 zfs/lib/libzcommon/include/sys/fm/fs/Makefile
170 zfs/lib/libzcommon/include/sys/fm/Makefile
171 zfs/lib/libzcommon/include/sys/Makefile
172 zfs/lib/libzcommon/include/sys/fs/Makefile
173 zfs/lib/libzcommon/Makefile
174 zfs/lib/libzpool/Makefile
175 zfs/lib/libport/include/sys/Makefile
176 zfs/lib/libport/include/Makefile
177 zfs/lib/libport/Makefile
178 zfs/lib/libdmu-ctl/include/sys/Makefile
179 zfs/lib/libdmu-ctl/include/Makefile
180 zfs/lib/libdmu-ctl/Makefile
181 zfs/zcmd/ztest/Makefile
183 zfs/zcmd/zfs/Makefile
184 zfs/zcmd/zdb/Makefile
185 zfs/zcmd/zinject/Makefile
186 zfs/zcmd/zdump/Makefile
187 zfs/zcmd/zpool/Makefile
191 # HACK: I really, really hate this... but to ensure the kernel build
192 # system compiles C files shared between a library and a kernel module,
193 # we need to ensure each file has a unique make target. To do that
194 # I'm creating symlinks for each shared file at configure time. It
195 # may be possible something better can be done in the Makefile but it
196 # will take some serious investigation and I don't have the time now.
199 echo "Creating symlinks for additional make targets"
200 ln -s $LIBDIR/libport/u8_textprep.c $LIBDIR/libport/ku8_textprep.c
201 ln -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/kavl.c
202 ln -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/uavl.c
203 ln -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/knvpair.c
204 ln -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/unvpair.c
205 ln -s $LIBDIR/libzcommon/zfs_deleg.c $LIBDIR/libzcommon/kzfs_deleg.c
206 ln -s $LIBDIR/libzcommon/zfs_prop.c $LIBDIR/libzcommon/kzfs_prop.c
207 ln -s $LIBDIR/libzcommon/zprop_common.c $LIBDIR/libzcommon/kzprop_common.c
208 ln -s $LIBDIR/libzcommon/compress.c $LIBDIR/libzcommon/kcompress.c
209 ln -s $LIBDIR/libzcommon/list.c $LIBDIR/libzcommon/klist.c
210 ln -s $LIBDIR/libzcommon/zfs_namecheck.c $LIBDIR/libzcommon/kzfs_namecheck.c
211 ln -s $LIBDIR/libzcommon/zfs_comutil.c $LIBDIR/libzcommon/kzfs_comutil.c
212 ln -s $LIBDIR/libzcommon/zpool_prop.c $LIBDIR/libzcommon/kzpool_prop.c