makefiles: Support specifying installed files in the top-level makefile.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-11-27 13:16:52 +01:00
parent b1b8fb77be
commit d84de4ca00
18 changed files with 87 additions and 93 deletions

View File

@ -33,7 +33,6 @@ dlldir = ${libdir}/wine
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
srcdir = @srcdir@
wine64_disable = @wine64_disable@
SHELL = /bin/sh
RM = rm -f
MV = mv
@ -87,16 +86,15 @@ api_manext = 3w
conf_manext = 5
WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@
WINELOADER_DEPENDS = @WINELOADER_DEPENDS@
WINELOADER_INSTALL = @WINELOADER_INSTALL@
WINELOADER_LDFLAGS = @WINELOADER_LDFLAGS@
LIBWINE_SHAREDLIB = @LIBWINE_SHAREDLIB@
LIBWINE_IMPORTLIB = @LIBWINE_IMPORTLIB@
LIBWINE_INSTALL_LIB = @LIBWINE_INSTALL_LIB@
LIBWINE_INSTALL_DEV = @LIBWINE_INSTALL_DEV@
LIBWINE_LDFLAGS = @LIBWINE_LDFLAGS@
LIBWINE_DEPENDS = @LIBWINE_DEPENDS@
DISABLED_SUBDIRS = @DISABLED_SUBDIRS@
CONFIGURE_TARGETS = @CONFIGURE_TARGETS@
TOP_INSTALL_LIB = @TOP_INSTALL_LIB@
TOP_INSTALL_DEV = @TOP_INSTALL_DEV@
@ALL_VARS_RULES@
@SET_MAKE@

53
configure vendored
View File

@ -624,7 +624,6 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
WINELOADER_INSTALL
ALL_VARS_RULES
LDAP_LIBS
LDAP_CFLAGS
@ -725,8 +724,6 @@ OBJCFLAGS
OBJC
LIBWINE_DEPENDS
LIBWINE_LDFLAGS
LIBWINE_INSTALL_DEV
LIBWINE_INSTALL_LIB
LIBWINE_IMPORTLIB
LIBWINE_SHAREDLIB
DLLTOOL
@ -738,6 +735,8 @@ READELF
OTOOL
LDD
WINELOADER_LDFLAGS
TOP_INSTALL_DEV
TOP_INSTALL_LIB
LDEXECFLAGS
LDRPATH_LOCAL
LDRPATH_INSTALL
@ -762,7 +761,6 @@ AR
BISON
FLEX
TOOLSDIR
wine64_disable
TARGETFLAGS
LD
CPPBIN
@ -5661,8 +5659,6 @@ then
You should create a separate build directory and run configure from there." "$LINENO" 5
enable_fonts=${enable_fonts:-no}
enable_server=${enable_server:-no}
wine64_disable=\#
elif test "x$enable_win64" = "xyes"
then
test "x$libdir" != "x\${exec_prefix}/lib" || libdir="\${exec_prefix}/lib64"
@ -7763,6 +7759,10 @@ LDRPATH_LOCAL=""
LDEXECFLAGS=""
TOP_INSTALL_LIB=""
TOP_INSTALL_DEV=""
WINELOADER_LDFLAGS=""
LIBEXT="so"
@ -8153,14 +8153,12 @@ fi
LIBWINE_IMPORTLIB="libwine.a"
LIBWINE_INSTALL_LIB="libwine.dll"
LIBWINE_INSTALL_DEV="libwine.a"
LIBWINE_LDFLAGS="-shared \$(srcdir)/wine.def"
LIBWINE_DEPENDS="wine.def"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.dll"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.a"
;;
darwin*|macosx*)
@ -8812,14 +8810,12 @@ fi
LIBWINE_SHAREDLIB="libwine.$libwine_version.dylib"
LIBWINE_INSTALL_LIB="libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib"
LIBWINE_INSTALL_DEV="libwine.dylib"
LIBWINE_LDFLAGS="-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"
WINELOADER_DEPENDS="wine_info.plist"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.$libwine_version.dylib libs/wine/libwine.$libwine_soversion.dylib"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.dylib"
;;
linux-android*)
@ -8936,10 +8932,9 @@ fi
LIBWINE_SHAREDLIB="libwine.so"
LIBWINE_INSTALL_LIB="libwine.so"
LIBWINE_LDFLAGS="-shared -Wl,-soname,libwine.so"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.so"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lEGL" >&5
$as_echo_n "checking for -lEGL... " >&6; }
@ -9438,12 +9433,10 @@ $as_echo "$ac_cv_c_dll_unixware" >&6; }
fi
LIBWINE_SHAREDLIB="libwine.so.$libwine_version"
LIBWINE_INSTALL_LIB="libwine.so.$libwine_version libwine.so.$libwine_soversion"
LIBWINE_INSTALL_DEV="libwine.so"
LIBWINE_DEPENDS="wine.map"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.so.$libwine_version libs/wine/libwine.so.$libwine_soversion"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.so"
;;
esac
@ -20204,11 +20197,27 @@ $with_wine64/loader/wine-preloader:
clean::
\$(RM) fonts server loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader"
else
WINELOADER_INSTALL="wine.inf l_intl.nls"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV include"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB \
fonts \
loader/l_intl.nls \
loader/wine.inf \
programs/msiexec/msiexec \
programs/notepad/notepad \
programs/regedit/regedit \
programs/regsvr32/regsvr32 \
programs/wineboot/wineboot \
programs/winecfg/winecfg \
programs/wineconsole/wineconsole \
programs/winedbg/winedbg \
programs/winefile/winefile \
programs/winemine/winemine \
programs/winepath/winepath \
server/wineserver"
case $host_os in
cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;;
*) WINELOADER_INSTALL="$WINELOADER_INSTALL wine.desktop" ;;
*) TOP_INSTALL_LIB="$TOP_INSTALL_LIB loader/wine.desktop" ;;
esac
fi

