Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems building unzip 6.10b

21 views
Skip to first unread message

Lewis Rosenthal

unread,
Jun 1, 2013, 2:07:55 PM6/1/13
to
Hi, guys...

Prompted by Dave's mention in eCS-Technical (see
http://tech.groups.yahoo.com/group/eCS-Technical/message/17592 et seq)
and by http://mantis.smedley.id.au/view.php?id=549 , I decided to try to
give building the latest Unzip a shot...

I'm not making much headway. If I set aside all of the options I'd like
to add, and from bash, just run:

[Apollo|J:/devel/unzip610b]make -f os2/makefile.os2 gcc
make -f os2/makefile.os2 all \
CC="gcc -Zomf -O -I." \
CFLAGS="-Wall -DOS2 -DASM_CRC " \
NFLAGS="" \
DLLFLAG="" \
AS="gcc -Zomf" \
ASFLAGS="-Di386" \
LDFLAGS="-o ./" \
LDFLAGS2="-Zsmall-conv -Zstack 320 -Zsys -s" \
OUT="-o" \
OBJ=".obj" \
CRCA_O="crc_gcc.obj" \
DEF="os2/unzip.def"
make.exe[1]: Entering directory `J:/devel/unzip610b'
gcc -Zomf -O -I. -c -Wall -DOS2 -DASM_CRC unzip.c
In file included from unzpriv.h:637,
from unzip.h:734,
from unzip.c:69:
/@unixroot/usr/include/ctype.h:42: error: expected declaration
specifiers or '..
.' before '(' token
/@unixroot/usr/include/ctype.h:45: error: expected declaration
specifiers or '..
.' before '(' token
make.exe[1]: *** [unzip.obj] Error 1
make.exe[1]: Leaving directory `J:/devel/unzip610b'
make: *** [gcc] Error 2

The INSTALL file specifically states that for OS/2, makefile.os2 should
remain in the os2 directory and be called with -f as I have above.

I've actually had some recent successes in building things with gcc
4.4.6, so I think that my build system is relatively intact.

I understand (I think) that the "expected declaration" errors shown are
displayed as a result of -Wall, but looking at ctype.h, I don't
understand what's so different about those two particular lines than the
rest:

[32] __BEGIN_DECLS
[33] int isalnum(int);
[34] int isalpha(int);
[35] int iscntrl(int);
[36] int isdigit(int);
[37] int isgraph(int);
[38] int islower(int);
[39] int isprint(int);
[40] int ispunct(int);
[41] int isspace(int);
[42] int isupper(int);
[43] int isxdigit(int);
[44] int toupper(int);
[45] int tolower(int);

So, what's it complaining about? Am I missing a locale specifier somewhere?

TIA

--
Lewis
-------------------------------------------------------------
Lewis G Rosenthal, CNA, CLP, CLE, CWTS
Rosenthal & Rosenthal, LLC www.2rosenthals.com
Need a managed Wi-Fi hotspot? www.hautspot.com
visit my IT blog www.2rosenthals.net/wordpress
-------------------------------------------------------------

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Dave Yeo

unread,
Jun 1, 2013, 3:07:57 PM6/1/13
to
Lewis Rosenthal wrote:
> Hi, guys...
>
> Prompted by Dave's mention in eCS-Technical (see
> http://tech.groups.yahoo.com/group/eCS-Technical/message/17592 et seq)
> and by http://mantis.smedley.id.au/view.php?id=549 , I decided to try to
> give building the latest Unzip a shot...
>
> I'm not making much headway. If I set aside all of the options I'd like
> to add, and from bash, just run:
>
> [Apollo|J:/devel/unzip610b]make -f os2/makefile.os2 gcc
> make -f os2/makefile.os2 all \
> CC="gcc -Zomf -O -I." \
> CFLAGS="-Wall -DOS2 -DASM_CRC " \
> NFLAGS="" \
> DLLFLAG="" \
> AS="gcc -Zomf" \
> ASFLAGS="-Di386" \
> LDFLAGS="-o ./" \
> LDFLAGS2="-Zsmall-conv -Zstack 320 -Zsys -s" \

