Mercurial > mxe-octave
view src/graphicsmagick-2-dynamicpath.patch @ 7186:19a46de50b18 default tip @
* src/jasper.mk: update to v4.2.4
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Thu, 02 May 2024 09:22:30 -0400 |
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) {