Created
June 12, 2013 14:24
-
-
Save yyuu/5765731 to your computer and use it in GitHub Desktop.
verify if there is library function defined (like autoconf's AC_CHECK_LIB)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| has_broken_mac_readline() { | |
| # MacOSX 10.4 has a broken readline. | |
| # https://github.com/yyuu/pyenv/issues/23 | |
| local retval=1 | |
| local conftest="$BUILD_PATH/has_broken_mac_readline.c" | |
| if [ "$(uname -s)" = "Darwin" ]; then | |
| cat <<EOF > "$conftest" | |
| #ifdef __cplusplus | |
| extern "C" | |
| #endif | |
| char rl_gnu_readline_p (); | |
| int main() { return rl_gnu_readline_p (); return 0; } | |
| EOF | |
| { "$CC" -o "/dev/null" $CFLAGS $CPPFLAGS $LDFLAGS "$conftest" -lreadline | |
| } || retval=0 | |
| rm -f "$conftest" | |
| fi | |
| return "$retval" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment