libxcrypt icon indicating copy to clipboard operation
libxcrypt copied to clipboard

Add support for building static lib with MSVC

Open cmb69 opened this issue 1 year ago • 0 comments

This PR solves a couple of mostly minor issues (see individual commit messages for details) which prevent building the static crypt.lib with MSVC on Windows. For building a shared library (DLL) exported functions would need to be decorated with __declspec(dllexport) and __declspec(dllimport), respectively (see 'win32-dll' argument of LT_INIT()).

The biggest hurdle is that autoconf currently (2.72) does not properly recognize C11 support (only has recently been fixed in the development branch). I worked around that with the following hack:

 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 4b8afd8..1523e92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ m4_pattern_allow([PKG_INSTALLDIR])
 # Checks for programs.
 AC_CANONICAL_HOST
 AC_PROG_CC
+ac_prog_cc_stdc=c11
 
 # Dependencies
 PKG_PROG_PKG_CONFIG

Closes #193.

cmb69 avatar Dec 10 '24 19:12 cmb69