View File

@ -237,7 +237,6 @@ then
You should create a separate build directory and run configure from there.])
enable_fonts=${enable_fonts:-no}
enable_server=${enable_server:-no}
AC_SUBST(wine64_disable,[\#])
elif test "x$enable_win64" = "xyes"
then
test "x$libdir" != "x\${exec_prefix}/lib" || libdir="\${exec_prefix}/lib64"
@ -714,6 +713,8 @@ AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"")
AC_SUBST(LDEXECFLAGS,"")
AC_SUBST(TOP_INSTALL_LIB,"")
AC_SUBST(TOP_INSTALL_DEV,"")
AC_SUBST(WINELOADER_LDFLAGS,"")
LIBEXT="so"
DLLEXT=".so"
@ -753,10 +754,10 @@ case $host_os in
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.dll")
AC_SUBST(LIBWINE_IMPORTLIB,"libwine.a")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.dll")
AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.a")
AC_SUBST(LIBWINE_LDFLAGS,"-shared \$(srcdir)/wine.def")
AC_SUBST(LIBWINE_DEPENDS,"wine.def")
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.dll"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.a"
;;
darwin*|macosx*)
@ -881,10 +882,10 @@ case $host_os in
fi
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib")
AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.dylib")
AC_SUBST(LIBWINE_LDFLAGS,["-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"])
AC_SUBST(WINELOADER_DEPENDS,"wine_info.plist")
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.$libwine_version.dylib libs/wine/libwine.$libwine_soversion.dylib"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.dylib"
;;
linux-android*)
@ -903,8 +904,8 @@ case $host_os in
[LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"])
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so")
AC_SUBST(LIBWINE_LDFLAGS,["-shared -Wl,-soname,libwine.so"])
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.so"
WINE_CHECK_SONAME(EGL,eglGetProcAddress)
WINE_CHECK_SONAME(GLESv2,glFlush)
@ -983,9 +984,9 @@ case $host_os in
fi
fi
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so.$libwine_version")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so.$libwine_version libwine.so.$libwine_soversion")
AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.so")
AC_SUBST(LIBWINE_DEPENDS,"wine.map")
TOP_INSTALL_LIB="$TOP_INSTALL_LIB libs/wine/libwine.so.$libwine_version libs/wine/libwine.so.$libwine_soversion"
TOP_INSTALL_DEV="$TOP_INSTALL_DEV libs/wine/libwine.so"
;;
esac
@ -4075,10 +4076,27 @@ $with_wine64/loader/wine-preloader:
clean::
\$(RM) fonts server loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader])
else
AC_SUBST(WINELOADER_INSTALL,"wine.inf l_intl.nls")
TOP_INSTALL_DEV="$TOP_INSTALL_DEV include"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB \
fonts \
loader/l_intl.nls \
loader/wine.inf \
programs/msiexec/msiexec \
programs/notepad/notepad \
programs/regedit/regedit \
programs/regsvr32/regsvr32 \
programs/wineboot/wineboot \
programs/winecfg/winecfg \
programs/wineconsole/wineconsole \
programs/winedbg/winedbg \
programs/winefile/winefile \
programs/winemine/winemine \
programs/winepath/winepath \
server/wineserver"
case $host_os in
cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;;
*) WINELOADER_INSTALL="$WINELOADER_INSTALL wine.desktop" ;;
*) TOP_INSTALL_LIB="$TOP_INSTALL_LIB loader/wine.desktop" ;;
esac
fi

View File

@ -26,8 +26,6 @@ config_EXTRADEFS = \
SHAREDLIB = $(LIBWINE_SHAREDLIB)
IMPORTLIB = $(LIBWINE_IMPORTLIB)
INSTALL_LIB = $(LIBWINE_INSTALL_LIB)
INSTALL_DEV = $(LIBWINE_INSTALL_DEV)
libwine_LDFLAGS = $(LIBWINE_LDFLAGS)
libwine_DEPS = $(LIBWINE_DEPENDS)

View File

@ -11,7 +11,7 @@ SOURCES = \
wine_info.plist.in
PROGRAMS = $(WINELOADER_PROGRAMS)
INSTALL_LIB = $(WINELOADER_PROGRAMS) $(WINELOADER_INSTALL)
INSTALL_LIB = $(WINELOADER_PROGRAMS)
preloader_EXTRADEFS = $(MSVCRTFLAGS)

View File

@ -11,5 +11,3 @@ RC_SRCS = rsrc.rc
MANPAGES = msiexec.man.in
SVG_SRCS = msiexec.svg
INSTALL_LIB = msiexec.exe $(wine64_disable)msiexec

View File

@ -11,5 +11,3 @@ RC_SRCS = notepad.rc
MANPAGES = notepad.man.in
SVG_SRCS = notepad.svg
INSTALL_LIB = notepad.exe $(wine64_disable)notepad

View File

@ -20,5 +20,3 @@ RC_SRCS = regedit.rc
MANPAGES = regedit.man.in
SVG_SRCS = regedit.svg
INSTALL_LIB = regedit.exe $(wine64_disable)regedit

View File

@ -8,5 +8,3 @@ C_SRCS = \
RC_SRCS = regsvr32.rc
MANPAGES = regsvr32.man.in
INSTALL_LIB = regsvr32.exe $(wine64_disable)regsvr32

View File

@ -10,5 +10,3 @@ C_SRCS = \
RC_SRCS = wineboot.rc
MANPAGES = wineboot.man.in
INSTALL_LIB = wineboot.exe $(wine64_disable)wineboot

View File

@ -22,5 +22,3 @@ MANPAGES = winecfg.man.in
SVG_SRCS = \
logo.svg \
winecfg.svg
INSTALL_LIB = winecfg.exe $(wine64_disable)winecfg

View File

@ -13,5 +13,3 @@ C_SRCS = \
RC_SRCS = wineconsole.rc
MANPAGES = wineconsole.man.in
INSTALL_LIB = wineconsole.exe $(wine64_disable)wineconsole

View File

