2011-06-04  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* src/makefile.dj2: New prefix variable to install products in a
	different place.


2011-06-03  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* src/include/vesa.h: Remove packed attribute from char fields
	in structs.


2011-06-02  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* makedefs.grx: Fontpath set to /dev/env/DJDIR/lib/fonts/grx.




diff -aprNU5 mgrx100.orig/makedefs.grx mgrx100/makedefs.grx
--- mgrx100.orig/makedefs.grx	2008-09-06 22:23:18 +0000
+++ mgrx100/makedefs.grx	2011-06-04 20:04:46 +0000
@@ -37,14 +37,14 @@ LINUX_i386_CONSOLE    = $(SYSTEM_TAG_PRE
 LINUX_i386_X11        = $(SYSTEM_TAG_PREFIX).002
 DOS_DJGPP_V2          = $(SYSTEM_TAG_PREFIX).004
 WIN32_GCC_i386_STATIC = $(SYSTEM_TAG_PREFIX).006
 
 ifdef DEBUG
-CCOPT = -O1 -Wall -g -DDEBUG=$(DEBUG)
+CCOPT = -O2 -Wall -g -DDEBUG=$(DEBUG)
 LDOPT = -g
 else
-CCOPT = -O1 -Wall
+CCOPT = -O2 -Wall
 LDOPT =
 endif
 
 ifdef PROFILE
 CCOPT += -pg
@@ -141,11 +141,11 @@ ifdef GRXVDJ2
 
 # Put libmgrx.a to lib/dj2
 GRX_LIB_SUBDIR=dj2
 
 # Set the default GRX font path
-#MGRX_DEFAULT_FONT_PATH=c:/grxfonts
+MGRX_DEFAULT_FONT_PATH=/dev/env/DJDIR/lib/fonts/grx
 
 endif
 
 ### WIN32 MINGW SPECIFIC #############################################
 
diff -aprNU5 mgrx100.orig/src/include/vesa.h mgrx100/src/include/vesa.h
--- mgrx100.orig/src/include/vesa.h	2006-02-12 22:09:38 +0000
+++ mgrx100/src/include/vesa.h	2011-06-04 20:04:46 +0000
@@ -57,11 +57,11 @@
 
 /*
  * The VGA info structure (without padding)
  */
 typedef PACKTYPEMOD struct {
-    char        VESAsignature[4]  PACK;     /* should be "VESA" */
+    char        VESAsignature[4]      ;     /* should be "VESA" */
     short       VESAversion       PACK;     /* VESA version number */
     char   *OEMstringPtr      PACK;     /* Pointer to OEM string */
     long        Capabilities      PACK;     /* capabilities of the video env */
     short  *VideoModePtr      PACK;     /* ptr to supported Super VGA modes */
     /* ==== VESA 1.2 and later ==== */
@@ -84,40 +84,40 @@ typedef PACKTYPEMOD struct {
 /*
  * The mode information structure (without padding)
  */
 typedef PACKTYPEMOD struct {
     short       ModeAttributes    PACK;     /* mode attributes */
-    char        WinAAttributes    PACK;     /* Window A attributes */
-    char        WinBAttributes    PACK;     /* Window B attributes */
+    char        WinAAttributes        ;     /* Window A attributes */
+    char        WinBAttributes        ;     /* Window B attributes */
     short       WinGranularity    PACK;     /* window granularity */
     short       WinSize           PACK;     /* window size */
     short       WinASegment       PACK;     /* Window A start segment */
     short       WinBSegment       PACK;     /* Window B start segment */
     void      (*WinFuncPtr)()     PACK;     /* pointer to window function */
     short       BytesPerScanLine  PACK;     /* bytes per scan line */
     /* ==== extended and optional information ==== */
     short       XResolution       PACK;     /* horizontal resolution */
     short       YResolution       PACK;     /* vertical resolution */
-    char        XCharSize         PACK;     /* character cell width */
-    char        YCharSize         PACK;     /* character cell height */
-    char        NumberOfPlanes    PACK;     /* number of memory planes */
-    char        BitsPerPixel      PACK;     /* bits per pixel */
-    char        NumberOfBanks     PACK;     /* number of banks */
-    char        MemoryModel       PACK;     /* memory model type */
-    char        BankSize          PACK;     /* bank size in K */
-    char        NumImagePages     PACK;     /* number of image pages */
-    char        reserved[1]       PACK;
+    char        XCharSize             ;     /* character cell width */
+    char        YCharSize             ;     /* character cell height */
+    char        NumberOfPlanes        ;     /* number of memory planes */
+    char        BitsPerPixel          ;     /* bits per pixel */
+    char        NumberOfBanks         ;     /* number of banks */
+    char        MemoryModel           ;     /* memory model type */
+    char        BankSize              ;     /* bank size in K */
+    char        NumImagePages         ;     /* number of image pages */
+    char        reserved[1]           ;
     /* ==== VESA 1.2 and later ==== */
-    char        RedMaskSize       PACK;     /* number of bits in red mask */
-    char        RedMaskPos        PACK;     /* starting bit for red mask */
-    char        GreenMaskSize     PACK;
-    char        GreenMaskPos      PACK;
-    char        BlueMaskSize      PACK;
-    char        BlueMaskPos       PACK;
-    char        ReservedMaskSize  PACK;     /* reserved bits in pixel */
-    char        ReservedMaskPos   PACK;
-    char        DirectScreenMode  PACK;
+    char        RedMaskSize           ;     /* number of bits in red mask */
+    char        RedMaskPos            ;     /* starting bit for red mask */
+    char        GreenMaskSize         ;
+    char        GreenMaskPos          ;
+    char        BlueMaskSize          ;
+    char        BlueMaskPos           ;
+    char        ReservedMaskSize      ;     /* reserved bits in pixel */
+    char        ReservedMaskPos       ;
+    char        DirectScreenMode      ;
     /* ==== VESA 2.0 and later ==== */
     unsigned long LinearFrameBuffer PACK;   /* physical address of linear frame buf */
     unsigned long StartOffScreenMem PACK;   /* physical addr.: start of off screen mem */
     short       OffScreenMemSize  PACK;     /* off screen mem size in kb */
 } VESAmodeInfoBlock;
diff -aprNU5 mgrx100.orig/src/makefile.dj2 mgrx100/src/makefile.dj2
--- mgrx100.orig/src/makefile.dj2	2007-12-12 00:03:56 +0000
+++ mgrx100/src/makefile.dj2	2011-06-04 23:44:42 +0000
@@ -19,10 +19,15 @@ TAG = $(DOS_DJGPP_V2)
 
 MGRXln    = libmgrx.a
 MGRXST    = ../lib/$(GRX_LIB_SUBDIR)/$(MGRXln)
 MGRXSTdos = $(subst /,\,$(MGRXST))
 DJDIRdos  = $(subst /,\,$(DJDIR))
+ifdef prefix
+  DJDIRdos    = $(subst /,\,$(prefix))
+endif
+MKDIR = $(DJDIR)/bin/mkdir.exe
+DJMKDIR = $(subst /,\,$(MKDIR))
 
 OX=.o
 OP=
 
 include ./stdobjs.mak
@@ -113,20 +118,23 @@ clean:
 cleanall: clean
 	if exist $(MGRXSTdos) del $(MGRXSTdos)
 	if exist ..\bin\*.exe del ..\bin\*.exe
 
 install: $(MGRXST)
+	if not exist "$(DJDIRdos)\lib\NUL" $(DJMKDIR) -p "$(DJDIRdos)\lib"
+	if not exist "$(DJDIRdos)\include\NUL" $(DJMKDIR) -p "$(DJDIRdos)\include"
 	copy $(MGRXSTdos) $(DJDIRdos)\lib
 	copy ..\include\mgrx.h $(DJDIRdos)\include
 	copy ..\include\mgrxkeys.h $(DJDIRdos)\include
 
 uninstall:
 	if exist $(DJDIRdos)\lib\$(MGRXln)    del $(DJDIRdos)\lib\$(MGRXln)
 	if exist $(DJDIRdos)\include\mgrx.h   del $(DJDIRdos)\include\mgrx.h
 	if exist $(DJDIRdos)\include\mgrxkeys.h del $(DJDIRdos)\include\mgrxkeys.h
 
 install-bin: $(UTILP)
+	if not exist "$(DJDIRdos)\bin\NUL" $(DJMKDIR) -p "$(DJDIRdos)\bin"
 	copy ..\bin\bin2c.exe $(DJDIRdos)\bin
 	copy ..\bin\fnt2c.exe $(DJDIRdos)\bin
 	copy ..\bin\vesainfo.exe $(DJDIRdos)\bin
 	copy ..\bin\modetest.exe $(DJDIRdos)\bin
 
@@ -135,13 +143,17 @@ uninstall-bin:
 	if exist $(DJDIRdos)\bin\fnt2c.exe del $(DJDIRdos)\bin\fnt2c.exe
 	if exist $(DJDIRdos)\bin\vesainfo.exe del $(DJDIRdos)\bin\vesainfo.exe
 	if exist $(DJDIRdos)\bin\modetest.exe del $(DJDIRdos)\bin\modetest.exe
 
 ifdef MGRX_DEFAULT_FONT_PATH
-FONTPATHdos = $(subst /,\,$(MGRX_DEFAULT_FONT_PATH))
+ifdef prefix
+  FONTPATHdos = $(subst /,\,$(subst /dev/env/DJDIR,$(prefix),$(MGRX_DEFAULT_FONT_PATH)))
+else
+  FONTPATHdos = $(subst /,\,$(MGRX_DEFAULT_FONT_PATH))
+endif
 install-fonts:
-	if not exist $(FONTPATHdos)\nul mkdir $(FONTPATHdos)
+	if not exist "$(FONTPATHdos)\NUL" $(DJMKDIR) -p "$(FONTPATHdos)"
 	copy ..\fonts\*.* $(FONTPATHdos)
 uninstall-fonts:
 	del $(FONTPATHdos)\*.*
 endif
 
