diff mbox

[v3] Code to allow cros-compilation on chromeOS

Message ID 20170404173722.23696-1-gwendal@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gwendal Grignou April 4, 2017, 5:37 p.m. UTC
- Request LIBTOOL to be used
- Set topbuildir based on a Makefile variable to call libtool
- Use /usr/local instead of /var for xfstest final location
- Move macros from aclocal.m4 to acinclude.m4, aclocal.m4 is autogenerated.
- Use autoconf variables @prefix@, @exec_prefix@.

The regular way of compiling xfstests - make - remains.
But it now runs autoreconf and libtoolize -i to produce a valid
configure.
Verified with 'make install --dry-run' that files are installed at the
same place.
Verified compiling in chromeOS chroot works as well.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---

Changes in v2:
Removal of instal-sh, use of autoreconf

Changes in v3:
Use of @exec_prefix@ variable, unify installation location.

 Makefile             |   7 +-
 acinclude.m4         |  30 ++++++
 aclocal.m4           |  50 ----------
 configure.ac         |   3 +-
 include/builddefs.in |   9 +-
 install-sh           | 259 ---------------------------------------------------
 6 files changed, 41 insertions(+), 317 deletions(-)
 create mode 100644 acinclude.m4
 delete mode 100644 aclocal.m4
 delete mode 100755 install-sh

Comments

Eryu Guan April 6, 2017, 11:18 a.m. UTC | #1
On Tue, Apr 04, 2017 at 10:37:22AM -0700, Gwendal Grignou wrote:
> - Request LIBTOOL to be used
> - Set topbuildir based on a Makefile variable to call libtool
> - Use /usr/local instead of /var for xfstest final location
> - Move macros from aclocal.m4 to acinclude.m4, aclocal.m4 is autogenerated.
> - Use autoconf variables @prefix@, @exec_prefix@.
> 
> The regular way of compiling xfstests - make - remains.
> But it now runs autoreconf and libtoolize -i to produce a valid
> configure.
> Verified with 'make install --dry-run' that files are installed at the
> same place.
> Verified compiling in chromeOS chroot works as well.
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> 
> Changes in v2:
> Removal of instal-sh, use of autoreconf
> 
> Changes in v3:
> Use of @exec_prefix@ variable, unify installation location.
> 
>  Makefile             |   7 +-
>  acinclude.m4         |  30 ++++++
>  aclocal.m4           |  50 ----------
>  configure.ac         |   3 +-
>  include/builddefs.in |   9 +-
>  install-sh           | 259 ---------------------------------------------------
>  6 files changed, 41 insertions(+), 317 deletions(-)
>  create mode 100644 acinclude.m4
>  delete mode 100644 aclocal.m4
>  delete mode 100755 install-sh
> 
> diff --git a/Makefile b/Makefile
> index 30d8747d..994a36ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -76,12 +76,13 @@ clean:  # if configure hasn't run, nothing to clean
>  endif
>  
>  configure: configure.ac
> -	autoheader
> -	autoconf
> +	autoreconf
> +	libtoolize -i
>  
>  include/builddefs include/config.h: configure
>  	./configure \
> -                --libexecdir=/usr/lib
> +                --libexecdir=/usr/lib \
> +                --exec_prefix=/var/lib
>  
>  aclocal.m4::
>  	aclocal --acdir=`pwd`/m4 --output=$@
> diff --git a/acinclude.m4 b/acinclude.m4
> new file mode 100644
> index 00000000..666f4069
> --- /dev/null
> +++ b/acinclude.m4
> @@ -0,0 +1,30 @@
> +dnl Copyright (C) 2016 Free Software Foundation, Inc.
> +dnl This file is free software; the Free Software Foundation
> +dnl gives unlimited permission to copy and/or distribute it,
> +dnl with or without modifications, as long as this notice is preserved.
> +AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
> +  [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
> +    AC_SUBST(have_fiemap)
> +  ])
> +
> +AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
> +  [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
> +    AC_SUBST(have_prctl)
> +  ])
> +
> +AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
> +  [ AC_CHECK_HEADER([linux/fs.h])
> +  ])
> +
> +AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
> +  [ AC_MSG_CHECKING([for fallocate])
> +    AC_TRY_LINK([
> +#define _GNU_SOURCE
> +#define _FILE_OFFSET_BITS 64
> +#include <fcntl.h>
> +#include <linux/falloc.h> ],
> +      [ fallocate(0, 0, 0, 0); ],
> +      [ have_fallocate=true; AC_MSG_RESULT(yes) ],
> +      [ have_fallocate=false; AC_MSG_RESULT(no) ])
> +    AC_SUBST(have_fallocate)
> +  ])
> diff --git a/aclocal.m4 b/aclocal.m4
> deleted file mode 100644
> index f3412e19..00000000
> --- a/aclocal.m4
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -# generated automatically by aclocal 1.11 -*- Autoconf -*-
> -
> -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
> -# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
> -# This file is free software; the Free Software Foundation
> -# gives unlimited permission to copy and/or distribute it,
> -# with or without modifications, as long as this notice is preserved.
> -
> -# This program is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
> -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
> -# PARTICULAR PURPOSE.
> -
> -AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
> -  [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
> -    AC_SUBST(have_fiemap)
> -  ])
> -
> -AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
> -  [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
> -    AC_SUBST(have_prctl)
> -  ])
> -
> -AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
> -  [ AC_CHECK_HEADER([linux/fs.h])
> -  ])
> -
> -AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
> -  [ AC_MSG_CHECKING([for fallocate])
> -    AC_TRY_LINK([
> -#define _GNU_SOURCE
> -#define _FILE_OFFSET_BITS 64
> -#include <fcntl.h>
> -#include <linux/falloc.h> ],
> -      [ fallocate(0, 0, 0, 0); ],
> -      [ have_fallocate=true; AC_MSG_RESULT(yes) ],
> -      [ have_fallocate=false; AC_MSG_RESULT(no) ])
> -    AC_SUBST(have_fallocate)
> -  ])
> -m4_include([m4/multilib.m4])
> -m4_include([m4/package_acldev.m4])
> -m4_include([m4/package_aiodev.m4])
> -m4_include([m4/package_attrdev.m4])
> -m4_include([m4/package_dmapidev.m4])
> -m4_include([m4/package_gdbmdev.m4])
> -m4_include([m4/package_globals.m4])
> -m4_include([m4/package_ssldev.m4])
> -m4_include([m4/package_utilies.m4])
> -m4_include([m4/package_uuiddev.m4])
> -m4_include([m4/package_xfslibs.m4])
> diff --git a/configure.ac b/configure.ac
> index 246f92eb..2d7078bd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1,5 +1,6 @@
>  AC_INIT([xfstests], [1.1.1])
> -AC_PREREQ(2.50)
> +AC_CONFIG_MACRO_DIR([m4])

Sorry, I didn't notice this in last review. But I don't know why this
AC_CONFIG_MACRO_DIR doesn't work on my RHEL6.9 system (it does work on
RHEL7), make reports:

configure.ac:5: error: possibly undefined macro: AC_PACKAGE_GLOBALS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:6: error: possibly undefined macro: AC_PACKAGE_UTILITIES
...

Restoring all the "m4_include" in acinclude.m4 works for me. Just my
data point, not sure what's the proper fix.

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gwendal Grignou April 6, 2017, 11:26 p.m. UTC | #2
On Thu, Apr 6, 2017 at 4:18 AM, Eryu Guan <eguan@redhat.com> wrote:
>
> On Tue, Apr 04, 2017 at 10:37:22AM -0700, Gwendal Grignou wrote:
> > - Request LIBTOOL to be used
> > - Set topbuildir based on a Makefile variable to call libtool
> > - Use /usr/local instead of /var for xfstest final location
> > - Move macros from aclocal.m4 to acinclude.m4, aclocal.m4 is autogenerated.
> > - Use autoconf variables @prefix@, @exec_prefix@.
> >
> > The regular way of compiling xfstests - make - remains.
> > But it now runs autoreconf and libtoolize -i to produce a valid
> > configure.
> > Verified with 'make install --dry-run' that files are installed at the
> > same place.
> > Verified compiling in chromeOS chroot works as well.
> >
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> > ---
> >
> > Changes in v2:
> > Removal of instal-sh, use of autoreconf
> >
> > Changes in v3:
> > Use of @exec_prefix@ variable, unify installation location.
> >
>
> Sorry, I didn't notice this in last review. But I don't know why this
> AC_CONFIG_MACRO_DIR doesn't work on my RHEL6.9 system (it does work on
> RHEL7), make reports:
>
> configure.ac:5: error: possibly undefined macro: AC_PACKAGE_GLOBALS
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> configure.ac:6: error: possibly undefined macro: AC_PACKAGE_UTILITIES

Checking stack overflow
(http://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error/8946674),
is pkg_config installed on your RH6.9 system.

>
> ...
>
> Restoring all the "m4_include" in acinclude.m4 works for me. Just my
> data point, not sure what's the proper fix.
>
> Thanks,
> Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan April 7, 2017, 4:12 a.m. UTC | #3
On Thu, Apr 06, 2017 at 04:26:01PM -0700, Gwendal Grignou wrote:
> On Thu, Apr 6, 2017 at 4:18 AM, Eryu Guan <eguan@redhat.com> wrote:
> >
> > On Tue, Apr 04, 2017 at 10:37:22AM -0700, Gwendal Grignou wrote:
> > > - Request LIBTOOL to be used
> > > - Set topbuildir based on a Makefile variable to call libtool
> > > - Use /usr/local instead of /var for xfstest final location
> > > - Move macros from aclocal.m4 to acinclude.m4, aclocal.m4 is autogenerated.
> > > - Use autoconf variables @prefix@, @exec_prefix@.
> > >
> > > The regular way of compiling xfstests - make - remains.
> > > But it now runs autoreconf and libtoolize -i to produce a valid
> > > configure.
> > > Verified with 'make install --dry-run' that files are installed at the
> > > same place.
> > > Verified compiling in chromeOS chroot works as well.
> > >
> > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> > > ---
> > >
> > > Changes in v2:
> > > Removal of instal-sh, use of autoreconf
> > >
> > > Changes in v3:
> > > Use of @exec_prefix@ variable, unify installation location.
> > >
> >
> > Sorry, I didn't notice this in last review. But I don't know why this
> > AC_CONFIG_MACRO_DIR doesn't work on my RHEL6.9 system (it does work on
> > RHEL7), make reports:
> >
> > configure.ac:5: error: possibly undefined macro: AC_PACKAGE_GLOBALS
> >       If this token and others are legitimate, please use m4_pattern_allow.
> >       See the Autoconf documentation.
> > configure.ac:6: error: possibly undefined macro: AC_PACKAGE_UTILITIES
> 
> Checking stack overflow
> (http://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error/8946674),
> is pkg_config installed on your RH6.9 system.

Yes, it's installed.

# rpm -q pkgconfig
pkgconfig-0.23-9.1.el6.x86_64

Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gwendal Grignou April 7, 2017, 9:41 p.m. UTC | #4
Reading  stack overflow further, the fact AC_PACKAGE_GLOBALS and
AC_PACKAGE_UTILITIES are not defined are just the consequence of the
error.
When all work fine, the autoconfigued ./aclocal.m4 should contains
several m4_include and in particular
m4_include([m4/package_globals.m4])" that will load the definitions
for these macros.
I am shooting in the dark, how ./aclocal.m4 compares between RH7.0 and RH6.9?
What are the revisions of automake, autoconf, m4 andlibtoolize.
Does autoreconf -fi help?

Thanks for your help,
Gwendal.

On Thu, Apr 6, 2017 at 9:12 PM, Eryu Guan <eguan@redhat.com> wrote:
> On Thu, Apr 06, 2017 at 04:26:01PM -0700, Gwendal Grignou wrote:
>> On Thu, Apr 6, 2017 at 4:18 AM, Eryu Guan <eguan@redhat.com> wrote:
>> >
>> > On Tue, Apr 04, 2017 at 10:37:22AM -0700, Gwendal Grignou wrote:
>> > > - Request LIBTOOL to be used
>> > > - Set topbuildir based on a Makefile variable to call libtool
>> > > - Use /usr/local instead of /var for xfstest final location
>> > > - Move macros from aclocal.m4 to acinclude.m4, aclocal.m4 is autogenerated.
>> > > - Use autoconf variables @prefix@, @exec_prefix@.
>> > >
>> > > The regular way of compiling xfstests - make - remains.
>> > > But it now runs autoreconf and libtoolize -i to produce a valid
>> > > configure.
>> > > Verified with 'make install --dry-run' that files are installed at the
>> > > same place.
>> > > Verified compiling in chromeOS chroot works as well.
>> > >
>> > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
>> > > ---
>> > >
>> > > Changes in v2:
>> > > Removal of instal-sh, use of autoreconf
>> > >
>> > > Changes in v3:
>> > > Use of @exec_prefix@ variable, unify installation location.
>> > >
>> >
>> > Sorry, I didn't notice this in last review. But I don't know why this
>> > AC_CONFIG_MACRO_DIR doesn't work on my RHEL6.9 system (it does work on
>> > RHEL7), make reports:
>> >
>> > configure.ac:5: error: possibly undefined macro: AC_PACKAGE_GLOBALS
>> >       If this token and others are legitimate, please use m4_pattern_allow.
>> >       See the Autoconf documentation.
>> > configure.ac:6: error: possibly undefined macro: AC_PACKAGE_UTILITIES
>>
>> Checking stack overflow
>> (http://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error/8946674),
>> is pkg_config installed on your RH6.9 system.
>
> Yes, it's installed.
>
> # rpm -q pkgconfig
> pkgconfig-0.23-9.1.el6.x86_64
>
> Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan April 10, 2017, 9:25 a.m. UTC | #5
On Fri, Apr 07, 2017 at 02:41:59PM -0700, Gwendal Grignou wrote:
> Reading  stack overflow further, the fact AC_PACKAGE_GLOBALS and
> AC_PACKAGE_UTILITIES are not defined are just the consequence of the
> error.
> When all work fine, the autoconfigued ./aclocal.m4 should contains
> several m4_include and in particular
> m4_include([m4/package_globals.m4])" that will load the definitions
> for these macros.
> I am shooting in the dark, how ./aclocal.m4 compares between RH7.0 and RH6.9?

RHEL6.9:
https://paste.fedoraproject.org/paste/EUo-NKzoZPwbIIhn1bjoJF5M1UNdIGYhyRLivL9gydE=

RHEL7.3:
https://paste.fedoraproject.org/paste/SEhryYO0GXT8VIA0-24q8V5M1UNdIGYhyRLivL9gydE=

> What are the revisions of automake, autoconf, m4 andlibtoolize.

[root@eguan-rhel6 xfstests]# rpm -q automake autoconf m4 libtool
automake-1.11.1-4.el6.noarch
autoconf-2.63-5.1.el6.noarch
m4-1.4.13-5.el6.x86_64
libtool-2.2.6-15.5.el6.x86_64

[root@dhcp-66-87-213 xfstests]# rpm -q automake autoconf m4 libtool
automake-1.13.4-3.el7.noarch
autoconf-2.69-11.el7.noarch
m4-1.4.16-10.el7.x86_64
libtool-2.4.2-21.el7_2.x86_64

> Does autoreconf -fi help?

No, autoreconf -fi has the same issue.

> 
> Thanks for your help,
> Gwendal.

Thank you!

Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gwendal Grignou April 19, 2017, 9:59 p.m. UTC | #6
On Mon, Apr 10, 2017 at 2:25 AM, Eryu Guan <eguan@redhat.com> wrote:
> On Fri, Apr 07, 2017 at 02:41:59PM -0700, Gwendal Grignou wrote:
>> Reading  stack overflow further, the fact AC_PACKAGE_GLOBALS and
>> AC_PACKAGE_UTILITIES are not defined are just the consequence of the
>> error.
>> When all work fine, the autoconfigued ./aclocal.m4 should contains
>> several m4_include and in particular
>> m4_include([m4/package_globals.m4])" that will load the definitions
>> for these macros.
>> I am shooting in the dark, how ./aclocal.m4 compares between RH7.0 and RH6.9?
>
> RHEL6.9:
> https://paste.fedoraproject.org/paste/EUo-NKzoZPwbIIhn1bjoJF5M1UNdIGYhyRLivL9gydE=
>
> RHEL7.3:
> https://paste.fedoraproject.org/paste/SEhryYO0GXT8VIA0-24q8V5M1UNdIGYhyRLivL9gydE=

I was out for a while, the pastes seems to have expired.
>
>> What are the revisions of automake, autoconf, m4 andlibtoolize.
>
> [root@eguan-rhel6 xfstests]# rpm -q automake autoconf m4 libtool
> automake-1.11.1-4.el6.noarch
> autoconf-2.63-5.1.el6.noarch
> m4-1.4.13-5.el6.x86_64
> libtool-2.2.6-15.5.el6.x86_64
>
> [root@dhcp-66-87-213 xfstests]# rpm -q automake autoconf m4 libtool
> automake-1.13.4-3.el7.noarch
> autoconf-2.69-11.el7.noarch
> m4-1.4.16-10.el7.x86_64
> libtool-2.4.2-21.el7_2.x86_64

Maybe it is the same problem as explained in
https://lists.gnu.org/archive/html/autoconf/2013-08/msg00013.html.

I submit a patch shortly which calls autoreconf --install=m4.

Gwendal.
>
>> Does autoreconf -fi help?
>
> No, autoreconf -fi has the same issue.
>
>>
>> Thanks for your help,
>> Gwendal.
>
> Thank you!
>
> Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 30d8747d..994a36ca 100644
--- a/Makefile
+++ b/Makefile
@@ -76,12 +76,13 @@  clean:  # if configure hasn't run, nothing to clean
 endif
 
 configure: configure.ac
-	autoheader
-	autoconf
+	autoreconf
+	libtoolize -i
 
 include/builddefs include/config.h: configure
 	./configure \
-                --libexecdir=/usr/lib
+                --libexecdir=/usr/lib \
+                --exec_prefix=/var/lib
 
 aclocal.m4::
 	aclocal --acdir=`pwd`/m4 --output=$@
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 00000000..666f4069
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,30 @@ 
+dnl Copyright (C) 2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
+  [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
+    AC_SUBST(have_fiemap)
+  ])
+
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
+  [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
+    AC_SUBST(have_prctl)
+  ])
+
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
+  [ AC_CHECK_HEADER([linux/fs.h])
+  ])
+
+AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
+  [ AC_MSG_CHECKING([for fallocate])
+    AC_TRY_LINK([
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <fcntl.h>
+#include <linux/falloc.h> ],
+      [ fallocate(0, 0, 0, 0); ],
+      [ have_fallocate=true; AC_MSG_RESULT(yes) ],
+      [ have_fallocate=false; AC_MSG_RESULT(no) ])
+    AC_SUBST(have_fallocate)
+  ])
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index f3412e19..00000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,50 +0,0 @@ 
-# generated automatically by aclocal 1.11 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
-  [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
-    AC_SUBST(have_fiemap)
-  ])
-
-AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
-  [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
-    AC_SUBST(have_prctl)
-  ])
-
-AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
-  [ AC_CHECK_HEADER([linux/fs.h])
-  ])
-
-AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
-  [ AC_MSG_CHECKING([for fallocate])
-    AC_TRY_LINK([
-#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
-#include <fcntl.h>
-#include <linux/falloc.h> ],
-      [ fallocate(0, 0, 0, 0); ],
-      [ have_fallocate=true; AC_MSG_RESULT(yes) ],
-      [ have_fallocate=false; AC_MSG_RESULT(no) ])
-    AC_SUBST(have_fallocate)
-  ])
-m4_include([m4/multilib.m4])
-m4_include([m4/package_acldev.m4])
-m4_include([m4/package_aiodev.m4])
-m4_include([m4/package_attrdev.m4])
-m4_include([m4/package_dmapidev.m4])
-m4_include([m4/package_gdbmdev.m4])
-m4_include([m4/package_globals.m4])
-m4_include([m4/package_ssldev.m4])
-m4_include([m4/package_utilies.m4])
-m4_include([m4/package_uuiddev.m4])
-m4_include([m4/package_xfslibs.m4])
diff --git a/configure.ac b/configure.ac
index 246f92eb..2d7078bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@ 
 AC_INIT([xfstests], [1.1.1])
-AC_PREREQ(2.50)
+AC_CONFIG_MACRO_DIR([m4])
+LT_INIT
 AC_CONFIG_SRCDIR([src/xfsctl.c])
 AC_PACKAGE_GLOBALS(xfstests)
 AC_PACKAGE_UTILITIES(xfstests)
diff --git a/include/builddefs.in b/include/builddefs.in
index 24f838f5..b08f1211 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -7,6 +7,8 @@ 
 ifndef _BUILDDEFS_INCLUDED_
 _BUILDDEFS_INCLUDED_ = 1
 
+top_builddir=$(TOPDIR)
+
 DEBUG = @debug_build@
 OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
@@ -24,6 +26,7 @@  LIBUUID = @libuuid@
 LIBHANDLE = @libhdl@
 LIBDM = @libdm@
 LIBTEST = $(TOPDIR)/lib/libtest.la
+prefix = @prefix@
 
 PKG_NAME        = @pkg_name@
 PKG_USER        = @pkg_user@
@@ -32,10 +35,8 @@  PKG_RELEASE     = @pkg_release@
 PKG_VERSION     = @pkg_version@
 PKG_PLATFORM    = @pkg_platform@
 PKG_DISTRIBUTION= @pkg_distribution@
-PKG_SBIN_DIR    = @sbindir@
-# A bit of a hack; by rights only state should probably go here
-# But for now ...
-PKG_LIB_DIR     = /var/lib/@pkg_name@
+PKG_LIB_DIR     = $(DESTDIR)@exec_prefix@/@pkg_name@
+
 
 CC              = @cc@
 AWK             = @awk@
diff --git a/install-sh b/install-sh
deleted file mode 100755
index 58e7b586..00000000
--- a/install-sh
+++ /dev/null
@@ -1,259 +0,0 @@ 
-#! /bin/bash
-#
-# Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#
-# This script emulates bsd install and also recognises
-# two environment variables, with the following semantics :-
-#
-# $DIST_MANIFEST - if set, the name of the file to append manifest
-#                  information in the following format:
-#                  File     :  f mode owner group src target
-#                  Directory:  d mode owner group target
-#                  Symlink  :  l linkval target
-#
-# $DIST_ROOT     - if set, prepend to target
-#
-# The sematics of all combinations of these two variables
-# are as follows:
-#
-# $DIST_MANIFEST?  $DIST_ROOT? |   Copy?  Append Manifest?
-# -----------------------------+--------------------------
-#       not set       not set  |    yes        no
-#       not set       set      |    yes        no
-#       set           not set  |    no         yes
-#       set           set      |    yes        yes
-#
-_usage() {
-    echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory"
-    echo "or     $prog [-D] [-o owner] [-g group] [-m mode] file directory/file"
-    echo "or     $prog [-o owner] [-g group] [-m mode] file [file ...] directory"
-    echo "or     $prog -S file target  (creates \"target\" symlink)"
-    echo ""
-    echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the"
-    echo "behaviour of this command - see comments in the script."
-    echo "The -D flag is only available for the second usage, and causes"
-    echo "the target directory to be created before installing the file."
-    echo ""
-    exit 1
-}
-
-_chown ()
-{
-    _st=255
-    if [ $# -eq 3 ] ; then
-	chown $1:$2 $3
-	_st=$?
-	if [ $_st -ne 0 ] ; then
-	    if [ $REAL_UID != '0' ] ; then
-		if [ ! -f $DIST_ROOT/.chown.quite ] ; then
-		    echo '==============================================='
-		    echo Ownership of files under ${DIST_ROOT:-/}
-		    echo cannot be changed
-		    echo '==============================================='
-		    if [ -n "$DIST_ROOT" ] ; then
-			touch $DIST_ROOT/.chown.quite
-		    fi
-		fi
-	       _st=0
-	    fi     
-	fi
-    fi
-
-    return $_st
-}
-
-
-_manifest ()
-{ 
-    echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null}
-}
-
-prog=`basename $0`
-HERE=`pwd`
-dflag=false
-Dflag=false
-Sflag=false
-DIRMODE=755
-FILEMODE=644
-OWNER=`id -u`
-GROUP=`id -g`
-REAL_UID=$OWNER
-
-# default is to install and don't append manifest
-INSTALL=true
-MANIFEST=:
-
-: ${DIST_ROOT:=${DESTDIR}}
-
-[ -n "$DIST_MANIFEST" -a -z "$DIST_ROOT" ] && INSTALL=false
-[ -n "$DIST_MANIFEST" ] && MANIFEST="_manifest"
-
-[ $# -eq 0 ] && _usage
-
-if $INSTALL
-then
-    CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown
-else
-    CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true
-fi
-
-[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true
-
-while getopts "Dcm:d:S:o:g:" c $*
-do
-   case $c in
-   c)
-	;;
-   g)
-	GROUP=$OPTARG
-	;;
-   o)
-	OWNER=$OPTARG
-	;;
-   m)
-	DIRMODE=`expr $OPTARG`
-	FILEMODE=$DIRMODE
-	;;
-   D) 
-	Dflag=true
-	;;
-   S) 
-	symlink=$OPTARG
-	Sflag=true
-	;;
-   d) 
-	dir=$DIST_ROOT/$OPTARG
-	dflag=true
-	;;
-   *)
-   	_usage
-	;;
-   esac
-done
-
-shift `expr $OPTIND - 1`
-
-status=0
-if $dflag
-then
-    #
-    # first usage
-    #
-    $MKDIR -p $dir 
-    status=$?
-    if [ $status -eq 0 ]
-    then
-	$CHMOD $DIRMODE $dir
-	status=$?
-    fi
-    if [ $status -eq 0 ]
-    then
-	$CHOWN $OWNER $GROUP $dir
-	status=$?
-    fi
-    $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT}
-elif $Sflag
-then
-    #
-    # fourth usage (symlink)
-    #
-    if [ $# -ne 1 ]
-    then
-    	_usage
-    else
-    	target=$DIST_ROOT/$1
-    fi
-    $LN -s -f $symlink $target
-    status=$?
-    $MANIFEST l $symlink ${target#$DIST_ROOT} 
-else
-    list=""
-    dir=""
-    if [ $# -eq 2 ]
-    then
-	#
-	# second usage
-	#
-	f=$1
-	dir=$DIST_ROOT/$2
-	if $Dflag
-	then
-	    mkdir -p `dirname $dir`
-	fi
-	$CP $f $dir
-	status=$?
-	if [ $status -eq 0 ]
-	then 
-	    if [ -f $dir/$f ]
-	    then
-		$CHMOD $FILEMODE $dir/$f
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir/$f
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
-	    else
-		$CHMOD $FILEMODE $dir
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT}
-	    fi
-	fi
-    else
-	#
-	# third usage
-	#
-	n=1
-	while [ $# -gt 0 ]
-	do
-	    if [ $# -gt 1 ]
-	    then
-		list="$list $1"
-	    else
-		dir=$DIST_ROOT/$1
-	    fi
-	    shift
-	done
-
-	# echo DIR=$dir list=\"$list\"
-	for f in $list
-	do
-	    $CP $f $dir
-	    status=$?
-	    if [ $status -eq 0 ]
-	    then
-		$CHMOD $FILEMODE $dir/$f
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir/$f
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
-	    fi
-	    [ $status -ne 0 ] && break
-	done
-    fi
-fi
-
-exit $status