Author: simons
Date: 2010-06-24 17:51:31 +0000 (Thu, 24 Jun 2010)
New Revision: 22407

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22407&view=rev

Added:
   nix/trunk/src/bsdiff-4.3/compat-include/
   nix/trunk/src/bsdiff-4.3/compat-include/err.h
Modified:
   nix/trunk/configure.ac
   nix/trunk/src/bsdiff-4.3/Makefile.am

Log:
Fix build of bsdiff-4.3 on machines that don't have <err.h>, such as Solaris.

Changes:

Modified: nix/trunk/configure.ac
===================================================================
--- nix/trunk/configure.ac      2010-06-24 17:51:24 UTC (rev 22406)
+++ nix/trunk/configure.ac      2010-06-24 17:51:31 UTC (rev 22407)
@@ -136,6 +136,10 @@
 AC_LANG_POP(C++)
 
 
+# Check for <err.h>.
+AC_CHECK_HEADER([err.h], [], [bsddiff_compat_include="-Icompat-include"])
+AC_SUBST([bsddiff_compat_include])
+
 # Check whether we have the personality() syscall, which allows us to
 # do i686-linux builds on x86_64-linux machines.
 AC_CHECK_HEADERS([sys/personality.h])

Modified: nix/trunk/src/bsdiff-4.3/Makefile.am
===================================================================
--- nix/trunk/src/bsdiff-4.3/Makefile.am        2010-06-24 17:51:24 UTC (rev 
22406)
+++ nix/trunk/src/bsdiff-4.3/Makefile.am        2010-06-24 17:51:31 UTC (rev 
22407)
@@ -8,4 +8,4 @@
 
 bspatch_LDADD = ${bzip2_lib}
 
-AM_CFLAGS = -O3 ${bzip2_include}
+AM_CFLAGS = -O3 ${bzip2_include} ${bsddiff_compat_include}

Added: nix/trunk/src/bsdiff-4.3/compat-include/err.h
===================================================================
--- nix/trunk/src/bsdiff-4.3/compat-include/err.h                               
(rev 0)
+++ nix/trunk/src/bsdiff-4.3/compat-include/err.h       2010-06-24 17:51:31 UTC 
(rev 22407)
@@ -0,0 +1,12 @@
+/* Simulate BSD's <err.h> functionality. */
+
+#ifndef COMPAT_ERR_H_INCLUDED
+#define COMPAT_ERR_H_INCLUDED 1
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define err(rc,...)  do { fprintf(stderr,__VA_ARGS__); exit(rc); } while(0)
+#define errx(rc,...) do { fprintf(stderr,__VA_ARGS__); exit(rc); } while(0)
+
+#endif

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to