root/branches/Orange-Branch/configure.in @ 8794

Revision 8794, 39.6 KB (checked in by mtmoore, 2 years ago)

Provide warning during configure if version of berkeley db is not at least 4.8.30

Line 
1dnl **************************************************************
2dnl PVFS2 AUTOCONF SCRIPT
3dnl
4dnl Process this file with autoconf to produce a configure script.
5dnl You may need to use autoheader as well if changing any DEFINEs
6
7dnl sanity checks, output header, location of scripts used here
8AC_INIT(include/pvfs2-types.h)
9AC_PREREQ(2.59)
10AC_CONFIG_AUX_DIR(maint/config)
11
12dnl
13dnl for test builds, insert the build date and time information into
14dnl into the version; for official releases, clear the PVFS2_PRE line
15dnl
16dnl PVFS2 versioning information. 
17dnl An @ in the date string can confuse e.g. scp and 'make kmod'
18CONFIGURE_TIME=`date -u +"%Y-%m-%d-%H%M%S"`
19PVFS2_VERSION_MAJOR=2
20PVFS2_VERSION_MINOR=8
21PVFS2_VERSION_SUB=4
22#PVFS2_VERSION_RELEASE="orangefs"
23#PVFS2_PRE=""
24PVFS2_VERSION_PRE="orangefs-$CONFIGURE_TIME"
25
26PVFS2_VERSION=$PVFS2_VERSION_MAJOR.$PVFS2_VERSION_MINOR.$PVFS2_VERSION_SUB-$PVFS2_VERSION_RELEASE$PVFS2_VERSION_PRE
27AC_SUBST(PVFS2_VERSION)
28AC_DEFINE_UNQUOTED(PVFS2_VERSION_MAJOR, $PVFS2_VERSION_MAJOR, major version number)
29AC_DEFINE_UNQUOTED(PVFS2_VERSION_MINOR, $PVFS2_VERSION_MINOR, minor version number)
30AC_DEFINE_UNQUOTED(PVFS2_VERSION_SUB, $PVFS2_VERSION_SUB, sub version number)
31#AC_DEFINE_UNQUOTED(PVFS2_VERSION_RELEASE, $PVFS2_VERSION_RELEASE, release version number)
32AC_SUBST(PVFS2_VERSION_MAJOR)
33AC_SUBST(PVFS2_VERSION_MINOR)
34AC_SUBST(PVFS2_VERSION_SUB)
35#AC_SUBST(PVFS2_VERSION_RELEASE)
36
37dnl BMI_ONLY_TAG
38
39dnl Checks for host type
40dnl Ensures we can compile on this OS
41AC_CANONICAL_HOST
42
43USR_CFLAGS=$CFLAGS
44if test "x$USR_CFLAGS" = "x"; then
45        USR_CFLAGS_SET=no
46fi
47
48AC_CONFIG_HEADER(pvfs2-config.h)
49
50AC_CHECK_HEADER([pwd.h],
51    [AC_DEFINE(HAVE_GETPWUID, 1, Define if pwd.h exists)])
52AC_CHECK_HEADER([sys/vfs.h],
53                [AC_DEFINE(HAVE_SYS_VFS_H, 1, Define if sys/vfs.h exists)])
54AC_CHECK_HEADER([sys/mount.h],
55                [AC_DEFINE(HAVE_SYS_MOUNT_H, 1, Define if sys/mount.h exists)])
56
57AC_CHECK_HEADERS([mntent.h, fstab.h])
58
59AC_CHECK_HEADERS(stdarg.h)
60
61AC_CHECK_HEADERS(attr/xattr.h)
62AC_CHECK_HEADERS(sys/xattr.h)
63
64AC_CHECK_SIZEOF([long int])
65
66dnl Check for utilities that we need during the build process
67AC_PROG_INSTALL
68AC_PROG_CC
69
70AC_MSG_CHECKING([for required gcc])
71if test "x$GCC" = "x"; then
72        AC_MSG_ERROR(no)
73fi
74
75CFLAGS=$USR_CFLAGS
76
77AC_PROG_CPP
78AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
79if test $HAVE_PERL = "no"; then
80    AC_MSG_ERROR("perl required in PATH to complete build")
81fi
82
83AC_CHECK_PROG(HAVE_FIND, find, yes, no)
84if test $HAVE_FIND = "no"; then
85    AC_MSG_ERROR("find required in PATH complete build")
86fi
87
88AC_CHECK_PROG(HAVE_BISON, bison, yes, no)
89if test $HAVE_BISON = "no"; then
90    AC_MSG_ERROR("bison required in PATH to complete build")
91fi
92
93AC_CHECK_PROG(HAVE_FLEX, flex, yes, no)
94if test $HAVE_FLEX = "no"; then
95    AC_MSG_ERROR("flex required in PATH to complete build")
96fi
97
98AC_MSG_CHECKING([for required Math::BigInt perl module])
99perl -e "use Math::BigInt" 2>&1 > /dev/null
100if test $? != 0; then
101        AC_MSG_ERROR(no)
102else
103        AC_MSG_RESULT(yes)
104fi
105
106if test $host != $build; then
107        AC_CHECK_PROGS(BUILD_CC, gcc cc)
108else
109        BUILD_CC=$CC
110        BUILD_CFLAGS=$BUILD_CFLAGS
111        BUILD_LDFLAGS=$BUILD_LDFLAGS
112fi
113
114AC_SUBST(BUILD_CC)
115AC_SUBST(BUILD_CFLAGS)
116AC_SUBST(BUILD_LDFLAGS)
117
118#
119# Threading options.
120#
121# Client - thread-safe or not
122#   --disable-thread-safety : chooses null or posix locking mechanism
123#   For applications that know they are not multi-threaded, or choose
124#   to handle locking themselves, this configure option can be used to
125#   slightly decrease library-induced latency by removing the locking.
126#
127# Client - job threading
128#   libpvfs2-threaded.{so,a} with __PVFS2_JOB_THREADED__
129#   This option causes the client library to spawn an extra thread
130#   to handle network communications.  In this way, it is possible
131#   that the library can handle new and completed requests from
132#   the application while also interacting with the network.
133#
134#   These separate libraries can not be built using the existing
135#   configure mechanism.  They are only built if required by the
136#   kernel module helper.
137#
138# Server - three options:
139#   trove
140#     (hack Makefile.in)
141#   job
142#     (hack Makefile.in)
143#   aio
144#     --disable-aio-threaded-callbacks
145#
146#   Trove (storage) and job threading in the server are implemented
147#   using #defines, but not exported through the configure mechanism.
148#   AIO threaded callbacks are a separate thread used in conjunction
149#   with trove, and can be disabled through a configure option as
150#   AIO has been found to be buggy on many systems.
151#
152#
153# Kernel module helper - job threading
154#   --enable-threaded-kmod-helper
155#
156#   This is a special client that "helps" applications that access PVFS
157#   through the kernel using normal VFS calls (e.g. "ls").  This
158#   configure options builds it using __PVFS2_JOB_THREADED__ as described
159#   above.  That enables a thread for the network layer and a thread
160#   for the kernel interface.  This has the potential to increase the
161#   rate at which concurrent operations are processed, but has the potential
162#   drawback of somewhat higher overhead for a single operation and lack
163#   of testing.
164#
165#   Enabling this options causes one of libpvfs2-threaded.{so,a} to be
166#   built, depending on --enable-shared and --enable-static.  If both are
167#   enabled, the shared library takes precedence.
168#
169
170dnl a mechanism to turn off threads in the client library
171AC_MSG_CHECKING([for client library thread safety support])
172AC_ARG_ENABLE(thread-safety,
173[  --disable-thread-safety Disables thread safety in the client library],
174[if test "x$enableval" = "xno" ; then
175    LIBCFLAGS="$LIBCFLAGS -D__GEN_NULL_LOCKING__"
176    THREAD_LIB=""
177    AC_MSG_RESULT(no)
178fi],
179[   LIBCFLAGS="$LIBCFLAGS -D__GEN_POSIX_LOCKING__"
180    THREAD_LIB="-lpthread"
181    AC_MSG_RESULT(yes) ])
182
183AC_SUBST(LIBCFLAGS)
184AC_SUBST(THREAD_LIB)
185
186dnl a mechanism to disable building the PVFS2 server
187AC_ARG_ENABLE(server,
188[  --disable-server        Disables building of PVFS2 server],
189[if test "x$enableval" = "xyes" ; then
190    BUILD_SERVER=1
191    NEED_BERKELEY_DB=yes
192else
193    BUILD_SERVER=""
194fi],
195    BUILD_SERVER=1
196    NEED_BERKELEY_DB=yes)
197AC_SUBST(BUILD_SERVER)
198
199AC_ARG_WITH(openssl,
200        [  --with-openssl=<dir>    Build with openssl (default=/usr)
201  --without-openssl       Don't build with openssl.],
202        [AX_OPENSSL(${withval})],
203        [AX_OPENSSL_OPTIONAL])
204
205dnl a mechanism to turn off memory usage statistics in karma (may be
206dnl confusing for some classes of users)
207AC_ARG_ENABLE(karma-mem-usage-stats,
208[  --disable-karma-mem-usage-stats
209                          Disables memory usage stats in karma],
210[if test "x$enableval" = "xno" ; then
211    CFLAGS="$CFLAGS -D__KARMA_DISABLE_MEM_USAGE__"
212fi]
213,)
214
215dnl build only the bmi library
216AC_ARG_ENABLE(bmi-only,
217[  --enable-bmi-only       Build only the BMI library],
218[if test "x$enableval" = "xyes" ; then
219    BUILD_BMI_ONLY=1
220fi]
221,)
222AC_SUBST(BUILD_BMI_ONLY)
223
224dnl if we're only building the BMI lib, disable checks for server and DB.
225if test "x$BUILD_BMI_ONLY" = "x1"; then
226        BUILD_SERVER=""
227        NEED_BERKELEY_DB=no
228        AC_SUBST(BUILD_SERVER)
229        AC_SUBST(NEED_BERKELEY_DB)
230fi
231
232dnl a mechanism to turn off perf counters
233AC_ARG_ENABLE(perf-counters,
234[  --disable-perf-counters Disables pvfs2-server performance counters],
235[if test "x$enableval" = "xno" ; then
236    CFLAGS="$CFLAGS -D__PVFS2_DISABLE_PERF_COUNTERS__"
237fi]
238,)
239
240dnl a mechanism to turn on mmap-readahead caching (for kernel interface)
241MMAP_RA_CACHE=""
242AC_ARG_ENABLE(mmap-racache,
243[  --enable-mmap-racache   **EXPERIMENTAL** Enables mmap-readahead in kernel
244                          interface],
245[if test "x$enableval" = "xyes" ; then
246MMAP_RA_CACHE="-DUSE_MMAP_RA_CACHE"
247fi]
248,)
249AC_SUBST(MMAP_RA_CACHE)
250
251dnl See if the --enable-trusted-connections  option was given to configure
252AC_ARG_ENABLE(trusted-connections,
253[  --enable-trusted-connections
254                          **EXPERIMENTAL** Enable connects only
255                          from trusted hosts/ports ],
256[if test "x$enableval" = "xyes"; then
257TRUSTED_CONNECTIONS="-DUSE_TRUSTED"
258fi],
259)
260AC_SUBST(TRUSTED_CONNECTIONS)
261
262
263dnl a function to check if we have the required gtk stuff for the
264dnl karma gui
265test_for_karma()
266{
267  AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
268  if test "x$HAVE_PKGCONFIG" = "xyes" ; then
269     AC_MSG_CHECKING([for gtk2.0 (for karma gui)])
270     if `pkg-config --exists gtk+-2.0` ; then
271        AC_MSG_RESULT(yes)
272        GTKLIBS=`pkg-config --libs gtk+-2.0`
273        GTKCFLAGS=`pkg-config --cflags gtk+-2.0`
274
275        AC_SUBST(GTKLIBS)
276        AC_SUBST(GTKCFLAGS)
277        BUILD_KARMA="1"
278        AC_SUBST(BUILD_KARMA)
279     else
280        AC_MSG_RESULT(no)
281     fi
282  fi
283}
284
285dnl optionally disable building the karma gui
286AC_ARG_ENABLE(karma,
287[  --disable-karma         Disables optional gui.  (Enabled by default)],
288[ if test "x$enableval" = "xyes" ; then
289      test_for_karma
290   fi
291],
292[test_for_karma]
293)
294
295dnl shared or static client library (see --enable-shared below)
296AC_ARG_ENABLE(static,
297[  --disable-static        Do not build static client library],
298[build_static=$enableval], [build_static=yes])
299AC_SUBST(build_static)
300
301dnl NOTE: removing the linux-gnu host check for now; we may want to put it back
302dnl before releaseing any code, though...  -Phil
303dnl
304dnl AC_MSG_CHECKING(whether we know how to compile for this OS)
305dnl if test x$host_os != xlinux-gnu; then AC_MSG_ERROR($host_os not supported.)
306dnl else AC_MSG_RESULT(yes)
307dnl fi
308
309dnl some redhat 2.4 kernels have a lot of 2.6 features, so we need to take
310dnl special measures to accomodate those hacked kernels.  However, we do not
311dnl need to take these workarounds if someone is building a stock kernel.org
312dnl kernel. 
313
314dnl was the configure option passed in?
315set_redhat24=0
316dnl what was the configure option set to?
317use_redhat24=0
318
319AC_ARG_ENABLE([redhat24],
320[  --enable-redhat24       Enable workaround for RedHat 2.4 kernel],
321    set_redhat24=1
322    if test "$enableval" = no ; then
323        use_redhat24=0
324    else
325        use_redhat24=1
326    fi
327)
328
329dnl some systems (ie, RedHat EL 3 prior to Update 2) have buggy NPTL/Pthread
330dnl implementations.  We accomodate this with a server stub script hack that
331dnl attempts to disable NPTL and fall back to old fashioned Linux Threads.
332
333dnl was the configure option passed in?
334set_nptl_workaround=0
335dnl what was the configure option set to?
336use_nptl_workaround=0
337
338AC_ARG_ENABLE([nptl-workaround],
339[  --enable-nptl-workaround
340                          Enable workaround for buggy NPTL/Pthread libraries],
341    set_nptl_workaround=1
342    if test "$enableval" = no ; then
343        use_nptl_workaround=0
344    else
345        use_nptl_workaround=1
346    fi
347)
348
349dnl We check for the following redhat tags, as they all have similarly
350dnl modified 2.4.x kernels
351dnl
352RHTAG1="Red Hat Linux release 9"
353RHTAG2="Red Hat Enterprise Linux WS release 3"
354RHTAG3="Red Hat Enterprise Linux AS release 3"
355RHTAG4="Red Hat Enterprise Linux ES release 3"
356RHTAG5="Red Hat Linux Advanced Server release 2.1AS"
357RHTAG6="Fedora Core release 1 (Yarrow)"
358
359
360dnl we won't be able to catch all cases, but see if we can
361dnl get the majority of platforms where we might need to work around
362dnl backported features.  Basically we give up if running on these redhat
363dnl versions
364
365REDHAT_RELEASE=""
366if test -f /etc/redhat-release; then
367    AC_MSG_CHECKING(for tagged Redhat releases (must patch))
368    REDHAT_REL=`cat /etc/redhat-release`
369    if test "x`echo $REDHAT_REL | cut -b 1-23`" = "x$RHTAG1" ||
370       test "x`echo $REDHAT_REL | cut -b 1-37`" = "x$RHTAG2" ||
371       test "x`echo $REDHAT_REL | cut -b 1-37`" = "x$RHTAG3" ||
372       test "x`echo $REDHAT_REL | cut -b 1-37`" = "x$RHTAG4" ||
373       test "x`echo $REDHAT_REL | cut -b 1-43`" = "x$RHTAG5" ||
374       test "x`echo $REDHAT_REL | cut -b 1-30`" = "x$RHTAG6" ; then
375       AC_MSG_RESULT(yes)
376       
377       if test "$set_redhat24" = 0 || test "$set_nptl_workaround" = 0 ; then
378           AC_MSG_ERROR([
379    You appear to be configuring PVFS2 on a RedHat distribution that
380    likely ships with a heavily modified kernel and c library.  You must
381    specify two configure arguments to provide necessary information before
382    proceeding.  First pick one of these two options:
383    =============================
384    --enable-redhat24         (if you are using a redhat provided 2.4 kernel)
385    --disable-redhat24        (if you are using a stock kernel.org kernel)
386    =============================
387    Also pick one of the next two options.  You should probably enable the
388    workaround if you are using RedHat EL 3 prior to update 2.  Otherwise it
389    is probably safer (and higher performance) to disable it:
390    =============================
391    --enable-nptl-workaround  (to work around buggy glibc pthread library)
392    --disable-nptl-workaround (if you trust your glibc pthread library)
393    ============================= ])
394       fi
395    else
396       AC_MSG_RESULT(no)
397    fi
398fi
399
400dnl some non-redhat kernels (like whitebox linux and centos) rebuild
401dnl rhel and give the distribution a different name, so if the user sets
402dnl "enable-redhat24", then use it no matter what /etc/redhat-release might say
403
404if test "$use_redhat24" = 1 ; then
405   REDHAT_RELEASE="-DREDHAT_RELEASE_9"
406fi
407AC_SUBST(REDHAT_RELEASE)
408
409if test "$use_nptl_workaround" = 1 ; then
410   NPTL_WORKAROUND="1"
411fi
412AC_SUBST(NPTL_WORKAROUND)
413
414use_aio_thcb=1
415AC_ARG_ENABLE([aio-threaded-callbacks],
416[  --disable-aio-threaded-callbacks
417                          **EXPERIMENTAL** Disable use of AIO
418                          threaded callbacks],
419    if test "$enableval" = no ; then use_aio_thcb=0 ; fi)
420
421dnl there used to be a big hairy test in here, back when glibc-2.3.0 and
422dnl glibc-2.3.1 had buggy aio callbacks.  That test was broken because it
423dnl assumed just linux, and could not handle glibc-2.4.x (or newer).  Rely on
424dnl aio-threaded-callbacks, perhaps with a blacklist of distros that have the
425dnl broken glibc.
426
427MISC_TROVE_FLAGS=""
428if test $use_aio_thcb = 1 ; then
429        MISC_TROVE_FLAGS="-D__PVFS2_TROVE_AIO_THREADED__"
430fi
431AC_SUBST(MISC_TROVE_FLAGS)
432
433dnl Check for AIO's aiocb->__error_code field (linux has it, OS X doesn't)
434AC_MSG_CHECKING([for __error_code field in aiocb struct])
435AC_TRY_COMPILE(
436    [
437        #include <aio.h>
438    ],
439    [
440        struct aiocb aiocb;
441        aiocb.__error_code = 0;
442    ],
443    AC_MSG_RESULT(yes)
444    AC_DEFINE(HAVE_AIOCB_ERROR_CODE, 1, Define if aiocb->__error_code exists)
445    ,
446    AC_MSG_RESULT(no)
447)
448
449dnl Check for AIO's aiocb->__return_value field (linux has it, OS X doesn't)
450AC_MSG_CHECKING([for __return_value field in aiocb struct])
451AC_TRY_COMPILE(
452    [
453        #include <aio.h>
454    ],
455    [
456        struct aiocb aiocb;
457        aiocb.__return_value = 0;
458    ],
459    AC_MSG_RESULT(yes)
460    AC_DEFINE(HAVE_AIOCB_RETURN_VALUE, 1, Define if aiocb->__return_value exists)
461    ,
462    AC_MSG_RESULT(no)
463)
464dnl Check byte ordering
465AC_C_BIGENDIAN
466
467dnl Check size of pointer type; needed by id-generator
468AC_CHECK_SIZEOF(void *)
469
470dnl Options for debugging
471dnl This particular one enables tracing of memory allocation and
472dnl    freeing with the mtrace tool
473AC_ARG_WITH(mtrace,
474[  --with-mtrace           Use mtrace (must set MALLOC_TRACE to output file)],
475CFLAGS="$CFLAGS -include mcheck.h"
476AC_DEFINE(WITH_MTRACE, 1, Define if mtrace memory leak detection was enabled)
477)
478
479dnl This particular one enables berkeley db to emit detected errors
480AC_ARG_WITH(berkdb-debug,
481[  --with-berkdb-debug     Use berkeley db error reporting (if detected).],
482AC_DEFINE(BERKDB_ERROR_REPORTING, 1, Define if berkeley db error reporting was enabled)
483)
484
485TAU_INCS=
486BUILD_TAU=
487
488dnl use the tau trace library
489AC_ARG_WITH(tau,
490[  --with-tau=path         Use TAU trace library installed in "path"],
491    if test "x$withval" = "xyes" ; then
492           AC_MSG_ERROR(--with-tau must be given a pathname)
493    else
494       TAU_INCS="-I$withval/include"
495       CFLAGS="$CFLAGS $TAU_INCS -D__PVFS2_ENABLE_EVENT__"
496       LDFLAGS="$LDFLAGS -L$withval/$(uname -m)/lib"
497       tau_mkfile=$withval/$(uname -m)/lib/Makefile.*-profile-trace
498       if test ! -f $tau_mkfile; then
499           AC_MSG_ERROR(TAU not compiled with profiling and tracing support)
500       fi
501       tau_config=$(echo $tau_mkfile | sed -e "s|.*Makefile.tau-||")
502       LIBS="$LIBS -lTAU_tf -lTAU_traceinput-$tau_config -ltau-$tau_config -lpthread -lstdc++"
503       AC_DEFINE(HAVE_TAU, 1, [Define if TAU library is used])
504       BUILD_TAU=1
505    fi
506)
507
508AC_SUBST(TAU_INCS)
509AC_SUBST(BUILD_TAU)
510
511BUILD_KERNEL=
512
513dnl
514dnl Enables the kernel module to build if the appropriate
515dnl linux-2.6.x path is specified
516dnl Make sure this is a usable kernel source tree too.
517dnl
518AC_ARG_WITH(kernel,
519[  --with-kernel=srcpath   Build pvfs2 kernel module against 2.6.x src],
520    if test "x$withval" = "xyes" -o "x$withval" = "x" ; then
521           AC_MSG_ERROR(--with-kernel must be given the path to your kernel source.)
522    fi
523    if ! test -d $withval ; then
524           AC_MSG_ERROR(The --with-kernel path $withval is not a directory.)
525    fi
526    if ! test -r $withval/include/linux/version.h ; then
527       AC_MSG_ERROR(The kernel source tree must have been configured.)
528    fi
529
530    if test -r $withval/include/linux/version.h && grep -q UTS_RELEASE..2\\.6\\. $withval/include/linux/version.h ; then
531        vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/linux/version.h`
532    elif test -r $withval/include/linux/utsrelease.h && grep -q UTS_RELEASE..2\\.6\\. $withval/include/linux/utsrelease.h; then
533        vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/linux/utsrelease.h`
534    elif test -r  $withval/include/generated/utsrelease.h && grep -q UTS_RELEASE..2\\.6\\. $withval/include/generated/utsrelease.h; then
535        vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/generated/utsrelease.h`
536    else
537        AC_MSG_ERROR(The kernel source tree does not appear to be 2.6)
538    fi
539
540    # At least up through 2.6.3 needed to write .__modpost.cmd; this changed
541    # sometime between then and 2.6.10.   Now anybody can compile out-of-tree
542    # modules against a configured kernel tree
543    LINUX_KERNEL_SRC="$withval"
544    BUILD_KERNEL=1
545    , LINUX_KERNEL_SRC=""
546)
547
548dnl
549dnl Enables the kernel module to build if the appropriate
550dnl linux-2.4.x path is specified
551dnl Make sure this is a usable kernel source tree too.
552dnl
553AC_ARG_WITH(kernel24,
554[  --with-kernel24=srcpath Build pvfs2 kernel module against 2.4.x src],
555    if test "x$withval" = "xyes" -o "x$withval" = "x" ; then
556           AC_MSG_ERROR(--with-kernel24 must be given the path to your kernel 2.4.x source.)
557    fi
558    if ! test -d $withval ; then
559           AC_MSG_ERROR(The --with-kernel path $withval is not a directory.)
560    fi
561    if ! test -r $withval/include/linux/version.h ; then
562       AC_MSG_ERROR(The kernel source tree must have been configured.)
563    fi
564    vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/linux/version.h`
565    if ! grep -q UTS_RELEASE..2\\.4\\. $withval/include/linux/version.h ; then
566       AC_MSG_ERROR(The kernel source tree does not appear to be 2.4)
567    fi
568    k24_minor_ver=`echo $vers | cut -b 26- | sed -n 's/\"//p' | head -n 1`
569    tmp_k24_minor_ver=`echo $k24_minor_ver | grep \-`
570    if ! test "x$tmp_k24_minor_ver" = "x"; then
571       tmp_k24_minor_ver=`echo $k24_minor_ver | cut -d- -f1`
572       k24_minor_ver=$tmp_k24_minor_ver
573    fi
574    LINUX24_KERNEL_SRC="$withval" LINUX24_KERNEL_MINOR_VER="`echo $k24_minor_ver| cut -d'.' -f 1`"
575    BUILD_KERNEL=1
576    , LINUX24_KERNEL_SRC="" LINUX24_KERNEL_MINOR_VER="")
577
578AC_SUBST(BUILD_KERNEL)
579
580dnl now that we have the path to kernel source we can feature-test kernels.
581
582oldcflags=$CFLAGS
583if test -z "${LINUX_KERNEL_SRC}"  ; then
584        lk_src=${LINUX24_KERNEL_SRC}
585elif test -z "${LINUX24_KERNEL_SRC}"  ; then
586        lk_src=${LINUX_KERNEL_SRC}
587fi
588
589dnl some kernels (SLES9 2.6.5-7.191, for one) will pass the test for ki_dtor
590dnl but the resulting pvfs2.ko module will be built with internal
591dnl symbols (mmgrab and flush_icache_range). 
592dnl
593dnl if option not given, carry out the test.  Only certain kernels (like SLES
594dnl 9) will need --disable-kernel-aio
595
596AC_ARG_ENABLE(kernel-aio,
597  [  --disable-kernel-aio    Forcibly disable kernel aio],
598  [ enable_kernel_aio=$enableval ],
599  [ enable_kernel_aio=yes ]
600  )
601
602AC_ARG_ENABLE(kernel-sendfile,
603  [  --enable-kernel-sendfile
604                          **EXPERIMENTAL** Forcibly enable kernel sendfile],
605  [ enable_kernel_sendfile=$enableval ],
606  [ enable_kernel_sendfile=no ]
607  )
608
609if test -n "$lk_src" ; then
610    AX_KERNEL_FEATURES
611    AC_DEFINE(WITH_LINUX_KMOD, 1, [Define to build for linux kernel module userspace helper.])
612fi
613
614dnl
615dnl Enabling this option links pvfs2-client-core against libpvfs2-threaded.so.
616dnl Note that even without this option, pvfs2-client-core always requires
617dnl pthreads to run its remount thread.
618dnl
619AC_ARG_ENABLE([threaded-kmod-helper],
620[  --enable-threaded-kmod-helper
621                          **EXPERIMENTAL** Use threads in the kernel
622                          helper application],
623[ if test "x$enableval" = "xyes" ; then
624    THREADED_KMOD_HELPER=yes
625  fi
626])
627AC_SUBST(THREADED_KMOD_HELPER)
628
629dnl PAV configuration needs absolute location of source and build.
630dnl Linux-2.6 module needs absolute location of source, and uses the
631dnl relative location for soft links for out-of-tree builds.
632BUILD_ABSOLUTE_TOP=`pwd`
633SRC_RELATIVE_TOP=`echo $0 | sed -e "s|configure$||"`
634SRC_ABSOLUTE_TOP=`cd $SRC_RELATIVE_TOP ; pwd`
635
636AC_SUBST(LINUX_KERNEL_SRC)
637AC_SUBST(LINUX24_KERNEL_SRC)
638AC_SUBST(LINUX24_KERNEL_MINOR_VER)
639AC_SUBST(BUILD_ABSOLUTE_TOP)
640AC_SUBST(SRC_RELATIVE_TOP)
641AC_SUBST(SRC_ABSOLUTE_TOP)
642
643dnl Optimized code, but never override CFLAGS from command line or environment.
644AC_ARG_ENABLE(fast,
645[  --enable-fast           Disable optional debugging, enable optimizations.],
646[
647if test "x$USR_CFLAGS_SET" = "xno"; then
648    CFLAGS="$CFLAGS -DNDEBUG -O3 -DGOSSIP_DISABLE_DEBUG"
649fi
650])
651
652dnl
653dnl a function to check for FUSE
654dnl
655test_for_fuse()
656{
657  AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
658  if test "x$HAVE_PKGCONFIG" = "xyes" ; then
659    AC_MSG_CHECKING([for FUSE library])
660    if `pkg-config --exists fuse` ; then
661       AC_MSG_RESULT(yes)
662       FUSE_LDFLAGS=`pkg-config --libs fuse`
663       FUSE_CFLAGS=`pkg-config --cflags fuse`
664
665       AC_SUBST(FUSE_LDFLAGS)
666       AC_SUBST(FUSE_CFLAGS)
667       BUILD_FUSE="1"
668       AC_SUBST(BUILD_FUSE)
669    else
670            AC_MSG_ERROR([FUSE: FUSE library not found. Check LD_LIBRARY_PATH.])
671    fi
672  else
673          AC_MSG_ERROR(FUSE: pkg-config not available. Please install pkg-config.)
674  fi
675}
676
677dnl FUSE component
678AC_ARG_ENABLE(fuse,
679[  --enable-fuse           **EXPERIMENTAL** Enable FUSE component],
680[
681if test "x$enableval" = "xyes" ; then
682   test_for_fuse
683   CFLAGS="$CFLAGS -D__PVFS2_ENABLE_FUSE__"
684fi
685],
686)
687
688# default CFLAGS is -g -O2, unless user set CFLAGS or asked for --enable-fast
689if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
690    CFLAGS="$CFLAGS -g -O2"
691fi
692
693dnl Options that are not yet working
694dnl --------------------------------
695dnl AC_ARG_ENABLE(profiling,
696dnl [  --enable-profiling      Enable profiling (using gprof).                     *** not yet working ***],
697dnl CFLAGS="$CFLAGS -pg -fprofile-arcs",
698dnl )
699dnl
700dnl AC_ARG_ENABLE(coverage,
701dnl [  --enable-coverage       Enable coverage analysis (disables optimizations).  *** not yet working ***],
702dnl [ CFLAGS="$CFLAGS -g -pg -ftest-coverage -O0"
703dnl ENABLE_COVERAGE=1 ],
704dnl )
705
706AC_SUBST(ENABLE_COVERAGE)
707
708STRICT_CFLAGS=
709AC_ARG_ENABLE(strict,
710[  --enable-strict         Turn on strict compiler warnings],
711    STRICT_CFLAGS=1)
712AC_SUBST(STRICT_CFLAGS)
713
714dnl Check if user actually wants to see all our build output (compiles, links, etc.).
715AC_ARG_ENABLE(verbose-build,
716[  --enable-verbose-build  Enables full output during build process],
717QUIET_COMPILE=0,
718QUIET_COMPILE=1)
719
720AC_SUBST(QUIET_COMPILE)
721
722dnl
723dnl a function to check for epoll capabilities
724dnl
725test_for_epoll()
726{
727  AC_CHECK_HEADERS(sys/epoll.h)
728  AC_MSG_CHECKING(for epoll functions)
729  AC_TRY_LINK([#include <sys/epoll.h>], [
730        int fd;
731        fd = epoll_create(1);
732        close(fd);
733  ],
734     AC_MSG_RESULT(yes)
735     BUILD_EPOLL=1
736     AC_SUBST(BUILD_EPOLL),
737     AC_MSG_RESULT(no)
738  )
739}
740
741dnl optionally enable use of epoll() on Linux instead of poll()
742dnl optionally disable use of epoll() on Linux instead of poll()
743AC_ARG_ENABLE(epoll,
744[  --enable-epoll          Enable use of epoll for TCP/IP polling
745                          (epoll is enabled by default, this option
746                          ensures no checking is done for x-compiling)
747  --disable-epoll         Disable epoll, use poll instead],
748[
749   if test "x$enableval" = "xyes"; then
750        BUILD_EPOLL=1
751        AC_SUBST(BUILD_EPOLL)
752   fi
753],
754[
755  test_for_epoll
756])
757
758dnl enables a hack to print back traces out of segfault signal handler
759AC_ARG_ENABLE(segv-backtrace,
760[  --disable-segv-backtrace
761                          Disables back traces in segfault signal handler],,
762    AC_MSG_CHECKING(if segv backtrace capable)
763    AC_TRY_COMPILE([
764#include <execinfo.h>
765#define __USE_GNU
766#include <ucontext.h>
767#if !defined(REG_EIP) && !defined(REG_RIP)
768                   choke me
769#endif
770                   ], [],
771                   AC_MSG_RESULT(yes)
772                   PVFS2_SEGV_BACKTRACE=1,
773                   AC_MSG_RESULT(no)
774    )
775)
776AC_SUBST(PVFS2_SEGV_BACKTRACE)
777
778dnl shared or static client library
779AC_ARG_ENABLE(shared,
780[  --enable-shared         Build shared client library],
781[build_shared=$enableval], [build_shared=no])
782AC_SUBST(build_shared)
783
784dnl Bad things happen in the makefile if you happen to --disable-static
785dnl but do not --enable-shared.
786if test "x$build_shared" = "xno" -a "x$build_static" = "xno" ; then
787    AC_MSG_ERROR([Must do --enable-shared or --enable-static or both.])
788fi
789
790dnl See if CC is a GNU compiler.  This may require a real test in future
791dnl versions of autoconf.  In 2.13 it is a side-effect of AC_PROG_CC.  First
792dnl check if it is an Intel compiler; those lie and claim to be gcc but are
793dnl not argument compatible
794INTELC=
795GNUC=
796AC_MSG_CHECKING(whether cc is an Intel compiler)
797AC_TRY_COMPILE([
798#ifndef __ICC
799       choke me
800#endif
801], [],
802    AC_MSG_RESULT(yes)
803    INTELC=1
804    ,
805    AC_MSG_RESULT(no)
806)
807if test "x$INTELC" = "x" ; then
808    if test "x$GCC" = "xyes" ; then
809       GNUC=1
810    fi
811fi
812AC_SUBST(INTELC)
813AC_SUBST(GNUC)
814
815AC_ARG_WITH(efence,
816[  --with-efence=<path>    Use electric fence for malloc debugging.],
817       if test "x$withval" != "xyes" ; then
818              LDFLAGS="${LDFLAGS} -L$withval"
819       fi
820       AC_CHECK_LIB(efence,malloc)
821)
822
823dnl Use compiled-in valgrind annotations?  Give the header path if
824dnl is not in the usual location.  It is common to install the header
825dnl in a subdirectory, so look for that too.  Leave the include path
826dnl in CPPFLAGS if it is not a standard header.
827AC_ARG_WITH(valgrind,
828[  --with-valgrind[=<path>]  Use valgrind annotations for debugging.], [
829    found=no
830    save_cppflags="$CPPFLAGS"
831    AC_MSG_CHECKING(for valgrind.h usability)
832    if test "x$withval" = xyes ; then
833        AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes)
834        if test x$found = xno ; then
835            CPPFLAGS="$CPPFLAGS -I/usr/include/valgrind"
836            AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
837                CPPFLAGS="$save_cppflags")
838        fi
839    else
840        for d in $withval $withval/include \
841                 $withval/valgrind $withval/include/valgrind
842        do
843            CPPFLAGS="$CPPFLAGS -I$d"
844            AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
845                CPPFLAGS="$save_cppflags")
846            if test x$found = xyes ; then
847                break
848            fi
849        done
850    fi
851    AC_MSG_RESULT($found)
852    if test x$found = xyes ; then
853        AC_DEFINE(HAVE_VALGRIND_H, 1, Define if include file valgrind.h exists)
854    fi
855])
856
857if test "x$NEED_BERKELEY_DB" = "xyes" ; then
858    dnl
859    dnl make sure that required db development package is installed
860    dnl and valid; path can be specified at configure time
861    dnl
862    AC_ARG_WITH(db,
863           [  --with-db=<dir>         Location of installed DB package (default=/usr)],
864           [AX_BERKELEY_DB(${withval})],
865           [AX_BERKELEY_DB("")])
866fi
867dnl end of NEED_BERKELEY_DB section
868
869if test "x$BUILD_SERVER" = "x1"; then
870        dnl check if -lrt is required
871        AX_CHECK_NEEDS_LIBRT
872fi
873
874case "$host_os" in
875
876    *darwin*)
877        AC_DEFINE([TARGET_OS_DARWIN], 1, Define if on darwin)
878        TARGET_OS_DARWIN=1
879        AC_SUBST(TARGET_OS_DARWIN)
880    ;;
881    *linux*)
882        AC_DEFINE([TARGET_OS_LINUX], 1, Define if on linux)
883        TARGET_OS_LINUX=1
884        AC_SUBST(TARGET_OS_LINUX)
885    ;;
886esac
887
888AC_CHECK_HEADERS(netdb.h)
889AC_CHECK_HEADERS(arpa/inet.h)
890AC_CHECK_HEADERS(sys/socket.h)
891dnl check for gethostbyname function
892AC_MSG_CHECKING(for gethostbyname)
893oldcflags="$CFLAGS"
894CFLAGS="$USR_CFLAGS"
895AC_TRY_COMPILE([
896#include <netdb.h>
897], [
898gethostbyname("localhost");
899],
900AC_MSG_RESULT(yes)
901AC_DEFINE(HAVE_GETHOSTBYNAME, 1, Define if gethostbyname function exists),
902AC_MSG_RESULT(no)
903WARN_ABOUT_HOSTNAMES="yes")
904
905AC_MSG_CHECKING(for gethostbyaddr)
906AC_TRY_COMPILE([
907#include <netdb.h>
908], [
909struct sockaddr_in peer;
910gethostbyaddr((void *)&peer.sin_addr.s_addr, sizeof(struct in_addr), AF_INET);
911],
912AC_MSG_RESULT(yes)
913AC_DEFINE(HAVE_GETHOSTBYADDR, 1, Define if gethostbyaddr function exists),
914AC_MSG_RESULT(no)  )
915
916CFLAGS="$oldcflags"
917
918dnl allow disabling TCP BMI method
919BUILD_BMI_TCP=1
920AC_ARG_WITH(bmi-tcp,
921[  --without-bmi-tcp       Disable BMI TCP method],
922    if test -z "$withval" -o "$withval" = yes ; then
923        :
924    elif test "$withval" = no ; then
925        BUILD_BMI_TCP=
926    else
927        AC_MSG_ERROR([Option --with-tcp requires yes/no argument.])
928    fi
929)
930AC_SUBST(BUILD_BMI_TCP)
931
932dnl
933dnl Configure bmi_gm, if --with-gm or a variant given.
934dnl
935AX_GM
936
937dnl
938dnl Configure bmi_mx, if --with-mx or a variant given.
939dnl
940AX_MX
941
942dnl
943dnl Configure bmi_ib, if --with-ib or a variant given.
944dnl
945AX_IB
946
947dnl
948dnl Configure bmi_portals, if --with-portals or a variant given.
949dnl
950AX_PORTALS
951
952dnl
953dnl Configure bmi_zoid, if --with-zoid or a variant given.
954dnl
955AX_ZOID
956
957dnl
958dnl check if fgetxattr takes extra arguments
959AC_MSG_CHECKING([for fgetxattr extra arguments])
960AC_TRY_COMPILE([
961        #include <sys/types.h>
962        #ifdef HAVE_ATTR_XATTR_H
963        #include <attr/xattr.h>
964        #endif
965        #ifdef HAVE_SYS_XATTR_H
966        #include <sys/xattr.h>
967        #endif
968        ],
969        [
970        fgetxattr(0, 0, 0, 0, 0, 0);
971        ],
972        AC_MSG_RESULT(yes)
973        AC_DEFINE(HAVE_FGETXATTR_EXTRA_ARGS, 1, Define if fgetxattr takes position and option arguments),
974        AC_MSG_RESULT(no)
975)
976
977dnl
978dnl look for sysinfo header
979AC_CHECK_HEADER(sys/sysinfo.h,
980       AC_DEFINE(HAVE_SYSINFO, 1, Define if sysinfo.h is present)
981       )
982
983dnl for regular functions, add another AC_CHECK_FUNCS line
984AC_CHECK_FUNCS(strnlen)
985AC_CHECK_FUNCS(strtoull)
986AC_CHECK_FUNCS(strstr)
987AC_CHECK_FUNCS(fgetxattr)
988AC_CHECK_FUNCS(fsetxattr)
989
990dnl fgetxattr doesn't have a prototype on some systems
991AC_MSG_CHECKING([for fgetxattr prototype])
992AC_TRY_COMPILE([
993        #include <sys/types.h>
994        #ifdef HAVE_ATTR_XATTR_H
995        #include <attr/xattr.h>
996        #endif
997        #ifdef HAVE_SYS_XATTR_H
998        #include <sys/xattr.h>
999        #endif
1000        char * fgetxattr(char *foo);
1001        ], [],
1002        AC_MSG_RESULT(no),
1003        AC_MSG_RESULT(yes)
1004        AC_DEFINE(HAVE_FGETXATTR_PROTOTYPE, 1, Define if system provides fgtxattr prototype)
1005)
1006
1007dnl
1008dnl check if fgetxattr takes extra arguments:  old systems that do not have any
1009dnl sort of fgetxattr should fall back to our faked version.
1010
1011AC_MSG_CHECKING([for fgetxattr extra arguments])
1012AC_TRY_COMPILE([
1013        #include <sys/types.h>
1014        #ifdef HAVE_ATTR_XATTR_H
1015        #include <attr/xattr.h>
1016        #endif
1017        #ifdef HAVE_SYS_XATTR_H
1018        #include <sys/xattr.h>
1019        #endif
1020        ],
1021        [
1022        #ifdef HAVE_FGETXATTR_PROTOTYPE
1023        fgetxattr(0, 0, 0, 0, 0, 0);
1024        #else
1025        #  error
1026        #endif
1027        ],
1028        AC_MSG_RESULT(yes)
1029        AC_DEFINE(HAVE_FGETXATTR_EXTRA_ARGS, 1, Define if fgetxattr takes position and option arguments),
1030        AC_MSG_RESULT(no)
1031)
1032
1033AC_MSG_CHECKING([for fsetxattr extra arguments])
1034AC_TRY_COMPILE([
1035        #include <sys/types.h>
1036        #ifdef HAVE_ATTR_XATTR_H
1037        #include <attr/xattr.h>
1038        #endif
1039        #ifdef HAVE_SYS_XATTR_H
1040        #include <sys/xattr.h>
1041        #endif
1042        ],
1043        [
1044        fsetxattr(0, 0, 0, 0, 0, 0);
1045        ],
1046        AC_MSG_RESULT(yes)
1047        AC_DEFINE(HAVE_FSETXATTR_EXTRA_ARGS, 1, Define if fsetxattr takes position and option arguments),
1048        AC_MSG_RESULT(no)
1049)
1050
1051
1052dnl check for getmntent(), special test
1053AC_FUNC_GETMNTENT
1054
1055dnl if we use headers that might not be on every platform, add them here
1056AC_CHECK_HEADERS(malloc.h)
1057AC_CHECK_HEADERS(mntent.h)
1058
1059AC_ARG_ENABLE(static-server,
1060[  --enable-static-server  Builds the server static],
1061[ staticserver=$enableval ],
1062[ staticserver="no" ] )
1063
1064if test "$staticserver" = "yes"; then
1065        SERVER_LDFLAGS="$LDFLAGS -static"
1066else
1067        SERVER_LDFLAGS="$LDFLAGS -rdynamic"
1068fi
1069
1070AC_SUBST(SERVER_LDFLAGS)
1071
1072dnl this is a special case, used to key off options controlling gossip
1073dnl   backtrace capability
1074AC_CHECK_HEADERS(execinfo.h,
1075        LDFLAGS="$LDFLAGS -rdynamic"
1076        GOSSIP_ENABLE_BACKTRACE=1
1077)
1078AC_SUBST(GOSSIP_ENABLE_BACKTRACE)
1079
1080dnl --
1081dnl Check for SDL
1082AC_MSG_CHECKING([for SDL])
1083SDL_CONFIG=`which sdl-config 2> /dev/null`
1084if ! test -z "$SDL_CONFIG" && test -x "$SDL_CONFIG"; then
1085   AC_MSG_RESULT(yes)
1086   SDL_VERSION=`sdl-config --version`
1087   VISCFLAGS=`sdl-config --cflags`
1088   VISCLIBS=`sdl-config --libs`
1089
1090   dnl We also need SDL ttf support
1091   dnl only define BUILD_VIS if we have all required parts
1092   AC_CHECK_HEADERS(SDL_ttf.h,
1093       [BUILD_VIS="1"
1094        CPPFLAGS="$CPPFLAGS $VISCFLAGS"],
1095        [AC_CHECK_HEADERS(SDL/SDL_ttf.h,
1096            [BUILD_VIS="1"
1097            CPPFLAGS="$CPPFLAGS $VISCFLAGS"],)],
1098)
1099
1100   AC_SUBST(BUILD_VIS)
1101   AC_SUBST(VISCFLAGS)
1102   AC_SUBST(VISLIBS)
1103else
1104   AC_MSG_RESULT(no)
1105fi
1106
1107dnl Which form of strerror?
1108AC_MSG_CHECKING([for GNU-style strerror_r])
1109AC_TRY_COMPILE(
1110    [
1111        #include <string.h>
1112        extern char *strerror_r();
1113    ], [],
1114    AC_MSG_RESULT(yes)
1115    AC_DEFINE(HAVE_GNU_STRERROR_R, 1, Define if strerror_r is GNU-specific)
1116    ,
1117    AC_MSG_RESULT(no)
1118)
1119
1120dnl create any missing subdirectories that wouldn't be created
1121dnl by AC_OUTPUT below (which won't create intermediate dirs).
1122for d in src/apps src/io src/common src/client src/kernel \
1123       doc src/apps/kernel test; do
1124       install -d $d;
1125done
1126
1127dnl output final version of top level makefile and subdirectory
1128dnl    makefile includes
1129AC_OUTPUT(include/pvfs2.h
1130Makefile
1131module.mk
1132src/apps/admin/module.mk
1133src/apps/admin/pvfs2-config
1134src/apps/devel/module.mk
1135src/apps/karma/module.mk
1136src/apps/vis/module.mk
1137src/apps/fuse/module.mk
1138src/apps/kernel/linux/module.mk
1139src/apps/user/module.mk
1140src/io/trove/module.mk
1141src/io/trove/trove-handle-mgmt/module.mk
1142src/io/trove/trove-dbpf/module.mk
1143src/common/misc/module.mk
1144src/common/quickhash/module.mk
1145src/common/quicklist/module.mk
1146src/common/dotconf/module.mk
1147src/common/id-generator/module.mk
1148src/common/gossip/module.mk
1149src/common/gen-locks/module.mk
1150src/common/llist/module.mk
1151src/common/statecomp/module.mk
1152src/common/events/module.mk
1153src/common/mgmt/module.mk
1154src/io/bmi/module.mk
1155src/io/bmi/bmi_tcp/module.mk
1156src/io/bmi/bmi_gm/module.mk
1157src/io/bmi/bmi_mx/module.mk
1158src/io/bmi/bmi_ib/module.mk
1159src/io/bmi/bmi_portals/module.mk
1160src/io/bmi/bmi_zoid/module.mk
1161src/io/description/module.mk
1162src/io/flow/module.mk
1163src/io/flow/flowproto-bmi-trove/module.mk
1164src/io/flow/flowproto-template/module.mk
1165src/io/flow/flowproto-dump-offsets/module.mk
1166src/io/flow/flowproto-bmi-cache/module.mk
1167src/io/buffer/module.mk
1168src/io/job/module.mk
1169src/io/dev/module.mk
1170src/proto/module.mk
1171src/server/module.mk
1172src/server/request-scheduler/module.mk
1173src/client/sysint/module.mk
1174src/kernel/linux-2.6/Makefile
1175src/kernel/linux-2.4/Makefile
1176doc/module.mk
1177doc/coding/module.mk
1178doc/design/module.mk
1179doc/random/module.mk
1180examples/pvfs2-server.rc
1181doc/doxygen/pvfs2-doxygen.conf
1182)
1183
1184chmod +x $BUILD_ABSOLUTE_TOP/src/apps/admin/pvfs2-config
1185
1186# print a summary of the configuration information
1187if test "x$BUILD_BMI_ONLY" = "x1" ; then
1188        AC_MSG_RESULT()
1189        AC_MSG_RESULT([***** Displaying BMI configuration information *****])
1190        AC_MSG_RESULT([----------------------------------------------------])
1191        PKGSTR="BMI"
1192else
1193        AC_MSG_RESULT()
1194        AC_MSG_RESULT([***** Displaying PVFS Configuration Information *****])
1195        AC_MSG_RESULT([------------------------------------------------------])
1196        PKGSTR="PVFS2"
1197fi
1198
1199# print PVFS configs (not used by BMI)
1200if test "x$BUILD_BMI_ONLY" != "x1" ; then
1201
1202if test "x$BUILD_KARMA" = "x1" ; then
1203   AC_MSG_RESULT([PVFS2 configured to build karma gui               : yes])
1204else
1205   AC_MSG_RESULT([PVFS2 configured to build karma gui               :  no])
1206fi
1207
1208if test "x$ENABLE_COVERAGE" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1209   AC_MSG_RESULT([PVFS2 configured to perform coverage analysis     : yes])
1210else
1211   AC_MSG_RESULT([PVFS2 configured to perform coverage analysis     :  no])
1212fi
1213
1214if test "x$MISC_TROVE_FLAGS" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1215   AC_MSG_RESULT([PVFS2 configured for aio threaded callbacks       :  no])
1216else
1217   AC_MSG_RESULT([PVFS2 configured for aio threaded callbacks       : yes])
1218fi
1219
1220if test "x$BUILD_FUSE" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1221   AC_MSG_RESULT([PVFS2 configured to use FUSE                      : yes])
1222else
1223   AC_MSG_RESULT([PVFS2 configured to use FUSE                      :  no])
1224fi
1225
1226if test "x$LINUX_KERNEL_SRC" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1227   AC_MSG_RESULT([PVFS2 configured for the 2.6.x kernel module      :  no])
1228else
1229   AC_MSG_RESULT([PVFS2 configured for the 2.6.x kernel module      : yes])
1230fi
1231
1232if test "x$LINUX24_KERNEL_SRC" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1233   AC_MSG_RESULT([PVFS2 configured for the 2.4.x kernel module      :  no])
1234else
1235   AC_MSG_RESULT([PVFS2 configured for the 2.4.x kernel module      : yes])
1236fi
1237
1238if test "x$MMAP_RA_CACHE" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1239   AC_MSG_RESULT([PVFS2 configured for using the mmap-ra-cache      :  no])
1240else
1241   AC_MSG_RESULT([PVFS2 configured for using the mmap-ra-cache      : yes])
1242fi
1243
1244if test "x$REDHAT_RELEASE" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1245   AC_MSG_RESULT([PVFS2 will use workaround for redhat 2.4 kernels  :  no])
1246else
1247   AC_MSG_RESULT([PVFS2 will use workaround for redhat 2.4 kernels  : yes])
1248fi
1249
1250if test "x$NPTL_WORKAROUND" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1251   AC_MSG_RESULT([PVFS2 will use workaround for buggy NPTL          :  no])
1252else
1253   AC_MSG_RESULT([PVFS2 will use workaround for buggy NPTL          : yes])
1254fi
1255
1256if test "x$BUILD_SERVER" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1257   AC_MSG_RESULT([PVFS2 server will be built                        : yes])
1258else
1259   AC_MSG_RESULT([PVFS2 server will be built                        :  no])
1260
1261fi
1262
1263else
1264
1265# print BMI and PVFS configs
1266if test "x$THREAD_LIB" = "x"; then
1267   AC_MSG_RESULT([$PKGSTR configured for a thread-safe client library :  no])
1268else
1269   AC_MSG_RESULT([$PKGSTR configured for a thread-safe client library : yes])
1270fi
1271
1272if test "x$BUILD_EPOLL" = "x1" ; then
1273   AC_MSG_RESULT([$PKGSTR configured to use epoll                     : yes])
1274else
1275   AC_MSG_RESULT([$PKGSTR configured to use epoll                     :  no])
1276fi
1277
1278if test "x$TRUSTED_CONNECTIONS" = "x" ; then
1279        AC_MSG_RESULT([$PKGSTR configured for using trusted connections    :  no])
1280else
1281        AC_MSG_RESULT([$PKGSTR configured for using trusted connections    : yes])
1282fi
1283
1284fi # end of BMI/PVFS config display
1285
1286if test "x$WARN_ABOUT_HOSTNAMES" = "xyes" ; then
1287   AC_MSG_RESULT(WARNING: gethostbyname is not supported on this machine: ALL ADDRESSES MUST BE IN DOT NOTATION.)
1288fi
1289
1290
1291dnl
1292dnl Warn about potential slowness if using a "fast" network along with
1293dnl TCP.  Polling with timeout in BMI is implemented by sequentially asking
1294dnl each device to poll for half of the timeout.  This leads to a fixed 5 ms
1295dnl delay in the TCP device before the IB device can be queried, for instance.
1296dnl When traffic will only appear on one device, suggest that TCP be disabled.
1297dnl But leave TCP as default on, certainly, as that is what most people want.
1298dnl
1299if test x$BUILD_GM = x1 -o x$BUILD_MX = x1 -o x$BUILD_IB = x1 -o \
1300        x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then
1301    if test x$BUILD_BMI_TCP = x1 ; then
1302        AC_MSG_WARN([You have selected to build $PKGSTR to use a "fast" network
1303                    interface, but have not disabled TCP.  The way this is
1304                    currently implemented will lead to rather slow response
1305                    times on the fast interface.  Suggest you configure with
1306                    "--without-bmi-tcp" for the best performance.])
1307    fi
1308fi
1309
1310if test x$HAVE_DB_OLD = x1; then
1311    AC_MSG_WARN([The detected version of Berkeley DB is not at least 4.8.30.
1312                    Metadata corruption has been documented in versions prior
1313                    to 4.8.30. It is highly recommended that you update the
1314                    version of Berkeley DB you are building against.])
1315fi
1316
1317AC_MSG_RESULT()
1318AC_MSG_RESULT([$PKGSTR version string: $PVFS2_VERSION])
1319
1320AC_MSG_RESULT()
Note: See TracBrowser for help on using the browser.