Implemented on-demand loading of builtin dlls using dlopen().

This commit is contained in:
Alexandre Julliard 2000-04-24 17:17:49 +00:00
parent 59b0d7b202
commit e1e75371d9
31 changed files with 359 additions and 276 deletions

View File

@ -5,4 +5,3 @@ config.log
config.status config.status
libwine.so.1.0 libwine.so.1.0
wine wine
wine.sym

View File

@ -30,7 +30,6 @@ X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@ X_LIBS = @X_LIBS@
XLIB = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ XLIB = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
DLL_LINK = @DLL_LINK@ DLL_LINK = @DLL_LINK@
WINELIB = $(DLL_LINK)
LIBS = @LIBS@ LIBS = @LIBS@
YACC = @YACC@ YACC = @YACC@
LEX = @LEX@ LEX = @LEX@

View File

@ -131,7 +131,7 @@ EXTRA_OBJS = $(LIBOBJS)
EMU_TARGET = @EMU_TARGET@ EMU_TARGET = @EMU_TARGET@
all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET) all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMU_TARGET)
@echo "Wine build complete." @echo "Wine build complete."
LIBLINTS = $(LIBOBJS:.o=.ln) LIBLINTS = $(LIBOBJS:.o=.ln)
@ -144,15 +144,12 @@ WINAPI_CHECK_EXTRA_FLAGS = --global
@MAKE_RULES@ @MAKE_RULES@
all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
Make.rules: Make.rules.in configure 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 wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS) wine: lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMUOBJS)
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS)
nm -n wine | grep -v _compiled >wine.sym
llib-lwine.ln : $(LIBLINTS) llib-lwine.ln : $(LIBLINTS)
$(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
@ -168,8 +165,6 @@ install_a: lib$(MODULE).a
install_wine: wine install_wine: wine
[ -d $(bindir) ] || $(MKDIR) $(bindir) [ -d $(bindir) ] || $(MKDIR) $(bindir)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
[ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
$(INSTALL_PROGRAM) wine $(bindir)/wine $(INSTALL_PROGRAM) wine $(bindir)/wine
install:: $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%) install:: $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%)
@ -179,7 +174,7 @@ install:: $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=instal
$(INSTALL_PROGRAM) debugger/winedbg $(bindir)/winedbg $(INSTALL_PROGRAM) debugger/winedbg $(bindir)/winedbg
uninstall:: uninstall::
cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION)
cd $(bindir) && $(RM) wine wineserver dosmod winedbg cd $(bindir) && $(RM) wine wineserver dosmod winedbg
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
@ -194,12 +189,14 @@ lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
$(RANLIB) $@ $(RANLIB) $@
checklink:: checklink::
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LIBS) && $(RM) checklink
$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS): $(TOOLSUBDIRS) dummy $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS): $(TOOLSUBDIRS) dummy
@cd `dirname $@` && $(MAKE) `basename $@` @cd `dirname $@` && $(MAKE) `basename $@`
$(LIBPROGRAMS): lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(DLLDIR): $(TOOLSUBDIRS) dummy
$(LIBPROGRAMS): lib$(MODULE).$(LIBEXT) $(DLLDIR)
$(LIBLINTS) $(EMULINTS): dummy $(LIBLINTS) $(EMULINTS): dummy
@cd `dirname $@` && $(MAKE) lint @cd `dirname $@` && $(MAKE) lint
@ -232,7 +229,7 @@ htmlpages:
for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
clean:: clean::
$(RM) wine wine.sym libwine.so.1.0 TAGS $(RM) wine libwine.so.1.0 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

