Re: [Plib-devel] patch for compiling on Solaris 10
Brought to you by:
sjbaker
From: Vikas N K. <vik...@us...> - 2006-12-12 04:35:32
|
Hi John, The socklen_t problem is occurring since you have the following in your configure.in Here are the details in config.log for the Sun Studio 11 compiler running on Solaris 10. socklen_t is defined in /usr/include/sys/socket.h but yet, the test below (at the end of the email) fails. Why? Because of the "-Wall" option. Sun Studio 11 compilers on Solaris 10 do not support the -Wall option. Hence the exit code $? is 1 because of which socklen_t gets defined as int instead of size_t or uint32_t. You could try "+w2" for a certain level of warnings. In any case, we should not check for socklen_t since it is defined on most systems. This checking is very antiquated on Unixes. If you look at configure.in the check has been added for Unix98. Even if it is defined in the header files, if socklen_t gets into the compile line as -Dsocklen_t=int or -Dsocklen_t=size_t, we will still have to undefine it before it is typedef'd in <netinet/in.h> Regarding strstr(), on Solaris10 in the header files the strstr() function returns a const char* for __cplusplus>=199711L which apparently is some C++ standard (ISO/IEC 14882:1998) (lifted this off the header file, i.e. in /usr/include/iso/string_iso.h) The header file /usr/include/string.h uses this iso/string_iso.h header file for all its string functions. Regards, Vikas configure:7169: checking for socklen_t configure:7191: /opt/SUNWspro/bin/cc -c -g -Wall -I/export/home/vicash/FLIGHTGEAR/run/include conftest.c >&5 cc: illegal option -Wall configure:7197: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE "plib" | #define VERSION "1.8.4" | #ifdef __cplusplus | extern "C" void exit (int); | #endif | #define HAVE_LIBPTHREAD 1 | #define HAVE_LIBGL 1 | #define HAVE_LIBDL 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | | #include <sys/types.h> | #include <sys/socket.h> | socklen_t apa; | | int | main () | { | | ; | return 0; | } configure:7240: /opt/SUNWspro/bin/cc -c -g -Wall -I/export/home/vicash/FLIGHTGEAR/run/include conftest.c >&5 cc: illegal option -Wall configure:7246: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE "plib" | #define VERSION "1.8.4" | #ifdef __cplusplus | extern "C" void exit (int); | #endif | #define HAVE_LIBPTHREAD 1 | #define HAVE_LIBGL 1 | #define HAVE_LIBDL 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | | #include <sys/types.h> | #include <sys/socket.h> | int accept (int, struct sockaddr *, size_t *); | | int | main () | { | | ; | return 0; | } configure:7273: result: int |