Menu

#2 Support SGI-specific compiler options

closed-accepted
nobody
None
5
2001-04-09
2001-03-13
No

Here are some hacks to configure.in to use the "-Ofast"
option used by SGI's MIPSPro compilers (I finally got
tired of hand-editing the generated Makefile...) They
shouldn't hurt any other platform.

diff -c -r1.33 configure.in
*** configure.in 2001/02/10 15:29:01 1.33
--- configure.in 2001/03/13 23:04:43
***************
*** 267,272 ****
--- 267,281 ----
dnl IRIX headers work fine, but somehow don't
define or use "STDC_HEADERS"
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS
-DB230400=B115200 -DSTDC_HEADERS"
LIBS="$LIBS -laudio"
+
+ dnl Check if our compiler supports -Ofast (MIPSPro)
+ HAVE_OFAST=no
+ ocflags="$CFLAGS"
+ CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast
/;s/^-g /-Ofast /;s/ -g$/ -Ofast/;s/^-g$/-Ofast/'`
+ AC_MSG_CHECKING(if "-Ofast" works)
+ dnl Do a test compile of an empty function
+ AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes);
HAVE_OFAST=yes], AC_MSG_RESULT(no))
+ CFLAGS="$ocflags"
;;
esac

***************
*** 612,617 ****
--- 621,633 ----
dnl gb-- Probably not the cleanest way to take
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g /
/;s/ -g$/ /;s/^-g$//'`
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g
/ /;s/ -g$/ /;s/^-g$//'`
+ fi
+
+ dnl Or if we have -Ofast
+ if [[ "x$HAVE_OFAST" = "xyes" ]]; then
+ CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast
/;s/^-g /-Ofast /;s/ -g$/ -Ofast/;s/^-g$/-Ofast/'`
+ CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / -Ofast
/;s/^-g /-Ofast /;s/ -g$/ -Ofast/;s/^-g$/-Ofast/'`
+ LDFLAGS="$LDFLAGS -Ofast"
fi

dnl Generate Makefile.

Discussion

  • Christian Bauer

    Christian Bauer - 2001-04-09

    Logged In: YES
    user_id=10820

    Added to CVS as of 28-Mar-2001.

     
  • Christian Bauer

    Christian Bauer - 2001-04-09
    • labels: 103117 -->
    • milestone: 101869 -->
    • status: open --> open-accepted
     
  • Christian Bauer

    Christian Bauer - 2001-04-09
    • status: open-accepted --> closed-accepted
     

Log in to post a comment.