[PATCH] Enable subdir-objects

Thierry Reding thierry.reding at gmail.com
Wed Feb 12 08:15:26 PST 2014


automake complains about the subdir-objects being missing. Enabling it,
however, causes various build issues to pop up because $(srcdir),
$(top_srcdir), $(builddir) and $(top_builddir) aren't handled properly.
It's simple to work around it by substituting them for their actual
values, though.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 configure.ac                            |  2 +-
 hw/vfb/Makefile.am                      |  8 ++++----
 hw/xfree86/dixmods/Makefile.am          |  6 +++---
 hw/xfree86/int10/Makefile.am            |  4 ++--
 hw/xfree86/os-support/linux/Makefile.am | 16 ++++++++--------
 hw/xfree86/parser/Makefile.am           |  2 +-
 hw/xfree86/utils/cvt/Makefile.am        |  4 ++--
 hw/xnest/Makefile.am                    |  8 ++++----
 test/Makefile.am                        |  8 ++++----
 9 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index 21a659141bc9..d135cb2b38c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ RELEASE_DATE="2014-01-09"
 RELEASE_NAME="Golden Gaytime"
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
 AC_USE_SYSTEM_EXTENSIONS
 
 # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 9f4992c8b7f1..ceb418388505 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -9,12 +9,12 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
 
 SRCS =	InitInput.c \
 	InitOutput.c \
-	$(top_srcdir)/Xext/dpmsstubs.c \
-	$(top_srcdir)/Xi/stubs.c \
-	$(top_srcdir)/mi/miinitext.c
+	../../Xext/dpmsstubs.c \
+	../../Xi/stubs.c \
+	../../mi/miinitext.c
 
 libfbcmap_a_CFLAGS = $(AM_CFLAGS)
-libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
+libfbcmap_a_SOURCES = ../../fb/fbcmap_mi.c
 
 Xvfb_SOURCES = $(SRCS)
 
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 3c43640ec908..8b46ceccc401 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -19,12 +19,12 @@ AM_CPPFLAGS = @XORG_INCS@ \
 
 libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
-libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
+libfb_la_SOURCES = ../../../fb/fbcmap_mi.c fbmodule.c
 libfb_la_CFLAGS = $(AM_CFLAGS)
 
 libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
-libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
+libwfb_la_SOURCES = ../../../fb/fbcmap_mi.c fbmodule.c
 libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
 
 libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
@@ -44,7 +44,7 @@ libshadow_la_LIBADD += libfb.la
 endif
 libshadow_la_SOURCES = shmodule.c
 
-libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
+libdixmods_la_SOURCES = ../../../mi/miinitext.c
 libdixmods_la_CFLAGS = $(AM_CFLAGS)
 
 libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
diff --git a/hw/xfree86/int10/Makefile.am b/hw/xfree86/int10/Makefile.am
index 66cb14d46152..b7d419e63c1c 100644
--- a/hw/xfree86/int10/Makefile.am
+++ b/hw/xfree86/int10/Makefile.am
@@ -23,8 +23,8 @@ if INT10_VM86
 AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS)
 libint10_la_SOURCES = \
 	$(COMMON_SOURCES) \
-	$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \
-	$(srcdir)/../os-support/linux/int10/linux.c
+	../os-support/linux/int10/vm86/linux_vm86.c \
+	../os-support/linux/int10/linux.c
 endif
 
 if INT10_X86EMU
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 83e7e002705b..813453f23ae2 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -3,8 +3,8 @@ noinst_LTLIBRARIES = liblinux.la
 if LINUX_ALPHA
 noinst_LTLIBRARIES += liblinuxev56.la
 PLATFORM_PCI_SUPPORT = \
-       $(srcdir)/lnx_axp.c \
-       $(srcdir)/../shared/xf86Axp.c
+       lnx_axp.c \
+       ../shared/xf86Axp.c
 
 liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56
 
@@ -23,11 +23,11 @@ endif
 
 liblinux_la_SOURCES = lnx_init.c lnx_video.c \
                      lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
