我正在尝试在带有 Snow Leopard 的 i386 MacBook 上构建和安装 readline。
我做了以下步骤:
download and extract readline-6.0.tar.gz
./configure
make everything
sudo make install
我检查了示例,它们似乎可以工作(例如 rltest 支持历史记录)。这是文件 libreadline.6.0.dylib 的输出:
libreadline.6.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64
我希望它改为 i386,但如果这些示例有效......
然后我从 cabal 安装了 readline 包,其中包含以下内容:
cabal install readline --reinstall --configure-option=--with-readline-includes="/usr/local/include" --configure-option=--with-readline-libraries="/usr/local/lib"
它似乎有效:请注意,如果没有配置选项,安装将失败。我已经使用了 --reinstall 标志来强制重新安装,因为我已经做了很多试验。
这是阴谋集团信息的输出:
$ cabal info readline
* readline (library)
Synopsis: An interface to the GNU readline library
Latest version available: 1.0.1.0
Latest version installed: 1.0.1.0
Homepage: [ Not specified ]
Bug reports: [ Not specified ]
Description: More information on readline can be found at
http:\/\/www.gnu.org\/directory\/readline.html.
License: GPL
Maintainer: libraries@haskell.org
Source repo: [ Not specified ]
Flags: split-base
Dependencies: base >=3, process -any, base <3
Documentation: [ Not installed ]
Cached: Yes
Modules:
System.Console.Readline
System.Console.SimpleLineEditor
好的,看来我已经完成了。不我不是:
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> import System.Console.Readline
Prelude System.Console.Readline> do { readline "Prompt" }
Loading package syb ... linking ... done.
Loading package base-3.0.3.1 ... linking ... done.
Loading package filepath-1.1.0.2 ... linking ... done.
Loading package old-locale-1.0.0.1 ... linking ... done.
Loading package old-time-1.0.0.2 ... linking ... done.
Loading package unix-2.3.2.0 ... linking ... done.
Loading package directory-1.0.0.3 ... linking ... done.
Loading package process-1.0.1.1 ... linking ... done.
Loading package readline-1.0.1.0 ... linking ... <interactive>:
/Users/macbook/.cabal/lib/readline-1.0.1.0/ghc-6.10.4/HSreadline-1.0.1.0.o: unknown symbol `_rl_basic_quote_characters'
ghc: unable to load package `readline-1.0.1.0'
不出所料,我也无法构建依赖于 readline 的软件包(例如 JHC)。
你能为我指出正确的方向吗?如果您需要其他信息,请告诉我。
提前致谢。