Index: /trunk/configure.cmd
===================================================================
--- /trunk/configure.cmd	(revision 200)
+++ /trunk/configure.cmd	(revision 201)
@@ -46,4 +46,7 @@
 Opt.!GNUMakePath.0          = 0
 Opt.!GNUMakePath.!choice    = ''
+
+/* linker selection */
+Opt.!UseWlink   = 1
 
 /* library version */
@@ -284,4 +287,6 @@
     call WriteVar G.!ConfigCache, 'Opt.!GNUMakePath.!choice'
 
+    call WriteVar G.!ConfigCache, 'Opt.!UseWlink'
+
     call WriteVar G.!ConfigCache, 'Opt.!RELEASE'
     call WriteVar G.!ConfigCache, 'Opt.!DLL'
@@ -353,7 +358,8 @@
     call SaySay '----------------------'
     say
-    call SaySay 'Currently, Qt/OS2 supports only the Innotek GCC compiler 3.2.2'
-    call SaySay 'used together with IBM ILINK 3.08 to link native OMF object files'
-    call SaySay 'generated by GCC into OS/2 executables.'
+    call SaySay 'Currently, Qt/OS2 supports the Innotek GCC compilers 3.2.2 and 3.3.5'
+    call SaySay 'used together with Watcom WL.EXE or IBM ILINK 3.08 to link native OMF '
+    call SaySay 'object files generated by GCC into OS/2 executables.'
+    call SaySay 'When using the Watcom linker, the LXLite tool is needed as well.'
     say
     call SaySay 'Also, the GNU Make utility version 3.81beta1 or newer is required.'
@@ -371,13 +377,22 @@
     call WriteConfigCache
 
-    do until (Opt.!ILINKPath \= '')
-        Opt.!ILINKPath = MenuSelectPath(,
-            'Opt.!ILINKPath',,
-            'Select where to search for an ILINK installation:',,
-            'ilink.exe', 'CheckILINKPath',  'CheckILINKVersion',,
-            'ERROR: Could not find a valid ILINK installation'||G.!EOL||,
-            'in ''%1''!'||G.!EOL||,
-            'Please read the documentation.')
-    end
+    G.!Choices.0 = 2
+    G.!Choices.1 = 'Watcom linker bundled with GCC'
+    G.!Choices.2 = 'IBM linker from VisualAge C++'
+    choice = GetChoice('Select the linker type:', 'G.!Choices', -Opt.!UseWlink + 2)
+    Opt.!UseWlink = -choice + 2
+
+    if Opt.!UseWlink = 0 then do
+        do until (Opt.!ILINKPath \= '')
+            Opt.!ILINKPath = MenuSelectPath(,
+                'Opt.!ILINKPath',,
+                'Select where to search for an ILINK installation:',,
+                'ilink.exe', 'CheckILINKPath',  'CheckILINKVersion',,
+                'ERROR: Could not find a valid ILINK installation'||G.!EOL||,
+                'in ''%1''!'||G.!EOL||,
+                'Please read the documentation.')
+        end
+    end
+
     call WriteConfigCache
 
@@ -396,5 +411,8 @@
     say
     call SaySay 'Compiler     : Innotek GCC ('Opt.!GCCPath')'
-    call SaySay 'Linker       : IBM ILINK ('Opt.!ILINKPath')'
+    if Opt.!UseWlink = 0 then
+        call SaySay 'Linker       : IBM ILINK ('Opt.!ILINKPath')'
+    else
+        call SaySay 'Linker       : Watcom linker in GCC path'
     call SaySay 'Make Utility : GNU Make ('Opt.!GNUMakePath')'
     say
@@ -449,5 +467,10 @@
      */
     call lineout G.!QtCmd, '/* setup the GCC environment */'
-    call lineout G.!QtCmd, '''call'' GCC_PATH''\bin\gccenv.cmd'' GCC_PATH ''VAC308'''
+    if Opt.!UseWlink then do
+        call lineout G.!QtCmd, '''call'' GCC_PATH''\bin\gccenv.cmd'' GCC_PATH ''WLINK'''
+    end
+    else do
+        call lineout G.!QtCmd, '''call'' GCC_PATH''\bin\gccenv.cmd'' GCC_PATH ''VAC308'''
+    End
     call lineout G.!QtCmd, ''
     call lineout G.!QtCmd, 'call value ''QMAKESPEC'', QMAKESPEC, ''OS2ENVIRONMENT'''
@@ -483,8 +506,17 @@
      *  the beginning)
      */
-    call ConfigureCompiler_GenAddPathEnv 'PATH',,
-        Opt.!GCCPath.!path';'Opt.!ILINKPath.!path';'Opt.!GNUMAKEPath.!path
-    call ConfigureCompiler_GenAddPathEnv 'BEGINLIBPATH',,
-        Opt.!GCCPath.!libpath';'Opt.!ILINKPath.!libpath';'Opt.!GNUMAKEPath.!libpath
+    if Opt.!UseWlink = 0 then do
+        call ConfigureCompiler_GenAddPathEnv 'PATH',,
+            Opt.!GCCPath.!path';'Opt.!ILINKPath.!path';'Opt.!GNUMAKEPath.!path
+        call ConfigureCompiler_GenAddPathEnv 'BEGINLIBPATH',,
+            Opt.!GCCPath.!libpath';'Opt.!ILINKPath.!libpath';'Opt.!GNUMAKEPath.!libpath
+    end
+    else do
+        call ConfigureCompiler_GenAddPathEnv 'PATH',,
+            Opt.!GCCPath.!path';'Opt.!GNUMAKEPath.!path
+        call ConfigureCompiler_GenAddPathEnv 'BEGINLIBPATH',,
+            Opt.!GCCPath.!libpath';'Opt.!GNUMAKEPath.!libpath
+    end
+
     call lineout G.!QtCmd, ''
     call lineout G.!QtCmd, '/*'
