6.29.2. Flex 的内容
安装的程序: flex, flex++ (链接到 flex) 和 lex
安装的库: libfl.{a,so} and libfl_pic.{a,so}
安装的目录: /usr/share/doc/flex-2.5.38
Flex 程序包包含用于创建识别文本样式的程序的工具。
首先,跳过运行三个需要 bison 的回归测试。
sed -i -e '/test-bison/d' tests/Makefile.in
准备编译 Flex:
./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.5.38
编译软件包:
make
要测试结果 (大约 0.5 SBU),执行:
make check
安装软件包:
make install
有几个程序还不知道 flex,会试图运行它的前身 lex。要支持这些程序,创建一个打包脚本,命名为
lex
,以 lex 模拟模式调用 flex
:
cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Begin /usr/bin/lex
exec /usr/bin/flex -l "$@"
# End /usr/bin/lex
EOF
chmod -v 755 /usr/bin/lex