"Fossies" - the Fresh Open Source Software Archive

Member "singular-4.2.1/m4/flags.m4" (9 Jun 2021, 4973 Bytes) of package /linux/misc/singular-4.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "flags.m4": 4.2.0p3_vs_4.2.1.

    1 AC_DEFUN([SING_SHOW_FLAGS], [
    2 
    3 echo "/* --------------- $1 --------------- */";
    4 
    5 AC_MSG_CHECKING([  CFLAGS?..])
    6 AC_MSG_RESULT(${CFLAGS:-unset})
    7 AC_MSG_CHECKING([CXXFLAGS?..])
    8 AC_MSG_RESULT(${CXXFLAGS:-unset})
    9 AC_MSG_CHECKING([CPPFLAGS?..])
   10 AC_MSG_RESULT(${CPPFLAGS:-unset})
   11 AC_MSG_CHECKING([    DEFS?..])
   12 AC_MSG_RESULT(${DEFS:-unset})
   13 AC_MSG_CHECKING([ LDFLAGS?..])
   14 AC_MSG_RESULT(${LDFLAGS:-unset})
   15 AC_MSG_CHECKING([    LIBS?..])
   16 AC_MSG_RESULT(${LIBS:-unset})
   17 AC_MSG_CHECKING([     GCC?..])
   18 AC_MSG_RESULT(${GCC:-unset})
   19 AC_MSG_CHECKING([      CC?..])
   20 AC_MSG_RESULT(${CC:-unset})
   21 AC_MSG_CHECKING([     GXX?..])
   22 AC_MSG_RESULT(${GXX:-unset})
   23 AC_MSG_CHECKING([     CXX?..])
   24 AC_MSG_RESULT(${CXX:-unset})
   25 
   26 # echo "/* =============== $1 =============== */";
   27 ])
   28 
   29 AC_DEFUN([SING_RESET_FLAGS], [
   30  AC_MSG_WARN([Please note that we set empty defaults for CFLAGS and CXXFLAGS])
   31  : ${CFLAGS:=""}
   32  : ${CXXFLAGS:=""}
   33 ])
   34 
   35 
   36 AC_DEFUN([SING_CHECK_SET_ARGS], [
   37 #  SING_SHOW_FLAGS([Initial state?...])dnl
   38 
   39  AC_ARG_ENABLE([debug],
   40   AS_HELP_STRING([--enable-debug], [build the debugging version of the libraries]),
   41   [ENABLE_DEBUG="$enableval"], [ENABLE_DEBUG=""])
   42 
   43  AC_MSG_CHECKING([debugging checks should be embedded])
   44  if test "x${ENABLE_DEBUG}" != xyes; then
   45   AC_MSG_RESULT([no])
   46  else
   47   AC_MSG_RESULT([yes])
   48  fi
   49 
   50  AC_ARG_ENABLE([optimizationflags],
   51   AS_HELP_STRING([--disable-optimizationflags], [build the without default optimization flags]),
   52   [ENABLE_OPTIMIZATION="$enableval"], [ENABLE_OPTIMIZATION="yeah"])
   53 
   54  if test "x${ENABLE_DEBUG}" = xyes; then
   55   SINGULAR_CFLAGS=""
   56   if test "x${ENABLE_OPTIMIZATION}" = xyeah; then
   57    ENABLE_OPTIMIZATION="no"
   58    AC_MSG_WARN([Please note that we disable implicit (default) optimization flags since you have enabled the debug flags... ])
   59   fi
   60  else
   61   SINGULAR_CFLAGS="-DSING_NDEBUG -DOM_NDEBUG"
   62   # for now let '-DSING_NDEBUG -DOM_NDEBUG' be here...
   63   AC_DEFINE([OM_NDEBUG],1,"Disable OM Debug")
   64   AC_DEFINE([SING_NDEBUG],1,"Disable Singular Debug")
   65  fi
   66 
   67  if test "x${ENABLE_OPTIMIZATION}" = xyeah; then
   68    ENABLE_OPTIMIZATION="yes"
   69  fi
   70 
   71  if test "x${ENABLE_OPTIMIZATION}" = xyes; then
   72   if test "x${ENABLE_DEBUG}" = xyes; then
   73    AC_MSG_WARN([Please note that you will be using our optimization flags together with debug flags... ])
   74   fi
   75  fi
   76 
   77  AC_MSG_CHECKING([whether optimization flags should be used])
   78  if test "x${ENABLE_OPTIMIZATION}" = xyes; then
   79   AC_MSG_RESULT([yes])
   80  else
   81   AC_MSG_RESULT([no])
   82  fi
   83 
   84 
   85  AM_CONDITIONAL(WANT_DEBUG, test x"${ENABLE_DEBUG}" = xyes)
   86  AM_CONDITIONAL(WANT_OPTIMIZATIONFLAGS, test x"${ENABLE_OPTIMIZATION}" = xyes)
   87 
   88  AC_DEFINE_UNQUOTED([SINGULAR_CFLAGS],"$SINGULAR_CFLAGS",[SINGULAR_CFLAGS])
   89  AC_SUBST(SINGULAR_CFLAGS)
   90 
   91 # SING_SHOW_FLAGS([checking flags....])
   92 
   93  FLAGS="-pipe -fno-common"
   94  AC_LANG_PUSH([C])
   95  AX_APPEND_COMPILE_FLAGS(${FLAGS}, [CFLAGS])
   96  AC_LANG_POP([C])
   97 
   98  AC_LANG_PUSH([C++])
   99  AX_APPEND_COMPILE_FLAGS(${FLAGS}, [CXXFLAGS])
  100 
  101  # separate parts of Singular have to be real C++ :)
  102  FFLAGS="-fexceptions -frtti"
  103  AX_APPEND_COMPILE_FLAGS(${FFLAGS}, [FEXCEPTIONSFRTTI_CXXFLAGS])
  104  AC_SUBST(FEXCEPTIONSFRTTI_CXXFLAGS)
  105 
  106  AC_LANG_POP([C++])
  107 
  108  AX_APPEND_LINK_FLAGS(${FLAGS})
  109 
  110  if test "x${ENABLE_DEBUG}" = xyes; then
  111   DBGFLAGS="-g -ftrapv -fdiagnostics-show-option -Wall -Wextra -fno-delete-null-pointer-checks"
  112   #  -pedantic too strict ??? -Wvla -Wno-long-long ???
  113   AC_LANG_PUSH([C])
  114   AX_APPEND_COMPILE_FLAGS(${DBGFLAGS}, [CFLAGS])
  115   AC_LANG_POP([C])
  116   AC_LANG_PUSH([C++])
  117   AX_APPEND_COMPILE_FLAGS(${DBGFLAGS}, [CXXFLAGS])
  118   AC_LANG_POP([C++])
  119   AX_APPEND_LINK_FLAGS(${DBGFLAGS})
  120  fi
  121 
  122  ## for clang: -Wunneeded-internal-declaration
  123 
  124  if test "x${ENABLE_OPTIMIZATION}" != xno; then
  125   OPTFLAGS="-g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks"
  126   #  -O3 - crashes gcc???!!!
  127   # -fpermissive
  128   AC_LANG_PUSH([C])
  129   AX_APPEND_COMPILE_FLAGS(${OPTFLAGS}, [CFLAGS])
  130   AC_LANG_POP([C])
  131   AC_LANG_PUSH([C++])
  132   AX_APPEND_COMPILE_FLAGS(${OPTFLAGS}, [CXXFLAGS])
  133   AX_APPEND_COMPILE_FLAGS([-fno-rtti], [CXXFLAGS])
  134 #   AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space], [CXXFLAGS])
  135 ###  AX_APPEND_COMPILE_FLAGS([-fno-implicit-templates], [CXXFLAGS]) # problems due to STL
  136   AC_LANG_POP([C++])
  137   AX_APPEND_LINK_FLAGS(${OPTFLAGS})
  138 #  AX_APPEND_LINK_FLAGS([-fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space])
  139 ###  AX_APPEND_LINK_FLAGS([-fno-implicit-templates]) # see above :(
  140 #  AX_APPEND_LINK_FLAGS([ ])
  141  fi
  142 
  143  FLAGS2="-Qunused-arguments"
  144  AC_LANG_PUSH([C])
  145  AX_APPEND_COMPILE_FLAGS(${FLAGS2}, [CFLAGS])
  146  AC_LANG_POP([C])
  147 
  148  AC_LANG_PUSH([C++])
  149  AX_APPEND_COMPILE_FLAGS(${FLAGS2}, [CXXFLAGS])
  150  AC_LANG_POP([C++])
  151 
  152  AX_APPEND_LINK_FLAGS(${FLAGS2})
  153 
  154 # SING_SHOW_FLAGS([before PROG_C_CC])
  155 
  156 
  157 AC_PROG_CC
  158 AC_PROG_CXX
  159 ])