409
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -110,9 +110,11 @@ AC_CHECK_HEADERS(dlfcn.h,
AC_DEFINE(HAVE_DL_API), AC_DEFINE(HAVE_DL_API),
AC_CHECK_LIB(dl,dlopen, AC_CHECK_LIB(dl,dlopen,
AC_DEFINE(HAVE_DL_API) AC_DEFINE(HAVE_DL_API)
LIBS="$LIBS -ldl" LIBS="$LIBS -ldl",
LIBEXT="a"
) )
) ),
LIBEXT="a"
) )
AC_SUBST(XLIB) AC_SUBST(XLIB)
AC_SUBST(X_SRCS) AC_SUBST(X_SRCS)
@ -467,12 +469,13 @@ fi
DLLFLAGS="" DLLFLAGS=""
BUILDFLAGS="" BUILDFLAGS=""
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine"
if test "$LIBEXT" = "so"; then if test "$LIBEXT" = "so"; then
BUILDFLAGS="-pic" BUILDFLAGS="-pic"
DLLFLAGS="-fPIC" DLLFLAGS="-fPIC"
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine"
else else
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine \$(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

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = winedbg PROGRAMS = winedbg
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
WRCEXTRA = -A -p $* WRCEXTRA = -A -p $*
C_SRCS = \ C_SRCS = \
@ -45,6 +44,6 @@ lex.yy.c: debug.l
$(LEX) -8 -I $(SRCDIR)/debug.l $(LEX) -8 -I $(SRCDIR)/debug.l
winedbg: $(OBJS) winedbg: $(OBJS)
$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o $@ $(OBJS) $(DLL_LINK) $(LIBS)
### Dependencies: ### Dependencies:

View File

@ -5,6 +5,7 @@
# SOVERSION : version of the .so file # SOVERSION : version of the .so file
# ALTNAMES : alternate names for this dll (optional) # ALTNAMES : alternate names for this dll (optional)
# IMPORTS : dlls to import (optional) # IMPORTS : dlls to import (optional)
# EXTRALIBS : extra libraries to link in (optional)
# #
# plus all variables required by the global Make.rules.in # plus all variables required by the global Make.rules.in
# #
@ -23,7 +24,7 @@ all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
# Rules for .so files # Rules for .so files
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
$(LDSHARED) $(OBJS) -o $@ $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
$(ALLNAMES): lib$(MODULE).so.$(SOVERSION) $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
$(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@ $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
@ -43,7 +44,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$(DLLDIR) $(IMPORTS:%=-l%) -L$(TOPOBJDIR) -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
$(IMPORTLIBS): dummy $(IMPORTLIBS): dummy
@cd $(DLLDIR) && $(MAKE) `basename $@` @cd $(DLLDIR) && $(MAKE) `basename $@`

View File

@ -305,6 +305,30 @@ libwsock32.@LIBEXT@ libwinsock.@LIBEXT@: winsock/libwsock32.@LIBEXT@
libx11drv.@LIBEXT@: x11drv/libx11drv.@LIBEXT@ libx11drv.@LIBEXT@: x11drv/libx11drv.@LIBEXT@
$(RM) $@ && $(LN_S) x11drv/libx11drv.@LIBEXT@ $@ $(RM) $@ && $(LN_S) x11drv/libx11drv.@LIBEXT@ $@
# Inter-dll dependencies (only necessary for .so)
avifil32/libavifil32.so: libmsvfw32.so libwinmm.so
commdlg/libcomdlg32.so: libwinspool.so
ddraw/libddraw.so: libx11drv.so
dplayx/libdplayx.so: libole32.so
msvideo/libmsvfw32.so: libwinmm.so
oleaut32/liboleaut32.so: libole32.so libcomctl32.so
olecli/libolecli32.so: libolesvr32.so libole32.so
olepro32/libolepro32.so: liboleaut32.so libole32.so
shell32/libshell32.so: libole32.so
urlmon/liburlmon.so: libole32.so
version/libversion.so: liblz32.so
winmm/joystick/libjoystick.drv.so: libwinmm.so
winmm/mcianim/libmcianim.drv.so: libwinmm.so
winmm/mciavi/libmciavi.drv.so: libwinmm.so
winmm/mcicda/libmcicda.drv.so: libwinmm.so
winmm/mciseq/libmciseq.drv.so: libwinmm.so
winmm/mciwave/libmciwave.drv.so: libwinmm.so
winmm/midimap/libmidimap.drv.so: libwinmm.so
winmm/wavemap/libmsacm.drv.so: libwinmm.so
winmm/wineoss/libwineoss.drv.so: libwinmm.so
$(DLLFILES): dummy $(DLLFILES): dummy
@cd `dirname $@` && $(MAKE) @cd `dirname $@` && $(MAKE)

View File

@ -5,7 +5,7 @@ rsrc comdlg32
import shell32.dll import shell32.dll
import comctl32.dll import comctl32.dll
import winspool.dll import winspool.drv
0 stub ArrowBtnWndProc 0 stub ArrowBtnWndProc
1 stdcall ChooseColorA(ptr) ChooseColorA 1 stdcall ChooseColorA(ptr) ChooseColorA

View File

@ -461,7 +461,8 @@ LPVOID WINAPI SHAlloc(DWORD len)
DWORD WINAPI SHRegisterDragDrop(HWND hWnd,IDropTarget * pDropTarget) DWORD WINAPI SHRegisterDragDrop(HWND hWnd,IDropTarget * pDropTarget)
{ {
FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget); FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
return RegisterDragDrop(hWnd, pDropTarget); if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
return 0;
} }
/************************************************************************* /*************************************************************************

View File

@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = x11drv MODULE = x11drv
SOVERSION = 1.0 SOVERSION = 1.0
EXTRALIBS = $(X_LIBS) $(XLIB)
SPEC_SRCS = x11drv.spec SPEC_SRCS = x11drv.spec

View File

@ -183,6 +183,7 @@ BOOL BUILTIN_Init(void)
HMODULE16 BUILTIN_LoadModule( LPCSTR name ) HMODULE16 BUILTIN_LoadModule( LPCSTR name )
{ {
char dllname[16], *p; char dllname[16], *p;
void *handle;
int i; int i;
/* Fix the name in case we have a full path and extension */ /* Fix the name in case we have a full path and extension */
@ -198,9 +199,24 @@ HMODULE16 BUILTIN_LoadModule( LPCSTR name )
const BUILTIN16_DESCRIPTOR *descr = builtin_dlls[i]; const BUILTIN16_DESCRIPTOR *descr = builtin_dlls[i];
NE_MODULE *pModule = (NE_MODULE *)descr->module_start; NE_MODULE *pModule = (NE_MODULE *)descr->module_start;
OFSTRUCT *pOfs = (OFSTRUCT *)((LPBYTE)pModule + pModule->fileinfo); OFSTRUCT *pOfs = (OFSTRUCT *)((LPBYTE)pModule + pModule->fileinfo);
if (!lstrcmpiA( pOfs->szPathName, dllname )) if (!strcasecmp( pOfs->szPathName, dllname ))
return BUILTIN_DoLoadModule16( descr ); return BUILTIN_DoLoadModule16( descr );
} }
if ((handle = BUILTIN32_dlopen( dllname )))
{
for (i = 0; i < nb_dlls; i++)
{
const BUILTIN16_DESCRIPTOR *descr = builtin_dlls[i];
NE_MODULE *pModule = (NE_MODULE *)descr->module_start;
OFSTRUCT *pOfs = (OFSTRUCT *)((LPBYTE)pModule + pModule->fileinfo);
if (!strcasecmp( pOfs->szPathName, dllname ))
return BUILTIN_DoLoadModule16( descr );
}
ERR( "loaded .so but dll %s still not found\n", dllname );
BUILTIN32_dlclose( handle );
}
return (HMODULE16)2; return (HMODULE16)2;
} }

View File

@ -236,5 +236,7 @@ HGLOBAL16 NE_LoadPEResource( NE_MODULE *pModule, WORD type, LPVOID bits, DWORD s
extern WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR name, DWORD flags); extern WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR name, DWORD flags);
extern HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename ); extern HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename );
extern void BUILTIN32_UnloadLibrary(WINE_MODREF *wm); extern void BUILTIN32_UnloadLibrary(WINE_MODREF *wm);
extern void *BUILTIN32_dlopen( const char *name );
extern int BUILTIN32_dlclose( void *handle );
#endif /* __WINE_MODULE_H */ #endif /* __WINE_MODULE_H */

View File

@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex vartest volinfo PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex vartest volinfo
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
WRCEXTRA = -s -p $* WRCEXTRA = -s -p $*
SPEC_SRCS = \ SPEC_SRCS = \
@ -27,33 +26,33 @@ all: check_wrc $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
expand: expand.o expand.spec.o expand: expand.o expand.spec.o
$(CC) -o expand $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o expand $+ -L$(DLLDIR) -llz32 $(DLL_LINK) $(LIBS)
hello: hello.o hello.spec.o hello: hello.o hello.spec.o
$(CC) -o hello $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o hello $+ $(DLL_LINK) $(LIBS)
hello2: hello2.o hello2.spec.o hello2: hello2.o hello2.spec.o
$(CC) -o hello2 $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o hello2 $+ $(DLL_LINK) $(LIBS)
hello3: hello3.o hello3.spec.o hello3res.o hello3: hello3.o hello3.spec.o hello3res.o
$(CC) -o hello3 $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o hello3 $+ -L$(DLLDIR) -lcomdlg32 -lwinspool $(DLL_LINK) $(LIBS)
hello4: hello4.o hello4.spec.o hello4: hello4.o hello4.spec.o
$(CC) -o hello4 $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o hello4 $+ $(DLL_LINK) $(LIBS)
hello5: hello5.o hello5.spec.o hello5: hello5.o hello5.spec.o
$(CC) -o hello5 $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o hello5 $+ $(DLL_LINK) $(LIBS)
new: new.o new.spec.o new: new.o new.spec.o
$(CC) -o new $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o new $+ $(DLL_LINK) $(LIBS)
rolex: rolex.o rolex.spec.o rolex: rolex.o rolex.spec.o
$(CC) -o rolex $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o rolex $+ $(DLL_LINK) $(LIBS)
vartest: vartest.o vartest.spec.o vartest: vartest.o vartest.spec.o
$(CC) -o vartest $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o vartest $+ -L$(DLLDIR) -loleaut32 -lole32 $(DLL_LINK) $(LIBS)
volinfo: volinfo.o volinfo.spec.o volinfo: volinfo.o volinfo.spec.o
$(CC) -o volinfo $+ $(LDOPTIONS) $(ALL_LIBS) $(CC) -o volinfo $+ $(DLL_LINK) $(LIBS)
### Dependencies: ### Dependencies:

