SourceForge has been redesigned. Learn more.
Close

[2b666a]: / configure.ac  Maximize  Restore  History

Download this file

171 lines (136 with data), 4.5 kB

# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)

AC_INIT(blitz, 0.9, blitz-bugs@oonumerics.org)

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(blitz/blitz.h)
AC_CONFIG_HEADERS(blitz/config.h)

AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2 nostdinc no-installinfo])

# Avoid generating makefile rules to rebuild maintainer-only files by
# default.  Maintainers may override this default and generate these
# makefile rules using the `--enable-maintainer-mode' configure option.
AM_MAINTAINER_MODE

# Blitz++ configure utility, generated by autoconf.
#
# If you want to modify this file, make sure you are editing
# configure.ac, and not configure.  

AC_MSG_NOTICE([

Configuring $PACKAGE_STRING for $target

])

# C++ compiler
AC_PROG_CXX([xlc++ xlC icpc pathCC pgCC cxx aCC c++ CC g++ KCC FCC])
AC_LANG(C++)
AC_CXX_FLAGS_PRESET

# Option to disable Fortran (benchmarks will not compile)
AC_MSG_CHECKING([whether to enable Fortran compilation for benchmark codes])
AC_ARG_ENABLE(fortran,
  AS_HELP_STRING([--enable-fortran],[Enable Fortran compilation]),,[
  enable_fortran="yes"])
AC_MSG_RESULT([$enable_fortran])
AM_CONDITIONAL(FORTRAN_ENABLED, [test $enable_fortran = yes])

# Fortran compiler
if test $enable_fortran = yes; then
  AC_PROG_F77([xlf ifort pathf90 pgf77 ftn frt gfortran f77 g77 g95])
  AC_PROG_FC([xlf90 ifort pathf90 pgf90 ftn frt f90 gfortran g95])
  AC_FORTRAN_FLAGS_PRESET

  AC_LANG_PUSH(Fortran 77)
  AC_F77_LIBRARY_LDFLAGS
  AC_LANG_POP(Fortran 77)
  AC_LANG_PUSH(Fortran)
  AC_FC_LIBRARY_LDFLAGS

  if test -n "$FC"; then
    AC_FC_FREEFORM(,FC=)
  fi
  if test -n "$FC"; then
    AC_FC_SRCEXT(f90,,FC=)
  fi
  AC_LANG_POP(Fortran)
fi
AM_CONDITIONAL(F90_COMPILER, [test -n "$FC"])

# Prefix config macros with BZ_ and create compiler-specific bzconfig.h
AC_SET_COMPILER_SPECIFIC_HEADER

# makeinfo documentation
AC_CHECK_PROG(MAKEINFO, [makeinfo], [makeinfo], [""])
AM_CONDITIONAL(MAKEINFO_DOC, [test -n "$MAKEINFO"])
# texinfo documentation
AC_CHECK_PROG(TEXI2HTML, [texi2html], [texi2html])
AM_CONDITIONAL(TEXI2HTML_DOC, [test -n "$TEXI2HTML"])
# Doxygen documentation
AC_PROG_DOXYGEN

# Check if the script was called with --enable-64bit
# and if so modify the compilation flags.
AC_COMPILERS_ENABLE_64BITS

# Disable shared library building by default (use --enable-shared to enable)
AM_DISABLE_SHARED
AC_PROG_LIBTOOL

AC_CHECK_FUNC([sin],,[AC_CHECK_LIB(m,sin)])

AC_LIB_BLAS

# Check if the script was called with --enable-optimize or
# --enable-debug, and if so modify the compilation flags.
AC_CXX_ENABLE_OPTIMIZE
AC_CXX_ENABLE_DEBUG

# Option to enable thread-safety (requires thread support or OpenMP)
AC_MSG_CHECKING([whether to enable Blitz thread-safety features])
AC_ARG_ENABLE(threadsafe,
  AS_HELP_STRING([--enable-threadsafe],[Enable thread-safety features]),,[
  enable_threadsafe="no"])
AC_MSG_RESULT([$enable_threadsafe])
if test "$enable_threadsafe" = yes; then
  AC_DEFINE([THREADSAFE],[1],[Enable Blitz thread-safety features])
fi

AC_ARG_ENABLE(64-bit-dimensions,
  AS_HELP_STRING([--enable-64-bit-dimensions],[Enable dimensions with > 2^31 elements]),,[
  enable_64-bit-dimensions="no"])
AC_MSG_RESULT([$enable_64_bit_dimensions])
if test "$enable_64_bit_dimensions" = yes; then
  AC_DEFINE([BZ_FULLY64BIT],[1],[Enable dimensions with > 2^31 elements (NOT IMPLEMENTED)])
fi

# autoconf replacement of bzconfig
AC_CHECK_CXX_FEATURES

# Summarize variables
AC_ENV

# Process the Makefile.in's
AC_CONFIG_FILES([
	Makefile 
	bin/Makefile
	blitz/Makefile
	blitz/array/Makefile
	blitz/generate/Makefile
	blitz/meta/Makefile
	random/Makefile
	lib/Makefile
	testsuite/Makefile 
	examples/Makefile
	doc/Makefile
	doc/examples/Makefile
	doc/stencils/Makefile
	doc/doxygen/Makefile
	doc/doxygen/Doxyfile
	])

# Benchmarks require Fortran compiler
if test $enable_fortran = yes; then
AC_CONFIG_FILES([
	benchmarks/Makefile 
	benchmarks/plot_benchmarks.m
	])
fi

#	Obsolete makefiles
#
#	demos/Makefile
#	compiler/Makefile
#	manual/Makefile
#	manual/examples/Makefile
#	manual/stencils/Makefile
#	src/Makefile 

AX_CREATE_PKGCONFIG_INFO

AC_OUTPUT

# At some point in the future it would be nice to collect
# information about machines, OSes and compilers which
# people are using.  Obviously this has to be handled in
# a sensitive way.  Current idea: send the output
# of uname -a, $(target) and $(bz_compiler) via an
# anonymous remailer.  Prompt the user and give them
# a chance to override this behaviour.
# AC_SEND_CONFIG

AC_INFO