[PATCH xorg-gtest 1/3] Separate XSERVER deps from X11 deps

Gaetan Nadon memsize at videotron.ca
Wed Feb 29 12:57:52 PST 2012


On 12-02-29 01:57 PM, Chase Douglas wrote:
> On 02/27/2012 08:04 AM, Gaetan Nadon wrote:
>> The previous commits fixed a compile error as there were no -I for
>> Xlib.h but at the same time introduced a link error for the example
>> subdir. The X server published C flags introduce -fvisibility=hidden.
>>
>> The X server is not a build dependency for the gtest libraries, unlike
>> video drivers. The patch simply separates the two and now uses only
>> the C flags required to build the libraries. As a consequence,
>> XSERVER_LIBS usage is replaced as well which is a noop.
>>
>> Signed-off-by: Gaetan Nadon<memsize at videotron.ca>
>> ---
>>   configure.ac         |    3 ++-
>>   examples/Makefile.am |    2 +-
>>   src/Makefile.am      |    6 +++---
>>   3 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index da94219..807dbce 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -26,7 +26,8 @@ LT_INIT
>>   AC_PROG_CXX
>>   AC_PROG_INSTALL
>>
>> -PKG_CHECK_MODULES( XSERVER, x11 [xorg-server] )
>> +PKG_CHECK_MODULES( GTEST_DEPS, x11 )
>> +PKG_CHECK_MODULES( XSERVER, [xorg-server] )
>>
>>   # Check for Google Test
>>   AC_CHECK_GTEST
>> diff --git a/examples/Makefile.am b/examples/Makefile.am
>> index 7076623..13ab8ca 100644
>> --- a/examples/Makefile.am
>> +++ b/examples/Makefile.am
>> @@ -23,7 +23,7 @@ noinst_PROGRAMS = xorg-gtest-example
>>   xorg_gtest_example_SOURCES = xorg-gtest.cpp
>>
>>   AM_CPPFLAGS = -I$(top_srcdir)/include
>> -AM_CXXFLAGS = $(XSERVER_CFLAGS) $(GTEST_CPPFLAGS)
>> +AM_CXXFLAGS = $(GTEST_DEPS_CFLAGS) $(GTEST_CPPFLAGS)
>>
>>   xorg_gtest_example_LDADD = $(top_builddir)/src/libxorg-gtest.la
>> $(top_builddir)/src/libxorg-gtest_main.la -lgtest -lpthread -lX11
>>
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index 24a1b8c..2c2648a 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -28,11 +28,11 @@ libxorg_gtest_main_la_CPPFLAGS = \
>>       $(AM_CPPFLAGS) \
>>       $(GTEST_CPPFLAGS)
>>
>> -libxorg_gtest_la_LDFLAGS = $(XSERVER_LIBS)
>> -Wl,--version-script=libxorg-gtest.ver
>> +libxorg_gtest_la_LDFLAGS = $(GTEST_DEPS_LIBS)
>> -Wl,--version-script=libxorg-gtest.ver
>>   libxorg_gtest_main_la_LDFLAGS = \
>> -    $(XSERVER_LIBS) \
>> +    $(GTEST_DEPS_LIBS) \
>>       -Wl,--version-script=libxorg-gtest_main.ver
>>
>> -AM_CXXFLAGS = -I$(top_srcdir)/include $(XSERVER_CFLAGS)
>> +AM_CXXFLAGS = -I$(top_srcdir)/include $(GTEST_DEPS_CFLAGS)
>>
>>   EXTRA_DIST = libxorg-gtest.ver libxorg-gtest_main.ver
>
>
> It looks like we really just don't need xorg-server flags. If we
> remove it:
>
> PKG_CHECK_MODULES(XSERVER, x11)
There is need for PKG_CHECK_MODULES(x11). Currently in the sample, it is
hard-coded to -lX11 which could be the wrong library if one intended to
use the one locally built rather than the system one. Analogous issues
to the header files which were assumed to be system installed.

FYI: I have a dozen patches pending for various other issues.
>
> everything still seems to work fine. I'll send a patch for that, which
> should resolve symbol visibility as well.
>
> -- Chase
>



More information about the xorg-devel mailing list