@ -34,5 +34,3 @@ LEX_SRCS = debug.l
BISON_SRCS = dbg.y
MANPAGES = winedbg.man.in
INSTALL_LIB = winedbg.exe $(wine64_disable)winedbg

View File

@ -12,5 +12,3 @@ RC_SRCS = winefile.rc
MANPAGES = winefile.man.in
SVG_SRCS = winefile.svg
INSTALL_LIB = winefile.exe $(wine64_disable)winefile

View File

@ -12,5 +12,3 @@ RC_SRCS = winemine.rc
MANPAGES = winemine.man.in
SVG_SRCS = winemine.svg
INSTALL_LIB = winemine.exe $(wine64_disable)winemine

View File

@ -4,5 +4,3 @@ APPMODE = -mconsole -municode
C_SRCS = winepath.c
MANPAGES = winepath.man.in
INSTALL_LIB = winepath.exe $(wine64_disable)winepath

View File

@ -51,5 +51,3 @@ MANPAGES = \
wineserver.man.in
EXTRALIBS = $(LDEXECFLAGS) -lwine $(POLL_LIBS) $(RT_LIBS)
INSTALL_LIB = $(PROGRAMS)

View File

@ -137,6 +137,8 @@ static struct strarray libs;
static struct strarray enable_tests;
static struct strarray cmdline_vars;
static struct strarray disabled_dirs;
static struct strarray top_install_lib;
static struct strarray top_install_dev;
static const char *root_src_dir;
static const char *tools_dir;
static const char *tools_ext;
@ -2126,12 +2128,16 @@ static struct strarray get_default_imports( const struct makefile *make )
static void add_install_rule( struct makefile *make, const char *target,
const char *file, const char *dest )
{
if (strarray_exists( &make->install_lib, target ))
if (strarray_exists( &make->install_lib, target ) ||
strarray_exists( &top_install_lib, make->base_dir ) ||
strarray_exists( &top_install_lib, base_dir_path( make, target )))
{
strarray_add( &make->install_rules[INSTALL_LIB], file );
strarray_add( &make->install_rules[INSTALL_LIB], dest );
}
else if (strarray_exists( &make->install_dev, target ))
else if (strarray_exists( &make->install_dev, target ) ||
strarray_exists( &top_install_dev, make->base_dir ) ||
strarray_exists( &top_install_dev, base_dir_path( make, target )))
{
strarray_add( &make->install_rules[INSTALL_DEV], file );
strarray_add( &make->install_rules[INSTALL_DEV], dest );
@ -2493,15 +2499,10 @@ static void output_source_l( struct makefile *make, struct incl_file *source, co
static void output_source_h( struct makefile *make, struct incl_file *source, const char *obj )
{
if (source->file->flags & FLAG_GENERATED)
{
strarray_add( &make->all_targets, source->name );
}
else
{
strarray_add( &make->install_rules[INSTALL_DEV], source->name );
strarray_add( &make->install_rules[INSTALL_DEV],
strmake( "D$(includedir)/wine/%s", get_include_install_path( source->name ) ));
}
add_install_rule( make, source->name, source->name,
strmake( "D$(includedir)/wine/%s", get_include_install_path( source->name ) ));
}
@ -2626,15 +2627,11 @@ static void output_source_idl( struct makefile *make, struct incl_file *source,
if (source->file->flags & FLAG_IDL_PROXY) strarray_add( &make->dlldata_files, source->name );
if (source->file->flags & FLAG_INSTALL)
{
strarray_add( &make->install_rules[INSTALL_DEV], xstrdup( source->name ));
strarray_add( &make->install_rules[INSTALL_DEV],
strmake( "D$(includedir)/wine/%s.idl", get_include_install_path( obj ) ));
add_install_rule( make, source->name, xstrdup( source->name ),
strmake( "D$(includedir)/wine/%s.idl", get_include_install_path( obj ) ));
if (source->file->flags & FLAG_IDL_HEADER)
{
strarray_add( &make->install_rules[INSTALL_DEV], strmake( "%s.h", obj ));
strarray_add( &make->install_rules[INSTALL_DEV],
strmake( "d$(includedir)/wine/%s.h", get_include_install_path( obj ) ));
}
add_install_rule( make, source->name, strmake( "%s.h", obj ),
strmake( "d$(includedir)/wine/%s.h", get_include_install_path( obj ) ));
}
if (!targets.count) return;
@ -2676,12 +2673,10 @@ static void output_source_x( struct makefile *make, struct incl_file *source, co
tools_dir_path( make, "make_xftmpl" ), tools_ext, source->filename );
if (source->file->flags & FLAG_INSTALL)
{
strarray_add( &make->install_rules[INSTALL_DEV], source->name );
strarray_add( &make->install_rules[INSTALL_DEV],
strmake( "D$(includedir)/wine/%s", get_include_install_path( source->name ) ));
strarray_add( &make->install_rules[INSTALL_DEV], strmake( "%s.h", obj ));
strarray_add( &make->install_rules[INSTALL_DEV],
strmake( "d$(includedir)/wine/%s.h", get_include_install_path( obj ) ));
add_install_rule( make, source->name, source->name,
strmake( "D$(includedir)/wine/%s", get_include_install_path( source->name ) ));
add_install_rule( make, source->name, strmake( "%s.h", obj ),
strmake( "d$(includedir)/wine/%s.h", get_include_install_path( obj ) ));
}
}
@ -2692,7 +2687,8 @@ static void output_source_x( struct makefile *make, struct incl_file *source, co
static void output_source_sfd( struct makefile *make, struct incl_file *source, const char *obj )
{
unsigned int i;
char *ttf_file = src_dir_path( make, strmake( "%s.ttf", obj ));
char *ttf_obj = strmake( "%s.ttf", obj );
char *ttf_file = src_dir_path( make, ttf_obj );
if (fontforge && !make->src_dir)
{
@ -2702,10 +2698,8 @@ static void output_source_sfd( struct makefile *make, struct incl_file *source,
if (!(source->file->flags & FLAG_SFD_FONTS)) output( "all: %s\n", ttf_file );
}
if (source->file->flags & FLAG_INSTALL)
{
strarray_add( &make->install_rules[INSTALL_LIB], strmake( "%s.ttf", obj ));
strarray_add( &make->install_rules[INSTALL_LIB], strmake( "D$(fontdir)/%s.ttf", obj ));
}
add_install_rule( make, source->name, ttf_obj, strmake( "D$(fontdir)/%s", ttf_obj ));
if (source->file->flags & FLAG_SFD_FONTS)
{
struct strarray *array = source->file->args;
@ -2719,8 +2713,7 @@ static void output_source_sfd( struct makefile *make, struct incl_file *source,
output( "%s: %s %s\n", obj_dir_path( make, font ),
tools_path( make, "sfnt2fon" ), ttf_file );
output( "\t%s -o $@ %s %s\n", tools_path( make, "sfnt2fon" ), ttf_file, args );
strarray_add( &make->install_rules[INSTALL_LIB], xstrdup(font) );
strarray_add( &make->install_rules[INSTALL_LIB], strmake( "d$(fontdir)/%s", font ));
add_install_rule( make, source->name, xstrdup(font), strmake( "d$(fontdir)/%s", font ));
}
}
}
@ -4211,6 +4204,8 @@ int main( int argc, char *argv[] )
unwind_flags = get_expanded_make_var_array( top_makefile, "UNWINDFLAGS" );
libs = get_expanded_make_var_array( top_makefile, "LIBS" );
enable_tests = get_expanded_make_var_array( top_makefile, "ENABLE_TESTS" );
top_install_lib = get_expanded_make_var_array( top_makefile, "TOP_INSTALL_LIB" );
top_install_dev = get_expanded_make_var_array( top_makefile, "TOP_INSTALL_DEV" );
root_src_dir = get_expanded_make_variable( top_makefile, "srcdir" );
tools_dir = get_expanded_make_variable( top_makefile, "TOOLSDIR" );