httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: [patch apr-xplat.diffs] APR 2.0 - linkage mechanisms
Date Wed, 29 Mar 2000 07:39:51 GMT
> I know this has been mentioned before, but I'll mention it again... we
> really need to see smaller, self contained patches. I have
> spent a fair
> amount of time looking at this set of patches and I still can't say I
> completely understand where you are going or what you are trying to
> accomplish.  Patches submitted to the list need to be -very-
> focused; don't
> try to solve multiple problems with a single patch.

First, thank you for your effort to absorb these changes.  I know how much
time you spent reveiwing, because I know how many hours it took to write
them and rewrite them well.  The focus is specific,

1) properly tag functions to their 'own' library.

2) allow those tags to reflect static or dynamic linkage, open to flexibly
address other future requirements.

3) create the apr as a static library.

That code is dirt simple, for the apr example, in apr.hw ...

#ifdef APR_EXPORT_DLL

#define APR_EXPORT(type)         __stdcall type
#define APR_EXPORT_NONSTD(type)  __cdecl type __declspec(dllexport)
#define APR_EXPORT_VAR           extern __declspec(dllexport)

#elif defined(APR_EXPORT_DLL)

#define APR_EXPORT(type)         __stdcall type
#define APR_EXPORT_NONSTD(type)  __cdecl type __declspec(dllimport)
#define APR_EXPORT_VAR           extern __declspec(dllimport)

#else

#define APR_EXPORT(type)         __cdecl type
#define APR_EXPORT_NONSTD(type)  __cdecl type
#define APR_EXPORT_VAR           extern

#endif

even the next change is simple, grep /src/lib/apr/*

s/API_EXPORT/APR_EXPORT/
s/API_VAR_EXPORT/APR_EXPORT_VAR/

But we need to change Modules*.dsp, Apache.dsp, ApacheCore.dsp and
support/*.dsp.  Before that we want to also get ready for the same REGEX_
and AP_ tags (API_ and CORE_ will stay, both for the core, since the core is
the biggest headache to transform!!!)



I was phasing this one step at a time... put everything _in_place_ for that
step in the apr/aprlib projects, then move on to ap, then to regex, finally
to the core and modules, and then throw the flag.  Heck, I'd rather you
greped it yourself once everything is there, no point in my diffing nonsense
like that.

Of course I've done all that and it works wonderfully, now I'm trying to
pass it on in pieces, keeping the codebase stable with each pass.  I don't
have the tools to create diff sets of each issue myself and submit them
together as seperate issue patches.

The .dsp files and new .hw's, however, may require the apr-winsrc.diffs
patch to be applied.  Frankly, if this patch works across all other
platforms, I don't friggin care if we break the windows build for a day or
two, knowing that we are setting ourselves up to succeed later.



Here's the breakdown of the apr-xplat.diffs and the whys.  The only
additional patch REQURIED to windows, I believe, is the apr.dsp / aprlib.dsp
set, which is attached as a zip file.  These updates expect the .hw files to
be copied to apr.h and apr_config.h under windows.  I killed a few updates
from the patch, they are listed at the end.  I will detail the
apr-winsrc.diffs tommorow, but that is no reason not to proceed if nothing
breaks.



Group 1 - APR modifications outside of APR

src/ap/ap_base64.c
  using apache's prefs - bump ap_config to top
  does not rely on the Apache core (-CORE_PRIVATE)
  is a member of the ap library (+ap.h)

src/ap/ap_hooks.c
  is not a part of the apache core (-httpd.h)
  is a member of the ap library (+ap.h)

src/ap/ap_sha1.c
  follows apache's prefs - bump ap_config to top
  is not a part of the apache core (-httpd.h)
  is a member of the ap library (+ap.h)
  needs apr_lib.h declarations (+apr_lib.h)

src/include/ap_config.h
  fights with apr/apr_config frequently in the comming days
  conditionally trigger ap_inline, __attribute__, ENUM_BITFIELD
    and XtOffsetOf by #ifndef'ing them all

src/include/ap_hooks.h
  needed declarations (+apr_lib.h)
  but assure ap_config overrides apr configs (+ap_config.h)

src/include/http_protocol.h
  needed to publicly declare ap_setup_input()

src/include/httpd.h
  assure ap_config overrides apr configs (+ap_config.h)



Group 2 - APR headers

src/lib/apr/include/apr_errno.h
  Above all else we are apr!
  bump <errno.h> below and test HAVE_ERRNO_H
  Not necessary yet, Kill apr_win.h

src/lib/apr/include/apr_file_io.h
  "apr_time.h" -> "apr_general.h" -> "apr_errno.h" -> "apr.h"
  not necessary, simpler (-apr_general.h) (-apr_errno.h)
  perhaps more confusing as well?

src/lib/apr/include/apr_general.h
  "apr_errno.h" -> "apr.h"
  not necessary, maybe simpler (-apr.h), bump apr_errno.h to top.
  c'mon, (-sys/types.h)!  That's a fundimental of apr.h!
  ap_get_oslevel() conditially declared based on HAVE_OSLEVEL

src/lib/apr/include/apr_getopt.h
  API_VAR_IMPORT!?!  So I break what is already broken.
  Later on, s/API_VAR_EXPORT/APR_VAR_EXPORT/g will work CORRECTLY,
  both to build the lib (/D APR_EXPORT_DLL) and link (/D APR_IMPORT_DLL)

src/lib/apr/include/apr_lib.h
  "apr_thread_proc.h" -> "apr_file_io.h" -> "apr_general.h" -> "apr.h"
  not necessary, simpler (-apr_file_io.h) (-apr_general.h)
  c'mon, (-sys/types.h)!  That's a fundimental of apr.h!
  -ap_slack() since it is unused, belongs in ap.lib anyway

src/lib/apr/include/apr_lock.h
  "apr_general.h" -> "apr_errno.h" -> "apr.h"
  not necessary, simpler (-apr_errno.h)

src/lib/apr/include/apr_md5.h
  not necessary, but can we be consistent? s/APACHE_MD5_H/APR_MD5_H/

src/lib/apr/include/apr_network_io.h
  already invoked in apr.h!!! (-winsock2.h), plus by
    placing it above apr.h, knocked out all apr.h win include rules!
  "apr_file_io.h" -> "apr_general.h" -> "apr_error.h" -> "apr.h"
  not necessary, simpler (-apr_general.h) (-apr_error.h)

src/lib/apr/include/apr_pools.h
  bump apr_lib.h to the top, even before extern "C" blocks
    (who knows what that would have broken later?!?)
  not necessary, but can we be consistent? s/ap_POOLS_H/APR_POOLS_H/g
    (and I didn't even get it right!)
  c'mon, (-sys/types.h)!  That's a fundimental of apr.h!

src/lib/apr/include/apr_shmem.h
  "apr_general.h" -> "apr_error.h" -> "apr.h"
  not necessary, simpler (-apr_error.h) (-apr.h)

src/lib/apr/include/apr_signal.h
  "apr_general.h" -> "apr_error.h" -> "apr.h"
  not necessary, simpler (-apr_error.h)

src/lib/apr/include/apr_thread_proc.h
  "apr_file_io.h" -> "apr_general.h" -> "apr_error.h" -> "apr.h"
  not necessary, simpler (-apr_general.h) (-apr_error.h)

src/lib/apr/include/apr_time.h
  "apr_general.h" -> "apr_error.h" -> "apr.h"
  not necessary, simpler (-apr_error.h)
  API_VAR_IMPORT!?!  I'd overlook it later, and was broken!
  Later on, s/API_VAR_EXPORT/APR_VAR_EXPORT/g will work CORRECTLY,
  both to build the lib (/D APR_EXPORT_DLL) and link (/D APR_IMPORT_DLL)



Group 3 - APR cross-platform source

src/lib/apr/lib/apr_cpystrn.c
  Not necessary yet, kill apr_winconfig.h
  c'mon, (-sys/types.h)!  That's a fundimental of apr_config.h!

src/lib/apr/lib/apr_execve.c
  We are all apr!  (-#ifndef WIN32) #include "apr_config.h" (-#endif)

src/lib/apr/lib/apr_fnmatch.c
  Ok... here is something I thought I may have broken...
    but from the VC compiler's perspective, we want to
    maintain apr_config.h above any other declarations.
  string.h grows a HAVE_STRING_H test
  ctype.h grows a HAVE_CTYPE_H test

src/lib/apr/lib/apr_getpass.c
  Not necessary yet, kill apr_winconfig.h
  I believe in header clarity in source, but
    c'mon, (-sys/types.h)!  That's a fundimental of apr_config.h!
    likewise, (-errno.h)... fundimental of apr_errno!

src/lib/apr/lib/apr_md5.c
  We are all apr!  (-#ifndef WIN32) #include "apr_config.h" (-#endif)

src/lib/apr/lib/apr_pools.c
  Not necessary yet, kill apr_winconfig.h
  For missing declarations (+apr_portable.h)
    (could then kill apr_general.h)
  c'mon, (-sys/types.h)!  That's a fundimental of apr_config.h!

src/lib/apr/lib/apr_snprintf.c
  Not necessary yet, kill apr_winconfig.h
  math.h grows a HAVE_MATH_H test
  already invoked in apr.h!!! (-winsock2.h), plus by
    placing it above apr.h, knocked out all apr.h win include rules!

src/lib/apr/lib/apr_tables.c
  Not necessary yet, kill apr_winconfig.h



Group 4 - more APR modifications outside of APR

src/main/gen_test_char.c
  Does not use the core (-httpd.h)

src/main/http_log.c
  Not necessary yet, kill apr_winconfig.h
  This needs apache's prefs, not apr's, bump httpd.h above apr.h

src/main/listen.c
  This needs apache's config and prefs, not apr's,
    bump apr_network_io.h below httpd.h

src/modules/standard/mod_access.c
  This needs apache's config and prefs, not apr's,
    bump apr_network_io.h below httpd.h



I pulled these modules from the patch, and here's why:

src/CHANGES
  After the fact for these...

src/lib/apr/APRDesign
  prime example of what didn't belong in this patch before.
  Now it does but needs rewriting.  Documented the
  .hw/autoconf relationship, but since I don't understand
  which files drive autoconf, this needs to be kicked around.

src/lib/apr/lib/apr_signal.c
  CAUTION - this may be a cvs update that is backed out or worse.
  No change was intended here!!!



src/lib/apr/lib/apr_slack.c
  Dang it, this just doesn't belong in apr!  It isn't even used...
  back to ap with it, make it generic or mothball it to the attic!

Mime
View raw message