xfs
[Top] [All Lists]

PATCH: xfsprogs-1.3.1/configure.in - Cross Compilation

To: <linux-xfs@xxxxxxxxxxx>
Subject: PATCH: xfsprogs-1.3.1/configure.in - Cross Compilation
From: Grant Erickson <gerickso@xxxxxxxxxxx>
Date: Fri, 3 Aug 2001 10:31:44 -0700 (PDT)
Cc: <lord@xxxxxxx>
Reply-to: Grant Erickson <gerickson@xxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
Below is a patch to allow the xfsprogs-1.3.1/configure script to work
correctly (at least mostly correctly) when cross-compiling from
sparc-sun-solaris to powerpc-linux-gnu. The idea and code is
lifted, more or less, wholesale from e2fsprogs-1.22:

--- xfsprogs-1.3.1/configure.in Thu Jul 12 11:54:37 2001
+++ xfsprogs/configure.in       Fri Aug  3 10:18:47 2001
@@ -45,7 +45,7 @@
 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
 AC_SUBST(pkg_distribution)

-pkg_builder=`id -u -n`@`hostname -f`
+pkg_builder=`id -u -n`@`hostname`
 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
 AC_SUBST(pkg_builder)

@@ -166,37 +166,21 @@
     __psunsigned_t  psuint;
 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))

-
-dnl check sizeof long
-AC_MSG_CHECKING([sizeof long])
-cat <<End-of-File >conftest.c
-#include <stdio.h>
-main() { printf("%d\n", sizeof(long)); }
-End-of-File
-(eval $ac_compile) 2>&5
-(eval $ac_link) 2>&5
-ans=`./conftest`
-echo "./conftest -> \"$ans\"" >&5
-AC_MSG_RESULT($ans)
-test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
-test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
-rm -f conftest conftest.*
-
-dnl check sizeof pointer
-AC_MSG_CHECKING([sizeof pointer])
-cat <<End-of-File >conftest.c
-#include <stdio.h>
-main() { printf("%d\n", sizeof(char *)); }
-End-of-File
-(eval $ac_compile) 2>&5
-(eval $ac_link) 2>&5
-ans=`./conftest`
-echo "./conftest -> \"$ans\"" >&5
-AC_MSG_RESULT($ans)
-test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
-test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
-rm -f conftest conftest.*
-
+dnl
+dnl Check type sizes
+dnl
+if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
+  # if cross-compiling, with no cached values, just assume something common.
+  ac_cv_sizeof_long=4
+  ac_cv_sizeof_char_p=4
+  AC_MSG_WARN([Cross-compiling; cannot check type sizes; assuming long=4 
ponter=4])
+fi
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(char *)
+test $ac_cv_sizeof_long -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
+test $ac_cv_sizeof_long -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
+test $ac_cv_sizeof_char_p -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
+test $ac_cv_sizeof_char_p -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)

 dnl alternate root and usr prefixes
 test -z "$ROOT_PREFIX" && ROOT_PREFIX=""

-- 
Grant Erickson                            Phone:  (408) 487-8087
Brocade Communications Systems, Inc.      Fax:    (408) 392-1702
1745 Technology Drive
San Jose, CA 95110                        E-mail: gerickson@xxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>