After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 446361 - Multiple build issues on Solaris
Multiple build issues on Solaris
Status: RESOLVED FIXED
Product: gnome-commander
Classification: Other
Component: buildsystem
1.2.x
Other Solaris
: Normal critical
: 1.2.5
Assigned To: epiotr
epiotr
Depends on:
Blocks:
 
 
Reported: 2007-06-11 13:14 UTC by Damien Carbery
Modified: 2007-06-12 21:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove -Wall from Makefile.am as it breaks Solaris build. (3.10 KB, patch)
2007-06-11 13:15 UTC, Damien Carbery
needs-work Details | Review
Add a char member to empty struct to build on Solaris. (343 bytes, patch)
2007-06-11 13:16 UTC, Damien Carbery
committed Details | Review
Put GNU extension code inside #ifdef to allow building on Solaris. (424 bytes, patch)
2007-06-11 13:16 UTC, Damien Carbery
committed Details | Review
Remove return keyword from void function code. (410 bytes, patch)
2007-06-11 13:17 UTC, Damien Carbery
committed Details | Review
Fix shortcut ternary code to work on Solaris (699 bytes, patch)
2007-06-11 13:17 UTC, Damien Carbery
committed Details | Review
Remove comma from last enum item to work on Solaris. (348 bytes, patch)
2007-06-11 13:18 UTC, Damien Carbery
committed Details | Review
Only use -Wall for GCC compilers - configure.in code (4.19 KB, patch)
2007-06-12 11:02 UTC, Damien Carbery
committed Details | Review
Change warnx to g_warning to build on Solaris (7.29 KB, patch)
2007-06-12 11:03 UTC, Damien Carbery
committed Details | Review
FNM_CASEFOLD and empty struct fixes for Solaris (1.56 KB, patch)
2007-06-12 11:05 UTC, Damien Carbery
committed Details | Review

Description Damien Carbery 2007-06-11 13:14:51 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 &).
Comment 1 Damien Carbery 2007-06-11 13:15:38 UTC
Created attachment 89748 [details] [review]
Remove -Wall from Makefile.am as it breaks Solaris build.
Comment 2 Damien Carbery 2007-06-11 13:16:05 UTC
Created attachment 89749 [details] [review]
Add a char member to empty struct to build on Solaris.
Comment 3 Damien Carbery 2007-06-11 13:16:40 UTC
Created attachment 89750 [details] [review]
Put GNU extension code inside #ifdef to allow building on Solaris.
Comment 4 Damien Carbery 2007-06-11 13:17:10 UTC
Created attachment 89751 [details] [review]
Remove return keyword from void function code.
Comment 5 Damien Carbery 2007-06-11 13:17:35 UTC
Created attachment 89752 [details] [review]
Fix shortcut ternary code to work on Solaris
Comment 6 Damien Carbery 2007-06-11 13:18:06 UTC
Created attachment 89753 [details] [review]
Remove comma from last enum item to work on Solaris.
Comment 7 epiotr 2007-06-11 21:55:09 UTC
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.
Comment 8 Damien Carbery 2007-06-12 11:02:44 UTC
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.
Comment 9 Damien Carbery 2007-06-12 11:03:43 UTC
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.
Comment 10 Damien Carbery 2007-06-12 11:05:11 UTC
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.
Comment 11 Damien Carbery 2007-06-12 11:06:23 UTC
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.
Comment 12 epiotr 2007-06-12 21:22:05 UTC
Applied, thanks.