]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'ab/compat-regex'
authorJunio C Hamano <gitster@pobox.com>
Fri, 3 Sep 2010 16:43:45 +0000 (09:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Sep 2010 16:43:45 +0000 (09:43 -0700)
* ab/compat-regex:
  Fix compat/regex ANSIfication on MinGW
  autoconf: regex library detection typofix
  autoconf: don't use platform regex if it lacks REG_STARTEND
  t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND
  compat/regex: get rid of old-style definition
  compat/regex: define out variables only used under RE_ENABLE_I18N
  Change regerror() declaration from K&R style to ANSI C (C89)
  compat/regex: get the gawk regex engine to compile within git
  compat/regex: use the regex engine from gawk for compat

Conflicts:
compat/regex/regex.c

1  2 
Makefile
config.mak.in
configure.ac

diff --combined Makefile
index 32e3eb385d82126396c452f43b1fa70d5a7b4321,09b03c003336b40e7765cbd529b91977580e880e..40fbcaee9378db51ed22d0511b52a62b774cac45
+++ b/Makefile
@@@ -68,8 -68,6 +68,8 @@@ all:
  #
  # 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_LIBGEN_H if you don't have libgen.h.
  #
  # Define NEEDS_LIBGEN if your libgen needs -lgen when linking
@@@ -410,17 -408,12 +410,17 @@@ TEST_PROGRAMS_NEED_X += test-dat
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
  TEST_PROGRAMS_NEED_X += test-genrandom
 +TEST_PROGRAMS_NEED_X += test-line-buffer
  TEST_PROGRAMS_NEED_X += test-match-trees
 +TEST_PROGRAMS_NEED_X += test-obj-pool
  TEST_PROGRAMS_NEED_X += test-parse-options
  TEST_PROGRAMS_NEED_X += test-path-utils
  TEST_PROGRAMS_NEED_X += test-run-command
  TEST_PROGRAMS_NEED_X += test-sha1
  TEST_PROGRAMS_NEED_X += test-sigchain
 +TEST_PROGRAMS_NEED_X += test-string-pool
 +TEST_PROGRAMS_NEED_X += test-svn-fe
 +TEST_PROGRAMS_NEED_X += test-treap
  TEST_PROGRAMS_NEED_X += test-index-version
  
  TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
@@@ -475,7 -468,6 +475,7 @@@ export PYTHON_PAT
  
  LIB_FILE=libgit.a
  XDIFF_LIB=xdiff/lib.a
 +VCSSVN_LIB=vcs-svn/lib.a
  
  LIB_H += advice.h
  LIB_H += archive.h
@@@ -1043,7 -1035,6 +1043,7 @@@ ifeq ($(uname_S),Windows
        NO_UNSETENV = YesPlease
        NO_STRCASESTR = YesPlease
        NO_STRLCPY = YesPlease
 +      NO_STRTOK_R = YesPlease
        NO_MEMMEM = YesPlease
        # NEEDS_LIBICONV = YesPlease
        NO_ICONV = YesPlease
@@@ -1098,7 -1089,6 +1098,7 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        NO_UNSETENV = YesPlease
        NO_STRCASESTR = YesPlease
        NO_STRLCPY = YesPlease
 +      NO_STRTOK_R = YesPlease
        NO_MEMMEM = YesPlease
        NEEDS_LIBICONV = YesPlease
        OLD_ICONV = YesPlease
@@@ -1329,10 -1319,6 +1329,10 @@@ endi
  ifdef NO_STRTOULL
        COMPAT_CFLAGS += -DNO_STRTOULL
  endif
 +ifdef NO_STRTOK_R
 +      COMPAT_CFLAGS += -DNO_STRTOK_R
 +      COMPAT_OBJS += compat/strtok_r.o
 +endif
  ifdef NO_SETENV
        COMPAT_CFLAGS += -DNO_SETENV
        COMPAT_OBJS += compat/setenv.o
@@@ -1753,9 -1739,7 +1753,9 @@@ ifndef NO_CUR
  endif
  XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
        xdiff/xmerge.o xdiff/xpatience.o
 -OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS)
 +VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
 +      vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
 +OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
  
  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
  dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
@@@ -1870,18 -1854,12 +1870,18 @@@ builtin/prune.o builtin/reflog.o reacha
  builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
  builtin/tar-tree.o archive-tar.o: tar.h
  builtin/pack-objects.o: thread-utils.h
 +connect.o transport.o http-backend.o: url.h
  http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
 -http.o http-walker.o http-push.o remote-curl.o: http.h
 +http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h
  
  xdiff-interface.o $(XDIFF_OBJS): \
        xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
        xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
 +
 +$(VCSSVN_OBJS): \
 +      vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
 +      vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
 +      vcs-svn/svndump.h
  endif
  
  exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
@@@ -1894,12 -1872,16 +1894,16 @@@ builtin/init-db.s builtin/init-db.o: EX
  
  config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
  
 -http.s http.o: EXTRA_CPPFLAGS = -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
 +http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
  
  ifdef NO_EXPAT
  http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
  endif
  
+ ifdef NO_REGEX
+ compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
+ endif
  git-%$X: %.o $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
@@@ -1930,8 -1912,6 +1934,8 @@@ $(LIB_FILE): $(LIB_OBJS
  $(XDIFF_LIB): $(XDIFF_OBJS)
        $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
  
 +$(VCSSVN_LIB): $(VCSSVN_OBJS)
 +      $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
  
  doc:
        $(MAKE) -C Documentation all
@@@ -2030,18 -2010,12 +2034,18 @@@ test-date$X: date.o ctype.
  
  test-delta$X: diff-delta.o patch-delta.o
  
 +test-line-buffer$X: vcs-svn/lib.a
 +
  test-parse-options$X: parse-options.o
  
 +test-string-pool$X: vcs-svn/lib.a
 +
 +test-svn-fe$X: vcs-svn/lib.a
 +
  .PRECIOUS: $(TEST_OBJS)
  
  test-%$X: test-%.o $(GITLIBS)
 -      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
  
  check-sha1:: test-sha1$X
        ./test-sha1.sh
@@@ -2105,19 -2079,10 +2109,19 @@@ endi
        bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
        execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
        { test "$$bindir/" = "$$execdir/" || \
 -              { $(RM) "$$execdir/git$X" && \
 +        for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
 +              $(RM) "$$execdir/$$p" && \
                test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
 -              ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
 -              cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
 +              ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
 +              cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
 +        done; \
 +      } && \
 +      for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
 +              $(RM) "$$bindir/$$p" && \
 +              ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
 +              ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
 +              cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
 +      done && \
        for p in $(BUILT_INS); do \
                $(RM) "$$execdir/$$p" && \
                ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
@@@ -2216,8 -2181,8 +2220,8 @@@ distclean: clea
        $(RM) configure
  
  clean:
 -      $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
 -              builtin/*.o $(LIB_FILE) $(XDIFF_LIB)
 +      $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
 +              builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
        $(RM) -r bin-wrappers
@@@ -2293,7 -2258,6 +2297,7 @@@ check-docs:
                documented,gitglossary | \
                documented,githooks | \
                documented,gitrepository-layout | \
 +              documented,gitrevisions | \
                documented,gittutorial | \
                documented,gittutorial-2 | \
                documented,git-bisect-lk2009 | \
diff --combined config.mak.in
index 4ffd77420f089452edf23ec63b94ad88cf0f37f5,67dbd3b7399b0d5bbb1e0c9e01e14d92b6aa1b55..a0c34eec15773f0f3e4d2b4e12f0c76e722ede95
@@@ -46,7 -46,6 +46,7 @@@ NO_IPV6=@NO_IPV6
  NO_C99_FORMAT=@NO_C99_FORMAT@
  NO_HSTRERROR=@NO_HSTRERROR@
  NO_STRCASESTR=@NO_STRCASESTR@
 +NO_STRTOK_R=@NO_STRTOK_R@
  NO_MEMMEM=@NO_MEMMEM@
  NO_STRLCPY=@NO_STRLCPY@
  NO_UINTMAX_T=@NO_UINTMAX_T@
@@@ -59,6 -58,7 +59,7 @@@ NO_INET_NTOP=@NO_INET_NTOP
  NO_INET_PTON=@NO_INET_PTON@
  NO_ICONV=@NO_ICONV@
  OLD_ICONV=@OLD_ICONV@
+ NO_REGEX=@NO_REGEX@
  NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
  INLINE=@INLINE@
  SOCKLEN_T=@SOCKLEN_T@
diff --combined configure.ac
index 708e7b86ce2a55dffc162025c7a009a88b0d8c38,ed0561b5d4738c7955ac3603084c8a676c1c56dd..56731c35c9d1b5e2d2c82cdff51ab496dcbac7f5
@@@ -706,6 -706,27 +706,27 @@@ els
  fi
  AC_SUBST(NO_C99_FORMAT)
  #
+ # Define NO_REGEX if you have no or inferior regex support in your C library.
+ AC_CACHE_CHECK([whether the platform regex can handle null bytes],
+  [ac_cv_c_excellent_regex], [
+ AC_EGREP_CPP(yippeeyeswehaveit,
+       AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+ #include <regex.h>
+ ],
+ [#ifdef REG_STARTEND
+ yippeeyeswehaveit
+ #endif
+ ]),
+       [ac_cv_c_excellent_regex=yes],
+       [ac_cv_c_excellent_regex=no])
+ ])
+ if test $ac_cv_c_excellent_regex = yes; then
+       NO_REGEX=
+ else
+       NO_REGEX=YesPlease
+ fi
+ AC_SUBST(NO_REGEX)
+ #
  # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
  # when attempting to read from an fopen'ed directory.
  AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
@@@ -783,12 -804,6 +804,12 @@@ GIT_CHECK_FUNC(strcasestr
  [NO_STRCASESTR=YesPlease])
  AC_SUBST(NO_STRCASESTR)
  #
 +# Define NO_STRTOK_R if you don't have strtok_r
 +GIT_CHECK_FUNC(strtok_r,
 +[NO_STRTOK_R=],
 +[NO_STRTOK_R=YesPlease])
 +AC_SUBST(NO_STRTOK_R)
 +#
  # Define NO_MEMMEM if you don't have memmem.
  GIT_CHECK_FUNC(memmem,
  [NO_MEMMEM=],