18 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
19 |
|
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
20 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
21 |
+ |
AC_ARG_WITH(dgcc, [ --with-dgcc=COMPILER use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval]) |
22 |
|
|
23 |
|
dnl Checks for programs. |
24 |
|
AC_PROG_CC |
183 |
|
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h) |
184 |
|
AC_CHECK_HEADERS(sys/time.h sys/times.h) |
185 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h) |
186 |
+ |
AC_CHECK_HEADER(mmintrin.h, [have_mmintrin_h=yes]) |
187 |
+ |
AC_CHECK_HEADER(xmmintrin.h, [have_xmmintrin_h=yes]) |
188 |
+ |
AC_CHECK_HEADER(emmintrin.h, [have_emmintrin_h=yes]) |
189 |
|
|
190 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
191 |
|
AC_C_BIGENDIAN |
651 |
|
#endif |
652 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
653 |
|
|
654 |
+ |
dnl Check for ICC. |
655 |
+ |
AC_MSG_CHECKING(for ICC) |
656 |
+ |
HAVE_ICC=no |
657 |
+ |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
658 |
+ |
HAVE_ICC=yes |
659 |
+ |
fi |
660 |
+ |
AC_MSG_RESULT($HAVE_ICC) |
661 |
+ |
|
662 |
|
# Test if the compiler can generate ELF objects |
663 |
|
AC_CACHE_CHECK([whether the compiler can generate ELF objects], |
664 |
|
ac_cv_elf_objects, [ |
702 |
|
ac_cv_use_dyngen=no |
703 |
|
;; |
704 |
|
esac |
705 |
+ |
dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2) |
706 |
+ |
if [[ -z "$DYNGEN_CC" ]]; then |
707 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
708 |
+ |
DYNGEN_CC=$CXX |
709 |
+ |
else |
710 |
+ |
for p in /usr/bin /usr/local/bin; do |
711 |
+ |
gxx="$p/g++" |
712 |
+ |
if [[ -x "$gxx" ]]; then |
713 |
+ |
DYNGEN_CC="$gxx" |
714 |
+ |
fi |
715 |
+ |
done |
716 |
+ |
fi |
717 |
+ |
fi |
718 |
+ |
if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then |
719 |
+ |
ac_cv_use_dyngen=no |
720 |
+ |
fi |
721 |
|
]) |
722 |
|
if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then |
723 |
|
case $host_cpu in |
728 |
|
else |
729 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
730 |
|
fi |
731 |
+ |
if [[ "x$have_mmintrin_h" = "xyes" ]]; then |
732 |
+ |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx" |
733 |
+ |
fi |
734 |
+ |
if [[ "x$have_xmmintrin_h" = "xyes" ]]; then |
735 |
+ |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse" |
736 |
+ |
fi |
737 |
+ |
if [[ "x$have_emmintrin_h" = "xyes" ]]; then |
738 |
+ |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2" |
739 |
+ |
fi |
740 |
|
;; |
741 |
|
esac |
742 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000" |
791 |
|
|
792 |
|
dnl Generate Makefile. |
793 |
|
AC_SUBST(DYNGENSRCS) |
794 |
+ |
AC_SUBST(DYNGEN_CC) |
795 |
|
AC_SUBST(DYNGEN_OP_FLAGS) |
796 |
|
AC_SUBST(SYSSRCS) |
797 |
|
AC_SUBST(CPUSRCS) |