Find ImageMagick modules by native shared library suffix (#895)
* This allows us to delete `.la` files, which are technical
debt of days when shared libraries weren't ubiquitous.
diff --git a/MagickCore/module.c b/MagickCore/module.c
index a6202a9..24af3da 100644
--- a/MagickCore/module.c
+++ b/MagickCore/module.c
@@ -77,7 +77,7 @@
Define declarations.
*/
#if defined(MAGICKCORE_LTDL_DELEGATE)
-# define ModuleGlobExpression "*.la"
+# define ModuleGlobExpression "*" MAGICKCORE_LTDL_MODULE_EXT
#else
# if defined(_DEBUG)
# define ModuleGlobExpression "IM_MOD_DB_*.dll"
@@ -1455,7 +1455,7 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",tag);
assert(name != (char *) NULL);
#if defined(MAGICKCORE_LTDL_DELEGATE)
- (void) FormatLocaleString(name,MagickPathExtent,"%s.la",tag);
+ (void) FormatLocaleString(name,MagickPathExtent,"%s" MAGICKCORE_LTDL_MODULE_EXT,tag);
(void) LocaleLower(name);
#else
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
@@ -1508,7 +1508,7 @@
#elif !defined(MAGICKCORE_LTDL_DELEGATE)
(void) FormatLocaleString(name,MagickPathExtent,"%s.dll",tag);
#else
- (void) FormatLocaleString(name,MagickPathExtent,"%s.la",tag);
+ (void) FormatLocaleString(name,MagickPathExtent,"%s" MAGICKCORE_LTDL_MODULE_EXT,tag);
#endif
}
diff --git a/configure.ac b/configure.ac
index 6953688..f297ef5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1704,6 +1704,7 @@
LTDL_LIBS='-lltdl'
LIBS="$LTDL_LIBS $LIBS"
AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules and OpenCL])
+ AC_DEFINE_UNQUOTED([LTDL_MODULE_EXT],["${shrext_cmds}"],[Native module suffix])
AC_MSG_RESULT([yes])
have_ltdl='yes'
fi