[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sharutils 4.8 has been released
From: |
Bruce Korb |
Subject: |
Re: sharutils 4.8 has been released |
Date: |
Sun, 21 Feb 2010 16:14:15 -0800 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Eric Blake wrote:
> This package is broken on non-glibc machines, because it tries to use the
> non-existent gnu_basename (provided by a macro in basename.h).
One of the patches I applied today passed a mode of "rb" to popen().
I guess the Linux flavor of fopen() can handle that, but popen() cannot.
So I am using the test below as an indicator for selecting the string
to use for all FILE* open functions. You may wish to tweak the gnulib
flavor of popen() to strip out the 'b' when it is not needed.
Index: configure.ac
===================================================================
RCS file: /sources/sharutils/sharutils/configure.ac,v
retrieving revision 1.46
diff -u -p -r1.46 configure.ac
--- configure.ac 21 Feb 2010 23:24:56 -0000 1.46
+++ configure.ac 22 Feb 2010 00:08:58 -0000
@@ -114,6 +114,13 @@ AM_WITH_DMALLOC
CATALOGS="$new_CATALOGS"
fi]
+AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [dnl
+ FILE * fp = popen ("date", "rb");
+ exit (fp == NULL);])],
+ [AC_DEFINE([BINARY_MODE_POPEN], [1], [define if popen supports "rb" mode])]
+)
+
AC_DEFINE(_GNU_SOURCE, 1, [Make sure we see all GNU extensions.])
AH_TOP([#ifndef SHARUTILS_CONFIG_H])
On my Linux box, "BINARY_MODE_POPEN" does not get defined, so:
#ifdef BINARY_MODE_POPEN
static char const freadonly_mode[] = "rb";
static char const fwriteonly_mode[] = "wb";
#else
static char const freadonly_mode[] = "r";
static char const fwriteonly_mode[] = "w";
#endif