-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
unix: build broken on OSX by requirement for GNU readline #1253
Description
(Breaking discussion from 1129de5#commitcomment-11139851 now that it has been confirmed as a real issue.)
This is more of an issue with OSX than with MicroPython, but now that it has been confirmed by other OSX users we should open the discussion for possible solutions.
Prior to #1252 the unix build failed on OSX with the following message:
CC ../py/../extmod/modubinascii.c
CC ../py/../extmod/modmachine.c
CC main.c
CC gccollect.c
CC input.c
input.c:38:10: fatal error: 'readline/tilde.h' file not found
#include <readline/tilde.h>
^
1 error generated.
make: *** [build/input.o] Error 1
The issue is that the default readline on OSX is not GNU readline, but as mentioned in the prior discussion it is based on libedit from NetBSD. It is possible to use a package manager like MacPorts or HomeBrew to install GNU readline, however these package managers do not set the path to point to the new readline, presumably to avoid breaking software that relies on the native OSX version.
Inspired by a suggestion from @Anton-2, I found that I can build without modifying unix/mpconfigport.h with this command: CFLAGS_EXTRA=-I/opt/local/include make -j10
Presumably any other OSX user can do something similar, but it is less ideal than just being able to type make -B every time I pull the current source.
There was also the suggestion of linking against the package gnureadline like CPython apparently does to get around this issue on OSX, but I don't know how that might be done.
Opening this ticket to discuss these or any better suggestions.