]> granicus.if.org Git - imagemagick/commitdiff
Find ImageMagick modules by native shared library suffix (#895)
authorDavid Seifert <soap@gentoo.org>
Sat, 16 Dec 2017 18:01:03 +0000 (19:01 +0100)
committerImageMagick <urban-warrior@users.noreply.github.com>
Sat, 16 Dec 2017 18:01:03 +0000 (13:01 -0500)
* This allows us to delete `.la` files, which are technical
  debt of days when shared libraries weren't ubiquitous.

MagickCore/module.c
configure.ac

index a6202a9a413b75fe5d482d32fff38a3e1607b54e..24af3da26728d23e44837c754189903f4a342b96 100644 (file)
@@ -77,7 +77,7 @@ typedef void *ModuleHandle;
   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 @@ static void TagToCoderModuleName(const char *tag,char *name)
   (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 @@ static void TagToFilterModuleName(const char *tag,char *name)
 #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
 }
 \f
index 6953688a0f3868ebdc23c7d9744054eb7d741adf..f297ef5497607614ccd13948d45d7dfbe58dd4d8 100644 (file)
@@ -1704,6 +1704,7 @@ if test "$build_modules" != 'no' || test "X$ax_cv_check_cl_libcl" != Xno; then
       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