One of the problems that we have had on NetWare with the AWK script
that creates the API export list, is that it usually exports too much. 
In other words, there are some APIs which at times are defined as real
functions and other times are defined as macros depending on compile
time #ifdef's.  The AWK scripts do not have the ability to include or
exclude functions based on #ifdef's, so it just exports everything (see
#define DOXYGEN in the headers).  The problem that NetWare runs into is
that if the export list contains a function name that was really defined
as a macro, the linker chokes.  So basically the proposal is to run the
AWK scripts against a preprocessed header file rather than against the
original header files.
    The implementation of this is a little messy on NetWare, but should
work much better for platforms that use make files rather than project
files for building.  The process is as follows:

1) Create a simple exports.inc header file that contains nothing more
than #include statements for each standard HTTPD or APR/APU header.  

2) Preprocess the exports.inc header file using the platforms preferred
compiler with all of the compile time #define's declared.  

3) The previous step will produce a preprocessed version of all of the
HTTPD or APR header files that only includes the appropriate function
prototypes.  This preprocessed file can then be feed to MAKE_EXPORTS.AWK
script to produce a true export list for the platform.

I have attached the HTTPD and APR/APU versions for the exports.inc
header file.  The only tricky part is that the macros used in the
prototypes must be #undef'ed or redefined so that the untouched
prototype falls through to the preprocessed result file.  This enables
the AWK script to pick out the real prototypes in the same manner as it
always has.

Ideas, suggestions, comments are appreciated

thanks,
Brad

Attachment: nw_export_APR.inc
Description: Binary data

Attachment: nw_export_HTTPD.inc
Description: Binary data

<<attachment: build_nw_export.bat>>

Reply via email to