makefiles: Add support for specifying a prefix for installed library file names.

This commit is contained in:
Alexandre Julliard 2013-09-26 14:31:57 +02:00
parent a63be0823a
commit a83c598c79
9 changed files with 28 additions and 19 deletions

View File

@ -31,6 +31,7 @@ FLEX = @FLEX@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
DLLEXT = @DLLEXT@ DLLEXT = @DLLEXT@
DLLPREFIX = @DLLPREFIX@
FAKEEXT = $(DLLEXT:.so=.fake) FAKEEXT = $(DLLEXT:.so=.fake)
TOOLSEXT = @TOOLSEXT@ TOOLSEXT = @TOOLSEXT@
IMPLIBEXT = @IMPLIBEXT@ IMPLIBEXT = @IMPLIBEXT@

8
aclocal.m4 vendored
View File

@ -381,10 +381,10 @@ __uninstall__: $ac_dir/__uninstall__"
then then
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir) "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
\$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT
\$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll
$ac_dir/__uninstall__:: $ac_dir/__uninstall__::
\$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll"
else else
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
@ -501,10 +501,10 @@ __uninstall__: $ac_dir/__uninstall__"
then then
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir) "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
\$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT
\$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program
$ac_dir/__uninstall__:: $ac_dir/__uninstall__::
\$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program"
if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags
then then

11
configure vendored
View File

@ -713,6 +713,7 @@ LDRPATH_LOCAL
LDRPATH_INSTALL LDRPATH_INSTALL
IMPLIBEXT IMPLIBEXT
DLLFLAGS DLLFLAGS
DLLPREFIX
DLLEXT DLLEXT
CPP CPP
OPENGL_LIBS OPENGL_LIBS
@ -6409,6 +6410,8 @@ done
DLLEXT="" DLLEXT=""
DLLPREFIX=""
DLLFLAGS="-D_REENTRANT" DLLFLAGS="-D_REENTRANT"
IMPLIBEXT="def" IMPLIBEXT="def"
@ -15634,10 +15637,10 @@ __uninstall__: $ac_dir/__uninstall__"
then then
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir) "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
\$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT
\$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll
$ac_dir/__uninstall__:: $ac_dir/__uninstall__::
\$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll"
else else
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
@ -15758,10 +15761,10 @@ __uninstall__: $ac_dir/__uninstall__"
then then
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir) "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
\$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT
\$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program
$ac_dir/__uninstall__:: $ac_dir/__uninstall__::
\$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program"
if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags
then then

View File

@ -677,6 +677,7 @@ AC_CHECK_HEADERS([libprocstat.h],,,
dnl **** Check for working dll **** dnl **** Check for working dll ****
AC_SUBST(DLLEXT,"") AC_SUBST(DLLEXT,"")
AC_SUBST(DLLPREFIX,"")
AC_SUBST(DLLFLAGS,"-D_REENTRANT") AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(IMPLIBEXT,"def") AC_SUBST(IMPLIBEXT,"def")
AC_SUBST(LDRPATH_INSTALL,"") AC_SUBST(LDRPATH_INSTALL,"")

View File

@ -72,7 +72,7 @@ install_dll: $(MODULE) $(DESTDIR)$(dlldir) dummy
$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(dlldir)/$(MODULE) $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)
install_dll.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy install_dll.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE).so
install_dll.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy install_dll.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
$(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE) $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)
@ -80,7 +80,7 @@ install_dll.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
install install-lib:: install_dll$(DLLEXT) install_dll$(FAKEEXT) install install-lib:: install_dll$(DLLEXT) install_dll$(FAKEEXT)
uninstall:: uninstall::
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE) $(RM) $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
# Misc. rules # Misc. rules

View File

@ -107,6 +107,7 @@ EXTRA_OBJS = version.o
CONFIGDIRS = \ CONFIGDIRS = \
-DBINDIR='"$(bindir)"' \ -DBINDIR='"$(bindir)"' \
-DDLLDIR='"$(dlldir)"' \ -DDLLDIR='"$(dlldir)"' \
-DDLLPREFIX='"$(DLLPREFIX)"' \
-DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \ -DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \
-DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(dlldir)`\" \ -DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(dlldir)`\" \
-DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\" \ -DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\" \

View File

@ -249,9 +249,10 @@ static void init_server_dir( dev_t dev, ino_t ino )
} }
/* retrieve the default dll dir */ /* retrieve the default dll dir */
const char *get_dlldir( const char **default_dlldir ) const char *get_dlldir( const char **default_dlldir, const char **dll_prefix )
{ {
*default_dlldir = DLLDIR; *default_dlldir = DLLDIR;
*dll_prefix = "/" DLLPREFIX;
return dlldir; return dlldir;
} }

View File

@ -90,19 +90,20 @@ static load_dll_callback_t load_dll_callback;
static const char *build_dir; static const char *build_dir;
static const char *default_dlldir; static const char *default_dlldir;
static const char *dll_prefix;
static const char **dll_paths; static const char **dll_paths;
static unsigned int nb_dll_paths; static unsigned int nb_dll_paths;
static int dll_path_maxlen; static int dll_path_maxlen;
extern void mmap_init(void); extern void mmap_init(void);
extern const char *get_dlldir( const char **default_dlldir ); extern const char *get_dlldir( const char **default_dlldir, const char **dll_prefix );
/* build the dll load path from the WINEDLLPATH variable */ /* build the dll load path from the WINEDLLPATH variable */
static void build_dll_path(void) static void build_dll_path(void)
{ {
int len, count = 0; int len, count = 0;
char *p, *path = getenv( "WINEDLLPATH" ); char *p, *path = getenv( "WINEDLLPATH" );
const char *dlldir = get_dlldir( &default_dlldir ); const char *dlldir = get_dlldir( &default_dlldir, &dll_prefix );
if (path) if (path)
{ {
@ -152,6 +153,7 @@ static void build_dll_path(void)
if (len > dll_path_maxlen) dll_path_maxlen = len; if (len > dll_path_maxlen) dll_path_maxlen = len;
dll_paths[nb_dll_paths++] = default_dlldir; dll_paths[nb_dll_paths++] = default_dlldir;
} }
dll_path_maxlen += strlen( dll_prefix ) - 1;
} }
/* check if the library is the correct architecture */ /* check if the library is the correct architecture */
@ -237,11 +239,11 @@ static char *next_dll_path( struct dll_path_context *context )
/* fall through */ /* fall through */
default: default:
index -= 2; index -= 2;
if (index < nb_dll_paths) if (index >= nb_dll_paths) return NULL;
return prepend( context->name, dll_paths[index], strlen( dll_paths[index] )); path = prepend( path + 1, dll_prefix, strlen( dll_prefix ));
break; path = prepend( path, dll_paths[index], strlen( dll_paths[index] ));
return path;
} }
return NULL;
} }

View File

@ -26,7 +26,7 @@ $(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in
.PHONY: install_prog install_prog.so install_prog.fake .PHONY: install_prog install_prog.so install_prog.fake
install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE).so
install_prog.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy install_prog.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
$(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE) $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)
@ -37,7 +37,7 @@ install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
install install-lib:: install_prog$(DLLEXT) install_prog$(FAKEEXT) install install-lib:: install_prog$(DLLEXT) install_prog$(FAKEEXT)
uninstall:: uninstall::
$(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE) $(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
clean:: clean::
$(RM) $(MODULE) $(RM) $(MODULE)