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]
37 AM_INIT_AUTOMAKE(zfs, 0.4.0)
38 AC_CONFIG_HEADERS([zfs_config.h])
56 ZFS_AC_2ARGS_BIO_END_IO_T
70 # Check for needed userspace bits
71 AC_CHECK_HEADERS(sys/types.h sys/byteorder.h sys/isa_defs.h \
72 sys/systeminfo.h sys/u8_textprep.h libdiskmgt.h)
74 AC_CHECK_FUNCS(strlcat strlcpy strnlen issetugid setmntent getexecname)
76 AC_CHECK_LIB([diskmgt], [libdiskmgt_error],
77 [AC_DEFINE([HAVE_LIBDISKMGT], 1,
78 [Define to 1 if 'libdiskmgt' library available])])
80 AC_CHECK_LIB([efi], [efi_alloc_and_init],
81 [AC_DEFINE([HAVE_LIBEFI], 1,
82 [Define to 1 if 'libefi' library available])])
84 AC_CHECK_LIB([share], [sa_init],
85 [AC_DEFINE([HAVE_LIBSHARE], 1,
86 [Define to 1 if 'libshare' library available])])
88 AC_EGREP_HEADER(ioctl, unistd.h,
89 [AC_DEFINE([HAVE_IOCTL_IN_UNISTD_H], 1,
90 [Define to 1 if ioctl() is defined in <unistd.h> header file])])
92 AC_EGREP_HEADER(ioctl, sys/ioctl.h,
93 [AC_DEFINE([HAVE_IOCTL_IN_SYS_IOCTL_H], 1,
94 [Define to 1 if ioctl() is defined in <sys/ioctl.h> header file])])
96 AC_EGREP_HEADER(ioctl, stropts.h,
97 [AC_DEFINE([HAVE_IOCTL_IN_STROPTS_H], 1,
98 [Define to 1 if ioctl() is defined in <stropts.h> header file])])
100 AC_EGREP_HEADER(strcmp, strings.h,
101 [AC_DEFINE([HAVE_STRCMP_IN_STRINGS_H], 1,
102 [Define to 1 if strcmpl() is defined in <strings.h> header file])])
104 AC_EGREP_HEADER(sysinfo, sys/systeminfo.h,
105 [AC_DEFINE([HAVE_SYSINFO_IN_SYS_SYSTEMINFO_H], 1,
106 [Define to 1 if sysinfo() is defined in <sys/systeminfo.h> header file])])
108 #AC_DEFINE([HAVE_ZVOL], 1, ["Define to 1 to include ZVOL support"])
109 #AC_DEFINE([HAVE_ZPL], 1, ["Define to 1 to include ZPL support"])
110 #AC_DEFINE([WANT_FAKE_IOCTL], 1, ["Define to 1 to use fake ioctl() support"])
111 #AC_DEFINE([HAVE_DM_INUSE_SWAP], 1, ["None"])
112 #AC_DEFINE([HAVE_UNICODE], 1, ["None"])
113 #AC_DEFINE([HAVE_INTTYPES], 1, [Define to 1 if unint16 defined in <sys/types.h> header file])
115 # Add "V=1" to KERNELMAKE_PARAMS to enable verbose module build
117 KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL -I$splsrc -I$splsrc/include -I$TOPDIR"
119 # Minimally required for pread() functionality an other GNU goodness
120 HOSTCFLAGS="$HOSTCFLAGS -ggdb -O2 -std=c99 -D_GNU_SOURCE -D__EXTENSIONS__ "
121 # Quiet warnings not covered by the gcc-* patches
122 HOSTCFLAGS="$HOSTCFLAGS -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses "
123 HOSTCFLAGS="$HOSTCFLAGS -Wno-uninitialized -fno-strict-aliasing "
124 # Expected defines not covered by zfs_config.h
125 HOSTCFLAGS="$HOSTCFLAGS -DHAVE_SPL -D_POSIX_PTHREAD_SEMANTICS "
126 HOSTCFLAGS="$HOSTCFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT "
127 HOSTCFLAGS="$HOSTCFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\" "
128 # Expected default include paths additional paths added by Makefiles
129 HOSTCFLAGS="$HOSTCFLAGS -I$TOPDIR "
131 if test "$kernelbuild" != "$kernelsrc"; then
132 KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$kernelbuild"
135 AC_SUBST(KERNELMAKE_PARAMS)
136 AC_SUBST(KERNELCPPFLAGS)
139 AC_CONFIG_FILES([ Makefile
145 zfs/lib/libudmu/include/Makefile
146 zfs/lib/libudmu/Makefile
148 zfs/lib/libnvpair/include/sys/Makefile
149 zfs/lib/libnvpair/include/Makefile
150 zfs/lib/libnvpair/Makefile
151 zfs/lib/libsolcompat/sparc64/Makefile
152 zfs/lib/libsolcompat/Makefile
153 zfs/lib/libsolcompat/include/tsol/Makefile
154 zfs/lib/libsolcompat/include/sparc64/sys/Makefile
155 zfs/lib/libsolcompat/include/sparc64/Makefile
156 zfs/lib/libsolcompat/include/rpc/Makefile
157 zfs/lib/libsolcompat/include/i386/sys/Makefile
158 zfs/lib/libsolcompat/include/i386/Makefile
159 zfs/lib/libsolcompat/include/ia32/sys/Makefile
160 zfs/lib/libsolcompat/include/ia32/Makefile
161 zfs/lib/libsolcompat/include/amd64/sys/Makefile
162 zfs/lib/libsolcompat/include/amd64/Makefile
163 zfs/lib/libsolcompat/include/sys/sysevent/Makefile
164 zfs/lib/libsolcompat/include/sys/fm/Makefile
165 zfs/lib/libsolcompat/include/sys/Makefile
166 zfs/lib/libsolcompat/include/Makefile
167 zfs/lib/libsolcompat/i386/Makefile
168 zfs/lib/libsolcompat/amd64/Makefile
169 zfs/lib/libavl/include/sys/Makefile
170 zfs/lib/libavl/include/Makefile
171 zfs/lib/libavl/Makefile
172 zfs/lib/libuutil/include/Makefile
173 zfs/lib/libuutil/Makefile
174 zfs/lib/libzfs/include/Makefile
175 zfs/lib/libzfs/Makefile
176 zfs/lib/libumem/include/Makefile
177 zfs/lib/libumem/Makefile
178 zfs/lib/libumem/sys/Makefile
179 zfs/lib/libzcommon/include/Makefile
180 zfs/lib/libzcommon/include/sys/fm/fs/Makefile
181 zfs/lib/libzcommon/include/sys/fm/Makefile
182 zfs/lib/libzcommon/include/sys/Makefile
183 zfs/lib/libzcommon/include/sys/fs/Makefile
184 zfs/lib/libzcommon/Makefile
185 zfs/lib/libzpool/Makefile
186 zfs/lib/libport/include/sys/Makefile
187 zfs/lib/libport/include/Makefile
188 zfs/lib/libport/Makefile
189 zfs/lib/libdmu-ctl/include/sys/Makefile
190 zfs/lib/libdmu-ctl/include/Makefile
191 zfs/lib/libdmu-ctl/Makefile
192 zfs/zcmd/ztest/Makefile
194 zfs/zcmd/zfs/Makefile
195 zfs/zcmd/zdb/Makefile
196 zfs/zcmd/zinject/Makefile
197 zfs/zcmd/zdump/Makefile
198 zfs/zcmd/zpool/Makefile
202 # HACK: I really, really hate this... but to ensure the kernel build
203 # system compiles C files shared between a library and a kernel module,
204 # we need to ensure each file has a unique make target. To do that
205 # I'm creating symlinks for each shared file at configure time. It
206 # may be possible something better can be done in the Makefile but it
207 # will take some serious investigation and I don't have the time now.
210 echo "Creating symlinks for additional make targets"
211 ln -s $LIBDIR/libport/u8_textprep.c $LIBDIR/libport/ku8_textprep.c
212 ln -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/kavl.c
213 ln -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/uavl.c
214 ln -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/knvpair.c
215 ln -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/unvpair.c
216 ln -s $LIBDIR/libzcommon/zfs_deleg.c $LIBDIR/libzcommon/kzfs_deleg.c
217 ln -s $LIBDIR/libzcommon/zfs_prop.c $LIBDIR/libzcommon/kzfs_prop.c
218 ln -s $LIBDIR/libzcommon/zprop_common.c $LIBDIR/libzcommon/kzprop_common.c
219 ln -s $LIBDIR/libzcommon/compress.c $LIBDIR/libzcommon/kcompress.c
220 ln -s $LIBDIR/libzcommon/list.c $LIBDIR/libzcommon/klist.c
221 ln -s $LIBDIR/libzcommon/zfs_namecheck.c $LIBDIR/libzcommon/kzfs_namecheck.c
222 ln -s $LIBDIR/libzcommon/zfs_comutil.c $LIBDIR/libzcommon/kzfs_comutil.c
223 ln -s $LIBDIR/libzcommon/zpool_prop.c $LIBDIR/libzcommon/kzpool_prop.c