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@
OBJEXT = @OBJEXT@
DLLEXT = @DLLEXT@
DLLPREFIX = @DLLPREFIX@
FAKEEXT = $(DLLEXT:.so=.fake)
TOOLSEXT = @TOOLSEXT@
IMPLIBEXT = @IMPLIBEXT@

8
aclocal.m4 vendored
View File

@ -381,10 +381,10 @@ __uninstall__: $ac_dir/__uninstall__"
then
wine_fn_append_rule \
"$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
$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
wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
@ -501,10 +501,10 @@ __uninstall__: $ac_dir/__uninstall__"
then
wine_fn_append_rule \
"$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
$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
then

11
configure vendored
View File

@ -713,6 +713,7 @@ LDRPATH_LOCAL
LDRPATH_INSTALL
IMPLIBEXT
DLLFLAGS
DLLPREFIX
DLLEXT
CPP
OPENGL_LIBS
@ -6409,6 +6410,8 @@ done
DLLEXT=""
DLLPREFIX=""
DLLFLAGS="-D_REENTRANT"
IMPLIBEXT="def"
@ -15634,10 +15637,10 @@ __uninstall__: $ac_dir/__uninstall__"
then
wine_fn_append_rule \
"$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
$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
wine_fn_append_rule \
"$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
@ -15758,10 +15761,10 @@ __uninstall__: $ac_dir/__uninstall__"
then
wine_fn_append_rule \
"$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
$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
then

View File

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

View File

@ -72,7 +72,7 @@ install_dll: $(MODULE) $(DESTDIR)$(dlldir) dummy
$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)
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_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)
uninstall::
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
$(RM) $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
# Misc. rules

View File

@ -107,6 +107,7 @@ EXTRA_OBJS = version.o
CONFIGDIRS = \
-DBINDIR='"$(bindir)"' \
-DDLLDIR='"$(dlldir)"' \
-DDLLPREFIX='"$(DLLPREFIX)"' \
-DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \
-DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(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 */
const char *get_dlldir( const char **default_dlldir )
const char *get_dlldir( const char **default_dlldir, const char **dll_prefix )
{
*default_dlldir = DLLDIR;
*dll_prefix = "/" DLLPREFIX;
return dlldir;
}

View File

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