|
|
dnl Mingw, because it doesnt have a standard file tree. Maybe if ming do this | dnl Mingw, because it doesnt have a standard file tree. Maybe if ming do this |
dnl else do -I/usr/include. Or some shit. You figure it out. | dnl else do -I/usr/include. Or some shit. You figure it out. |
| |
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" |
|
dnl - Same thing here. | dnl - Same thing here. |
| |
dnl - Where are our compilers, and who are we compiling for? | dnl - Where are our compilers, and who are we compiling for? |
|
|
dnl - It is easier to debug zsnes with no optimization enabled. | dnl - It is easier to debug zsnes with no optimization enabled. |
ZSNESEXE="zsnesd" | ZSNESEXE="zsnesd" |
PSR_TEMP="" | PSR_TEMP="" |
CFLAGS="$CFLAGS -Wall -W -DDEBUG -O0 -fno-omit-frame-pointer -gstabs3" |
CFLAGS="$CFLAGS -Wall -W -DDEBUG -gstabs3" |
NFLAGS="$NFLAGS -DDEBUG -g -F stabs -s -O0" | NFLAGS="$NFLAGS -DDEBUG -g -F stabs -s -O0" |
else | else |
ZSNESEXE="zsnes" | ZSNESEXE="zsnes" |
PSR_TEMP=" rm -f t_\$*.c" | PSR_TEMP=" rm -f t_\$*.c" |
| |
CFLAGSBAK="$CFLAGS" |
|
AC_ARG_VAR(force_arch, [Force architecture to optimize GCC/G++ for]) |
|
AC_MSG_CHECKING(which cpu architecture to optimize for) |
|
if test x$force_arch != x; then |
|
CFLAGS="$CFLAGS -march=$force_arch" |
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]])], |
|
[AC_MSG_RESULT(forcing $force_arch)], |
|
[AC_MSG_RESULT($force_arch ??) |
|
AC_MSG_WARN(incorrect force_arch parameter) |
|
force_arch="" |
|
CFLAGS="$CFLAGSBAK" |
|
AC_MSG_CHECKING(for autodetected architecture)]) |
|
fi |
|
if test x$force_arch = x; then |
|
if test x$ARCH_INFO = x; then |
|
case x$target in |
|
i686-*-*) |
|
AC_MSG_RESULT(guessing i686) |
|
CFLAGS="$CFLAGS -march=i686" |
|
;; |
|
i586-*-*) |
|
AC_MSG_RESULT(guessing i586) |
|
CFLAGS="$CFLAGS -march=i586" |
|
;; |
|
i486-*-*) |
|
AC_MSG_RESULT(guessing i486) |
|
CFLAGS="$CFLAGS -march=i486" |
|
;; |
|
*) |
|
AC_MSG_RESULT(guessing i386) |
|
CFLAGS="$CFLAGS -march=i386" |
|
AC_MSG_WARN([This is not what you want, use --target or force-arch]) |
|
;; |
|
esac |
|
else |
|
AC_MSG_RESULT($ARCH_INFO) |
|
CFLAGS="$CFLAGS -march=$ARCH_INFO" |
|
fi |
|
fi |
|
|
|
AC_ARG_ENABLE(release, | AC_ARG_ENABLE(release, |
[ --enable-release Build ultra-optimized release binary (zsnes)], | [ --enable-release Build ultra-optimized release binary (zsnes)], |
release=$enableval, | release=$enableval, |
|
|
AC_MSG_CHECKING(if you want crazy optimizations) | AC_MSG_CHECKING(if you want crazy optimizations) |
AC_MSG_RESULT($release) | AC_MSG_RESULT($release) |
if test x$release = xyes; then | if test x$release = xyes; then |
if test x$force_arch = x; then |
CFLAGS="$CFLAGS $STRIP -D__RELEASE__" |
AC_MSG_WARN([If you intend to distribute this binary, make sure you use force_arch and set to i586 (or whichever CPU Arch you intend for)]) |
|
fi |
|
CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr $STRIP -D__RELEASE__" |
|
NFLAGS="$NFLAGS -O99999999 -D__RELEASE__" | NFLAGS="$NFLAGS -O99999999 -D__RELEASE__" |
else | else |
CFLAGS="$CFLAGS -O3 -fomit-frame-pointer $STRIP" |
CFLAGS="$CFLAGS $STRIP" |
NFLAGS="$NFLAGS -O1" | NFLAGS="$NFLAGS -O1" |
fi | fi |
fi | fi |