Changeset 2363


Ignore:
Timestamp:
Jul 14, 2011 4:15:46 AM (8 years ago)
Author:
stefan
Message:

do a proper check for strings.h instead of assuming a cached value

Location:
ThirdParty/Metis/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ThirdParty/Metis/trunk/configure

    r2354 r2363  
    2012720127}
    2012820128
    20129 # We need to create a dummy header file for Windows
    20130 echo "$as_me:$LINENO: checking whether we need to create a dummy strings.h file" >&5
    20131 echo $ECHO_N "checking whether we need to create a dummy strings.h file... $ECHO_C" >&6
    20132 if test "$ac_cv_header_strings_h" = no; then
    20133   echo "$as_me:$LINENO: result: yes" >&5
    20134 echo "${ECHO_T}yes" >&6
     20129# We may need to create a dummy header file for Windows
     20130if test "${ac_cv_header_strings_h+set}" = set; then
     20131  echo "$as_me:$LINENO: checking for strings.h" >&5
     20132echo $ECHO_N "checking for strings.h... $ECHO_C" >&6
     20133if test "${ac_cv_header_strings_h+set}" = set; then
     20134  echo $ECHO_N "(cached) $ECHO_C" >&6
     20135fi
     20136echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5
     20137echo "${ECHO_T}$ac_cv_header_strings_h" >&6
     20138else
     20139  # Is the header compilable?
     20140echo "$as_me:$LINENO: checking strings.h usability" >&5
     20141echo $ECHO_N "checking strings.h usability... $ECHO_C" >&6
     20142cat >conftest.$ac_ext <<_ACEOF
     20143/* confdefs.h.  */
     20144_ACEOF
     20145cat confdefs.h >>conftest.$ac_ext
     20146cat >>conftest.$ac_ext <<_ACEOF
     20147/* end confdefs.h.  */
     20148$ac_includes_default
     20149#include <strings.h>
     20150_ACEOF
     20151rm -f conftest.$ac_objext
     20152if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     20153  (eval $ac_compile) 2>conftest.er1
     20154  ac_status=$?
     20155  grep -v '^ *+' conftest.er1 >conftest.err
     20156  rm -f conftest.er1
     20157  cat conftest.err >&5
     20158  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     20159  (exit $ac_status); } &&
     20160         { ac_try='test -z "$ac_c_werror_flag"
     20161                         || test ! -s conftest.err'
     20162  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     20163  (eval $ac_try) 2>&5
     20164  ac_status=$?
     20165  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     20166  (exit $ac_status); }; } &&
     20167         { ac_try='test -s conftest.$ac_objext'
     20168  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     20169  (eval $ac_try) 2>&5
     20170  ac_status=$?
     20171  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     20172  (exit $ac_status); }; }; then
     20173  ac_header_compiler=yes
     20174else
     20175  echo "$as_me: failed program was:" >&5
     20176sed 's/^/| /' conftest.$ac_ext >&5
     20177
     20178ac_header_compiler=no
     20179fi
     20180rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     20181echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     20182echo "${ECHO_T}$ac_header_compiler" >&6
     20183
     20184# Is the header present?
     20185echo "$as_me:$LINENO: checking strings.h presence" >&5
     20186echo $ECHO_N "checking strings.h presence... $ECHO_C" >&6
     20187cat >conftest.$ac_ext <<_ACEOF
     20188/* confdefs.h.  */
     20189_ACEOF
     20190cat confdefs.h >>conftest.$ac_ext
     20191cat >>conftest.$ac_ext <<_ACEOF
     20192/* end confdefs.h.  */
     20193#include <strings.h>
     20194_ACEOF
     20195if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     20196  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     20197  ac_status=$?
     20198  grep -v '^ *+' conftest.er1 >conftest.err
     20199  rm -f conftest.er1
     20200  cat conftest.err >&5
     20201  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     20202  (exit $ac_status); } >/dev/null; then
     20203  if test -s conftest.err; then
     20204    ac_cpp_err=$ac_c_preproc_warn_flag
     20205    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     20206  else
     20207    ac_cpp_err=
     20208  fi
     20209else
     20210  ac_cpp_err=yes
     20211fi
     20212if test -z "$ac_cpp_err"; then
     20213  ac_header_preproc=yes
     20214else
     20215  echo "$as_me: failed program was:" >&5
     20216sed 's/^/| /' conftest.$ac_ext >&5
     20217
     20218  ac_header_preproc=no
     20219fi
     20220rm -f conftest.err conftest.$ac_ext
     20221echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     20222echo "${ECHO_T}$ac_header_preproc" >&6
     20223
     20224# So?  What about this header?
     20225case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     20226  yes:no: )
     20227    { echo "$as_me:$LINENO: WARNING: strings.h: accepted by the compiler, rejected by the preprocessor!" >&5
     20228echo "$as_me: WARNING: strings.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     20229    { echo "$as_me:$LINENO: WARNING: strings.h: proceeding with the compiler's result" >&5
     20230echo "$as_me: WARNING: strings.h: proceeding with the compiler's result" >&2;}
     20231    ac_header_preproc=yes
     20232    ;;
     20233  no:yes:* )
     20234    { echo "$as_me:$LINENO: WARNING: strings.h: present but cannot be compiled" >&5
     20235echo "$as_me: WARNING: strings.h: present but cannot be compiled" >&2;}
     20236    { echo "$as_me:$LINENO: WARNING: strings.h:     check for missing prerequisite headers?" >&5
     20237echo "$as_me: WARNING: strings.h:     check for missing prerequisite headers?" >&2;}
     20238    { echo "$as_me:$LINENO: WARNING: strings.h: see the Autoconf documentation" >&5
     20239echo "$as_me: WARNING: strings.h: see the Autoconf documentation" >&2;}
     20240    { echo "$as_me:$LINENO: WARNING: strings.h:     section \"Present But Cannot Be Compiled\"" >&5
     20241echo "$as_me: WARNING: strings.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     20242    { echo "$as_me:$LINENO: WARNING: strings.h: proceeding with the preprocessor's result" >&5
     20243echo "$as_me: WARNING: strings.h: proceeding with the preprocessor's result" >&2;}
     20244    { echo "$as_me:$LINENO: WARNING: strings.h: in the future, the compiler will take precedence" >&5
     20245echo "$as_me: WARNING: strings.h: in the future, the compiler will take precedence" >&2;}
     20246    (
     20247      cat <<\_ASBOX
     20248## --------------------------------------------------------------- ##
     20249## Report this to http://projects.coin-or.org/BuildTools/newticket ##
     20250## --------------------------------------------------------------- ##
     20251_ASBOX
     20252    ) |
     20253      sed "s/^/$as_me: WARNING:     /" >&2
     20254    ;;
     20255esac
     20256echo "$as_me:$LINENO: checking for strings.h" >&5
     20257echo $ECHO_N "checking for strings.h... $ECHO_C" >&6
     20258if test "${ac_cv_header_strings_h+set}" = set; then
     20259  echo $ECHO_N "(cached) $ECHO_C" >&6
     20260else
     20261  ac_cv_header_strings_h=$ac_header_preproc
     20262fi
     20263echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5
     20264echo "${ECHO_T}$ac_cv_header_strings_h" >&6
     20265
     20266fi
     20267if test $ac_cv_header_strings_h = yes; then
     20268  :
     20269else
    2013520270  touch strings.h
    20136 else
    20137   echo "$as_me:$LINENO: result: no" >&5
    20138 echo "${ECHO_T}no" >&6
    20139 fi
     20271fi
     20272
     20273
    2014020274
    2014120275# On some systems, there are no drand48 and srand48.
  • ThirdParty/Metis/trunk/configure.ac

    r2017 r2363  
    5757AC_COIN_INIT_AUTO_TOOLS
    5858
    59 # We need to create a dummy header file for Windows
    60 AC_MSG_CHECKING([whether we need to create a dummy strings.h file])
    61 if test "$ac_cv_header_strings_h" = no; then
    62   AC_MSG_RESULT([yes])
    63   touch strings.h
    64 else
    65   AC_MSG_RESULT([no])
    66 fi
     59# We may need to create a dummy header file for Windows
     60AC_CHECK_HEADER([strings.h], [], [touch strings.h])
    6761
    6862# On some systems, there are no drand48 and srand48.
Note: See TracChangeset for help on using the changeset viewer.