Commit 7bf07d15 authored by Alexandre Julliard's avatar Alexandre Julliard

Only link with msvcrt on mingw32. Cleaned up a few AC_SUBST.

parent d1c14414
...@@ -1241,7 +1241,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ...@@ -1241,7 +1241,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
LIBEXT=so # library type .so or .a LIBEXT="so"
# Check whether --enable-debug or --disable-debug was given. # Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then if test "${enable_debug+set}" = set; then
...@@ -10171,10 +10172,17 @@ _ACEOF ...@@ -10171,10 +10172,17 @@ _ACEOF
fi fi
LDSHARED="" DLLEXT=""
LDDLLFLAGS=""
DLLFLAGS=""
DLLIBS="" DLLIBS=""
LDDLLFLAGS=""
LDSHARED=""
case $host_os in case $host_os in
cygwin*|mingw32*) cygwin*|mingw32*)
if test -n "$ac_tool_prefix"; then if test -n "$ac_tool_prefix"; then
...@@ -10525,6 +10533,8 @@ done ...@@ -10525,6 +10533,8 @@ done
if test "$LIBEXT" = "so" if test "$LIBEXT" = "so"
then then
DLLFLAGS="-fPIC"
DLLEXT=".so"
echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5 echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5
echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6 echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6
if test "${ac_cv_c_dll_gnuelf+set}" = set; then if test "${ac_cv_c_dll_gnuelf+set}" = set; then
...@@ -10650,30 +10660,21 @@ If you are using Linux, you will need a newer binutils. ...@@ -10650,30 +10660,21 @@ If you are using Linux, you will need a newer binutils.
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLLEXT=".so"
elif test "$LIBEXT" = "dll"; then
#DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
DLLEXT=""
fi
case $build_os in case $build_os in
cygwin*|mingw32*) cygwin*|mingw32*)
LDPATH="PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$PATH\"" ;; LDPATH="PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$PATH\""
;;
*) *)
LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$LD_LIBRARY_PATH\"" ;; LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$LD_LIBRARY_PATH\""
;;
esac esac
CRTLIBS=""
case $host_os in
mingw32*)
CRTLIBS="-lmsvcrt" ;;
esac
if test "$LIBEXT" = "so" if test "$LIBEXT" = "so"
...@@ -14736,6 +14737,7 @@ s,@ECHO_C@,$ECHO_C,;t t ...@@ -14736,6 +14737,7 @@ s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t s,@ECHO_T@,$ECHO_T,;t t
s,@LIBS@,$LIBS,;t t s,@LIBS@,$LIBS,;t t
s,@LIBEXT@,$LIBEXT,;t t
s,@OPTIONS@,$OPTIONS,;t t s,@OPTIONS@,$OPTIONS,;t t
s,@build@,$build,;t t s,@build@,$build,;t t
s,@build_cpu@,$build_cpu,;t t s,@build_cpu@,$build_cpu,;t t
...@@ -14803,15 +14805,15 @@ s,@ARTSINCL@,$ARTSINCL,;t t ...@@ -14803,15 +14805,15 @@ s,@ARTSINCL@,$ARTSINCL,;t t
s,@ALSALIBS@,$ALSALIBS,;t t s,@ALSALIBS@,$ALSALIBS,;t t
s,@NASLIBS@,$NASLIBS,;t t s,@NASLIBS@,$NASLIBS,;t t
s,@AUDIOIOLIBS@,$AUDIOIOLIBS,;t t s,@AUDIOIOLIBS@,$AUDIOIOLIBS,;t t
s,@DLLWRAP@,$DLLWRAP,;t t
s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t
s,@DLLIBS@,$DLLIBS,;t t
s,@DLLFLAGS@,$DLLFLAGS,;t t
s,@DLLEXT@,$DLLEXT,;t t s,@DLLEXT@,$DLLEXT,;t t
s,@LDSHARED@,$LDSHARED,;t t s,@DLLFLAGS@,$DLLFLAGS,;t t
s,@DLLIBS@,$DLLIBS,;t t
s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t
s,@LIBEXT@,$LIBEXT,;t t s,@LDSHARED@,$LDSHARED,;t t
s,@DLLWRAP@,$DLLWRAP,;t t
s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t
s,@LDPATH@,$LDPATH,;t t s,@LDPATH@,$LDPATH,;t t
s,@CRTLIBS@,$CRTLIBS,;t t
s,@LDD@,$LDD,;t t s,@LDD@,$LDD,;t t
s,@ALLOCA@,$ALLOCA,;t t s,@ALLOCA@,$ALLOCA,;t t
/@MAKE_RULES@/r $MAKE_RULES /@MAKE_RULES@/r $MAKE_RULES
......
...@@ -12,8 +12,8 @@ AC_CONFIG_AUX_DIR(tools) ...@@ -12,8 +12,8 @@ AC_CONFIG_AUX_DIR(tools)
dnl **** Command-line arguments **** dnl **** Command-line arguments ****
dnl Default values dnl Library type .so or .a
LIBEXT=so # library type .so or .a AC_SUBST(LIBEXT,"so")
AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages])) AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages]))
AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages])) AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages]))
...@@ -723,9 +723,11 @@ fi ...@@ -723,9 +723,11 @@ fi
dnl **** Check for working dll **** dnl **** Check for working dll ****
LDSHARED="" AC_SUBST(DLLEXT,"")
LDDLLFLAGS="" AC_SUBST(DLLFLAGS,"")
DLLIBS="" AC_SUBST(DLLIBS,"")
AC_SUBST(LDDLLFLAGS,"")
AC_SUBST(LDSHARED,"")
case $host_os in case $host_os in
cygwin*|mingw32*) cygwin*|mingw32*)
...@@ -748,6 +750,8 @@ case $host_os in ...@@ -748,6 +750,8 @@ case $host_os in
if test "$LIBEXT" = "so" if test "$LIBEXT" = "so"
then then
DLLFLAGS="-fPIC"
DLLEXT=".so"
AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf, AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic], [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic],
ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")]) ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
...@@ -778,30 +782,19 @@ If you are using Linux, you will need a newer binutils.] ...@@ -778,30 +782,19 @@ If you are using Linux, you will need a newer binutils.]
) )
fi fi
DLLFLAGS=""
if test "$LIBEXT" = "so"; then
DLLFLAGS="-fPIC"
DLLEXT=".so"
elif test "$LIBEXT" = "dll"; then
#DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
DLLEXT=""
fi
case $build_os in case $build_os in
cygwin*|mingw32*) cygwin*|mingw32*)
LDPATH="PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$PATH\"" ;; AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$PATH\"") ;;
*) *)
LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$LD_LIBRARY_PATH\"" ;; AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$LD_LIBRARY_PATH\"") ;;
esac esac
AC_SUBST(DLLIBS) dnl Mingw needs explicit msvcrt for linking libwine
AC_SUBST(DLLFLAGS) AC_SUBST(CRTLIBS,"")
AC_SUBST(DLLEXT) case $host_os in
AC_SUBST(LDSHARED) mingw32*)
AC_SUBST(LDDLLFLAGS) CRTLIBS="-lmsvcrt" ;;
AC_SUBST(LIBEXT) esac
AC_SUBST(LDPATH)
dnl **** Get the soname for libraries that we load dynamically **** dnl **** Get the soname for libraries that we load dynamically ****
......
...@@ -7,7 +7,7 @@ LIBEXT = @LIBEXT@ ...@@ -7,7 +7,7 @@ LIBEXT = @LIBEXT@
MODULE = none MODULE = none
SOVERSION = 1.0 SOVERSION = 1.0
SONAME = libwine.so SONAME = libwine.so
EXTRALIBS = @DLLIBS@ EXTRALIBS = @DLLIBS@ @CRTLIBS@
C_SRCS = \ C_SRCS = \
config.c \ config.c \
...@@ -33,7 +33,7 @@ libwine.a: $(OBJS) ...@@ -33,7 +33,7 @@ libwine.a: $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libwine.dll: $(OBJS) libwine.dll: $(OBJS)
$(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine.a -o libwine.dll $(OBJS) -lmsvcrt $(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine.a -o libwine.dll $(OBJS) $(EXTRALIBS)
.PHONY: install_so install_a install_dll .PHONY: install_so install_a install_dll
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment