Merge branch 'js/compat-itimer'
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:21:44 +0000 (14:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:21:44 +0000 (14:21 -0700)
Pieces to support compilation on __TANDEM.

* js/compat-itimer:
Add a no-op setitimer() wrapper

1  2 
Makefile
git-compat-util.h
diff --combined Makefile
index 99157da2df475d3e7869472646528f705b3cc198,f93bf1959ae47fabd0e927aa4876ea3b135f2623..56301dc0a80db5085400436bab3346f2dbdd5321
+++ b/Makefile
@@@ -90,8 -90,6 +90,8 @@@ all:
  #
  # Define NO_MKDTEMP if you don't have mkdtemp in the C library.
  #
 +# Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash.
 +#
  # Define NO_MKSTEMPS if you don't have mkstemps in the C library.
  #
  # Define NO_STRTOK_R if you don't have strtok_r in the C library.
  # Define NO_PREAD if you have a problem with pread() system call (e.g.
  # cygwin1.dll before v1.5.22).
  #
+ # Define NO_SETITIMER if you don't have setitimer()
+ #
+ # Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
+ # This also implies NO_SETITIMER
+ #
  # Define NO_THREAD_SAFE_PREAD if your pread() implementation is not
  # thread-safe. (e.g. compat/pread.c or cygwin)
  #
@@@ -498,7 -501,6 +503,7 @@@ TEST_PROGRAMS_NEED_X += test-mergesor
  TEST_PROGRAMS_NEED_X += test-mktemp
  TEST_PROGRAMS_NEED_X += test-parse-options
  TEST_PROGRAMS_NEED_X += test-path-utils
 +TEST_PROGRAMS_NEED_X += test-regex
  TEST_PROGRAMS_NEED_X += test-revision-walking
  TEST_PROGRAMS_NEED_X += test-run-command
  TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
@@@ -1642,10 -1644,6 +1647,10 @@@ ifdef NO_MKDTEM
        COMPAT_CFLAGS += -DNO_MKDTEMP
        COMPAT_OBJS += compat/mkdtemp.o
  endif
 +ifdef MKDIR_WO_TRAILING_SLASH
 +      COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
 +      COMPAT_OBJS += compat/mkdir.o
 +endif
  ifdef NO_MKSTEMPS
        COMPAT_CFLAGS += -DNO_MKSTEMPS
  endif
@@@ -1677,6 -1675,13 +1682,13 @@@ endi
  ifdef OBJECT_CREATION_USES_RENAMES
        COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1
  endif
+ ifdef NO_STRUCT_ITIMERVAL
+       COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
+       NO_SETITIMER=YesPlease
+ endif
+ ifdef NO_SETITIMER
+       COMPAT_CFLAGS += -DNO_SETITIMER
+ endif
  ifdef NO_PREAD
        COMPAT_CFLAGS += -DNO_PREAD
        COMPAT_OBJS += compat/pread.o
@@@ -2812,13 -2817,8 +2824,13 @@@ endi
  
  ### Check documentation
  #
 +ALL_COMMANDS = $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS)
 +ALL_COMMANDS += git
 +ALL_COMMANDS += gitk
 +ALL_COMMANDS += gitweb
 +ALL_COMMANDS += git-gui git-citool
  check-docs::
 -      @(for v in $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk; \
 +      @(for v in $(ALL_COMMANDS); \
        do \
                case "$$v" in \
                git-merge-octopus | git-merge-ours | git-merge-recursive | \
                sed -e '/^#/d' \
                    -e 's/[     ].*//' \
                    -e 's/^/listed /' command-list.txt; \
 -              ls -1 Documentation/git*txt | \
 +              $(MAKE) -C Documentation print-man1 | \
 +              grep '\.txt$$' | \
                sed -e 's|Documentation/|documented |' \
                    -e 's/\.txt//'; \
        ) | while read how cmd; \
        do \
 -              case "$$how,$$cmd" in \
 -              *,git-citool | \
 -              *,git-gui | \
 -              *,git-help | \
 -              documented,gitattributes | \
 -              documented,gitignore | \
 -              documented,gitmodules | \
 -              documented,gitcli | \
 -              documented,git-tools | \
 -              documented,gitcore-tutorial | \
 -              documented,gitcvs-migration | \
 -              documented,gitdiffcore | \
 -              documented,gitglossary | \
 -              documented,githooks | \
 -              documented,gitrepository-layout | \
 -              documented,gitrevisions | \
 -              documented,gittutorial | \
 -              documented,gittutorial-2 | \
 -              documented,git-bisect-lk2009 | \
 -              documented,git-remote-helpers | \
 -              documented,gitworkflows | \
 -              sentinel,not,matching,is,ok ) continue ;; \
 -              esac; \
 -              case " $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk " in \
 +              case " $(ALL_COMMANDS) " in \
                *" $$cmd "*)    ;; \
                *) echo "removed but $$how: $$cmd" ;; \
                esac; \
diff --combined git-compat-util.h
index fd732d7243a9266302751189c32a57fd441a671d,3515366b129b7343d15c67bc8e4fe3c83e0b1f7d..24b5432462234ee25123cb5aa96222bab0f9e28f
  #define probe_utf8_pathname_composition(a,b)
  #endif
  
 +#ifdef MKDIR_WO_TRAILING_SLASH
 +#define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
 +extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
 +#endif
 +
+ #ifdef NO_STRUCT_ITIMERVAL
+ struct itimerval {
+       struct timeval it_interval;
+       struct timeval it_value;
+ }
+ #endif
+ #ifdef NO_SETITIMER
+ #define setitimer(which,value,ovalue)
+ #endif
  #ifndef NO_LIBGEN_H
  #include <libgen.h>
  #else
@@@ -609,12 -615,6 +620,12 @@@ int rmdir_or_warn(const char *path)
   */
  int remove_or_warn(unsigned int mode, const char *path);
  
 +/* Call access(2), but warn for any error besides ENOENT. */
 +int access_or_warn(const char *path, int mode);
 +
 +/* Warn on an inaccessible file that ought to be accessible */
 +void warn_on_inaccessible(const char *path);
 +
  /* Get the passwd entry for the UID of the current process. */
  struct passwd *xgetpwuid_self(void);