mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-07 23:02:23 +00:00
loader: add Cygwin support
Cygwin libraries use the .dll extension and "cyg" prefix in place of "lib". Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
0ce48729d3
commit
96186bc721
2 changed files with 19 additions and 1 deletions
|
|
@ -212,9 +212,15 @@ static const char *stdSubdirs[] = {
|
|||
* to port this DDX to, say, Darwin, we'll need to fix this.
|
||||
*/
|
||||
static PatternRec stdPatterns[] = {
|
||||
#ifdef __CYGWIN__
|
||||
{"^cyg(.*)\\.dll$",},
|
||||
{"(.*)_drv\\.dll$",},
|
||||
{"(.*)\\.dll$",},
|
||||
#else
|
||||
{"^lib(.*)\\.so$",},
|
||||
{"(.*)_drv\\.so$",},
|
||||
{"(.*)\\.so$",},
|
||||
#endif
|
||||
{NULL,}
|
||||
};
|
||||
|
||||
|
|
@ -408,21 +414,33 @@ FindModuleInSubdir(const char *dirpath, const char *module)
|
|||
continue;
|
||||
}
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
snprintf(tmpBuf, PATH_MAX, "cyg%s.dll", module);
|
||||
#else
|
||||
snprintf(tmpBuf, PATH_MAX, "lib%s.so", module);
|
||||
#endif
|
||||
if (strcmp(direntry->d_name, tmpBuf) == 0) {
|
||||
if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
snprintf(tmpBuf, PATH_MAX, "%s_drv.dll", module);
|
||||
#else
|
||||
snprintf(tmpBuf, PATH_MAX, "%s_drv.so", module);
|
||||
#endif
|
||||
if (strcmp(direntry->d_name, tmpBuf) == 0) {
|
||||
if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
snprintf(tmpBuf, PATH_MAX, "%s.dll", module);
|
||||
#else
|
||||
snprintf(tmpBuf, PATH_MAX, "%s.so", module);
|
||||
#endif
|
||||
if (strcmp(direntry->d_name, tmpBuf) == 0) {
|
||||
if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
|
||||
ret = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue