Mac OS X: compile with default architecture (i386 on 10.5, x86_64 on 10.6) and allow

alternative architecture running configure with option --with-archflags="-arch xxx"

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7870 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-11-18 13:23:52 +00:00
parent db6ca980af
commit e002042fd9

View File

@ -33,6 +33,11 @@ AC_PREREQ(2.50)
dnl Required file in package... dnl Required file in package...
AC_INIT(src/Fl.cxx) AC_INIT(src/Fl.cxx)
dnl So --with-archflags option is used during "checking size of long"
if test `uname` = Darwin; then
CFLAGS="$CFLAGS $with_archflags"
fi
dnl FLTK library versions... dnl FLTK library versions...
FL_MAJOR_VERSION=1 FL_MAJOR_VERSION=1
FL_MINOR_VERSION=3 FL_MINOR_VERSION=3
@ -102,21 +107,6 @@ case $uname in
fi fi
fi fi
;; ;;
Darwin*)
# Starting with 10.6 (Snow Leopard), OS X does not support
# Carbon calls anymore. We patch this until we are completely Cocoa compliant
# by limiting ourselves to 32 bit Intel compiles
d_ver_rev=`sw_vers -productVersion | sed -e 's/\.[[0-9]][[0-9]]*//2'`
d_ver=`echo $d_ver_rev | sed -e 's/\.[[0-9]][[0-9]]*//'`
d_rev=`echo $d_ver_rev | sed -e 's/[[0-9]][[0-9]]*\.//'`
if test $d_ver -gt 10 -o $d_ver -eq 10 -a $d_rev -ge 6; then
CFLAGS="$CFLAGS -arch i386"
CXXFLAGS="$CXXFLAGS -arch i386"
LDFLAGS="$LDFLAGS -arch i386"
DSOFLAGS="$DSOFLAGS -arch i386"
fi
;;
esac esac
dnl Define the libraries and link options we will need. dnl Define the libraries and link options we will need.
@ -373,9 +363,7 @@ AC_ARG_WITH(archflags, [ --with-archflags="flags"
case $uname in case $uname in
Darwin*) Darwin*)
# QD is not supported anymore since 1.3 # QD is not supported anymore since 1.3
AC_DEFINE(USE_QUARTZ, 1)
AC_DEFINE(__APPLE_QUARTZ__) AC_DEFINE(__APPLE_QUARTZ__)
AC_DEFINE(__APPLE_COCOA__)
;; ;;
esac esac
@ -840,7 +828,7 @@ case $uname_GUI in
Darwin*) Darwin*)
# MacOS X uses Cocoa for graphics. There are still some Carbon leftovers. # MacOS X uses Cocoa for graphics. There are still some Carbon leftovers.
LIBS="$LIBS -framework Carbon -framework Cocoa -framework ApplicationServices -framework AudioToolbox" LIBS="$LIBS -framework Cocoa -framework Carbon -framework AudioToolbox"
if test x$have_pthread = xyes; then if test x$have_pthread = xyes; then
AC_DEFINE(HAVE_PTHREAD) AC_DEFINE(HAVE_PTHREAD)