Commit 8ff8353d authored by Oliver Sander's avatar Oliver Sander

Merge remote-tracking branch 'markus.blatt/cmake-support'

parents b192b4ce 46b6ab54
Pipeline #228 failed with stage
......@@ -2,7 +2,11 @@ Automake.global
Makefile
Makefile.in
.deps
config.*
config.h
config.in
config.log
config.status
config.sub
configure
aclocal.m4
autom4te.cache
......
# set up project
project("dune-uggrid" C CXX)
#circumvent not building docs
set(BUILD_DOCS 1)
# general stuff
cmake_minimum_required(VERSION 2.8.12)
#find dune-common and set the module path
find_package(dune-common)
list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/modules")# make sure our own modules are found
#include the dune macros
include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
find_package(FLEX)
find_package(BISON)
find_package(MPI)
# set defines that are only used internally.
# The rest is in cmake/modules/DuneUggrid.cmake
if(MPI_C_FOUND)
set(UG_ENABLE_PARALLEL True CACHE BOOL "Enable a parallel UG (default is True if MPI is there false otherwise")
else()
set(UG_ENABLE_PARALLEL False CACHE BOOL "Enable a parallel UG (default is True if MPI is there false otherwise")
endif()
set(UG_ENABLE_DEBUGGING False CACHE BOOL "Enable UG debugging (default is Off)")
set(UG_ENABLE_2D True CACHE BOOL "Build library for 2d (default is On)")
set(UG_ENABLE_3D True CACHE BOOL "Build library for 3d (default is On)")
set(UG_ENABLE_SYSTEM_HEAP ON CACHE BOOL "If ON/True then we are using the operating system heap instead of the one internal to UG (Default: ON")
set(UG_DDD_MAX_MACROBITS "24" CACHE STRING
"Set number of bits of an unsigned int used to store the process number,
the remaining bits are used to store the local entity id")
if(UG_ENABLE_SYSTEM_HEAP)
add_definitions("-DUG_USE_SYSTEM_HEAP=1")
set(UG_EXTRAFLAGS "-DUG_USE_SYSTEM_HEAP=1")
endif()
if(UG_ENABLE_DEBUGGING)
add_definitions("-DDebug")
set(UG_EXTRAFLAGS "${UG_EXTRAFLAGS} -DDebug")
endif()
add_definitions(-DUGLIB -DFOR_DUNE)
set(UG_EXTRAFLAGS "${UG_EXTRAFLAGS} -DUGLIB -DFOR_DUNE")
#Always build parallel libs if MPI is found
if(UG_ENABLE_PARALLEL)
if(NOT MPI_C_FOUND)
message(SEND_ERROR "A parallel UG was requested but MPI was not found. Either change variable UG_ENABLE_PARALLEL or install MPI." )
endif()
add_definitions("-DModelP")
set(UG_EXTRAFLAGS "${UG_EXTRAFLAGS} -DModelP")
endif()
#set the include headers
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/low
${PROJECT_SOURCE_DIR}/gm ${PROJECT_SOURCE_DIR}/dev ${PROJECT_SOURCE_DIR}/dom
${PROJECT_SOURCE_DIR}/np ${PROJECT_SOURCE_DIR}/ui
${PROJECT_SOURCE_DIR}/graphics/uggraph ${PROJECT_SOURCE_DIR}/np/algebra
${PROJECT_SOURCE_DIR}/np/udm ${PROJECT_SOURCE_DIR}/np/procs
${PROJECT_SOURCE_DIR}/parallel ${PROJECT_SOURCE_DIR}/parallel/ddd
${PROJECT_SOURCE_DIR}/parallel/ppif ${PROJECT_SOURCE_DIR}/ddd/include
${PROJECT_SOURCE_DIR}/parallel/dddif ${PROJECT_SOURCE_DIR}/parallel/util
${PROJECT_SOURCE_DIR}/parallel/ddd/include )
set(UG_ENABLED_DIMENSIONS)
if(UG_ENABLE_2D)
list(APPEND UG_ENABLED_DIMENSIONS "2")
endif()
if(UG_ENABLE_3D)
list(APPEND UG_ENABLED_DIMENSIONS "3")
endif()
macro(ug_expand_object_libs var dim)
set(${var})
foreach(_lib ${ARGN})
set(${var} ${${var}} "\$<TARGET_OBJECTS:${_lib}${dim}>")
endforeach()
endmacro()
# a macro that creates the libraries for all dimensions.
#
macro(ug_add_dim_libs LIB_NAME)
cmake_parse_arguments(ADD_LIB "OBJECT;DUNE" ""
"SOURCES;SOURCES_2D;SOURCES_3D;OBJECT_LIBS;OBJECT_DIM_LIBS;ADD_LIBS" ${ARGN})
if(ADD_LIB_APPEND)
set(_append "APPEND") # append all libraries in export.
endif()
if(ADD_LIB_OBJECT)
set(OBJECT "OBJECT")
endif()
ug_expand_object_libs(OBJECT_LIBS "" ${ADD_LIB_OBJECT_LIBS})
foreach(dim ${UG_ENABLED_DIMENSIONS})
ug_expand_object_libs(OBJECT_DIM_LIBS ${dim} ${ADD_LIB_OBJECT_DIM_LIBS})
if(ADD_LIB_DUNE)
if(ADD_LIB_ADD_LIBS)
set(_EXTRA_ARGS "ADD_LIBS" ${ADD_LIB_ADD_LIBS})
endif()
if(OBJECT)
message(FATAL_ERROR "OBJECT may only be used in conjuction with DUNE property")
endif()
dune_add_library("${LIB_NAME}${dim}" ${OBJECT} ${ADD_LIB_SOURCES}
${ADD_LIB_SOURCES_${dim}D}
${ADD_LIB_UNPARSED_ARGUMENTS} ${OBJECT_DIM_LIBS} ${OBJECT_LIBS}
${_EXTRA_ARGS} ${_append})
set(_libs "${LIB_NAME}${dim}")
if(DUNE_BUILD_BOTH_LIBS)
set(_libs ${_libs} "${LIB_NAME}${dim}-shared")
endif()
else()
add_library("${LIB_NAME}${dim}" ${OBJECT} ${ADD_LIB_SOURCES}
${ADD_LIB_SOURCES_${dim}D}
${ADD_LIB_UNPARSED_ARGUMENTS} ${OBJECT_DIM_LIBS} ${OBJECT_LIBS})
if(OBJECT AND DUNE_BUILD_BOTH_LIBS)
set_property(TARGET "${LIB_NAME}${dim}" PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif()
if(ADD_LIB_ADD_LIBS)
dune_target_link_libraries(${LIB_NAME}${dim} ${ADD_LIB_ADD_LIBS})
endif()
set(_libs "${LIB_NAME}${dim}")
endif()
foreach(_lib ${_libs})
target_compile_definitions("${_lib}" PRIVATE "-DUG_DIM_${dim}")
endforeach()
set(_append "APPEND") # Do not overwrite but append next lib in export
endforeach()
endmacro()
# !!! maybe make this configurable later
set(DYNAMIC_MEMORY_ALLOCMODEL True)
check_include_file(alloca.h HAVE_ALLOCA_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(float.h HAVE_FLOAT_H)
check_include_file(limits.h HAVE_LIMITS_H)
check_include_file(malloc.h HAVE_MALLOC_H)
check_include_file(memory.h HAVE_MEMORY_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(time.h HAVE_TIME_H)
include(CheckFunctionExists)
# Although the define is checked in low/ugmemory.h
# alloca is never called.
#check_function_exists(alloca HAVE_ALLOCA)
# define it unconditionally
set(HAVE_ALLOCA True)
include(CMakePushCheckState)
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m)
check_function_exists(bzero HAVE_BZERO)
check_function_exists(floor HAVE_FLOOR)
check_function_exists(malloc HAVE_MALLOC)
check_function_exists(memcpy HAVE_MEMCPY)
check_function_exists(memmove HAVE_MEMMOVE)
check_function_exists(memset HAVE_MEMSET)
check_function_exists(realloc HAVE_REALLOC)
check_function_exists(strchr HAVE_STRCHR)
check_function_exists(strrchr HAVE_STRRCHR)
check_function_exists(strdup HAVE_STRDUP)
check_function_exists(strstr HAVE_STRSTR)
check_function_exists(strtol HAVE_STRTOL)
# I am not really sure what AC_FUNC_FORK does
# For now just make the checks for defines needed
# for compilation
check_function_exists(vfork HAVE_VFORK)
set(HAVE_WORKING_VFORK "${HAVE_VFORK}")
cmake_pop_check_state()
if(NOT HAVE_ALLOCA_H)
message(SEND_ERROR "Could not find required header alloca.h")
endif()
if(NOT HAVE_ALLOCA)
message(SEND_ERROR "Could not find required function alloca")
endif()
if(HAVE_STRING_H OR HAVE_STRINGS_H)
set(STDC_HEADERS True)
endif()
if(HAVE_TIME_H AND HAVE_SYS_TIME_H)
set(TIME_WITH_SYS_TIME True)
endif()
# do everything in the subdirs (order matters because of library dependencies!)
if(UG_ENABLE_PARALLEL)
set(SUBDIRS parallel)
else()
set(SUBDIRS "")
endif()
set(SUBDIRS ${SUBDIRS} low dev gm dom graphics np ui lib tools)
set(CMAKE_INSTALL_PKGINCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/ug")
# create and install pkg-config information and
# cmake package configuration as ug not dune-uggrid
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
if(UG_ENABLE_PARALLEL)
set(parallel "yes")
else()
set(parallel "no")
endif()
set(fordune "yes")
set(VERSION ${DUNE_UGGRID_VERSION})
set(UG_XLIBS "${X11_LIBRARIES}")
configure_file(libug.pc.in libug.pc)
configure_file(ug-config.cmake.in ug-config.cmake @ONLY)
configure_file(ug-config-version.cmake.in ug-config-version.cmake @ONLY)
#install header
install(FILES initug.h DESTINATION ${CMAKE_INSTALL_PKGINCLUDEDIR})
foreach(i ${SUBDIRS})
add_subdirectory(${i})
endforeach(i ${SUBDIRS})
add_subdirectory(cmake/modules)
# set variable names for config.h
set(ARCHNAME ${CMAKE_LIBRARY_ARCHITECTURE})
set(DDD_MAX_PROCBITS_IN_GID ${UG_DDD_MACROBITS})
# finalize the dune project, e.g., generate config.h etc.
# Use package init to set additional information
set(dune-uggrid_INIT "set(UG_PARALLEL ${parallel})
set(UG_FOR_DUNE yes)")
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
# This comes after finalize as it uses DUNE_INSTALL_LIBDIR
# computed there.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libug.pc
DESTINATION ${DUNE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ug-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/ug-config-version.cmake
DESTINATION ${DUNE_INSTALL_LIBDIR}/cmake/ug)
# do everything in the subdirs (order matters!)
SUBDIRS = parallel low dev gm dom graphics np ui lib tools
#
# libltdl after low will be needed for plugins later
ugincludedir = $(pkgincludedir)
uginclude_HEADERS = initug.h
# install pkg-config information
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libug.pc
#install cmake package configuration
cmakeconfigdir = $(libdir)/cmake/ug
cmakeconfig_DATA = ug-config.cmake ug-config-version.cmake
#
## automake-options
#
# don't follow the full GNU-standard
AUTOMAKE_OPTIONS = foreign 1.7
ACLOCAL_AMFLAGS = -I m4
# possibly use the same compiler for distcheck
# DISTCHECK_CONFIGURE_FLAGS = CXX="$(CXX)" CC="$(CC)"
install(FILES DuneUggridMacros.cmake DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules)
find_package(X11)
# Compatibility against previous UG versions.
set(UG_USE_SYSTEM_HEAP ${UG_ENABLE_SYSTEM_HEAP})
set(UG_FOUND True)
set(HAVE_UG True)
set(UG_VERSION "${DUNE_UGGRID_VERSION}")
# The dune module is alway 3.13.0 or above!
add_definitions(-DUG_USE_NEW_DIMENSION_DEFINES)
if(UG_PARALLEL STREQUAL "yes")
# Actually we probably should activate UG
# for everything. But for the time being we fall
# back to the enable trick. To change this just
# uncomment the lines below.
#add_definitions("-DENABLE_UG=1")
#add_definitions("-DModelP")
set(UG_DEFINITIONS "ENABLE_UG=1;ModelP")
else()
# Actually we probably should activate UG
# for everything. But for the time being we fall
# back to the enable trick. To change this just
# uncomment the lines below.
#add_definitions("-DENABLE_UG=1")
set(UG_DEFINITIONS "ENABLE_UG=1")
endif()
# Check whether dune-uggrid is installed
if(NOT dune-uggrid_INSTALLED)
#Yes, then we have setup the complete include path to the ug headers.
include_directories(${dune-uggrid_PREFIX} ${dune-uggrid_PREFIX}/low
${dune-uggrid_PREFIX}/gm ${dune-uggrid_PREFIX}/dev ${dune-uggrid_PREFIX}/dom
${dune-uggrid_PREFIX}/np ${dune-uggrid_PREFIX}/ui
${dune-uggrid_PREFIX}/graphics/uggraph ${dune-uggrid_PREFIX}/np/algebra
${dune-uggrid_PREFIX}/np/udm ${dune-uggrid_PREFIX}/np/procs
${dune-uggrid_PREFIX}/parallel ${dune-uggrid_PREFIX}/parallel/ddd
${dune-uggrid_PREFIX}/parallel/ppif ${dune-uggrid_PREFIX}/ddd/include
${dune-uggrid_PREFIX}/parallel/dddif ${dune-uggrid_PREFIX}/parallel/util
${dune-uggrid_PREFIX}/parallel/ddd/include )
endif(NOT dune-uggrid_INSTALLED)
/* begin dune-uggrid */
/* Define to the version of dune-common */
#define DUNE_UGGRID_VERSION "${DUNE_UGGRID_VERSION}"
/* Define to the major version of dune-common */
#define DUNE_UGGRID_VERSION_MAJOR ${DUNE_UGGRID_VERSION_MAJOR}
/* Define to the minor version of dune-common */
#define DUNE_UGGRID_VERSION_MINOR ${DUNE_UGGRID_VERSION_MINOR}
/* Define to the revision of dune-common */
#define DUNE_UGGRID_VERSION_REVISION ${DUNE_UGGRID_VERSION_REVISION}
/* If this is set, the operating system heap is used instead of UG's own heap
data structure. */
#cmakedefine UG_USE_SYSTEM_HEAP 1
/* begin private section */
/* obsolete architecture string */
#cmakedefine ARCHNAME "${CMAKE_LIBRARY_ARCHITECTURE}"
/* UG memory allocation model */
#define DYNAMIC_MEMORY_ALLOCMODEL 1
/* see parallel/ddd/dddi.h */
#cmakedefine DDD_MAX_PROCBITS_IN_GID ${UG_DDD_MAX_MACROBITS}
/* Define to 1 if you have `alloca', as a function or macro. */
#cmakedefine HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
#cmakedefine HAVE_ALLOCA_H 1
/* Define to 1 if you have the `bzero' function. */
#cmakedefine HAVE_BZERO 1
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */
#cmakedefine HAVE_DIRENT_H 1
/* Define to 1 if you have the <float.h> header file, and it defines. */
#cmakedefine HAVE_FLOAT_H 1
/* Define to 1 if you have the floor function. */
#cmakedefine HAVE_FLOOR 1
/* Define to 1 if you have the <limits.h> header file, and it defines. */
#cmakedefine HAVE_LIMITS_H 1
/* Define to 1 if you have the <malloc.h> header file, and it defines. */
#cmakedefine HAVE_MALLOC_H 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#cmakedefine HAVE_MALLOC 1
/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file, and it defines. */
#cmakedefine HAVE_MEMORY_H 1
/* Define to 1 if you have the `memcpy' function. */
// Was never set with autotools for whatever reason.
//#cmakedefine HAVE_MEMCPY 1
/* Define to 1 if you have the `memset' function. */
#cmakedefine HAVE_MEMSET 1
/* Define to 1 if you have the `realloc' function. */
#cmakedefine HAVE_REALLOC 1
/* Define to 1 if you have the <stdlib.h> header file, and it defines. */
#cmakedefine HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#cmakedefine HAVE_STRCHR 1
/* Define to 1 if you have the `strrchr' function. */
#cmakedefine HAVE_STRRCHR 1
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP 1
/* Define to 1 if you have the <string.h> header file, and it defines. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the <strings.h> header file, and it defines. */
#cmakedefine HAVE_STRINGS_H 1
/* Define to 1 if you have the `strrchr' function. */
#cmakedefine HAVE_STRRCHR 1
/* Define to 1 if you have the <strrchr.h> header file, and it defines. */
#cmakedefine HAVE_STRRCHR_H 1
/* Define to 1 if you have the `strstr' function. */
#cmakedefine HAVE_STRSTR 1
/* Define to 1 if you have the <strstr.h> header file, and it defines. */
#cmakedefine HAVE_STRSTR_H 1
/* Define to 1 if you have the `strchr' function. */
#cmakedefine HAVE_STRTOL 1
/* Define to 1 if you have the <strtol.h> header file, and it defines. */
#cmakedefine HAVE_STRTOL_H 1
/* Define to 1 if `vfork' works. */
#cmakedefine HAVE_WORKING_VFORK 1
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#cmakedefine TIME_WITH_SYS_TIME 1
/* end private section */
/* end dune-uggrid */
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(ug, 3.13.0, ug@conan.iwr.uni-heidelberg.de)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([initug.cc])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_LN_S
#for per-target flags
AM_PROG_CC_C_O
# for dom/lgm/ngin
AM_PROG_LEX
AC_PROG_YACC
# libtool (lines stolen from libtool-docs)
dnl Enable building of the convenience library
dnl and set LIBLTDL accordingly
AC_LIBLTDL_CONVENIENCE
dnl Substitute LTDLINCL and LIBLTDL in the Makefiles
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
# was fr libs wollen wir:
AC_DISABLE_SHARED
AC_ENABLE_STATIC
dnl Check for dlopen support
AC_LIBTOOL_DLOPEN
dnl Configure libtool
AC_PROG_LIBTOOL
dnl Configure libltdl
AC_CONFIG_SUBDIRS(libltdl)
# get Fortran-compiler-specs (for ddd-FORTRAN-bindings)
AC_PROG_F77
if test x$ac_cv_prog_f77_g != xno ; then
AC_F77_MAIN
AC_F77_WRAPPERS
else
# tell about missing FORTRAN
AC_DEFINE(NOF77, 1, [define if no FORTRAN-compiler is available])
fi
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lfamg':
AC_CHECK_LIB([famg], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [pow])
# !!!
AM_CONDITIONAL(NETGEN, false)
# Checks for header files.
AC_PATH_XTRA
have_xaw=no
if test x$have_x = xyes ; then
save_LIBS="$LIBS"
LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
# the usual collection of X-libs without Xaw which is checked separately
UG_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXt"
AC_CHECK_LIB([Xaw], [XawTextGetInsertionPoint],
[have_xaw=yes],[have_xaw=no])
# !!! reverse sense
if test x$have_xaw = xyes ; then
AC_DEFINE(USE_XAW, 1, [use the Athena Text Widget])
UG_XLIBS="$UG_XLIBS -lXaw"
else
AC_MSG_WARN([You have the X11 libs installed but not Xaw (the Athena Widgets): X-output will use archaic code!])
fi
# already expand variable (no obvious drawback and we can insert the
# value into libug.pc
AC_SUBST(UG_XLIBS)
LIBS="$save_LIBS"
fi
AM_CONDITIONAL(XAW, test x$have_xaw = xyes)
AM_CONDITIONAL(X11, test x$have_x = xyes)
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h limits.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/param.h sys/socket.h unistd.h values.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([ptrdiff_t])
AC_C_BIGENDIAN
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero floor gethostbyaddr gethostbyname gethrtime memmove memset mkdir pow socket sqrt strchr strdup strrchr strstr strtol])
#
## parallel support
#
AC_ARG_ENABLE([parallel],AC_HELP_STRING([--enable-parallel],[enable parallel computing (default is NO)]),[parallel=$enableval],[parallel=no])
if test x$parallel = xyes ; then
# set define
UG_EXTRAFLAGS="-DModelP"
fi
AC_SUBST(parallel)
#
## Support for DUNE. Building with --enable-dune sets the compiler flag -DFOR_DUNE
## which controls several small adjustments in the UG data structures which where
## unavoidable for the use as a DUNE grid implementation.
#
AC_ARG_ENABLE([dune],AC_HELP_STRING([--enable-dune],[compile for use with the DUNE system (default is NO)]),[dune=$enableval],[dune=no])
if test x$dune = xyes ; then
# set define
UG_EXTRAFLAGS="$UG_EXTRAFLAGS -DFOR_DUNE"
fi
AC_SUBST(fordune, "$dune")
# debugging
AC_ARG_ENABLE([debug],AC_HELP_STRING([--enable-debug],[enable UG debugging (default is NO)]),[debug=$enableval],[debug=no])
if test x$debug = xyes ; then
# set define
UG_EXTRAFLAGS="$UG_EXTRAFLAGS -DDebug"
fi
# check for some DDD parameters
DDD_PARAMETERS
# check whether we are using the UG heap or the operating system heap
UG_ENABLE_SYSTEM_HEAP
AS_IF([test "x$enable_system_heap" = "xyes"],[
# set define
UG_EXTRAFLAGS="$UG_EXTRAFLAGS -DUG_USE_SYSTEM_HEAP=1"
])
# the DUNE-test for MPI-package and parameters
UG_MPI
if test "x$parallel" = "xyes" -a "x$with_mpi" = "xno"; then
AC_MSG_ERROR([MPI needed for the parallel UG-lib!])
fi
# set results as automake-conditionals
AM_CONDITIONAL(PARALLEL, test x$parallel = xyes)
#
## build options
#
# !!! reduce include pathes!!!
UG_CPPFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/low -I\$(top_srcdir)/gm -I\$(top_srcdir)/dev -I\$(top_srcdir)/dom -I\$(top_srcdir)/np -I\$(top_srcdir)/ui -I\$(top_srcdir)/graphics/uggraph -I\$(top_srcdir)/np/algebra -I\$(top_srcdir)/np/udm -I\$(top_srcdir)/np/procs -I\$(top_srcdir)/parallel -I\$(top_srcdir)/parallel/ddd -I\$(top_srcdir)/parallel/ppif -I\$(top_srcdir)/parallel/ddd/include -I\$(top_srcdir)/parallel/dddif -I\$(top_srcdir)/parallel/util -DUGLIB $UG_EXTRAFLAGS"
AC_SUBST(UG_CPPFLAGS)
# export EXTRAFLAGS for libug.pc, CPPFLAGS would be quite wrong :)
AC_SUBST(UG_EXTRAFLAGS)
AC_SUBST(UG_2DFLAGS, '$(UG_CPPFLAGS) -DUG_DIM_2')
AC_SUBST(UG_3DFLAGS, '$(UG_CPPFLAGS) -DUG_DIM_3')
AC_ARG_ENABLE([2d],AC_HELP_STRING([--enable-2d],[build library for 2d (default is YES)]),[build2d=$enableval],[build2d=yes])
AM_CONDITIONAL(BUILD2D, test x$build2d = xyes)
AC_ARG_ENABLE([3d],AC_HELP_STRING([--enable-3d],[build library for 3d (default is YES)]),[build3d=$enableval],[build3d=yes])
AM_CONDITIONAL(BUILD3D, test x$build3d = xyes)
# lib-stuff
AC_SUBST(UG_LDFLAGS, '-L$(top_srcdir)/lib')
# where should the plugins go to?
plugindir=${libdir}/ug/
AC_SUBST(plugindir)
AC_SUBST(UG_PLUGINDIR, '-DPLUGINDIR=\"$(plugindir)\"')
# move architecture-parts into header to still allow crude tricks :(
AC_DEFINE_UNQUOTED(ARCH_CPU, "$build_cpu", [CPU type])
AC_DEFINE_UNQUOTED(ARCH_VENDOR, "$build_vendor", [OS Vendor])
AC_DEFINE_UNQUOTED(ARCH_OS, "$build_os", [OS type])
# !!! somehow backward compatible Symbol... (should be replaced by the
# defines above)
AC_DEFINE_UNQUOTED(ARCHNAME, "$build", [obsolete architecture string])
# !!! maybe make this configurable later
AC_DEFINE(DYNAMIC_MEMORY_ALLOCMODEL, 1, [UG memory allocation model])
# tell automake what to build
AM_CONDITIONAL(MACOS, test x$build_vendor = xapple)
AC_CONFIG_FILES([Makefile
dev/Makefile
dev/meta/Makefile
dev/ppm/Makefile
dev/ps/Makefile
dev/rif/Makefile
dev/sif/Makefile
dev/xif/Makefile
dom/Makefile
dom/std/Makefile
dom/lgm/Makefile
dom/lgm/ngin/Makefile
dom/lgm/ngin2d/Makefile
gm/Makefile
gm/gg2/Makefile
gm/gg3/Makefile
graphics/Makefile
graphics/uggraph/Makefile
graphics/grape/Makefile
lib/Makefile
lib/ugdata/Makefile
low/Makefile
np/Makefile
np/algebra/Makefile
np/amglib/Makefile
np/field/Makefile
np/procs/Makefile
np/udm/Makefile
tools/Makefile
ui/Makefile
parallel/Makefile
parallel/util/Makefile
parallel/ppif/Makefile
parallel/ppif/MPI/Makefile
parallel/ddd/Makefile
parallel/ddd/analyser/Makefile
parallel/ddd/basic/Makefile
parallel/ddd/basic/test/Makefile
parallel/ddd/ctrl/Makefile
parallel/ddd/ident/Makefile
parallel/ddd/if/Makefile
parallel/ddd/join/Makefile
parallel/ddd/mgr/Makefile
parallel/ddd/prio/Makefile
parallel/ddd/xfer/Makefile
parallel/dddif/Makefile
libug.pc
ug-config.cmake
ug-config-version.cmake
])
AC_OUTPUT
dnl Still missing:
dnl
dnl dom/gen/Makefile
dnl gm/gg3/netgen/general/makefile
dnl gm/gg3/netgen/geom/makefile
dnl gm/gg3/netgen/linalg/makefile
dnl gm/gg3/netgen/meshing/makefile
dnl gm/gg3/netgen/opti/makefile
# The libs from these directories are needed for devices
#add_subdirec