X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Fautoconf%2Flustre-build.m4;h=5d1e4c15eaf48fe41db46868e6a50057024a9d7d;hb=2945ad90da1908917f93740dbe340cdb0d31f001;hp=fefa9d88ec360d47b22ed719307807e7a0721bac;hpb=f64af1d45df2a76f97337b47259363f61fab6b5f;p=fs%2Flustre-release.git diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4 index fefa9d8..5d1e4c1 100644 --- a/build/autoconf/lustre-build.m4 +++ b/build/autoconf/lustre-build.m4 @@ -10,6 +10,54 @@ fi ]) # +# LB_CANONICAL_SYSTEM +# +# fixup $target_os for use in other places +# +AC_DEFUN([LB_CANONICAL_SYSTEM], +[case $target_os in + linux*) + lb_target_os="linux" + ;; + darwin*) + lb_target_os="darwin" + ;; +esac +AC_SUBST(lb_target_os) +]) + +# +# LB_CHECK_FILE +# +# Check for file existance even when cross compiling +# +AC_DEFUN([LB_CHECK_FILE], +[AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl +AC_CACHE_CHECK([for $1], lb_File, +[if test -r "$1"; then + AS_VAR_SET(lb_File, yes) +else + AS_VAR_SET(lb_File, no) +fi]) +AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl +AS_VAR_POPDEF([lb_File])dnl +])# LB_CHECK_FILE + +# +# LB_CHECK_FILES +# +# LB_CHECK_FILE over multiple files +# +AC_DEFUN([LB_CHECK_FILES], +[AC_FOREACH([AC_FILE_NAME], [$1], + [LB_CHECK_FILE(AC_FILE_NAME, + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1, + [Define to 1 if you have the + file `]AC_File['.]) +$2], + [$3])])]) + +# # LB_PATH_LIBSYSIO # # Handle internal/external libsysio @@ -18,31 +66,43 @@ AC_DEFUN([LB_PATH_LIBSYSIO], [AC_ARG_WITH([sysio], AC_HELP_STRING([--with-sysio=path], [set path to libsysio source (default is included libsysio)]), - [],[with_sysio='yes']) + [],[ + case $lb_target_os in + linux) + with_sysio='yes' + ;; + *) + with_sysio='no' + ;; + esac + ]) AC_MSG_CHECKING([location of libsysio]) +enable_sysio="$with_sysio" case x$with_sysio in xyes) AC_MSG_RESULT([internal]) - AC_CHECK_FILE([$srcdir/libsysio/src/rmdir.c],[],[ + LB_CHECK_FILE([$srcdir/libsysio/src/rmdir.c],[],[ AC_MSG_ERROR([A complete internal libsysio was not found.]) ]) - AC_CONFIG_SUBDIRS(libsysio) LIBSYSIO_SUBDIR="libsysio" - SYSIO='$(top_srcdir)/libsysio' + SYSIO="$PWD/libsysio" ;; xno) AC_MSG_RESULT([disabled]) ;; *) AC_MSG_RESULT([$with_sysio]) - AC_CHECK_FILE([$with_sysio/src/libsysio.a],[],[ + LB_CHECK_FILE([$with_sysio/lib/libsysio.a],[],[ AC_MSG_ERROR([A complete (built) external libsysio was not found.]) ]) SYSIO=$with_sysio + with_sysio="yes" ;; esac -AC_SUBST(LIBSYSIO_SUBDIR) -AC_SUBST(SYSIO) + +# We have to configure even if we don't build here for make dist to +# work +AC_CONFIG_SUBDIRS(libsysio) ]) # @@ -105,7 +165,7 @@ if test x$CRAY_PORTALS_INCLUDES != x -a x$CRAY_PORTALS_LIBS != x ; then with_cray_portals=yes AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals]) CPPFLAGS="-I$CRAY_PORTALS_INCLUDES $CPPFLAGS" - EXTRA_KCFLAGS="-I-I$CRAY_PORTALS_INCLUDES $EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-I$CRAY_PORTALS_INCLUDES $EXTRA_KCFLAGS" else with_cray_portals=no fi @@ -123,14 +183,11 @@ AC_ARG_ENABLE([modules], AC_HELP_STRING([--disable-modules], [disable building of Lustre kernel modules]), [],[ - case $target_os in - linux* | darwin) - enable_modules='yes' - ;; - *) - enable_modules='no' - ;; - esac + LC_TARGET_SUPPORTED([ + enable_modules='yes' + ],[ + enable_modules='no' + ]) ]) AC_MSG_RESULT([$enable_modules ($target_os)]) @@ -139,10 +196,11 @@ if test x$enable_modules = xyes ; then linux*) LB_PROG_LINUX ;; - darwin) + darwin*) LB_PROG_DARWIN ;; *) + # This is strange - Lustre supports a target we don't AC_MSG_ERROR([Modules are not supported on $target_os]) ;; esac @@ -158,12 +216,15 @@ AC_DEFUN([LB_CONFIG_UTILS], [AC_MSG_CHECKING([whether to build utilities]) AC_ARG_ENABLE([utils], AC_HELP_STRING([--disable-utils], - [disable building of Lustre utility programs]) + [disable building of Lustre utility programs]), [],[enable_utils='yes']) if test x$with_cray_portals = xyes ; then enable_utils='no' fi AC_MSG_RESULT([$enable_utils]) +if test x$enable_utils = xyes ; then + LB_CONFIG_INIT_SCRIPTS +fi ]) # @@ -264,6 +325,9 @@ AC_SUBST(sysconfdir) # Directories for documentation and demos. docdir='${datadir}/doc/$(PACKAGE)' AC_SUBST(docdir) + +LP_PATH_DEFAULTS +LC_PATH_DEFAULTS ]) # @@ -273,7 +337,6 @@ AC_SUBST(docdir) # AC_DEFUN([LB_PROG_CC], [AC_PROG_RANLIB -AC_PROG_CC AC_MSG_CHECKING([for buggy compiler]) CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"` bad_cc() { @@ -312,7 +375,17 @@ if test $ac_cv_sizeof_unsigned_long_long != 8 ; then AC_MSG_ERROR([** we assume that sizeof(long long) == 8. Tell phil@clusterfs.com]) fi -CPPFLAGS="-I\$(top_srcdir)/lustre/include -I\$(top_srcdir)/portals/include $CPPFLAGS" +AC_MSG_CHECKING([if $CC accepts -m64]) +CC_save="$CC" +CC="$CC -m64" +AC_TRY_COMPILE([],[],[ + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) + CC="$CC_save" +]) + +CPPFLAGS="-I\$(top_builddir)/portals/include -I\$(top_srcdir)/portals/include -I\$(top_builddir)/lustre/include -I\$(top_srcdir)/lustre/include $CPPFLAGS" LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1" AC_SUBST(LLCPPFLAGS) @@ -321,7 +394,7 @@ LLCFLAGS="-g -Wall -fPIC" AC_SUBST(LLCFLAGS) # everyone builds against portals and lustre -EXTRA_KCFLAGS="-g -I$PWD/portals/include -I$PWD/lustre/include" +EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/portals/include -I$PWD/lustre/include" AC_SUBST(EXTRA_KCFLAGS) ]) @@ -337,6 +410,19 @@ AM_CONDITIONAL(TESTS, test x$enable_tests = xyes) AM_CONDITIONAL(DOC, test x$ENABLE_DOC = x1) AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno) AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1") +AM_CONDITIONAL(LINUX, test x$lb_target_os = "xlinux") +AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin") + +# this lets lustre cancel libsysio, per-branch or if liblustre is +# disabled +if test "x$LIBSYSIO_SUBDIR" = xlibsysio ; then + if test "x$with_sysio" != xyes ; then + SYSIO="" + LIBSYSIO_SUBDIR="" + fi +fi +AC_SUBST(LIBSYSIO_SUBDIR) +AC_SUBST(SYSIO) LB_LINUX_CONDITIONALS LB_DARWIN_CONDITIONALS @@ -351,7 +437,9 @@ LC_CONDITIONALS # main configure steps # AC_DEFUN([LB_CONFIGURE], -[LB_INCLUDE_RULES +[LB_CANONICAL_SYSTEM + +LB_INCLUDE_RULES LB_PATH_DEFAULTS @@ -366,7 +454,10 @@ LB_CONFIG_TESTS LB_CONFIG_MODULES -LB_CONFIG_LIBLUSTRE +LC_CONFIG_LIBLUSTRE + +LP_CONFIGURE +LC_CONFIGURE LB_CONDITIONALS LB_CONFIG_HEADERS @@ -375,6 +466,7 @@ AC_CONFIG_FILES( [Makefile:build/Makefile.in.toplevel] [autoMakefile build/autoMakefile +build/autoconf/Makefile build/Rules build/lustre.spec ]) @@ -386,11 +478,13 @@ AC_OUTPUT cat <<_ACEOF -CPPFLAGS: $CPPFLAGS -LLCPPFLAGS: $LLCPPFLAGS -CFLAGS: $CFLAGS +CC: $CC +LD: $LD +CPPFLAGS: $CPPFLAGS +LLCPPFLAGS: $LLCPPFLAGS +CFLAGS: $CFLAGS EXTRA_KCFLAGS: $EXTRA_KCFLAGS -LLCFLAGS: $LLCFLAGS +LLCFLAGS: $LLCFLAGS Type 'make' to build Lustre. _ACEOF