home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / pvfs-2.8.1.tar.gz / pvfs-2.8.1.tar / pvfs-2.8.1 / configure.in < prev    next >
Text File  |  2009-03-02  |  39KB  |  1,283 lines

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