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 |
|
|
9 |
+ |
dnl Aliases for PACKAGE and VERSION macros. |
10 |
+ |
AC_DEFINE(PACKAGE, PACKAGE_NAME, [Alias to PACKAGE for i18n.]) |
11 |
+ |
AC_DEFINE(VERSION, PACKAGE_VERSION, [Alias to VERSION for i18n.]) |
12 |
+ |
|
13 |
|
dnl Video options. |
14 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
15 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
74 |
|
HAVE_M68K=no |
75 |
|
HAVE_SPARC=no |
76 |
|
HAVE_POWERPC=no |
77 |
+ |
HAVE_X86_64=no |
78 |
|
case "$target_cpu" in |
79 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
80 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
81 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
82 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
83 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
79 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
80 |
> |
m68k* ) HAVE_M68K=yes;; |
81 |
> |
sparc* ) HAVE_SPARC=yes;; |
82 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
83 |
> |
x86_64* ) HAVE_X86_64=yes;; |
84 |
|
esac |
79 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
85 |
|
|
86 |
|
dnl Checks for programs. |
87 |
|
AC_PROG_CC |
108 |
|
AC_CHECK_LIB(Hcurses, tgetent, , |
109 |
|
AC_CHECK_LIB(curses, tgetent)))))) |
110 |
|
AC_CHECK_LIB(readline, readline) |
106 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
111 |
|
else |
112 |
|
AC_MSG_RESULT(no) |
113 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
190 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
191 |
|
LIBS="$LIBS $GTK_LIBS" |
192 |
|
UISRCS=prefs_editor_gtk.cpp |
193 |
+ |
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
194 |
+ |
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
195 |
+ |
dnl includes <libintl.h> |
196 |
+ |
AM_GNU_GETTEXT |
197 |
|
B2_PATH_GNOMEUI([ |
198 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
199 |
|
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
224 |
|
dnl Checks for header files. |
225 |
|
AC_HEADER_STDC |
226 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
227 |
+ |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
228 |
|
|
229 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
230 |
|
AC_C_BIGENDIAN |
369 |
|
LIBS="$LIBS -laudio" |
370 |
|
WANT_ESD=no |
371 |
|
|
372 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
373 |
< |
HAVE_OFAST=no |
372 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
373 |
> |
HAVE_IPA=no |
374 |
|
ocflags="$CFLAGS" |
375 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
376 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
375 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
376 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
377 |
|
dnl Do a test compile of an empty function |
378 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
378 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
379 |
|
CFLAGS="$ocflags" |
380 |
|
|
381 |
|
;; |
562 |
|
AC_TRY_RUN([ |
563 |
|
#include "vm_alloc.cpp" |
564 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
565 |
< |
volatile char * lm; |
565 |
> |
volatile char * lm = 0; |
566 |
|
if (vm_init() < 0) exit(1); |
567 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
567 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
568 |
|
lm[0] = 'z'; |
569 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
570 |
|
vm_exit(); exit(0); |
778 |
|
dnl Check for GCC 2.7 or higher. |
779 |
|
HAVE_GCC27=no |
780 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
781 |
< |
AC_EGREP_CPP(yes, |
781 |
> |
AC_EGREP_CPP(xyes, |
782 |
|
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
783 |
< |
yes |
783 |
> |
xyes |
784 |
|
#endif |
785 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
786 |
|
|
787 |
|
dnl Check for GCC 3.0 or higher. |
788 |
|
HAVE_GCC30=no |
789 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
790 |
< |
AC_EGREP_CPP(yes, |
790 |
> |
AC_EGREP_CPP(xyes, |
791 |
|
[#if __GNUC__ >= 3 |
792 |
< |
yes |
792 |
> |
xyes |
793 |
|
#endif |
794 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
795 |
|
|
829 |
|
CAN_JIT=no |
830 |
|
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
831 |
|
|
832 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
832 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
833 |
|
dnl i386 CPU |
834 |
|
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
835 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
836 |
|
ASM_OPTIMIZATIONS=i386 |
837 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
838 |
|
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" |
839 |
+ |
CAN_JIT=yes |
840 |
+ |
fi |
841 |
+ |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
842 |
+ |
dnl x86-64 CPU |
843 |
+ |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
844 |
+ |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
845 |
+ |
ASM_OPTIMIZATIONS="x86-64" |
846 |
+ |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
847 |
|
fi |
831 |
– |
CAN_JIT=yes |
848 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
849 |
|
dnl SPARC CPU |
850 |
|
case "$target_os" in |
1101 |
|
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1102 |
|
fi |
1103 |
|
|
1104 |
< |
dnl Or if we have -Ofast |
1105 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1106 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1107 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1104 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1105 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1106 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1107 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1108 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1109 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1109 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1110 |
|
fi |
1111 |
|
|
1112 |
|
dnl Generate Makefile. |
1114 |
|
AC_SUBST(SYSSRCS) |
1115 |
|
AC_SUBST(CPUINCLUDES) |
1116 |
|
AC_SUBST(CPUSRCS) |
1117 |
< |
AC_OUTPUT(Makefile) |
1117 |
> |
AC_CONFIG_FILES([Makefile]) |
1118 |
> |
AC_OUTPUT |
1119 |
|
|
1120 |
|
dnl Print summary. |
1121 |
|
echo |