This stack declaration is way to small and possibly what is causing the
crash. The default of 1MB is probably sufficient. Actually just comment
out the whole line as the rest is for EMX except -s, you can strip it
with lxlite later.


> OUT="-o" \
> OBJ=".obj" \
> CRCA_O="crc_gcc.obj" \
> DEF="os2/unzip.def"
> make.exe[1]: Entering directory `J:/devel/unzip610b'
> gcc -Zomf -O -I. -c -Wall -DOS2 -DASM_CRC unzip.c
> In file included from unzpriv.h:637,
> from unzip.h:734,
> from unzip.c:69:
> /@unixroot/usr/include/ctype.h:42: error: expected declaration
> specifiers or '..
> .' before '(' token
> /@unixroot/usr/include/ctype.h:45: error: expected declaration
> specifiers or '..
> .' before '(' token
> make.exe[1]: *** [unzip.obj] Error 1
[...]

>
> So, what's it complaining about? Am I missing a locale specifier somewhere?

It's probably a totally unrelated error. Try commenting out the #include
<ctype.h> line to see if you get a more meaningful error or add -E to
the CFLAGS to get the preprocessor output and examine unzip.o (or unzip.obj)
Dave

Andy

unread,
Jun 1, 2013, 7:30:39 PM6/1/13
to
On Sat, 1 Jun 2013 18:07:55 UTC, Lewis Rosenthal
<lgros...@2-de-sp-am-2rosenthals.com> wrote:

<snip>
> make.exe[1]: Entering directory `J:/devel/unzip610b'
> gcc -Zomf -O -I. -c -Wall -DOS2 -DASM_CRC unzip.c
> In file included from unzpriv.h:637,
> from unzip.h:734,
> from unzip.c:69:
> /@unixroot/usr/include/ctype.h:42: error: expected declaration
> specifiers or '..
> .' before '(' token
> /@unixroot/usr/include/ctype.h:45: error: expected declaration
> specifiers or '..
> .' before '(' token
> make.exe[1]: *** [unzip.obj] Error 1
> make.exe[1]: Leaving directory `J:/devel/unzip610b'
> make: *** [gcc] Error 2
>
<snip>
I just reproduced it with my environment I use for building Mozilla.
I also decided to try OpenWatcom and it gave slightly different error
about expecing a ) and finding a ( but also in ctype.h but I haven't
found anything else so far.
Andy
--

Lewis Rosenthal

unread,
Jun 1, 2013, 10:12:42 PM6/1/13
to
On 06/01/13 07:30 pm, Andy thus wrote :
Thanks, guys. I'll give this another go this evening. I'm glad I'm not
the only one seeing weirdness, here, at least.

Lewis Rosenthal

unread,
Jun 1, 2013, 10:41:48 PM6/1/13
to
On 06/01/13 10:12 pm, Lewis Rosenthal thus wrote :
Ugh...

After hacking a little bit, (following Dave's advice, I removed the:

LDFLAGS2="-Zsmall-conv -Zstack 320 -Zsys -s" \

line completely, but there's still something which is passing these
params, as I keep bumping into stuff mentioning that string.

Further, I get a mess of stuff happening in os2acls.c (which is included
from os2.c, and deals with handling LAN Server ACLs). My head's not in
it, at least not until I pull 6.0 and give that a go to try to determine
whether there's just something with 6.10 which is causing the confusion.

Thanks again for the help, and for confirming that I'm not alone in what
I'm seeing. ;-)

Dave Yeo

unread,
Jun 1, 2013, 11:10:28 PM6/1/13
to
Probably missing a locale, os2cfg.h redefines toupper and tolower
anyways so just wrap the #include <ctype.h> with #ifndef __EMX__ #endif.
I also did,
--- makefile.os2.orig 2013-06-01 19:55:04.000000000 -0700
+++ makefile.os2 2013-06-01 19:56:16.000000000 -0700
@@ -394,9 +394,9 @@
AS="gcc -Zomf" \
ASFLAGS="-Di386" \
LDFLAGS="-o ./" \
- LDFLAGS2="-Zsmall-conv -Zstack 320 -Zsys -s" \
+ LDFLAGS2="-s" \
OUT="-o" \
- OBJ=".obj" \
+ OBJ=".o" \
CRCA_O="crc_gcc.obj" \
DEF="os2/unzip.def"

and

--- os2acl.c.orig 2013-06-01 19:57:08.000000000 -0700
+++ os2acl.c 2013-06-01 19:59:42.000000000 -0700
@@ -71,7 +71,7 @@
typedef ULONG U_INT;
#ifdef __EMX__
#define PSTR16 _far16ptr
-#define PTR16(x) _emx_32to16(x)
+#define PTR16(x) _libc_32to16(x)
#else /* other 32-bit */
#define PSTR16 PCHAR16
#define PTR16(x) ((PCHAR16)(x))
@@ -123,7 +123,7 @@
_THUNK_FLAT (pbBuffer);
_THUNK_SHORT (cbBuffer);
_THUNK_FLAT (pcbTotalAvail);
- _THUNK_CALLI (_emx_32to16(_NetAccessGetInfo)));
+ _THUNK_CALLI (_libc_32to16(_NetAccessGetInfo)));
}

USHORT NetAccessSetInfo(PSZ pszServer, PSZ pszResource, USHORT sLevel,
@@ -137,7 +137,7 @@
_THUNK_FLAT (pbBuffer);
_THUNK_SHORT (cbBuffer);
_THUNK_SHORT (sParmNum);
- _THUNK_CALLI (_emx_32to16(_NetAccessSetInfo)));
+ _THUNK_CALLI (_libc_32to16(_NetAccessSetInfo)));
}

USHORT NetAccessAdd(PSZ pszServer, USHORT sLevel,
@@ -149,7 +149,7 @@
_THUNK_SHORT (sLevel);
_THUNK_FLAT (pbBuffer);
_THUNK_SHORT (cbBuffer);
- _THUNK_CALLI (_emx_32to16(_NetAccessAdd)));
+ _THUNK_CALLI (_libc_32to16(_NetAccessAdd)));
}

#else /* other 32-bit */

Watch line wrap.
This succeeded compiling and quickly testing seems to work. Zip needs
similar patches and there are still warnings. Really the port needs to
be done over including adding bzip2 support, making sure large file
support is working and so on.
Dave


Dave Yeo

unread,
Jun 1, 2013, 11:12:24 PM6/1/13
to
Lewis Rosenthal wrote:
> Thanks again for the help, and for confirming that I'm not alone in what
> I'm seeing.

Of course I replied while you were replying :) See other post for fixes
Dave

Lewis Rosenthal

unread,
Jun 3, 2013, 10:28:11 PM6/3/13
to
On 06/01/13 11:10 pm, Dave Yeo thus wrote :
Wow... Thanks, Dave! I'll giv ethis another shot (so much for getting to
bed early tonight, I see). ;-)

Much appreciated.

Lewis Rosenthal

unread,
Jun 4, 2013, 12:28:53 AM6/4/13
to
On 06/01/13 11:10 pm, Dave Yeo thus wrote :
Okay, so here's my progress:

I was able to build it - once - (thanks again, so much, Dave).

However, after cleaning everything out and starting over, I get (watch
the line breaks - I've added "\" where I saw them):

# make -f os2/makefile.os2 D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
LIBBZ2=bzip2/libbz2.a gcc
make -f os2/makefile.os2 all \
CC="gcc -Zomf -O -I." \
CFLAGS="-Wall -DOS2 -DASM_CRC -DWILD_STOP_AT_DIR -DOS2_EAS \
-DASM_CRC -DUSE_BZIP2 -DBZIP2_SFX -DUNICODE_SUPPORT" \
NFLAGS="" \
DLLFLAG="" \
AS="gcc -Zomf" \
ASFLAGS="-Di386" \
LDFLAGS="-o ./" \
LDFLAGS2="-s" \
OUT="-o" \
OBJ=".o" \
CRCA_O="crc_gcc.obj" \
DEF="os2/unzip.def"
make.exe[1]: Entering directory `J:/devel/unzip610b'
gcc -Zomf -O -I. -c -Wall -DOS2 -DASM_CRC -DWILD_STOP_AT_DIR \ -DOS2_EAS
-DASM_CRC -DUSE_BZIP2 -DBZIP2_SFX -DUNICODE_SUPPORT unzip.c
unzip.c: In function 'get_shortopt':
unzip.c:3986: warning: implicit declaration of function 'isdigit'
gcc -Zomf -O -I. -c -Wall -DOS2 -DASM_CRC -DWILD_STOP_AT_DIR \ -DOS2_EAS
-DASM_CRC -DUSE_BZIP2 -DBZIP2_SFX -DUNICODE_SUPPORT crc32.c
make.exe[1]: *** No rule to make target `crc_gcc.obj', needed by \
`unzip.exe'. Stop.
make.exe[1]: Leaving directory `J:/devel/unzip610b'
make: *** [gcc] Error 2

I'm not sure how I got it to work before, but it's possible that
crc_gcc.obj was generated before I applied your changes, and it was a
leftover.

Sorry to be such a pain (and a newbie). Thanks again for all of the help
and guidance.

Cheers/2

Dave Yeo

unread,
Jun 4, 2013, 2:28:55 AM6/4/13
to
Lewis Rosenthal wrote:
> make.exe[1]: *** No rule to make target `crc_gcc.obj', needed by \
> `unzip.exe'. Stop.
> make.exe[1]: Leaving directory `J:/devel/unzip610b'
> make: *** [gcc] Error 2
>
> I'm not sure how I got it to work before, but it's possible that
> crc_gcc.obj was generated before I applied your changes, and it was a
> leftover.
>
> Sorry to be such a pain (and a newbie). Thanks again for all of the help
> and guidance.

Your missing
- OBJ=".obj" \
+ OBJ=".o" \

somewhere in the make file.
Under EMX, -Zomf under CFLAGS caused the default suffix to be .obj which
is standard for OS/2 etc whereas under kLIBC the default is .o
I'll try your command line
Dave

Dave Yeo

unread,
Jun 4, 2013, 2:34:55 AM6/4/13
to
Lewis Rosenthal wrote:
> I was able to build it - once - (thanks again, so much, Dave).
>
> However, after cleaning everything out and starting over, I get (watch
> the line breaks - I've added "\" where I saw them):
>
> # make -f os2/makefile.os2 D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
> LIBBZ2=bzip2/libbz2.a gcc
> make -f os2/makefile.os2 all

Sorry, missed this. Probably should be make -f os2/makefile.os2 gcc ...
Dave

Dave Yeo

unread,
Jun 4, 2013, 2:50:21 AM6/4/13
to
Using your command line except I used bz2_s.a instead of libbz2.a to
build static seemed to have worked fine here. Bedtime so all I did was
test that it didn't crash. For distributing a static linked bz2 seems
better
Dave

Andy

unread,
Jun 4, 2013, 1:14:54 PM6/4/13
to
On Sun, 2 Jun 2013 03:10:28 UTC, Dave Yeo <dave....@gmail.com>
wrote:

<snip>
> Probably missing a locale, os2cfg.h redefines toupper and tolower
> anyways so just wrap the #include <ctype.h> with #ifndef __EMX__ #endif.
I ended up including ctype.h in the os2cfg.h file so that both Watcom
and GCC were happy.
Andy

Lewis Rosenthal

unread,
Jun 4, 2013, 1:21:00 PM6/4/13
to
On 06/04/13 02:50 am, Dave Yeo thus wrote :
I agree, and a static build is what I'm looking to do.

So, then, just so that I can follow this, how would I know that bz2_s.a
is the static lib? I thought that all I needed to do was state that I
wanted to statically link libbz2.a.

Insofar as missing that .obj -> .o change... I've got:

# emx, gcc, OMF format, statically linked C runtime
gcc:
$(MAKE) -f os2/makefile.os2 all \
CC="gcc -Zomf -O -I." \
CFLAGS="-Wall -DOS2 -DASM_CRC $(LOCAL_UNZIP)" \
NFLAGS="" \
DLLFLAG="" \
AS="gcc -Zomf" \
ASFLAGS="-Di386" \
LDFLAGS="-o ./" \
LDFLAGS2="-s" \
OUT="-o" \
OBJ=".o" \
CRCA_O="crc_gcc.obj" \
DEF="os2/unzip.def"

and I am specifying gcc as the target. Is it the CRCA_O="crc_gcc.obj"
which is causing a conflict and I need to change that to crc_gcc.o?
Ugh... Never mind; that was it (forest & trees issue).

Getting back to the bz2_s.a thing: Cold you please enlighten me as to
where you got that? My understanding was that all I needed to do WRT
bzip2 was to "dump" the sources into bzip2\ and specify the option and
modify the make line, referencing the library. Clearly, I'm missing
something else.

Thanks again, Dave!!

Lewis Rosenthal

unread,
Jun 4, 2013, 1:23:36 PM6/4/13
to
On 06/04/13 01:14 pm, Andy thus wrote :
So you got it building? If you set UNZIPOPT=-C, does it complain?

Andy

unread,
Jun 4, 2013, 4:50:11 PM6/4/13
to
On Tue, 4 Jun 2013 17:23:36 UTC, Lewis Rosenthal
<lgros...@2-de-sp-am-2rosenthals.com> wrote:

> On 06/04/13 01:14 pm, Andy thus wrote :
> > On Sun, 2 Jun 2013 03:10:28 UTC, Dave Yeo <dave....@gmail.com>
> > wrote:
> >
> > <snip>
> >> Probably missing a locale, os2cfg.h redefines toupper and tolower
> >> anyways so just wrap the #include <ctype.h> with #ifndef __EMX__ #endif.
> > I ended up including ctype.h in the os2cfg.h file so that both Watcom
> > and GCC were happy.
> >
> So you got it building? If you set UNZIPOPT=-C, does it complain?
>

Yes, but I think I already had it set... by clearing it then it no
longer complains.
Andy
--

Lewis Rosenthal

unread,
Jun 4, 2013, 5:12:05 PM6/4/13
to
On 06/04/13 04:50 pm, Andy thus wrote :
Carrying on two discussions about the same thing... ;-)

Indeed, if you don't then tell it to ignore case, it doesn't complain,
but I don't know whether it has any idea of case-sensitivity or not.

I'm going to ask Yuri for his diff. I feel like I'm asking for the
answers to last week's crossword, but this is driving me nuts!

Dave Yeo

unread,
Jun 4, 2013, 10:33:04 PM6/4/13
to
Lewis Rosenthal wrote:
> Getting back to the bz2_s.a thing: Cold you please enlighten me as to
> where you got that? My understanding was that all I needed to do WRT
> bzip2 was to "dump" the sources into bzip2\ and specify the option and
> modify the make line, referencing the library. Clearly, I'm missing
> something else.
>
> Thanks again, Dave!!

I built it sometime ago and just copied the file to bzip2\ from lib.
Basic library stuff on OS/2. .a suffix can be either static or import
library, usually aout with .lib being OMF. _s.a is used for static and
_dll.a for import library with lib once again used for OMF. The linker
is smart enough usually to convert aout to OMF using emxomf if there is
a mismatch, you can't go the other way. Some versions of libtool such as
the default ones will only create one or another, other ports will
create both static and import with the different suffixes or somewhere
in between.
The linker prefers lib as the prefix but the library doesn't need it,
this is for 8.3 name compatibility.
If you just dumped the sources in bzip2/, it probably built a static
lib. Static lib is just basically all the objects files concated
together with a table of contents.
Yuri's patches etc should be in
http://rpm.netlabs.org/release/00/i386/SRPMS/unzip-6.0-5.oc00.src.rpm
http://rpm.netlabs.org/release/00/i386/SRPMS/zip-3.0-5.oc00.src.rpm
Dave

Lewis Rosenthal

unread,
Jun 5, 2013, 1:18:54 AM6/5/13
to
On 06/04/13 10:33 pm, Dave Yeo thus wrote :
Ugh... I mirror the whole d-mn repo; now why didn't I see that? I'll
close my ticket. Thanks for pointing that out!!!!

Thanks for the great explanation of this stuff, too. My looking glass is
getting clearer by the minute!

Cheers/2
0 new messages