Fichier non installé avec les autotools

Résolu/Fermé
mat-ser Messages postés 30 Date d'inscription samedi 16 février 2008 Statut Membre Dernière intervention 12 janvier 2017 - Modifié par mat-ser le 29/08/2016 à 23:37
mat-ser Messages postés 30 Date d'inscription samedi 16 février 2008 Statut Membre Dernière intervention 12 janvier 2017 - 1 sept. 2016 à 00:57
Bonjour,
je suis dans un petit projet où le fichier bouton.png doit être intstallé dans /usr/share/bouton.
j'ai pensé à extra_dist mais cela ne fonctionne pas.

configure.ac
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([bouton], [1.0], [votre@e.mail])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/fonts.cpp])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX

#AT_WITH_QT

AM_CXXFLAGS=-I @top_srcdir@/include # Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

PKG_PROG_PKG_CONFIG

# ...

# Check for Qt libraries
PKG_CHECK_MODULES(QT, [QtCore, QtGui], [], [AC_MSG_ERROR([Qt libraries are required.])])

# Retrieve Qt compilation and linker flags
CPPFLAGS="`$PKG_CONFIG --cflags-only-I QtCore QtGui` $CPPFLAGS"
LDFLAGS="`$PKG_CONFIG --libs-only-L QtCore QtGui` $LDFLAGS"
LIBS="`$PKG_CONFIG --libs-only-l QtCore QtGui` $LIBS"

if ! `$PKG_CONFIG --atleast-version=4.6.0 QtCore`; then
AC_MSG_ERROR([Qt >= 4.6.0 is required.])
fi

AC_CHECK_PROGS(MOC, [moc-qt5 moc-qt4 moc])
AC_CHECK_PROGS(UIC, [uic-qt5 uic-qt4 uic])
AC_CHECK_PROGS(RCC, [rcc])
if test -z "$MOC" || test -z "$UIC" || test -z "$RCC"; then
AC_MSG_ERROR([Qt utility programs moc, uic, and rcc are required.])
fi

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT


Makefile.am
SUBDIRS = src
EXTRA_DIST = default16.png


src/Makefile
bin_PROGRAMS = bouton
bouton_CXXFLAGS=-I /usr/include/i386-linux-gnu/qt5
bouton_SOURCES = fonts.cpp


$ ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
./configure: line 3121: @top_srcdir@/include: No such file or directory
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for QT... yes
checking for moc-qt5... no
checking for moc-qt4... moc-qt4
checking for uic-qt5... no
checking for uic-qt4... uic-qt4
checking for rcc... rcc
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands



$ make
make all-recursive
make[1]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
Making all in src
make[2]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I /usr/include/i386-linux-gnu/qt5 -g -O2 -MT bouton-fonts.o -MD -MP -MF .deps/bouton-fonts.Tpo -c -o bouton-fonts.o `test -f 'fonts.cpp' || echo './'`fonts.cpp
mv -f .deps/bouton-fonts.Tpo .deps/bouton-fonts.Po
g++ -I /usr/include/i386-linux-gnu/qt5 -g -O2 -o bouton bouton-fonts.o -lQtGui -lQtCore
make[2]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
make[2]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
make[1]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'


$ make DESTDIR=~/exemplesQtZero/bouton/bouton-1.0-i386 install
Making install in src
make[1]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
make[2]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
/bin/mkdir -p '/home/matser/exemplesQtZero/bouton/bouton-1.0-i386/usr/local/bin'
/usr/bin/install -c bouton '/home/matser/exemplesQtZero/bouton/bouton-1.0-i386/usr/local/bin'
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
make[1]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0/src'
make[1]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
make[2]: Entering directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'
make[1]: Leaving directory '/home/matser/exemplesQtZero/bouton/bouton-1.0'


le fichier bouton.png n'a pas été installé dans ~/exemplesQtZero/bouton\
/bouton-1.0-i386/usr/share/local/bouton

quelqu'un a une idée?


A voir également:

3 réponses

mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024 7 749
30 août 2016 à 09:35
Bonjour,

Pour ta question, as tu regardé ceci :
https://stackoverflow.com/questions/10721826/install-arbitrary-data-files-in-fixed-location-with-automake

Maintenant si je peux me permettre... cmake est bien plus simple d'utilisation qu'autotools.
https://stackoverflow.com/questions/4071880/what-are-the-differences-between-autotools-cmake-and-scons
https://bitbucket.org/scons/scons/wiki/SconsVsOtherBuildTools

Bonne chance
1
mat-ser Messages postés 30 Date d'inscription samedi 16 février 2008 Statut Membre Dernière intervention 12 janvier 2017 2
30 août 2016 à 11:23
Meci Mamiemando, tu as résolu mon problème

voici comment j'ai corrigé le Makefile.am à la racine du projet:
SUBDIRS = src
pkgdata_DATA = default16.png
Si cela peut aider quelqu'un...
1
mat-ser Messages postés 30 Date d'inscription samedi 16 février 2008 Statut Membre Dernière intervention 12 janvier 2017 2
30 août 2016 à 12:01
on peut aussi faire un dossier data
mkdir data

et utiliser ce Makefile.am à la racine du projet:
SUBDIRS = src
pkgdata_DATA = data/default16.png
0
mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024 7 749
30 août 2016 à 14:52
Merci pour ton retour, n'oublie pas de basculer le sujet en résolu les prochaines fois :-)
https://www.commentcamarche.net/infos/25917-marquer-un-fil-de-discussion-comme-etant-resolu/

Bonne continuation !
0
mat-ser Messages postés 30 Date d'inscription samedi 16 février 2008 Statut Membre Dernière intervention 12 janvier 2017 2
1 sept. 2016 à 00:57
le sujet est résolu, mais je tiens à ajouter ceci
pour faire le tarball, on utilise à la racine du projet
make dist-bzip2

pour que le dossier data apparaisse dans le tarball final, il faut ajouter
EXTRA_DIST = leFichier ou leDossier
le Makefile.am de la racine du projet est donc ceci:
SUBDIRS = src
pkgdata_DATA = data/default16.png
EXTRA_DIST = data
0