2009/11/8, Constantine Sapuntzakis wrote:
> Attached is a new full diff:
> thread-v5.diff.gz
> +/* to get defines for error-checking mutexes */
> +#define _XOPEN_SOURCE 500
> +
> +/* Needed for NI_MAXSERV - default normally but _XOPEN_SOURCE disables it*/
> +#ifdef __APPLE__
> +# define _DARWIN_C_SOURCE
> +#else
> +# define _BSD_SOURCE
> +#endif
> +
> #include "setup.h"
These lines in the hostthre.c patch part are contrary to the libcurl
configuration and build philosophy. Nothing allowed before the
inclusion of setup.h in any general purpose source file. If the file
were specific to a single OS that statement could be relaxed, but this
is not the case.
And now all the 'fun' that is related with this.
If for any reason a preprocessor symbol such as _XOPEN_SOURCE which
changes the behavior of system header files and on some OS even
modifies which libraries should be linked must be defined, then the
definition must be done in lib/setup.h immediately below or above
where _REENTRANT might be defined.
Additionally the configure script must check if there is a reason to
define such preprocessor symbol to be defined when the library is
finally built.
Since the definition of this preprocessor symbol invalidates nearly
all checks that the configure script could have done up to that point,
and that autoconf does not support a multi-pass configuration concept,
it becomes necessary that the check is done before the definitive
definitions of function availability are done for the library. Take in
account that if the symbol is going to be defined when building the
library it must also be defined while performing the configuration
tests, otherwise configuration results won't be accurate and all sorts
of funny things will start happening.
So, before making further considerations of what should be done and
specifically how should we do it, please try to remove the statements
above the setup.h inclusion directive, and what is more important
evaluate if definition of _XOPEN_SOURCE is actually going to be needed
in some cases or if all this could be done without libcurl's setup.h
having to define it.
Cheers,
--
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-09