aclocal的搜索路径在哪里

时间:2014-03-20 07:37:34

标签: c autotools autoconf automake

当我为我的C程序编译运行automake --foreign --add-missing时,我收到以下消息。

mylib/Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
mylib/Makefile.am:1:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
mylib/Makefile.am:1:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
mylib/Makefile.am:1:   If 'LT_INIT' is in 'configure.ac', make sure
mylib/Makefile.am:1:   its definition is in aclocal's search path.

这是我的configure.ac whitch包括LT_INIT。

AC_PREREQ([2.69])
AC_INIT([drive], [1], [admin@local])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/drive.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
LT_INIT
AC_CONFIG_FILES([Makefile
                src/Makefile
                mylib/Makefile])
AC_OUTPUT

mylib / Makefile.am也在这里

lib_LTLIBRARIES = libmylib.la      
libmylib_la_SOURCES = mylib.c   
include_HEADERS = mylib.h

那么aclocal的srearch路径在哪里?如何编写LT_ININT的定义?

2 个答案:

答案 0 :(得分:0)

我可以通过aclocal --print-ac-dir

看到aclocal的srearch路径

/opt/libtool/share/aclocal

但是没有自述文件就没有任何资源。

在我的情况下,aclocal的安装与automake不同

/opt/automake/share/aclocal

中有一些与m4相关的文件

然后我与/ opt/automake/share/aclocal

建立了符号链接
/opt/libtool/share/aclocal-> /opt/automake/share/aclocal

现在automake完成且没有错误。

答案 1 :(得分:0)

该错误表明缺少软件包“ LIBTOOL”

mylib/Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined

只需安装

sudo apt-get install libtool
相关问题