X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fconfigure.in;h=05ecf9fbe3c7ed18908b6bc75904f9086cb3a480;hb=011a73edf0a9ef1e9c50cdf01c94050bbfc70bdf;hp=17ff5a39b5cd7a568cb26c1357c3bc747e0f8573;hpb=d25410272593de279e84cf891961c535b8c7fc70;p=fw%2Fsdcc diff --git a/sim/ucsim/configure.in b/sim/ucsim/configure.in index 17ff5a39..05ecf9fb 100644 --- a/sim/ucsim/configure.in +++ b/sim/ucsim/configure.in @@ -379,7 +379,6 @@ ucsim_ACCEPT_LENGTH_T AC_DEFUN(DD_COPT, [ AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2, cat >_test_.c < int main(void) {return(0);} EOF $$1 -v -$2 -c _test_.c 1>&5 2>&5 @@ -391,6 +390,30 @@ fi rm -f _test_.* a.out) ]) +# DD_COPT_NO_IGNORE macro checks if the compiler specified as the +# 1st parameter supports and doesn't ignore option specified as the +# 2nd parameter +# For example: DD_COPT_NO_IGNORE(CXX, fPIC) + +AC_DEFUN(DD_COPT_NO_IGNORE, [ +AC_CACHE_CHECK(whether $$1 accepts and doesn't ignore -$2,ucsim_cv_$1$2, +cat >_test_.c <&1 1>&5) +if test "$?" = "0"; then + expr "$ucsim_cv_$1$2" : '.*'-$2'.*ignored' 1>&5 2>&5 + if test "$?" = "0"; then + ucsim_cv_$1$2="no" + else + ucsim_cv_$1$2="yes" + fi +else + ucsim_cv_$1$2="no" +fi +rm -f _test_.* a.out) +]) + # Checking characteristics of compilers and other programs # -------------------------------------------------------- @@ -454,13 +477,17 @@ if test "$ucsim_cv_CXXpipe" = "yes"; then CXXFLAGS="$CXXFLAGS -pipe" fi +# temporary solution to supress GCC 4.2.0 c++ warning: +# deprecated conversion from string constant to `char *' +CXXFLAGS="$CXXFLAGS -Wno-write-strings" + PICOPT="" SHAREDLIB="no" -DD_COPT(CXX, fPIC) +DD_COPT_NO_IGNORE(CXX, fPIC) if test "$ucsim_cv_CXXfPIC" = "yes"; then PICOPT="-fPIC" else - DD_COPT(CXX, fpic) + DD_COPT_NO_IGNORE(CXX, fpic) if test "$ucsim_cv_CXXfpic" = "yes"; then PICOPT="-fpic" fi @@ -468,14 +495,6 @@ fi if test "$PICOPT"x != "x"; then SHAREDLIB="yes" fi -# If this is Cygwin neither use Position Independant Code -# nor build .so -# Quick + dirty by Bernhard -# FIXME -if $CXX --version 2>&1 | grep -i cygming 1>&5 2>&5 || $CXX --version 2>&1 | grep -i cygwin 1>&5 2>&5; then - PICOPT="" - SHAREDLIB="no" -fi AC_SUBST(SHAREDLIB) AC_SUBST(PICOPT)