Index: /trunk/mkspecs/os2-g++/qmake.conf
===================================================================
--- /trunk/mkspecs/os2-g++/qmake.conf	(revision 200)
+++ /trunk/mkspecs/os2-g++/qmake.conf	(revision 201)
@@ -4,5 +4,5 @@
 # qmake configuration for os2-g++
 #
-# Written for Innotek GCC and IBM ILINK
+# Written for Innotek GCC and IBM ILINK or OpenWatcom WLINK
 #
 # :mode=makefile:tabSize=8:indentSize=4:noTabs=true:
@@ -28,5 +28,5 @@
 
 QMAKE_CC		= gcc
-QMAKE_CFLAGS		= -Zomf
+QMAKE_CFLAGS		= -Zomf -march=i486 -mcpu=i686
 QMAKE_CFLAGS_WARN_ON	= -Wall
 QMAKE_CFLAGS_WARN_OFF	= -w
@@ -101,6 +101,13 @@
 
 QMAKE_LINK		= g++
-QMAKE_LFLAGS		= -Zomf -Zstack 0x2000 -Zmap
-QMAKE_LFLAGS_RELEASE	= -s -Zlinker /EXEPACK:2
+QMAKE_LINKER_TYPE	= $$(EMXOMFLD_TYPE)
+contains(QMAKE_LINKER_TYPE, WLINK) {
+    CONFIG             *= exepack
+    QMAKE_LFLAGS	= -Zomf -Zstack 0x2000 -Zmap -Zlinker "DISABLE 1121"
+    QMAKE_LFLAGS_RELEASE = -s
+} else {
+    QMAKE_LFLAGS	= -Zomf -Zstack 0x2000 -Zmap
+    QMAKE_LFLAGS_RELEASE = -s -Zlinker /EXEPACK:2
+}
 QMAKE_LFLAGS_DEBUG	=
 QMAKE_LFLAGS_CONSOLE	= -Zlinker /PM:VIO
@@ -125,5 +132,8 @@
 
 QMAKE_RUN_LINK          = $(LINK) $(LFLAGS) -o $(TARGET) $(DEF_FILE) @$$qmake_objects.target $(LIBS)
-QMAKE_RUN_IMPLIB        = emximp -p 64 -o $(basename $(TARGET)).lib $(DEF_FILE)
+QMAKE_RUN_IMPLIB        = emximp -p128 -o $(basename $(TARGET)).lib $(DEF_FILE)
+QMAKE_RUN_EXEPACK       = lxlite /B- $(TARGET)
+
+exepack:QMAKE_POST_LINK = $(if $(findstring QT_NO_DEBUG, $(CFLAGS)), $$QMAKE_RUN_EXEPACK)
 
 QMAKE_RUN_GENDEF        = \
@@ -147,5 +157,5 @@
 QMAKE_LIBS_QT_ENTRY     =
 
-QMAKE_LIB		= emxomfar r
+QMAKE_LIB		= emxomfar -p128 r
 QMAKE_RUN_LIB           = $(LIB) $(TARGET) $(OBJECTS) $(OBJMOC)
 
Index: /trunk/qmake/Makefile.os2-g++
===================================================================
--- /trunk/qmake/Makefile.os2-g++	(revision 200)
+++ /trunk/qmake/Makefile.os2-g++	(revision 201)
@@ -3,12 +3,19 @@
 #
 CXX	    =	g++
-CFLAGS	    =	-c -o$@ -O -s -Zomf \
+CFLAGS	    =	-c -o$@ -O -s -Zomf -march=i486 -mcpu=i686 \
 		-I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\os2 -Igenerators\mac -I..\include -I..\src\tools \
 		-I..\mkspecs\os2-g++ \
 		-DQT_NO_TEXTCODEC -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP
 CXXFLAGS    =   $(CFLAGS)
-LFLAGS	    =   -s -Zomf -Zstack 0x2000 -Zlinker /PM:VIO -Zlinker /EXEPACK:2
+LFLAGS      =   -s -Zomf -Zstack 0x2000 -Zlinker /PM:VIO
+
+ifeq ($(EMXOMFLD_TYPE),WLINK)
+    EXEPACK = && lxlite /B- qmake.exe
+else
+    LFLAGS += -Zlinker /EXEPACK:2
+endif
+
 LIBS	    =   -lregistry.dll
-LINKQMAKE   =	g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
+LINKQMAKE   =	g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) $(EXEPACK)
 ADDCLEAN    =
 
Index: /trunk/qmake/generators/os2/gnumake.cpp
===================================================================
--- /trunk/qmake/generators/os2/gnumake.cpp	(revision 200)
+++ /trunk/qmake/generators/os2/gnumake.cpp	(revision 201)
@@ -253,4 +253,6 @@
         if ( !project->isEmpty( "RES_FILE" ) && !project->isEmpty( "QMAKE_RUN_RC_EXE" ) )
             t << "\n\t" << var("QMAKE_RUN_RC_EXE");
+        if ( !project->variables()["QMAKE_POST_LINK"].isEmpty() )
+            t << "\n\t" << var( "QMAKE_POST_LINK" );
         if ( project->isActiveConfig("dll") && !project->isEmpty( "QMAKE_RUN_IMPLIB" ) )
             t << "\n\t" << var( "QMAKE_RUN_IMPLIB" );
