Autoconf/Automake: How to avoid passing the "check" option to AC_CONFIG_SUBDIRS
Asked Answered
V

2

9

I'm using Autoconf to build my c++ project. It uses third party code which is also built with the help of Autoconf/Automake. So in my configure.ac I've got the following line:

AC_CONFIG_SUBDIRS([subdirectoryname])

Everything works fine, but I also use the feature to let tests be automatically made if make check is executed - which is done by the third party code as well. Because these tests take a while it's annoying to execute them each time I want to test my own code. So is there any way to avoid that the check option is passed to the subdirectory's Makefile?

Update: Overriding check-recursive does not seem to be an option, as my top-level Makefile.am looks (more or less) like this:

SUBDIRS=library src

So disabling checking on this level would also disable the checking inside my src folder. And that's not what I want to achieve. I just want to disable the checking in the library directory.

Virgel answered 30/11, 2011 at 20:5 Comment(0)
J
6

Overriding check-recursive in your Makefile.am should work:

check-recursive:
     @true

or, if you only wanted to check in a specific directory:

check-recursive:
     $(MAKE) -C src check
Jam answered 7/12, 2011 at 20:56 Comment(2)
That's not so easy I think. I added some information about my Makefile.am above.Virgel
Great! Your second option did the job.Virgel
A
0

according to the autoconf manual, it will execute a configure.gnu script in the subdirectory if it finds one. Theoretically that could be a script which adds a --disable-tests or similar option to a call to ./configure

That said, I've yet to get this to work on a project of my own. :-/

Addie answered 7/12, 2011 at 20:42 Comment(3)
Sounds interesting. If you got something, let me know.Virgel
If you are able and going to modify the subdirectory, better put a GNUmakefile in the library directory that does nothing on check and calls Makefile for everything else.Jam
I am not able to modify the contents of the library directory (imported via svn external and so on...). That's the whole clue: I want to configure this from above. Making changes to the library directory would be easy.Virgel

© 2022 - 2024 — McMap. All rights reserved.