X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fconfigure.in;h=a8c506ec0c1301d7669f4b64b33987b7ab14afd9;hb=a3ab6292ce144f88d1c5a919ee4a72d94e1366f7;hp=17ff5a39b5cd7a568cb26c1357c3bc747e0f8573;hpb=c03aeb7c6e0f49d55a275fa3cfc63a380d6c57cf;p=fw%2Fsdcc diff --git a/sim/ucsim/configure.in b/sim/ucsim/configure.in index 17ff5a39..a8c506ec 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 # -------------------------------------------------------- @@ -456,11 +479,11 @@ fi 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 +491,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)