我將autotools功能添加到個人圖書館,但我遇到了一些問題。我確定自動工具對我來說是全新的。Automake錯誤建築庫 - 幻影文件
.
|-- Makefile.am
|-- configure.ac
`-- socket++
|-- Makefile.am
|-- base_socket.cpp
|-- base_socket.hpp
|-- client.cpp
|-- client.hpp
|-- config.h
|-- config.h.in
|-- refcount++.hpp
|-- server.cpp
|-- server.hpp
|-- server.imp.hpp
`-- types
|-- Makefile.am
|-- simple_socket.cpp
|-- simple_socket.hpp
|-- simple_socket_stop.cpp
|-- simple_socket_stop.hpp
|-- text_buffered.hpp
`-- text_buffered.imp.hpp
這裏是configure.ac
AC_INIT([socket++], [1.2], [[email protected]], [socket++], [http://dev.xif.fr/socketxx])
AM_INIT_AUTOMAKE([foreign -Wall])
AC_CONFIG_HEADERS([socket++/config.h])
AC_CONFIG_SRCDIR([socket++/base_socket.cpp])
AC_CONFIG_FILES([Makefile socket++/Makefile socket++/types/Makefile])
AC_CONFIG_MACRO_DIR([m4])
# Distribute additional compiler and linker flags
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
# Checks for compilers
AC_PROG_CXX
AC_PROG_CC
AX_CXX_COMPILE_STDCXX_11
# Libtool
LT_INIT
LT_LANG([C++])
# Checks for header files
AC_CHECK_HEADERS([arpa/inet.h inttypes.h netdb.h netinet/in.h stddef.h sys/ioctl.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([gethostbyname inet_ntoa select socket strerror])
AC_OUTPUT
這裏是socket++/Makefile.am
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
AM_CXXFLAGS = -I$(top_srcdir)/socket++ @[email protected]
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = types
lib_LTLIBRARIES = libsocket++.la
library_includedir=$(includedir)/socket++
library_include_HEADERS = refcount++.hpp base_socket.hpp client.hpp server.imp.hpp server.hpp
libsocket++_la_SOURCES = base_socket.cpp client.cpp server.cpp
socket++_libincludedir = $(libdir)/socket++/include
nodist_socket++_libinclude_HEADERS = config.h
libsocket++_la_LIBADD = types/libsocket++types.a
最後socket++/types/Makefile.am
noinst_lib_LTLIBRARIES = libsocket++types.la
library_includedir=$(includedir)/socket++/types
library_include_HEADERS = simple_socket_stop.hpp simple_socket.hpp text_buffered.imp.hpp text_buffered.hpp
libsocket++types_la_SOURCES = simple_socket_stop.cpp simple_socket.cpp
全部是罰款./configure
但是,當我make
,我有這樣的錯誤:
make[3]: Entering directory '/root/socket++/socket++/types'
make[3]: *** No rule to make target 'libsocket++types.c', needed by 'libsocket++types.lo'. Stop.
,由於libsocket++types.c
從未在libsocket++types_la_SOURCES
定義我搜索了一段時間,但沒有發現任何有關文件的幻影像這樣奇怪。 在此先感謝您的幫助!
我以爲這是一個'+'字符相關的問題。那是對的。我稱之爲'phantom'文件'libsocket ++ types.c',因爲它不存在。感謝幫助 –