我正在尝试在我的MacOS 10.8.3机器上使用libtool。因为苹果提供的所有内容都已过时,所以我正在使用macports。我已经安装了最新版本:
libtool (GNU libtool) 2.4.2
automake (GNU automake) 1.13.1
autoconf (GNU Autoconf) 2.69
所有内容都安装在 /opt 目录下。
这里是 configure.ac 文件:
AC_INIT([Hello], [0.1], [bug-report@hello.example.com], [hello], [http://hello.example.com/])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 no-define])
LT_INIT
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
这里是Makefile.am文件:
lib_LTLIBRARIES = libsomething-1.0.la
libsomething_1_0_la_SOURCES = something.cc
bin_PROGRAMS = hello
hello_SOURCES = hello.h hello.cc main.cc
运行glibtoolize会产生以下错误:
glibtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
glibtoolize: rerunning glibtoolize, to keep the correct libtool macros in-tree.
glibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
当我在Makefile.am中添加这行代码时: ACLOCAL_AMFLAGS="-I m4" 我遇到了以下错误;
glibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
如果我修改成这样: ACLOCAL_AMFLAGS="-Im4"
我就会得到相同的错误信息: glibtoolize: 在 Makefile.am 中 ACLOCAL_AMFLAGS 中考虑添加 `-I m4'。
我得到的第二个错误是:
configure.ac:5: error: required file '../ltmain.sh' not found
如何消除这些错误?
autoreconf -fvi
应该可以解决这个问题。 - ldav1s/opt/
目录了。 - vy32