summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-10-05 16:52:19 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-10-07 17:24:03 -0700
commita4ce2aa6348ecca3a5b1ac8d87caf974bdad3455 (patch)
treed7b899288caa0886972e7ba3cec25acf85e3b5c3
parent22fd21a71d3dc98a94cc5f6592832e1d19bb479a (diff)
downloadxserver-a4ce2aa6348ecca3a5b1ac8d87caf974bdad3455.tar.gz
Add platform tests for Dtrace linker magic
Replaces special handling for Xquartz DDX and scales better to handling the multiple platforms that now have some level of Dtrace support available. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--configure.ac14
-rw-r--r--dix/Makefile.am2
-rw-r--r--hw/xfree86/Makefile.am2
-rw-r--r--os/Makefile.am4
-rw-r--r--test/Makefile.am2
-rw-r--r--test/xi2/Makefile.am2
6 files changed, 18 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 531316917..f34bc99ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,8 +102,20 @@ fi
if test "x$WDTRACE" != "xno" ; then
AC_DEFINE(XSERVER_DTRACE, 1,
[Define to 1 if the DTrace Xserver provider probes should be built in.])
+
+# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
+# object files, and require linking with those as relocatable objects, not .a
+# archives. MacOS X handles all this in the normal compiler toolchain, and on
+# some releases (like Tiger), will error out on dtrace -G. For now, other
+# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
+# ports appear to, based on my web searches, but have not yet been tested).
+ case $host_os in
+ darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
+ *) SPECIAL_DTRACE_OBJECTS=yes ;;
+ esac
fi
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
+AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
AC_HEADER_DIRENT
AC_HEADER_STDC
@@ -1247,7 +1259,7 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
-if test "x$WDTRACE" != "xno" && test "x$XQUARTZ" = "xno"; then
+if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
DIX_LIB='$(top_builddir)/dix/dix.O'
OS_LIB='$(top_builddir)/os/os.O'
else
diff --git a/dix/Makefile.am b/dix/Makefile.am
index 85a8767d2..0996cffea 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -54,7 +54,7 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \
|| cp Xserver-dtrace.h.in $@
-if !XQUARTZ
+if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libdix
dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 48db5a14c..159b935cf 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -80,7 +80,7 @@ BUILT_SOURCES = xorg.conf.example
DISTCLEANFILES += xorg.conf.example xorg.conf.example.pre
EXTRA_DIST = xorgconf.cpp
-if XSERVER_DTRACE
+if SPECIAL_DTRACE_OBJECTS
# Re-add dtrace object code that gets lost when building static libraries
Xorg_LDADD += $(XSERVER_LIBS)
endif
diff --git a/os/Makefile.am b/os/Makefile.am
index 9ce8ff274..22ed1946c 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -41,8 +41,7 @@ endif
EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
$(XDMCP_SRCS) $(STRLCAT_SRCS)
-if !XQUARTZ
-if XSERVER_DTRACE
+if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libos & libdix
dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS)
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o
@@ -52,7 +51,6 @@ noinst_PROGRAMS = os.O
os.O: dtrace.o $(am_libos_la_OBJECTS)
ld -r -o $@ dtrace.o .libs/*.o
endif
-endif
os.c:
touch $@
diff --git a/test/Makefile.am b/test/Makefile.am
index 1bd76f587..7c4467161 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,7 +9,7 @@ AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
INCLUDES = @XORG_INCS@
TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
-if XSERVER_DTRACE
+if SPECIAL_DTRACE_OBJECTS
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
endif
diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am
index ef6d0f0ab..0e2de6b47 100644
--- a/test/xi2/Makefile.am
+++ b/test/xi2/Makefile.am
@@ -17,7 +17,7 @@ INCLUDES = @XORG_INCS@
TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
COMMON_SOURCES=protocol-common.h protocol-common.c
-if XSERVER_DTRACE
+if SPECIAL_DTRACE_OBJECTS
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
endif