[PATCH] Code to allow cros-compilation on chromeOS

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



- 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.

TEST=Compile in chromeOS chroot.
TEST=Using a snippet of build-all at https://github.com/tytso/xfstests-bld
After adding config.sub and config.guess with:
cp /usr/share/misc/config.sub /usr/share/misc/config.guess
Verified that compilation of xfstest works:
ver=$(git describe --always --dirty); echo "xfstests       $ver ($(git log -1 --pretty=%cD))" > ../xfstests.ver ;
autoheader ; autoconf ;
CFLAGS="$LCF -I$DESTDIR/include -fno-stack-protector"
CPPFLAGS="-I$DESTDIR/include"
LDFLAGS="$LLF -static -L$DESTDIR/lib"
LIBS=-lpthread
./configure
make -j40 LLDFLAGS=$EXEC_LLDFLAGS LIBTOOL="/usr/bin/libtool --tag=CC" BUILD_VERBOSE=1

Signed-off-by: Gwendal Grignou <gwendal@xxxxxxxxxxxx>
---
 acinclude.m4         | 30 ++++++++++++++++++++++++++++++
 aclocal.m4           | 50 --------------------------------------------------
 configure.ac         |  3 ++-
 include/builddefs.in |  7 +++++++
 4 files changed, 39 insertions(+), 51 deletions(-)
 create mode 100644 acinclude.m4
 delete mode 100644 aclocal.m4

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 fa48d2f8..d8393b1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@
 AC_INIT([xfstests], [1.1.1])
-AC_PREREQ(2.50)
+AC_CONFIG_MACRO_DIRS([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..48d35311 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@
@@ -35,7 +37,12 @@ PKG_DISTRIBUTION= @pkg_distribution@
 PKG_SBIN_DIR    = @sbindir@
 # A bit of a hack; by rights only state should probably go here
 # But for now ...
+ifdef DESTDIR
+PKG_LIB_DIR     = $(DESTDIR)/usr/local/@pkg_name@
+else
 PKG_LIB_DIR     = /var/lib/@pkg_name@
+endif
+
 
 CC              = @cc@
 AWK             = @awk@
-- 
2.12.0.367.g23dc2f6d3c-goog

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux