automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: troubles with autotools


From: laura la
Subject: Re: troubles with autotools
Date: Thu, 10 Feb 2011 12:35:53 -0300

Hi Ralf
first of all, It took me 4 google searches to find this FAQ you
mention, is this it?
http://www.gnu.org/software/hello/manual/automake/FAQ.html

I googled for
1) "autotools faq",
2) a random part of the file you mention "Writing rules for tools with
many output files"
3) your name "Ralf  Wildenhues"
4) "automake faq"

the last search took me to the link above, I hope is the right one.

About that automake faq, let me tell you from my point of view, and
maybe it will help others in my situation: the
new-opensource-contributor-that-is-just-starting. This is what I have
in my head, this is all my knowledge when bumping into problems: Here
I admit with brutal honesty my complete ignorance up to this point.

I start with a project that is already set up. I download the code,
run ./autogen.sh, it generates lots of files, among them "configure".
I run configure, then make and make install (after installing all
required dependencies). Sometimes that autogen author did it so it
runs configure itself. I found gnome projects do that two days ago. I
started two months ago or so. So there I was, runing autogen, and then
configure, when all the time configure was already being run. At
least, I think it is:

if test x$NOCONFIGURE = x; then
    printbold Running $srcdir/configure $conf_flags "$@" ...
    $srcdir/configure $conf_flags "$@" \
    && echo Now type \`make\' to compile $PKG_NAME || exit 1
else
    echo Skipping configure process.
fi

this is the last part of /usr/bin/gnome-autogen.sh and I have no idea
what test x$NOCONFIGURE = x could mean. yep, C++ developer with more
than 5 years experience here. It says "printbold Running configure
blablalba" if only I read the autogen.sh output! I don't read that.
it's just a blur of hundreds of lines scrolling in terminal. If there
is some error I will look at it, otherwise ignore it.

Ok so lets go on, I'm working in this already set up project. I know
that when running "make install" the files gets installed, and I have
to sudo make install otherwise I have no permission to write the files
wherever they are being installed. Let me draw what I have in my head
about installation: (see attachment "home and mistery place.png"

so I want to install everything in my own folder, somewhere inside
/home/laura to not touch anything already there in the system. I learn
that I do that with autogen.sh --prefix. Then I learn that if I
install my app and the libraries my app uses that way, I have to run
autogen.sh --prefix and --libdir. and there is some PKG_CONFIG_PATH
black magic going on too. My command ends looking like this:

CXXFLAGS='-g -O0' CFLAGS='-g -O0' ./autogen.sh --prefix
/home/laura/00_code/opt/gnome
PKG_CONFIG_PATH=/home/laura/00_code/opt/gnome/lib/pkgconfig:/home/laura/00_code/opt/gnome/share/pkgconfig
--libdir /home/laura/00_code/opt/gnome/lib

So now everything works, everything is installed in my dirs, I won't
have to reinstall ubuntu again after installing GTK+-3.0 unstable by
mistake in the default location! and just in case, now I have / and
/home in different partitions, I'm prepared!

I don't know what does it all mean exactly but I'm in a hurry! I need
to start working adding comboboxes to the preferences dialog ASAP! see
what I mean?

Then I want to add a folder to my project, or link to a new library.
Worse yet: the projects are not typical executable apps, they are some
kind of libraries (gstreamer plugins) or just files being installed in
/usr/share (gnome-video-effects). Tough luck, I'm not dealing with
helloworld.c ! I have plenty of automatically generated files to look
at. makefile and configure are autogenerated, so after googling and
skipping huge documentations, I find the tidbit info I need: which are
the files that are not autogenerated.
http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html  It
seems they are configure.in and Makefile.am. (I don't have any
configure.in. just configure.ac... and what in the name of god is
INTI_CFLAGS or INTI_LIBS?)

So I google "autotools tutorial". And of course I end up here
http://www.gnu.org/software/autoconf/manual/autoconf.html (autoconf
link in the first google link:
http://www.lrde.epita.fr/~adl/autotools.html. After all autoconf
sounds like something related to autogen.sh, and it's the first link
there. The automake link gets forgotten, (plus it points to
redhat.com, gnu.org sounds a lot more official, and ubuntu is debian
related) and in the autoconf manual there is a little section for
automake: http://www.gnu.org/software/autoconf/manual/autoconf.html#Automake
it mentions it creates the makefiles, doesn't sound important. I can
forget about it. This is all to say that it would never have crossed
my mind that "automake" has anything to do with my world. automake? I
see autogen, configure and makefiles. why would I look at the automake
faq? That's just the thing that creates the makefiles right? (I would
think to myself).

Or any "beginner' tutorial I find deals with starting from scratch
with a helloworld.c program. The patience and time I should spend with
that! I already have a project with those files! I need to know every
option I have for each file and their meaning, so I can look at the
files I already have, more or less understand them and add what I
need.

And while looking at
http://www.gnu.org/software/autoconf/manual/autoconf.html that's where
we give up. I mean, just look at that manual.

Now I'm looking at
http://sources.redhat.com/automake/automake.html#FAQ let's see,
suppose it crosses my mind to look at it while dealing with my project
problems. This are my thoughts:

#CVS - SKIP. I use git, does not apply to my situation.
#missing and AM_MAINTAINER_MODE: mmm I don't know what are they
talking about. does this have something to do with my problems? I
don't think so. SKIP.
# Wildcards: Why doesn't Automake support wildcards? - SKIP. nothing
to do with my problems.
# Limitations on File Names: Limitations on source and installed file names
# distcleancheck: Files left in build directory after distclean
# Flag Variables Ordering: CFLAGS vs. AM_CFLAGS vs. mumble_CFLAGS
# Renamed Objects: Why are object files sometimes renamed?
# Per-Object Flags: How to simulate per-object flags?
# Multiple Outputs: Writing rules for tools with many output files -
SKIP SKIP SKIP SKIP SKIP SKIP.
# Installing to Hard-Coded Locations - mmmm sounds reeeeally remotely
related, maybe read it a littlle? I read " ‘make distcheck’ fails."
hmm SKIP nothing to do with me.

# Adding a Makefile.am to an existing project - SKIP - I mean, for
this to catch my attention, I would already have to know that I need
to add a new Makefile.am to my project, and then, I'd only care about
what I should put in there, with a clear short example. And what the
results are.

Maybe now you can understand what does someone in my situation and
with my background knowledge experiences. So I'm sorry to say, I don't
think the faq entry would help, I don't know of a better idea either.
Maybe I'll think of something later, I'm too tired now.

I'm thinking something like "these are the files you can edit. This is
what configure.ac can contain ant the result is this. You need a
Makefile.am in each folder if.... and this is what it can contain and
the results." I'm thinking of a project configuration files like just
that, config files. If I'm dealing with config files, I want to know
what options exist, and what does each do. Are autotools files
something like config files? I'm starting to doubt it. The other day a
chat-pal asked me: what are autotools? After all this I went trough I
struggled to answer: "Iit's something that... lets you.. build and
install... you project".

By the way, the image is a sketch by Frank Frazetta (original is
mildly NSFW, the woman is almost naked:
http://frankfrazettamuseum.com/prints.html #43 "flying reptiles"), I
just got an answer today to a mail I sent them asking for permission
to use the image in the way I did and it was declined, so I will
replace it with something else soon. :(


Sorry about the long, ranty mail.
Laura


On Wed, Feb 9, 2011 at 7:00 PM, Ralf Wildenhues <address@hidden> wrote:
>
> Hello Laura, automake-patches readers,
>
> I help maintain autotools, and I've seen your blog
> http://programmermusings.blogspot.com/2011/02/new-gstreamer-plugin.html
> and while I can sympathize with you for the steep learning curve that
> autotools unfortunately have, let's try to improve things.
>
> So, a couple of questions: would the new FAQ entry below have helped?
> If not, what is unclear about it, what should be changed?  Second, OK to
> add your name and email to THANKS when committing the patch?
>
> Third, please be encouraged to ask questions on the automake at gnu.org
> mailing list.  We do expect users to become better over time in
> searching list archives before asking, and gain understanding, but
> initially we do try to be helpful even to complete newcomers.
>
> Last but not least, I would like to use the image from your blog post
> maybe in a future talk.  Did you create it, can I used it, are there
> strings attached to it?
>
> Others, do you see any issues with the patch?
>
> Thanks,
> Ralf
>
>    Add FAQ entry about adding a new directory to an existing project.
>
>    * doc/automake.texi (FAQ, Adding a Makefile.am): New FAQ section.
>    * THANKS: Update.
>    Prompted by a blog entry from Laura Lucas Alday.
>
> diff --git a/doc/automake.texi b/doc/automake.texi
> index 3af5201..ee73092 100644
> --- a/doc/automake.texi
> +++ b/doc/automake.texi
> @@ -354,6 +354,7 @@ Top
>  * Multiple Outputs::            Writing rules for tools with many output 
> files
>  * Hard-Coded Install Paths::    Installing to hard-coded locations
>  * Debugging Make Rules::        Strategies when things don't work as expected
> +* Adding a Makefile.am::        Adding a Makefile.am to an existing project
>  * Reporting Bugs::              Feedback on bugs and feature requests
>
>  History of Automake
> @@ -10524,6 +10525,7 @@ FAQ
>  * Multiple Outputs::            Writing rules for tools with many output 
> files
>  * Hard-Coded Install Paths::    Installing to hard-coded locations
>  * Debugging Make Rules::        Strategies when things don't work as expected
> +* Adding a Makefile.am::        Adding a Makefile.am to an existing project
>  * Reporting Bugs::              Feedback on bugs and feature requests
> address@hidden menu
>
> @@ -11919,6 +11921,64 @@ Debugging Make Rules
> address@hidden itemize
>
>
> address@hidden Adding a Makefile.am
> address@hidden Adding a @file{Makefile.am} to an existing project
> address@hidden adding @file{Makefile.am}
> address@hidden @file{Makefile.am}, adding
> +
> +What do I need to do when I want to add a @file{sub/foo/Makefile.am} to
> +an existing project?
> +
> +In general, it takes three steps:
> +
> address@hidden
> address@hidden
> +Write the @file{sub/foo/Makefile.am} file itself.
> +
> address@hidden
> +In a recursive @file{Makefile} project, edit the next higher-up
> address@hidden and add the relative directory in its @samp{SUBDIRS};
> +i.e., in this case, either add @file{foo} to the @samp{SUBDIRS} variable
> +in @file{sub/Makefile.am}:
> +
> address@hidden
> +## sub/Makefile.am
> +SUBDIRS = ...
> +
> +SUBDIRS += foo
> address@hidden example
> +
> address@hidden
> +or add @file{sub/foo} to the @samp{SUBDIRS} variable in the toplevel
> address@hidden if there is no intermediate @file{sub/Makefile.am}
> +(@pxref{Subdirectories}).
> +
> +In a nonrecursive @file{Makefile} project, depending on local
> +convention, you would probably write a fragment file to be included in
> +the toplevel @file{Makefile.am}:
> +
> address@hidden
> +## toplevel Makefile.am
> +...
> +include sub/foo/Makefile.am
> address@hidden example
> +
> address@hidden
> +Note that in this case you also need to use the relative subdir prefixes
> +in file names used inside the fragment file (@pxref{Alternative}).
> +
> address@hidden
> +Add the line @code{AC_CONFIG_FILES([sub/foo/Makefile])} to the
> address@hidden file (@pxref{Requirements}).
> address@hidden itemize
> +
> +Then, rerunning @command{make} in the build directory should do the
> +right thing unless you have rebuild rules disabled
> +(@pxref{maintainer-mode}); alternatively, run @command{autoreconf -v} in
> +the toplevel source directory. address@hidden Explained}, for a small
> +but complete example package.
> +
> +
> address@hidden Reporting Bugs
> address@hidden Reporting Bugs
>

Attachment: home and mistery place.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]