Running Configure From Subdirectory Of Source Tree

Home » Asterisk Users » Running Configure From Subdirectory Of Source Tree
Asterisk Users 3 Comments

Hello everyone,

I would like to seek your advice regarding a build (or rather “configure”)
problem I am running into. For reference, tests are all relative to a build from a 1.8.26.0 tarball, on Debian Wheezy.

I would like to understand if it is possible, and if any of you have tried, to build Asterisk from a subdirectory of the source tree, i.e., from a clean source tree

# mkdir my-build-directory
# cd my-build-directory
# ../configure
# make

I lack a proper amount of knowledge on the matter, but I think that this should be “legit” with a common autotools build toolchain. Tests suggest that (at least in my case) this is not working with

configure: error: cannot find install-sh, install.sh, or shtool in `pwd`

Looking in the configure process in detail, the failure seem to follow the checks (/bin/sh -x output)

+ for ac_dir in ‘`pwd`’ ‘”$srcdir”/`pwd`’

It looks to me that despite checking “`pwd`” leads to a correct behaviour, checking “../`pwd`” is not correct. I seem to understand that this behaviour was introduced in configure.ac at r259848, by adding

AC_CONFIG_AUX_DIR(`pwd`)

The log for the commit reports

———————————————————————-

3 thoughts on - Running Configure From Subdirectory Of Source Tree

  • That’s not something that is likely to be supported. Any configure script in the tree will be run via the top-level build process, as needed. Is there some reason you think you need to run the other configure scripts yourself?

  • 2014-03-05 20:08 GMT+01:00 Jason Parker :

    Hello Jason,

    I admit I naively have yet to consider whether the actual build could work or not, and assumed (for lack of knowledge) it could. By chance, is yours an assumption or you have personally experienced (or know by understanding its inner workings) that the top level make does not perform correctly if the sources lie elsewhere (in this case, in the parent directory)?

    Is there some reason you think you need to run the other

    If your question is related to the origin of the need of configuring and building in a subdirectory, I am in need of building custom Debian packages for Asterisk, and my plan was to use a single source package to build several “monolithic” Asterisk binary packages, each with different configure options and patches to modify/add some functionalities (I
    currently compile and install them manually, and could use some Debian-magic-automation). Debhelper offers a “–builddirectory” option which allows to easily perform such task, and I already successfully used it on more simple software using the autotool build toolchain, but essentially this works as in my “manual”
    example, thus failing.

    Thanks in advance for your advice.

  • Hi

    Again, answering a bit late,

    Why is that, BTW?

    Does the rest of the build system support this? Anyway, the obvious workaround is (cd ..; ./configure) .

    If you can’t use shell and must use an explicit command, add a wrapper script:

    #!/bin/sh cd .. exec ./configure “$@”