1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer et al. |
3 |
|
|
4 |
< |
AC_INIT(main_unix.cpp) |
4 |
> |
AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII) |
5 |
> |
AC_CONFIG_SRCDIR(main_unix.cpp) |
6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
8 |
|
|
70 |
|
HAVE_M68K=no |
71 |
|
HAVE_SPARC=no |
72 |
|
HAVE_POWERPC=no |
73 |
+ |
HAVE_X86_64=no |
74 |
|
case "$target_cpu" in |
75 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
76 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
77 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
78 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
79 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
75 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
76 |
> |
m68k* ) HAVE_M68K=yes;; |
77 |
> |
sparc* ) HAVE_SPARC=yes;; |
78 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
79 |
> |
x86_64* ) HAVE_X86_64=yes;; |
80 |
|
esac |
79 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
81 |
|
|
82 |
|
dnl Checks for programs. |
83 |
|
AC_PROG_CC |
187 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
188 |
|
LIBS="$LIBS $GTK_LIBS" |
189 |
|
UISRCS=prefs_editor_gtk.cpp |
190 |
+ |
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
191 |
+ |
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
192 |
+ |
dnl includes <libintl.h> |
193 |
+ |
AM_GNU_GETTEXT |
194 |
|
B2_PATH_GNOMEUI([ |
195 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
196 |
|
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
365 |
|
LIBS="$LIBS -laudio" |
366 |
|
WANT_ESD=no |
367 |
|
|
368 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
369 |
< |
HAVE_OFAST=no |
368 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
369 |
> |
HAVE_IPA=no |
370 |
|
ocflags="$CFLAGS" |
371 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
372 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
371 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
372 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
373 |
|
dnl Do a test compile of an empty function |
374 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
374 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
375 |
|
CFLAGS="$ocflags" |
376 |
|
|
377 |
|
;; |
558 |
|
AC_TRY_RUN([ |
559 |
|
#include "vm_alloc.cpp" |
560 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
561 |
< |
volatile char * lm; |
561 |
> |
volatile char * lm = 0; |
562 |
|
if (vm_init() < 0) exit(1); |
563 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
563 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
564 |
|
lm[0] = 'z'; |
565 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
566 |
|
vm_exit(); exit(0); |
774 |
|
dnl Check for GCC 2.7 or higher. |
775 |
|
HAVE_GCC27=no |
776 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
777 |
< |
AC_EGREP_CPP(yes, |
777 |
> |
AC_EGREP_CPP(xyes, |
778 |
|
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
779 |
< |
yes |
779 |
> |
xyes |
780 |
|
#endif |
781 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
782 |
|
|
783 |
|
dnl Check for GCC 3.0 or higher. |
784 |
|
HAVE_GCC30=no |
785 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
786 |
< |
AC_EGREP_CPP(yes, |
786 |
> |
AC_EGREP_CPP(xyes, |
787 |
|
[#if __GNUC__ >= 3 |
788 |
< |
yes |
788 |
> |
xyes |
789 |
|
#endif |
790 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
791 |
|
|
825 |
|
CAN_JIT=no |
826 |
|
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
827 |
|
|
828 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
828 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
829 |
|
dnl i386 CPU |
830 |
|
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
831 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
832 |
|
ASM_OPTIMIZATIONS=i386 |
833 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
834 |
|
JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS" |
835 |
+ |
CAN_JIT=yes |
836 |
+ |
fi |
837 |
+ |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
838 |
+ |
dnl x86-64 CPU |
839 |
+ |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
840 |
+ |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
841 |
+ |
ASM_OPTIMIZATIONS="x86-64" |
842 |
+ |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
843 |
|
fi |
831 |
– |
CAN_JIT=yes |
844 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
845 |
|
dnl SPARC CPU |
846 |
|
case "$target_os" in |
1097 |
|
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1098 |
|
fi |
1099 |
|
|
1100 |
< |
dnl Or if we have -Ofast |
1101 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1102 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1103 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1100 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1101 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1102 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1103 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1104 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1105 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1105 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1106 |
|
fi |
1107 |
|
|
1108 |
|
dnl Generate Makefile. |
1110 |
|
AC_SUBST(SYSSRCS) |
1111 |
|
AC_SUBST(CPUINCLUDES) |
1112 |
|
AC_SUBST(CPUSRCS) |
1113 |
< |
AC_OUTPUT(Makefile) |
1113 |
> |
AC_CONFIG_FILES([Makefile]) |
1114 |
> |
AC_OUTPUT |
1115 |
|
|
1116 |
|
dnl Print summary. |
1117 |
|
echo |