Select Git revision
configure.in
configure.in 4.59 KiB
dnl Process this file with autoconf to produce a configure script.
AC_INIT(ALBERT/src/Common/albert.h)
AM_INIT_AUTOMAKE(albert, 1.1)
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_F77
dnl ******************************************************************************
dnl comment the next line out to create dynamic libraries
dnl ******************************************************************************
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
dnl change the installation directory. This could surely be done more elegantly...
AC_PREFIX_DEFAULT(`pwd`)
dnl look for X11 library paths AND sets all necessary flags (X_CFLAGS) e.g.
AC_PATH_XTRA
dnl Checks for libraries.
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main,,AC_MSG_ERROR(No lm library! Exiting...))
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h unistd.h X11/Xlib.h X11/Xutil.h,,AC_MSG_ERROR(Exiting...))
AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(strdup strstr,,AC_MSG_ERROR(Exiting...))
dnl ******************************************************************************
dnl Prevent -g from being set here automatically...
dnl ******************************************************************************
CFLAGS=
FFLAGS=
dnl ******************************************************************************
dnl These are our own tests
dnl ******************************************************************************
dnl The -n32 option was needed for SGIs:
dnl The g77 command produced new 32-bit objects whereas gcc defaulted to old
dnl 32-bit objects. This caused warnings during making (symbol tables
dnl destroyed???)
dnl ******************************************************************************
plotansi_variable_source=PLOT_for_sun.c
plotansi_variable_object=PLOT_for_sun.lo
case "$build_vendor" in
*sgi*) AC_MSG_RESULT([Building for SGI system, using -n32 linker flag...])
object_type=-n32;;
*ibm*) AC_MSG_RESULT([Building for IBM system, affects PLOT_Ansi...])
plotansi_variable_source=PLOT_for_ibm.c
plotansi_variable_object=PLOT_for_ibm.lo;;
esac
case "$build" in
*titan*) AC_MSG_RESULT([Building for TITAN cpu/vendor/system?, affects PLOT_Ansi...])
plotansi_variable_source=PLOT_for_tit.c
plotansi_variable_object=PLOT_for_tit.lo;;
esac
case "$build_os" in
*linux*)
AC_CHECK_LIB(MesaGL, main)
AC_CHECK_LIB(g2c, main)
AC_CHECK_LIB(blas, main,,AC_MSG_WARN([Problems with libblas: also tried lg2c for Linux...])
make_own_blas_lib=libblas.la,-lg2c)
AC_CHECK_LIB(X11, main,,AC_MSG_ERROR(Exiting...),-L$x_libraries)
AC_CHECK_LIB(Xext, main,,AC_MSG_ERROR(Exiting...),-L$x_libraries)
;;
*)
AC_CHECK_LIB(X11, main,,AC_MSG_ERROR(Exiting...))
AC_CHECK_LIB(Xext, main,,AC_MSG_ERROR(Exiting...))
AC_CHECK_LIB(gl, main)
AC_CHECK_LIB(GL, main)
AC_CHECK_LIB(blas, main,,
AC_MSG_WARN(Problems with libblas: creating our own...)
make_own_blas_lib=libblas.la,);;
esac
albert_variable_source=
gltools_include=
AC_MSG_CHECKING([for libgltools.a])
AC_ARG_WITH(gltools,
[ --with-gltools=PATH specify the path of the gltools library],
if test -f $withval/gltools-2-3/libgltools.a; then
AC_MSG_RESULT([Found libgltools.a in specified directory $withval/gltools-2-3.])
AC_DEFINE(HAVE_LIBGLTOOLS)
gltools_include="-I$withval/gltools-2-3"
gltools_lib="-L$withval/gltools-2-3"
albert_variable_source=gltools.c
albert_variable_object=gltools.lo
LIBS="-L$withval/gltools-2-3 -lgltools $LIBS"
else
AC_MSG_RESULT([No libgltools.a found in $withval/gltools-2-3.])
fi,
if test -f ./gltools-2-3/libgltools.a; then
AC_MSG_RESULT([Found libgltools.a in default directory ./gltools-2-3])
AC_DEFINE(HAVE_LIBGLTOOLS)
gltools_include="-I`pwd`/gltools-2-3"
albert_variable_source=gltools.c
albert_variable_object=gltools.lo
LIBS="-L`pwd`/gltools-2-3 -lgltools $LIBS"
else
AC_MSG_RESULT([No libgltools.a found in ./gltools-2-3])
fi)
AC_SUBST(static_libraries)
AC_SUBST(object_type)
AC_SUBST(plotansi_variable_source)
AC_SUBST(plotansi_variable_object)
AC_SUBST(gltools_include)
AC_SUBST(albert_variable_source)
AC_SUBST(albert_variable_object)
AC_SUBST(make_own_blas_lib)
AC_OUTPUT(Makefile BLAS/Makefile IAMTOOLS/Makefile SOLVER/Makefile SOLVER/src/Makefile PLOT_ANSI/Makefile PLOT_ANSI/src/Makefile ALBERT/Makefile ALBERT/src/Makefile ALBERT/src/1d/Makefile ALBERT/src/2d/Makefile ALBERT/src/3d/Makefile ALBERT/src/Common/Makefile ALBERT/src/Common/Makefile.albert DEMO/src/Makefile DEMO/src/1d/Makefile DEMO/src/2d/Makefile DEMO/src/3d/Makefile)