From: SourceForge.net <no...@so...> - 2008-08-20 13:34:23
|
Patches item #2062373, was opened at 2008-08-20 15:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=433166&aid=2062373&group_id=42445 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Osmialowski (newchief) Assigned to: Nobody/Anonymous (nobody) Summary: compatibility bigpatch Initial Comment: This patch I've made after creating fully installing version of upcoming Player-2.2 for Solaris 10. I must add here few facts: 1. Recently I did fresh install of Solaris 10 rev. 2008.05 2. This time I didn't install gcc from Solaris 10 Companion CD (as I can't find any newer release of it). Instead I've installed CSW framework (something like fink for MacOSX or MinGW/Cygwin for Windows - actually more like MinGW than Cygwin as Cygwin emulates POSIX system while CSW does not emulate anything) 3. CSW provides three versions of gcc: - 2.95 (as on QNX and causes the same kind of problems, however this one provides all C++ and STL headers) - 3.x - cannot be installed due to an error in postinstall script - 4.0.x - cannot link Player (and many other programs either), issue known by CSW developers and waiting to solve 4. More things can be compiled on Solaris with CSW than on QNX with the same 2.95 compiler, however new bugs similar to those previous I had to patch. 5. Solaris 10 provides GTK2/GLIB2 (as it offers GNOME as desktop manager) with one of GLIB2 headers broken (however it seems to hurt only while using 2.9x gcc compiler). Two solutions of that: patch the header (quite easy to do) or install CSW version of GTK2/GLIB2. I've choosen first solution and linked playerv and friends against GTK2/GLIB2 provided by Solaris 10. 6. There's no cmake provided by Solaris. Typically I was building latest version from tarball. This time I've used cmake 2.4.8 provided by CSW framework. 7. I've installed GEOS from CSW but it cannot be found by cmake. I feel this is all systems issue which causes GEOS (and libpqxx either) isn't discovered properly at all, but currently I have no time to figure out. Noticeable issues I had to solve: 1. I don't know what Solaris recognition code for cmake was based on, but it simply does not work (or it does not work with CSW). Cmake recognizes OS as SunOS, not Solaris (actually, SunOS is an ancient name for Solaris). Therefore I had to change FindOS.cmake file a bit. I must warn I don't know how it behaves on OpenSolaris as I don't have any (once I've installed it but it didn't work stable on some old PC I've used for tests, now Solaris 10 2008.05 works fine on the same PC). Three lines from CPackConfig.cmake: SET(CPACK_PACKAGE_FILE_NAME "Player-2.2.0-SunOS") SET(CPACK_SYSTEM_NAME "SunOS") SET(CPACK_TOPLEVEL_TAG "SunOS") 2. The fact that <sys/filio.h> is present and required (which is the truth on solaris 10) is still not recognized properly. To fix this I had to add one line to SearchForStuff.cmake file. 3. I don't know where std::_Ios_Fmtflags type of variable keeping value returned by flags() method was taken from as gcc on Solaris cannot find it. I was trying to find its description on cplusplus.com page, I only found that flags() method returns value of type fmtflags defined in std::ios (which inherits this type from std::ios_base on gcc 3 and later) so I assume its use is more portable than use of (unknown for me) std::_Ios_Fmtflags type (I've checked on x86 Fedora 9 gcc 4, and it also has std::ios::fmtflags, so I believe type replacement I've proposed in my patch is safe). 4. C++ on GCC suite version 2.95 does not provide <locale> header where std::locale() function is defined, I've used #if's to solve the problem. Only one file is involved. 5. To use string class, <string> header must be explicitly included, also to avoid typing std:: before string class name, "using namespace std;" is worth to add. Affected files in my patch: - client_libs/libplayerc/dev_ranger.c 2.95 C compat - client_libs/libplayerc++/actarrayproxy.cc _Ios_Fmtflags issue, missing header inclusion - client_libs/libplayerc++/cameraproxy.cc locale issue - client_libs/libplayerc++/limbproxy.cc _Ios_Fmtflags issue, missing header inclusion - cmake/internal/FindOS.cmake - SunOS vs Solaris - cmake/internal/SearchForStuff.cmake <sys/filio.h> issue - server/drivers/blackboard/localbb/localbb.cpp mess with headers and namespace, <string> issue - server/drivers/mixed/mricp/src/Timer.cpp header for usleep() is missing, nevertheless, I've changed it to much safer nanosleep() call from <ctime>, as usleep() mess with POSIX signals which is not safe in multithread environment, while nanosleep() is implemented safe way. - server/drivers/mixed/mricp/src/mricp_driver.cpp mess with headers, <string> issue - server/drivers/wsn/accel_calib.cc iterators are much more portable than at() method which is not present on older compilers - server/drivers/wsn/mica2.cc the same as above - utils/logsplitter/logsplitter.c ctime_r() function has different list of parameters on different systems (one more parameter on Solaris 10), I've added #if that I've found grepping through the groups - it was suggested solution for the problem - utils/playercam/playercam.c 2.95 C compat - utils/playerv/pv_dev_actarray.c 2.95 C compat - utils/playerv/pv_dev_gripper.c 2.95 C compat - utils/playerv/pv_dev_vectormap.c 2.95 C compat I've prepared this patch using diff from Solaris 10, it behaves slightly different than the one on Linux (also it has little different list of parameters) but I hope this patch is still applicable. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=433166&aid=2062373&group_id=42445 |