Use dllwrap for building shared libraries in cygwin.
This commit is contained in:
parent
63411dbde5
commit
d48ca948cb
|
@ -36,6 +36,8 @@ LEX = @LEX@
|
||||||
LEXLIB = @LEXLIB@
|
LEXLIB = @LEXLIB@
|
||||||
LIBEXT = @LIBEXT@
|
LIBEXT = @LIBEXT@
|
||||||
LDSHARED = @LDSHARED@
|
LDSHARED = @LDSHARED@
|
||||||
|
DLLWRAP = @DLLWRAP@
|
||||||
|
DLLWRAPFLAGS = --add-stdcall-alias
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
LN_S = @LN_S@
|
LN_S = @LN_S@
|
||||||
DIVINCL = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
|
DIVINCL = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
|
||||||
|
@ -60,7 +62,7 @@ WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
|
||||||
MAKEDEP = $(TOPOBJDIR)/tools/makedep
|
MAKEDEP = $(TOPOBJDIR)/tools/makedep
|
||||||
WRC = $(TOPOBJDIR)/tools/wrc/wrc
|
WRC = $(TOPOBJDIR)/tools/wrc/wrc
|
||||||
WMC = $(TOPOBJDIR)/tools/wmc/wmc
|
WMC = $(TOPOBJDIR)/tools/wmc/wmc
|
||||||
LDPATH = LD_LIBRARY_PATH="$(TOPOBJDIR)/unicode:$$LD_LIBRARY_PATH"
|
LDPATH = @LDPATH@
|
||||||
DLLDIR = $(TOPOBJDIR)/dlls
|
DLLDIR = $(TOPOBJDIR)/dlls
|
||||||
LIBWINE = -L$(TOPOBJDIR)/library -lwine
|
LIBWINE = -L$(TOPOBJDIR)/library -lwine
|
||||||
LIBTSX11 = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
|
LIBTSX11 = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
|
||||||
|
|
21
configure.in
21
configure.in
|
@ -69,6 +69,7 @@ AC_PROG_LN_S
|
||||||
AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
|
AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
|
||||||
AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
|
AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
|
||||||
AC_CYGWIN
|
AC_CYGWIN
|
||||||
|
AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
|
||||||
|
|
||||||
dnl Check for lint
|
dnl Check for lint
|
||||||
AC_CHECK_PROGS(LINT, lclint lint)
|
AC_CHECK_PROGS(LINT, lclint lint)
|
||||||
|
@ -576,19 +577,36 @@ then
|
||||||
fi
|
fi
|
||||||
if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
|
if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
|
||||||
then
|
then
|
||||||
|
LIBEXT="a"
|
||||||
|
if test "$DLLWRAP" = "dllwrap"; then
|
||||||
|
dnl FIXME - check whether dllwrap works correctly...
|
||||||
|
if test "$CYGWIN" = "yes"; then
|
||||||
|
echo "*** use dllwrap for building shared library."
|
||||||
|
LIBEXT="dll"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$LIBEXT" = "a"; then
|
||||||
echo "*** It is currently not possible to build WINE without shared"
|
echo "*** It is currently not possible to build WINE without shared"
|
||||||
echo "*** library (.so) support to allow transparent switch between .so"
|
echo "*** library (.so) support to allow transparent switch between .so"
|
||||||
echo "*** and .dll files."
|
echo "*** and .dll files."
|
||||||
echo "*** If you are using Linux, you will need a newer binutils."
|
echo "*** If you are using Linux, you will need a newer binutils."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DLLFLAGS=""
|
DLLFLAGS=""
|
||||||
|
LDPATH=""
|
||||||
|
|
||||||
if test "$LIBEXT" = "so"; then
|
if test "$LIBEXT" = "so"; then
|
||||||
DLLFLAGS="-fPIC"
|
DLLFLAGS="-fPIC"
|
||||||
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
|
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
|
||||||
|
LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
|
||||||
|
elif test "$LIBEXT" = "dll"; then
|
||||||
|
#DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
|
||||||
|
DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
|
||||||
|
LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
|
||||||
else
|
else
|
||||||
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
|
DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
|
||||||
AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
|
AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
|
||||||
|
@ -621,6 +639,7 @@ AC_SUBST(DLLFLAGS)
|
||||||
AC_SUBST(LDSHARED)
|
AC_SUBST(LDSHARED)
|
||||||
AC_SUBST(LDDLLFLAGS)
|
AC_SUBST(LDDLLFLAGS)
|
||||||
AC_SUBST(LIBEXT)
|
AC_SUBST(LIBEXT)
|
||||||
|
AC_SUBST(LDPATH)
|
||||||
|
|
||||||
dnl **** Check for reentrant libc ****
|
dnl **** Check for reentrant libc ****
|
||||||
dnl
|
dnl
|
||||||
|
|
|
@ -37,6 +37,10 @@ lib$(MODULE).a: $(ALL_OBJS) Makefile.in
|
||||||
$(AR) $@ $(ALL_OBJS)
|
$(AR) $@ $(ALL_OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
# Rules for .dll files
|
||||||
|
lib$(MODULE).dll: $(ALL_OBJS) Makefile.in
|
||||||
|
$(DLLWRAP) $(DLLWRAPFLAGS) --implib lib$(MODULE).a -o lib$(MODULE).dll $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
||||||
|
|
||||||
# Rules for checking that no imports are missing
|
# Rules for checking that no imports are missing
|
||||||
|
|
||||||
checklink:: lib$(MODULE).$(LIBEXT)
|
checklink:: lib$(MODULE).$(LIBEXT)
|
||||||
|
|
|
@ -29,6 +29,9 @@ libwine.a: $(OBJS)
|
||||||
$(AR) $@ $(OBJS)
|
$(AR) $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libwine.dll: $(OBJS)
|
||||||
|
$(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine.a -o libwine.dll $(OBJS)
|
||||||
|
|
||||||
install_so: libwine.so.$(SOVERSION)
|
install_so: libwine.so.$(SOVERSION)
|
||||||
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
||||||
$(INSTALL_PROGRAM) libwine.so.$(SOVERSION) $(libdir)/libwine.so.$(SOVERSION)
|
$(INSTALL_PROGRAM) libwine.so.$(SOVERSION) $(libdir)/libwine.so.$(SOVERSION)
|
||||||
|
|
|
@ -37,6 +37,9 @@ libwine_tsx11.a: $(OBJS)
|
||||||
$(AR) $@ $(OBJS)
|
$(AR) $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libwine_tsx11.dll: $(OBJS)
|
||||||
|
$(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine_tsx11.a -o libwine_tsx11.dll $(OBJS)
|
||||||
|
|
||||||
install_so: libwine_tsx11.so.$(SOVERSION)
|
install_so: libwine_tsx11.so.$(SOVERSION)
|
||||||
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
||||||
$(INSTALL_PROGRAM) libwine_tsx11.so.$(SOVERSION) $(libdir)/libwine_tsx11.so.$(SOVERSION)
|
$(INSTALL_PROGRAM) libwine_tsx11.so.$(SOVERSION) $(libdir)/libwine_tsx11.so.$(SOVERSION)
|
||||||
|
|
|
@ -93,6 +93,10 @@ libwine_unicode.a: $(OBJS)
|
||||||
$(AR) $@ $(OBJS)
|
$(AR) $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
# --export-all don't work correctly because of dllwrap's bug
|
||||||
|
libwine_unicode.dll: $(OBJS) wine_unicode.def
|
||||||
|
$(DLLWRAP) $(DLLWRAPFLAGS) --def wine_unicode.def --implib libwine_unicode.a -o libwine_unicode.dll $(OBJS)
|
||||||
|
|
||||||
install_so: libwine_unicode.so.$(SOVERSION)
|
install_so: libwine_unicode.so.$(SOVERSION)
|
||||||
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
||||||
$(INSTALL_PROGRAM) libwine_unicode.so.$(SOVERSION) $(libdir)/libwine_unicode.so.$(SOVERSION)
|
$(INSTALL_PROGRAM) libwine_unicode.so.$(SOVERSION) $(libdir)/libwine_unicode.so.$(SOVERSION)
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
EXPORTS
|
||||||
|
cp_mbstowcs
|
||||||
|
cp_wcstombs
|
||||||
|
utf8_wcstombs
|
||||||
|
utf8_mbstowcs
|
||||||
|
cp_get_table
|
||||||
|
cp_enum_table
|
||||||
|
strcmpiW
|
||||||
|
strncmpiW
|
||||||
|
strstrW
|
Loading…
Reference in New Issue