diff options
Diffstat (limited to 'pc')
-rw-r--r-- | pc/ChangeLog | 11 | ||||
-rw-r--r-- | pc/Makefile | 3 | ||||
-rw-r--r-- | pc/gawkmisc.pc | 46 |
3 files changed, 60 insertions, 0 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog index c965fa89..800e6790 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,14 @@ +2017-10-21 KO Myung-Hun <komh78@gmail.com> + + * gawkmisc.pc (os2_dlsym, os2_fixdllname, os2_dlopen) [__KLIBC__]: + New functions. + +2017-10-21 Eli Zaretskii <eliz@gnu.org> + + * Makefile (install1): Create include/ at desctination, and copy + there gawkapi.h. Also copy *.png image files to share/info, as + those are required for the Info readers. + 2017-10-19 Arnold D. Robbins <arnold@skeeve.com> * 4.2.0: Release tar ball made. diff --git a/pc/Makefile b/pc/Makefile index f45782d0..be5e052e 100644 --- a/pc/Makefile +++ b/pc/Makefile @@ -294,15 +294,18 @@ install1: cat pc/awklib/igawk >> igawk.cmd cat pc/awklib/igawk.bat > igawk.bat -mkdir "$(prefix)" + -mkdir "$(prefix)/include" -mkdir "$(prefix)/bin" -mkdir "$(prefix)/share" -mkdir "$(prefix)/share/man" -mkdir "$(pkgdatadir)" "$(prefix)/share/man/man1" "$(prefix)/share/info" cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin cp gawk.exe $(prefix)/bin/awk.exe + cp gawkapi.h $(prefix)/include cp awklib/eg/lib/* pc/awklib/igawk.awk $(pkgdatadir) cp doc/*.1 $(prefix)/share/man/man1 cp doc/*.info $(prefix)/share/info + cp doc/*.png $(prefix)/share/info # install2 is equivalent to install1, but doesn't require cp, sed, etc. install2: diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index 41ffd5ec..1d845cc8 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -548,6 +548,52 @@ _os2_unixroot_path(const char *path) return (result) ? (const char*) result : path; } + +/* limit a length of DLL name up to 8 characters. If dst is not enough for + a fixed dll name, it is truncated. */ +char *os2_fixdllname(char *dst, const char *src, size_t n) +{ + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + char name[_MAX_FNAME]; + char ext[_MAX_EXT]; + char dll_file[_MAX_PATH]; + + _splitpath(src, drive, dir, name, ext); + if (strlen(name) > 8) + name[8] = '\0'; + _makepath(dll_file, drive, dir, name, ext); + + strncpy(dst, dll_file, n); + dst[n - 1] = '\0'; + + return dst; +} + +#ifdef __KLIBC__ + +/* replacement of dlopen(). This limits a length of a base name up to 8 + characters. */ +void *os2_dlopen(const char *file, int mode) +{ + char dll_file[strlen(file) + 1]; + + return (dlopen)(os2_fixdllname(dll_file, file, sizeof(dll_file)), mode); +} + +/* replacement of dlsym(). This prepends '_' to name. */ +void *os2_dlsym(void *handle, const char *name) +{ + char sym[strlen(name) + 1 + 1]; /* 1 for '_', 1 for NUL */ + + sym[0] = '_'; + strcpy(sym + 1, name); + + return (dlsym)(handle, sym); +} + +#endif /* __KLIBC__ */ + #endif /* __EMX__ */ #ifdef __MINGW32__ |