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

Revision 9024, 39.9 KB (checked in by mtmoore, 21 months ago)

configure change to support 3.X kernel series

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    elif test -r  $withval/include/generated/utsrelease.h && grep -qE UTS_RELEASE..3\\. $withval/include/generated/utsrelease.h; then
537        vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/generated/utsrelease.h`
538    else
539        AC_MSG_ERROR(The kernel source tree does not appear to be 2.6 or 3.X)
540       
541    fi
542
543    # At least up through 2.6.3 needed to write .__modpost.cmd; this changed
544    # sometime between then and 2.6.10.   Now anybody can compile out-of-tree
545    # modules against a configured kernel tree
546    LINUX_KERNEL_SRC="$withval"
547    BUILD_KERNEL=1
548    , LINUX_KERNEL_SRC=""
549)
550
551dnl
552dnl Enables the kernel module to build if the appropriate
553dnl linux-2.4.x path is specified
554dnl Make sure this is a usable kernel source tree too.
555dnl
556AC_ARG_WITH(kernel24,
557[  --with-kernel24=srcpath Build pvfs2 kernel module against 2.4.x src],
558    if test "x$withval" = "xyes" -o "x$withval" = "x" ; then
559           AC_MSG_ERROR(--with-kernel24 must be given the path to your kernel 2.4.x source.)
560    fi
561    if ! test -d $withval ; then
562           AC_MSG_ERROR(The --with-kernel path $withval is not a directory.)
563    fi
564    if ! test -r $withval/include/linux/version.h ; then
565       AC_MSG_ERROR(The kernel source tree must have been configured.)
566    fi
567    vers=`sed -n '/UTS_RELEASE/{; s/.*"\([0-9]\.[0-9]\).*".*/\1/; p; }' $withval/include/linux/version.h`
568    if ! grep -q UTS_RELEASE..2\\.4\\. $withval/include/linux/version.h ; then
569       AC_MSG_ERROR(The kernel source tree does not appear to be 2.4)
570    fi
571    k24_minor_ver=`echo $vers | cut -b 26- | sed -n 's/\"//p' | head -n 1`
572    tmp_k24_minor_ver=`echo $k24_minor_ver | grep \-`
573    if ! test "x$tmp_k24_minor_ver" = "x"; then
574       tmp_k24_minor_ver=`echo $k24_minor_ver | cut -d- -f1`
575       k24_minor_ver=$tmp_k24_minor_ver
576    fi
577    LINUX24_KERNEL_SRC="$withval" LINUX24_KERNEL_MINOR_VER="`echo $k24_minor_ver| cut -d'.' -f 1`"
578    BUILD_KERNEL=1
579    , LINUX24_KERNEL_SRC="" LINUX24_KERNEL_MINOR_VER="")
580
581AC_SUBST(BUILD_KERNEL)
582
583dnl now that we have the path to kernel source we can feature-test kernels.
584
585oldcflags=$CFLAGS
586if test -z "${LINUX_KERNEL_SRC}"  ; then
587        lk_src=${LINUX24_KERNEL_SRC}
588elif test -z "${LINUX24_KERNEL_SRC}"  ; then
589        lk_src=${LINUX_KERNEL_SRC}
590fi
591
592dnl some kernels (SLES9 2.6.5-7.191, for one) will pass the test for ki_dtor
593dnl but the resulting pvfs2.ko module will be built with internal
594dnl symbols (mmgrab and flush_icache_range). 
595dnl
596dnl if option not given, carry out the test.  Only certain kernels (like SLES
597dnl 9) will need --disable-kernel-aio
598
599AC_ARG_ENABLE(kernel-aio,
600  [  --disable-kernel-aio    Forcibly disable kernel aio],
601  [ enable_kernel_aio=$enableval ],
602  [ enable_kernel_aio=yes ]
603  )
604
605AC_ARG_ENABLE(kernel-sendfile,
606  [  --enable-kernel-sendfile
607                          **EXPERIMENTAL** Forcibly enable kernel sendfile],
608  [ enable_kernel_sendfile=$enableval ],
609  [ enable_kernel_sendfile=no ]
610  )
611
612if test -n "$lk_src" ; then
613    AX_KERNEL_FEATURES
614    AC_DEFINE(WITH_LINUX_KMOD, 1, [Define to build for linux kernel module userspace helper.])
615fi
616
617dnl
618dnl Enabling this option links pvfs2-client-core against libpvfs2-threaded.so.
619dnl Note that even without this option, pvfs2-client-core always requires
620dnl pthreads to run its remount thread.
621dnl
622AC_ARG_ENABLE([threaded-kmod-helper],
623[  --enable-threaded-kmod-helper
624                          **EXPERIMENTAL** Use threads in the kernel
625                          helper application],
626[ if test "x$enableval" = "xyes" ; then
627    THREADED_KMOD_HELPER=yes
628  fi
629])
630AC_SUBST(THREADED_KMOD_HELPER)
631
632dnl PAV configuration needs absolute location of source and build.
633dnl Linux-2.6 module needs absolute location of source, and uses the
634dnl relative location for soft links for out-of-tree builds.
635BUILD_ABSOLUTE_TOP=`pwd`
636SRC_RELATIVE_TOP=`echo $0 | sed -e "s|configure$||"`
637SRC_ABSOLUTE_TOP=`cd $SRC_RELATIVE_TOP ; pwd`
638
639AC_SUBST(LINUX_KERNEL_SRC)
640AC_SUBST(LINUX24_KERNEL_SRC)
641AC_SUBST(LINUX24_KERNEL_MINOR_VER)
642AC_SUBST(BUILD_ABSOLUTE_TOP)
643AC_SUBST(SRC_RELATIVE_TOP)
644AC_SUBST(SRC_ABSOLUTE_TOP)
645
646dnl Optimized code, but never override CFLAGS from command line or environment.
647AC_ARG_ENABLE(fast,
648[  --enable-fast           Disable optional debugging, enable optimizations.],
649[
650if test "x$USR_CFLAGS_SET" = "xno"; then
651    CFLAGS="$CFLAGS -DNDEBUG -O3 -DGOSSIP_DISABLE_DEBUG"
652fi
653])
654
655dnl
656dnl a function to check for FUSE
657dnl
658test_for_fuse()
659{
660  AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
661  if test "x$HAVE_PKGCONFIG" = "xyes" ; then
662    AC_MSG_CHECKING([for FUSE library])
663    if `pkg-config --exists fuse` ; then
664       AC_MSG_RESULT(yes)
665       FUSE_LDFLAGS=`pkg-config --libs fuse`
666       FUSE_CFLAGS=`pkg-config --cflags fuse`
667
668       AC_SUBST(FUSE_LDFLAGS)
669       AC_SUBST(FUSE_CFLAGS)
670       BUILD_FUSE="1"
671       AC_SUBST(BUILD_FUSE)
672    else
673            AC_MSG_ERROR([FUSE: FUSE library not found. Check LD_LIBRARY_PATH.])
674    fi
675  else
676          AC_MSG_ERROR(FUSE: pkg-config not available. Please install pkg-config.)
677  fi
678}
679
680dnl FUSE component
681AC_ARG_ENABLE(fuse,
682[  --enable-fuse           **EXPERIMENTAL** Enable FUSE component],
683[
684if test "x$enableval" = "xyes" ; then
685   test_for_fuse
686   CFLAGS="$CFLAGS -D__PVFS2_ENABLE_FUSE__"
687fi
688],
689)
690
691# default CFLAGS is -g -O2, unless user set CFLAGS or asked for --enable-fast
692if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
693    CFLAGS="$CFLAGS -g -O2"
694fi
695
696dnl Options that are not yet working
697dnl --------------------------------
698dnl AC_ARG_ENABLE(profiling,
699dnl [  --enable-profiling      Enable profiling (using gprof).                     *** not yet working ***],
700dnl CFLAGS="$CFLAGS -pg -fprofile-arcs",
701dnl )
702dnl
703dnl AC_ARG_ENABLE(coverage,
704dnl [  --enable-coverage       Enable coverage analysis (disables optimizations).  *** not yet working ***],
705dnl [ CFLAGS="$CFLAGS -g -pg -ftest-coverage -O0"
706dnl ENABLE_COVERAGE=1 ],
707dnl )
708
709AC_SUBST(ENABLE_COVERAGE)
710
711STRICT_CFLAGS=
712AC_ARG_ENABLE(strict,
713[  --enable-strict         Turn on strict compiler warnings],
714    STRICT_CFLAGS=1)
715AC_SUBST(STRICT_CFLAGS)
716
717dnl Check if user actually wants to see all our build output (compiles, links, etc.).
718AC_ARG_ENABLE(verbose-build,
719[  --enable-verbose-build  Enables full output during build process],
720QUIET_COMPILE=0,
721QUIET_COMPILE=1)
722
723AC_SUBST(QUIET_COMPILE)
724
725dnl
726dnl a function to check for epoll capabilities
727dnl
728test_for_epoll()
729{
730  AC_CHECK_HEADERS(sys/epoll.h)
731  AC_MSG_CHECKING(for epoll functions)
732  AC_TRY_LINK([#include <sys/epoll.h>], [
733        int fd;
734        fd = epoll_create(1);
735        close(fd);
736  ],
737     AC_MSG_RESULT(yes)
738     BUILD_EPOLL=1
739     AC_SUBST(BUILD_EPOLL),
740     AC_MSG_RESULT(no)
741  )
742}
743
744dnl optionally enable use of epoll() on Linux instead of poll()
745dnl optionally disable use of epoll() on Linux instead of poll()
746AC_ARG_ENABLE(epoll,
747[  --enable-epoll          Enable use of epoll for TCP/IP polling
748                          (epoll is enabled by default, this option
749                          ensures no checking is done for x-compiling)
750  --disable-epoll         Disable epoll, use poll instead],
751[
752   if test "x$enableval" = "xyes"; then
753        BUILD_EPOLL=1
754        AC_SUBST(BUILD_EPOLL)
755   fi
756],
757[
758  test_for_epoll
759])
760
761dnl enables a hack to print back traces out of segfault signal handler
762AC_ARG_ENABLE(segv-backtrace,
763[  --disable-segv-backtrace
764                          Disables back traces in segfault signal handler],,
765    AC_MSG_CHECKING(if segv backtrace capable)
766    AC_TRY_COMPILE([
767#include <execinfo.h>
768#define __USE_GNU
769#include <ucontext.h>
770#if !defined(REG_EIP) && !defined(REG_RIP)
771                   choke me
772#endif
773                   ], [],
774                   AC_MSG_RESULT(yes)
775                   PVFS2_SEGV_BACKTRACE=1,
776                   AC_MSG_RESULT(no)
777    )
778)
779AC_SUBST(PVFS2_SEGV_BACKTRACE)
780
781dnl shared or static client library
782AC_ARG_ENABLE(shared,
783[  --enable-shared         Build shared client library],
784[build_shared=$enableval], [build_shared=no])
785AC_SUBST(build_shared)
786
787dnl Bad things happen in the makefile if you happen to --disable-static
788dnl but do not --enable-shared.
789if test "x$build_shared" = "xno" -a "x$build_static" = "xno" ; then
790    AC_MSG_ERROR([Must do --enable-shared or --enable-static or both.])
791fi
792
793dnl See if CC is a GNU compiler.  This may require a real test in future
794dnl versions of autoconf.  In 2.13 it is a side-effect of AC_PROG_CC.  First
795dnl check if it is an Intel compiler; those lie and claim to be gcc but are
796dnl not argument compatible
797INTELC=
798GNUC=
799AC_MSG_CHECKING(whether cc is an Intel compiler)
800AC_TRY_COMPILE([
801#ifndef __ICC
802       choke me
803#endif
804], [],
805    AC_MSG_RESULT(yes)
806    INTELC=1
807    ,
808    AC_MSG_RESULT(no)
809)
810if test "x$INTELC" = "x" ; then
811    if test "x$GCC" = "xyes" ; then
812       GNUC=1
813    fi
814fi
815AC_SUBST(INTELC)
816AC_SUBST(GNUC)
817
818AC_ARG_WITH(efence,
819[  --with-efence=<path>    Use electric fence for malloc debugging.],
820       if test "x$withval" != "xyes" ; then
821              LDFLAGS="${LDFLAGS} -L$withval"
822       fi
823       AC_CHECK_LIB(efence,malloc)
824)
825
826dnl Use compiled-in valgrind annotations?  Give the header path if
827dnl is not in the usual location.  It is common to install the header
828dnl in a subdirectory, so look for that too.  Leave the include path
829dnl in CPPFLAGS if it is not a standard header.
830AC_ARG_WITH(valgrind,
831[  --with-valgrind[=<path>]  Use valgrind annotations for debugging.], [
832    found=no
833    save_cppflags="$CPPFLAGS"
834    AC_MSG_CHECKING(for valgrind.h usability)
835    if test "x$withval" = xyes ; then
836        AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes)
837        if test x$found = xno ; then
838            CPPFLAGS="$CPPFLAGS -I/usr/include/valgrind"
839            AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
840                CPPFLAGS="$save_cppflags")
841        fi
842    else
843        for d in $withval $withval/include \
844                 $withval/valgrind $withval/include/valgrind
845        do
846            CPPFLAGS="$CPPFLAGS -I$d"
847            AC_COMPILE_IFELSE([#include <valgrind.h>], found=yes,
848                CPPFLAGS="$save_cppflags")
849            if test x$found = xyes ; then
850                break
851            fi
852        done
853    fi
854    AC_MSG_RESULT($found)
855    if test x$found = xyes ; then
856        AC_DEFINE(HAVE_VALGRIND_H, 1, Define if include file valgrind.h exists)
857    fi
858])
859
860if test "x$NEED_BERKELEY_DB" = "xyes" ; then
861    dnl
862    dnl make sure that required db development package is installed
863    dnl and valid; path can be specified at configure time
864    dnl
865    AC_ARG_WITH(db,
866           [  --with-db=<dir>         Location of installed DB package (default=/usr)],
867           [AX_BERKELEY_DB(${withval})],
868           [AX_BERKELEY_DB("")])
869fi
870dnl end of NEED_BERKELEY_DB section
871
872if test "x$BUILD_SERVER" = "x1"; then
873        dnl check if -lrt is required
874        AX_CHECK_NEEDS_LIBRT
875fi
876
877case "$host_os" in
878
879    *darwin*)
880        AC_DEFINE([TARGET_OS_DARWIN], 1, Define if on darwin)
881        TARGET_OS_DARWIN=1
882        AC_SUBST(TARGET_OS_DARWIN)
883    ;;
884    *linux*)
885        AC_DEFINE([TARGET_OS_LINUX], 1, Define if on linux)
886        TARGET_OS_LINUX=1
887        AC_SUBST(TARGET_OS_LINUX)
888    ;;
889esac
890
891AC_CHECK_HEADERS(netdb.h)
892AC_CHECK_HEADERS(arpa/inet.h)
893AC_CHECK_HEADERS(sys/socket.h)
894dnl check for gethostbyname function
895AC_MSG_CHECKING(for gethostbyname)
896oldcflags="$CFLAGS"
897CFLAGS="$USR_CFLAGS"
898AC_TRY_COMPILE([
899#include <netdb.h>
900], [
901gethostbyname("localhost");
902],
903AC_MSG_RESULT(yes)
904AC_DEFINE(HAVE_GETHOSTBYNAME, 1, Define if gethostbyname function exists),
905AC_MSG_RESULT(no)
906WARN_ABOUT_HOSTNAMES="yes")
907
908AC_MSG_CHECKING(for gethostbyaddr)
909AC_TRY_COMPILE([
910#include <netdb.h>
911], [
912struct sockaddr_in peer;
913gethostbyaddr((void *)&peer.sin_addr.s_addr, sizeof(struct in_addr), AF_INET);
914],
915AC_MSG_RESULT(yes)
916AC_DEFINE(HAVE_GETHOSTBYADDR, 1, Define if gethostbyaddr function exists),
917AC_MSG_RESULT(no)  )
918
919CFLAGS="$oldcflags"
920
921dnl allow disabling TCP BMI method
922BUILD_BMI_TCP=1
923AC_ARG_WITH(bmi-tcp,
924[  --without-bmi-tcp       Disable BMI TCP method],
925    if test -z "$withval" -o "$withval" = yes ; then
926        :
927    elif test "$withval" = no ; then
928        BUILD_BMI_TCP=
929    else
930        AC_MSG_ERROR([Option --with-tcp requires yes/no argument.])
931    fi
932)
933AC_SUBST(BUILD_BMI_TCP)
934
935dnl
936dnl Configure bmi_gm, if --with-gm or a variant given.
937dnl
938AX_GM
939
940dnl
941dnl Configure bmi_mx, if --with-mx or a variant given.
942dnl
943AX_MX
944
945dnl
946dnl Configure bmi_ib, if --with-ib or a variant given.
947dnl
948AX_IB
949
950dnl
951dnl Configure bmi_portals, if --with-portals or a variant given.
952dnl
953AX_PORTALS
954
955dnl
956dnl Configure bmi_zoid, if --with-zoid or a variant given.
957dnl
958AX_ZOID
959
960dnl
961dnl check if fgetxattr takes extra arguments
962AC_MSG_CHECKING([for fgetxattr extra arguments])
963AC_TRY_COMPILE([
964        #include <sys/types.h>
965        #ifdef HAVE_ATTR_XATTR_H
966        #include <attr/xattr.h>
967        #endif
968        #ifdef HAVE_SYS_XATTR_H
969        #include <sys/xattr.h>
970        #endif
971        ],
972        [
973        fgetxattr(0, 0, 0, 0, 0, 0);
974        ],
975        AC_MSG_RESULT(yes)
976        AC_DEFINE(HAVE_FGETXATTR_EXTRA_ARGS, 1, Define if fgetxattr takes position and option arguments),
977        AC_MSG_RESULT(no)
978)
979
980dnl
981dnl look for sysinfo header
982AC_CHECK_HEADER(sys/sysinfo.h,
983       AC_DEFINE(HAVE_SYSINFO, 1, Define if sysinfo.h is present)
984       )
985
986dnl for regular functions, add another AC_CHECK_FUNCS line
987AC_CHECK_FUNCS(strnlen)
988AC_CHECK_FUNCS(strtoull)
989AC_CHECK_FUNCS(strstr)
990AC_CHECK_FUNCS(fgetxattr)
991AC_CHECK_FUNCS(fsetxattr)
992
993dnl fgetxattr doesn't have a prototype on some systems
994AC_MSG_CHECKING([for fgetxattr prototype])
995AC_TRY_COMPILE([
996        #include <sys/types.h>
997        #ifdef HAVE_ATTR_XATTR_H
998        #include <attr/xattr.h>
999        #endif
1000        #ifdef HAVE_SYS_XATTR_H
1001        #include <sys/xattr.h>
1002        #endif
1003        char * fgetxattr(char *foo);
1004        ], [],
1005        AC_MSG_RESULT(no),
1006        AC_MSG_RESULT(yes)
1007        AC_DEFINE(HAVE_FGETXATTR_PROTOTYPE, 1, Define if system provides fgtxattr prototype)
1008)
1009
1010dnl
1011dnl check if fgetxattr takes extra arguments:  old systems that do not have any
1012dnl sort of fgetxattr should fall back to our faked version.
1013
1014AC_MSG_CHECKING([for fgetxattr extra arguments])
1015AC_TRY_COMPILE([
1016        #include <sys/types.h>
1017        #ifdef HAVE_ATTR_XATTR_H
1018        #include <attr/xattr.h>
1019        #endif
1020        #ifdef HAVE_SYS_XATTR_H
1021        #include <sys/xattr.h>
1022        #endif
1023        ],
1024        [
1025        #ifdef HAVE_FGETXATTR_PROTOTYPE
1026        fgetxattr(0, 0, 0, 0, 0, 0);
1027        #else
1028        #  error
1029        #endif
1030        ],
1031        AC_MSG_RESULT(yes)
1032        AC_DEFINE(HAVE_FGETXATTR_EXTRA_ARGS, 1, Define if fgetxattr takes position and option arguments),
1033        AC_MSG_RESULT(no)
1034)
1035
1036AC_MSG_CHECKING([for fsetxattr extra arguments])
1037AC_TRY_COMPILE([
1038        #include <sys/types.h>
1039        #ifdef HAVE_ATTR_XATTR_H
1040        #include <attr/xattr.h>
1041        #endif
1042        #ifdef HAVE_SYS_XATTR_H
1043        #include <sys/xattr.h>
1044        #endif
1045        ],
1046        [
1047        fsetxattr(0, 0, 0, 0, 0, 0);
1048        ],
1049        AC_MSG_RESULT(yes)
1050        AC_DEFINE(HAVE_FSETXATTR_EXTRA_ARGS, 1, Define if fsetxattr takes position and option arguments),
1051        AC_MSG_RESULT(no)
1052)
1053
1054
1055dnl check for getmntent(), special test
1056AC_FUNC_GETMNTENT
1057
1058dnl if we use headers that might not be on every platform, add them here
1059AC_CHECK_HEADERS(malloc.h)
1060AC_CHECK_HEADERS(mntent.h)
1061
1062AC_ARG_ENABLE(static-server,
1063[  --enable-static-server  Builds the server static],
1064[ staticserver=$enableval ],
1065[ staticserver="no" ] )
1066
1067if test "$staticserver" = "yes"; then
1068        SERVER_LDFLAGS="$LDFLAGS -static"
1069else
1070        SERVER_LDFLAGS="$LDFLAGS -rdynamic"
1071fi
1072
1073AC_SUBST(SERVER_LDFLAGS)
1074
1075dnl this is a special case, used to key off options controlling gossip
1076dnl   backtrace capability
1077AC_CHECK_HEADERS(execinfo.h,
1078        LDFLAGS="$LDFLAGS -rdynamic"
1079        GOSSIP_ENABLE_BACKTRACE=1
1080)
1081AC_SUBST(GOSSIP_ENABLE_BACKTRACE)
1082
1083dnl --
1084dnl Check for SDL
1085AC_MSG_CHECKING([for SDL])
1086SDL_CONFIG=`which sdl-config 2> /dev/null`
1087if ! test -z "$SDL_CONFIG" && test -x "$SDL_CONFIG"; then
1088   AC_MSG_RESULT(yes)
1089   SDL_VERSION=`sdl-config --version`
1090   VISCFLAGS=`sdl-config --cflags`
1091   VISCLIBS=`sdl-config --libs`
1092
1093   dnl We also need SDL ttf support
1094   dnl only define BUILD_VIS if we have all required parts
1095   AC_CHECK_HEADERS(SDL_ttf.h,
1096       [BUILD_VIS="1"
1097        CPPFLAGS="$CPPFLAGS $VISCFLAGS"],
1098        [AC_CHECK_HEADERS(SDL/SDL_ttf.h,
1099            [BUILD_VIS="1"
1100            CPPFLAGS="$CPPFLAGS $VISCFLAGS"],)],
1101)
1102
1103   AC_SUBST(BUILD_VIS)
1104   AC_SUBST(VISCFLAGS)
1105   AC_SUBST(VISLIBS)
1106else
1107   AC_MSG_RESULT(no)
1108fi
1109
1110dnl Which form of strerror?
1111AC_MSG_CHECKING([for GNU-style strerror_r])
1112AC_TRY_COMPILE(
1113    [
1114        #include <string.h>
1115        extern char *strerror_r();
1116    ], [],
1117    AC_MSG_RESULT(yes)
1118    AC_DEFINE(HAVE_GNU_STRERROR_R, 1, Define if strerror_r is GNU-specific)
1119    ,
1120    AC_MSG_RESULT(no)
1121)
1122
1123dnl create any missing subdirectories that wouldn't be created
1124dnl by AC_OUTPUT below (which won't create intermediate dirs).
1125for d in src/apps src/io src/common src/client src/kernel \
1126       doc src/apps/kernel test; do
1127       install -d $d;
1128done
1129
1130dnl output final version of top level makefile and subdirectory
1131dnl    makefile includes
1132AC_OUTPUT(include/pvfs2.h
1133Makefile
1134module.mk
1135src/apps/admin/module.mk
1136src/apps/admin/pvfs2-config
1137src/apps/devel/module.mk
1138src/apps/karma/module.mk
1139src/apps/vis/module.mk
1140src/apps/fuse/module.mk
1141src/apps/kernel/linux/module.mk
1142src/apps/user/module.mk
1143src/io/trove/module.mk
1144src/io/trove/trove-handle-mgmt/module.mk
1145src/io/trove/trove-dbpf/module.mk
1146src/common/misc/module.mk
1147src/common/quickhash/module.mk
1148src/common/quicklist/module.mk
1149src/common/dotconf/module.mk
1150src/common/id-generator/module.mk
1151src/common/gossip/module.mk
1152src/common/gen-locks/module.mk
1153src/common/llist/module.mk
1154src/common/statecomp/module.mk
1155src/common/events/module.mk
1156src/common/mgmt/module.mk
1157src/io/bmi/module.mk
1158src/io/bmi/bmi_tcp/module.mk
1159src/io/bmi/bmi_gm/module.mk
1160src/io/bmi/bmi_mx/module.mk
1161src/io/bmi/bmi_ib/module.mk
1162src/io/bmi/bmi_portals/module.mk
1163src/io/bmi/bmi_zoid/module.mk
1164src/io/description/module.mk
1165src/io/flow/module.mk
1166src/io/flow/flowproto-bmi-trove/module.mk
1167src/io/flow/flowproto-template/module.mk
1168src/io/flow/flowproto-dump-offsets/module.mk
1169src/io/flow/flowproto-bmi-cache/module.mk
1170src/io/buffer/module.mk
1171src/io/job/module.mk
1172src/io/dev/module.mk
1173src/proto/module.mk
1174src/server/module.mk
1175src/server/request-scheduler/module.mk
1176src/client/sysint/module.mk
1177src/kernel/linux-2.6/Makefile
1178src/kernel/linux-2.4/Makefile
1179doc/module.mk
1180doc/coding/module.mk
1181doc/design/module.mk
1182doc/random/module.mk
1183examples/pvfs2-server.rc
1184doc/doxygen/pvfs2-doxygen.conf
1185)
1186
1187chmod +x $BUILD_ABSOLUTE_TOP/src/apps/admin/pvfs2-config
1188
1189# print a summary of the configuration information
1190if test "x$BUILD_BMI_ONLY" = "x1" ; then
1191        AC_MSG_RESULT()
1192        AC_MSG_RESULT([***** Displaying BMI configuration information *****])
1193        AC_MSG_RESULT([----------------------------------------------------])
1194        PKGSTR="BMI"
1195else
1196        AC_MSG_RESULT()
1197        AC_MSG_RESULT([***** Displaying PVFS Configuration Information *****])
1198        AC_MSG_RESULT([------------------------------------------------------])
1199        PKGSTR="PVFS2"
1200fi
1201
1202# print PVFS configs (not used by BMI)
1203if test "x$BUILD_BMI_ONLY" != "x1" ; then
1204
1205if test "x$BUILD_KARMA" = "x1" ; then
1206   AC_MSG_RESULT([PVFS2 configured to build karma gui               : yes])
1207else
1208   AC_MSG_RESULT([PVFS2 configured to build karma gui               :  no])
1209fi
1210
1211if test "x$ENABLE_COVERAGE" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1212   AC_MSG_RESULT([PVFS2 configured to perform coverage analysis     : yes])
1213else
1214   AC_MSG_RESULT([PVFS2 configured to perform coverage analysis     :  no])
1215fi
1216
1217if test "x$MISC_TROVE_FLAGS" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1218   AC_MSG_RESULT([PVFS2 configured for aio threaded callbacks       :  no])
1219else
1220   AC_MSG_RESULT([PVFS2 configured for aio threaded callbacks       : yes])
1221fi
1222
1223if test "x$BUILD_FUSE" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1224   AC_MSG_RESULT([PVFS2 configured to use FUSE                      : yes])
1225else
1226   AC_MSG_RESULT([PVFS2 configured to use FUSE                      :  no])
1227fi
1228
1229if test "x$LINUX_KERNEL_SRC" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1230   AC_MSG_RESULT([PVFS2 configured for the 2.6/3 kernel module      :  no])
1231else
1232   AC_MSG_RESULT([PVFS2 configured for the 2.6/3 kernel module      : yes])
1233fi
1234
1235if test "x$LINUX24_KERNEL_SRC" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1236   AC_MSG_RESULT([PVFS2 configured for the 2.4.x kernel module      :  no])
1237else
1238   AC_MSG_RESULT([PVFS2 configured for the 2.4.x kernel module      : yes])
1239fi
1240
1241if test "x$MMAP_RA_CACHE" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1242   AC_MSG_RESULT([PVFS2 configured for using the mmap-ra-cache      :  no])
1243else
1244   AC_MSG_RESULT([PVFS2 configured for using the mmap-ra-cache      : yes])
1245fi
1246
1247if test "x$REDHAT_RELEASE" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1248   AC_MSG_RESULT([PVFS2 will use workaround for redhat 2.4 kernels  :  no])
1249else
1250   AC_MSG_RESULT([PVFS2 will use workaround for redhat 2.4 kernels  : yes])
1251fi
1252
1253if test "x$NPTL_WORKAROUND" = "x" -a "x$BUILD_BMI_ONLY" != "x1"; then
1254   AC_MSG_RESULT([PVFS2 will use workaround for buggy NPTL          :  no])
1255else
1256   AC_MSG_RESULT([PVFS2 will use workaround for buggy NPTL          : yes])
1257fi
1258
1259if test "x$BUILD_SERVER" = "x1" -a "x$BUILD_BMI_ONLY" != "x1"; then
1260   AC_MSG_RESULT([PVFS2 server will be built                        : yes])
1261else
1262   AC_MSG_RESULT([PVFS2 server will be built                        :  no])
1263
1264fi
1265
1266else
1267
1268# print BMI and PVFS configs
1269if test "x$THREAD_LIB" = "x"; then
1270   AC_MSG_RESULT([$PKGSTR configured for a thread-safe client library :  no])
1271else
1272   AC_MSG_RESULT([$PKGSTR configured for a thread-safe client library : yes])
1273fi
1274
1275if test "x$BUILD_EPOLL" = "x1" ; then
1276   AC_MSG_RESULT([$PKGSTR configured to use epoll                     : yes])
1277else
1278   AC_MSG_RESULT([$PKGSTR configured to use epoll                     :  no])
1279fi
1280
1281if test "x$TRUSTED_CONNECTIONS" = "x" ; then
1282        AC_MSG_RESULT([$PKGSTR configured for using trusted connections    :  no])
1283else
1284        AC_MSG_RESULT([$PKGSTR configured for using trusted connections    : yes])
1285fi
1286
1287fi # end of BMI/PVFS config display
1288
1289if test "x$WARN_ABOUT_HOSTNAMES" = "xyes" ; then
1290   AC_MSG_RESULT(WARNING: gethostbyname is not supported on this machine: ALL ADDRESSES MUST BE IN DOT NOTATION.)
1291fi
1292
1293
1294dnl
1295dnl Warn about potential slowness if using a "fast" network along with
1296dnl TCP.  Polling with timeout in BMI is implemented by sequentially asking
1297dnl each device to poll for half of the timeout.  This leads to a fixed 5 ms
1298dnl delay in the TCP device before the IB device can be queried, for instance.
1299dnl When traffic will only appear on one device, suggest that TCP be disabled.
1300dnl But leave TCP as default on, certainly, as that is what most people want.
1301dnl
1302if test x$BUILD_GM = x1 -o x$BUILD_MX = x1 -o x$BUILD_IB = x1 -o \
1303        x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then
1304    if test x$BUILD_BMI_TCP = x1 ; then
1305        AC_MSG_WARN([You have selected to build $PKGSTR to use a "fast" network
1306                    interface, but have not disabled TCP.  The way this is
1307                    currently implemented will lead to rather slow response
1308                    times on the fast interface.  Suggest you configure with
1309                    "--without-bmi-tcp" for the best performance.])
1310    fi
1311fi
1312
1313if test x$HAVE_DB_OLD = x1; then
1314    AC_MSG_WARN([The detected version of Berkeley DB is not at least 4.8.30.
1315                    Metadata corruption has been documented in versions prior
1316                    to 4.8.30. It is highly recommended that you update the
1317                    version of Berkeley DB you are building against.])
1318fi
1319
1320AC_MSG_RESULT()
1321AC_MSG_RESULT([$PKGSTR version string: $PVFS2_VERSION])
1322
1323AC_MSG_RESULT()
Note: See TracBrowser for help on using the browser.