From c4f448fc9be2278eb683c68674fba20ef1b99b47 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 5 Mar 2009 16:05:58 -0800 Subject: [PATCH] Fixes for building on windows --- m4/as-host-defines.m4 | 4 ++-- orc/Makefile.am | 10 +++++++++- orc/orcprogram-mmx.c | 1 - orc/orcprogram-powerpc.c | 1 - orc/orcprogram-win32.c | 26 ++++++++++++++++++++++++++ orc/orcrules-mmx.c | 1 - 6 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 orc/orcprogram-win32.c diff --git a/m4/as-host-defines.m4 b/m4/as-host-defines.m4 index 8b813bb..d43596f 100644 --- a/m4/as-host-defines.m4 +++ b/m4/as-host-defines.m4 @@ -45,8 +45,8 @@ AM_CONDITIONAL(HAVE_ARM, test "x$HAVE_ARM" = "xyes") ;; esac -AM_CONDITIONAL(HAVE_OS_WIN32, test "$HAVE_WIN32" = "yes") -AM_CONDITIONAL(HAVE_OS_LINUX, test "$HAVE_LINUX" = "yes") +AM_CONDITIONAL(HAVE_OS_WIN32, test "$HAVE_OS_WIN32" = "yes") +AM_CONDITIONAL(HAVE_OS_LINUX, test "$HAVE_OS_LINUX" = "yes") ]) diff --git a/orc/Makefile.am b/orc/Makefile.am index 4b118c4..889d9fc 100644 --- a/orc/Makefile.am +++ b/orc/Makefile.am @@ -4,6 +4,8 @@ pkgincludedir = $(includedir)/orc-@ORC_MAJORMINOR@/orc lib_LTLIBRARIES = liborc-@ORC_MAJORMINOR@.la liborc_@ORC_MAJORMINOR@_la_LIBS = $(ORC_LIBS) +liborc_@ORC_MAJORMINOR@_la_LDFLAGS = \ + -no-undefined -export-symbols-regex 'orc_' liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) liborc_@ORC_MAJORMINOR@_la_SOURCES = \ @@ -17,13 +19,19 @@ liborc_@ORC_MAJORMINOR@_la_SOURCES = \ orcprogram-sse.c \ orcprogram.h \ orcopcodes.c \ - orcprogram-linux.c \ orcrules-mmx.c \ orcrules-sse.c \ orcdebug.c \ orccpu.c \ x86.c +if HAVE_OS_LINUX +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcprogram-linux.c +endif +if HAVE_OS_WIN32 +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcprogram-win32.c +endif + if HAVE_I386 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c else diff --git a/orc/orcprogram-mmx.c b/orc/orcprogram-mmx.c index 9a74d7c..8c677ee 100644 --- a/orc/orcprogram-mmx.c +++ b/orc/orcprogram-mmx.c @@ -7,7 +7,6 @@ #include #include -#include #include #include diff --git a/orc/orcprogram-powerpc.c b/orc/orcprogram-powerpc.c index c99ec51..2e6ef42 100644 --- a/orc/orcprogram-powerpc.c +++ b/orc/orcprogram-powerpc.c @@ -7,7 +7,6 @@ #include #include -#include #include diff --git a/orc/orcprogram-win32.c b/orc/orcprogram-win32.c new file mode 100644 index 0000000..5f7445a --- /dev/null +++ b/orc/orcprogram-win32.c @@ -0,0 +1,26 @@ + +#include "config.h" + +#include +#include +#include + +#include +#include + +#include + +#define SIZE 65536 + + +void +orc_program_allocate_codemem (OrcProgram *program) +{ + /* Now you know why Windows has viruses */ + + program->code = malloc(SIZE); + program->code_exec = program->code; + program->code_size = SIZE; + program->codeptr = program->code; +} + diff --git a/orc/orcrules-mmx.c b/orc/orcrules-mmx.c index 9c6eceb..2fce71b 100644 --- a/orc/orcrules-mmx.c +++ b/orc/orcrules-mmx.c @@ -7,7 +7,6 @@ #include #include -#include #include #include -- 2.7.4