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 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / test / configure.in < prev    next >
Text File  |  2010-04-30  |  8KB  |  282 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(correctness/pts/pts.h)
  9. AC_CONFIG_HEADER(pvfs2-test-config.h)
  10. AC_CONFIG_AUX_DIR(maint)
  11.  
  12. USR_CFLAGS=$CFLAGS
  13. if test "x$USR_CFLAGS" = "x"; then
  14.     USR_CFLAGS_SET=no
  15. fi
  16.  
  17. dnl PAV configuration needs absolute location of source and build.
  18. dnl Linux-2.6 module needs absolute location of source, and uses the
  19. dnl relative location for soft links for out-of-tree builds.
  20. BUILD_ABSOLUTE_TOP=`pwd`
  21. SRC_RELATIVE_TOP=$srcdir
  22. SRC_ABSOLUTE_TOP=`cd $srcdir ; pwd`
  23.  
  24. AC_SUBST(BUILD_ABSOLUTE_TOP)
  25. AC_SUBST(SRC_RELATIVE_TOP)
  26. AC_SUBST(SRC_ABSOLUTE_TOP)
  27.  
  28. dnl Check if user actually wants to see all our build output (compiles, links, etc.).
  29. AC_ARG_ENABLE(verbose-build,
  30. [  --enable-verbose-build  Enables full output during build process],
  31. QUIET_COMPILE=0,
  32. QUIET_COMPILE=1)
  33.  
  34. AC_SUBST(QUIET_COMPILE)
  35.  
  36. dnl Check for utilities that we need during the build process
  37. AC_PROG_INSTALL
  38. AC_PROG_CC
  39.  
  40. AC_MSG_CHECKING(whether cc is gcc)
  41. if test "x$GCC" = "x"; then
  42.     AC_MSG_ERROR(pvfs2 currently requires gcc as the compiler)
  43. fi
  44. CFLAGS=$USR_CFLAGS
  45.  
  46. AC_PROG_CPP
  47. AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
  48. AC_CHECK_PROG(HAVE_FIND, find, yes, no)
  49. AC_CHECK_PROG(HAVE_BISON, bison, yes, no)
  50. AC_CHECK_PROG(HAVE_FLEX, flex, yes, no)
  51.  
  52. AC_CHECK_HEADERS(openssl/evp.h)
  53. AC_CHECK_HEADERS(openssl/crypto.h)
  54. AC_CHECK_HEADERS(zlib.h)
  55. dnl See if CC is a GNU compiler.  This may require a real test in future
  56. dnl versions of autoconf.  In 2.13 it is a side-effect of AC_PROG_CC.  First
  57. dnl check if it is an Intel compiler; those lie and claim to be gcc but are
  58. dnl not argument compatible
  59. INTELC=
  60. GNUC=
  61. AC_MSG_CHECKING(whether cc is an Intel compiler)
  62. AC_TRY_COMPILE([
  63. #ifndef __ICC
  64.        choke me
  65. #endif
  66. ], [],
  67.     AC_MSG_RESULT(yes)
  68.     INTELC=1
  69.     ,
  70.     AC_MSG_RESULT(no)
  71. )
  72. if test x$INTELC = x ; then
  73.     if test x$GCC = xyes ; then
  74.     GNUC=1
  75.     fi
  76. fi
  77. AC_SUBST(INTELC)
  78. AC_SUBST(GNUC)
  79.  
  80. AC_ARG_WITH(efence,
  81. [  --with-efence=<path>    Use electric fence for malloc debugging.],
  82.     if test x$withval != xyes ; then
  83.         LDFLAGS="${LDFLAGS} -L$withval"
  84.     fi
  85.     AC_CHECK_LIB(efence,malloc)
  86. )
  87.  
  88. AC_ARG_WITH(zlib,
  89. [  --with-zlib=<path>      Use zlib for checksums.],
  90.         if test x$withval != xyes ; then
  91.                 LDFLAGS="${LDFLAGS} -L$withval"
  92.         fi
  93. )
  94. AC_CHECK_LIB(z, adler32, [
  95.         LIBS="${LIBS} -lz"
  96.         AC_DEFINE(HAVE_LIBZ, 1, Define if libz exists)
  97. ])
  98.  
  99. AC_ARG_WITH(mpi, 
  100. [  --with-mpi=<dir>        Location of the MPI installation],
  101.     if test x$withval = xyes; then
  102.     AC_MSG_ERROR(--with-mpi must be given a pathname)
  103.     else
  104.     MPICC="${withval}/bin/mpicc"
  105.     CFLAGS="${CFLAGS} -I${withval}/include"
  106.     LDFLAGS="${LDFLAGS} -L${withval}/lib"
  107.     BUILD_MPI="1"
  108.     fi
  109. )
  110.  
  111. dnl a mechanism to turn off threads in the client library
  112. AC_ARG_ENABLE(thread-safety,
  113. [  --disable-thread-safety Disables thread safety in the client library],
  114. [if test "x$enableval" = "xno" ; then
  115.     CFLAGS="$CFLAGS -D__GEN_NULL_LOCKING__"
  116.     AC_MSG_RESULT(no)
  117. fi],
  118. [   CFLAGS="$CFLAGS -D__GEN_POSIX_LOCKING__"
  119.     AC_MSG_RESULT(yes) ]
  120. )
  121.  
  122. dnl default paths:
  123. PVFS2_SRC_RELATIVE_TOP="${srcdir}/.."
  124. PVFS2_BUILD_RELATIVE_TOP=".."
  125.  
  126. AC_ARG_WITH(pvfs2-src, 
  127. [  --with-pvfs2-src=<dir>  Location of the PVFS2 src directory],
  128.     if test x$withval = xyes; then
  129.     AC_MSG_ERROR(--with-pvfs2-src must be given a pathname)
  130.     else
  131.     PVFS2_SRC_RELATIVE_TOP="${withval}"
  132.     PVFS2_BUILD_RELATIVE_TOP="${withval}"
  133.     fi
  134. )
  135.  
  136. AC_ARG_WITH(pvfs2-build, 
  137. [  --with-pvfs2-build=<dir> Location of the PVFS2 build dir (if different from src dir)],
  138.     if test x$withval = xyes; then
  139.     AC_MSG_ERROR(--with-pvfs2-build must be given a pathname)
  140.     else
  141.     PVFS2_BUILD_RELATIVE_TOP="${withval}"
  142.     fi
  143. )
  144. AC_SUBST(PVFS2_SRC_RELATIVE_TOP)
  145. AC_SUBST(PVFS2_BUILD_RELATIVE_TOP)
  146.  
  147. AC_ARG_ENABLE(strict,
  148. [  --enable-strict         Turn on strict debugging with gcc],
  149. [
  150. if test "x$USR_CFLAGS_SET" = "xno"; then
  151.     CFLAGS="$CFLAGS -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast"
  152. fi
  153. ],
  154. [
  155. if test "x$USR_CFLAGS_SET" = "xno"; then
  156.     CFLAGS="$CFLAGS -O2"
  157. fi
  158. ])
  159.  
  160. LDFLAGS="${LDFLAGS} -L${PVFS2_BUILD_RELATIVE_TOP}/lib"
  161. CFLAGS="${CFLAGS} -I${PVFS2_SRC_RELATIVE_TOP} -I${PVFS2_SRC_RELATIVE_TOP}/include -I${PVFS2_BUILD_RELATIVE_TOP}"
  162. CPPFLAGS="${CFLAGS} -I${PVFS2_SRC_RELATIVE_TOP} -I${PVFS2_SRC_RELATIVE_TOP}/include -I${PVFS2_BUILD_RELATIVE_TOP}"
  163.  
  164. dnl make sure we actually were supplied all of the PVFS2 components we need
  165. AC_CHECK_HEADER(pvfs2-config.h, ,
  166.     AC_MSG_ERROR("could not find pvfs2-config.h... must specify path to PVFS2 src with --with-pvfs2-src")
  167.     )
  168.  
  169. dnl ask pvfs2-config to tell us what libraries to use for client and server
  170. dnl tests
  171. LIBS="${LIBS} `/bin/sh ${PVFS2_BUILD_RELATIVE_TOP}/src/apps/admin/pvfs2-config --libs`"
  172. SERVERLIBS=`/bin/sh ${PVFS2_BUILD_RELATIVE_TOP}/src/apps/admin/pvfs2-config --serverlibs`
  173. PVFS2_TOP_PREFIX=`/bin/sh ${PVFS2_BUILD_RELATIVE_TOP}/src/apps/admin/pvfs2-config --prefix`
  174. AC_SUBST(SERVERLIBS)
  175. AC_SUBST(PVFS2_TOP_PREFIX)
  176.  
  177. dnl make sure the libs exist and work
  178. AC_CHECK_LIB(pvfs2, PVFS_sys_create, ,
  179.     AC_MSG_ERROR("could not find libpvfs2... must specify path to PVFS2 installation or build tree with --with-pvfs2-build")
  180.     )
  181.  
  182. MPI_INTELC=
  183. MPI_GNUC=
  184. if test x$BUILD_MPI = x1; then
  185.     AC_MSG_CHECKING(whether the mpicc compiler works)
  186.     saveCC="$CC"
  187.     CC="$MPICC"
  188.     AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
  189.     AC_MSG_RESULT(yes),
  190.     AC_MSG_RESULT(no)
  191.     AC_MSG_ERROR($CC doesn't appear to be a valid MPI compiler)
  192.     )
  193.     dnl See if mpicc is a GNU compiler, notice that intel compiler claims
  194.     dnl it is GCC, but isn't argument compatible, hence check it first.
  195.     AC_MSG_CHECKING(whether mpicc is an Intel compiler)
  196.     AC_TRY_COMPILE([
  197.     #ifndef __ICC
  198.        choke me
  199.     #endif
  200.     ], [],
  201.     AC_MSG_RESULT(yes)
  202.     MPI_INTELC=1
  203.     ,
  204.     AC_MSG_RESULT(no)
  205.     )
  206.     if test x$MPI_INTELC = x; then
  207.     AC_MSG_CHECKING(whether mpicc is a GNU compiler)
  208.     AC_TRY_COMPILE([
  209.     #ifndef __GNUC__
  210.            choke me
  211.     #endif
  212.     ], [],
  213.         AC_MSG_RESULT(yes)
  214.         MPI_GNUC=1
  215.         ,
  216.         AC_MSG_RESULT(no)
  217.     )
  218.     fi
  219.     CC="$saveCC"
  220.     AC_SUBST(MPICC)
  221.     AC_SUBST(BUILD_MPI)
  222. fi
  223. AC_SUBST(MPI_INTELC)
  224. AC_SUBST(MPI_GNUC)
  225.  
  226. AC_ARG_WITH(db,
  227.     [  --with-db=<dir>         Location of installed DB package (default=/usr)],
  228.     [AX_BERKELEY_DB(${withval})],
  229.     [AX_BERKELEY_DB("")])
  230.  
  231. AC_ARG_WITH(openssl,
  232.          [  --with-openssl=<dir>  Location of installed openssl package (default=/usr)
  233.               --without-openssl     Don't build with openssl.
  234.          ],
  235.          [AX_OPENSSL(${withval})],
  236.          [AX_OPENSSL_OPTIONAL])
  237.  
  238. AC_ARG_WITH(libaio,
  239.          [  --with-libaio=<dir>  Location of installed libaio package (default=/usr)
  240.               --without-libaio     Don't build with libaio.
  241.          ],
  242.          [AX_AIO(${withval})],
  243.          [AX_AIO_OPTIONAL])
  244.  
  245. dnl create any missing subdirectories that wouldn't be created
  246. dnl by AC_OUTPUT below (which won't create intermediate dirs).
  247. for d in common io client correctness/pts kernel ; do
  248.     install -d $d;
  249. done
  250.  
  251. dnl output final version of top level makefile and subdirectory
  252. dnl    makefile includes
  253. AC_OUTPUT(Makefile
  254. io/trove/module.mk
  255. io/buffer/module.mk
  256. common/quicklist/module.mk
  257. common/id-generator/module.mk
  258. common/gossip/module.mk
  259. common/gen-locks/module.mk
  260. common/misc/module.mk
  261. io/bmi/module.mk
  262. io/description/module.mk
  263. io/flow/module.mk
  264. io/job/module.mk
  265. io/dev/module.mk
  266. client/sysint/module.mk
  267. client/mpi-io/module.mk
  268. client/vfs/module.mk
  269. proto/module.mk
  270. server/module.mk
  271. server/request-scheduler/module.mk
  272. correctness/pts/module.mk
  273. correctness/module.mk
  274. common/pav/configfile.sample
  275. kernel/linux-2.6/module.mk
  276. maint/mpi-depend.sh
  277. shared/module.mk
  278. perfbase/benchmarks/module.mk
  279. posix/module.mk
  280. )
  281.  
  282.