Commit 7e495e1d authored by Alexandre Julliard's avatar Alexandre Julliard

Make unicode.o into a separate ELF library so that we can use it from

the wineserver too.
parent 3084b586
...@@ -173,7 +173,7 @@ DLLS = \ ...@@ -173,7 +173,7 @@ DLLS = \
$(CC) -c -o $*.o $< $(CC) -c -o $*.o $<
.mc.rc: .mc.rc:
$(WMC) -i -H /dev/null -o $@ $< LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WMC) -i -H /dev/null -o $@ $<
.rc.s: .rc.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $< $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
......
...@@ -32,6 +32,10 @@ PROGRAMS = \ ...@@ -32,6 +32,10 @@ PROGRAMS = \
LIBPROGRAMS = \ LIBPROGRAMS = \
debugger/winedbg debugger/winedbg
# Libraries (not dlls) to build
LIBRARIES = \
unicode/libwine_unicode.$(LIBEXT)
# Sub-directories to run make depend/clean into # Sub-directories to run make depend/clean into
SUBDIRS = \ SUBDIRS = \
console \ console \
...@@ -75,7 +79,8 @@ INSTALLSUBDIRS = \ ...@@ -75,7 +79,8 @@ INSTALLSUBDIRS = \
documentation \ documentation \
include \ include \
server \ server \
tools tools \
unicode
LIBOBJS = \ LIBOBJS = \
controls/controls.o \ controls/controls.o \
...@@ -98,7 +103,6 @@ LIBOBJS = \ ...@@ -98,7 +103,6 @@ LIBOBJS = \
relay32/relay32.o \ relay32/relay32.o \
resources/resources.o \ resources/resources.o \
scheduler/scheduler.o \ scheduler/scheduler.o \
unicode/unicode.o \
win32/win32.o \ win32/win32.o \
windows/windows.o windows/windows.o
...@@ -126,20 +130,20 @@ Make.rules: Make.rules.in configure ...@@ -126,20 +130,20 @@ Make.rules: Make.rules.in configure
@echo $? is newer than 'Make.rules', please rerun ./configure! @echo $? is newer than 'Make.rules', please rerun ./configure!
@exit 1 @exit 1
wine: lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMUOBJS) wine: libwine.$(LIBEXT) libwine_unicode.$(LIBEXT) dlls $(EMUOBJS)
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS) $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS)
llib-lwine.ln : $(LIBLINTS) llib-lwine.ln : $(LIBLINTS)
$(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
install_so: lib$(MODULE).so.$(SOVERSION) install_so: libwine.so.$(SOVERSION)
[ -d $(libdir) ] || $(MKDIR) $(libdir) [ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION) $(INSTALL_PROGRAM) libwine.so.$(SOVERSION) $(libdir)/libwine.so.$(SOVERSION)
cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so cd $(libdir) && $(RM) libwine.so && $(LN_S) libwine.so.$(SOVERSION) libwine.so
install_a: lib$(MODULE).a install_a: libwine.a
[ -d $(libdir) ] || $(MKDIR) $(libdir) [ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a $(INSTALL_DATA) libwine.a $(libdir)/libwine.a
install:: all $(LIBEXT:%=install_%) $(INSTALLSUBDIRS:%=%/__install__) install:: all $(LIBEXT:%=install_%) $(INSTALLSUBDIRS:%=%/__install__)
[ -d $(bindir) ] || $(MKDIR) $(bindir) [ -d $(bindir) ] || $(MKDIR) $(bindir)
...@@ -151,29 +155,36 @@ uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__) ...@@ -151,29 +155,36 @@ uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION)
cd $(bindir) && $(RM) wine dosmod cd $(bindir) && $(RM) wine dosmod
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in libwine.so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
$(LDSHARED) $(OBJS) -o $@ $(LDSHARED) $(OBJS) -o $@
lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION) libwine.so: libwine.so.$(SOVERSION)
$(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@ $(RM) $@ && $(LN_S) libwine.so.$(SOVERSION) $@
lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in libwine.a: $(OBJS) Makefile.in Make.rules.in
$(RM) $@ $(RM) $@
$(AR) $@ $(OBJS) $(AR) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS): dummy $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS) $(LIBRARIES): dummy
@cd `dirname $@` && $(MAKE) `basename $@` @cd `dirname $@` && $(MAKE) `basename $@`
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(DLLDIR): tools # Dependencies between directories
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) dlls: tools
$(LIBPROGRAMS): tools dlls libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
server tools dlls: libwine_unicode.$(LIBEXT)
$(LIBPROGRAMS): tools dlls lib$(MODULE).$(LIBEXT) libwine_unicode.$(LIBEXT): unicode/libwine_unicode.$(LIBEXT)
$(RM) $@ && $(LN_S) unicode/libwine_unicode.$(LIBEXT) $@
$(LIBLINTS) $(EMULINTS): dummy $(LIBLINTS) $(EMULINTS): dummy
@cd `dirname $@` && $(MAKE) lint @cd `dirname $@` && $(MAKE) lint
checklink:: checklink::
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LIBS) && $(RM) checklink $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine -lwine_unicode $(LIBS) && $(RM) checklink
install_programs: dummy install_programs: dummy
@cd programs && $(MAKE) install @cd programs && $(MAKE) install
...@@ -196,7 +207,7 @@ htmlpages: ...@@ -196,7 +207,7 @@ htmlpages:
for i in $(SUBDIRS); do (cd $$i && $(MAKE) html); done for i in $(SUBDIRS); do (cd $$i && $(MAKE) html); done
clean:: clean::
$(RM) wine libwine.so.1.0 TAGS $(RM) wine libwine.so.$(SOVERSION) TAGS
distclean: clean distclean: clean
$(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
......
...@@ -4553,9 +4553,9 @@ DLLFLAGS="" ...@@ -4553,9 +4553,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC" DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine" DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
else else
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine \$(X_LIBS) \$(XLIB)" DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode \$(X_LIBS) \$(XLIB)"
echo $ac_n "checking whether the linker supports --[no]-whole-archive (Linux)""... $ac_c" 1>&6 echo $ac_n "checking whether the linker supports --[no]-whole-archive (Linux)""... $ac_c" 1>&6
echo "configure:4561: checking whether the linker supports --[no]-whole-archive (Linux)" >&5 echo "configure:4561: checking whether the linker supports --[no]-whole-archive (Linux)" >&5
if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then
......
...@@ -507,9 +507,9 @@ DLLFLAGS="" ...@@ -507,9 +507,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC" DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine" DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
else else
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine \$(X_LIBS) \$(XLIB)" DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode \$(X_LIBS) \$(XLIB)"
AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)], AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
ac_cv_c_whole_archive, ac_cv_c_whole_archive,
[saved_cflags=$CFLAGS [saved_cflags=$CFLAGS
......
...@@ -45,7 +45,7 @@ $(ALTNAMES:%=lib%.a): lib$(MODULE).a ...@@ -45,7 +45,7 @@ $(ALTNAMES:%=lib%.a): lib$(MODULE).a
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT)) IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS) checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine -lwine_unicode $(EXTRALIBS) $(LIBS) && $(RM) checklink
$(IMPORTLIBS): dummy $(IMPORTLIBS): dummy
@cd $(DLLDIR) && $(MAKE) `basename $@` @cd $(DLLDIR) && $(MAKE) `basename $@`
......
...@@ -42,7 +42,7 @@ all: $(PROGRAMS) ...@@ -42,7 +42,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
wineserver: $(OBJS) wineserver: $(OBJS)
$(CC) -o $(PROGRAMS) $(OBJS) $(LIBS) $(CC) -o $(PROGRAMS) $(OBJS) -L$(TOPOBJDIR) -lwine_unicode $(LIBS)
install:: $(PROGRAMS) install:: $(PROGRAMS)
[ -d $(bindir) ] || $(MKDIR) $(bindir) [ -d $(bindir) ] || $(MKDIR) $(bindir)
......
...@@ -144,7 +144,7 @@ static int atom_hash( struct atom_table *table, const WCHAR *str ) ...@@ -144,7 +144,7 @@ static int atom_hash( struct atom_table *table, const WCHAR *str )
{ {
int i; int i;
WCHAR hash = 0; WCHAR hash = 0;
for (i = 0; str[i]; i++) hash ^= towupper(str[i]) + i; for (i = 0; str[i]; i++) hash ^= toupperW(str[i]) + i;
return hash % table->entries_count; return hash % table->entries_count;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <assert.h> #include <assert.h>
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999 Alexandre Julliard * Copyright (C) 1999 Alexandre Julliard
*/ */
#include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include "unicode.h" #include "unicode.h"
......
...@@ -11,47 +11,10 @@ ...@@ -11,47 +11,10 @@
#error This file can only be used in the Wine server #error This file can only be used in the Wine server
#endif #endif
#include "config.h"
#include <ctype.h>
#ifdef HAVE_WCTYPE_H
#include <wctype.h>
#endif
#include "windef.h" #include "windef.h"
#include "wine/unicode.h"
#include "object.h" #include "object.h"
static inline size_t strlenW( const WCHAR *str )
{
const WCHAR *s = str;
while (*s) s++;
return s - str;
}
static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
{
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
return *str1 - *str2;
}
#ifndef HAVE_WCTYPE_H
/* FIXME */
#define towupper(ch) (HIBYTE(ch) ? ch : (WCHAR)toupper(LOBYTE(ch)))
#endif
static inline int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
{
while (*str1 && (towupper(*str1) == towupper(*str2))) { str1++; str2++; }
return towupper(*str1) - towupper(*str2);
}
static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
{
const WCHAR *ret = dst;
while ((*dst++ = *src++));
return (WCHAR *)ret;
}
static inline WCHAR *strdupW( const WCHAR *str ) static inline WCHAR *strdupW( const WCHAR *str )
{ {
size_t len = (strlenW(str) + 1) * sizeof(WCHAR); size_t len = (strlenW(str) + 1) * sizeof(WCHAR);
......
...@@ -4,6 +4,7 @@ TOPOBJDIR = ../.. ...@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
YACCOPT = #-v YACCOPT = #-v
LIBEXT = @LIBEXT@
PROGRAMS = wmc PROGRAMS = wmc
MODULE = none MODULE = none
...@@ -18,17 +19,17 @@ C_SRCS = \ ...@@ -18,17 +19,17 @@ C_SRCS = \
EXTRA_SRCS = mcy.y EXTRA_SRCS = mcy.y
EXTRA_OBJS = y.tab.o EXTRA_OBJS = y.tab.o
all: check_unicode $(PROGRAMS) all: $(PROGRAMS)
depend mcl.o: y.tab.h depend mcl.o: y.tab.h
@MAKE_RULES@ @MAKE_RULES@
wmc: $(OBJS) $(TOPOBJDIR)/unicode/unicode.o wmc: $(OBJS) $(TOPOBJDIR)/libwine_unicode.$(LIBEXT)
$(CC) $(CFLAGS) -o wmc $(OBJS) $(TOPOBJDIR)/unicode/unicode.o $(LEXLIB) $(CC) $(CFLAGS) -o wmc $(OBJS) -L$(TOPOBJDIR) -lwine_unicode $(LEXLIB)
$(TOPOBJDIR)/unicode/unicode.o check_unicode: $(TOPOBJDIR)/libwine_unicode.$(LIBEXT):
cd $(TOPOBJDIR)/unicode && $(MAKE) cd $(TOPOBJDIR) && $(MAKE) libwine_unicode.$(LIBEXT)
y.tab.c y.tab.h: mcy.y y.tab.c y.tab.h: mcy.y
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/mcy.y $(YACC) $(YACCOPT) -d -t $(SRCDIR)/mcy.y
......
Makefile Makefile
libwine_unicode.so.1.0
...@@ -3,7 +3,11 @@ TOPSRCDIR = @top_srcdir@ ...@@ -3,7 +3,11 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .. TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = unicode LIBEXT = @LIBEXT@
LDSHARED = @LDSHARED@
MODULE = none
SOVERSION = 1.0
SONAME = libwine_unicode.so
CODEPAGES = \ CODEPAGES = \
037 \ 037 \
...@@ -69,8 +73,36 @@ C_SRCS = \ ...@@ -69,8 +73,36 @@ C_SRCS = \
wctomb.c \ wctomb.c \
$(CODEPAGES:%=c_%.c) $(CODEPAGES:%=c_%.c)
all: $(MODULE).o all: libwine_unicode.$(LIBEXT)
@MAKE_RULES@ @MAKE_RULES@
libwine_unicode.so.$(SOVERSION): $(OBJS)
$(LDSHARED) $(OBJS) -o $@
libwine_unicode.so: libwine_unicode.so.$(SOVERSION)
$(RM) $@ && $(LN_S) libwine_unicode.so.$(SOVERSION) $@
libwine_unicode.a: $(OBJS)
$(RM) $@
$(AR) $@ $(OBJS)
$(RANLIB) $@
install_so: libwine_unicode.so.$(SOVERSION)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) libwine_unicode.so.$(SOVERSION) $(libdir)/libwine_unicode.so.$(SOVERSION)
cd $(libdir) && $(RM) libwine_unicode.so && $(LN_S) libwine_unicode.so.$(SOVERSION) libwine_unicode.so
install_a: libwine_unicode.a
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_DATA) libwine_unicode.a $(libdir)/libwine_unicode.a
install:: all $(LIBEXT:%=install_%)
uninstall::
cd $(libdir) && $(RM) libwine_unicode.a libwine_unicode.so libwine_unicode.so.$(SOVERSION)
clean::
$(RM) libwine_unicode.so.$(SOVERSION)
### Dependencies: ### Dependencies:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment