Changeset 2579


Ignore:
Timestamp:
Jul 3, 2012 4:03:05 PM (7 years ago)
Author:
stefan
Message:

work around some warnings from autoconf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/autotools-update/coin.m4

    r2578 r2579  
    300300# in the variable CXXDEFS, and additional compilation flags with ADD_CXXFLAGS.
    301301
    302 AC_DEFUN([AC_COIN_PROG_CXX],
    303 [AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0
    304 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    305 AC_LANG_PUSH(C++)
    306 
    307 AC_ARG_VAR(CXXDEFS,[Additional -D flags to be used when compiling C++ code.])
    308 AC_ARG_VAR(ADD_CXXFLAGS,[Additional C++ compiler options])
    309 AC_ARG_VAR(DBG_CXXFLAGS,[Debug C++ compiler options])
    310 AC_ARG_VAR(OPT_CXXFLAGS,[Optimize C++ compiler options])
    311 
    312 coin_has_cxx=yes
    313 
     302AC_DEFUN([AC_COIN_PROG_CXX_INIT],
     303[
    314304save_cxxflags="$CXXFLAGS"
    315305# For *-*-solaris*, promote Studio/Workshop compiler to front of list.
     
    335325AC_PROG_CXX([$comps])
    336326
    337 #AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler
    338 #thus, we test here whether $CXX is actually working
    339 AC_LANG_PUSH(C++)
    340 AC_MSG_CHECKING([whether C++ compiler $CXX works]);
    341 AC_COMPILE_IFELSE(
    342   [AC_LANG_PROGRAM(, [int i=0;])],
    343   [AC_MSG_RESULT(yes)],
    344   [AC_MSG_RESULT(no)
    345    AC_MSG_ERROR(failed to find a C++ compiler or C++ compiler $CXX does not work)]
    346 )
    347 AC_LANG_POP(C++)
    348 
    349327coin_cxx_is_cl=false
    350328# It seems that we need to cleanup something here for the Windows
     
    371349esac
    372350CXXFLAGS="$save_cxxflags"
     351])
     352
     353AC_DEFUN([AC_COIN_PROG_CXX],
     354[AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0
     355AC_REQUIRE([AC_COIN_PROG_CXX_INIT])
     356AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     357AC_LANG_PUSH(C++)
     358
     359AC_ARG_VAR(CXXDEFS,[Additional -D flags to be used when compiling C++ code.])
     360AC_ARG_VAR(ADD_CXXFLAGS,[Additional C++ compiler options])
     361AC_ARG_VAR(DBG_CXXFLAGS,[Debug C++ compiler options])
     362AC_ARG_VAR(OPT_CXXFLAGS,[Optimize C++ compiler options])
     363
     364#AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler
     365#thus, we test here whether $CXX is actually working
     366AC_MSG_CHECKING([whether C++ compiler $CXX works]);
     367AC_COMPILE_IFELSE(
     368  [AC_LANG_PROGRAM(, [int i=0;])],
     369  [AC_MSG_RESULT(yes)],
     370  [AC_MSG_RESULT(no)
     371   AC_MSG_ERROR(failed to find a C++ compiler or C++ compiler $CXX does not work)]
     372)
    373373
    374374# Check if a project specific CXXFLAGS variable has been set
     
    699699# possible to provide additional -D flags in the variable CDEFS.
    700700
    701 AC_DEFUN([AC_COIN_PROG_CC],
    702 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
    703 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    704 AC_LANG_PUSH(C)
    705 
     701# C compiler recognition moved to separate macro so we can AC_REQUIRE it
     702AC_DEFUN([AC_COIN_PROG_CC_INIT],
     703[
    706704# For consistency, we set the C compiler to the same value of the C++
    707705# compiler, if the C++ is set, but the C compiler isn't (only for CXX=cl)
     
    722720AC_ARG_VAR(DBG_CFLAGS,[Debug C compiler options])
    723721AC_ARG_VAR(OPT_CFLAGS,[Optimize C compiler options])
    724 
    725 coin_has_cc=yes
    726722
    727723save_cflags="$CFLAGS"
     
    780776esac
    781777AM_CONDITIONAL(COIN_CC_IS_CL, [test $coin_cc_is_cl = true])
     778])
     779
     780AC_DEFUN([AC_COIN_PROG_CC],
     781[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
     782AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     783AC_REQUIRE([AC_COIN_PROG_CC_INIT])
     784AC_LANG_PUSH(C)
     785
     786# C compiler has been checked via AC_REQUIRE([AC_COIN_PROG_CC_INIT])
     787# We do it this way so our explicit "call" to AC_PROG_CC is done before
     788# the AC_REQUIRE of AC_TRY_LINK
    782789
    783790# Check if a project specific CFLAGS variable has been set
     
    983990# given by the user), and find an appropriate value for FFLAGS
    984991
    985 AC_DEFUN([AC_COIN_PROG_F77],
    986 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
    987 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    988 AC_REQUIRE([AC_COIN_PROG_CC])
    989 AC_REQUIRE([AC_COIN_F77_COMPS])
    990 AC_LANG_PUSH([Fortran 77])
    991 
    992 AC_ARG_VAR(ADD_FFLAGS,[Additional Fortran compiler options])
    993 AC_ARG_VAR(DBG_FFLAGS,[Debug Fortran compiler options])
    994 AC_ARG_VAR(OPT_FFLAGS,[Optimize Fortran compiler options])
    995 
    996 coin_has_f77=yes
    997 
     992AC_DEFUN([AC_COIN_PROG_F77_INIT],
     993[
    998994save_fflags="$FFLAGS"
    999995
     
    10161012
    10171013FFLAGS="$save_fflags"
     1014])
     1015
     1016AC_DEFUN([AC_COIN_PROG_F77],
     1017[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
     1018AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     1019AC_REQUIRE([AC_COIN_PROG_CC])
     1020AC_REQUIRE([AC_COIN_F77_COMPS])
     1021AC_REQUIRE([AC_COIN_PROG_F77_INIT])
     1022AC_LANG_PUSH([Fortran 77])
     1023
     1024AC_ARG_VAR(ADD_FFLAGS,[Additional Fortran compiler options])
     1025AC_ARG_VAR(DBG_FFLAGS,[Debug Fortran compiler options])
     1026AC_ARG_VAR(OPT_FFLAGS,[Optimize Fortran compiler options])
    10181027
    10191028# Check if a project specific FFLAGS variable has been set
Note: See TracChangeset for help on using the changeset viewer.