use*_*414 5 c automake autoconf autotools
当我运行automake --foreign --add-missing我的 C 程序编译时,我收到以下消息 。
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.
Run Code Online (Sandbox Code Playgroud)
这是我的configure.acwhitch 包括 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
Run Code Online (Sandbox Code Playgroud)
mylib/Makefile.am 也在这里
lib_LTLIBRARIES = libmylib.la
libmylib_la_SOURCES = mylib.c
include_HEADERS = mylib.h
Run Code Online (Sandbox Code Playgroud)
那么aclocal'搜索路径在哪里,我如何编写LT_ININT的定义?
我可以看到 aclocal\xe2\x80\x99 srearch 路径aclocal --print-ac-dir
它是/opt/libtool/share/aclocal
但是没有 README 就没有\xe2\x80\x99t 任何资源。
\n\n就我而言,aclocal 的安装方式与 automake 不同
\n\n并且有一些m4相关的文件/opt/automake/share/aclocal
然后我建立了到 / 的符号链接opt/automake/share/aclocal
/opt/libtool/share/aclocal-> /opt/automake/share/aclocal\nRun Code Online (Sandbox Code Playgroud)\n\n现在 automake 已完成且没有错误。
\n