You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2011/04/01 02:44:12 UTC
DO NOT REPLY [Bug 46175] Full Mingw+MSys support
https://issues.apache.org/bugzilla/show_bug.cgi?id=46175
--- Comment #21 from Jeff Trawick <tr...@apache.org> 2011-03-31 20:44:07 EDT ---
About the use of APR_DECLARE_STATIC/APR_DECLARE_EXPORT:
(And yes, I probably am confused; just tell me where.)
The Microsoft toolchain build is set up to be able to generate statically- and
dynamically-linked versions of APR which can coexist in the APR installation
directory, and the user defines one of those symbols when building their
application so that the one copy of the include files declare the correct
linkage depending on whether the application will be statically or dynamically
linked with APR. (Yeah, they're also used in the APR build itself since
there's one apr.h for both builds.)
The autoconf-based toolchain can only generate static or dynamic in one build,
and they apparently cannot coexist. A couple of examples:
1. There can only be one apr-2-config, and "apr-2-config --cflags" will have
either APR_DECLARE_STATIC or APR_DECLARE_EXPORT, depending on the last one
which was installed. (That could be ripped out of apr-2-config, and maybe
Windows users won't make use of that anyway.)
2. (Fuzzy recollection, unfortunately) I installed a dynamic build then a
static build into the same directory; when I linked my app, the link step would
reference the apr DLL if libapr-2.dll.la existed in the INSTALLDIR/lib
directory; when the la was removed it would statically link with apr.
If the coexistence of static/dynamic is not practical with the autoconf-based
build, I don't think we need to expose the
APR_DECLARE_STATIC/APR_DECLARE_EXPORT "choice" for that build. IOW, don't add
it to CPPFLAGS, and substitute the proper linkage when apr.h is generated
("#define APR_DECLARE(type) @aprdcl@" and the like) and there won't be
multiple versions in the final apr.h.
Thoughts?
BTW, the patch has three versions of the declare macros:
if APR_DECLARE_STATIC
foo
else if APR_DECLARE_EXPORT
bar
else
baz
endif
What is that default set of definitions used for? I thought one of those
APR_DECLARE_ would always be defined.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org