* configure.ac: Setup installation of dll files in $bindir.
(IF_DLL, LIBNETTLE_FILE_SRC, LIBHOGWEED_FILE_SRC): New
substitutions.
* config.make.in (LIBNETTLE_FILE_SRC): Substitute new autoconf
variable.
(LIBHOGWEED_FILE_SRC): Likewise.
* Makefile.in (install-dll-nettle, uninstall-dll-nettle): New
target for installing the dll file in $bindir.
(install-shared-nettle): Conditionally
depend on install-dll-nettle. Use LIBNETTLE_FILE_SRC.
(uninstall-shared-nettle): Conditionally depend on
install-dll-nettle.
(various hogweed targets): Analogous changes.
Rev: nettle/ChangeLog:1.230
Rev: nettle/Makefile.in:1.41
Rev: nettle/config.make.in:1.4
Rev: nettle/configure.ac:1.47
2011-11-19 Niels Möller <nisse@lysator.liu.se>
- From Martin Storsjö:
+ Cygwin/mingw32 improvements contributed by Martin Storsjö:
+ * configure.ac: Setup installation of dll files in $bindir.
+ (IF_DLL, LIBNETTLE_FILE_SRC, LIBHOGWEED_FILE_SRC): New
+ substitutions.
+
+ * config.make.in (LIBNETTLE_FILE_SRC): Substitute new autoconf
+ variable.
+ (LIBHOGWEED_FILE_SRC): Likewise.
+
+ * Makefile.in (install-dll-nettle, uninstall-dll-nettle): New
+ target for installing the dll file in $bindir.
+ (install-shared-nettle): Conditionally
+ depend on install-dll-nettle. Use LIBNETTLE_FILE_SRC.
+ (uninstall-shared-nettle): Conditionally depend on
+ install-dll-nettle.
+ (various hogweed targets): Analogous changes.
+
* configure.ac: Unify shared lib setup for cygwin and mingw.
2011-10-31 Niels Möller <nisse@lysator.liu.se>
$(INSTALL_DATA) $$f $(DESTDIR)$(libdir) ; \
done
-install-shared-nettle: $(LIBNETTLE_FORLINK)
+install-dll-nettle:
+ $(MKDIR_P) $(DESTDIR)$(bindir)
+ $(INSTALL_DATA) $(LIBNETTLE_FORLINK) $(DESTDIR)$(bindir)/$(LIBNETTLE_FORLINK)
+
+install-shared-nettle: $(LIBNETTLE_FORLINK) @IF_DLL@ install-dll-nettle
$(MKDIR_P) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIBNETTLE_FORLINK) $(DESTDIR)$(libdir)/$(LIBNETTLE_FILE)
+ $(INSTALL_DATA) $(LIBNETTLE_FILE_SRC) $(DESTDIR)$(libdir)/$(LIBNETTLE_FILE)
[ -z "$(LIBNETTLE_SONAME)" ] \
|| (cd $(DESTDIR)$(libdir) \
&& ln -sf $(LIBNETTLE_FILE) $(LIBNETTLE_SONAME) \
&& ln -sf $(LIBNETTLE_FILE) $(LIBNETTLE_FORLINK))
-install-shared-hogweed: $(LIBHOGWEED_FORLINK)
+install-dll-hogweed:
+ $(MKDIR_P) $(DESTDIR)$(bindir)
+ $(INSTALL_DATA) $(LIBHOGWEED_FORLINK) $(DESTDIR)$(bindir)/$(LIBHOGWEED_FORLINK)
+
+install-shared-hogweed: $(LIBHOGWEED_FORLINK) @IF_DLL@ install-dll-hogweed
$(MKDIR_P) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIBHOGWEED_FORLINK) $(DESTDIR)$(libdir)/$(LIBHOGWEED_FILE)
+ $(INSTALL_DATA) $(LIBHOGWEED_FILE_SRC) $(DESTDIR)$(libdir)/$(LIBHOGWEED_FILE)
[ -z "$(LIBHOGWEED_SONAME)" ] \
|| (cd $(DESTDIR)$(libdir) \
&& ln -sf $(LIBHOGWEED_FILE) $(LIBHOGWEED_SONAME) \
# FIXME: Leaves the links around
uninstall-shared: uninstall-shared-nettle @IF_HOGWEED@ uninstall-shared-hogweed
-uninstall-shared-nettle:
+uninstall-dll-nettle:
+ rm -f $(DESTDIR)$(bindir)/$(LIBNETTLE_FORLINK)
+
+uninstall-shared-nettle: @IF_DLL@ uninstall-dll-nettle
rm -f $(DESTDIR)$(libdir)/$(LIBNETTLE_FILE)
[ -z "$(LIBNETTLE_SONAME)" ] \
|| rm -f $(LIBNETTLE_SONAME) $(LIBNETTLE_FORLINK)
-uninstall-shared-hogweed:
+uninstall-dll-hogweed:
+ rm -f $(DESTDIR)$(bindir)/$(LIBHOGWEED_FORLINK)
+
+uninstall-shared-hogweed: @IF_DLL@ uninstall-dll-hogweed
rm -f $(DESTDIR)$(libdir)/$(LIBHOGWEED_FILE)
[ -z "$(LIBHOGWEED_SONAME)" ] \
|| rm -f $(LIBHOGWEED_SONAME) $(LIBHOGWEED_FORLINK)
LIBNETTLE_MINOR = @LIBNETTLE_MINOR@
LIBNETTLE_SONAME = @LIBNETTLE_SONAME@
LIBNETTLE_FILE = @LIBNETTLE_FILE@
+LIBNETTLE_FILE_SRC = @LIBNETTLE_FILE_SRC@
LIBNETTLE_FORLINK = @LIBNETTLE_FORLINK@
LIBNETTLE_LIBS = @LIBNETTLE_LIBS@
LIBNETTLE_LINK = @LIBNETTLE_LINK@
LIBHOGWEED_MINOR = @LIBHOGWEED_MINOR@
LIBHOGWEED_SONAME = @LIBHOGWEED_SONAME@
LIBHOGWEED_FILE = @LIBHOGWEED_FILE@
+LIBHOGWEED_FILE_SRC = @LIBHOGWEED_FILE_SRC@
LIBHOGWEED_FORLINK = @LIBHOGWEED_FORLINK@
LIBHOGWEED_LIBS = @LIBHOGWEED_LIBS@
LIBHOGWEED_LINK = @LIBHOGWEED_LINK@
SHLIBCFLAGS="$CCPIC"
+IF_DLL='#'
+LIBNETTLE_FILE_SRC='$(LIBNETTLE_FORLINK)'
+LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FORLINK)'
+
case "$host_os" in
mingw32*|cygwin*)
+ # The actual DLLs, e.g. libnettle-$major-$minor.dll, are normally
+ # installed into the bin dir (or more exactly $libdir/../bin, for
+ # automake), while libnettle.dll.a, which is a stub file for
+ # linking to the DLL, is installed into the lib dir.
case "$host_os" in
mingw32*)
LIBNETTLE_FORLINK='libnettle-$(LIBNETTLE_MAJOR)-$(LIBNETTLE_MINOR).dll'
esac
LIBNETTLE_SONAME=''
LIBNETTLE_FILE='libnettle.dll.a'
+ LIBNETTLE_FILE_SRC='$(LIBNETTLE_FILE)'
LIBNETTLE_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
LIBNETTLE_LIBS='-Wl,--no-whole-archive $(LIBS)'
LIBHOGWEED_SONAME=''
LIBHOGWEED_FILE='libhogweed.dll.a'
+ LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FILE)'
LIBHOGWEED_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
LIBHOGWEED_LIBS='-Wl,--no-whole-archive $(LIBS) libnettle.dll.a'
+ IF_DLL=''
;;
darwin*)
LIBNETTLE_FORLINK=libnettle.dylib
AC_SUBST(LIBNETTLE_FORLINK)
AC_SUBST(LIBNETTLE_SONAME)
AC_SUBST(LIBNETTLE_FILE)
+AC_SUBST(LIBNETTLE_FILE_SRC)
AC_SUBST(LIBNETTLE_LINK)
AC_SUBST(LIBNETTLE_LIBS)
AC_SUBST(LIBHOGWEED_FORLINK)
AC_SUBST(LIBHOGWEED_SONAME)
AC_SUBST(LIBHOGWEED_FILE)
+AC_SUBST(LIBHOGWEED_FILE_SRC)
AC_SUBST(LIBHOGWEED_LINK)
AC_SUBST(LIBHOGWEED_LIBS)
AC_SUBST(IF_HOGWEED)
AC_SUBST(IF_SHARED)
+AC_SUBST(IF_DLL)
OPENSSL_LIBFLAGS=''