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>
This commit is contained in:
Alan Coopersmith 2009-10-05 16:52:19 -07:00
parent 8c51b88640
commit 4b0911565d
6 changed files with 18 additions and 8 deletions

View File

@ -97,8 +97,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
@ -1242,7 +1254,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

View File

@ -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)

View File

@ -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

View File

@ -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 $@

View File

@ -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

View File

@ -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