Saumitra Bhanage wrote:
Hi,
I am trying to build OpenHPI on my Solaris 10 u5 sparc machine. So which
compiler I must use? as per requirement is mentioned in README, I used
gcc available for solaris. but when I compiled I found ./configure is
giving parameter "-mt" to gcc (in CFLAGS and other flags). I tried to
override the CFLAGS by ./configure CFLAGS='<other flags removing -mt>'
but still it appended -mt flag.
basically error is weird, while configuration, the configure script is
creating conftest.c file and tries compiling it against option
-lglib-2.0 just to check availability of glib-2.0 which I have installed
and tested its working. and as Gcc is failing (due to illigle option t)
configure pops out error as glib-2.0 is missing.
I am using gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
I tried searching who is setting this -mt flag and tried to remove it
with few changes in configure file. but from somewhere it is getting
appended, maybe because architecture is solaris and -mt flag of cc is
same as -lpthread for gcc.
Hi,
The "-mt" flag is being added to the GLIB_CFLAGS and GLIB_LIBS
variables in configure by the "pkg-config --cflags gthread-2.0" and
"pkg-config --libs gthread-2.0" commands. You can see the "-mt" flag
in /usr/lib/pkgconfig/gthread-2.0.pc.
One workaround for this problem is to add code in configure to remove
the "-mt" from these variables. I have attached a patch,
openhpi-2.12.0-Solaris10.patch, which adds this code. The patch also
makes a few other changes you may need when compiling OpenHPI-2.12.0
on Solaris 10. To apply the patch try,
% cd openhpi-2.12.0
% gpatch -p1 < openhpi-2.12.0-Solaris10.patch
Chris
diff -r 056b8a475f9f configure
--- a/configure Mon Sep 29 15:34:04 2008 -0700
+++ b/configure Mon Sep 29 16:52:29 2008 -0700
@@ -20596,6 +20596,13 @@
GLIB_CFLAGS=`pkg-config --cflags $GLIB gthread-2.0`
GLIB_LIBS=`pkg-config --libs $GLIB gthread-2.0`
+case $host_os in
+ solaris2.10)
+ GLIB_CFLAGS=`echo $GLIB_CFLAGS | sed -e 's/-mt/-D_REENTRANT/g'`
+ GLIB_LIBS=`echo $GLIB_LIBS | sed -e 's/-mt//g'`
+ ;;
+esac
+
{ echo "$as_me:$LINENO: checking for GLIB - version >= $GLIB_REQUIRED_VERSION" >&5
echo $ECHO_N "checking for GLIB - version >= $GLIB_REQUIRED_VERSION... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: result: yes (version $exact_version)" >&5
diff -r 056b8a475f9f hpi_shell/commands.c
--- a/hpi_shell/commands.c Mon Sep 29 15:34:04 2008 -0700
+++ b/hpi_shell/commands.c Mon Sep 29 16:52:30 2008 -0700
@@ -748,7 +748,7 @@
if (read_file) return(HPI_SHELL_CMD_ERROR);
i = get_string_param("RDR Type (s|a|c|w|i|d|f) ==> ",
buf, 9);
- if (i != 0 || strnlen(buf, 3) > 1)
+ if (i != 0 || strlen(buf) > 1)
return HPI_SHELL_PARM_ERROR;
} else {
memset(buf, 0, 10);
diff -r 056b8a475f9f openhpid/Makefile.in
--- a/openhpid/Makefile.in Mon Sep 29 15:34:04 2008 -0700
+++ b/openhpid/Makefile.in Mon Sep 29 16:52:30 2008 -0700
@@ -305,7 +305,7 @@
openhpid_SOURCES = openhpid.cpp
nodist_openhpid_SOURCES = $(REMOTE_SOURCES)
-openhpid_LDADD = $(top_builddir)/utils/libopenhpiutils.la \
+openhpid_LDADD = -lrt $(top_builddir)/utils/libopenhpiutils.la \
$(top_builddir)/marshal/libohtcpconnx.la $(am__append_1) \
$(am__append_3)
openhpid_LDFLAGS = -export-dynamic $(am__append_2)
diff -r 056b8a475f9f openhpid/oh_client.cpp
--- a/openhpid/oh_client.cpp Mon Sep 29 15:34:04 2008 -0700
+++ b/openhpid/oh_client.cpp Mon Sep 29 16:52:30 2008 -0700
@@ -21,7 +21,6 @@
#include <glib.h>
#include <SaHpi.h>
#include <oHpi.h>
-#include <oh_error.h>
#include <oh_domain.h>
#include <config.h>
}
@@ -30,6 +29,11 @@
#include "oh_client.h"
#include "oh_client_session.h"
+
+extern "C"
+{
+#include <oh_error.h>
+}
#define client_dbg(cmd, str) dbg("%s: %s\n", cmd, str)
#define client_err(cmd, str) err("%s: %s\n", cmd, str)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel