public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* B20.1: small change for dlltool to enhance portability
@ 1999-03-07  9:23 Kai-Uwe Rommel
  1999-03-31 19:45 ` Kai-Uwe Rommel
  0 siblings, 1 reply; 2+ messages in thread
From: Kai-Uwe Rommel @ 1999-03-07  9:23 UTC (permalink / raw)
  To: cygwin

I maintain several packages that are compiled with GNU gcc compilers
for the OS/2 and Win32 platforms. I use emx+gcc for OS/2 and CygWin
and MinGW32 for Win32. One example is the official RCS 5.7 release
for the PC that I maintain.

Some of these packages also contain DLLs (such as RCS, in which I
put the shared code into a rcslib.dll). With the current tools, I
can maintain a maximum of portability of the code between Win32
and OS/2 with only a different header file and Makefiles.

However, I need to use differen .DEF files for building DLLs
because I need to use additional statements in .DEF files for OS/2.
These are part of the Microsoft/IBM defined syntax of .DEF files
but are only meaningful for some linkers (on OS/2, mostly) and
are silently ignored by other linkers.

However, the GNU binary utilities do NOT silently ignore these
additional keywords which forces me to maintain different .DEF
files just because of one single line in them (I do not want
to use sed commands in Makefiles in order to keep build procedures
as simple as possible).

So what I did was adding support for these keywords to the
dlltool's scanner and parser grammars. Since they have no meaning
to CygWin and MinGW32, no other functionality has to be added.
The dlltool utility, with this patch, now silently ignores
the following additional keywords:

a) The DATA statement now can contain the attributes NONSHARED,
   SINGLE and MULTIPLE.

b) The LIBRARY statement now can contain the attributes
   INITINSTANCE, INITGLOBAL, TERMINSTANCE and TERMGLOBAL.

As I said above, they have no meaning and are silently ignored,
just for portability reasons.

I append the small context diff to this message as an attachment.
It is relative to the source code in the B20.1 source code package.
Please add it to future releases.

Kai Uwe Rommel

--
/* Kai Uwe Rommel                   ARS Computer & Consulting GmbH *
 * rommel@ars.de ( http://www.ars.de )             Muenchen, Germany *
 * rommel@leo.org ( http://www.leo.org/pub/comp/os/os2 maintenance) */


(See attached file: dlltool.dif)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* B20.1: small change for dlltool to enhance portability
  1999-03-07  9:23 B20.1: small change for dlltool to enhance portability Kai-Uwe Rommel
@ 1999-03-31 19:45 ` Kai-Uwe Rommel
  0 siblings, 0 replies; 2+ messages in thread
From: Kai-Uwe Rommel @ 1999-03-31 19:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

I maintain several packages that are compiled with GNU gcc compilers
for the OS/2 and Win32 platforms. I use emx+gcc for OS/2 and CygWin
and MinGW32 for Win32. One example is the official RCS 5.7 release
for the PC that I maintain.

Some of these packages also contain DLLs (such as RCS, in which I
put the shared code into a rcslib.dll). With the current tools, I
can maintain a maximum of portability of the code between Win32
and OS/2 with only a different header file and Makefiles.

However, I need to use differen .DEF files for building DLLs
because I need to use additional statements in .DEF files for OS/2.
These are part of the Microsoft/IBM defined syntax of .DEF files
but are only meaningful for some linkers (on OS/2, mostly) and
are silently ignored by other linkers.

However, the GNU binary utilities do NOT silently ignore these
additional keywords which forces me to maintain different .DEF
files just because of one single line in them (I do not want
to use sed commands in Makefiles in order to keep build procedures
as simple as possible).

So what I did was adding support for these keywords to the
dlltool's scanner and parser grammars. Since they have no meaning
to CygWin and MinGW32, no other functionality has to be added.
The dlltool utility, with this patch, now silently ignores
the following additional keywords:

a) The DATA statement now can contain the attributes NONSHARED,
   SINGLE and MULTIPLE.

