Commit c1bfca04 authored by Alexandre Julliard's avatar Alexandre Julliard

Changed builtin dlls file names to make it clear they are not normal

Unix libraries, and install them in $libdir/wine instead of $libdir to avoid name conflicts in /usr/lib.
parent c90aa7b6
......@@ -36,6 +36,7 @@ YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
LIBEXT = @LIBEXT@
DLLEXT = @DLLEXT@
LDSHARED = @LDSHARED@
DLLWRAP = @DLLWRAP@
DLLWRAPFLAGS = --add-stdcall-alias
......@@ -93,6 +94,7 @@ bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
dlldir = @libdir@/wine
prog_manext = 1
conf_manext = 5
includedir = @includedir@/wine
......
......@@ -21,7 +21,7 @@ VPATH = @srcdir@
LIBEXT = @LIBEXT@
LDCONFIG = @LDCONFIG@
MODULE = wine
IMPORTS = ntdll
IMPORTS = ntdll.dll
# Stand-alone programs
PROGRAMS = \
......@@ -39,8 +39,12 @@ LIBRARIES = \
tsx11/libwine_tsx11.$(LIBEXT) \
unicode/libwine_unicode.$(LIBEXT)
# Dlls that we need to link against (should go away)
LINKABLE_DLLS = winspool.drv x11drv.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
# Libraries symlinks to create at the top level
LIBSYMLINKS = \
$(LINKABLE_DLLS:%=lib%.$(LIBEXT)) \
libwine.$(LIBEXT) \
libwine_tsx11.$(LIBEXT) \
libwine_unicode.$(LIBEXT) \
......@@ -70,7 +74,7 @@ INSTALLSUBDIRS = \
EMUOBJS = \
miscemu/miscemu.o
all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) $(LIBSYMLINKS) wine
all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) wine
@echo "Wine build complete."
WINAPI_CHECK_EXTRA_FLAGS = --global
......@@ -81,10 +85,10 @@ Make.rules: Make.rules.in configure
@echo $? is newer than 'Make.rules', please rerun ./configure!
@exit 1
wine: dlls $(EMUOBJS)
$(CC) -o wine $(EMUOBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBS) $(LDFLAGS)
wine: $(EMUOBJS) $(LIBSYMLINKS) $(IMPORTS:%=lib%.$(LIBEXT)) library/libwine.$(LIBEXT)
$(CC) -o wine $(EMUOBJS) -L. $(IMPORTS:%=-l%) $(LIBWINE) $(LIBS) $(LDFLAGS)
install_wine:
install_wine: dummy
[ -d $(bindir) ] || $(MKDIR) $(bindir)
$(INSTALL_PROGRAM) wine $(bindir)/wine
......@@ -97,6 +101,8 @@ uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
$(EMUOBJS) $(PROGRAMS) $(LIBPROGRAMS) $(LIBRARIES): dummy
@cd `dirname $@` && $(MAKE) `basename $@`
# Symlinks to libraries that we need to link against
libwine.$(LIBEXT): library/libwine.$(LIBEXT)
$(RM) $@ && $(LN_S) library/libwine.$(LIBEXT) $@
......@@ -109,6 +115,26 @@ libwine_unicode.$(LIBEXT): unicode/libwine_unicode.$(LIBEXT)
libwine_uuid.a: ole/libwine_uuid.a
$(RM) $@ && $(LN_S) ole/libwine_uuid.a $@
libwinspool.drv.$(LIBEXT): dlls/winspool.drv$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/winspool.drv$(DLLEXT) $@
libx11drv.dll.$(LIBEXT): dlls/x11drv.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/x11drv.dll$(DLLEXT) $@
libuser32.dll.$(LIBEXT): dlls/user32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/user32.dll$(DLLEXT) $@
libgdi32.dll.$(LIBEXT): dlls/gdi32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/gdi32.dll$(DLLEXT) $@
libkernel32.dll.$(LIBEXT): dlls/kernel32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/kernel32.dll$(DLLEXT) $@
libntdll.dll.$(LIBEXT): dlls/ntdll.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dlls/ntdll.dll$(DLLEXT) $@
$(LINKABLE_DLLS:%=dlls/%$(DLLEXT)): dlls
# Dependencies between directories
$(PROGRAMS): tools
......
......@@ -732,13 +732,16 @@ LDPATH=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLLEXT=".so"
LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
elif test "$LIBEXT" = "dll"; then
#DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
DLLEXT=""
LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
fi
AC_SUBST(DLLFLAGS)
AC_SUBST(DLLEXT)
AC_SUBST(LDSHARED)
AC_SUBST(LDDLLFLAGS)
AC_SUBST(LIBEXT)
......
......@@ -10,34 +10,33 @@
#
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
LIBEXT = @LIBEXT@
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
SPEC_SRCS = $(ALTNAMES:%=%.spec)
ALL_OBJS = $(MODULE).spec.o $(OBJS)
DLLEXT = @DLLEXT@
SPEC_SRCS = $(ALTNAMES:.dll=.spec)
ALL_OBJS = $(MODULE:%.dll=%).spec.o $(OBJS)
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
all: lib$(MODULE).$(LIBEXT)
all: $(MODULE)$(DLLEXT)
@MAKE_RULES@
# Rules for .so files
lib$(MODULE).so: $(ALL_OBJS) Makefile.in
$(MODULE).so: $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for .dll files
lib$(MODULE).dll: $(ALL_OBJS) Makefile.in
$(DLLWRAP) $(DLLWRAPFLAGS) --implib lib$(MODULE).a -o lib$(MODULE).dll $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(MODULE): $(ALL_OBJS) Makefile.in
$(DLLWRAP) $(DLLWRAPFLAGS) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for checking that no imports are missing
checklink:: lib$(MODULE).$(LIBEXT)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) $(ALL_LIBS) && $(RM) checklink
checklink:: $(MODULE)$(DLLEXT)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) $(ALL_LIBS) && $(RM) checklink
# Rules for testing
$(TESTRESULTS): lib$(MODULE).$(LIBEXT)
$(TESTRESULTS): $(MODULE)$(DLLEXT)
# Rules for debug channels
......@@ -52,18 +51,28 @@ Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
# Rules for installation
.PHONY: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
.PHONY: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
$(ALTNAMES:%=_install_/lib%.$(LIBEXT)): install_lib
cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
$(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
install_lib: lib$(MODULE).$(LIBEXT)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) lib$(MODULE).$(LIBEXT) $(libdir)/lib$(MODULE).$(LIBEXT)
install_lib: $(MODULE)$(DLLEXT)
[ -d $(dlldir) ] || $(MKDIR) $(dlldir)
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
install:: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
install:: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
uninstall::
cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
# Extra install rules for dlls not yet properly separated
install_libdir:: install_lib
cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) && if [ "$(dlldir)" = "$(libdir)/wine" ]; \
then $(LN_S) wine/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); \
else $(LN_S) $(dlldir)/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); fi
uninstall_libdir::
$(RM) $(libdir)/lib$(MODULE).$(LIBEXT)
# End of global dll rules
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = advapi32
MODULE = advapi32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = avicap32
MODULE = avicap32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = avifil32
ALTNAMES = avifile
MODULE = avifil32.dll
ALTNAMES = avifile.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = comctl32
MODULE = comctl32.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = comdlg32
ALTNAMES = commdlg
MODULE = comdlg32.dll
ALTNAMES = commdlg.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = crtdll
MODULE = crtdll.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = crypt32
MODULE = crypt32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dciman32
MODULE = dciman32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,9 +2,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ddraw
MODULE = ddraw.dll
EXTRALIBS = $(LIBUUID) $(LIBTSX11) $(X_LIBS) $(XLIB)
IMPORTS = user32 gdi32 kernel32 ntdll
IMPORTS = user32.dll gdi32.dll kernel32.dll ntdll.dll
OPENGLFILES = \
d3dcommon.c \
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = devenum
MODULE = devenum.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dinput
MODULE = dinput.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dplay
MODULE = dplay.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dplayx
MODULE = dplayx.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dsound
MODULE = dsound.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -3,10 +3,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = gdi32
SOVERSION = 1.0
ALTNAMES = gdi dispdib wing
IMPORTS = kernel32 ntdll
MODULE = gdi32.dll
ALTNAMES = gdi.dll dispdib.dll wing.dll
IMPORTS = kernel32.dll ntdll.dll
EXTRALIBS = @FREETYPELIBS@
EXTRAINCL = @FREETYPEINCL@
......@@ -52,5 +51,7 @@ version16.res: version16.rc
gdi.spec.c: version16.res
### Dependencies:
install:: install_libdir
uninstall:: uninstall_libdir
### Dependencies:
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = glu32
MODULE = glu32.dll
EXTRALIBS = $(X_LIBS) $(XLIB)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = icmp
MODULE = icmp.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = imagehlp
MODULE = imagehlp.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = imm32
ALTNAMES = imm
MODULE = imm32.dll
ALTNAMES = imm.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,10 +2,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = kernel32
SOVERSION = 1.0
ALTNAMES = comm kernel stress system toolhelp windebug win87em wprocs
IMPORTS = ntdll
MODULE = kernel32.dll
ALTNAMES = comm.dll kernel.dll stress.dll system.dll toolhelp.dll windebug.dll win87em.dll wprocs.dll
IMPORTS = ntdll.dll
C_SRCS = \
comm.c \
......@@ -54,4 +53,7 @@ version16.res: version16.rc
kernel.spec.c: version16.res
install:: install_libdir
uninstall:: uninstall_libdir
### Dependencies:
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = lz32
ALTNAMES = lzexpand
MODULE = lz32.dll
ALTNAMES = lzexpand.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -25,6 +25,7 @@ $makefiles = `find . -name Makefile.in -print`;
%imports = ();
%directories = ();
%altnames = ();
%linked_dlls = ();
# list of special dlls that can be switched on or off by configure
%special_dlls =
......@@ -53,25 +54,34 @@ foreach $i (split(/\s/,$makefiles))
$altnames{$module} = \@list;
next;
}
if (/^IMPORTS\s*=\s*(.*)/)
{
my @list = split(/\s/,$1);
$linked_dlls{$module} = \@list;
next;
}
}
}
foreach $mod (sort keys %directories)
{
my $spec = sprintf("%s/%s.spec", $directories{$mod}, $mod);
my $dll = $mod;
$dll =~ s/\.dll$//;
my $spec = sprintf("%s/%s.spec", $directories{$mod}, $dll);
open SPEC,$spec or die "cannot open $spec";
$imports{$mod} = [ ];
while (<SPEC>)
{
if (/^\#?import\s+(-delay\s+)?([a-zA-Z0-9_]+)\.dll/)
{
my $imp = $2;
my $imp = $2 . ".dll";
push @{$imports{$mod}}, $imp;
next;
}
if (/^\#?import\s+(-delay\s+)?([a-zA-Z0-9_.]+)/)
{
my $imp = $2;
$imp .= ".dll" unless ($imp =~ /\./);
push @{$imports{$mod}}, $imp;
next;
}
......@@ -90,7 +100,6 @@ TOPSRCDIR = \@top_srcdir\@
TOPOBJDIR = ..
SRCDIR = \@srcdir\@
VPATH = \@srcdir\@
LIBEXT = \@LIBEXT\@
EOF
......@@ -135,20 +144,22 @@ printf NEWMAKE "\n";
my %targets = (); # use a hash to get rid of duplicate target names
foreach $mod (sort keys %directories)
{
next if defined($special_dlls{$mod}); # skip special dlls
$targets{sprintf("lib%s.\$(LIBEXT)",$mod)} = 1;
next if defined($special_dlls{$directories{$mod}}); # skip special dlls
$targets{sprintf("%s\$(DLLEXT)",$mod)} = 1;
next unless defined $altnames{$mod};
foreach $i (sort @{$altnames{$mod}})
{
$targets{sprintf("lib%s.\$(LIBEXT)",$i)} = 1;
$targets{sprintf("%s\$(DLLEXT)",$i)} = 1;
}
}
print NEWMAKE <<EOF;
# Main target
\@MAKE_RULES\@
all: \\
\$(EXTRADIRS:%=lib%.\$(LIBEXT)) \\
\$(EXTRADIRS:%=%.dll\$(DLLEXT)) \\
EOF
printf NEWMAKE "\t%s\n", join( " \\\n\t", sort keys %targets );
......@@ -158,26 +169,24 @@ printf NEWMAKE "\t%s\n", join( " \\\n\t", sort keys %targets );
print NEWMAKE <<EOF;
\@MAKE_RULES\@
# Map library name to directory
EOF
foreach $mod (sort keys %directories)
{
printf NEWMAKE "lib%s.\$(LIBEXT)", $mod;
printf NEWMAKE "%s\$(DLLEXT)", $mod;
if (defined $altnames{$mod})
{
my $count = 1;
foreach $i (sort @{$altnames{$mod}})
{
if (!($count++ % 3)) { printf NEWMAKE " \\\n "; }
printf NEWMAKE " lib%s.\$(LIBEXT)", $i;
printf NEWMAKE " %s\$(DLLEXT)", $i;
}
}
printf NEWMAKE ": %s/lib%s.\$(LIBEXT)\n", $directories{$mod}, $mod;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/lib%s.\$(LIBEXT) \$@\n\n", $directories{$mod}, $mod;
printf NEWMAKE ": %s/%s\$(DLLEXT)\n", $directories{$mod}, $mod;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s\$(DLLEXT) \$@\n\n", $directories{$mod}, $mod;
}
......@@ -190,7 +199,7 @@ my @depends = ();
foreach $mod (sort keys %imports)
{
my $count = 1;
my $dep = sprintf("%s/lib%s.\$(LIBEXT): dummy", $directories{$mod}, $mod);
my $dep = sprintf("%s/%s\$(DLLEXT): dummy", $directories{$mod}, $mod);
foreach $i (@{$imports{$mod}})
{
if ($count++ >= 3)
......@@ -198,15 +207,40 @@ foreach $mod (sort keys %imports)
$count = 0;
$dep .= " \\\n ";
}
$dep .= sprintf(" %s\$(DLLEXT)", $i);
}
foreach $i (@{$linked_dlls{$mod}})
{
if ($count++ >= 3)
{
$count = 0;
$dep .= " \\\n ";
}
$dep .= sprintf(" lib%s.\$(LIBEXT)", $i);
}
$dep .= sprintf("\n\t\@cd %s && \$(MAKE) lib%s.\$(LIBEXT)\n\n",$directories{$mod}, $mod);
$dep .= sprintf("\n\t\@cd %s && \$(MAKE) %s\$(DLLEXT)\n\n",$directories{$mod}, $mod);
push @depends, $dep;
}
print NEWMAKE sort @depends;
################################################################
# output the linkable dlls special links
%linkable_dlls = ();
foreach $mod (keys %imports)
{
foreach $i (@{$linked_dlls{$mod}}) { $linkable_dlls{$i} = 1; }
}
print NEWMAKE "# Special targets for dlls that we need to link to\n\n";
foreach $mod (keys %linkable_dlls)
{
printf NEWMAKE "lib%s.\$(LIBEXT): %s/%s\$(DLLEXT)\n", $mod, $directories{$mod}, $mod;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s\$(DLLEXT) \$@\n\n", $directories{$mod}, $mod;
}
################################################################
# makefile trailer
print NEWMAKE <<EOF;
......@@ -224,6 +258,7 @@ print NEWMAKE <<EOF;
install:: \$(SUBDIRS:%=%/__install__)
uninstall:: \$(SUBDIRS:%=%/__uninstall__)
-rmdir \$(dlldir)
check test:: \$(SUBDIRS:%=%/__test__)
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = mapi32
MODULE = mapi32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = mpr
MODULE = mpr.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msacm32
ALTNAMES = msacm
MODULE = msacm32.dll
ALTNAMES = msacm.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msdmo
MODULE = msdmo.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msimg32
MODULE = msimg32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msnet32
MODULE = msnet32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msrle32
MODULE = msrle32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvcrt
MODULE = msvcrt.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvcrt20
MODULE = msvcrt20.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvfw32
ALTNAMES = msvideo
MODULE = msvfw32.dll
ALTNAMES = msvideo.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = netapi32
MODULE = netapi32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ntdll
MODULE = ntdll.dll
EXTRALIBS = $(LIBUNICODE)
C_SRCS = \
......@@ -67,4 +67,7 @@ $(EXTRA_OBJS): dummy
relay32.s: $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -relay32
install:: install_libdir
uninstall:: uninstall_libdir
### Dependencies:
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = odbc32
MODULE = odbc32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,8 +3,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ole32
ALTNAMES = ole2 ole2nls ole2conv ole2prox ole2thk storage compobj
MODULE = ole32.dll
ALTNAMES = ole2.dll ole2nls.dll ole2conv.dll ole2prox.dll ole2thk.dll storage.dll compobj.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = oleaut32
ALTNAMES = ole2disp typelib
MODULE = oleaut32.dll
ALTNAMES = ole2disp.dll typelib.dll
EXTRALIBS = $(LIBUUID) @JPEGLIB@
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = olecli32
ALTNAMES = olecli
MODULE = olecli32.dll
ALTNAMES = olecli.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = oledlg
MODULE = oledlg.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = olepro32
MODULE = olepro32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = olesvr32
ALTNAMES = olesvr
MODULE = olesvr32.dll
ALTNAMES = olesvr.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = opengl32
IMPORTS = x11drv kernel32 ntdll
MODULE = opengl32.dll
IMPORTS = x11drv.dll kernel32.dll ntdll.dll
C_SRCS = \
wgl.c \
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = psapi
MODULE = psapi.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = qcap
MODULE = qcap.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = quartz
MODULE = quartz.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = rasapi32
ALTNAMES = rasapi16
MODULE = rasapi32.dll
ALTNAMES = rasapi16.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = riched32
MODULE = riched32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = rpcrt4
MODULE = rpcrt4.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = serialui
MODULE = serialui.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,9 +3,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = setupapi
SOVERSION = 1.0
ALTNAMES = setupx
MODULE = setupapi.dll
ALTNAMES = setupx.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shdocvw
MODULE = shdocvw.dll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -3,8 +3,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shell32
ALTNAMES = shell
MODULE = shell32.dll
ALTNAMES = shell.dll
EXTRALIBS = $(LIBUUID) $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shfolder
MODULE = shfolder.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
name shfolder
type win32
import shell32
import shell32.dll
@ forward SHGetFolderPathA shell32.SHGetFolderPathA
@ forward SHGetFolderPathW shell32.SHGetFolderPathW
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shlwapi
MODULE = shlwapi.dll
EXTRALIBS = $(LIBUUID) $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = sti
MODULE = sti.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = tapi32
MODULE = tapi32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,9 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ttydrv
SOVERSION = 1.0
IMPORTS = user32 gdi32 kernel32 ntdll
MODULE = ttydrv.dll
IMPORTS = user32.dll gdi32.dll kernel32.dll ntdll.dll
EXTRALIBS = @CURSESLIBS@
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = url
MODULE = url.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = urlmon
MODULE = urlmon.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,10 +3,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = user32
SOVERSION = 1.0
ALTNAMES = user keyboard ddeml display mouse
IMPORTS = gdi32 kernel32 ntdll
MODULE = user32.dll
ALTNAMES = user.dll keyboard.dll ddeml.dll display.dll mouse.dll
IMPORTS = gdi32.dll kernel32.dll ntdll.dll
C_SRCS = \
bidi16.c \
......@@ -84,4 +83,7 @@ mouse.spec.c: resources/mouse.res
user.spec.c: resources/version16.res
install:: install_libdir
uninstall:: uninstall_libdir
### Dependencies:
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = version
ALTNAMES = ver
MODULE = version.dll
ALTNAMES = ver.dll
EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -2,9 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = w32skrnl
SOVERSION = 1.0
ALTNAMES = w32sys win32s16
MODULE = w32skrnl.dll
ALTNAMES = w32sys.dll win32s16.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wnaspi32
ALTNAMES = winaspi
MODULE = wnaspi32.dll
ALTNAMES = winaspi.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,9 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winedos
SOVERSION = 1.0
IMPORTS = user32 kernel32 ntdll
MODULE = winedos.dll
IMPORTS = user32.dll kernel32.dll ntdll.dll
EXTRALIBS = @CURSESLIBS@ @UTILLIBS@
C_SRCS = \
......
......@@ -2,10 +2,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wineps
SOVERSION = 1.0
ALTNAMES = wineps16
IMPORTS = user32 gdi32 winspool.drv kernel32 ntdll
MODULE = wineps.dll
ALTNAMES = wineps16.dll
IMPORTS = user32.dll gdi32.dll winspool.drv kernel32.dll ntdll.dll
EXTRALIBS = @CUPSLIBS@ @FREETYPELIBS@
EXTRAINCL = @FREETYPEINCL@
......
......@@ -3,7 +3,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wininet
MODULE = wininet.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,8 +3,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winmm
ALTNAMES = mmsystem sound
MODULE = winmm.dll
ALTNAMES = mmsystem.dll sound.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,8 +2,8 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winnls32
ALTNAMES = winnls
MODULE = winnls32.dll
ALTNAMES = winnls.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -3,10 +3,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ws2_32
SOVERSION = 1.0
ALTNAMES = winsock
IMPORTS = user32 kernel32 ntdll
MODULE = ws2_32.dll
ALTNAMES = winsock.dll
IMPORTS = user32.dll kernel32.dll ntdll.dll
C_SRCS = \
async.c \
......
......@@ -15,5 +15,7 @@ C_SRCS = \
@MAKE_DLL_RULES@
### Dependencies:
install:: install_libdir
uninstall:: uninstall_libdir
### Dependencies:
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wintrust
MODULE = wintrust.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wow32
MODULE = wow32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,7 +2,7 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wsock32
MODULE = wsock32.dll
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
......
......@@ -2,9 +2,9 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = x11drv
MODULE = x11drv.dll
EXTRALIBS = $(LIBTSX11) $(X_LIBS) $(XLIB)
IMPORTS = user32 gdi32 kernel32
IMPORTS = user32.dll gdi32.dll kernel32.dll
C_SRCS = \
desktop.c \
......@@ -36,11 +36,11 @@ all: $(PROGRAMS)
$(EXTRA_OBJS) $(PROGRAMS): dummy
@cd `dirname $@` && $(MAKE) `basename $@`
install:: $(PROGRAMS)
install:: $(PROGRAMS) install_libdir
[ -d $(bindir) ] || $(MKDIR) $(bindir)
$(INSTALL_PROGRAM) $(TOPOBJDIR)/windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
uninstall::
uninstall:: uninstall_libdir
cd $(bindir) && $(RM) wineclipsrv
### Dependencies:
......@@ -220,7 +220,7 @@ install::
# Don't just do a rm -rf on $(includedir) -- don't want to wipe out
# anything extra the user may have put there.
uninstall::
cd $(includedir) && $(RM) $(INSTALLED_INCLUDES)
[ -d $(includedir) ] && cd $(includedir) && $(RM) $(INSTALLED_INCLUDES) || true
-rmdir $(includedir)/msvcrt/sys $(includedir)/msvcrt $(includedir)/wine $(includedir)
### Dependencies:
DEFS = @DLLFLAGS@ -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__ -DDLLDIR="\"$(dlldir)\""
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
......
......@@ -48,7 +48,7 @@ static const IMAGE_NT_HEADERS *main_exe;
static load_dll_callback_t load_dll_callback;
static char **dll_paths;
static const char **dll_paths;
static int nb_dll_paths;
static int dll_path_maxlen;
static int init_done;
......@@ -57,33 +57,49 @@ static int init_done;
/* build the dll load path from the WINEDLLPATH variable */
static void build_dll_path(void)
{
int count = 0;
static const char * const dlldir = DLLDIR;
int len, count = 0;
char *p, *path = getenv( "WINEDLLPATH" );
init_done = 1;
if (!path) return;
path = strdup(path);
p = path;
while (*p)
if (path)
{
while (*p == ':') p++;
if (!*p) break;
count++;
while (*p && *p != ':') p++;
/* count how many path elements we need */
path = strdup(path);
p = path;
while (*p)
{
while (*p == ':') p++;
if (!*p) break;
count++;
while (*p && *p != ':') p++;
}
}
dll_paths = malloc( (count+1) * sizeof(*dll_paths) );
if (count)
{
p = path;
nb_dll_paths = 0;
while (*p)
{
while (*p == ':') *p++ = 0;
if (!*p) break;
dll_paths[nb_dll_paths] = p;
while (*p && *p != ':') p++;
if (p - dll_paths[nb_dll_paths] > dll_path_maxlen)
dll_path_maxlen = p - dll_paths[nb_dll_paths];
nb_dll_paths++;
}
}
dll_paths = malloc( count * sizeof(*dll_paths) );
p = path;
nb_dll_paths = 0;
while (*p)
/* append default dll dir (if not empty) to path */
if ((len = strlen(dlldir)))
{
while (*p == ':') *p++ = 0;
if (!*p) break;
dll_paths[nb_dll_paths] = p;
while (*p && *p != ':') p++;
if (p - dll_paths[nb_dll_paths] > dll_path_maxlen)
dll_path_maxlen = p - dll_paths[nb_dll_paths];
nb_dll_paths++;
if (len > dll_path_maxlen) dll_path_maxlen = len;
dll_paths[nb_dll_paths++] = dlldir;
}
}
......@@ -93,28 +109,23 @@ static void build_dll_path(void)
static void *dlopen_dll( const char *name, char *error, int errorsize )
{
int i, namelen = strlen(name);
char *buffer, *p, *ext;
char *buffer, *p;
void *ret = NULL;
if (!init_done) build_dll_path();
buffer = malloc( dll_path_maxlen + namelen + 8 );
buffer = malloc( dll_path_maxlen + namelen + 5 );
/* store the name at the end of the buffer, prefixed by /lib and followed by .so */
/* store the name at the end of the buffer, followed by .so */
p = buffer + dll_path_maxlen;
memcpy( p, "/lib", 4 );
p += 4;
memcpy( p, name, namelen+1 );
ext = strrchr( p, '.' );
p += namelen;
/* check for .dll or .exe extension to remove */
if (ext && (!strcmp( ext, ".dll" ) || !strcmp( ext, ".exe" ))) p = ext;
memcpy( p, ".so", 4 );
*p++ = '/';
memcpy( p, name, namelen );
strcpy( p + namelen, ".so" );
for (i = 0; i < nb_dll_paths; i++)
{
int len = strlen(dll_paths[i]);
char *p = buffer + dll_path_maxlen - len;
p = buffer + dll_path_maxlen - len;
memcpy( p, dll_paths[i], len );
if ((ret = wine_dlopen( p, RTLD_NOW, error, errorsize ))) break;
}
......
......@@ -80,18 +80,21 @@ inline static void sort_symbols( char **table, int size )
/* open the .so library for a given dll in a specified path */
static char *try_library_path( const char *path, const char *name )
{
char *buffer, *p;
char *buffer;
int fd;
buffer = xmalloc( strlen(path) + strlen(name) + 8 );
sprintf( buffer, "%s/lib%s", path, name );
p = buffer + strlen(buffer) - 4;
if (!strcmp( p, ".dll" )) *p = 0;
buffer = xmalloc( strlen(path) + strlen(name) + 9 );
sprintf( buffer, "%s/%s", path, name );
if (!strchr( name, '.' )) strcat( buffer, ".dll" );
strcat( buffer, ".so" );
/* check if the file exists */
if ((fd = open( buffer, O_RDONLY )) == -1) return NULL;
close( fd );
return buffer;
if ((fd = open( buffer, O_RDONLY )) != -1)
{
close( fd );
return buffer;
}
free( buffer );
return NULL;
}
/* open the .so library for a given dll */
......
......@@ -790,7 +790,7 @@ void BuildDef32File(FILE *outfile)
fprintf(outfile, "; File generated automatically from %s; do not edit!\n\n",
input_file_name );
fprintf(outfile, "LIBRARY lib%s\n\n", DLLFileName);
fprintf(outfile, "LIBRARY %s\n\n", DLLFileName);
fprintf(outfile, "EXPORTS\n");
......@@ -833,7 +833,7 @@ void BuildDef32File(FILE *outfile)
fprintf(outfile, "=%s", make_internal_name( odp, "stub" ));
break;
case TYPE_FORWARD:
fprintf(outfile, "=lib%s", odp->link_name);
fprintf(outfile, "=%s", odp->link_name);
break;
default:
assert(0);
......
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