Closed talbergs closed 4 years ago
Tried branches "osx" and "1.0", same error ../athame_util.h:1217:1: error: unknown type name 'sighandler_t'
I don't have a Mac to test this on right now, but you might be able to fix it by adding "typedef void (*sighandler_t) (int);" to the top of athame.c
Tried that, no success. Parts of output:
Test Failed
Failed tests: 1 2 3 4 5
If i press "v" to view failures, every tests complains is dyld: Library not loaded: /usr/lib/libreadline.7.dylib
What now?
v: view failures
C: *DANGEROUS* continue anyway
x: exit
C
Installing Readline with Athame...
/bin/sh ./support/mkinstalldirs /usr/include \
/usr/include/readline /usr/lib \
/usr/share/info /usr/share/man/man3 /usr/share/doc/readline
mkdir -p -- /usr/share/doc/readline
mkdir: /usr/share/doc/readline: Operation not permitted
make: [installdirs] Error 1 (ignored)
for f in readline.h chardefs.h keymaps.h history.h tilde.h rlstdc.h rlconf.h rltypedefs.h athame.h; do \
/usr/bin/install -c -m 644 ./$f /usr/include/readline ; \
done
install: /usr/include/readline/readline.h: Operation not permitted
install: /usr/include/readline/chardefs.h: Operation not permitted
install: /usr/include/readline/keymaps.h: Operation not permitted
install: /usr/include/readline/history.h: Operation not permitted
install: /usr/include/readline/tilde.h: Operation not permitted
install: /usr/include/readline/rlstdc.h: Operation not permitted
install: /usr/include/readline/rlconf.h: Operation not permitted
install: /usr/include/readline/rltypedefs.h: Operation not permitted
install: /usr/include/readline/athame.h: Operation not permitted
make: *** [install-headers] Error 71
tried running as sudo ./readline_athame_setup.sh
Sorry for the delayed response.
There are 2 problems here: 1) There's some linking problem in setting up the test. There's a good chance it won't affect actual Athame, but since breaking bash is super annoying, I'd not recommend continuing without the test (unless you use a different bash version, see my recommendation below). 2) The "Operation not permitted" is because newer versions of OS X don't let you change a bunch of system files, even with root. You can disable this, but I wouldn't recommend it (see above). I'll try and add something about this to the Athame docs when I get a chance.
My recommendation, for anybody who is really determined to install Athame on OS X and is running into similar problems, is to install a local readline and bash. (Haven't tried it out recently, but it should be ./readline_athame_setup.sh --prefix="$HOME/.local" --nosudo --notest
and ./bash_readline_setup.sh --prefix="$HOME/.local" --with-installed-readline="$HOME/.local" --nosudo
). Then you can run the Athame version of bash with ./local/bash and if it's horribly broken, your regular shell is still usable. You can always symlink it later. Plus, it avoids the "Operation not permitted" error.
I had forgotten about this amazing project. Now using Arch and no problems on getting hands on this. As a side-note - I now use fish
as daily repl - they have their own realdline
thingy.
Sorry to dig up an old question. This is the first hit on Google searching for OS X and undeclared identifier for sighandler_t
.
I believe you want something like this:
#if defined(__APPLE__)
static sig_t old_sigint ;
#else
static sighandler_t old_sigint ;
#endif
And then:
old_sigint = signal(SIGINT, new_sigint);
Here's your authority to use sig_t
... According to the signal(3)
man page on OS X:
$ man signal
...
SIGNAL(3) BSD Library Functions Manual SIGNAL(3)
NAME
signal -- simplified software signal facilities
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <signal.h>
void (*signal(int sig, void (*func)(int)))(int);
or in the equivalent but easier to read typedef'd version:
typedef void (*sig_t) (int);
sig_t
signal(int sig, sig_t func);
...
Regarding this on OS X:
install: /usr/include/readline/readline.h: Operation not permitted
install: /usr/include/readline/chardefs.h: Operation not permitted
...
I believe it is due to Apple's new System Integrity Protection. You should install into /usr/local
, not /usr
. You have to jump through some hoops to install into /usr
. /usr
is not impossible, but it is very painful.
Also, for readline on OS X, your CFLAGS
and CXXFLAGS
should include -DNEED_EXTERN_PC
.
This is the output: