LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


View Poll Results: Which would be more painful?
Learning the autotools build system. 1 33.33%
Shooting myself in the foot with a .41 Magnum. 2 66.67%
Voters: 3. You may not vote on this poll

Reply
  Search this Thread
Old 12-12-2009, 02:34 AM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Autotools n00b: How to install the directory?


Hi. I'm in the process of trying to convert the program I am developing over from a simple Makefile to an autotools-based build system. This is my first time trying to do this sort of thing.

I believe I have made a lot of progress, but needless to say it has been a less than joyful experience. Right now I am playing with my .41 Magnum, pondering the question of which would be more painful -- continuing to work on figuring out autotools, or shooting myself in the foot.

Anyway, my question: What do I set in my Makefile.am (or configure.ac???) so a data directory is installed?

In my package, there is a src/ dir with this Makefile.am:

Code:
bin_PROGRAMS = lusus_stack
lusus_stack_SOURCES = data.cpp lusus_stack.cpp lusus_stack_funcs.cpp
lusus_stack_LDADD = -lXxf86vm -lclanApp -lclanCore -lclanDisplay -lclanGL -lclanSound -lclanVorbis -lfontconfig -lfreetype -lpthread
In the top level dir there is this Makefile.am:

Code:
SUBDIRS = src
And this configure.ac:

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

AC_PREREQ([2.63])
AC_INIT([lusus], [0.1], [lusus@freelists.org])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/lusus_stack.cpp])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lXxf86vm':
AC_CHECK_LIB([Xxf86vm], [main])
# FIXME: Replace `main' with a function in `-lclanApp':
AC_CHECK_LIB([clanApp], [main])
# FIXME: Replace `main' with a function in `-lclanCore':
AC_CHECK_LIB([clanCore], [main])
# FIXME: Replace `main' with a function in `-lclanDisplay':
AC_CHECK_LIB([clanDisplay], [main])
# FIXME: Replace `main' with a function in `-lclanGL':
AC_CHECK_LIB([clanGL], [main])
# FIXME: Replace `main' with a function in `-lclanSound':
AC_CHECK_LIB([clanSound], [main])
# FIXME: Replace `main' with a function in `-lclanVorbis':
AC_CHECK_LIB([clanVorbis], [main])
# FIXME: Replace `main' with a function in `-lfontconfig':
AC_CHECK_LIB([fontconfig], [main])
# FIXME: Replace `main' with a function in `-lfreetype':
AC_CHECK_LIB([freetype], [main])
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [main])

#LIBS([Xxf86vm], [clanApp], [clanCore], [clanDisplay], [clanGL], [clanSound], [clanVorbis], [fontconfig], [freetype], [pthread])

# Checks for header files.
AC_CHECK_HEADERS([limits.h stdlib.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL

# Checks for library functions.

AC_CONFIG_FILES([
 Makefile
 src/Makefile
])
AC_OUTPUT
But I also want the files in the data/ directory installed to a (/usr/local/)data/lusus/ directory. So, I guess I need a Makefile.am in the data/ dir, but what do I put in it?

(Sidenote: I am going through the official documentation as best I can... but the wording and examples (or lack thereof) has left me confused on a number of issues.)
 
Old 12-12-2009, 05:30 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Please have a look into this simple game
http://mirror.amdmi3.ru/distfiles/co...ion-1.2.tar.gz

And read configure.in , .. and the Makefile.in 's
in sound/ and pics/.

Standard location for "data" :
/usr/local/share/<app-name>/"data"
.....
 
1 members found this post helpful.
Old 12-12-2009, 07:11 PM   #3
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375

Original Poster
Blog Entries: 24

Rep: Reputation: 43
Cool

Quote:
Originally Posted by knudfl View Post
Please have a look into this simple game
http://mirror.amdmi3.ru/distfiles/co...ion-1.2.tar.gz

And read configure.in , .. and the Makefile.in 's
in sound/ and pics/.

Standard location for "data" :
/usr/local/share/<app-name>/"data"
.....
Ah, finally! A real yet understandable example! I'm making progress again. I figured out how to create directories and move the files into them, using this basic idea in the Makefile.am files:

Code:
pkgdatadir = $(datadir)/@PACKAGE@/img
pkgdata_DATA = img1.png img2.png img3.png
I tried to follow you example more precisely:

Code:
pkgdatadir = $(datadir)/@PACKAGE@/sounds
EXTRA_DIST =           \
        cheering.ogg   \
        flip-piece.ogg \
        hit.ogg        \
        hit2.ogg       \
        hit3.ogg       \
        miss.ogg       \
        miss2.ogg      \
        miss3.ogg      \
        tick.ogg       \
        click.ogg      \
        click2.ogg

pkgdata_DATA = $(EXTRA_DIST)
But then the makefile would always die with: "*** Recursive variable `EXTRA_DIST' references itself (eventually). Stop." Not sure what was going on there.
 
Old 12-12-2009, 07:39 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
cd concentration-1.2/

grep -n EXTRA_DIST ./*
./Makefile.in:68: \
DISTFILES = \
$(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)

Please see the Makefile.in in the top directory.
Line 68 notes the argument "" $(EXTRA_DIST) ""

If the EXTRA_DIST is missing here, the other
' Makefile.in 's ' can't refer to it.
.....

Last edited by knudfl; 12-12-2009 at 07:45 PM.
 
Old 12-12-2009, 07:48 PM   #5
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by CoderMan View Post
But then the makefile would always die with: "*** Recursive variable `EXTRA_DIST' references itself (eventually). Stop." Not sure what was going on there.
I don't think you need EXTRA_DIST when having the files installed explicitly because they're already referenced; try renaming it.
Kevin Barry
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
library output directory with autotools lgavitt Programming 0 10-15-2006 11:31 AM
Can't install anything in Ubuntu 5.1 (n00b) shafer5 Ubuntu 5 01-21-2006 08:38 PM
n00b cant install BoomBoox RMorris78 Linux - Newbie 10 01-16-2006 01:22 AM
n00b trying to install drivers jpeyper Linux - Newbie 1 02-12-2005 10:54 PM
Help n00b with sarge install overhard Debian 4 09-03-2004 06:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration