Mercurial > mxe-octave
view src/graphicsmagick-2-dynamicpath.patch @ 6234:97c5f8da5036 release
* src/librsb.mk: update to 1.2.0.11
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 27 May 2022 12:24:32 +0200 |
parents | 7ac858194666 |
children |
line wrap: on
line source
diff -ur GraphicsMagick-1.3.37.orig/magick/blob.c GraphicsMagick-1.3.37/magick/blob.c --- GraphicsMagick-1.3.37.orig/magick/blob.c 2021-12-14 12:59:54.946462559 -0500 +++ GraphicsMagick-1.3.37/magick/blob.c 2021-12-14 13:05:57.022604525 -0500 @@ -1975,6 +1975,29 @@ AddConfigurePath(path_map,&path_index,MagickLibConfigPath,exception); # endif /* defined(MagickLibConfigPath) */ +#if defined(MSWINDOWS) + { + char buf[FILENAME_MAX+100]; + if (GetModuleFileName(NULL, buf, FILENAME_MAX + 1)) + { + char *ptr = strrchr(buf, '\\'); + if(ptr) { + *(ptr+1) = 0; + strcat(buf, "..\\lib\\"); + strcat(buf, MagickShareConfigSubDir); + strcat(buf, "\\"); + AddConfigurePath(path_map,&path_index,buf,exception); + + *(ptr+1) = 0; + strcat(buf, "..\\share\\"); + strcat(buf, MagickLibConfigSubDir); + strcat(buf, "\\"); + AddConfigurePath(path_map,&path_index,buf,exception); + } + } + } +#endif + # if defined(MSWINDOWS) && !(defined(MagickLibConfigPath) || defined(MagickShareConfigPath)) { char diff -ur GraphicsMagick-1.3.37.orig/magick/module.c GraphicsMagick-1.3.37/magick/module.c --- GraphicsMagick-1.3.37.orig/magick/module.c 2021-12-14 12:59:54.935462099 -0500 +++ GraphicsMagick-1.3.37/magick/module.c 2021-12-14 13:08:20.667611735 -0500 @@ -1036,6 +1036,33 @@ } } +#if defined(MSWINDOWS) + { + char buf[FILENAME_MAX+100]; + if (GetModuleFileName(NULL, buf, FILENAME_MAX + 1)) + { + char *ptr = strrchr(buf, '\\'); + if(ptr) + { + *(ptr+1) = 0; + strcat(buf, "..\\lib\\"); + switch (module_type) + { + case MagickCoderModule: + default: + strcat(buf, MagickCoderModulesSubdir); + break; + case MagickFilterModule: + strcat(buf, MagickFilterModulesSubdir); + break; + } + strcat(buf, "\\"); + AddModulePath(path_map,&path_index,buf,exception); + } + } + } +#endif + #if defined(UseInstalledMagick) # if defined(MagickCoderModulesPath) {