From ecdc54753d6a5701710de7dc5bf02526efaf1e06 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 4 Nov 2010 18:20:15 +0000 Subject: [PATCH] Static Xvnc build should now work with later versions of libgnutls that depend on libtasn1 git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4184 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- configure.ac | 3 ++- unix/build-xorg | 62 +++++++++++++++++++------------------------------ 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/configure.ac b/configure.ac index 811342ab..1909e336 100644 --- a/configure.ac +++ b/configure.ac @@ -82,7 +82,8 @@ AC_ARG_VAR(GNUTLS_LDFLAGS, [Custom linker flags for using GnuTLS, e.g. -L{GnuTLS GNUTLS_LIBS= if test "x$enable_gnutls" = xyes; then if test "x$GNUTLS_LDFLAGS" = "x"; then - GNUTLS_LDFLAGS='-lgnutls -lgcrypt -lgpg-error' + GNUTLS_LDFLAGS='-lgnutls -lgcrypt -lgpg-error -lz' + AC_CHECK_LIB([tasn1], [asn1_create_element], [GNUTLS_LDFLAGS="${GNUTLS_LDFLAGS} -ltasn1"]) fi SAVE_LIBS=${LIBS} LIBS="${LIBS} ${GNUTLS_LDFLAGS}" diff --git a/unix/build-xorg b/unix/build-xorg index 78c991da..449445d4 100755 --- a/unix/build-xorg +++ b/unix/build-xorg @@ -326,56 +326,42 @@ if [ $STATIC = 1 -a "$MODE" = "build" ]; then else ln -fs $LIBSTDCPLUSPLUS ./xorg.build/syslib fi - if [ -f ./xorg.build/syslib/libcrypto.a ]; then - rm -f ./xorg.build/syslib/libcrypto.a - fi - 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 + STATICLIBS='libcrypto.a libz.a libgcrypt.a libgpg-error.a libtasn1.a libgnutls.a' + for lib in $STATICLIBS; do + if [ -f ./xorg.build/syslib/$lib ]; then + rm -f ./xorg.build/syslib/$lib + fi + done IS64BIT=`echo -e "#ifdef __x86_64__\nis64bit_yes\n#else\nis64bit_no\n#endif" | $CC $CFLAGS -E - | grep is64bit` STATICLIBDIR= case $IS64BIT in is64bit_yes) - if [ -d /usr/lib64 ]; then STATICLIBDIR=/usr/lib64; - else STATICLIBDIR=/usr/lib; fi + if [ -d /usr/lib64 ]; then STATICLIBDIR=lib64; + else STATICLIBDIR=lib; fi ;; is64bit_no) - if [ -d /usr/lib32 ]; then STATICLIBDIR=/usr/lib32; - else STATICLIBDIR=/usr/lib; fi + if [ -d /usr/lib32 ]; then STATICLIBDIR=lib32; + else STATICLIBDIR=lib; fi ;; *) echo "Cannot determine whether compiler output is 64-bit or 32-bit. Are you using GCC?" exit 1 ;; esac - if [ ! -f $STATICLIBDIR/libcrypto.a ]; then - echo Cannot find suitable libcrypto.a. Aborting ... - exit 1 - else - ln -fs $STATICLIBDIR/libcrypto.a ./xorg.build/syslib - fi - if [ ! -f $STATICLIBDIR/libz.a ]; then - echo Cannot find suitable libz.a. Aborting ... - exit 1 - 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 + for lib in $STATICLIBS; do + if [ -f /usr/$STATICLIBDIR/$lib ]; then + ln -fs /usr/$STATICLIBDIR/$lib ./xorg.build/syslib + else + if [ -f /$STATICLIBDIR/$lib ]; then + ln -fs /$STATICLIBDIR/$lib ./xorg.build/syslib + else + DYLIB=`echo $lib | sed s/\\\.a/\\.so/g` + if [ -f /usr/$STATICLIBDIR/$DYLIB -o -f /$STATICLIBDIR/$DYLIB ]; then + echo WARNING: Cannot find suitable $lib. Xvnc will depend on $DYLIB. + fi + fi + fi + done fi export ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" -- 2.39.5