b) The LIBRARY statement now can contain the attributes
   INITINSTANCE, INITGLOBAL, TERMINSTANCE and TERMGLOBAL.

As I said above, they have no meaning and are silently ignored,
just for portability reasons.

I append the small context diff to this message as an attachment.
It is relative to the source code in the B20.1 source code package.
Please add it to future releases.

Kai Uwe Rommel

--
/* Kai Uwe Rommel                   ARS Computer & Consulting GmbH *
 * rommel@ars.de ( http://www.ars.de )             Muenchen, Germany *
 * rommel@leo.org ( http://www.leo.org/pub/comp/os/os2 maintenance) */


(See attached file: dlltool.dif)

[-- Attachment #2: dlltool.dif --]
[-- Type: text/x-diff, Size: 2419 bytes --]

*** defparse.y~	Tue Oct 27 02:04:10 1998
--- defparse.y	Sun Mar 07 16:07:50 1999
***************
*** 30,36 ****
  
  %token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
  %token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
! %token READ WRITE EXECUTE SHARED NONAME
  %token <id> ID
  %token <number> NUMBER
  %type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
--- 30,37 ----
  
  %token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
  %token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
! %token READ WRITE EXECUTE SHARED NONSHARED NONAME
! %token SINGLE MULTIPLE INITINSTANCE INITGLOBAL TERMINSTANCE TERMGLOBAL
  %token <id> ID
  %token <number> NUMBER
  %type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
***************
*** 45,51 ****
  
  command: 
  		NAME opt_name opt_base { def_name ($2, $3); }
! 	|	LIBRARY opt_name opt_base { def_library ($2, $3); }
  	|	EXPORTS explist 
  	|	DESCRIPTION ID { def_description ($2);}
  	|	STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
--- 46,52 ----
  
  command: 
  		NAME opt_name opt_base { def_name ($2, $3); }
! 	|	LIBRARY opt_name opt_base option_list { def_library ($2, $3); }
  	|	EXPORTS explist 
  	|	DESCRIPTION ID { def_description ($2);}
  	|	STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
***************
*** 112,117 ****
--- 113,121 ----
  	|	WRITE { $$ = 2;}	
  	|	EXECUTE { $$=4;}
  	|	SHARED { $$=8;}
+ 	|	NONSHARED { $$=0;}
+ 	|	SINGLE { $$=0;}
+ 	|	MULTIPLE { $$=0;}
  	;
  
  opt_CONSTANT:
***************
*** 153,157 ****
--- 157,171 ----
  	|	{ $$=-1;}
  	;
  
+ option_list:
+ 	option_list opt_comma option
+ 	| option
+ 	;
  
+ option: 	INITINSTANCE
+ 	|	INITGLOBAL
+ 	|	TERMINSTANCE
+ 	|	TERMGLOBAL
+ 	|
+ 	;
  
*** deflex.l~	Thu Feb 12 22:26:56 1998
--- deflex.l	Sun Mar 07 16:03:13 1999
***************
*** 50,55 ****
--- 50,63 ----
  "WRITE"		{ return WRITE;}
  "EXECUTE"	{ return EXECUTE;}
  "SHARED"	{ return SHARED;}
+ "NONSHARED"	{ return NONSHARED;}
+ "SINGLE"	{ return SINGLE;}
+ "MULTIPLE"	{ return MULTIPLE;}
+ "INITINSTANCE"	{ return INITINSTANCE;}
+ "INITGLOBAL"	{ return INITGLOBAL;}
+ "TERMINSTANCE"	{ return TERMINSTANCE;}
+ "TERMGLOBAL"	{ return TERMGLOBAL;}
+ 
  
  [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0); 
  		return NUMBER; }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-03-31 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-07  9:23 B20.1: small change for dlltool to enhance portability Kai-Uwe Rommel
1999-03-31 19:45 ` Kai-Uwe Rommel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).