Newsgroup: it.comp.os.linux.development
Titolo: autotools: aggiungere una libreria

Salve NG,
sono assolutamente newbie per quel che riguarda gli autotools (e non
solo :) ) e non riesco a capire come includere una libreria che e' parte
del mio stesso progetto, non una libreria di "sistema".
Il mio progetto e' organizzato in alcune directory:
mylib1, mylib2, prog1.
prog1 deve linkare mylib1 e mylib2, ma non ho capito che macro inserire nel
configure.in
.
Grazie, Nicola.
-- 
chi va pian va san e va lontan

 solo :) ) e non riesco a capire come includere una libreria che e' parte
]zac[
Nel progetto qui sotto le librerie sono linkate staticamente al programma e
non vengono installate.
Se invece devono essere librerie linkate dinamicamente e installate bisogna
cambiare le seguenti impostazioni (il come dovrebbe essere possibile
saperlo a intuito e/o scopiazzando da altri piccoli progetto):
noinst_LIBRARIES = 
libanbasic_a_SOURCES = 
libancommopt_a_SOURCES = 
libanfileconf_a_SOURCES = 
e forse anche:
gesconf_LDADD
Progetto gesconf :
  /home/gdb/Desktop/src/gesconf-4.0:
  usede 936 available 4419620
  drwxr-xr-x 8 gdb gdb   4096 23 giu 16:27 .
  drwxr-xr-x 9 gdb gdb   4096 31 mar 19:39 ..
  lrwxrwxrwx 1 gdb gdb     28 17 dic  2006 ABOUT-NLS
-> /usr/share/gettext/ABOUT-NLS
  -rw-r--r-- 1 gdb gdb  68511 30 dic 14:49 aclocal.m4
  drwxr-xr-x 3 gdb gdb   4096  9 apr 21:13 anlibrary
  -rw-r--r-- 1 gdb gdb     56 22 dic  2002 AUTHORS
  drwxr-xr-x 2 gdb gdb   4096 30 dic 14:49 autom4te.cache
  -rw-r--r-- 1 gdb gdb   3995 26 feb  2006 ChangeLog
  -rwxr-xr-x 1 gdb gdb  39923 15 mar  2005 config.guess
  -rw-rw-r-- 1 gdb gdb  73687 29 mar 00:38 config.log
  lrwxrwxrwx 1 gdb gdb     31 17 dic  2006 config.rpath
-> /usr/share/gettext/config.rpath
  -rwxrwxr-x 1 gdb gdb  38096 29 mar 00:38 config.status
  -rwxr-xr-x 1 gdb gdb  29708 15 mar  2005 config.sub
  -rwxrwxr-x 1 gdb gdb 372530 30 dic 14:49 configure
  -rw-r--r-- 1 gdb gdb    806 30 dic 14:44 
configure.ac
  -rw-r--r-- 1 gdb gdb  18011 28 ago  2005 COPYING
  -rwxr-xr-x 1 gdb gdb  15112 15 mar  2005 depcomp
  drwxrwxr-x 2 gdb gdb   4096  6 feb  2006 include
  -rw-r--r-- 1 gdb gdb   9240 15 mar  2005 INSTALL
  -rwxr-xr-x 1 gdb gdb   9505 15 mar  2005 install-sh
  drwxr-xr-x 2 gdb gdb   4096 29 mar 00:38 m4
  -rw-r--r-- 1 gdb gdb  20966 29 mar 00:38 Makefile
  -rw-r--r-- 1 gdb gdb    223  7 feb  2006 Makefile.am
  -rw-rw-r-- 1 gdb gdb  19287 30 dic 14:49 Makefile.in
  -rwxr-xr-x 1 gdb gdb  10678 15 mar  2005 missing
  -rwxr-xr-x 1 gdb gdb   3421 15 mar  2005 mkinstalldirs
  -rw-r--r-- 1 gdb gdb      0 22 dic  2002 NEWS
  drwxr-xr-x 2 gdb gdb   4096 29 mar 00:38 po
  -rw-r--r-- 1 gdb gdb    394  5 feb  2006 README
  -rw-r--r-- 1 gdb gdb    520 16 ago  2005 README_BUGS
  drwxr-xr-x 3 gdb gdb   4096  9 apr 21:12 src
  -rw-rw-r-- 1 gdb gdb  29641 31 dic 20:13 tags
File 
configure.ac
 :
# Process this file with autoconf to produce a configure script.
AC_INIT(gesconf, 0.4.0, 
be...@adria.it
 
be...@libero.it
)
AC_CONFIG_SRCDIR([src/GesConf.h])
#AC_CONFIG_HEADER([config.h])
#AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(gesconf, 0.4.0)
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h malloc.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([strcspn strstr])
AM_GNU_GETTEXT
AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in
                src/Makefile
                anlibrary/Makefile])
