Hi,

On 7/10/11, Jim Hall <[email protected]> wrote:
>
>>> I already looked at this. libzip requires 'configure' as the first
>>> step to build it, which assumes a Unix-like environment. To build on
>>> DOS using OpenWatcom requires reverse-engineering their Makefiles and
>>> configuration options.

Well, I (wrongly / blindly) assumed that
"OW19/contrib/libzip/wlib/makefile" would build (oops, apparently
not). Oddly enough, the makefile uses LFNs but for some reason the .c
files themselves are SFN! (zip_add.c vs. zadd.c) And yes, OW 1.9
*does* ship their DOS-based installer (ZIP .sfx) using libzip (but
only "old" 0.6.1 from 2005). Who knows, cross compile most likely,
though wcc386 for DOS still can't handle LFNs anyways.

>> Actually a big part of EDLIN is the autoconf script, so yes you
>> can easily use that and configure on DOS,

BTW, I've done so once or twice!   ;-)

> but of course it does
>> feel a bit like a waste of space given that DOS systems do not
>> differ that much from each other,

Well, not all DJGPP installs are the same (2.03p2? 2.04? extra stuff
installed? all latest versions? enough POSIX utils (fil + txt + shl =
core)? buggy Bash? additional libs needed?).

But of course I agree, it's not reasonable to expect a full POSIX suite on DOS.

>> a makefile would be enough and
>> would avoid the need to have various configure tools installed.

I agree completely, more than most, but sadly *nix programmers don't
care about anyone but POSIX. They just would rather drop DOS
completely than bother with a tiny workaround.

>> PS: Maybe Rugxulo can come up with a static DOS libzip makefile.
>
> I'd appreciate the help! Rugxulo, if you could craft an OpenWatcom &
> WMAKE makefile that compiles a status libzip.lib (using -ml) then that
> would be a big step forward.

Well, as mentioned in private mail, I did build it for "large" model
(16-bit), but the examples (zipcmp, zipmerge) didn't work correctly.
It may be a (very tiny) stack (default size) issue, who knows. I
suspect it's just that the authors never intended anything but 32-bit
machines to ever use it. Anyways, it *does* work with 32-bit OW19
builds, thankfully, so you *could* use that if interested.

Here's a rough .BAT that shows what I've done (again), just in case
anybody wants to try it themselves for whatever reason. (Don't feel
obligated, of course, I'm just offering it anyways "just in case!" I
know it's far from crucial.)

P.S. ow19-libzip.zip is just a verbatim (but very tiny, specific,
partial) excerpt from OW19's stock sources.

https://sites.google.com/site/rugxulo/ow19-libzip.zip?attredirects=0&d=1

http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/file/7zip/9.13/
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/c/openwatcom/1.9/
http://www.zlib.net/

@echo off
REM Apologies for LFNs, tested on WinXP. But you get the idea ...

cd \tmp
dir

::  open-watcom-c-dos-1.9.7z
::  ow19-libzip.zip
::  zlib-1.2.5.tar.gz

cd \
p7zip x tmp/open-watcom-c-dos-1.9.7z
call watcom19\owsetenv.bat
cd \tmp
pause

p7zip x ow19-libzip.zip
cd ow19\contrib
p7zip x ../../zlib-1.2.5.tar.gz
p7zip x zlib-1.2.5.tar
del zlib-1.2.5.tar
ren zlib-1.2.5 zlib
cd zlib
set DOS4G=quiet
wmake -f watcom\watcom_f.mak
ren zlib_f.lib zlib.lib
pause

REM WinXP crashes the NTVDM CMD shell here, so I have to manually reopen (sigh)
REM
REM cmd.exe
REM \watcom19\owsetenv.bat
REM cd\tmp\ow19\contrib\zlib

cd ..\libzip\lib
set DOS4G=quiet
for %%a in (*.c) do wcc386 -zq -wx -oaxt -I..\..\zlib %%a
dir /b *.obj > libzip.txt
wlib -q libzip.lib @libzip.txt
cd ..\src
ren *.c *.c~
:: yes, these should all be smaller than 126 bytes, I'm using DOS-hosted OW19 !!
sed -e "/config\.h/s/^/\/\//" -e "s/\(#define\) PROG.*/&\n\1 PACKAGE
\x22\x22\n\1 VERSION\x22\x22/" zipcmp.c~ >zipcmp.c
sed -e "/config\.h/s/^/\/\//" -e "s/\(#define\) PROG.*/&\n\1 PACKAGE
\x22\x22\n\1 VERSION\x22\x22/" zipmerge.c~ >zipmerge.c
for %%a in (*.c) do wcl386 /bt=dos /l=causeway /oaxt /wx /zq %%a
/I..\..\zlib -I..\lib ..\lib\libzip.lib ..\..\zlib\zlib.lib
:: upx --best --lzma zipcmp.exe zipmerge.exe
pause

:: copy /b z:\befi-wip\old\befi_*.old *.zip
:: for %%a in (2z 3a) do lgzsp befi_%%a.zip
:: zipcmp befi_2z.zip befi_3a.zip

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to