mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-26 10:49:21 +00:00
Delete obsolete build files under src/MacOSX, which are no longer
needed since the same build can be produced from src/Unix via ./configure --enable-macosx-gui.
This commit is contained in:
parent
145f6c3d02
commit
4f63169cc9
@ -1,55 +0,0 @@
|
|||||||
How to build this source
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
1) Install the OS X Development tools
|
|
||||||
|
|
||||||
Source now only builds on 10.2 and 10.3. On 10.1, there are a few
|
|
||||||
compile and link errors that I just can't be bothered to fix.
|
|
||||||
On 10.4 when doing Xcode builds, there are problems with the way that
|
|
||||||
I have built libslirp.a. For now, do "make" instead of "make ide".
|
|
||||||
|
|
||||||
|
|
||||||
2) Open a Terminal, and cd to BasiliskII-1.0/src/MacOSX
|
|
||||||
|
|
||||||
3) autoconf
|
|
||||||
autoheader
|
|
||||||
./configure
|
|
||||||
|
|
||||||
This creates some symlinks to files in the Unix source and
|
|
||||||
/usr/libexec directories, generates ./configure, and runs it.
|
|
||||||
|
|
||||||
The end result is a Makefile and some header files
|
|
||||||
|
|
||||||
4) make
|
|
||||||
|
|
||||||
This should generate the uae_cpu emulator core's source,
|
|
||||||
compile the SLIRP sources and then the application.
|
|
||||||
|
|
||||||
* It is also possible to use the OS X integrated development environment
|
|
||||||
(i.e. "Project Builder" or Xcode) to build the application, instead of make.
|
|
||||||
Instead of step 4) above, do these steps:
|
|
||||||
|
|
||||||
4) make ide
|
|
||||||
|
|
||||||
This should generate the uae_cpu emulator core's source,
|
|
||||||
and then open the project in the Project Builder or Xcode IDE.
|
|
||||||
|
|
||||||
5) From the Build menu, choose 'Build' or 'Build & Run'
|
|
||||||
|
|
||||||
This should build everything
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
1) Compiling cpuemu.cpp takes 58 seconds on my 384MB G4 400.
|
|
||||||
Compiling it as separate files (cpuemu1.cpp thru cpuemu8.cpp)
|
|
||||||
takes 68 seconds on the same machine. If you have less RAM,
|
|
||||||
it may be faster to compile it as separate files.
|
|
||||||
|
|
||||||
2) If you want to change the addressing default
|
|
||||||
(which is currently direct), you have to reconfigure.
|
|
||||||
(i.e. make clean; ./configure --enable-addressing=banks)
|
|
||||||
|
|
||||||
3) To emulate a Mac Classic, or any Mac with 24bit addressing,
|
|
||||||
the app needs to be built with the above (bank) style addressing.
|
|
@ -1,307 +0,0 @@
|
|||||||
# Unix makefile for Basilisk II
|
|
||||||
|
|
||||||
## System specific configuration
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
HOST_CC = @CC@
|
|
||||||
HOST_CXX = @CXX@
|
|
||||||
CC_PROG = @CC@
|
|
||||||
CXX_PROG = @CXX@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
|
||||||
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ -I../slirp
|
|
||||||
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DAQUA -DFPU_IEEE
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
|
|
||||||
CFLAGS += -g
|
|
||||||
CPPFLAGS += -I../uae_cpu
|
|
||||||
CXXFLAGS += -g
|
|
||||||
LN_S = ln -s
|
|
||||||
|
|
||||||
## Compilers selection (XXX hackery for 10.2 cross-compilation...)
|
|
||||||
SDK_VERSION.ppc = @PPC_SDK_VERSION@
|
|
||||||
SDK_VERSION = $(SDK_VERSION.$(ARCH))
|
|
||||||
ifeq ($(SDK_VERSION), 10.2.8)
|
|
||||||
CC_PROG = gcc-3.3
|
|
||||||
CXX_PROG = g++-3.3
|
|
||||||
SDK_ROOT = /Developer/SDKs/MacOSX10.2.8.sdk
|
|
||||||
CC_ROOT = -F$(SDK_ROOT)/System/Library/Frameworks
|
|
||||||
LDFLAGS += -Wl,-syslibroot,$(SDK_ROOT)
|
|
||||||
endif
|
|
||||||
ifeq ($(SDK_VERSION), 10.3.9)
|
|
||||||
CC_ROOT = -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3
|
|
||||||
endif
|
|
||||||
ifeq ($(SDK_VERSION), 10.4)
|
|
||||||
CC_ROOT = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
|
|
||||||
endif
|
|
||||||
CC = $(CC_PROG) $(CC_ROOT) -arch $(ARCH)
|
|
||||||
CXX = $(CXX_PROG) $(CC_ROOT) -arch $(ARCH)
|
|
||||||
|
|
||||||
SLIRP_CFLAGS = @SLIRP_CFLAGS@
|
|
||||||
SLIRP_SRCS = @SLIRP_SRCS@
|
|
||||||
SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=obj/%.o)
|
|
||||||
|
|
||||||
## CPU emulation code
|
|
||||||
WANT_JIT = @WANT_JIT@
|
|
||||||
WANT_JIT_DEBUG = @WANT_JIT_DEBUG@
|
|
||||||
USE_JIT = no
|
|
||||||
CPUSRCS = \
|
|
||||||
../uae_cpu/basilisk_glue.cpp ../uae_cpu/readcpu.cpp \
|
|
||||||
../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/fpu/fpu_ieee.cpp
|
|
||||||
GEN_CPUSRCS = \
|
|
||||||
cpustbl.cpp cpudefs.cpp \
|
|
||||||
cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp \
|
|
||||||
cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp
|
|
||||||
ifeq ($(ARCH), i386)
|
|
||||||
USE_JIT = $(WANT_JIT)
|
|
||||||
DEFS += -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))"
|
|
||||||
DEFS += -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), x86_64)
|
|
||||||
USE_JIT = $(WANT_JIT)
|
|
||||||
DEFS += -DUNALIGNED_PROFITABLE
|
|
||||||
DEFS += -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS
|
|
||||||
endif
|
|
||||||
ifeq ($(USE_JIT), yes)
|
|
||||||
DEFS += -DUSE_JIT -DUSE_JIT_FPU
|
|
||||||
ifeq ($(WANT_JIT_DEBUG), yes)
|
|
||||||
DEFS += -DJIT_DEBUG
|
|
||||||
endif
|
|
||||||
CPUSRCS += \
|
|
||||||
../uae_cpu/compiler/compemu_support.cpp \
|
|
||||||
../uae_cpu/compiler/compemu_fpp.cpp
|
|
||||||
GEN_CPUSRCS += \
|
|
||||||
cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp \
|
|
||||||
cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp \
|
|
||||||
compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp \
|
|
||||||
compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp \
|
|
||||||
cpustbl_nf.cpp compstbl.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
GEN_DIR = gen
|
|
||||||
ifneq ($(ARCH),)
|
|
||||||
GEN_DIR = gen.$(ARCH)
|
|
||||||
endif
|
|
||||||
CPUSRCS += $(foreach file, $(GEN_CPUSRCS), $(GEN_DIR)/$(file))
|
|
||||||
CPPFLAGS += -I$(GEN_DIR)
|
|
||||||
|
|
||||||
## Source files thst replace/augment the ones from the Unix directory
|
|
||||||
SYSSRCS = serial_unix.cpp ../dummy/scsi_dummy.cpp \
|
|
||||||
audio_macosx.cpp AudioBackEnd.cpp AudioDevice.cpp MacOSX_sound_if.cpp \
|
|
||||||
clip_macosx.cpp Controller.mm Emulator.mm EmulatorView.mm \
|
|
||||||
ether_unix.cpp extfs_macosx.cpp main_macosx.mm misc_macosx.mm \
|
|
||||||
NNThread.m prefs_macosx.cpp PrefsEditor.mm sys_darwin.cpp video_macosx.mm
|
|
||||||
|
|
||||||
## Files
|
|
||||||
SRCS = ../main.cpp ../prefs.cpp ../prefs_items.cpp \
|
|
||||||
sys_unix.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \
|
|
||||||
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_unix.cpp ../timer.cpp \
|
|
||||||
timer_unix.cpp ../adb.cpp ../serial.cpp ../ether.cpp \
|
|
||||||
../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp \
|
|
||||||
vm_alloc.cpp sigsegv.cpp ../audio.cpp ../extfs.cpp \
|
|
||||||
../user_strings.cpp user_strings_unix.cpp sshpty.c strlcpy.c \
|
|
||||||
$(SYSSRCS) $(CPUSRCS) $(SLIRP_SRCS)
|
|
||||||
|
|
||||||
## Source files from Unix source directory that we link to
|
|
||||||
UNIXSRCS = ether_unix.cpp semaphore.h serial_unix.cpp sigsegv.cpp sigsegv.h \
|
|
||||||
sshpty.c sshpty.h strlcpy.c strlcpy.h sys_unix.cpp timer_unix.cpp \
|
|
||||||
user_strings_unix.cpp user_strings_unix.h \
|
|
||||||
vm_alloc.cpp vm_alloc.h xpram_unix.cpp
|
|
||||||
|
|
||||||
## Documentation files
|
|
||||||
DOCS = README.txt Credits.html ToDo.html HowTo.html Versions.html
|
|
||||||
|
|
||||||
## Binaries to build
|
|
||||||
APP = BasiliskII
|
|
||||||
APP_APP = $(APP).app
|
|
||||||
TARGET_ARCHES = @TARGET_ARCHES@
|
|
||||||
PROGS = $(foreach arch, $(TARGET_ARCHES), $(APP).$(arch))
|
|
||||||
|
|
||||||
BLESS = $(OBJ_DIR)/lowmem
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
.PHONY: modules install installdirs uninstall mostlyclean clean distclean depend dep
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .cpp .s .o .h
|
|
||||||
|
|
||||||
all: $(APP)_app
|
|
||||||
|
|
||||||
README.txt: ../../README
|
|
||||||
$(LN_S) $< $@
|
|
||||||
$(UNIXSRCS): %: ../Unix/%
|
|
||||||
$(LN_S) $< $@
|
|
||||||
|
|
||||||
OBJ_DIR = obj
|
|
||||||
ifneq ($(ARCH),)
|
|
||||||
OBJ_DIR = obj.$(ARCH)
|
|
||||||
endif
|
|
||||||
$(OBJ_DIR)::
|
|
||||||
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
|
|
||||||
|
|
||||||
define SRCS_LIST_TO_OBJS
|
|
||||||
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \
|
|
||||||
$(basename $(notdir $(file))))))
|
|
||||||
endef
|
|
||||||
OBJS = $(SRCS_LIST_TO_OBJS)
|
|
||||||
|
|
||||||
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
|
|
||||||
VPATH :=
|
|
||||||
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
|
|
||||||
|
|
||||||
define PROGS_template
|
|
||||||
$(APP).$(1): links
|
|
||||||
+$(MAKE) $(OBJ_DIR).$(1)/$(APP) ARCH=$(1)
|
|
||||||
$(LN_S) -f $(OBJ_DIR).$(1)/$(APP) $(APP).$(1)
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(APP): $(PROGS)
|
|
||||||
lipo $(foreach arch, $(TARGET_ARCHES), -arch $(arch) $(APP).$(arch)) \
|
|
||||||
-create -output $@
|
|
||||||
|
|
||||||
$(foreach arch,$(TARGET_ARCHES),$(eval $(call PROGS_template,$(arch))))
|
|
||||||
|
|
||||||
links: $(UNIXSRCS)
|
|
||||||
|
|
||||||
$(BLESS): $(OBJ_DIR) $(OBJ_DIR)/lowmem.o
|
|
||||||
$(HOST_CC) -o $@ $(OBJ_DIR)/lowmem.o
|
|
||||||
$(OBJ_DIR)/lowmem.o: ../Unix/Darwin/lowmem.c
|
|
||||||
$(HOST_CC) -o $@ -c $<
|
|
||||||
|
|
||||||
$(OBJ_DIR)/$(APP): $(OBJ_DIR) $(GEN_DIR) $(OBJS) $(BLESS)
|
|
||||||
$(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
|
|
||||||
$(BLESS) $@
|
|
||||||
|
|
||||||
$(APP)_app: $(APP) $(DOCS) Info.plist $(APP).icns
|
|
||||||
rm -rf $(APP_APP)/Contents
|
|
||||||
mkdir -p $(APP_APP)/Contents
|
|
||||||
cp -f ../MacOSX/Info.plist $(APP_APP)/Contents/
|
|
||||||
echo -n 'APPL????' > $(APP_APP)/Contents/PkgInfo
|
|
||||||
mkdir -p $(APP_APP)/Contents/MacOS
|
|
||||||
cp -f $(APP) $(APP_APP)/Contents/MacOS/
|
|
||||||
strip -x $(APP_APP)/Contents/MacOS/$(APP)
|
|
||||||
mkdir -p $(APP_APP)/Contents/Resources
|
|
||||||
cp -Rp English.lproj $(APP_APP)/Contents/Resources/
|
|
||||||
cp -f $(APP).icns $(APP_APP)/Contents/Resources/
|
|
||||||
cp -f $(DOCS) $(APP_APP)/Contents/Resources/
|
|
||||||
find $(APP_APP) -type d -name CVS | xargs rm -rf
|
|
||||||
|
|
||||||
mostlyclean:
|
|
||||||
rm -f $(PROGS) $(OBJ_DIR)/* core* *.core *~ *.bak
|
|
||||||
rm -f $(foreach arch, $(TARGET_ARCHES), $(GEN_DIR).$(arch)/*)
|
|
||||||
rm -f $(foreach arch, $(TARGET_ARCHES), $(OBJ_DIR).$(arch)/*)
|
|
||||||
|
|
||||||
clean: mostlyclean
|
|
||||||
rm -f $(UNIXSRCS)
|
|
||||||
rm -f README.txt
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -rf $(foreach arch, $(TARGET_ARCHES), $(GEN_DIR).$(arch))
|
|
||||||
rm -rf $(foreach arch, $(TARGET_ARCHES), $(OBJ_DIR).$(arch))
|
|
||||||
rm -rf autom4te.cache
|
|
||||||
rm -f Makefile
|
|
||||||
rm -f config.cache config.log config.status config.h configure
|
|
||||||
|
|
||||||
depend dep:
|
|
||||||
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null
|
|
||||||
|
|
||||||
$(OBJ_DIR)/%.o : ../slirp/%.c
|
|
||||||
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(SLIRP_CFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.o : %.c
|
|
||||||
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.o : %.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.o : %.m
|
|
||||||
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.o : %.mm
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.o : %.s
|
|
||||||
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.ho : %.c
|
|
||||||
$(HOST_CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/%.ho : %.cpp
|
|
||||||
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJ_DIR)/build68k: $(OBJ_DIR)/build68k.ho
|
|
||||||
$(HOST_CC) -o $@ $(OBJ_DIR)/build68k.ho
|
|
||||||
$(OBJ_DIR)/gencpu: $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
|
|
||||||
$(HOST_CXX) -o $@ $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
|
|
||||||
$(OBJ_DIR)/gencomp: $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
|
|
||||||
$(HOST_CXX) -o $@ $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
|
|
||||||
|
|
||||||
$(GEN_DIR)::
|
|
||||||
@[ -d $(GEN_DIR) ] || mkdir $(GEN_DIR) > /dev/null 2>&1
|
|
||||||
|
|
||||||
$(GEN_DIR)/cpudefs.cpp: $(OBJ_DIR)/build68k ../uae_cpu/table68k
|
|
||||||
$(OBJ_DIR)/build68k <../uae_cpu/table68k > $@
|
|
||||||
$(GEN_DIR)/cpustbl.cpp: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(GEN_DIR)/cpustbl_nf.cpp: $(GEN_DIR)/cpustbl.cpp
|
|
||||||
$(GEN_DIR)/compstbl.cpp: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(GEN_DIR)/cputbl.h: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(GEN_DIR)/comptbl.h: $(GEN_DIR)/compemu.cpp
|
|
||||||
|
|
||||||
$(GEN_DIR)/cpuemu.cpp: $(OBJ_DIR)/gencpu
|
|
||||||
cd $(GEN_DIR) && ../$(OBJ_DIR)/gencpu
|
|
||||||
|
|
||||||
$(GEN_DIR)/compemu.cpp: $(OBJ_DIR)/gencomp
|
|
||||||
cd $(GEN_DIR) && ../$(OBJ_DIR)/gencomp
|
|
||||||
|
|
||||||
$(OBJ_DIR)/cpustbl_nf.o: $(GEN_DIR)/cpustbl.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DNOFLAGS -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJ_DIR)/compemu_support.o: compemu_support.cpp $(GEN_DIR)/comptbl.h
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJ_DIR)/cpuemu1.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu2.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu3.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu4.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu5.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu6.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu7.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu8.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJ_DIR)/cpuemu1_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu2_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu3_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu4_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu5_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu6_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu7_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/cpuemu8_nf.o: $(GEN_DIR)/cpuemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJ_DIR)/compemu1.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu2.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu3.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu4.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu5.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu6.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu7.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@
|
|
||||||
$(OBJ_DIR)/compemu8.o: $(GEN_DIR)/compemu.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* config_macosx.h - MacOS X macros determined at compile-time
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Basilisk II (C) 1997-2008 Christian Bauer
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Supported platforms are: ppc, ppc64, x86, x86_64 */
|
|
||||||
#if ! defined __ppc__ && ! defined __ppc64__ && ! defined __i386__ && ! defined __x86_64__
|
|
||||||
# error "Unsupported architecture. Please fix arch-specific macros"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Size of data types */
|
|
||||||
#define SIZEOF_FLOAT 4
|
|
||||||
#define SIZEOF_DOUBLE 8
|
|
||||||
#if defined __ppc__ || defined __ppc64__
|
|
||||||
# if defined __LONG_DOUBLE_128__
|
|
||||||
# define SIZEOF_LONG_DOUBLE 16
|
|
||||||
# else
|
|
||||||
# define SIZEOF_LONG_DOUBLE 8
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define SIZEOF_LONG_DOUBLE 16
|
|
||||||
#endif
|
|
||||||
#define SIZEOF_SHORT 2
|
|
||||||
#define SIZEOF_INT 4
|
|
||||||
#if defined __ppc64__ || defined __x86_64__
|
|
||||||
# define SIZEOF_LONG 8
|
|
||||||
#else
|
|
||||||
# define SIZEOF_LONG 4
|
|
||||||
#endif
|
|
||||||
#define SIZEOF_LONG_LONG 8
|
|
||||||
#define SIZEOF_VOID_P SIZEOF_LONG /* ILP32 or LP64 */
|
|
||||||
|
|
||||||
/* Endian-ness of data types */
|
|
||||||
#if ! defined __LITTLE_ENDIAN__
|
|
||||||
# define WORDS_BIGENDIAN 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to the floating point format of the host machine. */
|
|
||||||
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
|
|
||||||
|
|
||||||
/* Define to 1 if the host machine stores floating point numbers in memory
|
|
||||||
with the word containing the sign bit at the lowest address, or to 0 if it
|
|
||||||
does it the other way around. This macro should not be defined if the
|
|
||||||
ordering is the same as for multi-word integers. */
|
|
||||||
/* #undef HOST_FLOAT_WORDS_BIG_ENDIAN */
|
|
||||||
|
|
||||||
/* Define if your system supports Mach exceptions. */
|
|
||||||
#define HAVE_MACH_EXCEPTIONS 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <mach/mach.h> header file. */
|
|
||||||
#define HAVE_MACH_MACH_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `mach_task_self' function. */
|
|
||||||
#define HAVE_MACH_TASK_SELF 1
|
|
||||||
|
|
||||||
/* Define if your system has a working vm_allocate()-based memory allocator. */
|
|
||||||
#define HAVE_MACH_VM 1
|
|
||||||
|
|
||||||
/* Define if the __PAGEZERO Mach-O Low Memory Globals hack works. */
|
|
||||||
#define PAGEZERO_HACK 1
|
|
@ -1,794 +0,0 @@
|
|||||||
dnl Mac OS X configuration driver
|
|
||||||
dnl $Id$
|
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
|
||||||
dnl Based on Unix/configure.in
|
|
||||||
dnl Written in 1999 by Christian Bauer et al.
|
|
||||||
dnl Occasionally re-synchronised (merged?) with latest version
|
|
||||||
dnl Written in 2002 by Christian Bauer et al.
|
|
||||||
|
|
||||||
dnl autoconf on 10.1 doesn't understand these
|
|
||||||
dnl AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
|
|
||||||
dnl AC_CONFIG_SRCDIR(main_macosx.mm)
|
|
||||||
AC_INIT(main_macosx.mm)
|
|
||||||
AC_CONFIG_AUX_DIR(../Unix)
|
|
||||||
AC_PREREQ(2.12)
|
|
||||||
AC_CONFIG_HEADER(config.h)
|
|
||||||
AH_TOP([
|
|
||||||
/* Include MacOS X macros determined at compile-time */
|
|
||||||
#include "config_macosx.h"
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Aliases for PACKAGE and VERSION macros.
|
|
||||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
|
|
||||||
AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
|
|
||||||
|
|
||||||
dnl Some systems do not put corefiles in the currect directory, avoid saving
|
|
||||||
dnl cores for the configure tests since some are intended to dump core.
|
|
||||||
ulimit -c 0
|
|
||||||
|
|
||||||
dnl Universal binaries.
|
|
||||||
AC_ARG_ENABLE(universal,
|
|
||||||
[ --enable-universal enable universal binaries for selected arches [default=no]],
|
|
||||||
[ WANT_UNIVERSAL=""
|
|
||||||
for arch in $enableval; do
|
|
||||||
case $arch in
|
|
||||||
yes) WANT_UNIVERSAL="i386 ppc";;
|
|
||||||
ppc|ppc64|i386|x86_64) WANT_UNIVERSAL="$WANT_UNIVERSAL $arch";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
])
|
|
||||||
AC_ARG_WITH(ppc-sdk, [ --with-ppc-sdk=VERSION use specific SDK VERSION for ppc builds [default=earliest]], [PPC_SDK_VERSION=$withval])
|
|
||||||
|
|
||||||
dnl Video options.
|
|
||||||
AC_ARG_ENABLE(multiwin,
|
|
||||||
[ --enable-multiwin allow multiple emulator windows [default=no]], [ENABLE_MULTIPLE=$enableval], [ENABLE_MULTIPLE=no])
|
|
||||||
|
|
||||||
dnl JIT compiler options.
|
|
||||||
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
|
|
||||||
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
|
|
||||||
|
|
||||||
dnl Addressing modes.
|
|
||||||
AC_ARG_ENABLE(addressing,
|
|
||||||
[ --enable-addressing=AM specify the addressing mode to use [default=fastest]],
|
|
||||||
[ case "$enableval" in
|
|
||||||
real) ADDRESSING_TEST_ORDER="real";;
|
|
||||||
direct) ADDRESSING_TEST_ORDER="direct";;
|
|
||||||
banks) ADDRESSING_TEST_ORDER="banks";;
|
|
||||||
fastest)ADDRESSING_TEST_ORDER="direct banks";;
|
|
||||||
*) AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);;
|
|
||||||
esac
|
|
||||||
],
|
|
||||||
[ ADDRESSING_TEST_ORDER="direct banks"
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl External packages.
|
|
||||||
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=no])
|
|
||||||
|
|
||||||
dnl Canonical system information.
|
|
||||||
AC_CANONICAL_HOST
|
|
||||||
AC_CANONICAL_TARGET
|
|
||||||
|
|
||||||
dnl Target OS type (target is host if not cross-compiling).
|
|
||||||
case "$target_os" in
|
|
||||||
linux*) OS_TYPE=linux;;
|
|
||||||
netbsd*) OS_TYPE=netbsd;;
|
|
||||||
freebsd*) OS_TYPE=freebsd;;
|
|
||||||
solaris*) OS_TYPE=solaris;;
|
|
||||||
darwin*) OS_TYPE=darwin;;
|
|
||||||
*) OS_TYPE=`echo $target_os | sed -e 's/-/_/g' | sed -e 's/\./_/g'`;;
|
|
||||||
esac
|
|
||||||
DEFINES="$DEFINES -DOS_$OS_TYPE"
|
|
||||||
|
|
||||||
dnl Target CPU type.
|
|
||||||
HAVE_I386=no
|
|
||||||
HAVE_M68K=no
|
|
||||||
HAVE_SPARC=no
|
|
||||||
HAVE_POWERPC=no
|
|
||||||
HAVE_X86_64=no
|
|
||||||
case "$target_cpu" in
|
|
||||||
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
|
|
||||||
m68k* ) HAVE_M68K=yes;;
|
|
||||||
sparc* ) HAVE_SPARC=yes;;
|
|
||||||
powerpc* ) HAVE_POWERPC=yes;;
|
|
||||||
x86_64* ) HAVE_X86_64=yes;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
dnl Checks for programs.
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_CC_C_O
|
|
||||||
AC_PROG_CPP
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_PROG_MAKE_SET
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
AC_PROG_EGREP
|
|
||||||
|
|
||||||
dnl We use mon if possible.
|
|
||||||
MONSRCS=
|
|
||||||
if [[ "x$WANT_MON" = "xyes" ]]; then
|
|
||||||
AC_MSG_CHECKING(for mon)
|
|
||||||
mon_srcdir=../../../mon/src
|
|
||||||
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
|
|
||||||
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c"
|
|
||||||
AC_SUBST(MONSRCS)
|
|
||||||
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
|
|
||||||
AC_CHECK_LIB(ncurses, tgetent, ,
|
|
||||||
[AC_CHECK_LIB(termcap, tgetent, ,
|
|
||||||
[AC_CHECK_LIB(termlib, tgetent, ,
|
|
||||||
[AC_CHECK_LIB(terminfo, tgetent, ,
|
|
||||||
[AC_CHECK_LIB(Hcurses, tgetent, ,
|
|
||||||
[AC_CHECK_LIB(curses, tgetent)])])])])])
|
|
||||||
AC_CHECK_LIB(readline, readline)
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
|
|
||||||
WANT_MON=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
|
|
||||||
HAVE_PTHREADS=yes
|
|
||||||
AC_CHECK_LIB(pthread, pthread_create, , [
|
|
||||||
AC_CHECK_LIB(c_r, pthread_create, , [
|
|
||||||
AC_CHECK_LIB(PTL, pthread_create, , [
|
|
||||||
HAVE_PTHREADS=no
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
dnl OS X does have pthreads, but not in any of the above locations:
|
|
||||||
HAVE_PTHREADS=yes
|
|
||||||
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
|
|
||||||
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
|
|
||||||
fi
|
|
||||||
AC_CHECK_FUNCS(pthread_cond_init)
|
|
||||||
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
|
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
|
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_settype)
|
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
|
|
||||||
|
|
||||||
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
|
|
||||||
SEMSRC=
|
|
||||||
AC_CHECK_FUNCS(sem_init, , [
|
|
||||||
if test "x$HAVE_PTHREADS" = "xyes"; then
|
|
||||||
SEMSRC=posix_sem.cpp
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl We want to enable multiple window support if possible
|
|
||||||
if [[ "x$WANT_MWIN" = "xyes" ]]; then
|
|
||||||
WANT_MWIN=yes
|
|
||||||
DEFINES="$DEFINES -DENABLE_MULTIPLE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl We use 64-bit file size support if possible.
|
|
||||||
AC_SYS_LARGEFILE
|
|
||||||
|
|
||||||
dnl Checks for header files.
|
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_CHECK_HEADERS(stdlib.h stdint.h)
|
|
||||||
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
|
|
||||||
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
|
|
||||||
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
|
|
||||||
AC_CHECK_HEADERS(sys/poll.h sys/select.h)
|
|
||||||
AC_CHECK_HEADERS(arpa/inet.h)
|
|
||||||
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#endif
|
|
||||||
])
|
|
||||||
AC_CHECK_HEADERS(AvailabilityMacros.h)
|
|
||||||
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
|
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
||||||
AC_C_CONST
|
|
||||||
AC_C_INLINE
|
|
||||||
AC_TYPE_OFF_T
|
|
||||||
dnl These two symbols are not defined in 10.1's autoconf:
|
|
||||||
dnl AC_CHECK_TYPE(loff_t, off_t)
|
|
||||||
dnl AC_CHECK_TYPE(caddr_t, [char *])
|
|
||||||
dnl We define loff_t as a typedef of off_t in sysdeps.h if we don't have LOFF_T
|
|
||||||
dnl OS X does have caddr_t, but the above check doesn't work, so we have to do:
|
|
||||||
AC_DEFINE(HAVE_CADDR_T, 1, [The type "caddr_t" does exist on MacOS X.])
|
|
||||||
AC_TYPE_SIZE_T
|
|
||||||
AC_TYPE_SIGNAL
|
|
||||||
AC_HEADER_TIME
|
|
||||||
AC_STRUCT_TM
|
|
||||||
|
|
||||||
dnl Check whether sys/socket.h defines type socklen_t.
|
|
||||||
dnl (extracted from ac-archive/Miscellaneous)
|
|
||||||
AC_CACHE_CHECK([for socklen_t],
|
|
||||||
ac_cv_type_socklen_t, [
|
|
||||||
AC_TRY_COMPILE([
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
], [socklen_t len = 42; return 0;],
|
|
||||||
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
|
|
||||||
dnl When cross-compiling, do not assume anything.
|
|
||||||
ac_cv_type_socklen_t="guessing no"
|
|
||||||
)
|
|
||||||
])
|
|
||||||
if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
|
|
||||||
AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Checks for library functions.
|
|
||||||
AC_CHECK_FUNCS(strdup strerror cfmakeraw)
|
|
||||||
AC_CHECK_FUNCS(clock_gettime timer_create)
|
|
||||||
AC_CHECK_FUNCS(sigaction signal)
|
|
||||||
AC_CHECK_FUNCS(poll inet_aton)
|
|
||||||
|
|
||||||
dnl Darwin seems to define mach_task_self() instead of task_self().
|
|
||||||
AC_CHECK_FUNCS(mach_task_self task_self)
|
|
||||||
|
|
||||||
dnl Check for headers and functions related to pty support (sshpty.c)
|
|
||||||
dnl From openssh-3.2.2p1 configure.ac
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
|
|
||||||
AC_CHECK_FUNCS(_getpty vhangup strlcpy)
|
|
||||||
if test -z "$no_dev_ptmx" ; then
|
|
||||||
if test "x$disable_ptmx_check" != "xyes" ; then
|
|
||||||
AC_CHECK_FILE([/dev/ptmx],
|
|
||||||
[
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
|
|
||||||
have_dev_ptmx=1
|
|
||||||
]
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AC_CHECK_FILE([/dev/ptc],
|
|
||||||
[
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
|
|
||||||
have_dev_ptc=1
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
dnl (end of code from openssh-3.2.2p1 configure.ac)
|
|
||||||
|
|
||||||
|
|
||||||
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
|
|
||||||
dnl doesn't work or is unimplemented. On these systems (mostly older
|
|
||||||
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
|
|
||||||
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
|
|
||||||
ac_cv_nonblocking_io, [
|
|
||||||
case "$host" in
|
|
||||||
*-*-osf*)
|
|
||||||
ac_cv_nonblocking_io=FIONBIO
|
|
||||||
;;
|
|
||||||
*-*-sunos4*)
|
|
||||||
ac_cv_nonblocking_io=FIONBIO
|
|
||||||
;;
|
|
||||||
*-*-ultrix*)
|
|
||||||
ac_cv_nonblocking_io=FIONBIO
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
ac_cv_nonblocking_io=O_NONBLOCK
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
])
|
|
||||||
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
|
|
||||||
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Check whether compiler supports byte bit-fields
|
|
||||||
AC_CACHE_CHECK([whether compiler supports byte bit-fields],
|
|
||||||
ac_cv_have_byte_bitfields, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_RUN([
|
|
||||||
struct A {
|
|
||||||
unsigned char b1:4;
|
|
||||||
unsigned char b2:4;
|
|
||||||
unsigned char c;
|
|
||||||
unsigned short s;
|
|
||||||
unsigned char a[4];
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
A a;
|
|
||||||
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
|
|
||||||
}],
|
|
||||||
[ac_cv_have_byte_bitfields=yes],
|
|
||||||
[ac_cv_have_byte_bitfields=no],
|
|
||||||
dnl When cross-compiling, assume only GCC supports this
|
|
||||||
[if [[ "$GCC" = "yes" ]]; then
|
|
||||||
ac_cv_have_byte_bitfields="guessing yes"
|
|
||||||
else
|
|
||||||
ac_cv_have_byte_bitfields="guessing no"
|
|
||||||
fi]
|
|
||||||
)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
|
|
||||||
AC_DEFUN([AC_CHECK_FRAMEWORK], [
|
|
||||||
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
|
|
||||||
AC_CACHE_CHECK([whether compiler supports framework $1],
|
|
||||||
ac_Framework, [
|
|
||||||
saved_LIBS="$LIBS"
|
|
||||||
LIBS="$LIBS -framework $1"
|
|
||||||
AC_TRY_LINK(
|
|
||||||
[$2], [],
|
|
||||||
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
|
|
||||||
)
|
|
||||||
])
|
|
||||||
AS_IF([test AS_VAR_GET(ac_Framework) = yes],
|
|
||||||
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
|
|
||||||
)
|
|
||||||
AS_VAR_POPDEF([ac_Framework])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Check for some MacOS X frameworks
|
|
||||||
AC_CHECK_FRAMEWORK(AppKit, [])
|
|
||||||
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
|
|
||||||
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
|
|
||||||
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
|
|
||||||
AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
|
|
||||||
AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
|
|
||||||
AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
|
|
||||||
|
|
||||||
dnl Select system-dependant source files.
|
|
||||||
ETHERSRC=ether_unix.cpp
|
|
||||||
DEFINES="$DEFINES -DBSD_COMP"
|
|
||||||
CXXFLAGS="$CXXFLAGS -fpermissive"
|
|
||||||
dnl Check for the CAM library
|
|
||||||
AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
|
|
||||||
if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
|
|
||||||
AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
|
|
||||||
else
|
|
||||||
dnl Check for the sys kernel includes
|
|
||||||
AC_CHECK_HEADER(camlib.h)
|
|
||||||
if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then
|
|
||||||
dnl In this case I should fix this thing including a "patch"
|
|
||||||
dnl to access directly to the functions in the kernel :) --Orlando
|
|
||||||
AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.])
|
|
||||||
else
|
|
||||||
SCSISRC=FreeBSD/scsi_freebsd.cpp
|
|
||||||
LIBS="$LIBS -lcam"
|
|
||||||
DEFINES="$DEFINES -DCAM"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Is the slirp library supported?
|
|
||||||
WANT_SLIRP=no
|
|
||||||
case "$ac_cv_have_byte_bitfields" in
|
|
||||||
yes|"guessing yes")
|
|
||||||
WANT_SLIRP=yes
|
|
||||||
ETHERSRC=ether_unix.cpp
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [[ "x$WANT_SLIRP" = "xyes" ]]; then
|
|
||||||
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
|
|
||||||
SLIRP_SRCS="\
|
|
||||||
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \
|
|
||||||
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \
|
|
||||||
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \
|
|
||||||
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \
|
|
||||||
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \
|
|
||||||
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c"
|
|
||||||
fi
|
|
||||||
AC_SUBST(WANT_SLIRP)
|
|
||||||
AC_SUBST(SLIRP_SRCS)
|
|
||||||
|
|
||||||
|
|
||||||
dnl Define a macro that translates a yesno-variable into a C macro definition
|
|
||||||
dnl to be put into the config.h file
|
|
||||||
dnl $1 -- the macro to define
|
|
||||||
dnl $2 -- the value to translate
|
|
||||||
dnl $3 -- template name
|
|
||||||
AC_DEFUN([AC_TRANSLATE_DEFINE], [
|
|
||||||
if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
|
|
||||||
AC_DEFINE($1, 1, $3)
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Check that the host supports TUN/TAP devices
|
|
||||||
AC_CACHE_CHECK([whether TUN/TAP is supported],
|
|
||||||
ac_cv_tun_tap_support, [
|
|
||||||
AC_TRY_COMPILE([
|
|
||||||
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
|
|
||||||
#include <linux/if.h>
|
|
||||||
#include <linux/if_tun.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
|
|
||||||
#include <net/if.h>
|
|
||||||
#include <net/if_tun.h>
|
|
||||||
#endif
|
|
||||||
], [
|
|
||||||
struct ifreq ifr;
|
|
||||||
memset(&ifr, 0, sizeof(ifr));
|
|
||||||
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
|
|
||||||
],
|
|
||||||
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
|
|
||||||
)
|
|
||||||
])
|
|
||||||
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
|
|
||||||
[Define if your system supports TUN/TAP devices.])
|
|
||||||
|
|
||||||
dnl Check signal handlers need to be reinstalled
|
|
||||||
AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
|
|
||||||
ac_cv_signal_need_reinstall, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_RUN([
|
|
||||||
#include <stdlib.h>
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include <signal.h>
|
|
||||||
static int handled_signal = 0;
|
|
||||||
RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
|
|
||||||
int main(void) { /* returns 0 if signals need not to be reinstalled */
|
|
||||||
signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
|
|
||||||
exit(handled_signal == 2);
|
|
||||||
}
|
|
||||||
], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
|
|
||||||
dnl When cross-compiling, do not assume anything.
|
|
||||||
ac_cv_signal_need_reinstall="guessing yes"
|
|
||||||
)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
]
|
|
||||||
)
|
|
||||||
AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall",
|
|
||||||
[Define if your system requires signals to be reinstalled.])
|
|
||||||
|
|
||||||
dnl Check if sigaction handlers need to be reinstalled
|
|
||||||
AC_CACHE_CHECK([whether sigaction handlers need to be reinstalled],
|
|
||||||
ac_cv_sigaction_need_reinstall, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_RUN([
|
|
||||||
#include <stdlib.h>
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include <signal.h>
|
|
||||||
static int handled_signal = 0;
|
|
||||||
RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
|
|
||||||
typedef RETSIGTYPE (*signal_handler)(int);
|
|
||||||
static signal_handler mysignal(int sig, signal_handler handler) {
|
|
||||||
struct sigaction old_sa;
|
|
||||||
struct sigaction new_sa;
|
|
||||||
new_sa.sa_handler = handler;
|
|
||||||
return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
|
|
||||||
}
|
|
||||||
int main(void) { /* returns 0 if signals need not to be reinstalled */
|
|
||||||
mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
|
|
||||||
exit(handled_signal == 2);
|
|
||||||
}
|
|
||||||
], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
|
|
||||||
dnl When cross-compiling, do not assume anything.
|
|
||||||
ac_cv_sigaction_need_reinstall="guessing yes"
|
|
||||||
)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
]
|
|
||||||
)
|
|
||||||
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
|
|
||||||
[Define if your system requires sigactions to be reinstalled.])
|
|
||||||
|
|
||||||
dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
|
|
||||||
AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],
|
|
||||||
ac_cv_have_skip_instruction, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_RUN([
|
|
||||||
#include "config_macosx.h"
|
|
||||||
#define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
|
|
||||||
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
|
|
||||||
#include "../Unix/vm_alloc.cpp"
|
|
||||||
#include "../Unix/sigsegv.cpp"
|
|
||||||
], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
|
|
||||||
dnl When cross-compiling, do not assume anything.
|
|
||||||
ac_cv_have_skip_instruction=no
|
|
||||||
)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
]
|
|
||||||
)
|
|
||||||
AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction",
|
|
||||||
[Define if we can ignore the fault (instruction skipping in SIGSEGV handler).])
|
|
||||||
|
|
||||||
dnl We can do Video on SEGV Signals
|
|
||||||
CAN_VOSF=yes
|
|
||||||
|
|
||||||
dnl A dummy program that returns always true
|
|
||||||
AC_PATH_PROG([BLESS], "true")
|
|
||||||
|
|
||||||
dnl Check for linker script support
|
|
||||||
case $target_os:$target_cpu in
|
|
||||||
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
|
|
||||||
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
|
|
||||||
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
|
|
||||||
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
|
|
||||||
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
|
|
||||||
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
|
|
||||||
esac
|
|
||||||
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
|
|
||||||
AC_CACHE_CHECK([whether linker script is usable],
|
|
||||||
ac_cv_linker_script_works, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
saved_LDFLAGS="$LDFLAGS"
|
|
||||||
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
|
|
||||||
AC_TRY_RUN(
|
|
||||||
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
|
|
||||||
[ac_cv_linker_script_works=yes],
|
|
||||||
[ac_cv_linker_script_works=no],
|
|
||||||
dnl When cross-compiling, assume it works
|
|
||||||
[ac_cv_linker_script_works="guessing yes"]
|
|
||||||
)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
if [[ "$ac_cv_linker_script_works" = "no" ]]; then
|
|
||||||
LDFLAGS="$saved_LDFLAGS"
|
|
||||||
LINKER_SCRIPT_FLAGS=""
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
|
|
||||||
[Define if there is a linker script to relocate the executable above 0x70000000.])
|
|
||||||
|
|
||||||
dnl Determine the addressing mode to use
|
|
||||||
ADDRESSING_MODE=""
|
|
||||||
AC_MSG_CHECKING([for the addressing mode to use])
|
|
||||||
for am in $ADDRESSING_TEST_ORDER; do
|
|
||||||
case $am in
|
|
||||||
real)
|
|
||||||
dnl Requires VOSF screen updates
|
|
||||||
if [[ "x$CAN_VOSF" = "xno" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
dnl Real addressing will probably work.
|
|
||||||
ADDRESSING_MODE="real"
|
|
||||||
WANT_VOSF=yes dnl we can use VOSF and we need it actually
|
|
||||||
DEFINES="$DEFINES -DREAL_ADDRESSING"
|
|
||||||
AC_DEFINE(REAL_ADDRESSING, 1, [Emulated memory is memory mapped to actual address.])
|
|
||||||
LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
direct)
|
|
||||||
dnl Requires VOSF screen updates
|
|
||||||
if [[ "x$CAN_VOSF" = "xyes" ]]; then
|
|
||||||
ADDRESSING_MODE="direct"
|
|
||||||
WANT_VOSF=yes dnl we can use VOSF and we need it actually
|
|
||||||
DEFINES="$DEFINES -DDIRECT_ADDRESSING"
|
|
||||||
AC_DEFINE(DIRECT_ADDRESSING, 1, [Emulated memory is an offset from actual address.])
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
banks)
|
|
||||||
dnl Default addressing mode
|
|
||||||
ADDRESSING_MODE="memory banks"
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
AC_MSG_RESULT($ADDRESSING_MODE)
|
|
||||||
if [[ "x$ADDRESSING_MODE" = "x" ]]; then
|
|
||||||
AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
|
|
||||||
ADDRESSING_MODE="memory banks"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Banked Memory Addressing mode is not supported by the JIT compiler
|
|
||||||
if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
|
|
||||||
AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Enable VOSF screen updates with this feature is requested and feasible
|
|
||||||
if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
|
|
||||||
AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
|
|
||||||
else
|
|
||||||
WANT_VOSF=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Check for GAS.
|
|
||||||
HAVE_GAS=no
|
|
||||||
AC_MSG_CHECKING(for GAS .p2align feature)
|
|
||||||
cat >conftest.S << EOF
|
|
||||||
.text
|
|
||||||
.p2align 5
|
|
||||||
EOF
|
|
||||||
if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
|
|
||||||
AC_MSG_RESULT($HAVE_GAS)
|
|
||||||
|
|
||||||
dnl Check for GCC 2.7 or higher.
|
|
||||||
HAVE_GCC27=no
|
|
||||||
AC_MSG_CHECKING(for GCC 2.7 or higher)
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
|
|
||||||
# error gcc < 2.7
|
|
||||||
#endif
|
|
||||||
]])],
|
|
||||||
[AC_MSG_RESULT(yes); HAVE_GCC27=yes],
|
|
||||||
[AC_MSG_RESULT(no)])
|
|
||||||
|
|
||||||
dnl Check for GCC 3.0 or higher.
|
|
||||||
HAVE_GCC30=no
|
|
||||||
AC_MSG_CHECKING(for GCC 3.0 or higher)
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
|
|
||||||
# error gcc < 3
|
|
||||||
#endif
|
|
||||||
]])],
|
|
||||||
[AC_MSG_RESULT(yes); HAVE_GCC30=yes],
|
|
||||||
[AC_MSG_RESULT(no)])
|
|
||||||
|
|
||||||
dnl Check for ICC.
|
|
||||||
AC_MSG_CHECKING(for ICC)
|
|
||||||
HAVE_ICC=no
|
|
||||||
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
|
|
||||||
HAVE_ICC=yes
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT($HAVE_ICC)
|
|
||||||
|
|
||||||
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
|
|
||||||
dnl Also set "-fno-exceptions" for C++ because exception handling requires
|
|
||||||
dnl the frame pointer.
|
|
||||||
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
|
|
||||||
CFLAGS="$CFLAGS -fomit-frame-pointer"
|
|
||||||
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp.
|
|
||||||
dnl As of 2001/08/02, this affects the following compilers:
|
|
||||||
dnl Official: probably gcc-3.1 (mainline CVS)
|
|
||||||
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
|
|
||||||
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
|
|
||||||
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
|
|
||||||
SAVED_CXXFLAGS="$CXXFLAGS"
|
|
||||||
CXXFLAGS="$CXXFLAGS -fno-merge-constants"
|
|
||||||
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([],[],[ac_cv_gcc_constants_merging=yes],[ac_cv_gcc_constants_merging=no])
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
if [[ "x$ac_cv_gcc_constants_merging" != "xyes" ]]; then
|
|
||||||
CXXFLAGS="$SAVED_CXXFLAGS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
|
|
||||||
dnl However, there are some corner cases exposed on x86-64
|
|
||||||
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
|
|
||||||
SAVED_CXXFLAGS="$CXXFLAGS"
|
|
||||||
CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
|
|
||||||
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
|
|
||||||
CXXFLAGS="$SAVED_CXXFLAGS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Add -fno-strict-aliasing for slirp sources
|
|
||||||
if [[ "x$HAVE_GCC30" = "xyes" ]]; then
|
|
||||||
SAVED_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
|
||||||
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
|
|
||||||
ac_cv_gcc_no_strict_aliasing, [
|
|
||||||
AC_TRY_COMPILE([],[],[ac_cv_gcc_no_strict_aliasing=yes],[ac_cv_gcc_no_strict_aliasing=no])
|
|
||||||
])
|
|
||||||
if [[ "x$ac_cv_gcc_no_strict_aliasing" = "xyes" ]]; then
|
|
||||||
AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")
|
|
||||||
fi
|
|
||||||
CFLAGS="$SAVED_CFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
|
|
||||||
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
|
|
||||||
SAVED_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS -mdynamic-no-pic"
|
|
||||||
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
|
|
||||||
ac_cv_gcc_mdynamic_no_pic, [
|
|
||||||
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
|
|
||||||
])
|
|
||||||
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
|
|
||||||
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
|
|
||||||
else
|
|
||||||
CFLAGS="$SAVED_CFLAGS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Make sure we can enable JIT debug mode.
|
|
||||||
if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
|
|
||||||
if [[ ":$WANT_JIT:$WANT_MON:" != ":yes:yes:" ]]; then
|
|
||||||
AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
|
|
||||||
WANT_JIT_DEBUG=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Additionnal checks for the IEEE FPU emulation code.
|
|
||||||
AC_CHECK_HEADERS(ieee754.h ieeefp.h floatingpoint.h nan.h)
|
|
||||||
AC_CHECK_FUNCS(atanh)
|
|
||||||
AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
|
|
||||||
dnl Math functions not mandated by C99 standard
|
|
||||||
AC_CHECK_FUNCS(isnanl isinfl)
|
|
||||||
dnl Math functions required by C99 standard, but probably not
|
|
||||||
dnl implemented everywhere. In that case, we fall back to the
|
|
||||||
dnl regular variant for doubles.
|
|
||||||
AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
|
|
||||||
AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
|
|
||||||
AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
|
|
||||||
AC_CHECK_FUNCS(floorl ceill)
|
|
||||||
|
|
||||||
dnl Remove the "-g" option if set for GCC.
|
|
||||||
if [[ "x$HAVE_GCC27" = "xyes" ]]; then
|
|
||||||
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
|
|
||||||
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl Some Mac OS X specific stuff:
|
|
||||||
dnl
|
|
||||||
|
|
||||||
dnl MacOS 10.2 (and later?) have a particular header for defining the OS version
|
|
||||||
if [[ "x$ac_cv_header_AvailabilityMacros_h" = "xyes" ]]; then
|
|
||||||
AC_DEFINE(AVAILABILITYMACROS, 1, [Header specific to 10.2 and later.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Which IDE do we use?
|
|
||||||
if test -d "/Developer/Applications/Xcode.app"; then
|
|
||||||
IDE=xcodebuild
|
|
||||||
PROJECT=BasiliskII.xcode
|
|
||||||
IDEARGS="-project BasiliskII.xcode"
|
|
||||||
else
|
|
||||||
IDE=pbxbuild
|
|
||||||
PROJECT=BasiliskII.pbproj
|
|
||||||
IDEARGS=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Universal binaries
|
|
||||||
if [[ -z "$WANT_UNIVERSAL" ]]; then
|
|
||||||
WANT_UNIVERSAL=`echo $target_cpu | sed -e 's/i.86/i386/' | sed -e 's/powerpc/ppc/'`
|
|
||||||
fi
|
|
||||||
AC_SUBST(TARGET_ARCHES, [$WANT_UNIVERSAL])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING(for PowerPC SDK)
|
|
||||||
for version in $PPC_SDK_VERSION 10.2.8 10.3.9 10.4; do
|
|
||||||
sdk=`echo /Developer/SDKs/MacOSX$version*.sdk`
|
|
||||||
if [[ -d "$sdk" ]]; then
|
|
||||||
PPC_SDK_VERSION="$version"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
AC_MSG_RESULT($PPC_SDK_VERSION)
|
|
||||||
AC_SUBST(PPC_SDK_VERSION)
|
|
||||||
|
|
||||||
AC_DEFINE(DATADIR, "~", [unix_ether needs this!])
|
|
||||||
|
|
||||||
dnl Generate Makefile.
|
|
||||||
AC_SUBST(DEFINES)
|
|
||||||
AC_SUBST(MONSRCS)
|
|
||||||
AC_SUBST(CPUINCLUDES)
|
|
||||||
AC_SUBST(BLESS)
|
|
||||||
AC_SUBST(IDE)
|
|
||||||
AC_SUBST(PROJECT)
|
|
||||||
AC_SUBST(IDEARGS)
|
|
||||||
AC_SUBST(SLIRP_SRCS)
|
|
||||||
AC_SUBST(KEYCODES)
|
|
||||||
AC_SUBST(WANT_JIT)
|
|
||||||
AC_SUBST(WANT_JIT_DEBUG)
|
|
||||||
dnl autoconf on 10.1 doesn't understand these
|
|
||||||
dnl AC_CONFIG_FILES([Makefile])
|
|
||||||
dnl AC_OUTPUT
|
|
||||||
AC_OUTPUT(Makefile)
|
|
||||||
|
|
||||||
dnl Print summary.
|
|
||||||
echo
|
|
||||||
echo Basilisk II configuration summary:
|
|
||||||
echo
|
|
||||||
echo Build binaries for ..................... : $WANT_UNIVERSAL
|
|
||||||
echo Multiple emulator windows .............. : $ENABLE_MULTIPLE
|
|
||||||
echo Enable video on SEGV signals ........... : $WANT_VOSF
|
|
||||||
echo mon debugger support ................... : $WANT_MON
|
|
||||||
echo Build JIT compiler ..................... : $WANT_JIT
|
|
||||||
echo Build JIT with debug code .............. : $WANT_JIT_DEBUG
|
|
||||||
echo Addressing mode ........................ : $ADDRESSING_MODE
|
|
||||||
echo Mac OS X development environment ....... : $IDE
|
|
||||||
echo
|
|
||||||
echo "Configuration done. Now type \"make\" (or \"make ide\")."
|
|
@ -1,345 +0,0 @@
|
|||||||
/*
|
|
||||||
* sysdeps.h - System dependent definitions for Mac OS X.
|
|
||||||
* Based on Unix version
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Basilisk II (C) 1997-2008 Christian Bauer
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SYSDEPS_H
|
|
||||||
#define SYSDEPS_H
|
|
||||||
|
|
||||||
#ifndef __STDC__
|
|
||||||
#error "Your compiler is not ANSI. Get a real one."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "user_strings_unix.h"
|
|
||||||
|
|
||||||
#ifndef STDC_HEADERS
|
|
||||||
#error "You don't have ANSI C header files."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
# include <sys/types.h>
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
|
||||||
# include <pthread.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
|
||||||
# include <sys/time.h>
|
|
||||||
# include <time.h>
|
|
||||||
#else
|
|
||||||
# ifdef HAVE_SYS_TIME_H
|
|
||||||
# include <sys/time.h>
|
|
||||||
# else
|
|
||||||
# include <time.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__MACH__)
|
|
||||||
#include <mach/clock.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Symbol to distinguish Nigel's Aqua port from a normal Darwin X11 build */
|
|
||||||
/* (this sysdeps.h file is currently specific to the Mac OS X Aqua port) */
|
|
||||||
#define AQUA 1
|
|
||||||
|
|
||||||
/* Header which defines OS X version for selecting APIs */
|
|
||||||
#ifdef AVAILABILITYMACROS
|
|
||||||
# include <AvailabilityMacros.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_NATIVE_M68K
|
|
||||||
|
|
||||||
/* Mac and host address space are the same */
|
|
||||||
#define REAL_ADDRESSING 1
|
|
||||||
|
|
||||||
/* Using 68k natively */
|
|
||||||
#define EMULATED_68K 0
|
|
||||||
|
|
||||||
/* Mac ROM is not write protected */
|
|
||||||
#define ROM_IS_WRITE_PROTECTED 0
|
|
||||||
#define USE_SCRATCHMEM_SUBTERFUGE 1
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Mac and host address space are distinct */
|
|
||||||
#ifndef REAL_ADDRESSING
|
|
||||||
#define REAL_ADDRESSING 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Using 68k emulator */
|
|
||||||
#define EMULATED_68K 1
|
|
||||||
|
|
||||||
/* The m68k emulator uses a prefetch buffer ? */
|
|
||||||
#define USE_PREFETCH_BUFFER 0
|
|
||||||
|
|
||||||
/* Mac ROM is write protected when banked memory is used */
|
|
||||||
#if REAL_ADDRESSING || DIRECT_ADDRESSING
|
|
||||||
# define ROM_IS_WRITE_PROTECTED 0
|
|
||||||
# define USE_SCRATCHMEM_SUBTERFUGE 1
|
|
||||||
#else
|
|
||||||
# define ROM_IS_WRITE_PROTECTED 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Direct Addressing requires Video on SEGV signals */
|
|
||||||
#if DIRECT_ADDRESSING && !ENABLE_VOSF
|
|
||||||
# undef ENABLE_VOSF
|
|
||||||
# define ENABLE_VOSF 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ExtFS is supported */
|
|
||||||
#define SUPPORTS_EXTFS 1
|
|
||||||
|
|
||||||
/* BSD socket API supported */
|
|
||||||
#define SUPPORTS_UDP_TUNNEL 1
|
|
||||||
|
|
||||||
|
|
||||||
/* Data types */
|
|
||||||
typedef unsigned char uint8;
|
|
||||||
typedef signed char int8;
|
|
||||||
#if SIZEOF_SHORT == 2
|
|
||||||
typedef unsigned short uint16;
|
|
||||||
typedef short int16;
|
|
||||||
#elif SIZEOF_INT == 2
|
|
||||||
typedef unsigned int uint16;
|
|
||||||
typedef int int16;
|
|
||||||
#else
|
|
||||||
#error "No 2 byte type, you lose."
|
|
||||||
#endif
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
typedef unsigned int uint32;
|
|
||||||
typedef int int32;
|
|
||||||
#elif SIZEOF_LONG == 4
|
|
||||||
typedef unsigned long uint32;
|
|
||||||
typedef long int32;
|
|
||||||
#else
|
|
||||||
#error "No 4 byte type, you lose."
|
|
||||||
#endif
|
|
||||||
#if SIZEOF_LONG == 8
|
|
||||||
typedef unsigned long uint64;
|
|
||||||
typedef long int64;
|
|
||||||
#define VAL64(a) (a ## l)
|
|
||||||
#define UVAL64(a) (a ## ul)
|
|
||||||
#elif SIZEOF_LONG_LONG == 8
|
|
||||||
typedef unsigned long long uint64;
|
|
||||||
typedef long long int64;
|
|
||||||
#define VAL64(a) (a ## LL)
|
|
||||||
#define UVAL64(a) (a ## uLL)
|
|
||||||
#else
|
|
||||||
#error "No 8 byte type, you lose."
|
|
||||||
#endif
|
|
||||||
#if SIZEOF_VOID_P == 4
|
|
||||||
typedef uint32 uintptr;
|
|
||||||
typedef int32 intptr;
|
|
||||||
#elif SIZEOF_VOID_P == 8
|
|
||||||
typedef uint64 uintptr;
|
|
||||||
typedef int64 intptr;
|
|
||||||
#else
|
|
||||||
#error "Unsupported size of pointer"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_LOFF_T
|
|
||||||
typedef off_t loff_t;
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_CADDR_T
|
|
||||||
typedef char * caddr_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Time data type for Time Manager emulation */
|
|
||||||
#ifdef HAVE_CLOCK_GETTIME
|
|
||||||
typedef struct timespec tm_time_t;
|
|
||||||
#elif defined(__MACH__)
|
|
||||||
typedef mach_timespec_t tm_time_t;
|
|
||||||
#else
|
|
||||||
typedef struct timeval tm_time_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define codes for all the float formats that we know of.
|
|
||||||
* Though we only handle IEEE format. */
|
|
||||||
#define UNKNOWN_FLOAT_FORMAT 0
|
|
||||||
#define IEEE_FLOAT_FORMAT 1
|
|
||||||
#define VAX_FLOAT_FORMAT 2
|
|
||||||
#define IBM_FLOAT_FORMAT 3
|
|
||||||
#define C4X_FLOAT_FORMAT 4
|
|
||||||
|
|
||||||
/* UAE CPU data types */
|
|
||||||
#define uae_s8 int8
|
|
||||||
#define uae_u8 uint8
|
|
||||||
#define uae_s16 int16
|
|
||||||
#define uae_u16 uint16
|
|
||||||
#define uae_s32 int32
|
|
||||||
#define uae_u32 uint32
|
|
||||||
#define uae_s64 int64
|
|
||||||
#define uae_u64 uint64
|
|
||||||
typedef uae_u32 uaecptr;
|
|
||||||
|
|
||||||
/* Alignment restrictions */
|
|
||||||
#if defined(__i386__) || defined(__powerpc__) || defined(__m68k__) || defined(__x86_64__)
|
|
||||||
# define CPU_CAN_ACCESS_UNALIGNED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Timing functions */
|
|
||||||
extern uint64 GetTicks_usec(void);
|
|
||||||
extern void Delay_usec(uint32 usec);
|
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
|
||||||
/* Centralized pthread attribute setup */
|
|
||||||
void Set_pthread_attr(pthread_attr_t *attr, int priority);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* UAE CPU defines */
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
|
|
||||||
#ifdef CPU_CAN_ACCESS_UNALIGNED
|
|
||||||
|
|
||||||
/* Big-endian CPUs which can do unaligned accesses */
|
|
||||||
static inline uae_u32 do_get_mem_long(uae_u32 *a) {return *a;}
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {return *a;}
|
|
||||||
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {*a = v;}
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = v;}
|
|
||||||
|
|
||||||
#else /* CPU_CAN_ACCESS_UNALIGNED */
|
|
||||||
|
|
||||||
#ifdef sgi
|
|
||||||
/* The SGI MIPSPro compilers can do unaligned accesses given enough hints.
|
|
||||||
* They will automatically inline these routines. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" { /* only the C compiler does unaligned accesses */
|
|
||||||
#endif
|
|
||||||
extern uae_u32 do_get_mem_long(uae_u32 *a);
|
|
||||||
extern uae_u32 do_get_mem_word(uae_u16 *a);
|
|
||||||
extern void do_put_mem_long(uae_u32 *a, uae_u32 v);
|
|
||||||
extern void do_put_mem_word(uae_u16 *a, uae_u32 v);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* sgi */
|
|
||||||
|
|
||||||
/* Big-endian CPUs which can not do unaligned accesses (this is not the most efficient way to do this...) */
|
|
||||||
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint8 *b = (uint8 *)a; return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];}
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint8 *b = (uint8 *)a; return (b[0] << 8) | b[1];}
|
|
||||||
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 24; b[1] = v >> 16; b[2] = v >> 8; b[3] = v;}
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 8; b[1] = v;}
|
|
||||||
#endif /* sgi */
|
|
||||||
|
|
||||||
#endif /* CPU_CAN_ACCESS_UNALIGNED */
|
|
||||||
|
|
||||||
#else /* WORDS_BIGENDIAN */
|
|
||||||
|
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
|
||||||
|
|
||||||
/* Intel x86 */
|
|
||||||
#define X86_PPRO_OPT
|
|
||||||
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
|
|
||||||
#ifdef X86_PPRO_OPT
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
|
|
||||||
#else
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
|
|
||||||
#endif
|
|
||||||
#define HAVE_GET_WORD_UNSWAPPED
|
|
||||||
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
|
|
||||||
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
|
|
||||||
#ifdef X86_PPRO_OPT
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
|
|
||||||
#else
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
|
|
||||||
#endif
|
|
||||||
#define HAVE_OPTIMIZED_BYTESWAP_32
|
|
||||||
/* bswap doesn't affect condition codes */
|
|
||||||
static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
|
|
||||||
#define HAVE_OPTIMIZED_BYTESWAP_16
|
|
||||||
#ifdef X86_PPRO_OPT
|
|
||||||
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
|
|
||||||
#else
|
|
||||||
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(CPU_CAN_ACCESS_UNALIGNED)
|
|
||||||
|
|
||||||
/* Other little-endian CPUs which can do unaligned accesses */
|
|
||||||
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 x = *a; return (x >> 24) | (x >> 8) & 0xff00 | (x << 8) & 0xff0000 | (x << 24);}
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint16 x = *a; return (x >> 8) | (x << 8);}
|
|
||||||
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {*a = (v >> 24) | (v >> 8) & 0xff00 | (v << 8) & 0xff0000 | (v << 24);}
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = (v >> 8) | (v << 8);}
|
|
||||||
|
|
||||||
#else /* CPU_CAN_ACCESS_UNALIGNED */
|
|
||||||
|
|
||||||
/* Other little-endian CPUs which can not do unaligned accesses (this needs optimization) */
|
|
||||||
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint8 *b = (uint8 *)a; return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];}
|
|
||||||
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint8 *b = (uint8 *)a; return (b[0] << 8) | b[1];}
|
|
||||||
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 24; b[1] = v >> 16; b[2] = v >> 8; b[3] = v;}
|
|
||||||
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 8; b[1] = v;}
|
|
||||||
|
|
||||||
#endif /* CPU_CAN_ACCESS_UNALIGNED */
|
|
||||||
|
|
||||||
#endif /* WORDS_BIGENDIAN */
|
|
||||||
|
|
||||||
#ifndef HAVE_OPTIMIZED_BYTESWAP_32
|
|
||||||
static inline uae_u32 do_byteswap_32(uae_u32 v)
|
|
||||||
{ return (((v >> 24) & 0xff) | ((v >> 8) & 0xff00) | ((v & 0xff) << 24) | ((v & 0xff00) << 8)); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_OPTIMIZED_BYTESWAP_16
|
|
||||||
static inline uae_u32 do_byteswap_16(uae_u32 v)
|
|
||||||
{ return (((v >> 8) & 0xff) | ((v & 0xff) << 8)); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define do_get_mem_byte(a) ((uae_u32)*((uae_u8 *)(a)))
|
|
||||||
#define do_put_mem_byte(a, v) (*(uae_u8 *)(a) = (v))
|
|
||||||
|
|
||||||
#define call_mem_get_func(func, addr) ((*func)(addr))
|
|
||||||
#define call_mem_put_func(func, addr, v) ((*func)(addr, v))
|
|
||||||
#define __inline__ inline
|
|
||||||
#define CPU_EMU_SIZE 0
|
|
||||||
#undef NO_INLINE_MEMORY_ACCESS
|
|
||||||
#undef MD_HAVE_MEM_1_FUNCS
|
|
||||||
#define ENUMDECL typedef enum
|
|
||||||
#define ENUMNAME(name) name
|
|
||||||
#define write_log printf
|
|
||||||
|
|
||||||
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)
|
|
||||||
#define ASM_SYM_FOR_FUNC(a) __asm__(a)
|
|
||||||
#else
|
|
||||||
#define ASM_SYM_FOR_FUNC(a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef REGPARAM
|
|
||||||
# define REGPARAM
|
|
||||||
#endif
|
|
||||||
#define REGPARAM2
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user