View File

@ -9,7 +9,7 @@ MAIN MENU
} }
} }
BITDEMO BITMAP "../rc/winelogo.bmp" /*BITDEMO BITMAP "../rc/winelogo.bmp"*/
DIADEMO DIALOG 20, 20, 179, 118 DIADEMO DIALOG 20, 20, 179, 118
STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_SYSMENU

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = icinfo aviinfo aviplay PROGRAMS = icinfo aviinfo aviplay
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = msvfw32 winmm ddraw x11drv
WRCEXTRA = -s -p $* WRCEXTRA = -s -p $*
SPEC_SRCS = \ SPEC_SRCS = \
@ -18,13 +18,13 @@ all: check_wrc $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
icinfo: icinfo.o icinfo.spec.o icinfo: icinfo.o icinfo.spec.o
$(CC) -o icinfo icinfo.o icinfo.spec.o $(LDOPTIONS) $(ALL_LIBS) $(CC) -o icinfo icinfo.o icinfo.spec.o $(DLL_LINK) $(LIBS)
aviinfo: aviinfo.o aviinfo.spec.o aviinfo: aviinfo.o aviinfo.spec.o
$(CC) -o aviinfo aviinfo.o aviinfo.spec.o $(LDOPTIONS) $(ALL_LIBS) $(CC) -o aviinfo aviinfo.o aviinfo.spec.o $(DLL_LINK) $(LIBS)
aviplay: aviplay.o aviplay.spec.o aviplay: aviplay.o aviplay.spec.o
$(CC) -o aviplay aviplay.o aviplay.spec.o $(LDOPTIONS) $(ALL_LIBS) $(CC) -o aviplay aviplay.o aviplay.spec.o $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) icinfo $(bindir)/icinfo $(INSTALL_PROGRAM) icinfo $(bindir)/icinfo

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = clock PROGRAMS = clock
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 comdlg32 ole32 winspool
WRCEXTRA = -s -p clock WRCEXTRA = -s -p clock
LICENSELANG = En LICENSELANG = En
@ -31,7 +31,7 @@ all: check_wrc $(PROGRAMS)
clock: $(OBJS) clock: $(OBJS)
$(CC) -o clock $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o clock $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) clock $(bindir)/clock $(INSTALL_PROGRAM) clock $(bindir)/clock

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = cmdlgtst PROGRAMS = cmdlgtst
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = comdlg32 winspool
WRCEXTRA = -s -p cmdlgtst WRCEXTRA = -s -p cmdlgtst
C_SRCS = \ C_SRCS = \
@ -22,7 +22,7 @@ all: check_wrc $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
cmdlgtst: $(OBJS) cmdlgtst: $(OBJS)
$(CC) -o cmdlgtst $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o cmdlgtst $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) cmdlgtst $(bindir)/cmdlgtst $(INSTALL_PROGRAM) cmdlgtst $(bindir)/cmdlgtst

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = control PROGRAMS = control
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 ole32
C_SRCS = control.c C_SRCS = control.c
@ -16,7 +16,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
control: $(OBJS) control: $(OBJS)
$(CC) -o control $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o control $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) control $(bindir)/control $(INSTALL_PROGRAM) control $(bindir)/control

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = notepad PROGRAMS = notepad
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 ole32 comdlg32 winspool
WRCEXTRA = -s -p notepad WRCEXTRA = -s -p notepad
LICENSELANG = En LICENSELANG = En
@ -31,7 +31,7 @@ all: check_wrc $(PROGRAMS)
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
notepad: $(OBJS) notepad: $(OBJS)
$(CC) -o notepad $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o notepad $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) notepad $(bindir)/notepad $(INSTALL_PROGRAM) notepad $(bindir)/notepad

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = osversioncheck PROGRAMS = osversioncheck
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
C_SRCS = osversioncheck.c C_SRCS = osversioncheck.c
@ -16,7 +15,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
osversioncheck: $(OBJS) osversioncheck: $(OBJS)
$(CC) -o osversioncheck $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o osversioncheck $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) osversioncheck $(bindir)/osversioncheck $(INSTALL_PROGRAM) osversioncheck $(bindir)/osversioncheck

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = progman PROGRAMS = progman
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 comdlg32 ole32 winspool
WRCEXTRA = -s -p progman WRCEXTRA = -s -p progman
LICENSELANG = En LICENSELANG = En
@ -33,7 +33,7 @@ all: check_wrc $(PROGRAMS)
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
progman: $(OBJS) progman: $(OBJS)
$(CC) -o progman $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o progman $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) progman $(bindir)/progman $(INSTALL_PROGRAM) progman $(bindir)/progman

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = regapi PROGRAMS = regapi
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
C_SRCS = \ C_SRCS = \
regapi.c regapi.c
@ -18,7 +17,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
regapi: $(OBJS) regapi: $(OBJS)
$(CC) -o regapi $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o regapi $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) regapi $(bindir)/regapi $(INSTALL_PROGRAM) regapi $(bindir)/regapi

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = regtest PROGRAMS = regtest
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
C_SRCS = regtest.c C_SRCS = regtest.c
@ -16,7 +15,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
regtest: $(OBJS) regtest: $(OBJS)
$(CC) -o regtest $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o regtest $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) regtest $(bindir)/regtest $(INSTALL_PROGRAM) regtest $(bindir)/regtest

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = view PROGRAMS = view
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = comdlg32 winspool
WRCEXTRA = -s -p view WRCEXTRA = -s -p view
C_SRCS = \ C_SRCS = \
@ -24,7 +24,7 @@ all: check_wrc $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
view: $(OBJS) view: $(OBJS)
$(CC) -o view $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o view $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) view $(bindir)/view $(INSTALL_PROGRAM) view $(bindir)/view

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = wcmd PROGRAMS = wcmd
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
WRCEXTRA = -s -p wcmd WRCEXTRA = -s -p wcmd
C_SRCS = \ C_SRCS = \
@ -25,7 +24,7 @@ all: check_wrc $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
wcmd: $(OBJS) wcmd: $(OBJS)
$(CC) -o wcmd $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o wcmd $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) wcmd $(bindir)/wcmd $(INSTALL_PROGRAM) wcmd $(bindir)/wcmd

