GNOME Bugzilla – Bug 446361
Multiple build issues on Solaris
Last modified: 2007-06-12 21:22:05 UTC
I am building 1.2.4 on OpenSolaris (Solaris Nevada) with the SunStudio compiler. I encountered a number of issues. Some I was able to resolve. 1) -Wall is not supported by the SunStudio compiler and breaks the build. Attached patch removes it from the Makefile.am files. One option is to put code in configure.in: GCC_WARNINGS= if [ "x$GCC" = xyes ]; then GCC_WARNINGS="-Wall" fi AC_SUBST(GCC_WARNINGS) and use $(GCC_WARNINGS) in Makefile.am 2) libgcmd/gnome-cmd-file-info.c containst an empty struct. The Sun compiler doesn't like these. Attached patch simply adds a char member when building with the Sun compiler. 3) src/filter.cc calls the fnmatch() function and references a GNU extension option - FNM_CASEFOLD. I put this inside #ifdef __GNUC (I think that is the right test). 4) src/libgviewer/viewer-widget.c returns something from a void function. Attached patch removes the 'return' keyword. 5) src/gnome-cmd-data.cc has ternary code: pw?:"" which the Sun compiler didn't like. I explicitly added pw i.e. pw?pw:"" in the attached patch. 6) src/gnome-cmd-types.h there is a comma after the last element of the GnomeCmdPermDispMode enum. Again the picky Sun compiler complained and I created a patch to remove the comma. 7) Then I got a C++ template error that I couldn't fix. "dict.h", line 57: Error: Could not find a match for std::map<unsigned,const std::string *>::insert(std::pair<unsigned, std::string *>) needed in DICT<unsigned, std::string>::add(const unsigned, const std::string &). "dict.h", line 58: Error: Could not find a match for std::map<std::string,const unsigned*>::insert(std::pair<std::string, unsigned*>) needed in DICT<unsigned, std::string>::add(const unsigned, const std::string &).
Created attachment 89748 [details] [review] Remove -Wall from Makefile.am as it breaks Solaris build.
Created attachment 89749 [details] [review] Add a char member to empty struct to build on Solaris.
Created attachment 89750 [details] [review] Put GNU extension code inside #ifdef to allow building on Solaris.
Created attachment 89751 [details] [review] Remove return keyword from void function code.
Created attachment 89752 [details] [review] Fix shortcut ternary code to work on Solaris
Created attachment 89753 [details] [review] Remove comma from last enum item to work on Solaris.
Thanks you for your bug report. I've applied all your patches apart from '-Wall' one, for I find this option very useful for problem reporting. We need to find out how to resolve this problem. I believe I've fixed problem #7 (C++ template error), I've added const clause to lines 57 and 58 - should work, but please try it.
Created attachment 89799 [details] [review] Only use -Wall for GCC compilers - configure.in code This version of the patch checks for GCC in configure and sets GCC_WARNINGS variable to -Wall. This variable is referenced in the appropriate Makefile.am files.
Created attachment 89801 [details] [review] Change warnx to g_warning to build on Solaris The err.h header is not available on Solaris, nor is the warnx function. Patch removes err.h reference and changes warnx to g_warning.
Created attachment 89802 [details] [review] FNM_CASEFOLD and empty struct fixes for Solaris These changes are like ones submitted yesterday - empty struct given char member on Solaris and FNM_CASEFOLD GNU extension also put inside #ifdef.
The changes to dict.h for the C++ template error work. With the above patches, gnome-commander 1.2.4 successfully builds for me. I haven't run it yet.
Applied, thanks.