--include ../../Makefile.cfg
+
+-include ../config.mk
GCC_ARCHIVE:=$(lastword $(sort $(wildcard gcc-*.tar.bz2)))
GCC_DIR:=$(GCC_ARCHIVE:%.tar.bz2=%)
BINUTILS_ARCHIVE:=$(lastword $(sort $(wildcard binutils-*.tar.bz2)))
BINUTILS_DIR:=$(BINUTILS_ARCHIVE:%.tar.bz2=%)
-BINUTILS_CHANGES := config.sub bfd/config.bfd gas/configure.tgt ld/configure.tgt ld/emulparams/acess2_i386.sh ld/Makefile.in
-GCC_CHANGES := config.sub gcc/config.gcc gcc/config/acess2.h libgcc/config.host
-
-ifeq ($(ARCH),x86)
- BFDARCH:=i586
-else ifeq ($(ARCH),x86_64)
- BFDARCH:=x86_64
-else
- $(error Arch $(ARCH) is not supported by magic gcc makfile)
-endif
+BINUTILS_CHANGES := config.sub bfd/config.bfd gas/configure.tgt ld/configure.tgt ld/emulparams/acess2_i386.sh ld/emulparams/acess2_amd64.sh ld/Makefile.in
+GCC_CHANGES := config.sub gcc/config.gcc gcc/config/acess2.h libgcc/config.host
+# libstdc++-v3/crossconfig.m4 config/override.m4
-PARLEVEL ?= 1
+TARGET=$(HOST)
+GCC_TARGETS := gcc target-libgcc
+# target-libstdc++-v3
-TARGET=$(BFDARCH)-pc-acess2
-PREFIX=$(shell pwd)/cross
-SYSROOT=$(shell pwd)/sysroot-$(ARCH)
+PREFIX := $(PREFIX)-BUILD
+BDIR_GCC := build-$(ARCH)/gcc
+BDIR_BINUTILS := build-$(ARCH)/binutils
.PHONY: all clean binutils gcc include
include:
mkdir -p $(PREFIX)
mkdir -p $(SYSROOT)/usr
- -ln -s $(ACESSDIR)/Usermode/include $(SYSROOT)/usr/include
- -ln -s $(ACESSDIR)/Usermode/Output/$(ARCH)/Libs $(SYSROOT)/usr/lib
+ ln -sf $(ACESSDIR)/Usermode/include $(SYSROOT)/usr/include
+ ln -sf $(ACESSDIR)/Usermode/Output/$(ARCH)/Libs $(SYSROOT)/usr/lib
gcc: $(GCC_DIR) $(PREFIX)/bin/$(TARGET)-gcc
@echo [CP] $@
@cp $< $@
-BDIR_GCC := build-$(ARCH)/gcc
-BDIR_BINUTILS := build-$(ARCH)/binutils
+$(GCC_DIR)/libstdc++-v3/configure: $(GCC_DIR)/libstdc++-v3/crossconfig.m4
+ cd $(GCC_DIR)/libstdc++-v3/ && autoconf
$(BDIR_BINUTILS)/Makefile: $(addprefix $(BINUTILS_DIR)/,$(BINUTILS_CHANGES))
@mkdir -p $(BDIR_BINUTILS)
@make -C $(BDIR_BINUTILS) all -j $(PARLEVEL)
@make -C $(BDIR_BINUTILS) install
-$(BDIR_GCC)/Makefile: Makefile $(addprefix $(GCC_DIR)/,$(GCC_CHANGES))
+$(BDIR_GCC)/Makefile: Makefile $(addprefix $(GCC_DIR)/,$(GCC_CHANGES)) $(GCC_DIR)/libstdc++-v3/configure
@mkdir -p $(BDIR_GCC)
@cd $(BDIR_GCC) && PATH=$(PREFIX)/bin:$$PATH ../../$(GCC_DIR)/configure --target=$(TARGET) --prefix=$(PREFIX) --disable-nls --enable-langs=c,c++ --includedir=$(ACESSDIR)/Usermode/include "--with-sysroot=$(SYSROOT)"
$(PREFIX)/bin/$(TARGET)-gcc: $(BDIR_GCC)/Makefile
- @PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) all-gcc -j $(PARLEVEL)
- @PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) all-target-libgcc -j $(PARLEVEL)
- @make -C $(BDIR_GCC) install-gcc install-target-libgcc
+ @PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) $(GCC_TARGETS:%=all-%) -j $(PARLEVEL)
+ @PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) $(GCC_TARGETS:%=install-%)
+++ /dev/null
---- SDL-1.2.15_orig/configure.in 2013-06-17 11:39:39.670720710 +0800
-+++ SDL-1.2.15/configure.in 2013-06-17 11:48:09.149384231 +0800
-@@ -43,6 +43,147 @@
- AC_SUBST(LT_REVISION)
- AC_SUBST(LT_AGE)
-
-+AH_TEMPLATE(HAVE_ALTIVEC_H, [])
-+AH_TEMPLATE(HAVE_CLOCK_GETTIME, [])
-+AH_TEMPLATE(HAVE_LIBC, [])
-+AH_TEMPLATE(HAVE_MEMCMP, [])
-+AH_TEMPLATE(HAVE_MPROTECT, [])
-+AH_TEMPLATE(HAVE_SA_SIGACTION, [])
-+AH_TEMPLATE(HAVE_SEM_TIMEDWAIT, [])
-+AH_TEMPLATE(HAVE_STRTOD, [])
-+AH_TEMPLATE(SDL_ALTIVEC_BLITTERS, [])
-+AH_TEMPLATE(SDL_ASSEMBLY_ROUTINES, [])
-+AH_TEMPLATE(SDL_AUDIO_DISABLED, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ALSA, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ARTS, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_BAUDIO, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_BSD, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_COREAUDIO, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_DISK, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_DMEDIA, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_DSOUND, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_DUMMY, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ESD, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_ESD_DYNAMIC, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_MINT, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_MMEAUDIO, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_NAS, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_NAS_DYNAMIC, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_OSS, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_PAUD, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_PULSE, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_QNXNTO, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_SUNAUDIO, [])
-+AH_TEMPLATE(SDL_AUDIO_DRIVER_WAVEOUT, [])
-+AH_TEMPLATE(SDL_BYTEORDER, [])
-+AH_TEMPLATE(SDL_CDROM_AIX, [])
-+AH_TEMPLATE(SDL_CDROM_BEOS, [])
-+AH_TEMPLATE(SDL_CDROM_BSDI, [])
-+AH_TEMPLATE(SDL_CDROM_DISABLED, [])
-+AH_TEMPLATE(SDL_CDROM_FREEBSD, [])
-+AH_TEMPLATE(SDL_CDROM_LINUX, [])
-+AH_TEMPLATE(SDL_CDROM_MACOSX, [])
-+AH_TEMPLATE(SDL_CDROM_MINT, [])
-+AH_TEMPLATE(SDL_CDROM_OPENBSD, [])
-+AH_TEMPLATE(SDL_CDROM_OSF, [])
-+AH_TEMPLATE(SDL_CDROM_QNX, [])
-+AH_TEMPLATE(SDL_CDROM_WIN32, [])
-+AH_TEMPLATE(SDL_CPUINFO_DISABLED, [])
-+AH_TEMPLATE(SDL_EVENTS_DISABLED, [])
-+AH_TEMPLATE(SDL_FILE_DISABLED, [])
-+AH_TEMPLATE(SDL_HAS_64BIT_TYPE, [])
-+AH_TEMPLATE(SDL_HERMES_BLITTERS, [])
-+AH_TEMPLATE(SDL_INPUT_LINUXEV, [])
-+AH_TEMPLATE(SDL_INPUT_TSLIB, [])
-+AH_TEMPLATE(SDL_JOYSTICK_BEOS, [])
-+AH_TEMPLATE(SDL_JOYSTICK_DISABLED, [])
-+AH_TEMPLATE(SDL_JOYSTICK_DUMMY, [])
-+AH_TEMPLATE(SDL_JOYSTICK_IOKIT, [])
-+AH_TEMPLATE(SDL_JOYSTICK_LINUX, [])
-+AH_TEMPLATE(SDL_JOYSTICK_MINT, [])
-+AH_TEMPLATE(SDL_JOYSTICK_RISCOS, [])
-+AH_TEMPLATE(SDL_JOYSTICK_USBHID, [])
-+AH_TEMPLATE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, [])
-+AH_TEMPLATE(SDL_JOYSTICK_WINMM, [])
-+AH_TEMPLATE(SDL_LOADSO_BEOS, [])
-+AH_TEMPLATE(SDL_LOADSO_DISABLED, [])
-+AH_TEMPLATE(SDL_LOADSO_DLCOMPAT, [])
-+AH_TEMPLATE(SDL_LOADSO_DLOPEN, [])
-+AH_TEMPLATE(SDL_LOADSO_LDG, [])
-+AH_TEMPLATE(SDL_LOADSO_WIN32, [])
-+AH_TEMPLATE(SDL_THREADS_DISABLED, [])
-+AH_TEMPLATE(SDL_THREAD_BEOS, [])
-+AH_TEMPLATE(SDL_THREAD_PTH, [])
-+AH_TEMPLATE(SDL_THREAD_PTHREAD, [])
-+AH_TEMPLATE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, [])
-+AH_TEMPLATE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, [])
-+AH_TEMPLATE(SDL_THREAD_SPROC, [])
-+AH_TEMPLATE(SDL_THREAD_WIN32, [])
-+AH_TEMPLATE(SDL_TIMERS_DISABLED, [])
-+AH_TEMPLATE(SDL_TIMER_BEOS, [])
-+AH_TEMPLATE(SDL_TIMER_MINT, [])
-+AH_TEMPLATE(SDL_TIMER_RISCOS, [])
-+AH_TEMPLATE(SDL_TIMER_UNIX, [])
-+AH_TEMPLATE(SDL_TIMER_WIN32, [])
-+AH_TEMPLATE(SDL_TIMER_WINCE, [])
-+AH_TEMPLATE(SDL_VIDEO_DISABLED, [])
-+AH_TEMPLATE(SDL_VIDEO_DISABLE_SCREENSAVER, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_AALIB, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_ACESS, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_BWINDOW, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_CACA, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_DDRAW, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_DGA, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_DIRECTFB, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_DUMMY, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_FBCON, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_GEM, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_GGI, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_IPOD, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_NANOX, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_PHOTON, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_PICOGUI, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_PS2GS, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_PS3, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_QTOPIA, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_QUARTZ, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_RISCOS, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_SVGALIB, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_TOOLBOX, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_VGL, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_WINDIB, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_WSCONS, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_DGAMOUSE, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_DYNAMIC, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_VIDMODE, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_XINERAMA, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_XME, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_XRANDR, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_X11_XV, [])
-+AH_TEMPLATE(SDL_VIDEO_DRIVER_XBIOS, [])
-+AH_TEMPLATE(SDL_VIDEO_OPENGL, [])
-+AH_TEMPLATE(SDL_VIDEO_OPENGL_GLX, [])
-+AH_TEMPLATE(SDL_VIDEO_OPENGL_OSMESA, [])
-+AH_TEMPLATE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC, [])
-+AH_TEMPLATE(SDL_VIDEO_OPENGL_WGL, [])
-+AH_TEMPLATE(int8_t, [Signed 8-bit int])
-+AH_TEMPLATE(int16_t, [Signed 16-bit int])
-+AH_TEMPLATE(int32_t, [Signed 32-bit int])
-+AH_TEMPLATE(int64_t, [Signed 64-bit int])
-+AH_TEMPLATE(uint8_t, [Unigned 8-bit int])
-+AH_TEMPLATE(uint16_t, [Unigned 16-bit int])
-+AH_TEMPLATE(uint32_t, [Unigned 32-bit int])
-+AH_TEMPLATE(uint64_t, [Unigned 64-bit int])
-+AH_TEMPLATE(uintptr_t, [Unsigned pointer-sized integer])
-+
- dnl Detect the canonical build and host environments
- AC_CONFIG_AUX_DIR([build-scripts])
- dnl AC_CANONICAL_HOST
-@@ -2831,6 +2972,16 @@
- # The RISC OS platform requires special setup.
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
- ;;
-+ *-acess*)
-+ ARCH=acess
-+ # Set up files for the video library
-+ if test x$enable_video = xyes; then
-+ AC_DEFINE(SDL_VIDEO_DRIVER_ACESS)
-+ SOURCES="$SOURCES $srcdir/src/video/acess/*.c"
-+ have_video=yes
-+ fi
-+ # TODO: Joystick
-+ ;;
- *)
- AC_MSG_ERROR([
- *** Unsupported host: Please add to configure.in