On Mon, 20 Jun 2011 18:06:31 -0400
Robert Goley <rago...@rdasys.com> wrote:

>   I am trying to build new viewer using only static libs or at least 
> static for all libs not in the base OS.  I am trying to do this in Snow 
> Leopard and will be doing it in linux soon.  I know DRC has done this 
> because his builds have had gnutls statically linked in.  I am trying to 
> do this for libintl.  It is the only lib not in the base OS that is 
> dynamically linked according to otool -L.  Normally, I would poke 
> -static into LDFLAGS in appropriate places but I am unfamiliar with 
> cmake.  Can anyone give me a couple pointers on this?  I want to end up 
> with gnutls, gettext, and fltk linked in statically.  I am sure this 
> would be a semi common build type for others as well.
> 

Not being a CMake expert myself either, I took the easy way out and
modified the build definitions in our local copy of TigerVNC. This
entails:

a) common/rfb/CMakeLists.txt:

set(JPEG_LIBRARIES libjpeg.a gcc)

b) common/rdr/CMakeLists.txt:

if(WIN32)
set(ZLIB_LIBRARIES libz.a)
endif()

c) vncviewer/CMakeLists.txt:

#target_link_libraries(vncviewer rfb network rdr os Xregion ${FLTK_LIBRARIES} 
${GETTEXT_LIBRARIES})

target_link_libraries(vncviewer -nodefaultlibs rfb network rdr os Xregion)

if(APPLE)
  target_link_libraries(vncviewer "-framework Carbon" "-framework Cocoa" 
"-framework ApplicationServices")
endif()

target_link_libraries(vncviewer -Wl,-Bstatic ${FLTK_BASE_LIBRARY} -Wl,-Bdynamic)

if(WIN32)
  target_link_libraries(vncviewer -Wl,-Bstatic ${GETTEXT_LIBRARIES} 
${ICONV_LIBRARIES} -Wl,-Bdynamic)
elseif(APPLE)
  target_link_libraries(vncviewer -Wl,-Bstatic ${GETTEXT_LIBRARIES} 
-Wl,-Bdynamic ${ICONV_LIBRARIES})
else()
  if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
    target_link_libraries(vncviewer ${X11_Xcursor_LIB} ${X11_Xfixes_LIB} Xft 
Xext)
  else()
    target_link_libraries(vncviewer -Wl,-Bstatic ${X11_Xcursor_LIB} 
${X11_Xfixes_LIB} Xft fontconfig expat freetype Xrender Xext -Wl,-Bdynamic)
  endif()
  target_link_libraries(vncviewer X11 m)
endif()

target_link_libraries(vncviewer libstdc++.a gcc gcc_eh)

if(WIN32)
  target_link_libraries(vncviewer ws2_32 comctl32 mingw32 moldname mingwex 
msvcrt kernel32 gcc)
else()
  target_link_libraries(vncviewer c)
endif()


Cleaned up versions that we can put upstream are welcome. :)

Rgds
-- 
Pierre Ossman            OpenSource-based Thin Client Technology
System Developer         Telephone: +46-13-21 46 00
Cendio AB                Web: http://www.cendio.com

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to