1

I am using Autoconf and Automake tools, in ordrer to develop/distribute my application.

Everything is working fine right now.

My applications depends on GSL (GNU Scientific Library), so in my configure.ac, I search for it by doing:

PKG_CHECK_MODULES([GSL], [gsl])

But if GSL is missing, the process can not continue.

My idea is the following: include gsl-1.15.tar.gz in the distrubution archive, like this:

  • /
    • 3rdParty/
      • gsl-1.15.tar.gz
    • src/
      • ...
    • configure.ac

And, suppose that the final user doesn't have internet connection, or root access, if GSL is missing, he can not proceed.

Is it possible to write in configure.ac that if GSL is missing, to extract 3rdParty/gsl-1.15.tar.gaz and point to extracted "include" and "lib" directories.

Is it possible ?

Can you help me ?

3
  • 2
    Don't do this: wiki.gentoo.org/wiki/Why_not_bundle_dependencies
    – Jack Kelly
    Mar 25, 2013 at 23:31
  • 2
    The autotools are not a package management system. Do not attempt to use them as such. Mar 27, 2013 at 13:04
  • Plenty of large applications, libraries / frameworks do this. 1) Linux distributions can't even agree on a single package management system - let alone the other Unix/BSD variants. 2) A user doesn't necessarily have the privileges to install packages / libraries system-wide! Sometimes, it's a matter of practicality to be able to get things done. The linked Gentoo article even describes this approach as a compromise.
    – Brett Hale
    Mar 30, 2013 at 0:02

1 Answer 1

0

Since most packages are compressed tarballs, I don't see the point of gsl being distributed as another tarball - just put the source in a subdirectory. The GSL package can then be configured by using AC_CONFIG_SUBDIRS in configure.ac.


The default action of PKG_CHECK_MODULES is to abort if not found. To change this:

PKG_CHECK_MODULES([GSL], [gsl >= 1.15], [gsl_pkg_local=;],
                  [gsl_pkg_local="yes"])

if test "x$gsl_pkg_local" != "xyes" ; then
    AC_CONFIG_SUBDIRS([gsl-1.15])
fi

This assumes you have the gsl-1.15 directory at the top level. There's also nothing special about the gsl_pkg_local variable name - so you can change these things to suit your needs.

5
  • Is it possible to configure it only if GSL is missing from system ?
    – odysseasg
    Mar 26, 2013 at 13:45
  • @odysseasg - sure. I assume it's currently aborting if not found?
    – Brett Hale
    Mar 26, 2013 at 17:03
  • Nice try, but conditionally configuring subdirectories means you have to be very careful with SUBDIRS, DIST_SUBDIRS, and so on to make sure you don't break make dist: stackoverflow.com/questions/15136267/… . Seriously, this way lies madness.
    – Jack Kelly
    Mar 29, 2013 at 22:31
  • @JackKelly - the autotools are meant to make life easy for those installing the software. Not those maintaining it.
    – Brett Hale
    Mar 29, 2013 at 23:33
  • 1
    OK @BrettHale Thank you. It is working but I have a new obstacle: If it configures the local GSL subdir, how to point GSL_CFLAGS and GSL_LIBS to the local correct subdirs ?
    – odysseasg
    Apr 2, 2013 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.