[PATCH] Build libxf86config with -fPIC.

Dan Nicholson dbn.lists at gmail.com
Sun Nov 14 21:31:42 PST 2010


On Sun, Nov 14, 2010 at 5:25 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> From: Adam Jackson <ajax at redhat.com>
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  hw/xfree86/parser/Makefile.am |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
> index caf7079..3bda51e 100644
> --- a/hw/xfree86/parser/Makefile.am
> +++ b/hw/xfree86/parser/Makefile.am
> @@ -32,7 +32,7 @@ libxf86config_internal_la_SOURCES = \
>
>  libxf86config_a_SOURCES = \
>        $(INTERNAL_SOURCES)
> -libxf86config_a_CFLAGS = $(AM_CFLAGS)
> +libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC
>
>  AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
>        -DSYSCONFDIR=\"$(sysconfdir)\" \

Why not just make libxf86config into a libtool library? Then libtool
will take care of all the PIC details, follow the --with-pic
configuration, and be static or shared as requested by the user.
Here's an untested diff, but I think it's all it would take (gmail has
surely broken the whitespace).

diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
index caf7079..6cbf8e4 100644
--- a/hw/xfree86/parser/Makefile.am
+++ b/hw/xfree86/parser/Makefile.am
@@ -1,6 +1,6 @@
 if INSTALL_LIBXF86CONFIG
 noinst_LTLIBRARIES = libxf86config_internal.la
-lib_LIBRARIES = libxf86config.a
+lib_LTLIBRARIES = libxf86config.la
 LIBHEADERS = \
        xf86Optrec.h \
        xf86Parser.h
@@ -30,9 +30,9 @@ INTERNAL_SOURCES= \
 libxf86config_internal_la_SOURCES = \
        $(INTERNAL_SOURCES)

-libxf86config_a_SOURCES = \
+libxf86config_la_SOURCES = \
        $(INTERNAL_SOURCES)
-libxf86config_a_CFLAGS = $(AM_CFLAGS)
+libxf86config_la_CFLAGS = $(AM_CFLAGS)

 AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
        -DSYSCONFDIR=\"$(sysconfdir)\" \


More information about the xorg-devel mailing list