Hi,
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?
Thanks, --Serge
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
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
On Tuesday 06 December 2011 04:14:27 Serge Pavlov wrote:
--- a/configure.ac +++ b/configure.ac
+if [ test -f libcpu/i386_dis.h ]; then
issues: - don't use the brackets as those are m4 quotes and will get removed, and if they weren't, it's invalid shell anyways: if [ test -f foo ] ; then - this doesn't work for out of tree builds as you need to be checking $srcdir - you probably should add an AC_MSG_WARNING that it was enabled, and why
+if [ -z "$use_maintainer_mode" ]; then
test -z "$use_maintainer_mode" -mike
Thank you very much, Mike! I should have been more careful. What about this variant?
diff --git a/configure.ac b/configure.ac index 826e644..37ce12c 100644 --- a/configure.ac +++ b/configure.ac @@ -24,9 +24,28 @@ AC_CONFIG_FILES([config/Makefile]) AC_COPYRIGHT([Copyright (C) 1996-2010 Red Hat, Inc.]) AC_PREREQ(2.63) dnl Minimum Autoconf version required.
+AC_CANONICAL_HOST +AC_CANONICAL_TARGET + 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 +case "${target_cpu}" in + i*86|x86_64) + if test ! -f ${srcdir}/libcpu/i386_dis.h; then + use_maintainer_mode=enable + elif test ! -f ${srcdir}/libcpu/x86_64_dis.h; then + use_maintainer_mode=enable + fi + ;; +esac +if test -z "$use_maintainer_mode"; then + AM_MAINTAINER_MODE +else + AM_MAINTAINER_MODE(enable) + AC_MSG_WARN([Maintainer mode is turned on as libcpu files not found]) +fi
dnl Unique ID for this build. MODVERSION="Build on $(hostname) $(date +%FT%R:%S%z)" @@ -44,9 +63,6 @@ AC_CONFIG_FILES([m4/Makefile]) dnl The RPM spec file. We substitute a few values in the file. AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
- -AC_CANONICAL_HOST - AC_ARG_ENABLE([thread-safety], AS_HELP_STRING([--enable-thread-safety], [enable thread safety of libraries]), use_locks=$enableval, use_locks=no)
As I understand these files (*_dis.h) are needed only for Intel platform?
Thanks, --Serge
2011/12/7 Mike Frysinger vapier@gentoo.org
On Tuesday 06 December 2011 04:14:27 Serge Pavlov wrote:
--- a/configure.ac +++ b/configure.ac
+if [ test -f libcpu/i386_dis.h ]; then
issues:
- don't use the brackets as those are m4 quotes and will get removed, and
if they weren't, it's invalid shell anyways: if [ test -f foo ] ; then
- this doesn't work for out of tree builds as you need to be checking
$srcdir
- you probably should add an AC_MSG_WARNING that it was enabled, and why
+if [ -z "$use_maintainer_mode" ]; then
test -z "$use_maintainer_mode" -mike
On Thu, Dec 08, 2011 at 11:26:11AM -0500, Mike Frysinger wrote:
On Thursday 08 December 2011 06:46:52 Serge Pavlov wrote:
As I understand these files (*_dis.h) are needed only for Intel platform?
iirc, elfutils will build all backends regardless of the system it will be running on. so most likely, you don't want the cpu checks.
Indeed. In general it is fine to manipulate a ELF file from one architure on any other architecture. There are even a couple of testcases that explicitly do so.
Cheers,
Mark
OK, thank you for the clarification. I hope the following patch is correct.
diff --git a/configure.ac b/configure.ac index 826e644..3e855a1 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,20 @@ 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 ${srcdir}/libcpu/i386_dis.h; then + use_maintainer_mode=enable +elif test ! -f ${srcdir}/libcpu/x86_64_dis.h; then + use_maintainer_mode=enable +fi +if test -z "$use_maintainer_mode"; then + AM_MAINTAINER_MODE +else + AM_MAINTAINER_MODE(enable) + AC_MSG_WARN([Maintainer mode is turned on as libcpu files not found]) +fi +
Many thanks, --Serge
2011/12/10 Mark Wielaard mjw@redhat.com
On Thu, Dec 08, 2011 at 11:26:11AM -0500, Mike Frysinger wrote:
On Thursday 08 December 2011 06:46:52 Serge Pavlov wrote:
As I understand these files (*_dis.h) are needed only for Intel
platform?
iirc, elfutils will build all backends regardless of the system it will
be
running on. so most likely, you don't want the cpu checks.
Indeed. In general it is fine to manipulate a ELF file from one architure on any other architecture. There are even a couple of testcases that explicitly do so.
Cheers,
Mark
On Monday 19 December 2011 03:45:56 Serge Pavlov wrote:
--- a/configure.ac +++ b/configure.ac @@ -26,7 +26,20 @@ 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 ${srcdir}/libcpu/i386_dis.h; then
- use_maintainer_mode=enable
+elif test ! -f ${srcdir}/libcpu/x86_64_dis.h; then
- use_maintainer_mode=enable
+fi +if test -z "$use_maintainer_mode"; then
- AM_MAINTAINER_MODE
+else
- AM_MAINTAINER_MODE(enable)
- AC_MSG_WARN([Maintainer mode is turned on as libcpu files not found])
+fi
assuming srcdir is sane, looks like it should work. you should be able to test by doing: # build in tree $ autoreconf -f -i $ rm -f libcpu/{i386,x86_64}_dis.h $ ./configure <make sure maintainer is enabled> $ make <should work>
# build a package $ make distcheck
# build out of tree $ make distclean $ mkdir build $ cd build $ ../configure <maintainer should not be enabled> $ make <should work> -mike
I checked the proposed test sequence. They are successful with the following exceptions:
1. 'make distclean' erases libcpu/*_dis.h files, so the first time the package is built out of tree maintainer mode is enabled. But after 'make distclean' in the build directory and making configure again, maintainer mode isn't set, because 'make distclean' in this case doesn't erase files in source directory.
2. I used 'make check' not 'make distcheck'. The latter fails even on trunk, - some tests fail. It looks like LD_LIBRARY_PATH isn't set properly. When using 'make check' these test pass successfully. Does 'make distcheck' work?
Thanks, --Serge
elfutils-devel@lists.fedorahosted.org