printer: Enable 10.x and unversioned ghostscript libraries to be used on Linux, fixes #2996
This commit is contained in:
@@ -52,6 +52,8 @@
|
|||||||
# define PATH_GHOSTSCRIPT_DLL "libgs.dylib"
|
# define PATH_GHOSTSCRIPT_DLL "libgs.dylib"
|
||||||
#else
|
#else
|
||||||
# define PATH_GHOSTSCRIPT_DLL "libgs.so.9"
|
# define PATH_GHOSTSCRIPT_DLL "libgs.so.9"
|
||||||
|
# define PATH_GHOSTSCRIPT_DLL_ALT1 "libgs.so.10"
|
||||||
|
# define PATH_GHOSTSCRIPT_DLL_ALT2 "libgs.so"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define POSTSCRIPT_BUFFER_LENGTH 65536
|
#define POSTSCRIPT_BUFFER_LENGTH 65536
|
||||||
@@ -341,12 +343,21 @@ ps_init(void *lpt)
|
|||||||
|
|
||||||
/* Try loading the DLL. */
|
/* Try loading the DLL. */
|
||||||
ghostscript_handle = dynld_module(PATH_GHOSTSCRIPT_DLL, ghostscript_imports);
|
ghostscript_handle = dynld_module(PATH_GHOSTSCRIPT_DLL, ghostscript_imports);
|
||||||
|
#ifdef PATH_GHOSTSCRIPT_DLL_ALT1
|
||||||
|
if (ghostscript_handle == NULL) {
|
||||||
|
ghostscript_handle = dynld_module(PATH_GHOSTSCRIPT_DLL_ALT1, ghostscript_imports);
|
||||||
|
# ifdef PATH_GHOSTSCRIPT_DLL_ALT2
|
||||||
if (ghostscript_handle == NULL)
|
if (ghostscript_handle == NULL)
|
||||||
|
ghostscript_handle = dynld_module(PATH_GHOSTSCRIPT_DLL_ALT2, ghostscript_imports);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (ghostscript_handle == NULL) {
|
||||||
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2115, (wchar_t *) IDS_2133);
|
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2115, (wchar_t *) IDS_2133);
|
||||||
else {
|
} else {
|
||||||
if (gsapi_revision(&rev, sizeof(rev)) == 0)
|
if (gsapi_revision(&rev, sizeof(rev)) == 0) {
|
||||||
pclog("Loaded %s, rev %ld (%ld)\n", rev.product, rev.revision, rev.revisiondate);
|
pclog("Loaded %s, rev %ld (%ld)\n", rev.product, rev.revision, rev.revisiondate);
|
||||||
else {
|
} else {
|
||||||
dynld_close(ghostscript_handle);
|
dynld_close(ghostscript_handle);
|
||||||
ghostscript_handle = NULL;
|
ghostscript_handle = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user