pkgsrc-Users archive

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

Re: building a package -- question about the configure stage

Jan Danielsson wrote:

> - --------
> #include <sys/sysctl.h>
> #endif
> - --------
>    Correct me if I'm wrong, but the HAVE_SYS_SYSCTRL_H is something
> which is defined in the Makefile, through the automake/autoconf tools?

Those HAVE_* macros typically reside in the file config.h, created by
the configure script from I bet nat-pmp.c contains a line

  #include "config.h"

at the start of the file.

>    Then I add a section:
> - --------
> #include <sys/param.h>
> #endif
> - --------
> nat-pmp.c, prior to the #include <sys/sysctl.h> causing the
> compilation error.

Correct, but you also need to add


to if doesn't contain this line already. I _think_ running
"autoheader" (see below) will do this for you.

Personally, I would put the check for HAVE_SYS_PARAM_H _inside_ the
check for HAVE_SYS_SYSCTL_H. That's where your problem occurs now.

>    Assuming this is correct, my next guess is that my change to
> will never do any good, because the configure merely *runs*
> the configure script, without actually generating it from the
> file. So, what I need to do is make sure that the configure
> script is regenerated from the file. (Please stop me if I'm
> completely wrong here).


>    Ergo, I need to run autoconf. The pkgsrc Guide stipulates that I need
> to do something like this:
> - --------
> USE_TOOLS+=     autoconf
>    How are my guesses, so far? Please clear up any misconceptions.

Good reasoning skills, I would say :-)

Actually, the package does not really _depend_ on autoconf and company.
If everything had worked ok, you would not need to have autoconf
installed on your machine, so why should any other user of your finished
Thus, the package for pkgsrc should not depend on autoconf because this
generation of "configure" from "" needs to happen only once,
on your machine.
The software already provides a mostly working "configure" script,
all you have to do is provide patches for (to be sent
upstream when your package is completely finished and their correct
working is verified), and configure.
As soon as a new release of the software appears, the (hopefully)
integrated patch for makes the three patches in pkgsrc

You install autoconf yourself, change, run

  $ aclocal
  $ autoheader
  $ autoconf

inside WRKSRC yourself and put the differences between, and
configure.orig/configure in your package directory "patches".

If you like, you can also take the opportunity to read some more about
autoconf in the info pages supplied by the autoconf package.

  $ info Autoconf

Typing 'q' quits the info program, '?' shows the available keys for


Home | Main Index | Thread Index | Old Index