GNOME Bugzilla – Bug 141319
Epiphany compile issues on Solaris
Last modified: 2007-08-03 13:52:27 UTC
The attached patch resolves some problems with compiling epiphany with the Forte compiler. Note that Forte complains about using "return" in void functions, requires ISO style variable argument macros, and Solaris doesn't have the mkdtemp function.
Created attachment 27178 [details] [review] patch to make epiphany build on Solaris with Forte
Comment on attachment 27178 [details] [review] patch to make epiphany build on Solaris with Forte >@@ -52,7 +52,13 @@ > "-XXXXXX", NULL); > full_name = g_build_filename (g_get_tmp_dir (), partial_name, > NULL); >+#ifdef __SUNPRO_C >+ mkstemp(full_name); >+ tmp_dir = g_malloc(sizeof(char *)*strlen(full_name)); >+ strcpy(tmp_dir, full_name); >+#else > tmp_dir = mkdtemp (full_name); >+#endif > g_free (partial_name); > > if (tmp_dir == NULL) Instead of just checking for this compiler, I'd prefer a configure check for mkstemp, and then #ifdef HAVE_MKSTEMP/#else here. Also I don't get this line: >+ tmp_dir = g_malloc(sizeof(char *)*strlen(full_name)); Shouldn't that be sizeof(char) * (strlen (full_name) + 1) ? Apart from that, the patch looks good.
> Instead of just checking for this compiler, I'd prefer a configure check for > mkstemp, and then #ifdef HAVE_MKSTEMP/#else here. Sorry, I mean mkdtemp.
Created attachment 28151 [details] [review] workaround when mkdtemp is unavailable I've checked in all the bits from attachment 27178 [details] [review] and a configure check for mkdtemp, except the implementation in the case of unavailable mkdtemp. Don't we have to create the directory in this case, after getting a temp file_name_ ?
I had to revert the varargs change to ephy-debug.h, since it wouldn't compile LOG("Test") messages (i.e. with no arguments).
Right, to support ISO style varargs with only 1 parameter, something like this would need to be done: #define LOG(...) \ gchar *val = g_strdup_printf (__VA_ARGS__); \ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "[ %s ] %s", \ __FILE__ , val); g_free (val); #endif It is a little annoying to have to allocate/free, but this might not matter if this is only used for debug purposes. Also you could set up the if-def's so that it only uses ISO standard if GNU style vararg macro is not available by the compiler. Other alternatives would be to eliminate the __FILE__ from appearing in the g_log message or printing two g_log messages (one with the file and the second with the message).
I have used some of these patches. For 1.2.6 I've had to use following patch and CFLAGS += -DHAVE_MKDTEMP CPPFLAGS += -DHAVE_MKDTEMP before compilation (this was in Makefile from GARNOME). because there is some test for MKDTEMP, which does not work on Solaris. Please check that patch. It compiles with epi 1.2.6 on Solaris 9/SPARC with Forte.
Created attachment 28711 [details] [review] Patch to compile 1.2.6 on Solaris with Forte Please review this patch, as some things may not be what they should be like.
Mass reassigning of Epiphany bugs to epiphany-maint@b.g.o
Comment on attachment 28711 [details] [review] Patch to compile 1.2.6 on Solaris with Forte I don't want to have to maintain a copy of mkdtemp in epiphany; it should just be available from glib (bug 118563). The LOG macro varargs problem is fixed in current code.
Do any of these issues still exist in epiphany 2.18.2 ?
Ivan: ping?
Sorry, I don't try to compile Epiphany on Sol since I've reported the problem.