OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   30-Jun-2007 10:30:36
  Branch: HEAD                             Handle: 2007063009303500

  Added files:
    openpkg-src/ccache      ccache.patch
  Modified files:
    openpkg-src/ccache      ccache.spec

  Log:
    apply patches from upstream vendor CVS

  Summary:
    Revision    Changes     Path
    1.1         +197 -0     openpkg-src/ccache/ccache.patch
    1.25        +3  -1      openpkg-src/ccache/ccache.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/ccache/ccache.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 ccache.patch
  --- /dev/null 2007-06-30 10:30:14 +0200
  +++ ccache.patch      2007-06-30 10:30:36 +0200
  @@ -0,0 +1,197 @@
  +Index: Makefile.in
  +--- Makefile.in.orig 2004-09-13 12:38:30 +0200
  ++++ Makefile.in      2007-06-30 10:27:56 +0200
  +@@ -8,7 +8,9 @@
  + [EMAIL PROTECTED]@
  + 
  + [EMAIL PROTECTED]@
  [EMAIL PROTECTED]@ -I.
  [EMAIL PROTECTED]@ -I.
  ++CFLAGS=$(CPPFLAGS) @CFLAGS@
  [EMAIL PROTECTED]@
  + [EMAIL PROTECTED]@
  + 
  + OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
  +@@ -20,7 +22,7 @@
  + docs: ccache.1 web/ccache-man.html
  + 
  + ccache$(EXEEXT): $(OBJS) $(HEADERS)
  +-    $(CC) $(CFLAGS) -o $@ $(OBJS)
  ++    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
  + 
  + ccache.1: ccache.yo
  +     -yodl2man -o ccache.1 ccache.yo
  +Index: ccache.1
  +--- ccache.1.orig    2004-09-13 12:38:30 +0200
  ++++ ccache.1 2007-06-30 10:27:56 +0200
  +@@ -234,6 +234,16 @@
  + incorrect setting of this debug info rarely causes problems\&. If you
  + strike problems with gdb not using the correct directory then enable
  + this option\&.
  ++.IP
  ++.IP "\fBCCACHE_NOHASH_SIZE_MTIME\fP"
  ++This tells ccache to not hash the real compiler's size and modification
  ++time. Normally this is the mechanism to detect compiler upgrades.
  ++There are situations however, where even though the compiler's size or
  ++modification time has changed you can safely use the cached objects
  ++(e.g. if as part of your build system the compiler is built as well
  ++and the compiler's source has not changed; or if the compiler has only
  ++changes that do not affect code generation). Use this feature only if
  ++you know what you are doing.
  + .IP 
  + .IP "\fBCCACHE_UNIFY\fP" 
  + If you set the environment variable CCACHE_UNIFY
  +Index: ccache.c
  +--- ccache.c.orig    2004-09-13 12:38:30 +0200
  ++++ ccache.c 2007-06-30 10:27:56 +0200
  +@@ -158,9 +158,9 @@
  +     struct stat st1, st2;
  +     int status;
  + 
  +-    x_asprintf(&tmp_stdout, "%s/tmp.stdout.%s", temp_dir, tmp_string());
  +-    x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string());
  +-    x_asprintf(&tmp_hashname, "%s/tmp.hash.%s.o", temp_dir, tmp_string());
  ++    x_asprintf(&tmp_stdout, "%s.tmp.stdout.%s", hashname, tmp_string());
  ++    x_asprintf(&tmp_stderr, "%s.tmp.stderr.%s", hashname, tmp_string());
  ++    x_asprintf(&tmp_hashname, "%s.tmp.%s", hashname, tmp_string());
  + 
  +     args_add(args, "-o");
  +     args_add(args, tmp_hashname);
  +@@ -331,8 +331,12 @@
  +             hash_string(str_basename(args->argv[0]));
  +     }
  + 
  +-    hash_int(st.st_size);
  +-    hash_int(st.st_mtime);
  ++    if (getenv("CCACHE_HASH_COMPILER")) {
  ++            hash_file(args->argv[0]);
  ++    } else if (!getenv("CCACHE_NOHASH_SIZE_MTIME")) {
  ++            hash_int(st.st_size);
  ++            hash_int(st.st_mtime);
  ++    }
  + 
  +     /* possibly hash the current working directory */
  +     if (getenv("CCACHE_HASHDIR")) {
  +@@ -640,6 +644,8 @@
  + 
  +             /* these are too hard */
  +             if (strcmp(argv[i], "-fbranch-probabilities")==0 ||
  ++                strcmp(argv[i], "-coverage") == 0 ||
  ++                strcmp(argv[i], "-ftest-coverage") == 0 ||
  +                 strcmp(argv[i], "-M") == 0 ||
  +                 strcmp(argv[i], "-MM") == 0 ||
  +                 strcmp(argv[i], "-x") == 0) {
  +Index: ccache.h
  +--- ccache.h.orig    2004-09-13 12:38:30 +0200
  ++++ ccache.h 2007-06-30 10:27:56 +0200
  +@@ -6,11 +6,10 @@
  + #include <unistd.h>
  + #include <stdlib.h>
  + #include <errno.h>
  +-#include <sys/stat.h>
  + #include <sys/types.h>
  ++#include <sys/stat.h>
  + #include <sys/wait.h>
  + #include <sys/mman.h>
  +-#include <sys/file.h>
  + #include <fcntl.h>
  + #include <time.h>
  + #include <string.h>
  +@@ -19,6 +18,7 @@
  + #include <stdarg.h>
  + #include <dirent.h>
  + #include <limits.h>
  ++#include <sys/file.h>
  + #ifdef HAVE_PWD_H
  + #include <pwd.h>
  + #endif
  +Index: cleanup.c
  +--- cleanup.c.orig   2003-09-28 06:48:17 +0200
  ++++ cleanup.c        2007-06-30 10:27:56 +0200
  +@@ -57,6 +57,17 @@
  +             free(p);
  +             return;
  +     }
  ++
  ++    if (strstr(fname, ".tmp.") != NULL) {
  ++            /* delete any tmp files older than 1 hour */
  ++            if (st->st_mtime + 3600 < time(NULL)) {
  ++                    unlink(fname);
  ++                    free(p);
  ++                    return;
  ++            }
  ++    }
  ++
  ++
  +     free(p);
  + 
  +     if (num_files == allocated) {
  +Index: config.h.in
  +--- config.h.in.orig 2003-09-28 06:48:17 +0200
  ++++ config.h.in      2007-06-30 10:27:56 +0200
  +@@ -19,6 +19,9 @@
  + /* Define to 1 if you have the `gethostname' function. */
  + #undef HAVE_GETHOSTNAME
  + 
  ++/* Define to 1 if you have the `getpwuid' function. */
  ++#undef HAVE_GETPWUID
  ++
  + /* Define to 1 if you have the <inttypes.h> header file. */
  + #undef HAVE_INTTYPES_H
  + 
  +@@ -31,6 +34,9 @@
  + /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. 
*/
  + #undef HAVE_NDIR_H
  + 
  ++/* Define to 1 if you have the <pwd.h> header file. */
  ++#undef HAVE_PWD_H
  ++
  + /* Define to 1 if you have the `realpath' function. */
  + #undef HAVE_REALPATH
  + 
  +@@ -98,3 +104,8 @@
  + 
  + /* Define _GNU_SOURCE so that we get all necessary prototypes */
  + #undef _GNU_SOURCE
  ++
  ++/* Define on UNIX to activate XPG/5 features.  */
  ++#if !defined(_XOPEN_SOURCE)
  ++# define _XOPEN_SOURCE
  ++#endif
  +Index: util.c
  +--- util.c.orig      2004-09-13 12:38:30 +0200
  ++++ util.c   2007-06-30 10:27:56 +0200
  +@@ -151,7 +151,7 @@
  +     vasprintf(ptr, format, ap);
  +     va_end(ap);
  +     
  +-    if (!ptr) fatal("out of memory in x_asprintf");
  ++    if (!*ptr) fatal("out of memory in x_asprintf");
  + }
  + 
  + /*
  +@@ -187,14 +187,10 @@
  + {
  +     void *p2;
  +     if (!ptr) return x_malloc(size);
  +-    p2 = malloc(size);
  ++    p2 = realloc(ptr, size);
  +     if (!p2) {
  +             fatal("out of memory in x_realloc");
  +     }
  +-    if (ptr) {
  +-            memcpy(p2, ptr, size);
  +-            free(ptr);
  +-    }
  +     return p2;
  + }
  + 
  +@@ -448,7 +444,7 @@
  +             }
  +     }
  + #endif
  +-    fatal("Unable to determine home directory");
  ++    fprintf(stderr, "ccache: Unable to determine home directory");
  +     return NULL;
  + }
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/ccache/ccache.spec
  ============================================================================
  $ cvs diff -u -r1.24 -r1.25 ccache.spec
  --- openpkg-src/ccache/ccache.spec    1 Jan 2007 17:36:59 -0000       1.24
  +++ openpkg-src/ccache/ccache.spec    30 Jun 2007 08:30:35 -0000      1.25
  @@ -33,10 +33,11 @@
   Group:        Development
   License:      GPL
   Version:      2.4
  -Release:      20061013
  +Release:      20070630
   
   #   list of sources
   Source0:      http://samba.org/ftp/ccache/ccache-%{version}.tar.gz
  +Patch0:       ccache.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -61,6 +62,7 @@
   
   %prep
       %setup -q
  +    %patch -p0
   
   %build
       CC="%{l_cc}" \
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to