Repository: spack/spack

Issue:
Cannot build elfutils
With the current head (b5eb298f3efde1ae32545a3363bed46e1811ab76) 

```
$ spack install elfutils
==> Installing elfutils
==> Using cached archive: ~/Documents/git/spack/var/spack/cache/elfutils/elfutils-0.163.tar.bz2
==> Already staged elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3 in ~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3
==> Already patched elfutils
==> Building elfutils [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Error: ProcessError: Command exited with status 1:
    '~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3/elfutils-0.163/configure' '--prefix=~/Documents/git/spack/opt/spack/linux-debian8-x86_64/gcc-4.9.2/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3' '--enable-maintainer-mode'
~/Documents/git/spack/lib/spack/spack/build_systems/autotools.py:266, in configure:
     258      def configure(self, spec, prefix):
     259          """Runs configure with the arguments specified in
     260          :py:meth:`~.AutotoolsPackage.configure_args`
     261          and an appropriately set prefix.
     262          """
     263          options = ['--prefix={0}'.format(prefix)] + self.configure_args()
     264  
     265          with working_dir(self.build_directory, create=True):
  >> 266              inspect.getmodule(self).configure(*options)

See build log for details:
  ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out
```
```
$ tail ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of long... 8
checking for struct user_regs_struct... yes
checking ~/Documents/git/spack/lib/spack/env/gcc/gcc option for 32-bit word size... -m32
checking for 64-bit host... yes
checking whether ~/Documents/git/spack/lib/spack/env/gcc/gcc -m32 makes executables we can run... yes
checking for flex... no
configure: error: flex needed in maintainer mode
```
Adding ```depends_on('flex')``` leads to 
```
configure: error: bison needed in maintainer mode
```

Is this a know issue? How do I fix this?


Discussion:
Why do we build in maintainer mode?

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py
--- a/var/spack/repos/builtin/packages/elfutils/package.py
+++ b/var/spack/repos/builtin/packages/elfutils/package.py
@@ -35,14 +35,22 @@ class Elfutils(AutotoolsPackage):
 
     homepage = "https://fedorahosted.org/elfutils/"
 
-    url      = "https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2"
+    url = "https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2"
     list_url = "https://sourceware.org/elfutils/ftp"
     list_depth = 1
 
+    version('0.170', '03599aee98c9b726c7a732a2dd0245d5')
     version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')
     version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)
 
+    depends_on('flex', type='build')
+    depends_on('bison', type='build')
+    depends_on('gettext')
+
     provides('elf@1')
 
     def configure_args(self):
-        return ['--enable-maintainer-mode']
+        # configure doesn't use LIBS correctly
+        return [
+            'LDFLAGS=-L%s -lintl' % self.spec['gettext'].prefix.lib,
+            '--enable-maintainer-mode']


Test patch: