[gtk-vnc-devel] [patch] build fail on Solaris.



Hi there,

I'm trying to build gtk-vnc trunk code on Solaris, but met ld fail, see following error message:

/ws/onnv-tools-prc/SUNWspro/SS11/bin/cc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/X11/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/include/libpng12 -DSYSCONFDIR=\"/export/home/halton/work/dist/etc\" -g -c gvnc.c  -KPIC -DPIC -o .libs/libgtk_vnc_1_0_la-gvnc.o
"gvnc.c", line 29: cannot find include file: <endian.h>

When I add -I/usr/include/ast to (where endian.h is located) to CFLAGS , get another error like some symbol not found:

/ws/onnv-tools-prc/SUNWspro/SS11/bin/cc -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/X11/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/include/libpng12 -I../src/ -I/usr/include/ast -o .libs/gvncviewer gvncviewer-gvncviewer.o  ../src/.libs/libgtk-vnc-1.0.so -L/usr/X11/lib -lgnutls -lgtk-x11-2.0 -lgdk-x11-2.0 -lXi -lXext -lX11 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lmlib -lpangocairo-1.0 -lfontconfig -lXrandr -lXcomposite -lXdamage -lpango-1.0 -lcairo -lXfixes -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -R/export/home/halton/work/dist/lib -R/usr/X11/lib
Undefined                       first referenced
symbol                             in file
_ast_snprintf                       gvncviewer-gvncviewer.o
_ast_printf                         gvncviewer-gvncviewer.o
_ast_malloc                         ../src/.libs/libgtk-vnc-1.0.so
_ast_sscanf                         ../src/.libs/libgtk-vnc-1.0.so
_ast_strdup                         ../src/.libs/libgtk-vnc-1.0.so
_ast_free                           ../src/.libs/libgtk-vnc-1.0.so
_ast_fprintf                        gvncviewer-gvncviewer.o
_Sfstderr                           gvncviewer-gvncviewer.o

Then add -last should be added to LDFLAGS to resolve the build problem.

Now I'm aware of gtk-vnc use some headers and libraries, which Solaris ships in different way.

So I made a patch to resolve this issue, hope does not make any bad effect on Linux.

Thanks,
Halton.
diff -r d6f1a50dbb0b configure.ac
--- a/configure.ac	Sun Oct 21 17:11:07 2007 -0300
+++ b/configure.ac	Fri Oct 26 15:15:26 2007 +0800
@@ -85,6 +85,24 @@ AC_SUBST(GNUTLS_CFLAGS)
 AC_SUBST(GNUTLS_CFLAGS)
 AC_SUBST(GNUTLS_LIBS)
 
+case $host in
+  *-*-solaris* | *-*-sunos*)
+	AC_CHECK_LIB(ast, _ast_printf,
+      [AST_LIBS="-last"],
+      [
+        echo "Error! You need to have libast around."
+        exit -1
+      ])
+    AC_CHECK_HEADER(ast/endian.h,,
+      [AST_CFLAGS="-I/usr/include/ast"],
+      [
+        echo "Error! You need to have ast/endian.h around."
+        exit -1
+      ])
+	AC_SUBST(AST_CFLAGS)
+	AC_SUBST(AST_LIBS) ;;
+esac
+  
 if test "$WITH_PYTHON" = "yes"; then
   PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQUIRED)
   AC_SUBST(PYGTK_CFLAGS)
diff -r d6f1a50dbb0b src/Makefile.am
--- a/src/Makefile.am	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/Makefile.am	Fri Oct 26 15:36:00 2007 +0800
@@ -3,10 +3,11 @@ EXTRA_DIST = libgtk-vnc_sym.version vncm
 
 lib_LTLIBRARIES = libgtk-vnc-1.0.la
 
-libgtk_vnc_1_0_la_LIBADD = @GTK_LIBS@ @GNUTLS_LIBS@
+libgtk_vnc_1_0_la_LIBADD = @GTK_LIBS@ @GNUTLS_LIBS@ @AST_LIBS@
 libgtk_vnc_1_0_la_CFLAGS = @GTK_CFLAGS@ @GNUTLS_CFLAGS@ @WARNING_CFLAGS@ \
                            -DSYSCONFDIR=\""$(sysconfdir)"\" \
-                           @DEBUG_CFLAGS@
+                           @DEBUG_CFLAGS@ \
+                           @AST_CFLAGS@
 libgtk_vnc_1_0_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libgtk-vnc_sym.version \
                             -version-info 0:1:0
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]