Commit cc62a19b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Generalize BUILD_* substitutions and add substitutions for MPI.

parent 15ec9009
......@@ -620,6 +620,10 @@ BUILD_F77
BUILD_FC
BUILD_CXX
BUILD_CC
BUILD_FC_INCLUDE
BUILD_C_INCLUDE
BUILD_MPI_FC_LIB
BUILD_MPI_C_LIB
BUILD_LIBS
BUILD_LDFLAGS
BUILD_FCFLAGS
......@@ -914,6 +918,10 @@ BUILD_CFLAGS
BUILD_FCFLAGS
BUILD_LDFLAGS
BUILD_LIBS
BUILD_MPI_C_LIB
BUILD_MPI_FC_LIB
BUILD_C_INCLUDE
BUILD_FC_INCLUDE
BUILD_CC
BUILD_CXX
BUILD_FC
......@@ -1655,6 +1663,14 @@ Some influential environment variables:
BUILD_LDFLAGS
append to LDFLAGS during build but not in configure phase
BUILD_LIBS append to LIBS during build but not in configure phase
BUILD_MPI_C_LIB
append to MPI_C_LIB during build but not in configure phase
BUILD_MPI_FC_LIB
append to MPI_FC_LIB during build but not in configure phase
BUILD_C_INCLUDE
append to C_INCLUDE during build but not in configure phase
BUILD_FC_INCLUDE
append to FC_INCLUDE during build but not in configure phase
BUILD_CC replace CC with expansion of $BUILD_CC during build but not in
configure phase
BUILD_CXX replace CXX with expansion of $BUILD_CXX during build but not in
......@@ -28740,7 +28756,6 @@ else
USE_FC_FALSE=
fi
 
# Checks for compiler
COMPILER="$CC $CFLAGS"
 
......@@ -28944,6 +28959,10 @@ CFLAGS="$CFLAGS${BUILD_CFLAGS+ $BUILD_CFLAGS}"
FCFLAGS="$FCFLAGS${BUILD_FCFLAGS+ $BUILD_FCFLAGS}"
LDFLAGS="$LDFLAGS${BUILD_LDFLAGS+ $BUILD_LDFLAGS}"
LIBS="$LIBS${BUILD_LIBS+ $BUILD_LIBS}"
MPI_C_LIB="$MPI_C_LIB${BUILD_MPI_C_LIB+ $BUILD_MPI_C_LIB}"
MPI_FC_LIB="$MPI_FC_LIB${BUILD_MPI_FC_LIB+ $BUILD_MPI_FC_LIB}"
C_INCLUDE="$C_INCLUDE${BUILD_C_INCLUDE+ $BUILD_C_INCLUDE}"
FC_INCLUDE="$FC_INCLUDE${BUILD_FC_INCLUDE+ $BUILD_FC_INCLUDE}"
CC="${BUILD_CC-$CC}"
CXX="${BUILD_CXX-$CXX}"
FC="${BUILD_FC-$FC}"
......
......@@ -325,40 +325,20 @@ AM_CONDITIONAL([USE_FC],[test -n "$FC" && test "X$FC" != "Xno" && test x$acx_cv_
dnl
AC_SUBST([CPPFLAGS])dnl
dnl
AC_ARG_VAR([BUILD_CFLAGS],
[append to CFLAGS during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([CFLAGS="$CFLAGS${BUILD_CFLAGS+ $BUILD_CFLAGS}"])dnl
AM_SUBST_NOTMAKE([BUILD_CFLAGS])dnl
AC_ARG_VAR([BUILD_FCFLAGS],
[append to FCFLAGS during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([FCFLAGS="$FCFLAGS${BUILD_FCFLAGS+ $BUILD_FCFLAGS}"])dnl
AM_SUBST_NOTMAKE([BUILD_FCFLAGS])dnl
AC_ARG_VAR([BUILD_LDFLAGS],
[append to LDFLAGS during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([LDFLAGS="$LDFLAGS${BUILD_LDFLAGS+ $BUILD_LDFLAGS}"])dnl
AM_SUBST_NOTMAKE([BUILD_LDFLAGS])dnl
AC_ARG_VAR([BUILD_LIBS],
[append to LIBS during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([LIBS="$LIBS${BUILD_LIBS+ $BUILD_LIBS}"])dnl
AM_SUBST_NOTMAKE([BUILD_LIBS])dnl
AC_ARG_VAR([BUILD_CC],
[replace CC with expansion of $BUILD_CC during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([CC="${BUILD_CC-$CC}"])dnl
AM_SUBST_NOTMAKE([BUILD_CC])dnl
AC_ARG_VAR([BUILD_CXX],
[replace CXX with expansion of $BUILD_CXX during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([CXX="${BUILD_CXX-$CXX}"])dnl
AM_SUBST_NOTMAKE([BUILD_CXX])dnl
AC_ARG_VAR([BUILD_FC],
[replace FC with expansion of $BUILD_FC during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([FC="${BUILD_FC-$FC}"])dnl
AM_SUBST_NOTMAKE([BUILD_FC])dnl
AC_ARG_VAR([BUILD_F77],
[replace F77 with expansion of $BUILD_F77 during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE([F77="${BUILD_F77-$F77}"])dnl
AM_SUBST_NOTMAKE([BUILD_F77])dnl
m4_foreach([build_flag_var],[[BUILD_CFLAGS],[BUILD_FCFLAGS],[BUILD_LDFLAGS],[BUILD_LIBS],[BUILD_MPI_C_LIB],[BUILD_MPI_FC_LIB],[BUILD_C_INCLUDE],[BUILD_FC_INCLUDE]],
[AC_ARG_VAR(build_flag_var,
[append to ]m4_bpatsubst(build_flag_var, [BUILD_], [])[ during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE(m4_bpatsubst(build_flag_var, [BUILD_], [])[="$]m4_bpatsubst(build_flag_var, [BUILD_], [])[$]{build_flag_var+ $build_flag_var[}"])dnl
AM_SUBST_NOTMAKE(build_flag_var)])dnl
m4_foreach([build_tool_var],[[BUILD_CC],[BUILD_CXX],[BUILD_FC],[BUILD_F77]],
[AC_ARG_VAR(build_tool_var,
[replace ]m4_bpatsubst(build_tool_var, [BUILD_], [])[ with expansion of $]build_tool_var[ during build but not in configure phase])dnl
AC_CONFIG_COMMANDS_PRE(m4_bpatsubst(build_tool_var, [BUILD_], [])[="$]{build_tool_var-$[]m4_bpatsubst(build_tool_var, [BUILD_], [])}["])dnl
AM_SUBST_NOTMAKE(build_tool_var)])dnl
dnl
dnl
dnl
# Checks for compiler
COMPILER="$CC $CFLAGS"
AC_DEFINE_UNQUOTED(COMPILER, ["$COMPILER"], [Compiler])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment