makefiles: Generate the platform-specific libwine rules from configure.

This commit is contained in:
Alexandre Julliard 2013-05-01 12:29:00 +02:00
parent 8849885f73
commit 54244470f3
5 changed files with 189 additions and 175 deletions

View File

@ -13,7 +13,6 @@
# First some useful definitions # First some useful definitions
LDSHARED = @LDSHARED@
INCLUDES = -I$(srcdir) -I. -I$(top_srcdir)/include -I$(top_builddir)/include $(EXTRAINCL) INCLUDES = -I$(srcdir) -I. -I$(top_srcdir)/include -I$(top_builddir)/include $(EXTRAINCL)
ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS) ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS) ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
@ -25,7 +24,7 @@ IDL_GEN_C_SRCS = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \ IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \
$(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h) $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
CLEAN_FILES = *.o *.a *.so *.mo *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core CLEAN_FILES = *.o *.a *.so *.mo *.ln *.res *.fake core
CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \ CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
$(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) \ $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) \
$(PO_SRCS:%=rsrc.pot) $(MC_SRCS:%=msg.pot) $(XTEMPLATE_SRCS:.x=.h) $(PO_SRCS:%=rsrc.pot) $(MC_SRCS:%=msg.pot) $(XTEMPLATE_SRCS:.x=.h)

View File

@ -30,7 +30,6 @@ BISON = @BISON@
FLEX = @FLEX@ FLEX = @FLEX@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
LIBEXT = @LIBEXT@
DLLEXT = @DLLEXT@ DLLEXT = @DLLEXT@
FAKEEXT = $(DLLEXT:.so=.fake) FAKEEXT = $(DLLEXT:.so=.fake)
TOOLSEXT = @TOOLSEXT@ TOOLSEXT = @TOOLSEXT@

161
configure vendored
View File

@ -633,8 +633,6 @@ LIBPOLL
LIBDL LIBDL
EXTRA_BINARIES EXTRA_BINARIES
MAIN_BINARY MAIN_BINARY
SOCKETLIBS
CRTLIBS
TOOLSEXT TOOLSEXT
LDPATH LDPATH
UNWINDFLAGS UNWINDFLAGS
@ -691,6 +689,8 @@ CORESERVICESLIB
APPLICATIONSERVICESLIB APPLICATIONSERVICESLIB
IOKITLIB IOKITLIB
COREFOUNDATIONLIB COREFOUNDATIONLIB
LIBWINE_RULES
SOCKETLIBS
DLLWRAP DLLWRAP
DLLTOOL DLLTOOL
ac_ct_READELF ac_ct_READELF
@ -699,9 +699,7 @@ LDD
LDRPATH_LOCAL LDRPATH_LOCAL
LDRPATH_INSTALL LDRPATH_INSTALL
IMPLIBEXT IMPLIBEXT
LIBEXT
LDDLLFLAGS LDDLLFLAGS
LDSHARED
DLLFLAGS DLLFLAGS
DLLEXT DLLEXT
CPP CPP
@ -6282,18 +6280,15 @@ DLLEXT=""
DLLFLAGS="-D_REENTRANT" DLLFLAGS="-D_REENTRANT"
LDSHARED=""
LDDLLFLAGS="" LDDLLFLAGS=""
LIBEXT="so"
IMPLIBEXT="def" IMPLIBEXT="def"
LDRPATH_INSTALL="" LDRPATH_INSTALL=""
LDRPATH_LOCAL="" LDRPATH_LOCAL=""
LIBEXT="so"
STATIC_IMPLIBEXT="def.a" STATIC_IMPLIBEXT="def.a"
# Extract the first word of "ldd", so it can be a program name with args. # Extract the first word of "ldd", so it can be a program name with args.
set dummy ldd; ac_word=$2 set dummy ldd; ac_word=$2
@ -6625,10 +6620,9 @@ else
fi fi
if test "$DLLWRAP" = "false"; then if test "$DLLWRAP" = "false"; then
LIBEXT="a" as_fn_error $? "dllwrap is needed to build a dll for Windows" "$LINENO" 5
else
LIBEXT="dll"
fi fi
LIBEXT="dll"
IMPLIBEXT="a" IMPLIBEXT="a"
STATIC_IMPLIBEXT="a" STATIC_IMPLIBEXT="a"
enable_iphlpapi=${enable_iphlpapi:-no} enable_iphlpapi=${enable_iphlpapi:-no}
@ -6640,14 +6634,45 @@ fi
enable_server=${enable_server:-no} enable_server=${enable_server:-no}
with_x=${with_x:-no} with_x=${with_x:-no}
with_pthread=${with_pthread:-no} with_pthread=${with_pthread:-no}
crtlibs=""
case $host_os in
mingw32*)
crtlibs="-lmsvcrt"
SOCKETLIBS="-L\$(top_builddir)/dlls/ws2_32 -lws2_32"
;; ;;
esac
LIBWINE_RULES="
all: libwine.dll libwine.a
libwine.a: wine.def
\$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def
libwine.dll: \$(OBJS) wine.def Makefile.in
\$(DLLWRAP) --def \$(srcdir)/wine.def -o \$@ \$(OBJS) $crtlibs \$(EXTRALIBS)
install install-lib:: libwine.dll \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_DATA) libwine.dll \$(DESTDIR)\$(libdir)/libwine.dll
install install-dev:: libwine.a \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.a libwine.dll
clean::
\$(RM) libwine.dll version.c
"
;;
darwin*|macosx*) darwin*|macosx*)
DLLEXT=".so" DLLEXT=".so"
LIBEXT="dylib" LIBEXT="dylib"
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
LDDLLFLAGS="-bundle -multiply_defined suppress" LDDLLFLAGS="-bundle -multiply_defined suppress"
LIBWINE_LDFLAGS="-multiply_defined suppress" LIBWINE_LDFLAGS="-multiply_defined suppress"
LDSHARED="\$(CC) -dynamiclib"
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`" LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine" LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
COREFOUNDATIONLIB="-framework CoreFoundation" COREFOUNDATIONLIB="-framework CoreFoundation"
@ -6818,7 +6843,35 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
fi fi
fi fi
LIBWINE_RULES="
all: libwine.dylib
libwine.\$(VERSION).dylib: \$(OBJS) \$(RELPATH) Makefile.in
\$(CC) -dynamiclib -install_name @rpath/libwine.\$(SOVERSION).dylib -Wl,-rpath,@loader_path/ -compatibility_version \$(SOVERSION) -current_version \$(VERSION) \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
libwine.\$(SOVERSION).dylib: libwine.\$(VERSION).dylib
\$(RM) \$@ && \$(LN_S) libwine.\$(VERSION).dylib \$@
libwine.dylib: libwine.\$(SOVERSION).dylib
\$(RM) \$@ && \$(LN_S) libwine.\$(SOVERSION).dylib \$@
install install-lib:: libwine.\$(VERSION).dylib \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_PROGRAM) libwine.\$(VERSION).dylib \$(DESTDIR)\$(libdir)/libwine.\$(VERSION).dylib
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.\$(SOVERSION).dylib && \$(LN_S) libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib
install install-dev:: \$(DESTDIR)\$(libdir) dummy
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib && \$(LN_S) libwine.\$(VERSION).dylib libwine.dylib
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib
clean::
\$(RM) libwine.dylib libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib version.c
"
;; ;;
*) *)
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
DLLEXT=".so" DLLEXT=".so"
@ -6871,7 +6924,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&5 { $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; } $as_echo "$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1 = yes; then : if test $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1 = yes; then :
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)" LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so.\$(SOVERSION)"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1" >&5 { $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; } $as_echo_n "checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1... " >&6; }
@ -6896,7 +6949,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&5 { $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; } $as_echo "$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1 = yes; then : if test $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1 = yes; then :
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)" LDSHARED="\$(CC) -shared -Wl,-h,libwine.so.\$(SOVERSION)"
fi fi
fi fi
@ -6976,7 +7029,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&5 { $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; } $as_echo "$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map = yes; then : if test $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map = yes; then :
LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)" LDSHARED="$LDSHARED -Wl,--version-script=\$(srcdir)/wine.map"
fi fi
rm -f conftest.map rm -f conftest.map
@ -7195,55 +7248,42 @@ fi
$as_echo "$ac_cv_c_dll_unixware" >&6; } $as_echo "$ac_cv_c_dll_unixware" >&6; }
if test "$ac_cv_c_dll_unixware" = "yes" if test "$ac_cv_c_dll_unixware" = "yes"
then then
LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" LDSHARED="\$(CC) -Wl,-G,-h,libwine.so.\$(SOVERSION)"
LDDLLFLAGS="-Wl,-G,-B,symbolic" LDDLLFLAGS="-Wl,-G,-B,symbolic"
fi
fi
LIBWINE_RULES="
all: libwine.so
libwine.so.\$(VERSION): \$(OBJS) wine.map Makefile.in
$LDSHARED \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
libwine.so.\$(SOVERSION): libwine.so.\$(VERSION)
\$(RM) \$@ && \$(LN_S) libwine.so.\$(VERSION) \$@
libwine.so: libwine.so.\$(SOVERSION)
\$(RM) \$@ && \$(LN_S) libwine.so.\$(SOVERSION) \$@
install install-lib:: libwine.so.\$(VERSION) \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_PROGRAM) libwine.so.\$(VERSION) \$(DESTDIR)\$(libdir)/libwine.so.\$(VERSION)
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so.\$(SOVERSION) && \$(LN_S) libwine.so.\$(VERSION) libwine.so.\$(SOVERSION)
install install-dev:: \$(DESTDIR)\$(libdir) dummy
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so && \$(LN_S) libwine.so.\$(VERSION) libwine.so
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so libwine.so.\$(VERSION) libwine.so.\$(SOVERSION)
clean::
\$(RM) libwine.so.\$(SOVERSION) libwine.so.\$(VERSION) version.c
"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build an HP-UX dll" >&5
$as_echo_n "checking whether we can build an HP-UX dll... " >&6; }
if ${ac_cv_c_dll_hpux+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -shared"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void myfunc() {}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_c_dll_hpux="yes"
else
ac_cv_c_dll_hpux="no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_dll_hpux" >&5
$as_echo "$ac_cv_c_dll_hpux" >&6; }
if test "$ac_cv_c_dll_hpux" = "yes"
then
LIBEXT="sl"
DLLEXT=".sl"
LDDLLFLAGS="-shared -fPIC"
LDSHARED="\$(CC) -shared"
fi
fi
fi
;; ;;
esac esac
enable_wineqtdecoder=${enable_wineqtdecoder:-no} enable_wineqtdecoder=${enable_wineqtdecoder:-no}
enable_winemac_drv=${enable_winemac_drv:-no} enable_winemac_drv=${enable_winemac_drv:-no}
if test "$LIBEXT" = "a"; then
as_fn_error $? "could not find a way to build shared libraries.
It is currently not possible to build Wine without shared library
(.so) support to allow transparent switch between .so and .dll files.
If you are using Linux, you will need a newer binutils.
" "$LINENO" 5
fi
CROSSTEST_DISABLE=\# CROSSTEST_DISABLE=\#
if test "$cross_compiling" = "no" -a "x$enable_tests" != xno -a "$LIBEXT" != "dll" if test "$cross_compiling" = "no" -a "x$enable_tests" != xno -a "$LIBEXT" != "dll"
@ -12983,15 +13023,6 @@ case $build_os in
;; ;;
esac esac
case $host_os in
mingw32*)
CRTLIBS="-lmsvcrt"
SOCKETLIBS="-L\$(top_builddir)/dlls/ws2_32 -lws2_32"
;;
esac
MAIN_BINARY="wine" MAIN_BINARY="wine"
test "x$enable_win64" != "xyes" || MAIN_BINARY="wine64" test "x$enable_win64" != "xyes" || MAIN_BINARY="wine64"

View File

@ -679,12 +679,11 @@ dnl **** Check for working dll ****
AC_SUBST(DLLEXT,"") AC_SUBST(DLLEXT,"")
AC_SUBST(DLLFLAGS,"-D_REENTRANT") AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(LDSHARED,"")
AC_SUBST(LDDLLFLAGS,"") AC_SUBST(LDDLLFLAGS,"")
AC_SUBST(LIBEXT,"so")
AC_SUBST(IMPLIBEXT,"def") AC_SUBST(IMPLIBEXT,"def")
AC_SUBST(LDRPATH_INSTALL,"") AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"") AC_SUBST(LDRPATH_LOCAL,"")
LIBEXT="so"
STATIC_IMPLIBEXT="def.a" STATIC_IMPLIBEXT="def.a"
WINE_PATH_SONAME_TOOLS WINE_PATH_SONAME_TOOLS
@ -693,11 +692,9 @@ case $host_os in
AC_CHECK_TOOL(DLLTOOL,dlltool,false) AC_CHECK_TOOL(DLLTOOL,dlltool,false)
AC_CHECK_TOOL(DLLWRAP,dllwrap,false) AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
if test "$DLLWRAP" = "false"; then if test "$DLLWRAP" = "false"; then
LIBEXT="a" AC_MSG_ERROR([dllwrap is needed to build a dll for Windows])
else
dnl FIXME - check whether dllwrap works correctly...
LIBEXT="dll"
fi fi
LIBEXT="dll"
IMPLIBEXT="a" IMPLIBEXT="a"
STATIC_IMPLIBEXT="a" STATIC_IMPLIBEXT="a"
dnl Disable modules that can't be used on Windows dnl Disable modules that can't be used on Windows
@ -711,14 +708,44 @@ case $host_os in
dnl Disable dependencies that are not useful on Windows dnl Disable dependencies that are not useful on Windows
with_x=${with_x:-no} with_x=${with_x:-no}
with_pthread=${with_pthread:-no} with_pthread=${with_pthread:-no}
dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
crtlibs=""
case $host_os in
mingw32*)
crtlibs="-lmsvcrt"
AC_SUBST(SOCKETLIBS,"-L\$(top_builddir)/dlls/ws2_32 -lws2_32") ;;
esac
AC_SUBST(LIBWINE_RULES,["
all: libwine.dll libwine.a
libwine.a: wine.def
\$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def
libwine.dll: \$(OBJS) wine.def Makefile.in
\$(DLLWRAP) --def \$(srcdir)/wine.def -o \$@ \$(OBJS) $crtlibs \$(EXTRALIBS)
install install-lib:: libwine.dll \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_DATA) libwine.dll \$(DESTDIR)\$(libdir)/libwine.dll
install install-dev:: libwine.a \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.a libwine.dll
clean::
\$(RM) libwine.dll version.c
"])
;; ;;
darwin*|macosx*) darwin*|macosx*)
DLLEXT=".so" DLLEXT=".so"
LIBEXT="dylib" LIBEXT="dylib"
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
LDDLLFLAGS="-bundle -multiply_defined suppress" LDDLLFLAGS="-bundle -multiply_defined suppress"
LIBWINE_LDFLAGS="-multiply_defined suppress" LIBWINE_LDFLAGS="-multiply_defined suppress"
LDSHARED="\$(CC) -dynamiclib"
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`" LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine" LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
dnl declare needed frameworks dnl declare needed frameworks
@ -823,7 +850,34 @@ case $host_os in
AC_MSG_ERROR([Xcode 3.x cannot build 16-bit code correctly. Use --disable-win16 if you don't need 16-bit support.])], AC_MSG_ERROR([Xcode 3.x cannot build 16-bit code correctly. Use --disable-win16 if you don't need 16-bit support.])],
AC_MSG_RESULT([[cross-compiling, assuming yes]])) AC_MSG_RESULT([[cross-compiling, assuming yes]]))
fi fi
AC_SUBST(LIBWINE_RULES,["
all: libwine.dylib
libwine.\$(VERSION).dylib: \$(OBJS) \$(RELPATH) Makefile.in
\$(CC) -dynamiclib -install_name @rpath/libwine.\$(SOVERSION).dylib -Wl,-rpath,@loader_path/ -compatibility_version \$(SOVERSION) -current_version \$(VERSION) \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
libwine.\$(SOVERSION).dylib: libwine.\$(VERSION).dylib
\$(RM) \$@ && \$(LN_S) libwine.\$(VERSION).dylib \$@
libwine.dylib: libwine.\$(SOVERSION).dylib
\$(RM) \$@ && \$(LN_S) libwine.\$(SOVERSION).dylib \$@
install install-lib:: libwine.\$(VERSION).dylib \$(DESTDIR)\$(libdir) dummy
\$(INSTALL_PROGRAM) libwine.\$(VERSION).dylib \$(DESTDIR)\$(libdir)/libwine.\$(VERSION).dylib
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.\$(SOVERSION).dylib && \$(LN_S) libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib
install install-dev:: \$(DESTDIR)\$(libdir) dummy
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib && \$(LN_S) libwine.\$(VERSION).dylib libwine.dylib
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib
clean::
\$(RM) libwine.dylib libwine.\$(VERSION).dylib libwine.\$(SOVERSION).dylib version.c
"])
;; ;;
*) *)
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
DLLEXT=".so" DLLEXT=".so"
@ -835,9 +889,9 @@ case $host_os in
LDSHARED="\$(CC) -shared" LDSHARED="\$(CC) -shared"
LDDLLFLAGS="-shared -Wl,-Bsymbolic" LDDLLFLAGS="-shared -Wl,-Bsymbolic"
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1], WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
[LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"], [LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so.\$(SOVERSION)"],
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1], [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
[LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"])]) [LDSHARED="\$(CC) -shared -Wl,-h,libwine.so.\$(SOVERSION)"])])
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs], [LDDLLFLAGS="$LDDLLFLAGS,-z,defs"]) WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs], [LDDLLFLAGS="$LDDLLFLAGS,-z,defs"])
@ -846,7 +900,7 @@ case $host_os in
echo '{ global: *; };' >conftest.map echo '{ global: *; };' >conftest.map
WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map], WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
[LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"]) [LDSHARED="$LDSHARED -Wl,--version-script=\$(srcdir)/wine.map"])
rm -f conftest.map rm -f conftest.map
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic], WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
@ -884,36 +938,41 @@ case $host_os in
ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")]) ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
if test "$ac_cv_c_dll_unixware" = "yes" if test "$ac_cv_c_dll_unixware" = "yes"
then then
LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" LDSHARED="\$(CC) -Wl,-G,-h,libwine.so.\$(SOVERSION)"
LDDLLFLAGS="-Wl,-G,-B,symbolic" LDDLLFLAGS="-Wl,-G,-B,symbolic"
fi
fi
AC_SUBST(LIBWINE_RULES,["
all: libwine.so
else libwine.so.\$(VERSION): \$(OBJS) wine.map Makefile.in
AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux, $LDSHARED \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
[WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")])
if test "$ac_cv_c_dll_hpux" = "yes" libwine.so.\$(SOVERSION): libwine.so.\$(VERSION)
then \$(RM) \$@ && \$(LN_S) libwine.so.\$(VERSION) \$@
LIBEXT="sl"
DLLEXT=".sl" libwine.so: libwine.so.\$(SOVERSION)
LDDLLFLAGS="-shared -fPIC" \$(RM) \$@ && \$(LN_S) libwine.so.\$(SOVERSION) \$@
LDSHARED="\$(CC) -shared"
fi install install-lib:: libwine.so.\$(VERSION) \$(DESTDIR)\$(libdir) dummy
fi \$(INSTALL_PROGRAM) libwine.so.\$(VERSION) \$(DESTDIR)\$(libdir)/libwine.so.\$(VERSION)
fi cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so.\$(SOVERSION) && \$(LN_S) libwine.so.\$(VERSION) libwine.so.\$(SOVERSION)
install install-dev:: \$(DESTDIR)\$(libdir) dummy
cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so && \$(LN_S) libwine.so.\$(VERSION) libwine.so
uninstall::
-cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so libwine.so.\$(VERSION) libwine.so.\$(SOVERSION)
clean::
\$(RM) libwine.so.\$(SOVERSION) libwine.so.\$(VERSION) version.c
"])
;; ;;
esac esac
enable_wineqtdecoder=${enable_wineqtdecoder:-no} enable_wineqtdecoder=${enable_wineqtdecoder:-no}
enable_winemac_drv=${enable_winemac_drv:-no} enable_winemac_drv=${enable_winemac_drv:-no}
if test "$LIBEXT" = "a"; then
AC_MSG_ERROR(
[could not find a way to build shared libraries.
It is currently not possible to build Wine without shared library
(.so) support to allow transparent switch between .so and .dll files.
If you are using Linux, you will need a newer binutils.]
)
fi
dnl Check for cross compiler to build test programs dnl Check for cross compiler to build test programs
AC_SUBST([CROSSTEST_DISABLE],[\#]) AC_SUBST([CROSSTEST_DISABLE],[\#])
if test "$cross_compiling" = "no" -a "x$enable_tests" != xno -a "$LIBEXT" != "dll" if test "$cross_compiling" = "no" -a "x$enable_tests" != xno -a "$LIBEXT" != "dll"
@ -1931,14 +1990,6 @@ case $build_os in
;; ;;
esac esac
dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
case $host_os in
mingw32*)
AC_SUBST(CRTLIBS,"-lmsvcrt")
AC_SUBST(SOCKETLIBS,"-L\$(top_builddir)/dlls/ws2_32 -lws2_32")
;;
esac
AC_SUBST(MAIN_BINARY,"wine") AC_SUBST(MAIN_BINARY,"wine")
test "x$enable_win64" != "xyes" || MAIN_BINARY="wine64" test "x$enable_win64" != "xyes" || MAIN_BINARY="wine64"

View File

@ -1,13 +1,9 @@
DLLFLAGS = @DLLFLAGS@ DLLFLAGS = @DLLFLAGS@
MODULE = libwine.$(LIBEXT) EXTRALIBS = $(LIBPORT) @LIBDL@ @COREFOUNDATIONLIB@ @CORESERVICESLIB@
VERSCRIPT = $(srcdir)/wine.map
EXTRALIBS = $(LIBPORT) @LIBDL@ @CRTLIBS@ @COREFOUNDATIONLIB@ @CORESERVICESLIB@
DEFS = -D__WINESRC__ -DWINE_UNICODE_API="" DEFS = -D__WINESRC__ -DWINE_UNICODE_API=""
VERSION = 1.0 VERSION = 1.0
SOVERSION = 1 SOVERSION = 1
SONAME = libwine.so.$(SOVERSION)
DYNAME = libwine.$(SOVERSION).dylib
INSTALLDIRS = $(DESTDIR)$(libdir) INSTALLDIRS = $(DESTDIR)$(libdir)
@ -94,8 +90,6 @@ C_SRCS = \
EXTRA_OBJS = version.o EXTRA_OBJS = version.o
all: $(MODULE) $(MODULE:.dll=.a)
@MAKE_RULES@ @MAKE_RULES@
# Special defines needed for config.c # Special defines needed for config.c
@ -111,70 +105,10 @@ CONFIGDIRS = \
config.o: config.c $(RELPATH) config.o: config.c $(RELPATH)
$(CC) -c $(ALLCFLAGS) -o $@ $(srcdir)/config.c $(CONFIGDIRS) $(CC) -c $(ALLCFLAGS) -o $@ $(srcdir)/config.c $(CONFIGDIRS)
# Linking rules
libwine.so.$(VERSION): $(OBJS) $(VERSCRIPT) Makefile.in
$(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
libwine.so.$(SOVERSION): libwine.so.$(VERSION)
$(RM) $@ && $(LN_S) libwine.so.$(VERSION) $@
libwine.so: libwine.so.$(SOVERSION)
$(RM) $@ && $(LN_S) libwine.so.$(SOVERSION) $@
libwine.a: wine.def
$(DLLTOOL) -l $@ -d $(srcdir)/wine.def
libwine.dll: $(OBJS) wine.def Makefile.in
$(DLLWRAP) --def $(srcdir)/wine.def -o $@ $(OBJS) $(EXTRALIBS)
DYLIB_LDFLAGS = -compatibility_version $(SOVERSION) -current_version $(VERSION)
libwine.$(VERSION).dylib: $(OBJS) $(RELPATH) Makefile.in
$(LDSHARED) -install_name @rpath/$(DYNAME) -Wl,-rpath,@loader_path/ $(DYLIB_LDFLAGS) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
libwine.$(SOVERSION).dylib: libwine.$(VERSION).dylib
$(RM) $@ && $(LN_S) libwine.$(VERSION).dylib $@
libwine.dylib: libwine.$(SOVERSION).dylib
$(RM) $@ && $(LN_S) libwine.$(SOVERSION).dylib $@
# Install rules
.PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib
install-lib-so: libwine.so.$(VERSION) $(DESTDIR)$(libdir) dummy
$(INSTALL_PROGRAM) libwine.so.$(VERSION) $(DESTDIR)$(libdir)/libwine.so.$(VERSION)
cd $(DESTDIR)$(libdir) && $(RM) libwine.so.$(SOVERSION) && $(LN_S) libwine.so.$(VERSION) libwine.so.$(SOVERSION)
install-lib-dll: libwine.dll $(DESTDIR)$(libdir) dummy
$(INSTALL_DATA) libwine.dll $(DESTDIR)$(libdir)/libwine.dll
install-lib-dylib: libwine.$(VERSION).dylib $(DESTDIR)$(libdir) dummy
$(INSTALL_PROGRAM) libwine.$(VERSION).dylib $(DESTDIR)$(libdir)/libwine.$(VERSION).dylib
cd $(DESTDIR)$(libdir) && $(RM) libwine.$(SOVERSION).dylib && $(LN_S) libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
install-dev-so: $(DESTDIR)$(libdir) dummy
cd $(DESTDIR)$(libdir) && $(RM) libwine.so && $(LN_S) libwine.so.$(VERSION) libwine.so
install-dev-dll: libwine.a $(DESTDIR)$(libdir) dummy
$(INSTALL_DATA) libwine.a $(DESTDIR)$(libdir)/libwine.a
install-dev-dylib: $(DESTDIR)$(libdir) dummy
cd $(DESTDIR)$(libdir) && $(RM) libwine.dylib && $(LN_S) libwine.$(VERSION).dylib libwine.dylib
install install-lib:: $(LIBEXT:%=install-lib-%)
install install-dev:: $(LIBEXT:%=install-dev-%)
uninstall::
-cd $(DESTDIR)$(libdir) && $(RM) libwine.a libwine.dll libwine.so libwine.so.$(VERSION) \
libwine.so.$(SOVERSION) libwine.dylib libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
version.c: dummy 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)
clean::
$(RM) libwine.so.$(SOVERSION) libwine.so.$(VERSION) version.c
$(RELPATH): $(RELPATH):
@cd $(TOOLSDIR)/tools && $(MAKE) relpath$(TOOLSEXT) @cd $(TOOLSDIR)/tools && $(MAKE) relpath$(TOOLSEXT)
@LIBWINE_RULES@