-                     $(srcdir)/../shared/bios_mmap.c \
-		     $(srcdir)/../shared/VTsw_usl.c \
-		     $(srcdir)/../shared/posix_tty.c \
-                     $(srcdir)/../shared/vidmem.c \
-		     $(srcdir)/../shared/sigio.c \
+                     ../shared/bios_mmap.c \
+                     ../shared/VTsw_usl.c \
+                     ../shared/posix_tty.c \
+                     ../shared/vidmem.c \
+                     ../shared/sigio.c \
                      $(ACPI_SRCS) \
                      $(APM_SRCS) \
                      $(PLATFORM_PCI_SUPPORT)
@@ -37,7 +37,7 @@ AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_
 AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS)
 
 EXTRA_DIST = \
-	$(srcdir)/../shared/xf86Axp.h
+	../shared/xf86Axp.h
 
 if LINUX_ALPHA
 liblinux_la_LIBADD = liblinuxev56.la
diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
index 3bf62e8af6a5..f020afa763cb 100644
--- a/hw/xfree86/parser/Makefile.am
+++ b/hw/xfree86/parser/Makefile.am
@@ -31,7 +31,7 @@ libxf86config_internal_la_SOURCES = \
 	$(INTERNAL_SOURCES)
 
 libxf86config_la_SOURCES = \
-	$(top_srcdir)/os/xprintf.c \
+	../../../os/xprintf.c \
 	$(INTERNAL_SOURCES)
 libxf86config_la_CFLAGS = $(AM_CFLAGS)
 libxf86config_la_LDFLAGS = -static
diff --git a/hw/xfree86/utils/cvt/Makefile.am b/hw/xfree86/utils/cvt/Makefile.am
index 26abeb40be9a..18769402a1e8 100644
--- a/hw/xfree86/utils/cvt/Makefile.am
+++ b/hw/xfree86/utils/cvt/Makefile.am
@@ -29,7 +29,7 @@ AM_CPPFLAGS = $(XORG_INCS) \
 
 # gah
 cvt_SOURCES = cvt.c \
-	$(top_srcdir)/hw/xfree86/modes/xf86cvt.c \
-	$(top_srcdir)/os/xprintf.c
+	../../../../hw/xfree86/modes/xf86cvt.c \
+	../../../../os/xprintf.c
 
 cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index 3c099cd6b1d2..4205a414622f 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -42,11 +42,11 @@ SRCS =	Args.c \
 	XNPixmap.h \
 	XNWindow.h \
 	xnest-config.h \
-	$(top_srcdir)/Xext/dpmsstubs.c \
-	$(top_srcdir)/Xi/stubs.c \
-	$(top_srcdir)/mi/miinitext.c
+	../../Xext/dpmsstubs.c \
+	../../Xi/stubs.c \
+	../../mi/miinitext.c
 
-libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
+libfbcmap_a_SOURCES = ../../fb/fbcmap_mi.c
 libfbcmap_a_CFLAGS = $(AM_CFLAGS)
 
 XNEST_LIBS = \
diff --git a/test/Makefile.am b/test/Makefile.am
index 2852bb3e0234..7dc0f0186b77 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -42,7 +42,7 @@ os_LDADD=$(TEST_LDADD)
 libxservertest_la_LIBADD = $(XSERVER_LIBS)
 if XORG
 
-nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
+nodist_libxservertest_la_SOURCES = ../hw/xfree86/sdksyms.c
 libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
             $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
@@ -71,9 +71,9 @@ endif
 else
 nodist_libxservertest_la_SOURCES = \
             ddxstubs.c \
-            $(top_srcdir)/mi/miinitext.c \
-            $(top_srcdir)/Xext/dpmsstubs.c \
-            $(top_srcdir)/Xi/stubs.c
+            ../mi/miinitext.c \
+            ../Xext/dpmsstubs.c \
+            ../Xi/stubs.c
 
 libxservertest_la_LIBADD += \
             $(top_builddir)/damageext/libdamageext.la \
-- 
1.8.4.2



More information about the xorg-devel mailing list