Re: [Plib-devel] patch for compiling on Solaris 10
Brought to you by:
sjbaker
From: Fay J. F Dr C. U. AFSEO/SK <joh...@eg...> - 2006-12-14 21:33:21
|
Gentlemen, It appears from the message below that the "configure" test for "socklen_t" fails on Sun Studio 11 compilers because they do not support "-Wall". I see three options: (1) Drop the "-Wall" flag. I do not like this option because I like the compiler to warn me when things are iffy. (2) Quit checking for "socklen_t" in the "configure" step. Vijay Kumar, who flagged the error, supports this option. The reasoning is that "socklen_t" is pretty much universal by now. (3) Make the "-Wall" flag system-dependent and don't use it Sun Studio 11 compilers. Is such a thing possible? John F. Fay Technical Fellow Jacobs/Sverdrup TEAS Group 850-883-1294 -----Original Message----- From: pli...@li... [mailto:pli...@li...] On Behalf Of Vikas N Kumar Sent: Monday, December 11, 2006 10:36 PM To: pli...@li... Subject: Re: [Plib-devel] patch for compiling on Solaris 10 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 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ plib-devel mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-devel |