4 # Verify that LUSTRE_VERSION was defined properly
6 AC_DEFUN([LB_CHECK_VERSION],
7 [if test "LUSTRE_VERSION" = "LUSTRE""_VERSION" ; then
8 AC_MSG_ERROR([This script was not built with a version number.])
15 # Handle internal/external libsysio
17 AC_DEFUN([LB_PATH_LIBSYSIO],
19 AC_HELP_STRING([--with-sysio=path],
20 [set path to libsysio source (default is included libsysio)]),
21 [],[with_sysio='yes'])
22 AC_MSG_CHECKING([location of libsysio])
23 enable_sysio="$with_sysio"
26 AC_MSG_RESULT([internal])
27 AC_CHECK_FILE([$srcdir/libsysio/src/rmdir.c],[],[
28 AC_MSG_ERROR([A complete internal libsysio was not found.])
30 AC_CONFIG_SUBDIRS(libsysio)
31 LIBSYSIO_SUBDIR="libsysio"
32 SYSIO='$(top_srcdir)/libsysio'
35 AC_MSG_RESULT([disabled])
38 AC_MSG_RESULT([$with_sysio])
39 AC_CHECK_FILE([$with_sysio/src/libsysio.a],[],[
40 AC_MSG_ERROR([A complete (built) external libsysio was not found.])
46 AC_SUBST(LIBSYSIO_SUBDIR)
51 # LB_PATH_CRAY_PORTALS
53 # Support for external Cray portals
55 AC_DEFUN([LB_PATH_CRAY_PORTALS],
56 [AC_MSG_CHECKING([for Cray portals])
57 AC_ARG_WITH([cray-portals],
58 AC_HELP_STRING([--with-cray-portals=path],
59 [path to cray portals]),
61 if test "$with_cray_portals" != no; then
62 CRAY_PORTALS_PATH=$with_cray_portals
63 CRAY_PORTALS_INCLUDES="$with_cray_portals/include"
64 CRAY_PORTALS_LIBS="$with_cray_portals"
66 ],[with_cray_portals=no])
67 AC_SUBST(CRAY_PORTALS_PATH)
68 AC_MSG_RESULT([$CRAY_PORTALS_PATH])
70 AC_MSG_CHECKING([for Cray portals includes])
71 AC_ARG_WITH([cray-portals-includes],
72 AC_HELP_STRING([--with-cray-portals-includes=path],
73 [path to cray portals includes]),
75 if test "$with_cray_portals_includes" != no; then
76 CRAY_PORTALS_INCLUDES="$with_cray_portals_includes"
79 AC_SUBST(CRAY_PORTALS_INCLUDES)
80 AC_MSG_RESULT([$CRAY_PORTALS_INCLUDES])
82 AC_MSG_CHECKING([for Cray portals libs])
83 AC_ARG_WITH([cray-portals-libs],
84 AC_HELP_STRING([--with-cray-portals-libs=path],
85 [path to cray portals libs]),
87 if test "$with_cray_portals_libs" != no; then
88 CRAY_PORTALS_LIBS="$with_cray_portals_libs"
91 AC_SUBST(CRAY_PORTALS_LIBS)
92 AC_MSG_RESULT([$CRAY_PORTALS_LIBS])
94 if test x$CRAY_PORTALS_INCLUDES != x ; then
95 if test ! -r $CRAY_PORTALS_INCLUDES/portals/api.h ; then
96 AC_MSG_ERROR([Cray portals headers were not found in $CRAY_PORTALS_INCLUDES. Please check the paths passed to --with-cray-portals or --with-cray-portals-includes.])
99 if test x$CRAY_PORTALS_LIBS != x ; then
100 if test ! -r $CRAY_PORTALS_LIBS/libportals.a ; then
101 AC_MSG_ERROR([Cray portals libraries were not found in $CRAY_PORTALS_LIBS. Please check the paths passed to --with-cray-portals or --with-cray-portals-libs.])
105 AC_MSG_CHECKING([whether to use Cray portals])
106 if test x$CRAY_PORTALS_INCLUDES != x -a x$CRAY_PORTALS_LIBS != x ; then
107 with_cray_portals=yes
108 AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
109 CPPFLAGS="-I$CRAY_PORTALS_INCLUDES $CPPFLAGS"
110 EXTRA_KCFLAGS="-I-I$CRAY_PORTALS_INCLUDES $EXTRA_KCFLAGS"
114 AC_MSG_RESULT([$with_cray_portals])
120 # Build kernel modules?
122 AC_DEFUN([LB_CONFIG_MODULES],
123 [AC_MSG_CHECKING([whether to build kernel modules])
124 AC_ARG_ENABLE([modules],
125 AC_HELP_STRING([--disable-modules],
126 [disable building of Lustre kernel modules]),
137 AC_MSG_RESULT([$enable_modules ($target_os)])
139 if test x$enable_modules = xyes ; then
142 LC_LINUX_SUPPORTED([LB_PROG_LINUX],
143 [AC_MSG_ERROR([Modules are not supported on $target_os])])
146 LC_DARWIN_SUPPORTED([LB_PROG_DARWIN],
147 [AC_MSG_ERROR([Modules are not supported on $target_os])])
150 AC_MSG_ERROR([Modules are not supported on $target_os])
161 AC_DEFUN([LB_CONFIG_UTILS],
162 [AC_MSG_CHECKING([whether to build utilities])
163 AC_ARG_ENABLE([utils],
164 AC_HELP_STRING([--disable-utils],
165 [disable building of Lustre utility programs])
166 [],[enable_utils='yes'])
167 if test x$with_cray_portals = xyes ; then
170 AC_MSG_RESULT([$enable_utils])
178 AC_DEFUN([LB_CONFIG_TESTS],
179 [AC_MSG_CHECKING([whether to build Lustre tests])
180 AC_ARG_ENABLE([tests],
181 AC_HELP_STRING([--disable-tests],
182 [disable building of Lustre tests]),
183 [],[enable_tests='yes'])
184 if test x$with_cray_portals = xyes ; then
187 AC_MSG_RESULT([$enable_tests])
195 AC_DEFUN([LB_CONFIG_DOCS],
196 [AC_MSG_CHECKING([whether to build docs])
198 AC_HELP_STRING([--disable-doc],
199 [skip creation of pdf documentation]),
201 if test x$enable_doc = xyes ; then
210 AC_MSG_RESULT([$enable_doc])
215 # LB_CONFIG_INIT_SCRIPTS
217 # our init scripts only work on red hat linux
219 AC_DEFUN([LB_CONFIG_INIT_SCRIPTS],
220 [ENABLE_INIT_SCRIPTS=0
221 if test x$enable_utils = xyes ; then
222 AC_MSG_CHECKING([whether to install init scripts])
223 # our scripts only work on red hat systems
224 if test -f /etc/init.d/functions -a -f /etc/sysconfig/network ; then
225 ENABLE_INIT_SCRIPTS=1
231 AC_SUBST(ENABLE_INIT_SCRIPTS)
237 # add -include config.h
239 AC_DEFUN([LB_CONFIG_HEADERS],
240 [AC_CONFIG_HEADERS([config.h])
241 CPPFLAGS="-include \$(top_builddir)/config.h $CPPFLAGS"
242 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
243 AC_SUBST(EXTRA_KCFLAGS)
249 # defines for including the toplevel Rules
251 AC_DEFUN([LB_INCLUDE_RULES],
252 [INCLUDE_RULES="include $PWD/build/Rules"
253 AC_SUBST(INCLUDE_RULES)
259 # 'fixup' default paths
261 AC_DEFUN([LB_PATH_DEFAULTS],
262 [# directories for binaries
263 AC_PREFIX_DEFAULT([/usr])
268 # Directories for documentation and demos.
269 docdir='${datadir}/doc/$(PACKAGE)'
279 # checks on the C compiler
281 AC_DEFUN([LB_PROG_CC],
283 AC_MSG_CHECKING([for buggy compiler])
284 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
286 AC_MSG_RESULT([buggy compiler found!])
288 echo " '$CC_VERSION'"
289 echo " has been known to generate bad code, "
290 echo " please get an updated compiler."
291 AC_MSG_ERROR([sorry])
293 case "$CC_VERSION" in
297 # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
298 # without "sub $0xc,%esp" to protect the stack from being
299 # stomped on by interrupts (bug 606)
300 "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
303 # mandrake's similar sub 0xc compiler bug
304 # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2
305 "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)")
309 AC_MSG_RESULT([no known problems])
313 # --------- unsigned long long sane? -------
314 AC_CHECK_SIZEOF(unsigned long long, 0)
315 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
316 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
317 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
318 AC_MSG_ERROR([** we assume that sizeof(long long) == 8. Tell phil@clusterfs.com])
321 CPPFLAGS="-I\$(top_srcdir)/lustre/include -I\$(top_srcdir)/portals/include $CPPFLAGS"
323 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
326 LLCFLAGS="-g -Wall -fPIC"
329 # everyone builds against portals and lustre
330 EXTRA_KCFLAGS="-g -I$PWD/portals/include -I$PWD/lustre/include"
331 AC_SUBST(EXTRA_KCFLAGS)
337 # AM_CONDITIONAL instances for everything
338 # (so that portals/lustre can disable some if needed)
339 AC_DEFUN([LB_CONDITIONALS],
340 [AM_CONDITIONAL(MODULES, test x$enable_modules = xyes)
341 AM_CONDITIONAL(UTILS, test x$enable_utils = xyes)
342 AM_CONDITIONAL(TESTS, test x$enable_tests = xyes)
343 AM_CONDITIONAL(DOC, test x$ENABLE_DOC = x1)
344 AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
345 AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1")
347 LB_LINUX_CONDITIONALS
348 LB_DARWIN_CONDITIONALS
357 # main configure steps
359 AC_DEFUN([LB_CONFIGURE],
384 [Makefile:build/Makefile.in.toplevel]
387 build/autoconf/Makefile
400 LLCPPFLAGS: $LLCPPFLAGS
402 EXTRA_KCFLAGS: $EXTRA_KCFLAGS
405 Type 'make' to build Lustre.