Skip to content
Snippets Groups Projects
Commit b018239f authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Build tsx11 layer as a separate shared library.

parent 886604c7
No related branches found
No related tags found
No related merge requests found
......@@ -60,8 +60,12 @@ WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
MAKEDEP = $(TOPOBJDIR)/tools/makedep
WRC = $(TOPOBJDIR)/tools/wrc/wrc
WMC = $(TOPOBJDIR)/tools/wmc/wmc
LDPATH = LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH"
LDPATH = LD_LIBRARY_PATH="$(TOPOBJDIR)/unicode:$$LD_LIBRARY_PATH"
DLLDIR = $(TOPOBJDIR)/dlls
LIBWINE = -L$(TOPOBJDIR)/library -lwine
LIBTSX11 = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
LIBUNICODE= -L$(TOPOBJDIR)/unicode -lwine_unicode
@SET_MAKE@
# Installation infos
......@@ -175,7 +179,7 @@ DLLS = \
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
.spec.spec.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -o $@ -spec $<
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
.c.glue.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
......@@ -198,7 +202,7 @@ $(MODULE).tmp.o: $(OBJS) Makefile.in
# Rule for main module spec file
$(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
# Rule to rebuild the resource compiler
......
......@@ -33,8 +33,15 @@ LIBPROGRAMS = \
# Libraries (not dlls) to build
LIBRARIES = \
library/libwine.$(LIBEXT) \
tsx11/libwine_tsx11.$(LIBEXT) \
unicode/libwine_unicode.$(LIBEXT)
# Libraries symlinks to create at the top level
LIBSYMLINKS = \
libwine.$(LIBEXT) \
libwine_tsx11.$(LIBEXT) \
libwine_unicode.$(LIBEXT)
# Sub-directories to run make depend/clean into
SUBDIRS = \
debugger \
......@@ -47,6 +54,7 @@ SUBDIRS = \
programs \
server \
tools \
tsx11 \
unicode
# Sub-directories to run make install into
......@@ -58,6 +66,7 @@ INSTALLSUBDIRS = \
library \
server \
tools \
tsx11 \
unicode
EMUOBJS = \
......@@ -65,7 +74,7 @@ EMUOBJS = \
DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) wine
all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) $(LIBSYMLINKS) wine
@echo "Wine build complete."
WINAPI_CHECK_EXTRA_FLAGS = --global
......@@ -76,7 +85,7 @@ Make.rules: Make.rules.in configure
@echo $? is newer than 'Make.rules', please rerun ./configure!
@exit 1
wine: libwine.$(LIBEXT) libwine_unicode.$(LIBEXT) dlls $(EMUOBJS)
wine: dlls $(EMUOBJS)
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS) $(LDFLAGS)
install:: all $(INSTALLSUBDIRS:%=%/__install__)
......@@ -94,6 +103,9 @@ $(EMUOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS) $(LIBRARIES): dummy
libwine.$(LIBEXT): library/libwine.$(LIBEXT)
$(RM) $@ && $(LN_S) library/libwine.$(LIBEXT) $@
libwine_tsx11.$(LIBEXT): tsx11/libwine_tsx11.$(LIBEXT)
$(RM) $@ && $(LN_S) tsx11/libwine_tsx11.$(LIBEXT) $@
libwine_unicode.$(LIBEXT): unicode/libwine_unicode.$(LIBEXT)
$(RM) $@ && $(LN_S) unicode/libwine_unicode.$(LIBEXT) $@
......@@ -103,14 +115,14 @@ $(DLLOBJS) $(PROGRAMS): tools
$(EMUOBJS): tools dlls
$(LIBPROGRAMS): tools dlls libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
$(LIBPROGRAMS): tools dlls
server tools: libwine_unicode.$(LIBEXT)
server tools: unicode/libwine_unicode.$(LIBEXT)
dlls: tools libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
dlls: tools $(LIBRARIES)
checklink::
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine -lwine_unicode $(LIBS) && $(RM) checklink
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(LIBWINE) $(LIBUNICODE) $(LIBS) && $(RM) checklink
install_programs: dummy
@cd programs && $(MAKE) install
......@@ -136,7 +148,7 @@ clean::
$(RM) wine
distclean: clean
$(RM) config.* TAGS Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man tools/winelauncher
$(RM) config.* TAGS Make.rules dlls/Makedll.rules programs/Makeprog.rules include/config.h documentation/wine.man documentation/wine.conf.man tools/winelauncher
$(RM) `find . \( -name Makefile -o -size 0 \) -print`
# We depend on configure above for checks, so we better don't use this rule.
......
......@@ -4825,9 +4825,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
else
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode \$(X_LIBS) \$(XLIB)"
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
echo $ac_n "checking whether the linker supports --[no]-whole-archive (Linux)""... $ac_c" 1>&6
echo "configure:4833: checking whether the linker supports --[no]-whole-archive (Linux)" >&5
if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then
......
......@@ -575,9 +575,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
else
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode \$(X_LIBS) \$(XLIB)"
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
ac_cv_c_whole_archive,
[saved_cflags=$CFLAGS
......
......@@ -3,8 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = x11drv
SOVERSION = 1.0
EXTRALIBS = $(X_LIBS) $(XLIB)
EXTRALIBS = $(LIBTSX11) $(X_LIBS) $(XLIB)
IMPORTS = user32 gdi32 kernel32
C_SRCS = \
......@@ -15,12 +14,10 @@ PROGRAMS = \
EXTRA_OBJS = \
$(TOPOBJDIR)/graphics/x11drv/x11drv.o \
$(TOPOBJDIR)/tsx11/tsx11.o \
$(TOPOBJDIR)/windows/x11drv/x11drv.o
SUBDIRS = \
$(TOPOBJDIR)/graphics/x11drv \
$(TOPOBJDIR)/tsx11 \
$(TOPOBJDIR)/windows/x11drv
@MAKE_DLL_RULES@
......
......@@ -34,6 +34,8 @@
DEFAULT_DEBUG_CHANNEL(x11drv);
static XKeyboardState keyboard_state;
static void (*old_tsx11_lock)(void);
static void (*old_tsx11_unlock)(void);
Display *display;
Screen *screen;
......@@ -54,6 +56,21 @@ static int error_handler(Display *display, XErrorEvent *error_evt)
return 0;
}
/***********************************************************************
* lock_tsx11
*/
static void lock_tsx11(void)
{
RtlEnterCriticalSection( &X11DRV_CritSection );
}
/***********************************************************************
* unlock_tsx11
*/
static void unlock_tsx11(void)
{
RtlLeaveCriticalSection( &X11DRV_CritSection );
}
/***********************************************************************
* get_server_startup
......@@ -256,6 +273,12 @@ static void process_attach(void)
get_server_startup();
setup_options();
/* setup TSX11 locking */
old_tsx11_lock = wine_tsx11_lock;
old_tsx11_unlock = wine_tsx11_unlock;
wine_tsx11_lock = lock_tsx11;
wine_tsx11_unlock = unlock_tsx11;
/* Open display */
if (!(display = TSXOpenDisplay( Options.display )))
......@@ -339,8 +362,11 @@ static void process_detach(void)
/* cleanup GDI */
X11DRV_GDI_Finalize();
#if 0 /* FIXME */
/* restore TSX11 locking */
wine_tsx11_lock = old_tsx11_lock;
wine_tsx11_unlock = old_tsx11_unlock;
#if 0 /* FIXME */
/* close the display */
XCloseDisplay( display );
display = NULL;
......
......@@ -16,6 +16,9 @@
#include <X11/extensions/shape.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern void TSXShapeCombineRectangles(Display*, Window, int, int, int, XRectangle*, int, int, int);
extern void TSXShapeCombineMask(Display*, Window, int, int, int, Pixmap, int);
......
......@@ -16,6 +16,9 @@
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern Bool TSXF86DGAQueryVersion(Display*,int*,int*);
extern Bool TSXF86DGAQueryExtension(Display*,int*,int*);
extern Status TSXF86DGAGetVideo(Display*,int,char**,int*,int*,int*);
......
......@@ -16,6 +16,9 @@
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern Bool TSXDGAQueryVersion(Display*, int*, int*);
extern Bool TSXDGAQueryExtension(Display*, int*, int*);
extern XDGAMode* TSXDGAQueryModes(Display*, int, int*);
......
......@@ -19,6 +19,9 @@
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern Bool TSXF86VidModeQueryVersion(Display*,int*,int*);
extern Bool TSXF86VidModeQueryExtension(Display*,int*,int*);
extern Bool TSXF86VidModeGetModeLine(Display*,int,int*,XF86VidModeModeLine*);
......
......@@ -14,6 +14,9 @@
#include <X11/Xlib.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern XFontStruct * TSXLoadQueryFont(Display*, const char*);
extern XModifierKeymap * TSXGetModifierMapping(Display*);
extern XImage * TSXCreateImage(Display*, Visual*, unsigned int, int, int, char*, unsigned int, unsigned int, int, int);
......
......@@ -15,6 +15,9 @@
#include <X11/xpm.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern int TSXpmCreatePixmapFromData(Display *, Drawable, char **, Pixmap *, Pixmap *, XpmAttributes *);
extern int TSXpmAttributesSize(void);
......
......@@ -15,6 +15,9 @@
#include <X11/Xlib.h>
#include <X11/Xresource.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern XrmQuark TSXrmUniqueQuark(void);
extern int TSXrmGetResource(XrmDatabase, const char*, const char*, char**, XrmValue*);
extern XrmDatabase TSXrmGetFileDatabase(const char*);
......
......@@ -16,6 +16,9 @@
#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern Bool TSXShmQueryExtension(Display *);
extern Bool TSXShmQueryVersion(Display *, int *, int *, Bool *);
extern int TSXShmPixmapFormat(Display *);
......
......@@ -16,6 +16,9 @@
#include <X11/Xresource.h>
#include <X11/Xutil.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern XClassHint * TSXAllocClassHint(void);
extern XSizeHints * TSXAllocSizeHints(void);
extern XWMHints * TSXAllocWMHints(void);
......
......@@ -18,6 +18,9 @@
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xvlib.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern int TSXvQueryExtension(Display*, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*);
extern int TSXvQueryAdaptors(Display*, Window, unsigned int*, XvAdaptorInfo**);
extern int TSXvQueryEncodings(Display*, XvPortID, unsigned int*, XvEncodingInfo**);
......
......@@ -112,6 +112,9 @@ foreach $name (@dolist) {
$pre_file
$x11_incl#include <X11/$extensions_dir$inc_name.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
END
print OUTC <<END;
......@@ -126,11 +129,8 @@ END
$pre_file
$x11_incl#include <X11/$extensions_dir$inc_name.h>
#include "debugtools.h"
#include "ts_$lcname.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11);
END
if($name eq "xpm") { # Handle as special case.
......@@ -487,13 +487,11 @@ sub raw_output_fn {
# print OUTH "#define $fn_name TS$fn_name\n";
print OUTC "{\n";
print OUTC " $resultdecl;\n" if $resultdecl;
print OUTC " TRACE(\"Call $fn_name\\n\");\n";
print OUTC " EnterCriticalSection( &X11DRV_CritSection );\n";
print OUTC " wine_tsx11_lock();\n";
print OUTC " ";
print OUTC "r = " if $resultdecl;
print OUTC "$fn_name($actuals);\n";
print OUTC " LeaveCriticalSection( &X11DRV_CritSection );\n";
print OUTC " TRACE(\"Ret $fn_name\\n\");\n";
print OUTC " wine_tsx11_unlock();\n";
print OUTC " return r;\n" if $resultdecl;
print OUTC "}\n";
$want{$fn_name} = 2;
......
Makefile
libwine_tsx11.so.1.0
......@@ -3,9 +3,14 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = tsx11
LIBEXT = @LIBEXT@
MODULE = none
SOVERSION = 1.0
SONAME = libwine_tsx11.so
EXTRALIBS = $(X_LIBS) $(XLIB)
C_SRCS = \
locking.c \
ts_xf86dga.c \
ts_xf86dga2.c \
ts_xf86vmode.c \
......@@ -17,11 +22,36 @@ C_SRCS = \
ts_shape.c \
ts_xpm.c
all: $(MODULE).o
all: libwine_tsx11.$(LIBEXT)
@MAKE_RULES@
$(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
$(LDCOMBINE) $(OBJS) -o $@
libwine_tsx11.so.$(SOVERSION): $(OBJS)
$(LDSHARED) $(OBJS) -o $@
libwine_tsx11.so: libwine_tsx11.so.$(SOVERSION)
$(RM) $@ && $(LN_S) libwine_tsx11.so.$(SOVERSION) $@
libwine_tsx11.a: $(OBJS)
$(RM) $@
$(AR) $@ $(OBJS)
$(RANLIB) $@
install_so: libwine_tsx11.so.$(SOVERSION)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) libwine_tsx11.so.$(SOVERSION) $(libdir)/libwine_tsx11.so.$(SOVERSION)
cd $(libdir) && $(RM) libwine_tsx11.so && $(LN_S) libwine_tsx11.so.$(SOVERSION) libwine_tsx11.so
install_a: libwine_tsx11.a
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_DATA) libwine_tsx11.a $(libdir)/libwine_tsx11.a
install:: all $(LIBEXT:%=install_%)
uninstall::
cd $(libdir) && $(RM) libwine_tsx11.a libwine_tsx11.so libwine_tsx11.so.$(SOVERSION)
clean::
$(RM) libwine_tsx11.so.$(SOVERSION)
### Dependencies:
/*
* Thread-safe X11 locking stubs
*/
static void nop(void)
{
}
void (*wine_tsx11_lock)(void) = nop;
void (*wine_tsx11_unlock)(void) = nop;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment