makefiles: Replace the libwine makefile rules by variable declarations.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2015-11-13 18:38:51 +09:00
parent 3cac38ab29
commit dec6a946d3
5 changed files with 87 additions and 83 deletions

View File

@ -80,6 +80,7 @@ LIBPORT = $(top_builddir)/libs/port/libwine_port.a
LIBWPP = $(top_builddir)/libs/wpp/libwpp.a
LIBWINE = -L$(top_builddir)/libs/wine -lwine
LIBWINE_STATIC = $(top_builddir)/libs/wine/libwine_static.a
PACKAGE_VERSION = @PACKAGE_VERSION@
SED_CMD = LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' -e 's,@PACKAGE_VERSION\@,@PACKAGE_VERSION@,g'
LDRPATH_INSTALL = @LDRPATH_INSTALL@
LDRPATH_LOCAL = @LDRPATH_LOCAL@
@ -92,6 +93,12 @@ conf_manext = 5
WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@
WINELOADER_DEPENDS = @WINELOADER_DEPENDS@
WINELOADER_INSTALL = @WINELOADER_INSTALL@
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@
@ALL_VARS_RULES@
@SET_MAKE@

75
configure vendored
View File

@ -704,7 +704,12 @@ APPLICATIONSERVICES_LIBS
FORCEFEEDBACK_LIBS
IOKIT_LIBS
COREFOUNDATION_LIBS
LIBWINE_RULES
LIBWINE_DEPENDS
LIBWINE_LDFLAGS
LIBWINE_INSTALL_DEV
LIBWINE_INSTALL_LIB
LIBWINE_IMPORTLIB
LIBWINE_SHAREDLIB
SOCKET_LIBS
DLLTOOL
WINELOADER_PROGRAMS
@ -7987,14 +7992,17 @@ fi
;;
esac
LIBWINE_RULES="
SHAREDLIB = libwine.dll
IMPORTLIB = libwine.a
INSTALL_LIB = libwine.dll
INSTALL_DEV = libwine.a
libwine_LDFLAGS = -shared \$(srcdir)/wine.def
libwine_DEPS = wine.def
"
LIBWINE_SHAREDLIB="libwine.dll"
LIBWINE_IMPORTLIB="libwine.a"
LIBWINE_INSTALL_LIB="libwine.dll"
LIBWINE_INSTALL_DEV="libwine.a"
LIBWINE_LDFLAGS="-shared \$(srcdir)/wine.def"
LIBWINE_DEPENDS="wine.def"
;;
@ -8013,7 +8021,6 @@ done
LIBEXT="dylib"
DLLFLAGS="$DLLFLAGS -fPIC"
LIBWINE_LDFLAGS="-multiply_defined suppress"
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
COREFOUNDATION_LIBS="-framework CoreFoundation"
@ -8231,13 +8238,13 @@ fi
fi
LIBWINE_RULES="
SHAREDLIB = libwine.$libwine_version.dylib
INSTALL_LIB = libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib
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
"
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"
@ -8385,11 +8392,11 @@ fi
;;
esac
LIBWINE_RULES="
SHAREDLIB = libwine.so
INSTALL_LIB = libwine.so
libwine_LDFLAGS = -shared
"
LIBWINE_SHAREDLIB="libwine.so"
LIBWINE_INSTALL_LIB="libwine.so"
LIBWINE_LDFLAGS="-shared"
;;
@ -8420,7 +8427,7 @@ fi
$as_echo "$ac_cv_c_dll_gnuelf" >&6; }
if test "$ac_cv_c_dll_gnuelf" = "yes"
then
shared_ldflags="-shared"
LIBWINE_LDFLAGS="-shared"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1" >&5
$as_echo_n "checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1... " >&6; }
if ${ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1+:} false; then :
@ -8444,7 +8451,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&5
$as_echo "$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&6; }
if test "x$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" = xyes; then :
shared_ldflags="-shared -Wl,-soname,libwine.so.$libwine_soversion"
LIBWINE_LDFLAGS="-shared -Wl,-soname,libwine.so.$libwine_soversion"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1" >&5
$as_echo_n "checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1... " >&6; }
@ -8469,7 +8476,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&5
$as_echo "$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&6; }
if test "x$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" = xyes; then :
shared_ldflags="-shared -Wl,-h,libwine.so.$libwine_soversion"
LIBWINE_LDFLAGS="-shared -Wl,-h,libwine.so.$libwine_soversion"
fi
fi
@ -8497,7 +8504,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&5
$as_echo "$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&6; }
if test "x$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" = xyes; then :
shared_ldflags="$shared_ldflags -Wl,--version-script=\$(srcdir)/wine.map"
LIBWINE_LDFLAGS="$LIBWINE_LDFLAGS -Wl,--version-script=\$(srcdir)/wine.map"
fi
rm -f conftest.map
@ -8741,16 +8748,16 @@ fi
$as_echo "$ac_cv_c_dll_unixware" >&6; }
if test "$ac_cv_c_dll_unixware" = "yes"
then
shared_ldflags="-Wl,-G,-h,libwine.so.$libwine_soversion"
LIBWINE_LDFLAGS="-Wl,-G,-h,libwine.so.$libwine_soversion"
fi
fi
LIBWINE_RULES="
SHAREDLIB = libwine.so.$libwine_version
INSTALL_LIB = libwine.so.$libwine_version libwine.so.$libwine_soversion
INSTALL_DEV = libwine.so
libwine_LDFLAGS = $shared_ldflags
libwine_DEPS = wine.map
"
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"
;;
esac
@ -18049,7 +18056,7 @@ wine_fn_config_dll xpssvcs enable_xpssvcs
wine_fn_config_makefile fonts enable_fonts clean,install-lib
wine_fn_config_makefile include enable_include clean,install-dev
wine_fn_config_makefile libs/port enable_libs_port
wine_fn_config_makefile libs/wine enable_libs_wine clean,config,install-dev,install-lib
wine_fn_config_makefile libs/wine enable_libs_wine clean,implib,install-dev,install-lib
wine_fn_config_makefile libs/wpp enable_libs_wpp
wine_fn_config_makefile loader enable_loader clean,install-lib
wine_fn_config_program arp enable_arp install

View File

@ -717,21 +717,18 @@ case $host_os in
AC_SUBST(SOCKET_LIBS,"-lws2_32") ;;
esac
AC_SUBST(LIBWINE_RULES,["
SHAREDLIB = libwine.dll
IMPORTLIB = libwine.a
INSTALL_LIB = libwine.dll
INSTALL_DEV = libwine.a
libwine_LDFLAGS = -shared \$(srcdir)/wine.def
libwine_DEPS = wine.def
"])
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")
;;
darwin*|macosx*)
AC_CHECK_HEADERS(libunwind.h)
LIBEXT="dylib"
DLLFLAGS="$DLLFLAGS -fPIC"
LIBWINE_LDFLAGS="-multiply_defined suppress"
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
dnl declare needed frameworks
@ -842,13 +839,10 @@ libwine_DEPS = wine.def
AC_MSG_RESULT([[cross-compiling, assuming yes]]))
fi
AC_SUBST(LIBWINE_RULES,["
SHAREDLIB = libwine.$libwine_version.dylib
INSTALL_LIB = libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib
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
"])
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")
;;
@ -874,11 +868,9 @@ libwine_LDFLAGS = -dynamiclib -install_name @rpath/libwine.$libwine_soversion.dy
;;
esac
AC_SUBST(LIBWINE_RULES,["
SHAREDLIB = libwine.so
INSTALL_LIB = libwine.so
libwine_LDFLAGS = -shared
"])
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so")
AC_SUBST(LIBWINE_LDFLAGS,"-shared")
;;
*)
@ -889,15 +881,15 @@ libwine_LDFLAGS = -shared
ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
if test "$ac_cv_c_dll_gnuelf" = "yes"
then
shared_ldflags="-shared"
LIBWINE_LDFLAGS="-shared"
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
[shared_ldflags="-shared -Wl,-soname,libwine.so.$libwine_soversion"],
[LIBWINE_LDFLAGS="-shared -Wl,-soname,libwine.so.$libwine_soversion"],
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
[shared_ldflags="-shared -Wl,-h,libwine.so.$libwine_soversion"])])
[LIBWINE_LDFLAGS="-shared -Wl,-h,libwine.so.$libwine_soversion"])])
echo '{ global: *; };' >conftest.map
WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
[shared_ldflags="$shared_ldflags -Wl,--version-script=\$(srcdir)/wine.map"])
[LIBWINE_LDFLAGS="$LIBWINE_LDFLAGS -Wl,--version-script=\$(srcdir)/wine.map"])
rm -f conftest.map
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
@ -936,16 +928,13 @@ libwine_LDFLAGS = -shared
ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
if test "$ac_cv_c_dll_unixware" = "yes"
then
shared_ldflags="-Wl,-G,-h,libwine.so.$libwine_soversion"
LIBWINE_LDFLAGS="-Wl,-G,-h,libwine.so.$libwine_soversion"
fi
fi
AC_SUBST(LIBWINE_RULES,["
SHAREDLIB = libwine.so.$libwine_version
INSTALL_LIB = libwine.so.$libwine_version libwine.so.$libwine_soversion
INSTALL_DEV = libwine.so
libwine_LDFLAGS = $shared_ldflags
libwine_DEPS = wine.map
"])
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")
;;
esac
@ -3399,7 +3388,7 @@ WINE_CONFIG_DLL(xpssvcs)
WINE_CONFIG_MAKEFILE([fonts],,[clean,install-lib])
WINE_CONFIG_MAKEFILE([include],,[clean,install-dev])
WINE_CONFIG_MAKEFILE([libs/port])
WINE_CONFIG_MAKEFILE([libs/wine],,[clean,config,install-dev,install-lib])
WINE_CONFIG_MAKEFILE([libs/wine],,[clean,implib,install-dev,install-lib])
WINE_CONFIG_MAKEFILE([libs/wpp])
WINE_CONFIG_MAKEFILE([loader],,[clean,install-lib])
WINE_CONFIG_PROGRAM(arp,,[install])

View File

@ -103,15 +103,16 @@ config_EXTRADEFS = \
-DBIN_TO_DLLDIR=\"`$(MAKEDEP) -R ${bindir} ${dlldir}`\" \
-DBIN_TO_DATADIR=\"`$(MAKEDEP) -R ${bindir} ${datadir}/wine`\"
SHAREDLIB = $(LIBWINE_SHAREDLIB)
IMPORTLIB = $(LIBWINE_IMPORTLIB)
INSTALL_LIB = $(LIBWINE_INSTALL_LIB)
INSTALL_DEV = $(LIBWINE_INSTALL_DEV)
libwine_LDFLAGS = $(LIBWINE_LDFLAGS)
libwine_DEPS = $(LIBWINE_DEPENDS)
version.c: dummy
version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
dummy:
# Make sure that make_makefiles sees the generated rules
.PHONY: dummy install install-lib install-dev uninstall
install install-lib::
install install-dev::
clean::
@LIBWINE_RULES@
.PHONY: dummy

View File

@ -200,6 +200,10 @@ sub parse_makefile($)
while (/\\$/) { chop; $_ .= <MAKE>; chomp; } # merge continued lines
next if (/^\s*$/);
if (/\@[A-Z_]+\@/) # config.status substitution variable
{
${$make{"=flags"}}{"config"} = 1;
}
if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE)\s*=\s*(.*)/)
{
my $var = $1;
@ -207,7 +211,7 @@ sub parse_makefile($)
${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB";
next;
}
if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
{
my $var = $1;
my @list = split(/\s+/, $2);
@ -223,10 +227,6 @@ sub parse_makefile($)
{
die "Variable $1 in $file.in is obsolete";
}
if (/\@[A-Z_]+\@/) # config.status substitution variable
{
${$make{"=flags"}}{"config"} = 1;
}
}
if ($file =~ /^programs\/([^\/]+)\/Makefile/)
@ -248,7 +248,7 @@ sub parse_makefile($)
${$make{"=flags"}}{"install-lib"} = 1 if defined $make{"INSTALL_LIB"};
${$make{"=flags"}}{"install-dev"} = 1 if defined $make{"INSTALL_DEV"};
}
${$make{"=flags"}}{"clean"} = 1 if defined $make{"PROGRAMS"} || defined $make{"EXTRA_TARGETS"};
${$make{"=flags"}}{"clean"} = 1 if defined $make{"PROGRAMS"} || defined $make{"EXTRA_TARGETS"} || defined $make{"EXTRA_OBJS"};
if (defined $make{"=flags"} && defined $make{"MODULE"})
{