View File

@ -5,7 +5,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = winemine PROGRAMS = winemine
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
WRCEXTRA = -s -p winemine WRCEXTRA = -s -p winemine
LICENSELANG = En LICENSELANG = En
@ -28,7 +27,7 @@ all: check_wrc $(PROGRAMS)
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
winemine: $(OBJS) winemine: $(OBJS)
$(CC) -o winemine $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o winemine $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) winemine $(bindir)/winemine $(INSTALL_PROGRAM) winemine $(bindir)/winemine

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = winhelp hlp2sgml PROGRAMS = winhelp hlp2sgml
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 ole32 comdlg32 winspool
WRCEXTRA = -s -p winhelp WRCEXTRA = -s -p winhelp
C_SRCS = \ C_SRCS = \
@ -32,7 +32,7 @@ depend: y.tab.h
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
winhelp: $(OBJS) winhelp: $(OBJS)
$(CC) -o winhelp $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o winhelp $(OBJS) $(DLL_LINK) $(LIBS)
hlp2sgml: hlp2sgml.o hlpfile.o hlp2sgml: hlp2sgml.o hlpfile.o
$(CC) -o hlp2sgml hlp2sgml.o hlpfile.o $(CC) -o hlp2sgml hlp2sgml.o hlpfile.o

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = winver PROGRAMS = winver
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS) IMPORTS = shell32 ole32
C_SRCS = winver.c C_SRCS = winver.c
@ -16,7 +16,7 @@ all: $(PROGRAMS)
@MAKE_RULES@ @MAKE_RULES@
winver: $(OBJS) winver: $(OBJS)
$(CC) -o winver $(OBJS) $(LDOPTIONS) $(ALL_LIBS) $(CC) -o winver $(OBJS) $(DLL_LINK) $(LIBS)
install:: install::
$(INSTALL_PROGRAM) winver $(bindir)/winver $(INSTALL_PROGRAM) winver $(bindir)/winver

