Re: automake breaks my file by putting includes after rules; how do I fix this?

2013-11-20 Thread Diego Elio Pettenò
On Wed, Nov 20, 2013 at 9:33 PM, Jason Gross  wrote:

> (I don't want to require running autoreconf and
> configure whenever you add a file that the makefile already knows how to
> compile).
>

You actually do not need autoreconf. Maintainer mode will take care of it
for you buy only running automake, and running the config status updater.

So use maintainer mode, and don't be a snowflake, please.

Diego Elio Pettenò — Flameeyes
flamee...@flameeyes.eu — http://blog.flameeyes.eu/


automake breaks my file by putting includes after rules; how do I fix this?

2013-11-20 Thread Jason Gross
I have a Makefile.am which includes another file in order to get a list of
files it should compile (I don't want to require running autoreconf and
configure whenever you add a file that the makefile already knows how to
compile).  But this does not work with automake's generated all and all-am
targets, which compute their dependencies on the basis of the DATA
variable, which is auto-defined to be nobase_hott_DATA, which depends on
variables set in the included file.  How do I fix this?  (Should I submit a
bug report that includes should come before the autogenerated targets?)

-Jason


Re: Want "make check" to test shared, static lib

2013-11-20 Thread Christian Rössel

Torbjörn,

On 11/13/2013 06:45 PM, Torbjorn Granlund wrote:

We in the GMP project would like to have "make check" run through our
testsuite for both the static and shared libs (when both are built).

We haven't been able to achive this.  Please help.


assuming that you are using libtool, just configure twice, with 
'--enable-static --disable-shared' and '--disable-static 
--enable-shared' respectively. Maybe this is not the solution you are 
looking for, but it is an easy workaround that is trivial to automate; 
and you don't have to touch any Makefile.am.


Hope that helps,
Christian


Torbjörn






Re: Error when using make distcheck

2013-11-20 Thread Roger Leigh
On Wed, Nov 20, 2013 at 09:05:57AM +1000, Peter Johansson wrote:
> On 11/20/2013 06:45 AM, jerome hamm wrote:
> >Hi,
> >
> >I am trying to pack some software using udev rules, which therefore needs
> >to copy some files to /lib/udev/rules.d.
> >When I try and run make distcheck, at the step where it must  install the
> >files in /lib/udev/rules.d it hopelessly fails because of permission issues.
> >
> >My rules (leeched from  the upower project) are the following:
> >
> >udevrules_DATA = \
> >95-evvgc.rules
> >
> ># UDEV for device permission acces setting
> >AC_ARG_WITH([udevrulesdir],
> > AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev
> >rules]),
> > [],
> > [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir
> >udev)"/rules.d"])
> >AC_SUBST([udevrulesdir], [$with_udevrulesdir])
> >
> >Someone in the #autotools channel told that it should try to copy the files
> >in a subfolder of the test folder (not the system root).
> >What I also don't understand is why it doesn't work when I try fakeroot
> >make distcheck ...
> >What am I doing wrong?
> 
> This sounds more like a question for the automake folks, but have
> you read this section in the Automake manual:
> 
> http://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths

This has been a bug in automake since forever, and a source of massive
frustration.  The fix (to automake) is also very simple.

The assumption automake makes is that everything you want to install
will go under the configured prefix.  While this is a nice ideal,
reality isn't so simple.  Examples:
- udev rules (as above)
- pam configuration (similar)
- nss modules
- any third party loadable modules/plugins
- cups printer drivers

All of the above have a common theme.  The software is installed into the
configured prefix, but it also needs to integrate with other software
which is /already installed into a different prefix/.  If I install it
into my prefix then the other software won't be able to make use of it.
Example: udev isn't going to look in /opt/mypackage/lib/udev/rules.d;
it does need installing to /lib/udev/rules.d.

automake supports this just fine.  It's even already happening outside
this special case if you configure with /usr as the prefix with
/etc as sysconfdir--it's installing outside the prefix.  What's broken
is just "distcheck"; if it set DESTDIR then it would work just fine.
As it is, it overrides prefix in a broken way, causing the above
problems.

In your specific case, because it overrides prefix, and you're not
using prefix in your install path, it still tries to use the full
path.  If it used DESTDIR correctly, it would be able to install it
into a staging directory without trouble.

I've now encountered this in a number of projects, for all of the above
example reasons.  In all cases the project built and distributed fine
but failed distcheck, and our only choice was to not use distcheck.
I've brought the issue up on this list a couple of times, and both times
I was told that what I was doing wasn't supported and was buggy.  BUT...
the important point here is that automake is clearly not supporting the
above use cases, so is falling short of the real needs of many projects.
Can't we just fix distcheck to use DESTDIR when doing the test install
and move on?


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



Re: Want "make check" to test shared, static lib

2013-11-20 Thread Torbjorn Granlund
Christian Rössel  writes:

  assuming that you are using libtool, just configure twice, with
  --enable-static --disable-shared' and '--disable-static
  --enable-shared' respectively. Maybe this is not the solution you are
  looking for, but it is an easy workaround that is trivial to automate;
  and you don't have to touch any Makefile.am.
  
We do just that for our (automated) own testing.  We cannot tell end
users to do that.  (Or, we sure can, but they won't do it,
realistically.)

-- 
Torbjörn