All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Perkin <jperkin@joyent.com>
To: dash@vger.kernel.org
Subject: [PATCH] [SHELL] Fix 64-bit Solaris build
Date: Fri, 11 Dec 2015 13:07:14 +0000	[thread overview]
Message-ID: <20151211130714.GD54973@joyent.com> (raw)

In a 64-bit Solaris environment there is no stat64() function, only
stat().  This conflicts with the stat64 #define used to support
dietlibc/klibc when stat64() is not found and results in:

  ./../config.h:194:16: error: redefinition of 'struct stat'
   #define stat64 stat
                ^
  In file included from cd.c:36:0:
  /usr/include/sys/stat.h:217:8: note: originally defined here
   struct stat {
          ^

Instead, add a AC_CHECK_DECL test for stat64, and only perform the
AC_CHECK_FUNC test if it isn't already defined.
---
 configure.ac | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8ae0dc6..f4c9b87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,10 +139,12 @@ if test "$ac_cv_func_signal" != yes; then
 fi
 
 dnl Check for stat64 (dietlibc/klibc).
-AC_CHECK_FUNC(stat64,, [
-	AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit])
-	AC_DEFINE(lstat64, lstat, [64-bit operations are the same as 32-bit])
-	AC_DEFINE(stat64, stat, [64-bit operations are the same as 32-bit])
+AC_CHECK_DECL(stat64,,[
+	AC_CHECK_FUNC(stat64,, [
+		AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit])
+		AC_DEFINE(lstat64, lstat, [64-bit operations are the same as 32-bit])
+		AC_DEFINE(stat64, stat, [64-bit operations are the same as 32-bit])
+	])
 ])
 
 AC_CHECK_FUNC(open64,, [
-- 
2.4.9 (Apple Git-60)

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com

             reply	other threads:[~2015-12-11 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 13:07 Jonathan Perkin [this message]
2016-06-06 14:27 ` [SHELL] Fix 64-bit Solaris build Herbert Xu
2016-06-06 15:22   ` Jonathan Perkin
2016-06-07  6:50     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151211130714.GD54973@joyent.com \
    --to=jperkin@joyent.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.