On Saturday 03 December 2011 22:40:51 Cactus wrote:
> I can only comment on the MSVC Windows build, for which I believe mpir.h is 
> identical DLL and static library builds.   To double check this I have just 
> built both and compared the two mpir.h files that were generated.
> 
> In fact mpir.h is now identical for win32 and x64 builds as well since I 
> changed this recently to avoid any differences because an increasing number 
> of people were trying to compile MPIR with the wrong version.
> 
>    Brian
> 
> 

Aha , only for cygwin and MSYS then which use the autotools , as in 
configure.in we have this

# Configs for Windows DLLs.

AC_LIBTOOL_WIN32_DLL

AC_SUBST(LIBGMP_DLL,0)
case $host in
  *-*-cygwin* | *-*-mingw*)
    # By default, build only static.
    if test -z "$enable_shared"; then
      enable_shared=no
    fi
    # Don't allow both static and DLL.
    if test "$enable_shared" != no && test "$enable_static" != no; then
      AC_MSG_ERROR([cannot build both static and DLL, since mpir.h is different 
for each.
Use "--disable-static --enable-shared" to build just a DLL.])
    fi

    # "-no-undefined" is required when building a DLL, see documentation on
    # AC_LIBTOOL_WIN32_DLL.
    #
    # "-Wl,--export-all-symbols" is a bit of a hack, it gets all libmpir and
    # libmpirxx functions and variables exported.  This is what libtool did 
    # in the past, and it's convenient for us in the test programs.
    #
    # Maybe it'd be prudent to check for --export-all-symbols before using
    # it, but it seems to have been in ld since at least 2000, and there's
    # not really any alternative we want to take up at the moment.
    #
    # "-Wl,output-def" is used to get a .def file for use by MS lib to make
    # a .lib import library, described in the manual.  libmpir-3.dll.def   
    # corresponds to the libmp-3.dll.def generated by libtool (as a result 
    # of -export-symbols on that library).
    #
    # Incidentally, libtool does generate an import library libmpir.dll.a,
    # but it's "ar" format and cannot be used by the MS linker.  There
    # doesn't seem to be any GNU tool for generating or converting to .lib.
    #
    # FIXME: The .def files produced by -Wl,output-def include isascii,
    # iscsym, iscsymf and toascii, apparently because mingw ctype.h doesn't
    # inline isascii (used in gmp).  It gives an extern inline for
    # __isascii, but for some reason not the plain isascii.
    #
    # LDFLAGS="$LDFLAGS -Wl,--enable-auto-import"  this is too general
    if test "$enable_shared" = yes; then
      GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
      LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libmpir-3.dll.def"
      LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS 
-Wl,--output-def,.libs/libmpirxx-3.dll.def"
      LIBGMP_DLL=1
    fi
    ;;
esac  


and note there are a few other systems which also can't build both types at the 
same time


Jason

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to