AC_OUTPUT 
File Makefile.am :
## Process this file with automake to produce Makefile.in
# General automake options.
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = m4 anlibrary src po
# documentation to install
EXTRA_DIST = config.rpath
  /home/gdb/Desktop/src/gesconf-4.0/anlibrary:
  usede 476 available 4419620
  drwxr-xr-x 3 gdb gdb  4096  9 apr 21:13 .
  drwxr-xr-x 8 gdb gdb  4096 23 giu 16:27 ..
  -rw-r--r-- 1 gdb gdb 19261 19 feb  2006 BaseString.c
  -rw-r--r-- 1 gdb gdb  2328 19 feb  2006 BaseString.h
  -rw-r--r-- 1 gdb gdb 17688  9 apr 20:54 BaseString.o
  -rw-r--r-- 1 gdb gdb 15338 20 feb  2006 CommOpt.c
  -rw-r--r-- 1 gdb gdb  3751 20 feb  2006 CommOpt.h
  -rw-r--r-- 1 gdb gdb 13168  9 apr 20:54 CommOpt.o
  drwxr-xr-x 2 gdb gdb  4096  9 apr 21:12 .deps
  -rw-rw-r-- 1 gdb gdb  5272  5 feb  2006 ErrLog.c
  -rw-rw-r-- 1 gdb gdb  2120  5 feb  2006 ErrLog.h
  -rw-r--r-- 1 gdb gdb  8644  9 apr 20:54 ErrLog.o
  -rw-r--r-- 1 gdb gdb  4911  4 feb  2006 file.c
  -rw-r--r-- 1 gdb gdb 56299  9 apr 21:13 FileConf.c
  -rw-r--r-- 1 gdb gdb 55577  1 apr 01:22 FileConf.c~
  -rw-r--r-- 1 gdb gdb  7407  9 apr 20:50 FileConf.h
  -rw-r--r-- 1 gdb gdb  7407  1 apr 01:22 FileConf.h~
  -rw-r--r-- 1 gdb gdb 49164  9 apr 21:12 FileConf.o
  -rw-r--r-- 1 gdb gdb  1532  4 feb  2006 file.h
  -rw-r--r-- 1 gdb gdb  6952  9 apr 20:54 file.o
  -rw-r--r-- 1 gdb gdb 34110  9 apr 20:54 libanbasic.a
  -rw-r--r-- 1 gdb gdb 13414  9 apr 20:54 libancommopt.a
  -rw-r--r-- 1 gdb gdb 56654  9 apr 21:12 libanfileconf.a
  -rw-r--r-- 1 gdb gdb 15380 29 mar 00:38 Makefile
  -rw-r--r-- 1 gdb gdb   325  7 feb  2006 Makefile.am
  -rw-rw-r-- 1 gdb gdb 14198 30 dic 14:49 Makefile.in
File Makefile.am :
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libanbasic.a libancommopt.a libanfileconf.a
libanbasic_a_SOURCES = BaseString.c file.c ErrLog.c
libancommopt_a_SOURCES = CommOpt.c
libanfileconf_a_SOURCES = FileConf.c file.c
INCLUDES = -DLOCALEDIR=$(top_srcdir)/include -I$(top_builddir)/include
  /home/gdb/Desktop/src/gesconf-4.0/src:
  usede 288 available 4419620
  drwxr-xr-x 3 gdb gdb  4096  9 apr 21:12 .
  drwxr-xr-x 8 gdb gdb  4096 23 giu 16:27 ..
  drwxr-xr-x 2 gdb gdb  4096  9 apr 20:54 .deps
  -rwxr-xr-x 1 gdb gdb 92775  9 apr 21:12 gesconf
  -rw-r--r-- 1 gdb gdb 14796  1 gen 15:57 GesConf.c
  -rw-r--r-- 1 gdb gdb  1809  1 gen 13:44 GesConf.h
  -rw-r--r-- 1 gdb gdb 18292  9 apr 20:54 GesConf.o
  -rw-r--r-- 1 gdb gdb 15372 29 mar 00:38 Makefile
  -rw-r--r-- 1 gdb gdb   453  6 feb  2006 Makefile.am
  -rw-rw-r-- 1 gdb gdb 14036 30 dic 14:49 Makefile.in
  -rwxr-xr-x 1 gdb gdb   920 28 ago  2005 sample
  -rw-r--r-- 1 gdb gdb   150  9 ago  2005 sample_copy.ini
  -rw-r--r-- 1 gdb gdb   295 20 feb  2006 sample.data
  -rw-r--r-- 1 gdb gdb  6387 28 ago  2005 samplefunc
  -rw-r--r-- 1 gdb gdb   150 10 ago  2005 sample.ini
  -rw-r--r-- 1 gdb gdb   468  9 ago  2005 sampleM_copy.ini
  -rw-r--r-- 1 gdb gdb   519 20 feb  2006 sampleM.ini
  -rwxr--r-- 1 gdb gdb   167 20 feb  2006 sample.tmp
  -rw-r--r-- 1 gdb gdb   193 29 mar 21:20 test1.ini
  -rw-r--r-- 1 gdb gdb   187 22 dic  2002 test.ini
  -rwxrwxr-x 1 gdb gdb 28126 20 lug  2003 trash
  -rw-r--r-- 1 gdb gdb  1921  4 feb  2006 trash.c
  -rw-r--r-- 1 gdb gdb  3601 20 feb  2006 XF86Config-4
  -rw-r--r-- 1 gdb gdb  3365 10 ago  2005 XF86Config-4_copy
  -rw-r--r-- 1 gdb gdb  3369  4 ago  2003 XF86Config-4-deb
  -rw-r--r-- 1 gdb gdb  2843 11 ago  2003 XF86Config-4-mdk
  -rw-rw-r-- 1 gdb gdb  2837  4 ago  2003 XF86Config-4-nvida
  -rw-r--r-- 1 gdb gdb  6378 15 ago  2003 XF86Config-4-suse
File Makefile.am :
## Process this file with automake to produce Makefile.in
anlibrary= ../anlibrary
##bin_PROGRAMS = gesconf trash
#trash_SOURCES = trash.c
bin_PROGRAMS = gesconf
gesconf_SOURCES = GesConf.c
gesconf_LDADD = $(anlibrary)/libanbasic.a $(anlibrary)/libancommopt.a
$(anlibrary)/libanfileconf.a
#trash_SOURCES = trash.c
localedir = $(datadir)/locale
INCLUDES = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/include
-I$(top_builddir)/include -I$(anlibrary)

 $(anlibrary)/libanfileconf.a
Ah ecco, questa dovrebbe fare al caso mio.
