From 57b11d4601b95da3fc086cc0ed4b3b8eee11333c Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Mon, 29 Feb 2016 20:57:06 -0500 Subject: [PATCH] Link libX11 dynamically Building libX11 statically causes problems with libpthread, however the version of libX11 that ships with el5 is too old to build libXext. So we have to build a dynamic version of libX11 and link against that while building. The resulting binary will actually be linked against the system libX11, which should be ABI compatible as far as Xvnc is concerned. --- contrib/packages/rpm/el5/SPECS/tigervnc.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/packages/rpm/el5/SPECS/tigervnc.spec b/contrib/packages/rpm/el5/SPECS/tigervnc.spec index 2fc033e0..1889f613 100644 --- a/contrib/packages/rpm/el5/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el5/SPECS/tigervnc.spec @@ -709,7 +709,6 @@ for module in ${modules}; do fi if [ "${module}" = "libX11" ]; then autoreconf -fiv - sed -i -e 's|^\(#pragma weak pthread_equal.*\)$||' src/UIThrStubs.c extraoptions="${extraoptions} --disable-specs" fi if [ "${module}" = "libSM" ]; then @@ -733,7 +732,7 @@ for module in ${modules}; do elif [ "${module}" = "libXt" ]; then LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S" elif [ "${module}" = "libX11" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic + LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --disable-static --enable-shared --with-pic elif [ "${module}" = "libXtst" ]; then LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic elif [ "${module}" = "libXpm" ]; then @@ -786,7 +785,7 @@ autoreconf -fiv %endif # link libGL statically against any xorg libraries built above -LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lX11 -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \ +LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -lX11 -lpthread -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \ PKG_CONFIG="pkg-config --static" ./configure %{common_flags} \ --host=%{_host} \ --build=%{_build} \ -- 2.39.5