View File

@ -4,14 +4,21 @@
* Copyright 1997 Alexandre Julliard * Copyright 1997 Alexandre Julliard
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_DL_API
#include <dlfcn.h>
#endif
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "builtin32.h" #include "builtin32.h"
#include "elfdll.h"
#include "neexe.h" #include "neexe.h"
#include "heap.h" #include "heap.h"
#include "main.h" #include "main.h"
@ -74,6 +81,39 @@ static void BUILTIN32_WarnSecondInstance( const char *name )
} }
} }
/***********************************************************************
* BUILTIN32_dlopen
*/
void *BUILTIN32_dlopen( const char *name )
{
#ifdef HAVE_DL_API
void *handle;
char buffer[128], *p;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
sprintf( buffer, "lib%s", name );
for (p = buffer; *p; p++) *p = tolower(*p);
if ((p = strrchr( buffer, '.' )) && (!strcmp( p, ".dll" ) || !strcmp( p, ".exe" ))) *p = 0;
strcat( buffer, ".so" );
if (!(handle = ELFDLL_dlopen( buffer, RTLD_NOW )))
ERR( "failed to load %s: %s\n", buffer, dlerror() );
return handle;
#else
return NULL;
#endif
}
/***********************************************************************
* BUILTIN32_dlclose
*/
int BUILTIN32_dlclose( void *handle )
{
#ifdef HAVE_DL_API
return dlclose( handle );
#endif
}
/*********************************************************************** /***********************************************************************
* BUILTIN32_DoLoadImage * BUILTIN32_DoLoadImage
* *
@ -357,6 +397,7 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags)
NE_MODULE *pModule; NE_MODULE *pModule;
WINE_MODREF *wm; WINE_MODREF *wm;
char dllname[MAX_PATH], *p; char dllname[MAX_PATH], *p;
void *handle;
int i; int i;
/* Fix the name in case we have a full path and extension */ /* Fix the name in case we have a full path and extension */
@ -368,14 +409,20 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags)
/* Search built-in descriptor */ /* Search built-in descriptor */
for (i = 0; i < nb_dlls; i++) for (i = 0; i < nb_dlls; i++)
if (!lstrcmpiA( builtin_dlls[i]->filename, dllname )) break; if (!strcasecmp( builtin_dlls[i]->filename, dllname )) goto found;
if (i == nb_dlls) if ((handle = BUILTIN32_dlopen( dllname )))
{ {
SetLastError( ERROR_FILE_NOT_FOUND ); for (i = 0; i < nb_dlls; i++)
return NULL; if (!strcasecmp( builtin_dlls[i]->filename, dllname )) goto found;
ERR( "loaded .so but dll %s still not found\n", dllname );
BUILTIN32_dlclose( handle );
} }
SetLastError( ERROR_FILE_NOT_FOUND );
return NULL;
found:
/* Load built-in module */ /* Load built-in module */
if (!dll_modules[i]) if (!dll_modules[i])
{ {
@ -418,8 +465,6 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags)
*/ */
HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename ) HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename )
{ {
HMODULE16 hModule16;
NE_MODULE *pModule;
int i, exe = -1; int i, exe = -1;
/* Search built-in EXE descriptor */ /* Search built-in EXE descriptor */

View File

@ -55,7 +55,6 @@ System=c:\windows\system
Temp=e:\ Temp=e:\
Path=c:\windows;c:\windows\system;e:\;e:\test;f:\ Path=c:\windows;c:\windows\system;e:\;e:\test;f:\
Profile=c:\windows\Profiles\Administrator Profile=c:\windows\Profiles\Administrator
SymbolTableFile=./wine.sym
# <wineconf> # <wineconf>