From 39f0afdce28871c40b5f5d64cca34c89fcea29ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krystian=20Bac=C5=82awski?= Date: Fri, 3 Aug 2012 19:51:11 +0200 Subject: [PATCH] Enable ixemul compilation. --- README | 6 +- bootstrap.sh | 9 ++- patches/ixemul-48.2/general/Makefile.in.diff | 15 +++++ patches/ixemul-48.2/glue/Makefile.in.diff | 11 ++++ patches/ixemul-48.2/glue/gen_glue.c.diff | 11 ++++ patches/ixemul-48.2/ixnet/Makefile.in.diff | 29 +++++++++ .../ixemul-48.2/ixnet/parse_version.c.diff | 44 ++++++++++++++ patches/ixemul-48.2/library/Makefile.in.diff | 33 ++++++++++ patches/ixemul-48.2/library/ixemul.h.diff | 13 ++++ .../ixemul-48.2/library/parse_version.c.diff | 60 +++++++++++++++++++ patches/ixemul-48.2/stdio/Makefile.in.diff | 15 +++++ patches/ixemul-48.2/stdlib/Makefile.in.diff | 15 +++++ patches/ixemul-48.2/string/Makefile.in.diff | 15 +++++ patches/ixemul-48.2/utils/Makefile.in.diff | 20 +++++++ patches/ixemul-48.2/utils/ixtimezone.c.diff | 11 ++++ 15 files changed, 302 insertions(+), 5 deletions(-) create mode 100644 patches/ixemul-48.2/general/Makefile.in.diff create mode 100644 patches/ixemul-48.2/glue/Makefile.in.diff create mode 100644 patches/ixemul-48.2/glue/gen_glue.c.diff create mode 100644 patches/ixemul-48.2/ixnet/Makefile.in.diff create mode 100644 patches/ixemul-48.2/ixnet/parse_version.c.diff create mode 100644 patches/ixemul-48.2/library/Makefile.in.diff create mode 100644 patches/ixemul-48.2/library/ixemul.h.diff create mode 100644 patches/ixemul-48.2/library/parse_version.c.diff create mode 100644 patches/ixemul-48.2/stdio/Makefile.in.diff create mode 100644 patches/ixemul-48.2/stdlib/Makefile.in.diff create mode 100644 patches/ixemul-48.2/string/Makefile.in.diff create mode 100644 patches/ixemul-48.2/utils/Makefile.in.diff create mode 100644 patches/ixemul-48.2/utils/ixtimezone.c.diff diff --git a/README b/README index 6534257..12e82aa 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ targeting m68k-amigaos with: * binutils 2.9.1 (assembler, linker, etc.) * libnix 2.1 (standard ANSI/C library replacement for AmigaOS) * AmigaOS headers & libraries (for AmigaOS 3.9) + * ixemul.library 48.2 Patches are welcome! @@ -27,6 +28,7 @@ Prerequisites (look at bootstrap.conf file): - gcc 2.95.3 - binutils 2.9.1 - bison 1.35 + - gawk 1.3.8 * Amiga specific sources & binaries: - libnix 2.1 - AmigaOS NDK 3.9 @@ -46,5 +48,5 @@ TODO: * Remove dependencies: - libamiga-bin * Provide some rudimentary testing (C / C++ sources). - * Build ixemul. - * Add auxiliary tools: GccFindHit, hunk2aout. + * Add auxiliary tools: hunk2aout. + * Build timezone data for ixemul (zic). diff --git a/bootstrap.sh b/bootstrap.sh index c4cbd4b..e1689f8 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -124,7 +124,10 @@ function unpack_sources { unpack_clean "${IXEMUL}" "${IXEMUL_SRC}" mv "ixemul" "${IXEMUL}" - chmod a+x "${IXEMUL}/configure" + pushd "${IXEMUL}" + chmod a+x "configure" "mkinstalldirs" + apply_patches "${IXEMUL}" + popd unpack_clean "${LIBNIX}" "${LIBNIX_SRC}" mv "libnix" "${LIBNIX}" @@ -344,7 +347,7 @@ function build_ixemul { mkdir -p "${IXEMUL}" cd "${IXEMUL}" CC=m68k-amigaos-gcc \ - CFLAGS=-noixemul \ + CFLAGS="-noixemul -I${PREFIX}/include" \ AR=m68k-amigaos-ar \ RANLIB=m68k-amigaos-ranlib \ "${SOURCES}/${IXEMUL}/configure" \ @@ -390,8 +393,8 @@ function build { process_headers install_libamiga build_libnix - #build_ixemul build_gpp + build_ixemul } function main { diff --git a/patches/ixemul-48.2/general/Makefile.in.diff b/patches/ixemul-48.2/general/Makefile.in.diff new file mode 100644 index 0000000..4a9e036 --- /dev/null +++ b/patches/ixemul-48.2/general/Makefile.in.diff @@ -0,0 +1,15 @@ +--- ixemul-48.2.orig/general/Makefile.in 2001-08-21 17:32:52.000000000 +0200 ++++ ixemul-48.2/general/Makefile.in 2012-08-03 19:29:32.000000000 +0200 +@@ -33,9 +33,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) diff --git a/patches/ixemul-48.2/glue/Makefile.in.diff b/patches/ixemul-48.2/glue/Makefile.in.diff new file mode 100644 index 0000000..da53108 --- /dev/null +++ b/patches/ixemul-48.2/glue/Makefile.in.diff @@ -0,0 +1,11 @@ +--- ixemul-48.2/glue/Makefile.in 1999-08-12 14:27:36.000000000 +0200 ++++ ixemul-48.2/glue/Makefile.in 2012-08-03 17:58:34.000000000 +0200 +@@ -77,7 +77,7 @@ + rm -f *.o + + gen_glue: gen_glue.c $(srcdir)/../include/sys/syscall.def +- $(CC) $(ALL_CFLAGS) $< -o $@ ++ gcc $(INCS) $< -o $@ + + clean: + rm -rf *baserel* diff --git a/patches/ixemul-48.2/glue/gen_glue.c.diff b/patches/ixemul-48.2/glue/gen_glue.c.diff new file mode 100644 index 0000000..385af07 --- /dev/null +++ b/patches/ixemul-48.2/glue/gen_glue.c.diff @@ -0,0 +1,11 @@ +--- ixemul-48.2.orig/glue/gen_glue.c 1999-08-12 14:27:36.000000000 +0200 ++++ ixemul-48.2/glue/gen_glue.c 2012-08-03 18:25:58.000000000 +0200 +@@ -1,6 +1,8 @@ + #include + #include + ++#include ++#include + #include + + struct syscall { diff --git a/patches/ixemul-48.2/ixnet/Makefile.in.diff b/patches/ixemul-48.2/ixnet/Makefile.in.diff new file mode 100644 index 0000000..2c306c2 --- /dev/null +++ b/patches/ixemul-48.2/ixnet/Makefile.in.diff @@ -0,0 +1,29 @@ +--- ixemul-48.2.orig/ixnet/Makefile.in 2001-09-01 17:16:30.000000000 +0200 ++++ ixemul-48.2/ixnet/Makefile.in 2012-08-03 19:30:25.000000000 +0200 +@@ -33,9 +33,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) +@@ -112,11 +112,11 @@ + ./create_header >$@ + + create_header: create_header.c $(srcdir)/../include/user.h ixnet.h +- gcc $(CFLAGS) $(INCS) $(OTHER_CFLAGS) $(DEFS) $< -o $@ ++ gcc $(CFLAGS) $(INCS) $(DEFS) $< -o $@ + chmod u+x $@ + + parse_version: parse_version.c +- gcc $(CFLAGS) $(OTHER_CFLAGS) -Dmc$(CPU) $(DEF_FPU) $(DEFS) $< -o $@ ++ gcc $(CFLAGS) -Dmc$(CPU) $(DEF_FPU) $(DEFS) $< -o $@ + chmod u+x $@ + + version.h: parse_version $(srcdir)/../version.in diff --git a/patches/ixemul-48.2/ixnet/parse_version.c.diff b/patches/ixemul-48.2/ixnet/parse_version.c.diff new file mode 100644 index 0000000..76160b1 --- /dev/null +++ b/patches/ixemul-48.2/ixnet/parse_version.c.diff @@ -0,0 +1,44 @@ +--- ixemul-48.2.orig/ixnet/parse_version.c 2001-08-21 17:33:06.000000000 +0200 ++++ ixemul-48.2/ixnet/parse_version.c 2012-08-03 18:29:55.000000000 +0200 +@@ -1,5 +1,6 @@ + #include + #include ++#include + + int main(int argc, char **argv) + { +@@ -23,20 +24,20 @@ + } + fscanf(f, "%d.%d,%d.%d.%d", &major, &minor, &day, &month, &year); + fclose(f); +- format = "/* +- * version.h file. Automatically generated by parse_version. +- */ +- +-#ifndef __VERSION_H__ +-#define __VERSION_H__ +- +-#define IXNET_NAME \"ixnet.library\" +-#define IXNET_IDSTRING \"ixnet %d.%d [%s] (%d.%d.%d)\" +-#define IXNET_VERSION %d +-#define IXNET_REVISION %d +-#define IXNET_PRIORITY 0 +- +-#endif ++ format = "/*\n\ ++ * version.h file. Automatically generated by parse_version.\n\ ++ */\n\ ++\n\ ++#ifndef __VERSION_H__\n\ ++#define __VERSION_H__\n\ ++\n\ ++#define IXNET_NAME \"ixnet.library\"\n\ ++#define IXNET_IDSTRING \"ixnet %d.%d [%s] (%d.%d.%d)\"\n\ ++#define IXNET_VERSION %d\n\ ++#define IXNET_REVISION %d\n\ ++#define IXNET_PRIORITY 0\n\ ++\n\ ++#endif\n\ + "; + tmp[0] = '\0'; + diff --git a/patches/ixemul-48.2/library/Makefile.in.diff b/patches/ixemul-48.2/library/Makefile.in.diff new file mode 100644 index 0000000..7e2e0b4 --- /dev/null +++ b/patches/ixemul-48.2/library/Makefile.in.diff @@ -0,0 +1,33 @@ +--- ixemul-48.2.orig/library/Makefile.in 2001-09-01 17:16:30.000000000 +0200 ++++ ixemul-48.2/library/Makefile.in 2012-08-03 18:50:34.000000000 +0200 +@@ -32,9 +32,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) +@@ -186,7 +186,7 @@ + ./create_header >$@ + + create_header: create_header.c $(srcdir)/../include/user.h ixemul.h +- gcc $(CFLAGS) $(INCS) $(OTHER_CFLAGS) $(DEFS) $< -o $@ ++ gcc $(CFLAGS) $(INCS) $(DEFS) $< -o $@ + chmod u+x $@ + + ii.o tz.o: version.h +@@ -194,7 +194,7 @@ + # Use native compiler, which may not understand some CFLAGS + # So force the defines of CPU and FPU via $DEF_CPU_FPU + parse_version: parse_version.c +- gcc $(CFLAGS) $(OTHER_CFLAGS) $(DEF_CPU_FPU) $(DEFS) $< -o $@ ++ gcc $(CFLAGS) $(DEF_CPU_FPU) $(DEFS) $< -o $@ + chmod u+x $@ + + version.h: parse_version $(srcdir)/../version.in diff --git a/patches/ixemul-48.2/library/ixemul.h.diff b/patches/ixemul-48.2/library/ixemul.h.diff new file mode 100644 index 0000000..512e661 --- /dev/null +++ b/patches/ixemul-48.2/library/ixemul.h.diff @@ -0,0 +1,13 @@ +--- ixemul-48.2.orig/library/ixemul.h 2001-08-21 17:33:24.000000000 +0200 ++++ ixemul-48.2/library/ixemul.h 2012-08-03 18:58:17.000000000 +0200 +@@ -294,8 +294,10 @@ + extern int has_68040_or_up; + extern int has_68060_or_up; + ++#ifndef AFB_68060 + #define AFB_68060 (7) + #define AFF_68060 (1L<<7) ++#endif + + #define usetup struct user *u_ptr=getuser(SysBase->ThisTask) + diff --git a/patches/ixemul-48.2/library/parse_version.c.diff b/patches/ixemul-48.2/library/parse_version.c.diff new file mode 100644 index 0000000..9c1f15c --- /dev/null +++ b/patches/ixemul-48.2/library/parse_version.c.diff @@ -0,0 +1,60 @@ +--- ixemul-48.2.orig/library/parse_version.c 2001-08-21 17:33:32.000000000 +0200 ++++ ixemul-48.2/library/parse_version.c 2012-08-03 18:49:15.000000000 +0200 +@@ -1,5 +1,6 @@ + #include + #include ++#include + + int main(int argc, char **argv) + { +@@ -23,28 +24,28 @@ + } + fscanf(f, "%d.%d,%d.%d.%d", &major, &minor, &day, &month, &year); + fclose(f); +- format = "/* +- * version.h file. Automatically generated by parse_version. +- */ +- +-#ifndef __VERSION_H__ +-#define __VERSION_H__ +- +-/* Commodities.h defines IX_VERSION too, so wait for our defines +- to come last, and undef the sucker now! */ +-#undef IX_VERSION +- +-#define IX_NAME \"ixemul.library\" +-#ifdef TRACE_LIBRARY +-#define IX_IDSTRING \"ixemul %d.%d [trace, %s] (%d.%d.%d)\" +-#else +-#define IX_IDSTRING \"ixemul %d.%d [%s] (%d.%d.%d)\" +-#endif +-#define IX_VERSION %d +-#define IX_REVISION %d +-#define IX_PRIORITY 0 +- +-#endif ++ format = "/*\n\ ++ * version.h file. Automatically generated by parse_version.\n\ ++ */\n\ ++\n\ ++#ifndef __VERSION_H__\n\ ++#define __VERSION_H__\n\ ++\n\ ++/* Commodities.h defines IX_VERSION too, so wait for our defines\n\ ++ to come last, and undef the sucker now! */\n\ ++#undef IX_VERSION\n\ ++\n\ ++#define IX_NAME \"ixemul.library\"\n\ ++#ifdef TRACE_LIBRARY\n\ ++#define IX_IDSTRING \"ixemul %d.%d [trace, %s] (%d.%d.%d)\"\n\ ++#else\n\ ++#define IX_IDSTRING \"ixemul %d.%d [%s] (%d.%d.%d)\"\n\ ++#endif\n\ ++#define IX_VERSION %d\n\ ++#define IX_REVISION %d\n\ ++#define IX_PRIORITY 0\n\ ++\n\ ++#endif\n\ + "; + + tmp[0] = '\0'; diff --git a/patches/ixemul-48.2/stdio/Makefile.in.diff b/patches/ixemul-48.2/stdio/Makefile.in.diff new file mode 100644 index 0000000..fd3597f --- /dev/null +++ b/patches/ixemul-48.2/stdio/Makefile.in.diff @@ -0,0 +1,15 @@ +--- ixemul-48.2.orig/stdio/Makefile.in 2001-08-21 17:36:24.000000000 +0200 ++++ ixemul-48.2/stdio/Makefile.in 2012-08-03 18:46:52.000000000 +0200 +@@ -32,9 +32,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) diff --git a/patches/ixemul-48.2/stdlib/Makefile.in.diff b/patches/ixemul-48.2/stdlib/Makefile.in.diff new file mode 100644 index 0000000..451cb47 --- /dev/null +++ b/patches/ixemul-48.2/stdlib/Makefile.in.diff @@ -0,0 +1,15 @@ +--- ixemul-48.2.orig/stdlib/Makefile.in 2001-08-21 17:36:24.000000000 +0200 ++++ ixemul-48.2/stdlib/Makefile.in 2012-08-03 18:46:18.000000000 +0200 +@@ -32,9 +32,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) diff --git a/patches/ixemul-48.2/string/Makefile.in.diff b/patches/ixemul-48.2/string/Makefile.in.diff new file mode 100644 index 0000000..890949d --- /dev/null +++ b/patches/ixemul-48.2/string/Makefile.in.diff @@ -0,0 +1,15 @@ +--- ixemul-48.2.orig/string/Makefile.in 2001-08-21 17:36:26.000000000 +0200 ++++ ixemul-48.2/string/Makefile.in 2012-08-03 18:45:47.000000000 +0200 +@@ -32,9 +32,9 @@ + + # I *love* GNU make! + define catenate +-/bin/echo -n creating $@... +-/bin/echo -e "$(^:%=#include \"%\"\n)" >$@ +-/bin/echo done ++echo -n creating $@... ++echo "$(^:%=#include \"%\"\n)" >$@ ++echo done + endef + + FLAVOR_CFLAGS = -m$(CPU) -m$(FPU) diff --git a/patches/ixemul-48.2/utils/Makefile.in.diff b/patches/ixemul-48.2/utils/Makefile.in.diff new file mode 100644 index 0000000..c60d11e --- /dev/null +++ b/patches/ixemul-48.2/utils/Makefile.in.diff @@ -0,0 +1,20 @@ +--- ixemul-48.2.orig/utils/Makefile.in 2001-08-21 17:36:26.000000000 +0200 ++++ ixemul-48.2/utils/Makefile.in 2012-08-03 19:25:28.000000000 +0200 +@@ -89,7 +89,7 @@ + $(CC) $(OUR_LDFLAGS) -o $@ $^ $(LIBS) + + ixpipe-handler: ixpipe-handler.o +- $(CC) -nostdlib -o $@ $? -lc ++ $(CC) $(OUR_LDFLAGS) -nostdlib -o $@ $? -lc + + ipcs: ipcs.o + $(CC) $(OUR_LDFLAGS) -o $@ $^ $(LIBS) +@@ -115,7 +115,7 @@ + zoneinfo/GMT: zic yearistype + rm -rf zoneinfo + mkdir zoneinfo +- rootme=`pwd` ; cd $(srcdir)/databases ; \ ++ -rootme=`pwd` ; cd $(srcdir)/databases ; \ + $$rootme/zic -d $$rootme/zoneinfo -y "sh $$rootme/yearistype" -p $(POSIXRULES) $(DATABASES) + + version.h: ../library/parse_version.c ../version.in diff --git a/patches/ixemul-48.2/utils/ixtimezone.c.diff b/patches/ixemul-48.2/utils/ixtimezone.c.diff new file mode 100644 index 0000000..2b28edc --- /dev/null +++ b/patches/ixemul-48.2/utils/ixtimezone.c.diff @@ -0,0 +1,11 @@ +--- ixemul-48.2.orig/utils/ixtimezone.c 1997-08-20 20:31:06.000000000 +0200 ++++ ixemul-48.2/utils/ixtimezone.c 2012-08-03 18:52:58.000000000 +0200 +@@ -35,7 +35,7 @@ + unsigned char flags; + } ixtime; + +-struct Node *BattClockBase; ++struct Library *BattClockBase; + + char VERSION[] = "\000$VER: ixtimezone 1.0 (10.11.95)"; +