delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/06/16/23:45:41

From: Doug Kaufman <dkaufman AT rahul DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Makefile Help
Date: Tue, 17 Jun 2003 03:37:04 +0000 (UTC)
Organization: a2i network
Lines: 103
Message-ID: <bcm2d0$6c6$1@blue.rahul.net>
References: <bck5hq$7df$1 AT bob DOT news DOT rcn DOT net>
NNTP-Posting-Host: violet.rahul.net
X-Trace: blue.rahul.net 1055821024 6534 66.237.72.28 (17 Jun 2003 03:37:04 GMT)
X-Complaints-To: support AT rahul DOT net
NNTP-Posting-Date: Tue, 17 Jun 2003 03:37:04 +0000 (UTC)
User-Agent: nn/6.6.4
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Chris Lee <clee2 AT envirolink DOT org> writes:

>What do you need to do in order to get this makefile to 
>work with DJGPP? 

>I get the feeling I'm overlooking something but can't figure 
>out what it is....


>#
># Makefile for UNIX - unrar
>#
># Note: you have to 'make clean' before you can build
>#	the sfx module
>#

># Linux using GCC
>CXX=g++
>CXXFLAGS=-O2
>DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE

If this is the makefile for unrar 3.50, you need to get rid of the
"-D_LARGEFILE_SOURCE" and change CXX to "gpp". You will also need to
make changes in a few other files. Here is the patch I used to compile,
but the binary hasn't been tested much, so use this as a starting point.

--- filefn.cpp.ori	2003-05-15 01:37:58.000000000 -0700
+++ filefn.cpp	2003-06-16 20:03:28.000000000 -0700
@@ -173,6 +173,7 @@
   return(1457664);
 #elif defined(_EMX)
   int Drive=(!isalpha(FileName[0]) || FileName[1]!=':') ? 0:toupper(FileName[0])-'A'+1;
+#ifndef _DJGPP
   if (_osmode == OS2_MODE)
   {
     FSALLOCATE fsa;
@@ -184,6 +185,7 @@
   }
   else
   {
+#endif /* !_DJGPP */
     union REGS regs,outregs;
     memset(&regs,0,sizeof(regs));
     regs.h.ah=0x36;
@@ -194,7 +196,9 @@
     Int64 FreeSize=outregs.x.ax*outregs.x.cx;
     FreeSize=FreeSize*outregs.x.bx;
     return(FreeSize);
+#ifndef _DJGPP
   }
+#endif /* _DJGPP */
 #else
   #define DISABLEAUTODETECT
   return(1457664);
--- makefile.unix.ori	2003-06-16 19:47:40.000000000 -0700
+++ makefile.unix	2003-06-16 20:08:50.000000000 -0700
@@ -6,9 +6,9 @@
 #
 
 # Linux using GCC
-CXX=g++
-CXXFLAGS=-O2
-DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+CXX=gpp
+CXXFLAGS=-O2 -W -Wall
+DEFINES=-D_FILE_OFFSET_BITS=64
 
 # Linux using LCC
 #CXX=lcc
--- os.hpp.ori	2003-05-15 01:38:00.000000000 -0700
+++ os.hpp	2003-06-16 20:13:20.000000000 -0700
@@ -59,6 +59,7 @@
   #include <errno.h>
   #ifdef _DJGPP
     #include <utime.h>
+    #define _int86 int86
   #else
     #include <os2.h>
     #include <sys/utime.h>
--- pathfn.cpp.ori	2003-05-15 01:37:58.000000000 -0700
+++ pathfn.cpp	2003-06-16 20:05:24.000000000 -0700
@@ -290,6 +290,7 @@
     strcpy(RARFileName,FullName);
     return;
   }
+#ifndef _DJGPP
   if (_osmode==OS2_MODE)
   {
     PTIB ptib;
@@ -298,6 +299,7 @@
     DosQueryModuleName(ppib->pib_hmte,NM,FullName);
   }
   else
+#endif /* _DJGPP */
     strcpy(FullName,RARFileName);
   strcpy(PointToName(FullName),Name);
 #elif defined(_UNIX)



-- 
Doug Kaufman
Internet: dkaufman AT rahul DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019