-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patches to compile on FreeBSD (2017-10-14) #19
Conversation
From the ast-open post on 3 Apr 2014: Below are a small set of patches that should restore a full build of ast-open to FreeBSD 9. I'm still quite new to iffe, though, so if there are better ways to do what I've done below, please don't hesitate to let me know. So much of my work (both professional and personal) uses ast-open heavily, and this seems like the very least I can do. To be clear, the build succeeds, but they don't cleanly pass all regression tests
Do we know if this still builds okay on Linux with these changes? It looks like travis has not built it because it only builds commits made after travis has been enabled for the repo. |
I have amended the commit and pushed again, let's see... |
FYI, This plus PR #76 allows everything but |
I will have to clean up and rearrange the commits before I merge this one. |
@siteshwar thank you, yes, this is a quick dump of what "works for me" to share, but it should be cleaned up |
I should have looked more closely at this before I made my changes to fix building ksh93 on macOS (a BSD derivative). At this point the only part of this PR not already merged simply changes the version number. Something I don't think should be necessary. We shouldn't have to manually update the version every time a commit is merged. It's worthwhile to have the version reflect the commit the build is based on but that should be done dynamically at build time by extracting the git head commit ID or tag. Sorry this languished so long, @saper. |
I have bumped the version number to create my own ksh93 release, since the upstream seemed pretty much dead. I found it useful to add some comments in the release notes. |
This now makes ksh build on DragonFly BSD. src/cmd/ksh93/sh/main.c, src/cmd/ksh93/tests/basic.sh: - fixargs() doesn't work on DragonFly either (re: 9b7c392, 159fb9e, cefe087). The following are backported from: att#26 (comment) att#19 src/lib/libast/comp/setlocale.c: - Add missing #include <errno.h> since errno is used. src/lib/libast/features/standards: - Do not set any standards macros (_POSIX_SOURCE etc) on FreeBSD or DragonflyBSD; they disable too much functionality on those. src/lib/libast/features/wchar: - Set _STDFILE_DECLARED on DragonFly, too. src/lib/libast/include/sfio.h, src/lib/libast/include/sfio_t.h, src/lib/libast/sfio/_sfopen.c, src/lib/libast/sfio/sfclrlock.c, src/lib/libast/sfio/sfhdr.h, src/lib/libast/sfio/sfnew.c, src/lib/libast/sfio/sfset.c: - Rename SF_* macros to SFIO_* to avoid a conflict with system headers. src/lib/libast/string/strexpr.c: - Rename error() to err() to avoid a conflict.
This now makes ksh build on DragonFly BSD. bin/package, src/cmd/INIT/package.sh: - DragonFly also needs the -lm hack for LDFLAGS. src/cmd/ksh93/sh/main.c, src/cmd/ksh93/tests/basic.sh: - fixargs() doesn't work on DragonFly either (re: 9b7c392, 159fb9e, cefe087). The following are backported from: att#26 (comment) att#19 src/lib/libast/comp/setlocale.c: - Add missing #include <errno.h> since errno is used. src/lib/libast/features/standards: - Do not set any standards macros (_POSIX_SOURCE etc) on FreeBSD or DragonflyBSD; they disable too much functionality on those. src/lib/libast/features/wchar: - Set _STDFILE_DECLARED on DragonFly, too. src/lib/libast/include/sfio.h, src/lib/libast/include/sfio_t.h, src/lib/libast/sfio/_sfopen.c, src/lib/libast/sfio/sfclrlock.c, src/lib/libast/sfio/sfhdr.h, src/lib/libast/sfio/sfnew.c, src/lib/libast/sfio/sfset.c: - Rename SF_* macros to SFIO_* to avoid a conflict with system headers. src/lib/libast/string/strexpr.c: - Rename error() to err() to avoid a conflict.
This now makes ksh build on DragonFly BSD. bin/package, src/cmd/INIT/package.sh: - DragonFly also needs the -lm hack for LDFLAGS. src/cmd/ksh93/sh/main.c, src/cmd/ksh93/tests/basic.sh: - fixargs() doesn't work on DragonFly either (re: 9b7c392, 159fb9e, cefe087). The following are backported from: att#26 (comment) att#19 src/lib/libast/comp/setlocale.c: - Add missing #include <errno.h> since errno is used. src/lib/libast/features/standards: - Do not set any standards macros (_POSIX_SOURCE etc) on FreeBSD or DragonflyBSD; they disable too much functionality on those. src/lib/libast/features/wchar: - Set _STDFILE_DECLARED on DragonFly, too. src/lib/libast/include/sfio.h, src/lib/libast/include/sfio_t.h, src/lib/libast/sfio/_sfopen.c, src/lib/libast/sfio/sfclrlock.c, src/lib/libast/sfio/sfhdr.h, src/lib/libast/sfio/sfnew.c, src/lib/libast/sfio/sfset.c: - Rename SF_* macros to SFIO_* to avoid a conflict with system headers. src/lib/libast/string/strexpr.c: - Rename error() to err() to avoid a conflict.
Ksh was not checking for `command` when running a special builtin, which caused preceding invocation-local variable assignments to become global. This is the reproducer from the att#72: $ foo=BUG command eval ':' $ echo "$foo" This no longer prints 'BUG', as ksh now makes sure the command builtin is not running a special builtin before making invocation-local variable assignments global. src/cmd/ksh93/sh/xec.c: - Backport the bugfix for BUG_CMDSPASGN from ksh93v- 2013-10-10-alpha. src/cmd/ksh93/tests/builtins.sh: - Add a regression test based on the reproducer in att#72.
RELEASE notes for src/cmd/ksh93/RELEASE
Credit goes to Robert S. Krzaczek