[apinames] Anonymous version map for GNU linker.

* src/tools/apinames.c (PROGRAM_VERSION): Set to 0.3.
(OutputFormat): Add `OUTPUT_GNU_VERMAP'.
(names_dump): Handle it.
(usage): Updated.
(main): Handle new command line flag `-wL'.
This commit is contained in:
Alexei Podtelezhnikov 2018-01-23 22:29:45 -05:00
parent c6a965b4d3
commit b1e0209829
2 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2018-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
[apinames] Anonymous version map for GNU linker.
* src/tools/apinames.c (PROGRAM_VERSION): Set to 0.3.
(OutputFormat): Add `OUTPUT_GNU_VERMAP'.
(names_dump): Handle it.
(usage): Updated.
(main): Handle new command line flag `-wL'.
2018-01-21 Alexei Podtelezhnikov <apodtele@gmail.com>
[unix] Call libtool to clean up.

View File

@ -22,7 +22,7 @@
#include <ctype.h>
#define PROGRAM_NAME "apinames"
#define PROGRAM_VERSION "0.2"
#define PROGRAM_VERSION "0.3"
#define LINEBUFF_SIZE 1024
@ -32,7 +32,8 @@ typedef enum OutputFormat_
OUTPUT_WINDOWS_DEF, /* output a Windows .DEF file for Visual C++ or Mingw */
OUTPUT_BORLAND_DEF, /* output a Windows .DEF file for Borland C++ */
OUTPUT_WATCOM_LBC, /* output a Watcom Linker Command File */
OUTPUT_NETWARE_IMP /* output a NetWare ImportFile */
OUTPUT_NETWARE_IMP, /* output a NetWare ImportFile */
OUTPUT_GNU_VERMAP /* output a version map for GNU or Solaris linker */
} OutputFormat;
@ -198,6 +199,15 @@ names_dump( FILE* out,
}
break;
case OUTPUT_GNU_VERMAP:
{
fprintf( out, "{\n\tglobal:\n" );
for ( nn = 0; nn < num_names; nn++ )
fprintf( out, "\t\t%s;\n", the_names[nn].name );
fprintf( out, "\tlocal:\n\t\t*;\n};\n" );
}
break;
default: /* LIST */
for ( nn = 0; nn < num_names; nn++ )
fprintf( out, "%s\n", the_names[nn].name );
@ -323,6 +333,7 @@ usage( void )
" -wB : output .DEF file for Borland C++\n"
" -wW : output Watcom Linker Response File\n"
" -wN : output NetWare Import File\n"
" -wL : output version map for GNU or Solaris linker\n"
"\n";
fprintf( stderr,
@ -410,6 +421,10 @@ int main( int argc, const char* const* argv )
format = OUTPUT_NETWARE_IMP;
break;
case 'L':
format = OUTPUT_GNU_VERMAP;
break;
case 0:
break;