Skip to content

Commit

Permalink
- Fix configure on OSX
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5826 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jul 8, 2010
1 parent ac71acc commit d8d92ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
40 changes: 8 additions & 32 deletions configure
Expand Up @@ -607,7 +607,6 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
FPUFLAGS
EXE
QMAKE
LIBSENDDATA_LDFLAGS
Expand Down Expand Up @@ -2182,11 +2181,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu






if test -z "$CFLAGS"; then
CFLAGS=" "
if test "Darwin" = `uname`; then
CFLAGS="-O3"
else
CFLAGS="-O3 -march=native"
fi
fi

ac_ext=c
Expand Down Expand Up @@ -3307,36 +3309,10 @@ rm -f conftest.l $LEX_OUTPUT_ROOT.c

fi

if test "`uname -m`" = "x86_64" && "Darwin" != `uname`; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CPU architecture" >&5
$as_echo_n "checking CPU architecture... " >&6; }

MARCH=`echo $CFLAGS | grep -- -march | sed 's/^.*-march=\(.*\) .*\$/\1/'`
if test -n "$MARCH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MARCH" >&5
$as_echo "$MARCH" >&6; }
else
CFLAGS+=" -march=native"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: -march=native" >&5
$as_echo "-march=native" >&6; }
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking optimizations" >&5
$as_echo_n "checking optimizations... " >&6; }

OLEVEL=`echo $CFLAGS | grep -- -O | sed 's/^.*-O\(.\).*\$/\1/'`
if test -n "$OLEVEL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: -O$OLEVEL" >&5
$as_echo "-O$OLEVEL" >&6; }
else
CFLAGS="-O3 $CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: -O3" >&5
$as_echo "-O3" >&6; }
fi

if test "`uname -m`" = "x86_64"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 64-bit CFLAGS" >&5
$as_echo_n "checking 64-bit CFLAGS... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking x86_64 CFLAGS" >&5
$as_echo_n "checking x86_64 CFLAGS... " >&6; }

if echo $CFLAGS | grep -q -- -fPIC; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: already got -fPIC" >&5
Expand Down
8 changes: 6 additions & 2 deletions configure.in
Expand Up @@ -33,18 +33,22 @@ AC_SUBST(EXE)

dnl Disables the default CFLAGS="-g -O2"
if test -z "$CFLAGS"; then
if test "Darwin" = `uname`; then
CFLAGS="-O3"
else
CFLAGS="-O3 -march=native"
fi
fi

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LEX

if test "`uname -m`" = "x86_64"; then
if test "`uname -m`" = "x86_64" && "Darwin" != `uname`; then

AC_MSG_CHECKING([64-bit CFLAGS])
AC_MSG_CHECKING([x86_64 CFLAGS])

if echo $CFLAGS | grep -q -- -fPIC; then
AC_MSG_RESULT([already got -fPIC])
Expand Down

0 comments on commit d8d92ad

Please sign in to comment.