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

the wineserver too.
oldstable
Alexandre Julliard 2000-07-25 21:01:59 +00:00
parent 3084b58606
commit 7e495e1d66
13 changed files with 80 additions and 70 deletions

View File

@ -173,7 +173,7 @@ DLLS = \
$(CC) -c -o $*.o $<
.mc.rc:
$(WMC) -i -H /dev/null -o $@ $<
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WMC) -i -H /dev/null -o $@ $<
.rc.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<

View File

@ -32,6 +32,10 @@ PROGRAMS = \
LIBPROGRAMS = \
debugger/winedbg
# Libraries (not dlls) to build
LIBRARIES = \
unicode/libwine_unicode.$(LIBEXT)
# Sub-directories to run make depend/clean into
SUBDIRS = \
console \
@ -75,7 +79,8 @@ INSTALLSUBDIRS = \
documentation \
include \
server \
tools
tools \
unicode
LIBOBJS = \
controls/controls.o \
@ -98,7 +103,6 @@ LIBOBJS = \
relay32/relay32.o \
resources/resources.o \
scheduler/scheduler.o \
unicode/unicode.o \
win32/win32.o \
windows/windows.o
@ -126,20 +130,20 @@ Make.rules: Make.rules.in configure
@echo $? is newer than 'Make.rules', please rerun ./configure!
@exit 1
wine: lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMUOBJS)
wine: libwine.$(LIBEXT) libwine_unicode.$(LIBEXT) dlls $(EMUOBJS)
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS)
llib-lwine.ln : $(LIBLINTS)
$(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
install_so: lib$(MODULE).so.$(SOVERSION)
install_so: libwine.so.$(SOVERSION)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
$(INSTALL_PROGRAM) libwine.so.$(SOVERSION) $(libdir)/libwine.so.$(SOVERSION)
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)
$(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
$(INSTALL_DATA) libwine.a $(libdir)/libwine.a
install:: all $(LIBEXT:%=install_%) $(INSTALLSUBDIRS:%=%/__install__)
[ -d $(bindir) ] || $(MKDIR) $(bindir)
@ -151,29 +155,36 @@ uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION)
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 $@
lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
$(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
libwine.so: libwine.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) $@
$(AR) $@ $(OBJS)
$(RANLIB) $@
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS): dummy
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS) $(LIBRARIES): dummy
@cd `dirname $@` && $(MAKE) `basename $@`
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(DLLDIR): tools
# Dependencies between directories
$(LIBPROGRAMS): tools dlls lib$(MODULE).$(LIBEXT)
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) dlls: tools
$(LIBPROGRAMS): tools dlls libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
server tools dlls: libwine_unicode.$(LIBEXT)
libwine_unicode.$(LIBEXT): unicode/libwine_unicode.$(LIBEXT)
$(RM) $@ && $(LN_S) unicode/libwine_unicode.$(LIBEXT) $@
$(LIBLINTS) $(EMULINTS): dummy
@cd `dirname $@` && $(MAKE) lint
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
@cd programs && $(MAKE) install
@ -196,7 +207,7 @@ htmlpages:
for i in $(SUBDIRS); do (cd $$i && $(MAKE) html); done
clean::
$(RM) wine libwine.so.1.0 TAGS
$(RM) wine libwine.so.$(SOVERSION) TAGS
distclean: clean
$(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man

4
configure vendored
View File

@ -4553,9 +4553,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
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 "configure:4561: checking whether the linker supports --[no]-whole-archive (Linux)" >&5
if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then

View File

@ -507,9 +507,9 @@ DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
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_cv_c_whole_archive,
[saved_cflags=$CFLAGS

View File

@ -45,7 +45,7 @@ $(ALTNAMES:%=lib%.a): lib$(MODULE).a
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
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
@cd $(DLLDIR) && $(MAKE) `basename $@`

View File

@ -42,7 +42,7 @@ all: $(PROGRAMS)
@MAKE_RULES@
wineserver: $(OBJS)
$(CC) -o $(PROGRAMS) $(OBJS) $(LIBS)
$(CC) -o $(PROGRAMS) $(OBJS) -L$(TOPOBJDIR) -lwine_unicode $(LIBS)
install:: $(PROGRAMS)
[ -d $(bindir) ] || $(MKDIR) $(bindir)

View File

@ -144,7 +144,7 @@ static int atom_hash( struct atom_table *table, const WCHAR *str )
{
int i;
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;
}

View File

@ -11,6 +11,7 @@
*/
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>

View File

@ -4,6 +4,7 @@
* Copyright (C) 1999 Alexandre Julliard
*/
#include <ctype.h>
#include <stdio.h>
#include "unicode.h"

View File

@ -11,47 +11,10 @@
#error This file can only be used in the Wine server
#endif
#include "config.h"
#include <ctype.h>
#ifdef HAVE_WCTYPE_H
#include <wctype.h>
#endif
#include "windef.h"
#include "wine/unicode.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 )
{
size_t len = (strlenW(str) + 1) * sizeof(WCHAR);

View File

@ -4,6 +4,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
YACCOPT = #-v
LIBEXT = @LIBEXT@
PROGRAMS = wmc
MODULE = none
@ -18,17 +19,17 @@ C_SRCS = \
EXTRA_SRCS = mcy.y
EXTRA_OBJS = y.tab.o
all: check_unicode $(PROGRAMS)
all: $(PROGRAMS)
depend mcl.o: y.tab.h
@MAKE_RULES@
wmc: $(OBJS) $(TOPOBJDIR)/unicode/unicode.o
$(CC) $(CFLAGS) -o wmc $(OBJS) $(TOPOBJDIR)/unicode/unicode.o $(LEXLIB)
wmc: $(OBJS) $(TOPOBJDIR)/libwine_unicode.$(LIBEXT)
$(CC) $(CFLAGS) -o wmc $(OBJS) -L$(TOPOBJDIR) -lwine_unicode $(LEXLIB)
$(TOPOBJDIR)/unicode/unicode.o check_unicode:
cd $(TOPOBJDIR)/unicode && $(MAKE)
$(TOPOBJDIR)/libwine_unicode.$(LIBEXT):
cd $(TOPOBJDIR) && $(MAKE) libwine_unicode.$(LIBEXT)
y.tab.c y.tab.h: mcy.y
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/mcy.y

View File

@ -1 +1,2 @@
Makefile
libwine_unicode.so.1.0

View File

@ -3,7 +3,11 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = unicode
LIBEXT = @LIBEXT@
LDSHARED = @LDSHARED@
MODULE = none
SOVERSION = 1.0
SONAME = libwine_unicode.so
CODEPAGES = \
037 \
@ -69,8 +73,36 @@ C_SRCS = \
wctomb.c \
$(CODEPAGES:%=c_%.c)
all: $(MODULE).o
all: libwine_unicode.$(LIBEXT)
@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: