2011/12/5 Mark Wielaard <mjw@redhat.com>
On Mon, Dec 05, 2011 at 05:20:17PM +0700, Serge Pavlov wrote:
> I cloned repository and invoked commands:
>
> autoheader
> aclocal -I m4
> autoconf
> automake -a -c
> ./configure
> make
>
> but eventuallyI get an error:
>
> make[2]: Entering directory `/export/users/svpavlov/repo/elfutils/libcpu'
> m4 -Di386 -DDISASSEMBLER defs/i386 > i386_defs
> sed
> '1,/^%%/d;/^#/d;/^[[:space:]]*$/d;s/[^:]*:\([^[:space:]]*\).*/MNE(\1)/;s/{[^}]*}//g;/INVALID/d'
> \
>   i386_defs | sort -u > i386.mnemonics
> make[2]: *** No rule to make target `i386_dis.h', needed by
> `i386_disasm.o'.  Stop.
>
> What's wrong?

You need to configure with --enable-maintainer-mode when building
from git and not from a release tar ball.

Maybe configure could detect the missing .h files and enable it
by default?

Cheers,

Mark
 
Great idea! The following patch could solve the problem:
 
diff --git a/configure.ac b/configure.ac
index 826e644..ce4a07c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,18 @@ AC_PREREQ(2.63)   dnl Minimum Autoconf version required.
 
 dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
 AM_INIT_AUTOMAKE([gnits 1.8 -Wno-portability dist-bzip2 no-dist-gzip])
-AM_MAINTAINER_MODE
+
+dnl If autogenerated files are absent, set maintainer mode to recreate them
+if [ test -f libcpu/i386_dis.h ]; then
+  use_maintainer_mode=enable
+elif [ test -f libcpu/x86_64_dis.h ]; then
+  use_maintainer_mode=enable
+fi
+if [ -z "$use_maintainer_mode" ]; then
+  AM_MAINTAINER_MODE
+else
+  AM_MAINTAINER_MODE(enable)
+fi
 
 dnl Unique ID for this build.
 MODVERSION="Build on $(hostname) $(date +%FT%R:%S%z)"

Thanks,
--Serge