dnl Process this file with autoconf to produce a configure script. AC_INIT(amiga/source/transdisk.c) AC_PREREQ(2.10) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_MAKE_SET AC_AIX AC_ISC_POSIX dnl Checks for libraries. HAVE_BEBOX=n dnl Replace `main' with a function in -lMedia_s: (Ian!) AC_CHECK_LIB(Media_s, main, HAVE_MEDIA_LIB=y, HAVE_MEDIA_LIB=n) dnl Replace `main' with a function in -lNeXT_s: AC_CHECK_LIB(NeXT_s, main, HAVE_NEXT_LIB=y, HAVE_NEXT_LIB=n) AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=y, HAVE_SVGA_LIB=n) AC_CHECK_LIB(AF, AFOpenAudioConn, HAVE_AF_LIB=y, HAVE_AF_LIB=n) AC_PATH_XTRA AC_CONFIG_HEADER(src/include/sysconfig.h) AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h) AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/select.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h linux/joystick.h) if [[ $ac_cv_header_linux_joystick_h = "yes" ]]; then AC_MSG_CHECKING(whether linux/joystick.h is broken) if grep "#include" /usr/include/linux/joystick.h >/dev/null; then AC_MSG_RESULT(yes) BROKEN_JOYSTICK_H=1 grep -v "#include" /usr/include/linux/joystick.h >include/joystick.h else AC_MSG_RESULT(no) BROKEN_JOYSTICK_H=0 fi fi AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_STRUCT_ST_BLOCKS AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_UTIME_NULL AC_CHECK_FUNCS(gettimeofday mkdir rmdir select strerror strstr statfs) AC_MSG_CHECKING(how many args statfs takes) if [[ $ac_cv_func_statfs = "yes" ]]; then AC_TRY_COMPILE([ #include "confdefs.h" #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_VFS_H #include #endif #ifdef HAVE_SYS_STATFS_H #include #endif #ifdef HAVE_SYS_STATVFS_H #include #endif],[struct statfs statbuf;statfs("/",&statbuf);], AC_MSG_RESULT(2) STATFS_NO_ARGS=2, AC_MSG_RESULT(4) STATFS_NO_ARGS=4) fi AC_MSG_CHECKING(whether to use f_bavail or f_bfree) if [[ $ac_cv_func_statfs = "yes" ]]; then AC_TRY_COMPILE([ #include "confdefs.h" #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_VFS_H #include #endif #ifdef HAVE_SYS_STATFS_H #include #endif #ifdef HAVE_SYS_STATVFS_H #include #endif],[struct statfs statbuf;statbuf.f_bavail;], AC_MSG_RESULT(f_bavail) STATBUF_BAVAIL=f_bavail, AC_MSG_RESULT(f_bfree) STATBUF_BAVAIL=f_bfree) fi USE_GUI=yes AC_ARG_ENABLE(gui, --disable-gui Don't use the Tcl/Tk GUI,[USE_GUI=$enableval],[]) if [[ $USE_GUI = "yes" ]]; then AC_CHECK_PROG(USE_GUI,wish4.0,yes,no) else echo "Disabling the GUI." fi AC_MSG_CHECKING(which target to use) if [[ $HAVE_BEBOX = "y" ]]; then AC_MSG_RESULT(BeBox) TARGET=be GFXOBJS="bebox.o nogui.o" ac_cv_c_inline= else if [[ $HAVE_NEXT_LIB = "y" ]]; then AC_MSG_RESULT(NeXTStep) TARGET=next GFXOBJS="NeXTwin.o" LIBRARIES="-sectcreate __ICON __header Uae.app/Uae.iconheader -segprot __ICON r r -sectcreate __ICON app Uae.app/Uae.tiff -lMedia_s -lNeXT_s" else if [[ x$no_x = "xyes" ]]; then if [[ $HAVE_SVGA_LIB = "n" ]]; then AC_MSG_RESULT(Ummm....) echo "Neither X nor SVGAlib found, don't know what target to use." exit 1 else AC_MSG_RESULT(SVGAlib) TARGET=svgalib AC_CHECK_LIB(ncurses, waddch, , HAVE_GUI=no) if [[ $USE_GUI = "yes" ]]; then GFXOBJS="svga.o tui.o svgancui.o" LIBRARIES="-lvga -lncurses" else GFXOBJS="svga.o nogui.o" LIBRARIES="-lvga" fi fi else AC_MSG_RESULT(X Window System) TARGET=x11 USEDGA=no AC_ARG_ENABLE(DGA, --disable-DGA Don't use the DGA extension,[USEDGA=$enableval],[]) if [[ $USEDGA = "yes" ]]; then TMP_SAVE_LIBS=$LIBS LIBS=$X_LIBS $LIBS AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, USEDGA=yes, USEDGA=no, [-lXext -lX11]) LIBS=$TMP_SAVE_LIBS fi if [[ $USEDGA = "yes" ]]; then LIBRARIES="$X_LIBS $X_PRE_LIBS -lXxf86dga -lXext -lX11 $X_EXTRA_LIBS" X_CFLAGS="$X_CFLAGS -DUSE_DGA_EXTENSION" USE_GUI=no else LIBRARIES="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" USE_GUI=yes fi if [[ $USE_GUI = "yes" ]]; then GFXOBJS="xwin.o xui.o" else if [[ $USEDGA = "yes" ]]; then GFXOBJS="xdga.o nogui.o" else GFXOBJS="xwin.o nogui.o" fi fi fi fi fi ASMOBJS= CPUOBJS="cpu0.o cpu1.o cpu2.o cpu3.o cpu4.o cpu5.o cpu6.o cpu7.o cpu8.o cpu9.o cpuA.o cpuB.o cpuC.o cpuD.o cpuE.o cpuF.o" dnl It may be possible to use X86.S on other systems, too, but then again, it dnl might break. Check for a system that is known to work. dnl Gustavo says it works on linuxaout, too. We'll try this later. if [[ "$CC" = "gcc" ]]; then dnl strength-reduce is turned off not because of paranoia, but because it dnl actually makes the code worse in some cases on the i386 (generates too dnl many registers, which all end up on the stack). CFLAGS="-O3 -fomit-frame-pointer -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -fno-strength-reduce" AC_MSG_CHECKING(whether we are on a Linux/i386 ELF system) LINUXELF=n if MACHINE=`uname -a 2>/dev/null`; then cat >conftest.c << EOF int main() { return 0; } EOF case $MACHINE in Linux*i*86) gcc conftest.c -o conftest file conftest >conftest.file if grep ELF conftest.file >/dev/null; then LINUXELF=y fi ;; esac rm -f conftest* fi if [[ $LINUXELF = "n" ]]; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) ASMOBJS=X86.o CPUOBJS="cpu_fast0.o cpu_fast1.o cpu_fast2.o cpu_fast3.o cpu_fast4.o cpu_fast5.o cpu_fast6.o cpu_fast7.o cpu_fast8.o cpu_fast9.o cpu_fastA.o cpu_fastB.o cpu_fastC.o cpu_fastD.o cpu_fastE.o cpu_fastF.o" CFLAGS="$CFLAGS -DX86_ASSEMBLY" fi else echo "Couldn't find GCC. UAE may or may not compile and run correctly." fi if [[ $TARGET = "x11" -o $TARGET = "svgalib" ]]; then dnl On a Unix system, zfile is supposed to work. Dunno about others. CFLAGS="$CFLAGS -DUSE_ZFILE" fi AC_SUBST(ac_cv_c_inline) AC_SUBST(STATFS_NO_ARGS) AC_SUBST(BROKEN_JOYSTICK_H) AC_SUBST(STATBUF_BAVAIL) AC_SUBST(LIBRARIES) AC_SUBST(TARGET) AC_SUBST(GFXOBJS) AC_SUBST(ASMOBJS) AC_SUBST(CPUOBJS) AC_SUBST(SET_MAKE) AC_OUTPUT(src/Makefile Makefile)