Add runtime libaries neccessary with mingw-w64
authorAndre Heinecke <aheinecke@intevation.de>
Tue, 7 May 2013 10:49:32 +0000 (10:49 +0000)
committerAndre Heinecke <aheinecke@intevation.de>
Tue, 7 May 2013 10:49:32 +0000 (10:49 +0000)
    GpgOL and GpgEx need the mingw runtime in the system path
    so they are added to pub now.

    * configure.ac: Add options for libgcc-sjlj-1 and libstdc++-6
    * src/inst-gpg4win.nsi, src/uninst-gpg4win.nsi: Handle
    the runtime libraries.

configure.ac
src/inst-gpg4win.nsi
src/uninst-gpg4win.nsi

index b9c8c19..d7b0439 100644 (file)
@@ -227,6 +227,49 @@ AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog,
                [build-aux/gitlog-to-changelog])
 AC_PROG_INSTALL
 
+# GpgOL and GpgEx need the runtime libaries
+# The default path should probably be more generic
+libgcc_dll=no
+AC_ARG_WITH([libgcc_s_sjlj-dll],
+           AC_HELP_STRING([--with-libgcc_s_sjlj-1-dll=FILE],
+                          [use the libgcc_s_sjlj-1 DLL]),
+           [libgcc_dll=$withval])
+if test "$libgcc_dll" = "no"; then
+  file="/usr/lib/gcc/$host/4.6/libgcc_s_sjlj-1.dll"
+  if test -r "$file"; then
+    libgcc_dll="$file"
+  fi
+fi
+if test "$libgcc_dll" = "no"; then
+  missing_tools="libgcc_s_sjlj-1.dll $missing_tools"
+fi
+
+if test -r "$libgcc_dll"; then
+  cp $libstdcpp_dll src/libstdc++-6.dll
+else
+  missing_tools="libgcc_s_sjlj-1.dll $missing_tools"
+fi
+
+libstdcpp_dll=no
+AC_ARG_WITH([libstdcpp_s_sjlj-dll],
+           AC_HELP_STRING([--with-libstdc++-6-dll=FILE],
+                          [use the libstdc++-6 DLL]),
+           [libstdcpp_dll=$withval])
+if test "$libstdcpp_dll" = "no"; then
+  file="/usr/lib/gcc/$host/4.6/libstdc++-6.dll"
+  if test -r "$file"; then
+    libstdcpp_dll="$file"
+  fi
+fi
+if test "$libstdcpp_dll" = "no"; then
+  missing_tools="libstdc++-6.dll $missing_tools"
+fi
+if test -r "$libstdcpp_dll"; then
+  cp $libgcc_dll src/libgcc_s_sjlj-1.dll
+else
+  missing_tools="libstdc++-6.dll $missing_tools"
+fi
+
 missing_tools=
 for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM STOW MAKENSIS ZCAT TEXI2DVI \
          DVIPDF CONVERT SHA1SUM MSGFMT ; do
index cf92f6a..f761735 100644 (file)
@@ -79,6 +79,11 @@ Section "-gpg4win" SEC_gpg4win
   File "${BUILD_DIR}/sha256sum.exe"
   File "${BUILD_DIR}/md5sum.exe"
 
+  SetOutPath "$INSTDIR\pub"
+  # Install the mingw runtime libaries
+  File "${BUILD_DIR}/libstdc++-6.dll"
+  File "${BUILD_DIR}/libgcc_s_sjlj-1.dll"
+
 !endif
 
 SectionEnd
index b662db1..9982956 100644 (file)
@@ -35,6 +35,10 @@ Section "-un.gpg4win"
   Delete "$INSTDIR\sha256sum.exe"
   Delete "$INSTDIR\md5sum.exe"
 
+  # Delete the runtime libarries
+  Delete "$INSTDIR\pub\libstdc++-6.dll"
+  Delete "$INSTDIR\pub\libgcc_s_sjlj-1.dll"
+
   # Delete standard stuff.
   Delete "$INSTDIR\share\gpg4win\README.*.txt"