summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc-2.9
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-04-22 12:55:47 +0000
committerLudovic Courtès <ludo@gnu.org>2009-04-22 12:55:47 +0000
commit26c3fe186fc92a08945158a332775c77f19d895b (patch)
treeea819f1c39ac6245d4b8621f61769c3818e25517 /pkgs/development/libraries/glibc-2.9
parenta6b2ffd5f2596f3fc88aece492aa741d17ab4424 (diff)
Glibc 2.9: Have rpcgen(1) look for cpp(1) in $PATH.
svn path=/nixpkgs/branches/stdenv-updates/; revision=15244
Diffstat (limited to 'pkgs/development/libraries/glibc-2.9')
-rw-r--r--pkgs/development/libraries/glibc-2.9/default.nix3
-rw-r--r--pkgs/development/libraries/glibc-2.9/rpcgen-path.patch72
2 files changed, 75 insertions, 0 deletions
diff --git a/pkgs/development/libraries/glibc-2.9/default.nix b/pkgs/development/libraries/glibc-2.9/default.nix
index cbbb98159ca55..84c138a197b60 100644
--- a/pkgs/development/libraries/glibc-2.9/default.nix
+++ b/pkgs/development/libraries/glibc-2.9/default.nix
@@ -43,6 +43,9 @@ stdenv.mkDerivation rec {
 
     /* Make it possible to override the locale-archive in NixOS. */
     ./locale-override.patch
+
+    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
+    ./rpcgen-path.patch
   ];
 
   # `--with-tls --without-__thread' enables support for TLS but causes
diff --git a/pkgs/development/libraries/glibc-2.9/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.9/rpcgen-path.patch
new file mode 100644
index 0000000000000..fbb03dd5fadee
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.9/rpcgen-path.patch
@@ -0,0 +1,72 @@
+By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
+(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
+patch makes it run any `cpp' command found in $PATH.
+
+--- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
++++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
+@@ -79,7 +79,7 @@ static const char *cmdname;
+ 
+ static const char *svcclosetime = "120";
+ static int cppDefined;	/* explicit path for C preprocessor */
+-static const char *CPP = SUNOS_CPP;
++static const char *CPP = "cpp";
+ static const char CPPFLAGS[] = "-C";
+ static char *pathbuf;
+ static int cpp_pid;
+@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
+ static void open_output (const char *infile, const char *outfile);
+ static void add_warning (void);
+ static void clear_args (void);
+-static void find_cpp (void);
+ static void open_input (const char *infile, const char *define);
+ static int check_nettype (const char *name, const char *list_to_check[]);
+ static void c_output (const char *infile, const char *define,
+@@ -327,31 +326,6 @@ clear_args (void)
+   argcount = FIXEDARGS;
+ }
+ 
+-/* make sure that a CPP exists */
+-static void
+-find_cpp (void)
+-{
+-  struct stat buf;
+-
+-  if (stat (CPP, &buf) < 0)
+-    {				/* /lib/cpp or explicit cpp does not exist */
+-      if (cppDefined)
+-	{
+-	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
+-	  crash ();
+-	}
+-      else
+-	{			/* try the other one */
+-	  CPP = SVR4_CPP;
+-	  if (stat (CPP, &buf) < 0)
+-	    {			/* can't find any cpp */
+-	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
+-	      crash ();
+-	    }
+-	}
+-    }
+-}
+-
+ /*
+  * Open input file with given define for C-preprocessor
+  */
+@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
+   switch (cpp_pid)
+     {
+     case 0:
+-      find_cpp ();
+       putarg (0, CPP);
+       putarg (1, CPPFLAGS);
+       addarg (define);
+@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
+       close (1);
+       dup2 (pd[1], 1);
+       close (pd[0]);
+-      execv (arglist[0], (char **) arglist);
++      execvp (arglist[0], (char **) arglist);
+       perror ("execv");
+       exit (1);
+     case -1: