diff -uNr  configure.in.org configure.in
--- configure.in.org	2010-03-22 13:40:34.000000000 +0900
+++ configure.in	2010-08-09 02:36:14.000000000 +0900
@@ -746,6 +746,9 @@
 	*darwin*)
 		NASM_FORMAT="-f macho"
 		;;
+	*os2-emx*)
+		NASM_FORMAT="-f aout -DAOUT"
+		;;
 	*)
 		CYGWIN=no
 		NASM_FORMAT="-f elf"
diff -uNr  frontend/parse.c.org frontend/parse.c
--- frontend/parse.c.org	2009-12-11 15:44:50.000000000 +0900
+++ frontend/parse.c	2010-08-09 02:36:14.000000000 +0900
@@ -45,11 +45,8 @@
 #endif
 
 #ifdef __OS2__
+#define INCL_DOS
 #include <os2.h>
-#define PRTYC_IDLE 1
-#define PRTYC_REGULAR 2
-#define PRTYD_MINIMUM -31
-#define PRTYD_MAXIMUM 31
 #endif
 
 #ifdef HAVE_LIMITS_H
@@ -201,7 +198,7 @@
 
     case 0:
         rc = DosSetPriority(0, /* Scope: only one process */
-                            PRTYC_IDLE, /* select priority class (idle, regular, etc) */
+                            PRTYC_IDLETIME, /* select priority class (idle, regular, etc) */
                             0, /* set delta */
                             0); /* Assume current process */
         console_printf("==> Priority set to 0 (Low priority).\n");
@@ -209,7 +206,7 @@
 
     case 1:
         rc = DosSetPriority(0, /* Scope: only one process */
-                            PRTYC_IDLE, /* select priority class (idle, regular, etc) */
+                            PRTYC_IDLETIME, /* select priority class (idle, regular, etc) */
                             PRTYD_MAXIMUM, /* set delta */
                             0); /* Assume current process */
         console_printf("==> Priority set to 1 (Medium priority).\n");
