From ac41255d56f82999e1cb5f9bd450bec3de95f3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 26 Sep 2007 16:43:56 +0000 Subject: [PATCH] Factor-out glucose symlinked code from xgl into a common library. --- Makefile.am | 7 ++ configure.ac | 15 +-- glucose/Makefile.am | 25 +---- glucose/symlink-xgl.sh | 166 ------------------------------- hw/xgl/Makefile.am | 44 ++------ hw/xgl/glx/Makefile.am | 1 + hw/xgl/glx/module/Makefile.am | 1 + hw/xgl/glxext/Makefile.am | 1 + hw/xgl/glxext/module/Makefile.am | 1 + xgl/Makefile.am | 42 ++++++++ {hw/xgl => xgl}/xgl.h | 0 {hw/xgl => xgl}/xglarea.c | 0 {hw/xgl => xgl}/xglcmap.c | 0 {hw/xgl => xgl}/xglcompose.c | 0 {hw/xgl => xgl}/xglcopy.c | 0 {hw/xgl => xgl}/xglfill.c | 0 {hw/xgl => xgl}/xglgc.c | 0 {hw/xgl => xgl}/xglgeometry.c | 0 {hw/xgl => xgl}/xglget.c | 0 {hw/xgl => xgl}/xglglyph.c | 0 {hw/xgl => xgl}/xglpict.c | 0 {hw/xgl => xgl}/xglpixmap.c | 0 {hw/xgl => xgl}/xglshm.c | 0 {hw/xgl => xgl}/xglsolid.c | 0 {hw/xgl => xgl}/xglsync.c | 0 {hw/xgl => xgl}/xgltile.c | 0 {hw/xgl => xgl}/xgltrap.c | 0 {hw/xgl => xgl}/xglwindow.c | 0 {hw/xgl => xgl}/xglxv.c | 0 29 files changed, 73 insertions(+), 230 deletions(-) delete mode 100755 glucose/symlink-xgl.sh create mode 100644 xgl/Makefile.am rename {hw/xgl => xgl}/xgl.h (100%) rename {hw/xgl => xgl}/xglarea.c (100%) rename {hw/xgl => xgl}/xglcmap.c (100%) rename {hw/xgl => xgl}/xglcompose.c (100%) rename {hw/xgl => xgl}/xglcopy.c (100%) rename {hw/xgl => xgl}/xglfill.c (100%) rename {hw/xgl => xgl}/xglgc.c (100%) rename {hw/xgl => xgl}/xglgeometry.c (100%) rename {hw/xgl => xgl}/xglget.c (100%) rename {hw/xgl => xgl}/xglglyph.c (100%) rename {hw/xgl => xgl}/xglpict.c (100%) rename {hw/xgl => xgl}/xglpixmap.c (100%) rename {hw/xgl => xgl}/xglshm.c (100%) rename {hw/xgl => xgl}/xglsolid.c (100%) rename {hw/xgl => xgl}/xglsync.c (100%) rename {hw/xgl => xgl}/xgltile.c (100%) rename {hw/xgl => xgl}/xgltrap.c (100%) rename {hw/xgl => xgl}/xglwindow.c (100%) rename {hw/xgl => xgl}/xglxv.c (100%) diff --git a/Makefile.am b/Makefile.am index b1daa056b..53624426d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,12 @@ if DBE DBE_DIR=dbe endif +if XGL +XGL_DIR=xgl +endif + if GLUCOSE +XGL_DIR=xgl GLUCOSE_DIR=glucose endif @@ -60,6 +65,7 @@ SUBDIRS = \ $(GLX_DIR) \ exa \ config \ + $(XGL_DIR) \ $(GLUCOSE_DIR) \ hw @@ -107,6 +113,7 @@ DIST_SUBDIRS = \ GL \ exa \ config \ + xgl \ glucose \ hw diff --git a/configure.ac b/configure.ac index a20b7453e..f986dd5f1 100644 --- a/configure.ac +++ b/configure.ac @@ -789,13 +789,10 @@ if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then test -d GL || mkdir GL case $host_os in solaris*) - SYMLINK_MESA="/usr/bin/bash $srcdir/GL/symlink-mesa.sh" - SYMLINK_GLUCOSE="/usr/bin/bash $srcdir/glucose/symlink-xgl.sh" ;; - *) SYMLINK_MESA=$srcdir/GL/symlink-mesa.sh - SYMLINK_GLUCOSE=$srcdir/glucose/symlink-xgl.sh ;; + SYMLINK_MESA="/usr/bin/bash $srcdir/GL/symlink-mesa.sh" ;; + *) SYMLINK_MESA=$srcdir/GL/symlink-mesa.sh ;; esac $SYMLINK_MESA $MESA_SOURCE GL/ - $SYMLINK_GLUCOSE $srcdir/hw/xgl glucose/ if test $? -ne 0; then AC_MSG_ERROR([Failed to link Mesa source tree. Please specify a proper path to Mesa sources, or disable GLX.]) fi @@ -1263,10 +1260,13 @@ fi AC_MSG_RESULT([$XGL]) AM_CONDITIONAL(XGL, [test "x$XGL" = xyes]) -if test "x$XGL" = xyes; then +if test "x$XGL" = xyes -o "x$GLUCOSE" = xyes; then XGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" - XGL_SYS_LIBS="$XGLMODULES_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" AC_SUBST([XGL_LIBS]) +fi + +if test "x$XGL" = xyes; then + XGL_SYS_LIBS="$XGLMODULES_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" AC_SUBST([XGL_SYS_LIBS]) AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules]) AC_DEFINE(XGLServer, 1, [Building XGL server]) @@ -2063,6 +2063,7 @@ Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile +xgl/Makefile glucose/Makefile hw/Makefile hw/xfree86/Makefile diff --git a/glucose/Makefile.am b/glucose/Makefile.am index 1686d386e..943a3c77a 100644 --- a/glucose/Makefile.am +++ b/glucose/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = -I@MESA_SOURCE@/include \ -I$(top_srcdir)/GL/mesa/glapi \ -I$(top_srcdir)/GL/glx \ -I$(top_srcdir)/GL/include \ + -I$(top_srcdir)/xgl \ -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common @@ -27,27 +28,3 @@ libglucose_la_SOURCES = \ glucose_info.c libglucose_la_LIBADD = $(GLUCOSE_LIBS) - - -nodist_libglucose_la_SOURCES = \ -xgl.h \ -xglarea.c \ -xglcmap.c \ -xglcompose.c \ -xglcopy.c \ -xglfill.c \ -xglgc.c \ -xglgeometry.c \ -xglget.c \ -xglglyph.c \ -xglpict.c \ -xglpixmap.c \ -xglshm.c \ -xglsolid.c \ -xglsync.c \ -xgltile.c \ -xgltrap.c \ -xglwindow.c \ -xglxv.c - -EXTRA_DIST = symlink_xgl.sh diff --git a/glucose/symlink-xgl.sh b/glucose/symlink-xgl.sh deleted file mode 100755 index 32da1106e..000000000 --- a/glucose/symlink-xgl.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/sh - -# -# A script that symlinks source files from xgl to glucose -# -# Author: Soren Sandmann (sandmann@redhat.com) (original) -# adapted for glucose by Alan Hourihane - -# -# Things we would like to do -# -# - Check that all the relevant files exist -# - AUTHORS, autogen.sh, configure.ac, ... -# - Check that we have actually linked everything -# - if a file doesn't need to be linked, then it needs -# to be listed as "not-linked" -# - Compute diffs between all the files (shouldn't be necessary) -# - possibly check that files are listet in Makefile.am's -# - Clean target directory of irrelevant files -# - -check_destinations () { - # don't do anything - we are relying on the side - # effect of dst_dir - true -} - -check_exist() { - # Check whether $1 exists - - if [ ! -e $1 ] ; then - error "$1 not found" - fi -} - -delete_existing() { - # Delete $2 - - rm -f $2 -} - -link_files() { - # Link $1 to $2 - - if [ ! -e $2 ] ; then - ln -s $1 $2 - fi -} - -main() { - check_args $1 $2 - - run check_destinations "Creating destination directories" - run check_exist "Checking that the source files exist" - run delete_existing "Deleting existing files" - run link_files "Linking files" -} - -## actual symlinking - -symlink_xgl() { - src_dir . - dst_dir . - - for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do - action `basename $src` - done -} - -######### -# -# Helper functions -# -######### - -error() { - echo - echo \ \ \ error:\ \ \ $1 - exit 1 -} - -# printing out what's going on -run_module() { - # $1 module - # $2 explanation - echo -n $EXPLANATION for $1 module ...\ - symlink_$1 - echo DONE -} - -run() { - # $1 what to do - # $2 explanation - - ACTION=$1 EXPLANATION=$2 run_module xgl -} - -src_dir() { - REAL_SRC_DIR=$SRC_DIR/$1 - if [ ! -d $REAL_SRC_DIR ] ; then - error "Source directory $REAL_SRC_DIR does not exist" - fi -} - -dst_dir() { - REAL_DST_DIR=$DST_DIR/$1 - if [ ! -d $REAL_DST_DIR ] ; then - mkdir -p $REAL_DST_DIR - fi -} - -action() { - if [ -z $2 ] ; then - $ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$1 - else - $ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$2 - fi -} - -usage() { - echo symlink-xgl.sh src-dir dst-dir - echo src-dir: the xgl source directory - echo dst-dir: the glucose directory -} - -# Check commandline args -check_args() { - if [ -z $1 ] ; then - echo Missing source dir - usage - exit 1 - fi - - if [ -z $2 ] ; then - echo Missing destination dir - usage - exit 1 - fi - - if [ ! -d $1 ] ; then - echo $1 is not a dir - usage - exit 1 - fi - - if [ ! -d $2 ] ; then - echo $2 is not a dir - usage - exit 1 - fi - - if [ $1 = $2 ] ; then - echo source and destination can\'t be the same - usage - exit 1 - fi - - D=`dirname "$relpath"` - B=`basename "$relpath"` - abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B" - - SRC_DIR=`( cd $1 ; pwd )` - DST_DIR=`(cd $2 ; pwd )` -} - -main $1 $2 diff --git a/hw/xgl/Makefile.am b/hw/xgl/Makefile.am index 6c72ea6ce..080a4fdac 100644 --- a/hw/xgl/Makefile.am +++ b/hw/xgl/Makefile.am @@ -28,53 +28,31 @@ AM_CFLAGS = \ -I$(top_srcdir)/GL/include \ -I@MESA_SOURCE@/include \ -I@MESA_SOURCE@/src/mesa/glapi \ + -I$(top_srcdir)/xgl \ $(XGLMODULES_CFLAGS) -noinst_LIBRARIES = libxgl.a - -libxgl_a_SOURCES = \ - xgl.h \ - xglmodule.h \ - xglglx.h \ - xglinput.c \ - xgloutput.c \ - xglcmap.c \ - xglparse.c \ - xglscreen.c \ - xglarea.c \ - xglgeometry.c \ - xglpixmap.c \ - xglsync.c \ - xglsolid.c \ - xgltile.c \ - xglcopy.c \ - xglfill.c \ - xglwindow.c \ - xglget.c \ - xglgc.c \ - xglshm.c \ - xglcompose.c \ - xglpict.c \ - xglglyph.c \ - xgltrap.c \ - xglloader.c \ - xglhash.c \ - xglglx.c \ - xglxv.c - EXTRA_DIST = \ xglmodule.h Xgl_LDFLAGS = -export-dynamic Xgl_SOURCES = \ xglinit.c \ + xglmodule.h \ + xglglx.h \ + xglinput.c \ + xgloutput.c \ + xglparse.c \ + xglscreen.c \ + xglloader.c \ + xglhash.c \ + xglglx.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/fb/fbcmap.c XGL_LIBS = \ - libxgl.a \ + $(top_srcdir)/xgl/libxgl.la \ @XGL_LIBS@ \ $(XSERVER_LIBS) diff --git a/hw/xgl/glx/Makefile.am b/hw/xgl/glx/Makefile.am index 314c02e96..76c4d2d7f 100644 --- a/hw/xgl/glx/Makefile.am +++ b/hw/xgl/glx/Makefile.am @@ -15,6 +15,7 @@ AM_CFLAGS = \ -I$(top_srcdir)/GL/include \ -I@MESA_SOURCE@/include \ -I@MESA_SOURCE@/src/mesa/glapi \ + -I$(top_srcdir)/xgl \ $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ diff --git a/hw/xgl/glx/module/Makefile.am b/hw/xgl/glx/module/Makefile.am index 103b041bf..ad132ae2f 100644 --- a/hw/xgl/glx/module/Makefile.am +++ b/hw/xgl/glx/module/Makefile.am @@ -6,6 +6,7 @@ AM_CFLAGS = \ @DIX_CFLAGS@ \ @LIBDRM_CFLAGS@ \ @DRIPROTO_CFLAGS@ \ + -I$(top_srcdir)/xgl \ -I$(srcdir)/.. \ -I$(srcdir)/../.. \ $(XGLXMODULES_CFLAGS) diff --git a/hw/xgl/glxext/Makefile.am b/hw/xgl/glxext/Makefile.am index 830b2d17b..4518cfb6d 100644 --- a/hw/xgl/glxext/Makefile.am +++ b/hw/xgl/glxext/Makefile.am @@ -9,6 +9,7 @@ AM_CFLAGS = \ $(XGLMODULES_CFLAGS) \ -I$(top_srcdir)/GL/glx \ -I$(top_srcdir)/GL/include \ + -I$(top_srcdir)/xgl \ -I$(top_srcdir)/hw/xgl \ -I@MESA_SOURCE@/include \ -I@MESA_SOURCE@/src/mesa/glapi diff --git a/hw/xgl/glxext/module/Makefile.am b/hw/xgl/glxext/module/Makefile.am index 66ea80afd..9fb36c763 100644 --- a/hw/xgl/glxext/module/Makefile.am +++ b/hw/xgl/glxext/module/Makefile.am @@ -3,6 +3,7 @@ AM_CFLAGS = \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ $(XGLMODULES_CFLAGS) \ + -I$(top_srcdir)/xgl \ -I$(top_srcdir)/hw/xgl libglxext_la_LDFLAGS = -avoid-version diff --git a/xgl/Makefile.am b/xgl/Makefile.am new file mode 100644 index 000000000..494a73beb --- /dev/null +++ b/xgl/Makefile.am @@ -0,0 +1,42 @@ +noinst_LTLIBRARIES = libxgl.la + +INCLUDES = -I@MESA_SOURCE@/include \ + -I$(top_srcdir)/GL/mesa/glapi \ + -I$(top_srcdir)/GL/glx \ + -I$(top_srcdir)/GL/include \ + -I$(top_srcdir)/hw/xfree86/os-support \ + -I$(top_srcdir)/hw/xfree86/os-support/bus \ + -I$(top_srcdir)/hw/xfree86/common + +# -DXFree86Server is required because the X11 driver in Mesa thinks that +# symbol means "being built in the server" +AM_CFLAGS = \ + @DIX_CFLAGS@ \ + @LIBDRM_CFLAGS@ \ + @DRIPROTO_CFLAGS@ \ + $(XGL_CFLAGS) \ + @GLX_DEFINES@ \ + -DXFree86Server + +libxgl_la_SOURCES = \ + xgl.h \ + xglarea.c \ + xglcmap.c \ + xglcompose.c \ + xglcopy.c \ + xglfill.c \ + xglgc.c \ + xglgeometry.c \ + xglget.c \ + xglglyph.c \ + xglpict.c \ + xglpixmap.c \ + xglshm.c \ + xglsolid.c \ + xglsync.c \ + xgltile.c \ + xgltrap.c \ + xglwindow.c \ + xglxv.c + +libxgl_la_LIBADD = $(XGL_LIBS) diff --git a/hw/xgl/xgl.h b/xgl/xgl.h similarity index 100% rename from hw/xgl/xgl.h rename to xgl/xgl.h diff --git a/hw/xgl/xglarea.c b/xgl/xglarea.c similarity index 100% rename from hw/xgl/xglarea.c rename to xgl/xglarea.c diff --git a/hw/xgl/xglcmap.c b/xgl/xglcmap.c similarity index 100% rename from hw/xgl/xglcmap.c rename to xgl/xglcmap.c diff --git a/hw/xgl/xglcompose.c b/xgl/xglcompose.c similarity index 100% rename from hw/xgl/xglcompose.c rename to xgl/xglcompose.c diff --git a/hw/xgl/xglcopy.c b/xgl/xglcopy.c similarity index 100% rename from hw/xgl/xglcopy.c rename to xgl/xglcopy.c diff --git a/hw/xgl/xglfill.c b/xgl/xglfill.c similarity index 100% rename from hw/xgl/xglfill.c rename to xgl/xglfill.c diff --git a/hw/xgl/xglgc.c b/xgl/xglgc.c similarity index 100% rename from hw/xgl/xglgc.c rename to xgl/xglgc.c diff --git a/hw/xgl/xglgeometry.c b/xgl/xglgeometry.c similarity index 100% rename from hw/xgl/xglgeometry.c rename to xgl/xglgeometry.c diff --git a/hw/xgl/xglget.c b/xgl/xglget.c similarity index 100% rename from hw/xgl/xglget.c rename to xgl/xglget.c diff --git a/hw/xgl/xglglyph.c b/xgl/xglglyph.c similarity index 100% rename from hw/xgl/xglglyph.c rename to xgl/xglglyph.c diff --git a/hw/xgl/xglpict.c b/xgl/xglpict.c similarity index 100% rename from hw/xgl/xglpict.c rename to xgl/xglpict.c diff --git a/hw/xgl/xglpixmap.c b/xgl/xglpixmap.c similarity index 100% rename from hw/xgl/xglpixmap.c rename to xgl/xglpixmap.c diff --git a/hw/xgl/xglshm.c b/xgl/xglshm.c similarity index 100% rename from hw/xgl/xglshm.c rename to xgl/xglshm.c diff --git a/hw/xgl/xglsolid.c b/xgl/xglsolid.c similarity index 100% rename from hw/xgl/xglsolid.c rename to xgl/xglsolid.c diff --git a/hw/xgl/xglsync.c b/xgl/xglsync.c similarity index 100% rename from hw/xgl/xglsync.c rename to xgl/xglsync.c diff --git a/hw/xgl/xgltile.c b/xgl/xgltile.c similarity index 100% rename from hw/xgl/xgltile.c rename to xgl/xgltile.c diff --git a/hw/xgl/xgltrap.c b/xgl/xgltrap.c similarity index 100% rename from hw/xgl/xgltrap.c rename to xgl/xgltrap.c diff --git a/hw/xgl/xglwindow.c b/xgl/xglwindow.c similarity index 100% rename from hw/xgl/xglwindow.c rename to xgl/xglwindow.c diff --git a/hw/xgl/xglxv.c b/xgl/xglxv.c similarity index 100% rename from hw/xgl/xglxv.c rename to xgl/xglxv.c