Attempt to link statically with gnutls if -static is specified, so that Xvnc and other binaries will be cross-compatible with other Linux distros


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4146 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/build-xorg b/unix/build-xorg
index 97eac3c..78c991d 100755
--- a/unix/build-xorg
+++ b/unix/build-xorg
@@ -332,6 +332,12 @@
     if [ -f ./xorg.build/syslib/libz.a ]; then
 	rm -f ./xorg.build/syslib/libz.a
     fi
+    if [ -f ./xorg.build/syslib/libgcrypt.a ]; then
+	rm -f ./xorg.build/syslib/libgcrypt.a
+    fi
+    if [ -f ./xorg.build/syslib/libgnutls.a ]; then
+	rm -f ./xorg.build/syslib/libgnutls.a
+    fi
     IS64BIT=`echo -e "#ifdef __x86_64__\nis64bit_yes\n#else\nis64bit_no\n#endif" | $CC $CFLAGS -E - | grep is64bit`
     STATICLIBDIR=
     case $IS64BIT in
@@ -360,6 +366,16 @@
     else
 	ln -fs $STATICLIBDIR/libz.a ./xorg.build/syslib
     fi
+    if [ ! -f $STATICLIBDIR/libgcrypt.a ]; then
+	echo WARNING: Cannot find suitable libgcrypt.a.  Xvnc will depend on libgcrypt.so ...
+    else
+	ln -fs $STATICLIBDIR/libgcrypt.a ./xorg.build/syslib
+    fi
+    if [ ! -f $STATICLIBDIR/libgnutls.a ]; then
+	echo WARNING: Cannot find suitable libgnutls.a.  Xvnc will depend on libgnutls.so ...
+    else
+	ln -fs $STATICLIBDIR/libgnutls.a ./xorg.build/syslib
+    fi
 fi
 
 export ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"