Skip to content
Snippets Groups Projects
Commit 28e2706a authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Stuff compiles again. Unify options for various packages. Still to do:

optionally disable debugging libraries, make compilation of DIM != DOW
an option. Tune Demo package. Solutions well known, just do it :)
parent c6873f59
No related branches found
No related tags found
No related merge requests found
...@@ -33,18 +33,47 @@ AC_CONFIG_FILES([Makefile ALBERTA_UTIL/Makefile ...@@ -33,18 +33,47 @@ AC_CONFIG_FILES([Makefile ALBERTA_UTIL/Makefile
AM_INIT_AUTOMAKE([1.6]) AM_INIT_AUTOMAKE([1.6])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
# change the installation directory. This could surely be done more elegantly...
dnl
dnl cH: hey, boys and girls, why do we do that?
dnl
AC_PREFIX_DEFAULT([`pwd`])
# Checks for programs. # Checks for programs.
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
# Compiler characteristics
dnl
dnl ****************************************************************************
dnl
dnl First, we zap CFLAGS, FFLAGS and CXXFLAGS (unless explicitly set
dnl by the user). We then choose -O3 for gcc and -O for all other
dnl compilers, and no optimization for the debugging library.
dnl
dnl NOTE: we use 7 spaces to distinguish a user-override of "" from
dnl our internal hack. Personally, I'd prefer to leave the fiddling
dnl with the CFLAGS to the user. Mmmh.
dnl
test -z "$CFLAGS" && CFLAGS=" "
test -z "$FFLAGS" && FFLAGS=" "
test -z "$CXXFLAGS" && CXXFLAGS=" "
dnl
dnl ****************************************************************************
dnl
dnl now check for compilers
dnl
AC_PROG_CC AC_PROG_CC
AC_PROG_F77 AC_PROG_F77
dnl dnl
dnl Mmmh. Quite elaborated nowadays dnl Mmmh. Quite elaborated nowadays. This is not used, but left in to
dnl demonstrate what could (and should) be done some day.
dnl dnl
AC_F77_WRAPPERS AC_F77_WRAPPERS
AC_F77_MAIN AC_F77_MAIN
AC_F77_LIBRARY_LDFLAGS AC_F77_LIBRARY_LDFLAGS
dnl
dnl ****************************************************************************
dnl dnl
dnl quick and very dirty hack for icc dnl quick and very dirty hack for icc
dnl dnl
...@@ -55,15 +84,48 @@ AC_PROG_LIBTOOL ...@@ -55,15 +84,48 @@ AC_PROG_LIBTOOL
if test `basename $CC` = icc; then if test `basename $CC` = icc; then
GCC=no GCC=no
fi fi
# change the installation directory. This could surely be done more elegantly... dnl
AC_PREFIX_DEFAULT([`pwd`]) dnl ****************************************************************************
dnl
if test "$GCC" = yes; then dnl set default debugging flags, but allow for user-override
ALBERTA_DEBUG_CFLAGS="-ggdb -fno-inline -fno-builtin" dnl
else if test -z "${ALBERTA_DEBUG_CFLAGS}"; then
ALBERTA_DEBUG_CFLAGS="-g" if test "$GCC" = yes; then
ALBERTA_DEBUG_CFLAGS="-ggdb -fno-inline -fno-builtin"
else
ALBERTA_DEBUG_CFLAGS="-g"
fi
fi fi
AC_SUBST(ALBERTA_DEBUG_CFLAGS) AC_SUBST(ALBERTA_DEBUG_CFLAGS)
dnl
dnl ****************************************************************************
dnl
dnl set default optimizing flags, but allow for user-override
dnl
if test "${CFLAGS}" = " "; then
if test "$GCC" = yes; then
CFLAGS="-O3"
else
CFLAGS="-O"
fi
fi
if test "${FFLAGS}" = " "; then
if test "$GCC" = yes; then
FFLAGS="-O3"
else
FFLAGS="-O"
fi
fi
if test "${CXXFLAGS}" = " "; then
if test "$GCC" = yes; then
CXXFLAGS="-O3"
else
CXXFLAGS="-O"
fi
fi
dnl
dnl ****************************************************************************
dnl
# Checks for libraries. # Checks for libraries.
...@@ -129,21 +191,9 @@ dnl check for BLAS library. The BLAS may come under different names. We default ...@@ -129,21 +191,9 @@ dnl check for BLAS library. The BLAS may come under different names. We default
dnl to -lblas, but other possibilities are sunperf, atlas, cpml (Alpha AXP) dnl to -lblas, but other possibilities are sunperf, atlas, cpml (Alpha AXP)
dnl etc etc etc etc etc etc etc etc etc etc ........................... dnl etc etc etc etc etc etc etc etc etc etc ...........................
dnl dnl
dnl Let the user decide what it wants. dnl Let the user decide what it wants (handled by ALBERTA_CHECK_PACKAGE()
dnl dnl
AC_ARG_WITH(BLASname, ALBERTA_CHECK_PACKAGE(blas, blas, , ${FLIBS},,,,required)
AC_HELP_STRING([--with-BLASname=NAME], [use NAME as the name of the BLAS library (without leading "lib" prefix and trailing suffix). Default: "blas"]),
[case "$withval" in
yes) AC_MSG_ERROR("option \"--with-BLASname\" requires an argument")
;;
no) AC_MSG_ERROR("option \"--with-BLASname\" requires an argument")
;;
*) LIBBLAS=$withval
;;
esac],
LIBBLAS=blas)
AC_SUBST(LIBBLAS)
ALBERTA_CHECK_PACKAGE(blas, $LIBBLAS, , ${FLIBS},,,,required)
dnl dnl
dnl check for X11 dnl check for X11
...@@ -154,53 +204,9 @@ X_ALL_LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 ${X_EXTRA_LIBS}" ...@@ -154,53 +204,9 @@ X_ALL_LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 ${X_EXTRA_LIBS}"
AC_SUBST(X_ALL_LIBS) AC_SUBST(X_ALL_LIBS)
dnl dnl
dnl check for OpenGL (maybe Mesa) dnl check for OpenGL
dnl dnl
AC_ARG_WITH(GLname, ALBERTA_CHECK_PACKAGE(opengl, GL, ,${X_ALL_LIBS}, GL/gl.h,,,required)
AC_HELP_STRING([--with-GLname=NAME], [use NAME as the name of the OpenGL (tm) library (without leading "lib" prefix and trailing suffix). Default: "GL"]),
[case "$withval" in
yes) AC_MSG_ERROR("option \"--with-GLname\" requires an argument")
;;
no) AC_MSG_ERROR("option \"--with-GLname\" requires an argument")
;;
*) LIBGL=$withval
;;
esac],
LIBGL=GL)
AC_SUBST(LIBGL)
ALBERTA_CHECK_PACKAGE(opengl, $LIBGL, ,${X_ALL_LIBS}, GL/gl.h,,,required)
dnl case "$build_os" in
dnl *linux*) AC_MSG_RESULT([Building on Linux system...])
dnl AC_CHECK_LIB(g2c, main)
dnl AC_CHECK_LIB(blas, main,,
dnl [AC_MSG_WARN([Problems with libblas, also tried lg2c...])
dnl make_own_blas_lib=libblas.la],
dnl [-lg2c])
dnl AC_CHECK_LIB(X11, main,,
dnl [AC_MSG_ERROR([Exiting...])],
dnl [${X_LIBS}])
dnl AC_CHECK_LIB(Xext, main,,
dnl [AC_MSG_ERROR([Exiting...])],
dnl [${X_LIBS}])
dnl AC_CHECK_LIB(GL, main,,
dnl [AC_CHECK_LIB(MesaGL,main)],
dnl [${X_LIBS}])
dnl ;;
dnl *)
dnl AC_CHECK_LIB(blas, main,,
dnl [AC_MSG_WARN([Problems with libblas, creating our own...])
dnl make_own_blas_lib=libblas.la])
dnl AC_CHECK_LIB(X11, main,,
dnl [AC_MSG_ERROR(Exiting...)],
dnl [${X_LIBS}])
dnl AC_CHECK_LIB(Xext, main,,
dnl [AC_MSG_ERROR(Exiting...)],
dnl [${X_LIBS}])
dnl AC_CHECK_LIB(gl, main)
dnl AC_CHECK_LIB(GL, main)
dnl ;;
dnl esac
dnl dnl
dnl check for optional pacakge gltools dnl check for optional pacakge gltools
...@@ -210,12 +216,12 @@ ALBERTA_CHECK_PACKAGE(gltools, gltools, , ${X_ALL_LIBS}, glmesh.h,,,optional) ...@@ -210,12 +216,12 @@ ALBERTA_CHECK_PACKAGE(gltools, gltools, , ${X_ALL_LIBS}, glmesh.h,,,optional)
dnl dnl
dnl some defines to enable building of alberta_movi dnl some defines to enable building of alberta_movi
dnl dnl
ALBERTA_CHECK_PACKAGE(grape, gr, , -l${LIBGL} ${X_ALL_LIBS}, grape.h,,, optional) ALBERTA_CHECK_PACKAGE(grape, gr, , ${OPENGL_LIB} ${X_ALL_LIBS}, grape.h,,, optional)
AM_CONDITIONAL(GRAPE, test -n "${GRAPE_LIB}") AM_CONDITIONAL(GRAPE, test -n "${GRAPE_LIB}")
ALBERTA_LIB_PATH=$prefix/lib ALBERTA_LIB_PATH=$prefix/lib
ALBERTA_INCLUDE_PATH='$(top_srcdir)/ALBERTA/src/Common/ -I$(top_srcdir)/ALBERTA_UTIL' ALBERTA_INCLUDE_PATH='$(top_srcdir)/ALBERTA/src/Common/ -I$(top_srcdir)/ALBERTA_UTIL'
ALBERTA_LIBS_22='$(top_builddir)/ALBERTA/src/ALBERTA22_0/libALBERTA22_0.la $(top_builddir)/SOLVER/src/libcsolver.la $(top_builddir)/ALBERTA_UTIL/libalberta_util.la $(top_builddir)/PLOT_ANSI/src/libPLOTansi.la' ALBERTA_LIBS_22='$(top_builddir)/ALBERTA/src/ALBERTA22_0/libALBERTA22_0.la $(top_builddir)/SOLVER/src/libcsolver.la $(top_builddir)/ALBERTA_UTIL/libalberta_util.la $(top_builddir)/PLOT_ANSI/src/libPLOTansi.la $(BLAS_ALL_LIB) $(GLTOOLS_ALL_LIB)'
ALBERTA_LIBS_33='$(top_builddir)/ALBERTA/src/ALBERTA33_0/libALBERTA33_0.la $(top_builddir)/SOLVER/src/libcsolver.la $(top_builddir)/ALBERTA_UTIL/libalberta_util.la' ALBERTA_LIBS_33='$(top_builddir)/ALBERTA/src/ALBERTA33_0/libALBERTA33_0.la $(top_builddir)/SOLVER/src/libcsolver.la $(top_builddir)/ALBERTA_UTIL/libalberta_util.la $(BLAS_ALL_LIB) $(GLTOOLS_ALL_LIB)'
ALBERTA_DEBUG= ALBERTA_DEBUG=
AC_SUBST(ALBERTA_DEBUG) AC_SUBST(ALBERTA_DEBUG)
AC_SUBST(ALBERTA_LIB_PATH) AC_SUBST(ALBERTA_LIB_PATH)
......
...@@ -116,7 +116,7 @@ dnl need to use m4_if, the $i arguments are not shell variables ...@@ -116,7 +116,7 @@ dnl need to use m4_if, the $i arguments are not shell variables
dnl dnl
m4_if($8, optional,[ALBERTA_CHECK_PKG_OPT([$1])]) m4_if($8, optional,[ALBERTA_CHECK_PKG_OPT([$1])])
dnl dnl
dnl bail out if package disabled completely dnl bail out if package is completely disabled
dnl dnl
if test "${UPNAME[_DISABLE]}" = yes; then if test "${UPNAME[_DISABLE]}" = yes; then
: :
...@@ -128,6 +128,20 @@ else ...@@ -128,6 +128,20 @@ else
DEFAULT_LIBDIR=$3 DEFAULT_LIBDIR=$3
fi fi
dnl dnl
dnl Optionally use an alternate name (e.g. MesaGL instead of GL etc.)
dnl
AC_ARG_WITH($1-name,
AC_HELP_STRING([--with-$1-name=NAME], [use NAME as the name of the $1 library (without leading "lib" prefix and trailing suffix). Default: "$2"]),
[case "$withval" in
yes) AC_MSG_ERROR("option \"--with-$1-name\" requires an argument")
;;
no) AC_MSG_ERROR("option \"--with-$1-name\" requires an argument")
;;
*) UPNAME[_NAME]=$withval
;;
esac],
UPNAME[_NAME]=$2)
dnl
dnl headers and libraries below the same directory :( dnl headers and libraries below the same directory :(
dnl dnl
m4_if($5,[],[],[ALBERTA_CHECK_PKG_DIR_OPT([$1])]) m4_if($5,[],[],[ALBERTA_CHECK_PKG_DIR_OPT([$1])])
...@@ -162,7 +176,7 @@ dnl ...@@ -162,7 +176,7 @@ dnl
dnl now check if the library and header files exist dnl now check if the library and header files exist
dnl dnl
if test "$8" = "optional" ; then if test "$8" = "optional" ; then
AC_CHECK_LIB($2, main, AC_CHECK_LIB(${UPNAME[_NAME]}, main,
[UPNAME[_LIB]="-L${UPNAME[_LIB_PATH]} -l$2" [UPNAME[_LIB]="-L${UPNAME[_LIB_PATH]} -l$2"
UPNAME[_ALL_LIB]="-L${UPNAME[_LIB_PATH]} -l$2 $4"], UPNAME[_ALL_LIB]="-L${UPNAME[_LIB_PATH]} -l$2 $4"],
[UPNAME[_LIB]="" [UPNAME[_LIB]=""
...@@ -172,7 +186,7 @@ if test "$8" = "optional" ; then ...@@ -172,7 +186,7 @@ if test "$8" = "optional" ; then
UPNAME[_INCLUDE_PATH]=""], UPNAME[_INCLUDE_PATH]=""],
-L${UPNAME[_LIB_PATH]} $4) -L${UPNAME[_LIB_PATH]} $4)
else else
AC_CHECK_LIB($2, main, AC_CHECK_LIB(${UPNAME[_NAME]}, main,
[UPNAME[_LIB]="-L${UPNAME[_LIB_PATH]} -l$2" [UPNAME[_LIB]="-L${UPNAME[_LIB_PATH]} -l$2"
UPNAME[_ALL_LIB]="-L${UPNAME[_LIB_PATH]} -l$2 $4"], UPNAME[_ALL_LIB]="-L${UPNAME[_LIB_PATH]} -l$2 $4"],
[AC_MSG_ERROR([Library "lib$2" was not found])], [AC_MSG_ERROR([Library "lib$2" was not found])],
...@@ -222,4 +236,5 @@ AC_SUBST(UPNAME[_LIB_PATH]) ...@@ -222,4 +236,5 @@ AC_SUBST(UPNAME[_LIB_PATH])
AC_SUBST(UPNAME[_INCLUDE]) AC_SUBST(UPNAME[_INCLUDE])
AC_SUBST(UPNAME[_LIB]) AC_SUBST(UPNAME[_LIB])
AC_SUBST(UPNAME[_ALL_LIB]) AC_SUBST(UPNAME[_ALL_LIB])
AC_SUBST(UPNAME[_NAME])
]) ])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment