Bonsoir,
J'ai un problème en essayant de build une bibliothèque avec autotools. Ces outils sont complètement nouveaux pour moi, il y a sûrement plein d'erreurs...
configure.ac
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 . |-- 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
socket++/Makefile.am
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 AC_INIT([socket++], [1.2], [xcodexif@xif.fr], [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++/types/Makefile.am
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} AM_CXXFLAGS = -I$(top_srcdir)/socket++ @AM_CXXFLAGS@ 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
Aucun problème avec le ./configure. Mais quand je fais make, j'ai cette erreur totalement bizarre :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 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
C'est bizarre car libsocket++types.c n'a jamais été défini dans libsocket++types_la_SOURCES.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 make[3]: Entering directory '/root/socket++/socket++/types' make[3]: *** No rule to make target 'libsocket++types.c', needed by 'libsocket++types.lo'. Stop.
Qu'est-ce qui lui prend de vouloir compiler un fichier inexistant alors que ne lui ait jamais demandé ?
Merci d'avance pour votre aide
Partager