Implemented on-demand loading of builtin dlls using dlopen().
This commit is contained in:
parent
59b0d7b202
commit
e1e75371d9
|
@ -5,4 +5,3 @@ config.log
|
|||
config.status
|
||||
libwine.so.1.0
|
||||
wine
|
||||
wine.sym
|
||||
|
|
|
@ -30,7 +30,6 @@ X_CFLAGS = @X_CFLAGS@
|
|||
X_LIBS = @X_LIBS@
|
||||
XLIB = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
|
||||
DLL_LINK = @DLL_LINK@
|
||||
WINELIB = $(DLL_LINK)
|
||||
LIBS = @LIBS@
|
||||
YACC = @YACC@
|
||||
LEX = @LEX@
|
||||
|
|
21
Makefile.in
21
Makefile.in
|
@ -131,7 +131,7 @@ EXTRA_OBJS = $(LIBOBJS)
|
|||
|
||||
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."
|
||||
|
||||
LIBLINTS = $(LIBOBJS:.o=.ln)
|
||||
|
@ -144,15 +144,12 @@ WINAPI_CHECK_EXTRA_FLAGS = --global
|
|||
|
||||
@MAKE_RULES@
|
||||
|
||||
all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
|
||||
|
||||
Make.rules: Make.rules.in configure
|
||||
@echo $? is newer than 'Make.rules', please rerun ./configure!
|
||||
@exit 1
|
||||
|
||||
wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
|
||||
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
nm -n wine | grep -v _compiled >wine.sym
|
||||
wine: lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMUOBJS)
|
||||
$(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
llib-lwine.ln : $(LIBLINTS)
|
||||
$(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
|
||||
|
@ -168,8 +165,6 @@ install_a: lib$(MODULE).a
|
|||
|
||||
install_wine: wine
|
||||
[ -d $(bindir) ] || $(MKDIR) $(bindir)
|
||||
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
||||
[ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
|
||||
$(INSTALL_PROGRAM) wine $(bindir)/wine
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
|
||||
|
@ -194,12 +189,14 @@ lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
|
|||
$(RANLIB) $@
|
||||
|
||||
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
|
||||
@cd `dirname $@` && $(MAKE) `basename $@`
|
||||
|
||||
$(LIBPROGRAMS): lib$(MODULE).$(LIBEXT) $(DLLOBJS)
|
||||
$(DLLDIR): $(TOOLSUBDIRS) dummy
|
||||
|
||||
$(LIBPROGRAMS): lib$(MODULE).$(LIBEXT) $(DLLDIR)
|
||||
|
||||
$(LIBLINTS) $(EMULINTS): dummy
|
||||
@cd `dirname $@` && $(MAKE) lint
|
||||
|
@ -232,7 +229,7 @@ htmlpages:
|
|||
for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
|
||||
|
||||
clean::
|
||||
$(RM) wine wine.sym libwine.so.1.0 TAGS
|
||||
$(RM) wine libwine.so.1.0 TAGS
|
||||
|
||||
distclean: clean
|
||||
$(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
|
||||
|
|
|
@ -110,9 +110,11 @@ AC_CHECK_HEADERS(dlfcn.h,
|
|||
AC_DEFINE(HAVE_DL_API),
|
||||
AC_CHECK_LIB(dl,dlopen,
|
||||
AC_DEFINE(HAVE_DL_API)
|
||||
LIBS="$LIBS -ldl"
|
||||
LIBS="$LIBS -ldl",
|
||||
LIBEXT="a"
|
||||
)
|
||||
)
|
||||
),
|
||||
LIBEXT="a"
|
||||
)
|
||||
AC_SUBST(XLIB)
|
||||
AC_SUBST(X_SRCS)
|
||||
|
@ -467,12 +469,13 @@ fi
|
|||
|
||||
DLLFLAGS=""
|
||||
BUILDFLAGS=""
|
||||
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine"
|
||||
|
||||
if test "$LIBEXT" = "so"; then
|
||||
BUILDFLAGS="-pic"
|
||||
DLLFLAGS="-fPIC"
|
||||
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine"
|
||||
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_cv_c_whole_archive,
|
||||
[saved_cflags=$CFLAGS
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = winedbg
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
WRCEXTRA = -A -p $*
|
||||
|
||||
C_SRCS = \
|
||||
|
@ -45,6 +44,6 @@ lex.yy.c: debug.l
|
|||
$(LEX) -8 -I $(SRCDIR)/debug.l
|
||||
|
||||
winedbg: $(OBJS)
|
||||
$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o $@ $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
### Dependencies:
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
# SOVERSION : version of the .so file
|
||||
# ALTNAMES : alternate names for this dll (optional)
|
||||
# IMPORTS : dlls to import (optional)
|
||||
# EXTRALIBS : extra libraries to link in (optional)
|
||||
#
|
||||
# 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
|
||||
|
||||
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)
|
||||
$(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
|
||||
|
@ -43,7 +44,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$(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
|
||||
@cd $(DLLDIR) && $(MAKE) `basename $@`
|
||||
|
|
|
@ -305,6 +305,30 @@ libwsock32.@LIBEXT@ libwinsock.@LIBEXT@: winsock/libwsock32.@LIBEXT@
|
|||
libx11drv.@LIBEXT@: 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
|
||||
@cd `dirname $@` && $(MAKE)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ rsrc comdlg32
|
|||
|
||||
import shell32.dll
|
||||
import comctl32.dll
|
||||
import winspool.dll
|
||||
import winspool.drv
|
||||
|
||||
0 stub ArrowBtnWndProc
|
||||
1 stdcall ChooseColorA(ptr) ChooseColorA
|
||||
|
|
|
@ -461,7 +461,8 @@ LPVOID WINAPI SHAlloc(DWORD len)
|
|||
DWORD WINAPI SHRegisterDragDrop(HWND hWnd,IDropTarget * pDropTarget)
|
||||
{
|
||||
FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
|
||||
return RegisterDragDrop(hWnd, pDropTarget);
|
||||
if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -4,6 +4,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = x11drv
|
||||
SOVERSION = 1.0
|
||||
EXTRALIBS = $(X_LIBS) $(XLIB)
|
||||
|
||||
SPEC_SRCS = x11drv.spec
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ BOOL BUILTIN_Init(void)
|
|||
HMODULE16 BUILTIN_LoadModule( LPCSTR name )
|
||||
{
|
||||
char dllname[16], *p;
|
||||
void *handle;
|
||||
int i;
|
||||
|
||||
/* 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];
|
||||
NE_MODULE *pModule = (NE_MODULE *)descr->module_start;
|
||||
OFSTRUCT *pOfs = (OFSTRUCT *)((LPBYTE)pModule + pModule->fileinfo);
|
||||
if (!lstrcmpiA( pOfs->szPathName, dllname ))
|
||||
if (!strcasecmp( pOfs->szPathName, dllname ))
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename );
|
||||
extern void BUILTIN32_UnloadLibrary(WINE_MODREF *wm);
|
||||
extern void *BUILTIN32_dlopen( const char *name );
|
||||
extern int BUILTIN32_dlclose( void *handle );
|
||||
|
||||
#endif /* __WINE_MODULE_H */
|
||||
|
|
|
@ -4,7 +4,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex vartest volinfo
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
WRCEXTRA = -s -p $*
|
||||
|
||||
SPEC_SRCS = \
|
||||
|
@ -27,33 +26,33 @@ all: check_wrc $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
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
|
||||
$(CC) -o hello $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o hello $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
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
|
||||
$(CC) -o hello3 $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o hello3 $+ -L$(DLLDIR) -lcomdlg32 -lwinspool $(DLL_LINK) $(LIBS)
|
||||
|
||||
hello4: hello4.o hello4.spec.o
|
||||
$(CC) -o hello4 $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o hello4 $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
hello5: hello5.o hello5.spec.o
|
||||
$(CC) -o hello5 $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o hello5 $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
new: new.o new.spec.o
|
||||
$(CC) -o new $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o new $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
rolex: rolex.o rolex.spec.o
|
||||
$(CC) -o rolex $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o rolex $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
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
|
||||
$(CC) -o volinfo $+ $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o volinfo $+ $(DLL_LINK) $(LIBS)
|
||||
|
||||
### Dependencies:
|
||||
|
|
|
@ -9,7 +9,7 @@ MAIN MENU
|
|||
}
|
||||
}
|
||||
|
||||
BITDEMO BITMAP "../rc/winelogo.bmp"
|
||||
/*BITDEMO BITMAP "../rc/winelogo.bmp"*/
|
||||
|
||||
DIADEMO DIALOG 20, 20, 179, 118
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_SYSMENU
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = icinfo aviinfo aviplay
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = msvfw32 winmm ddraw x11drv
|
||||
WRCEXTRA = -s -p $*
|
||||
|
||||
SPEC_SRCS = \
|
||||
|
@ -18,13 +18,13 @@ all: check_wrc $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
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
|
||||
$(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
|
||||
$(CC) -o aviplay aviplay.o aviplay.spec.o $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o aviplay aviplay.o aviplay.spec.o $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) icinfo $(bindir)/icinfo
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = clock
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 comdlg32 ole32 winspool
|
||||
WRCEXTRA = -s -p clock
|
||||
|
||||
LICENSELANG = En
|
||||
|
@ -31,7 +31,7 @@ all: check_wrc $(PROGRAMS)
|
|||
|
||||
|
||||
clock: $(OBJS)
|
||||
$(CC) -o clock $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o clock $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) clock $(bindir)/clock
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = cmdlgtst
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = comdlg32 winspool
|
||||
WRCEXTRA = -s -p cmdlgtst
|
||||
|
||||
C_SRCS = \
|
||||
|
@ -22,7 +22,7 @@ all: check_wrc $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
cmdlgtst: $(OBJS)
|
||||
$(CC) -o cmdlgtst $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o cmdlgtst $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) cmdlgtst $(bindir)/cmdlgtst
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = control
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 ole32
|
||||
|
||||
C_SRCS = control.c
|
||||
|
||||
|
@ -16,7 +16,7 @@ all: $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
control: $(OBJS)
|
||||
$(CC) -o control $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o control $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) control $(bindir)/control
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = notepad
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 ole32 comdlg32 winspool
|
||||
WRCEXTRA = -s -p notepad
|
||||
|
||||
LICENSELANG = En
|
||||
|
@ -31,7 +31,7 @@ all: check_wrc $(PROGRAMS)
|
|||
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
|
||||
|
||||
notepad: $(OBJS)
|
||||
$(CC) -o notepad $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o notepad $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) notepad $(bindir)/notepad
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = osversioncheck
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
|
||||
C_SRCS = osversioncheck.c
|
||||
|
||||
|
@ -16,7 +15,7 @@ all: $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
osversioncheck: $(OBJS)
|
||||
$(CC) -o osversioncheck $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o osversioncheck $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) osversioncheck $(bindir)/osversioncheck
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = progman
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 comdlg32 ole32 winspool
|
||||
WRCEXTRA = -s -p progman
|
||||
|
||||
LICENSELANG = En
|
||||
|
@ -33,7 +33,7 @@ all: check_wrc $(PROGRAMS)
|
|||
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
|
||||
|
||||
progman: $(OBJS)
|
||||
$(CC) -o progman $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o progman $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) progman $(bindir)/progman
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = regapi
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
|
||||
C_SRCS = \
|
||||
regapi.c
|
||||
|
@ -18,7 +17,7 @@ all: $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
regapi: $(OBJS)
|
||||
$(CC) -o regapi $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o regapi $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) regapi $(bindir)/regapi
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = regtest
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
|
||||
C_SRCS = regtest.c
|
||||
|
||||
|
@ -16,7 +15,7 @@ all: $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
regtest: $(OBJS)
|
||||
$(CC) -o regtest $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o regtest $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) regtest $(bindir)/regtest
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = view
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = comdlg32 winspool
|
||||
WRCEXTRA = -s -p view
|
||||
|
||||
C_SRCS = \
|
||||
|
@ -24,7 +24,7 @@ all: check_wrc $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
view: $(OBJS)
|
||||
$(CC) -o view $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o view $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) view $(bindir)/view
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = wcmd
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
WRCEXTRA = -s -p wcmd
|
||||
|
||||
C_SRCS = \
|
||||
|
@ -25,7 +24,7 @@ all: check_wrc $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
wcmd: $(OBJS)
|
||||
$(CC) -o wcmd $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o wcmd $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) wcmd $(bindir)/wcmd
|
||||
|
|
|
@ -5,7 +5,6 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = winemine
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
WRCEXTRA = -s -p winemine
|
||||
|
||||
LICENSELANG = En
|
||||
|
@ -28,7 +27,7 @@ all: check_wrc $(PROGRAMS)
|
|||
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
|
||||
|
||||
winemine: $(OBJS)
|
||||
$(CC) -o winemine $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o winemine $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) winemine $(bindir)/winemine
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = winhelp hlp2sgml
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 ole32 comdlg32 winspool
|
||||
WRCEXTRA = -s -p winhelp
|
||||
|
||||
C_SRCS = \
|
||||
|
@ -32,7 +32,7 @@ depend: y.tab.h
|
|||
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
|
||||
|
||||
winhelp: $(OBJS)
|
||||
$(CC) -o winhelp $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o winhelp $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
hlp2sgml: hlp2sgml.o hlpfile.o
|
||||
$(CC) -o hlp2sgml hlp2sgml.o hlpfile.o
|
||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
PROGRAMS = winver
|
||||
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
|
||||
IMPORTS = shell32 ole32
|
||||
|
||||
C_SRCS = winver.c
|
||||
|
||||
|
@ -16,7 +16,7 @@ all: $(PROGRAMS)
|
|||
@MAKE_RULES@
|
||||
|
||||
winver: $(OBJS)
|
||||
$(CC) -o winver $(OBJS) $(LDOPTIONS) $(ALL_LIBS)
|
||||
$(CC) -o winver $(OBJS) $(DLL_LINK) $(LIBS)
|
||||
|
||||
install::
|
||||
$(INSTALL_PROGRAM) winver $(bindir)/winver
|
||||
|
|
|
@ -4,14 +4,21 @@
|
|||
* Copyright 1997 Alexandre Julliard
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_DL_API
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "builtin32.h"
|
||||
#include "elfdll.h"
|
||||
#include "neexe.h"
|
||||
#include "heap.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
|
||||
*
|
||||
|
@ -357,6 +397,7 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags)
|
|||
NE_MODULE *pModule;
|
||||
WINE_MODREF *wm;
|
||||
char dllname[MAX_PATH], *p;
|
||||
void *handle;
|
||||
int i;
|
||||
|
||||
/* 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 */
|
||||
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 );
|
||||
return NULL;
|
||||
for (i = 0; i < nb_dlls; i++)
|
||||
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 */
|
||||
if (!dll_modules[i])
|
||||
{
|
||||
|
@ -418,8 +465,6 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags)
|
|||
*/
|
||||
HMODULE BUILTIN32_LoadExeModule( LPCSTR *filename )
|
||||
{
|
||||
HMODULE16 hModule16;
|
||||
NE_MODULE *pModule;
|
||||
int i, exe = -1;
|
||||
|
||||
/* Search built-in EXE descriptor */
|
||||
|
|
Loading…
Reference in New Issue