I would like to rebuild g++ with my own specific settings.

Here is what I did so far:

sudo aptitude install build-dep g++-4.2
mkdir trial && cd trial
apt-get source g++-4.2

Now I want to configure my specific settings. For g++ this is normally done by e.g.

sh configure --prefix=/home/voku/testing

But unfortunately there is no configure script inside the download directory (and also no configure.ac).

Are there additional steps that I need to get the configure script?

What I am actually looking for is a way to say:

  • get the source
  • apply all the patches you like
  • make that whole stuff ready to build

EDIT: I have also asked on Stack Overflow - but nobody seems to know there.

EDIT: Probably I could run one of the tools that actually create the .deb package for g++.

Afterwards - that's what I assume - there will be the needed configure script.

But that sounds awful:

  • build the g++ .deb package
  • cleanup the whole stuff again
  • then use the generated configure script with my own options
  • then build again

If you want to rebuild the Debian package with different options, it's a bit more complicated, because the Debian packaging of GCC is quite complex. In general, you would look for a configure call in debian/rules, but in the gcc-4.2 source package the interesting action actually happens in debian/rules2. Look for a variable called CONFARGS in there. debian/README.maintainers is also a good read if you want to do serious hacking on the package.

| improve this answer | |
  • I just came back to mention this, but you beat me to it, so +1 instead – Justin Smith Feb 17 '10 at 22:45
  • @Peter: thanks a lot. This is the best answer I have seen so far! – Vokuhila-Oliba Feb 18 '10 at 10:14

Try running autoconf - that is the command that creates the configure script for most applications that use one.


This was a wild goosechase, the right answer was to edit debian/rules2

| improve this answer | |
  • If that is unclear: you run autoconf by going to the source directory and just running autoconf with no arguments - if you have the right version and the right input files are there it just does the rest automatically. – Justin Smith Feb 17 '10 at 21:29
  • @Justin: autoconf tells me: autoconf: configure.in: No such file or directory. Looking around via find . -name configure.in shows nothing. – Vokuhila-Oliba Feb 17 '10 at 21:38
  • any program using configure should have a configure.in file? as a shot in the dark you could try, as explained on this page developers.sun.com/solaris/articles/gnu.html autoscan; mv configure.scan configure.in; aclocal; autoconf – Justin Smith Feb 17 '10 at 21:47
  • @Justin: a file called configure.scan is also not there – Vokuhila-Oliba Feb 17 '10 at 22:04
  • autoscan should output configure.scan automatically – Justin Smith Feb 17 '10 at 22:07

Usually it is


not just


i.e. try

 ./configure  --prefix=/home/voku/non-productive
| improve this answer | |
  • @Nicholaz: There is simply no configure script, nor configure.ac or something similar. Regarding ./configure : that doesn't make a difference once you have the configure script. sh configure does the same. – Vokuhila-Oliba Feb 17 '10 at 17:47
  • why is this getting voted up? he never run "configure", as he said, "sh configure" is identical to "./configure" this answer has nothing to do with his situation. – Justin Smith Feb 18 '10 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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