-
Notifications
You must be signed in to change notification settings - Fork 622
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
cannot compile tig with readline support on macOS Big Sur (11.1) #1072
Comments
Edit: setting |
I tried to export $ brew info readline
readline: stable 8.1 (bottled) [keg-only]
...
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
$ export LDFLAGS="-L/usr/local/opt/readline/lib"
$ export CPPFLAGS="-I/usr/local/opt/readline/include"
$ export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
$ env | grep -e 'LDFLAGS' -e 'CPPFLAGS' -e 'PKG_CONFIG_PATH'
LDFLAGS=-L/usr/local/opt/readline/lib
CPPFLAGS=-I/usr/local/opt/readline/include
PKG_CONFIG_PATH=/usr/local/opt/readline/lib/pkgconfig
# List the contents in the pkgconfig directory.
$ ls -A /usr/local/opt/readline/lib/pkgconfig
readline.pc
# Re-generate configure and run without `--with-readline`
$ make distclean
$ ./autogen.sh
$ ./configure prefix="${PWD}/local"
...
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking version of installed readline library... none
configure: WARNING: Could not test version of installed readline library.
configure: WARNING: Minimum required version of readline is 6.3
...
# Re-generate configure and run with `--with-readline`
$ make distclean
$ ./autogen.sh
$ ./configure prefix="${PWD}/local" --with-readline="/usr/local/opt/readline"
...
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking version of installed readline library... none
configure: WARNING: Could not test version of installed readline library.
configure: WARNING: Minimum required version of readline is 6.3
... |
I also checked the contents of installed readline library: $ exa --all --tree --classify --group-directories-first /usr/local/opt/readline/
/usr/local/opt/readline/
├── .brew/
│ └── readline.rb
├── include/
│ └── readline/
│ ├── chardefs.h
│ ├── history.h
│ ├── keymaps.h
│ ├── readline.h
│ ├── rlconf.h
│ ├── rlstdc.h
│ ├── rltypedefs.h
│ └── tilde.h
├── lib/
│ ├── pkgconfig/
│ │ └── readline.pc
│ ├── libhistory.8.1.dylib
│ ├── libhistory.8.dylib -> libhistory.8.1.dylib
│ ├── libhistory.a
│ ├── libhistory.dylib -> libhistory.8.1.dylib
│ ├── libreadline.8.1.dylib
│ ├── libreadline.8.dylib -> libreadline.8.1.dylib
│ ├── libreadline.a
│ └── libreadline.dylib -> libreadline.8.1.dylib
├── share/
│ ├── doc/
│ │ └── readline/
│ │ ├── CHANGES
│ │ ├── INSTALL
│ │ └── README
│ ├── info/
│ │ ├── history.info
│ │ ├── readline.info
│ │ └── rluserman.info
│ ├── man/
│ │ └── man3/
│ │ ├── history.3
│ │ └── readline.3
│ └── readline/
│ ├── excallback.c
│ ├── fileman.c
│ ├── hist_erasedups.c
│ ├── hist_purgecmd.c
│ ├── histexamp.c
│ ├── manexamp.c
│ ├── rl-callbacktest.c
│ ├── rl-fgets.c
│ ├── rl.c
│ ├── rlbasic.c
│ ├── rlcat.c
│ ├── rlevent.c
│ ├── rlkeymaps.c
│ ├── rlptytest.c
│ ├── rltest.c
│ └── rlversion.c
├── CHANGELOG
├── CHANGES
├── COPYING
├── INSTALL_RECEIPT.json
├── NEWS
└── README |
Let's try something simpler. On a Mac you shouldn't need to run run configure. |
It just build $ make distclean && make
rm -f -r doc/manual.html-chunked autom4te.cache
rm -f doc/*.toc doc/tig.1 doc/tigrc.5 doc/tigmanual.7 doc/tig.1.html doc/tigrc.5.html doc/manual.html README.html INSTALL.html NEWS.html doc/manual.html-chunked doc/manual.pdf aclocal.m4 configure
rm -f config.h config.log config.make config.status config.h.in
CC src/tig.o
CC src/types.o
CC src/string.o
CC src/util.o
CC src/map.o
CC src/argv.o
CC src/io.o
CC src/refdb.o
GEN src/builtin-config.c
CC src/builtin-config.o
CC src/request.o
CC src/line.o
CC src/keys.o
CC src/repo.o
CC src/options.o
CC src/draw.o
CC src/prompt.o
CC src/display.o
CC src/view.o
CC src/search.o
CC src/parse.o
CC src/watch.o
CC src/pager.o
CC src/log.o
CC src/reflog.o
CC src/diff.o
src/diff.c:377:27: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
(type = LINE_DEFAULT ||
^
1 warning generated.
CC src/help.o
CC src/tree.o
CC src/blob.o
CC src/blame.o
CC src/refs.o
CC src/status.o
CC src/stage.o
CC src/main.o
CC src/stash.o
CC src/grep.o
CC src/ui.o
CC src/apps.o
CC src/graph.o
CC src/graph-v1.o
CC src/graph-v2.o
CC compat/hashtab.o
CC compat/utf8proc.o
LINK src/tig
CC test/tools/test-graph.o
LINK test/tools/test-graph
CC tools/doc-gen.o
LINK tools/doc-gen |
Are you sure it doesn't create the executable src/tig ? |
I tried it again with a clean Git repository, $ git clone [email protected]:jonas/tig.git
$ cd tig
$ git checkout tig-2.5.1
$ make distclean
$ make
... (same output as the previous reply)
$ mkdir -p "${PWD}/local"
$ make install prefix="${PWD}/local"
INSTALL src/tig -> ~/workspace/playground/tig/local/bin
INSTALL tigrc -> ~/workspace/playground/tig/local/etc
$ ~/workspace/playground/tig/local/bin/tig --version
tig version 2.5.1
ncursesw version 6.2.20200212
readline version 8.1
^^^^^^^^^^^^^^^^ it finally works but I don't know why it works. :( I expect Ref: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tig.rb#L30 |
Sorry for my fault 🙏
|
The problem seems to be only with Catalina and Big Sur. Unfortunately I'm running an older version. Could you send a me a copy of the |
Does that help ? diff --git a/tools/ax_lib_readline.m4 b/tools/ax_lib_readline.m4
index 45fb353..f667509 100644
--- a/tools/ax_lib_readline.m4
+++ b/tools/ax_lib_readline.m4
@@ -120,18 +120,18 @@ AC_CACHE_VAL(ac_cv_rl_version,
extern int rl_gnu_readline_p;
-main()
+int main(void)
{
FILE *fp;
fp = fopen("conftest.rlv", "w");
if (fp == 0)
- exit(1);
+ ${cf_cv_main_return:-return}(1);
if (rl_gnu_readline_p != 1)
fprintf(fp, "0.0\n");
else
fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
fclose(fp);
- exit(0);
+ ${cf_cv_main_return:-return}(0);
}
]])],
ac_cv_rl_version=`cat conftest.rlv`, |
I send a copy of the |
I tested the changes of
👍 |
I also tested few commands:
# without `--with-readline` option
$ ./autogen.sh && ./configure
...
configure: WARNING: Could not test version of installed readline library.
configure: WARNING: Minimum required version of readline is 6.3
...
$ make
...
LINK src/tig
...
$ ./src/tig --version
./src/tig --version
tig version 2.5.1-dirty
ncurses version 5.7.20081102 But it works with # It works with `--with-readline` option
$ ./autogen.sh && ./configure --with-readline="/usr/local/opt/readline"
...
checking version of installed readline library... 8.1
... # use LDFLAGS and CPPFLAGS variables, without `--with-readline` option,
$ export LDFLAGS="-L/usr/local/opt/readline/lib"
$ export CPPFLAGS="-I/usr/local/opt/readline/include"
$ ./autogen.sh && ./configure
...
checking version of installed readline library... 8.1
... |
in another test case, $ make distclean
$ make
$ ./src/tig --version
tig version 2.5.1-dirty.
ncursesw version 6.2.20200212
readline version 8.1 |
Thanks a lot @edentsai,
It will work OOTB from the next version, but if you want to install the current tig-2.5.2 with readline support from Homebrew already, you can do |
Thanks a lot for your help. |
I am trying to install tig with readline support on macOS to record
~/.tig_history
,but the
./configure
can't detect the version of installed readline library while compile tig.In short:
the output of
./configure
displayed:I can't figure out where is the problem. :(
Details
my workstation information:
Install tig via Homebrew can't enable readline support:
$ brew uninstall tig $ brew install tig # tig doesn't enable readline support $ tig --version tig version 2.5.1 ncurses version 5.7.20081102
I also tried manually compile tig from the source code,
it still cannot enable readline support,
I think the reason is
./configure
cannot detect the version of installed readline library for me.I can't figure out where is the problem about this:
but I found a workaround to manually set
ac_cv_rl_version="8.1"
variable while execute./configure
:When I manually set
ac_cv_rl_version="8.1"
to run ./configure,it will enable readline support.
but I don't know how to fix this problem without set
ac_cv_rl_version
variable by myself.The text was updated successfully, but these errors were encountered: