Changeset 7d160bb in git


Ignore:
Timestamp:
May 24, 2013, 2:39:16 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
55150e5fbf40e9e0fa5d2c2fe5efd309f4ab2e12
Parents:
35564a593038fa54330b221ac4ac3342667c31ea
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-05-24 14:39:16+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-05-24 16:33:55+02:00
Message:
Better compiler flags handling by BS

fix: empty default compiler flags
add: use optimization flags by default (incompatible with debug, see --disable-optimizationflags)
add: check multiple compiler flags (debug/optimization)

NOTE: some optimization flags lead to GCC crashes.
NOTE: no implicit templates cannot be used due to some templated code (tgb*) :(
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r35564a5 r7d160bb  
    1212AM_MAINTAINER_MODE
    1313AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
     14
    1415m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
    15 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    16 
    1716
    1817dnl Check if build env is sane
     
    2120#
    2221# - Check for CC and CXX but be careful about CFLAGS.
    23 #
     22SING_RESET_FLAGS()
     23SING_CHECK_SET_ARGS()
    2424
    25 test "${CFLAGS+set}" = set || cflags_expl_set=no
     25#!
    2626AC_PROG_CC
    27 test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
    2827AC_PROG_CXX
    29 if test "x$GCC" != xyes && test "x$GXX" != xyes; then
    30   AC_MSG_WARN(you better use gcc to compile Factory)
    31 else
    32   if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
    33     AC_MSG_WARN([we use \`' as default for \`CXXFLAGS'
    34                     (instead of the configure default \`-g -O')])
    35   fi
    36   if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
    37     AC_MSG_WARN([we use \`' as default for \`CFLAGS'
    38                     (instead of the configure default \`-g -O')])
    39   fi
    40 fi
    41 
     28AC_PROG_CPP
     29AC_PROG_CXXCPP
     30AM_PROG_CC_C_O
     31### AM_PROG_LEX
     32AC_PROG_LN_S
     33AC_PROG_INSTALL
     34m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    4235
    4336AC_HEADER_STDC
     
    4639AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv)
    4740
    48 
    49 AC_PROG_CPP
    50 AC_PROG_CXXCPP
    51 AM_PROG_CC_C_O
    52 ### AM_PROG_LEX
    53 AC_PROG_LN_S
    54 AC_PROG_INSTALL
    5541
    5642AC_CHECK_PROGS([DOXYGEN], [doxygen])
     
    9783SING_CHECK_GFANLIB
    9884
    99 # CFLAGS
    100 if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
    101   CFLAGS=""
    102 fi
    103 
    104 # CXXFLAGS
    105 if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
    106   CXXFLAGS=""
    107 fi
    108 
    109 AC_DEFINE_UNQUOTED([CC],"$CC",[CC])
    110 AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX])
    111 AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS])
    112 AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS",[CXXFLAGS])
    113 AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS])
    114 
    11585### the following is needed due to the use of om_sing_opt_show_mem in misc_ip.cc...
    11686#ac_configure_args="$ac_configure_args --with-external-config_h=../Singular/omSingularConfig.h"
     
    138108fi
    139109
    140 SING_CHECK_DEBUG
    141 
    142110AC_ARG_ENABLE(countedref, AS_HELP_STRING([--enable-countedref], [Enable autoloading of reference counted types]),
    143111[if test "x$enableval" = "xyes"; then
     
    164132fi[]dnl
    165133])])
     134
     135
     136AC_DEFINE_UNQUOTED([CC],"$CC",[CC])
     137AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX])
     138AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS])
     139AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS",[CXXFLAGS])
     140AC_DEFINE_UNQUOTED([DEFS],"$DEFS",[DEFS])
     141AC_DEFINE_UNQUOTED([CPPFLAGS],"$CPPFLAGS",[CPPFLAGS])
     142AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS])
     143AC_DEFINE_UNQUOTED([LIBS],"$LIBS",[LIBS])
     144 
     145 
     146SING_SHOW_FLAGS([Compiler/linker flags: ])
    166147
    167148   
  • factory/configure.ac

    r35564a5 r7d160bb  
    2424m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    2525
    26 
    2726# Add pre'prefixed config
    2827AX_PREFIX_CONFIG_H([config.h],[],[config.h])
    2928
    30 AC_PROG_YACC
    31 # AM_PROG_AR
    32 LT_INIT
    33 
    34 #
    35 # Do not change version here!!!
    36 #
    3729dnl #
    3830dnl # Change version here, do not believe the comment in the
     
    4335
    4436#
    45 # - check withs and enables.
    46 #
    47 AC_ARG_WITH(
    48   Singular,
    49   [AS_HELP_STRING([--without-Singular],[build NOT for the use with CAS Singular.])],
    50   ,
    51   [with_Singular=yes])
    52 
    53 AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
    54 [if test "x$enableval" = "xyes"; then
    55   ENABLE_OMALLOC=yes
    56 fi], ENABLE_OMALLOC=no)
    57 
    58 AC_ARG_ENABLE(omalloc_trust, AS_HELP_STRING([--enable-omalloc-trust],[do not check the omalloc header]),
    59 [if test "x$enableval" = "xyes"; then
    60   omalloc_trust=yes
    61 fi], omalloc_trust=no)
    62 
    63 AC_ARG_WITH(omalloc_dir,[AS_HELP_STRING([--with-omalloc-dir=PTH],[location of omalloc])], with_omalloc_dir="$withval", with_omalloc_dir="")
    64 AC_ARG_WITH(omalloc_extra_dir,[AS_HELP_STRING([--with-omalloc-extra-dir=PTH],[optional extra location of omalloc])], with_omalloc_extra_dir="$withval", with_omalloc_extra_dir="")
    65 
    66 AC_ARG_ENABLE(
    67   cf-inline,
    68   [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
    69   [enable_cf_inline=$enableval],
    70   [enable_cf_inline=no])
    71 
    72 AC_ARG_ENABLE(
    73   streamio,
    74   [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
    75   ,
    76   [enable_streamio=no])
    77 
    78 AC_ARG_ENABLE(
    79   assertions,
    80   [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
    81   ,
    82   enable_assertions=yes)
    83 
    84 AC_ARG_ENABLE(
    85   timing,
    86   [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
    87   ,
    88   enable_timing=no)
    89 
    90 AC_ARG_ENABLE(
    91   debugoutput,
    92   [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
    93   ,
    94   enable_debugoutput=no)
    95 
    96 SING_CHECK_DEBUG
    97 
    98 #
    9937# - check for CC and CXX but be careful about CFLAGS.
    10038#
    101 test "${CFLAGS+set}" = set || cflags_expl_set=no
     39SING_RESET_FLAGS()
     40SING_CHECK_SET_ARGS()
     41
    10242AC_PROG_CC
    103 test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
    10443AC_PROG_CXX
    105 if test "x$GCC" != xyes && test "x$GXX" != xyes; then
    106   AC_MSG_WARN(you better use gcc to compile Factory)
    107 else
    108   if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
    109     AC_MSG_WARN([we use \`' as default for \`CXXFLAGS'
    110                     (instead of the configure default \`-g -O')])
    111   fi
    112   if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
    113     AC_MSG_WARN([we use \`' as default for \`CFLAGS'
    114                     (instead of the configure default \`-g -O')])
    115   fi
    116 fi
    117 
    11844#
    11945# - check for some other programs.
     
    12450AC_PROG_INSTALL
    12551AC_DISABLE_STATIC
     52AC_PROG_YACC
    12653LT_INIT
    12754AC_PROG_MAKE_SET
     
    13259AC_C_CONST
    13360AC_C_INLINE
     61
     62
     63#
     64# - check withs and enables.
     65#
     66AC_ARG_WITH(
     67  Singular,
     68  [AS_HELP_STRING([--without-Singular],[build NOT for the use with CAS Singular.])],
     69  ,
     70  [with_Singular=yes])
     71
     72AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
     73[if test "x$enableval" = "xyes"; then
     74  ENABLE_OMALLOC=yes
     75fi], ENABLE_OMALLOC=no)
     76
     77AC_ARG_ENABLE(omalloc_trust, AS_HELP_STRING([--enable-omalloc-trust],[do not check the omalloc header]),
     78[if test "x$enableval" = "xyes"; then
     79  omalloc_trust=yes
     80fi], omalloc_trust=no)
     81
     82AC_ARG_WITH(omalloc_dir,[AS_HELP_STRING([--with-omalloc-dir=PTH],[location of omalloc])], with_omalloc_dir="$withval", with_omalloc_dir="")
     83AC_ARG_WITH(omalloc_extra_dir,[AS_HELP_STRING([--with-omalloc-extra-dir=PTH],[optional extra location of omalloc])], with_omalloc_extra_dir="$withval", with_omalloc_extra_dir="")
     84
     85AC_ARG_ENABLE(
     86  cf-inline,
     87  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
     88  [enable_cf_inline=$enableval],
     89  [enable_cf_inline=no])
     90
     91AC_ARG_ENABLE(
     92  streamio,
     93  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
     94  ,
     95  [enable_streamio=no])
     96
     97AC_ARG_ENABLE(
     98  assertions,
     99  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
     100  ,
     101  enable_assertions=yes)
     102
     103AC_ARG_ENABLE(
     104  timing,
     105  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
     106  ,
     107  enable_timing=no)
     108
     109AC_ARG_ENABLE(
     110  debugoutput,
     111  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
     112  ,
     113  enable_debugoutput=no)
    134114
    135115AH_TEMPLATE([INT64], [Defenition for INT64])
  • gfanlib/configure.ac

    r35564a5 r7d160bb  
    6666AC_C_INLINE
    6767
    68 SING_CHECK_DEBUG
     68SING_RESET_FLAGS()
     69SING_CHECK_SET_ARGS()
     70
    6971
    7072#AC_MSG_RESULT($ac_cv_singuname)
  • libpolys/configure.ac

    r35564a5 r7d160bb  
    1818# - Check for CC and CXX but be careful about CFLAGS.
    1919#
    20 test "${CFLAGS+set}" = set || cflags_expl_set=no
     20SING_RESET_FLAGS()
     21SING_CHECK_SET_ARGS()
     22
    2123AC_PROG_CC
    22 test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
    2324AC_PROG_CXX
    24 if test "x$GCC" != xyes && test "x$GXX" != xyes; then
    25   AC_MSG_WARN(you better use gcc to compile Factory)
    26 else
    27   if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
    28     AC_MSG_WARN([we use \`' as default for \`CXXFLAGS'
    29                     (instead of the configure default \`-g -O')])
    30   fi
    31   if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
    32     AC_MSG_WARN([we use \`' as default for \`CFLAGS'
    33                     (instead of the configure default \`-g -O')])
    34   fi
    35 fi
    36 
    3725AM_PROG_CC_C_O
    3826AC_PROG_LN_S
    3927AC_PROG_INSTALL
    4028
    41 # AM_PROG_AR
    4229# Turn off shared libraries during beta-testing, since they
    4330# make the build process take too long.
     
    10289SING_CHECK_PLURAL
    10390
    104 # CFLAGS
    105 if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
    106   CFLAGS=""
    107 fi
    108  
    109 # CXXFLAGS
    110 if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
    111   CXXFLAGS=""
    112 fi
    113 
    114 #if test "x$prefix" != xNONE; then
    115 #  PREFIX="$prefix"
    116 #else
    117 #  PREFIX="$ac_default_prefix"
    118 #fi
    119 
    120 SING_CHECK_DEBUG
    121 
    12291# AC_SUBST(PREFIX)
    12392# AC_DEFINE_UNQUOTED(INSTALL_PREFIX,"$PREFIX",Prefix)
  • m4/options.m4

    r35564a5 r7d160bb  
    6969AC_MSG_RESULT($ENABLE_PLURAL)
    7070])
    71 
    72 
    73 
    74 AC_DEFUN([SING_CHECK_DEBUG], [
    75  ENABLE_DEBUG="no"
    76 
    77  AC_MSG_CHECKING([whether debugging checks should be embedded])
    78 
    79  AC_ARG_ENABLE([debug],
    80   AS_HELP_STRING([--enable-debug], [build the debugging version of the libraries]),
    81   [if test "x$enableval" = "xyes"; then
    82   ENABLE_DEBUG="yes"
    83   fi])
    84  
    85  AM_CONDITIONAL(WANT_DEBUG, test x"${ENABLE_DEBUG}" == xyes)
    86  
    87  if test "x${ENABLE_DEBUG}" != xyes; then
    88   AC_MSG_RESULT([no])
    89   AC_DEFINE([OM_NDEBUG],1,"Disable OM Debug")
    90   AC_DEFINE([NDEBUG],1,"Disable Debug")
    91  else
    92   AC_MSG_RESULT([yes])
    93  fi
    94 ])
  • omalloc/configure.ac

    r35564a5 r7d160bb  
    2828dnl help for configure
    2929dnl
    30 SING_CHECK_DEBUG
     30###### SING_RESET_FLAGS()
     31###### SING_CHECK_SET_ARGS()
    3132
    3233AC_ARG_WITH(
  • resources/configure.ac

    r35564a5 r7d160bb  
    6060
    6161SING_CHECK_PIPE
    62 SING_CHECK_DEBUG
     62SING_RESET_FLAGS()
     63SING_CHECK_SET_ARGS()
     64
    6365
    6466# CFLAGS
  • xalloc/configure.ac

    r35564a5 r7d160bb  
    2424LT_INIT
    2525
    26 SING_CHECK_DEBUG
     26SING_RESET_FLAGS()
     27SING_CHECK_SET_ARGS()
     28
    2729
    2830AC_CONFIG_FILES([Makefile])
Note: See TracChangeset for help on using the changeset viewer.