Merge branch 'dm/port'
authorJunio C Hamano <gitster@pobox.com>
Thu, 3 Jan 2013 18:28:21 +0000 (10:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Jan 2013 18:28:21 +0000 (10:28 -0800)
Add a few more knobs for new platform ports can tweak.

* dm/port:
  git-compat-util.h: do not #include <sys/param.h> by default
  Generalize the inclusion of strings.h
  Detect when the passwd struct is missing pw_gecos
  Support builds when sys/param.h is missing

1  2 
Makefile
configure.ac

diff --combined Makefile
+++ b/Makefile
@@@ -74,6 -74,8 +74,8 @@@ all:
  # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
  # d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
  #
+ # Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp.
+ #
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
  # Define NO_MEMMEM if you don't have memmem.
  # Define NO_POLL if you do not have or don't want to use poll().
  # This also implies NO_SYS_POLL_H.
  #
+ # Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
+ # *PLEASE* REPORT to git@vger.kernel.org if your platform needs this;
+ # we want to know more about the issue.
+ #
  # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
  #
  # Define NO_PREAD if you have a problem with pread() system call (e.g.
@@@ -374,7 -380,7 +380,7 @@@ htmldir = share/doc/git-do
  ETC_GITCONFIG = $(sysconfdir)/gitconfig
  ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
  lib = lib
 -# DESTDIR=
 +# DESTDIR =
  pathsep = :
  
  export prefix bindir sharedir sysconfdir gitwebdir localedir
@@@ -495,7 -501,6 +501,7 @@@ PROGRAM_OBJS += sh-i18n--envsubst.
  PROGRAM_OBJS += shell.o
  PROGRAM_OBJS += show-index.o
  PROGRAM_OBJS += upload-pack.o
 +PROGRAM_OBJS += remote-testsvn.o
  
  # Binary suffix, set to .exe for Windows builds
  X =
@@@ -575,9 -580,9 +581,9 @@@ endi
  export PERL_PATH
  export PYTHON_PATH
  
 -LIB_FILE=libgit.a
 -XDIFF_LIB=xdiff/lib.a
 -VCSSVN_LIB=vcs-svn/lib.a
 +LIB_FILE = libgit.a
 +XDIFF_LIB = xdiff/lib.a
 +VCSSVN_LIB = vcs-svn/lib.a
  
  LIB_H += xdiff/xinclude.h
  LIB_H += xdiff/xmacros.h
@@@ -746,7 -751,6 +752,7 @@@ LIB_OBJS += editor.
  LIB_OBJS += entry.o
  LIB_OBJS += environment.o
  LIB_OBJS += exec_cmd.o
 +LIB_OBJS += fetch-pack.o
  LIB_OBJS += fsck.o
  LIB_OBJS += gettext.o
  LIB_OBJS += gpg-interface.o
@@@ -764,7 -768,6 +770,7 @@@ LIB_OBJS += lockfile.
  LIB_OBJS += log-tree.o
  LIB_OBJS += mailmap.o
  LIB_OBJS += match-trees.o
 +LIB_OBJS += merge.o
  LIB_OBJS += merge-file.o
  LIB_OBJS += merge-recursive.o
  LIB_OBJS += mergesort.o
@@@ -799,7 -802,6 +805,7 @@@ LIB_OBJS += rerere.
  LIB_OBJS += resolve-undo.o
  LIB_OBJS += revision.o
  LIB_OBJS += run-command.o
 +LIB_OBJS += send-pack.o
  LIB_OBJS += sequencer.o
  LIB_OBJS += server-info.o
  LIB_OBJS += setup.o
@@@ -1086,7 -1088,6 +1092,7 @@@ ifeq ($(uname_O),Cygwin
                NO_SYMLINK_HEAD = YesPlease
                NO_IPV6 = YesPlease
                OLD_ICONV = UnfortunatelyYes
 +              CYGWIN_V15_WIN32API = YesPlease
        endif
        NO_THREAD_SAFE_PREAD = YesPlease
        NEEDS_LIBICONV = YesPlease
@@@ -1139,7 -1140,7 +1145,7 @@@ ifeq ($(uname_S),NetBSD
  endif
  ifeq ($(uname_S),AIX)
        DEFAULT_PAGER = more
 -      NO_STRCASESTR=YesPlease
 +      NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease
        NO_MKDTEMP = YesPlease
        NO_MKSTEMPS = YesPlease
        NO_NSEC = YesPlease
        FREAD_READS_DIRECTORIES = UnfortunatelyYes
        INTERNAL_QSORT = UnfortunatelyYes
 -      NEEDS_LIBICONV=YesPlease
 +      NEEDS_LIBICONV = YesPlease
        BASIC_CFLAGS += -D_LARGE_FILES
        ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
                NO_PTHREADS = YesPlease
                PTHREAD_LIBS = -lpthread
        endif
        ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
 -              INLINE=''
 +              INLINE = ''
        endif
        GIT_TEST_CMP = cmp
  endif
  ifeq ($(uname_S),GNU)
        # GNU/Hurd
 -      NO_STRLCPY=YesPlease
 +      NO_STRLCPY = YesPlease
        NO_MKSTEMPS = YesPlease
        HAVE_PATHS_H = YesPlease
        LIBC_CONTAINS_LIBINTL = YesPlease
@@@ -1187,9 -1188,9 +1193,9 @@@ ifeq ($(uname_S),IRIX
        NEEDS_LIBGEN = YesPlease
  endif
  ifeq ($(uname_S),IRIX64)
 -      NO_SETENV=YesPlease
 +      NO_SETENV = YesPlease
        NO_UNSETENV = YesPlease
 -      NO_STRCASESTR=YesPlease
 +      NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease
        NO_MKSTEMPS = YesPlease
        NO_MKDTEMP = YesPlease
        NO_REGEX = YesPlease
        NO_FNMATCH_CASEFOLD = YesPlease
        SNPRINTF_RETURNS_BOGUS = YesPlease
 -      SHELL_PATH=/usr/gnu/bin/bash
 +      SHELL_PATH = /usr/gnu/bin/bash
        NEEDS_LIBGEN = YesPlease
  endif
  ifeq ($(uname_S),HP-UX)
        INLINE = __inline
 -      NO_IPV6=YesPlease
 -      NO_SETENV=YesPlease
 -      NO_STRCASESTR=YesPlease
 +      NO_IPV6 = YesPlease
 +      NO_SETENV = YesPlease
 +      NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease
        NO_MKSTEMPS = YesPlease
        NO_STRLCPY = YesPlease
@@@ -1353,6 -1354,7 +1359,7 @@@ ifeq ($(uname_S),NONSTOP_KERNEL
        # Added manually, see above.
        NEEDS_SSL_WITH_CURL = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
+       HAVE_STRINGS_H = YesPlease
        NEEDS_LIBICONV = YesPlease
        NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
        NO_SYS_SELECT_H = UnfortunatelyYes
        MKDIR_WO_TRAILING_SLASH = YesPlease
        # RFE 10-120912-4693 submitted to HP NonStop development.
        NO_SETITIMER = UnfortunatelyYes
 +      SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
 +      SHELL_PATH = /usr/local/bin/bash
 +      # as of H06.25/J06.14, we might better use this
 +      #SHELL_PATH = /usr/coreutils/bin/bash
  endif
  ifneq (,$(findstring MINGW,$(uname_S)))
        pathsep = ;
        X = .exe
        SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
  ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
 -      htmldir=doc/git/html/
 +      htmldir = doc/git/html/
        prefix =
        INSTALL = /bin/install
        EXTLIBS += /mingw/lib/libz.a
@@@ -1559,7 -1557,7 +1566,7 @@@ els
                CURL_LIBCURL = -lcurl
        endif
        ifdef NEEDS_SSL_WITH_CURL
 -              CURL_LIBCURL += -lssl
 +              CURL_LIBCURL += -lssl
                ifdef NEEDS_CRYPTO_WITH_SSL
                        CURL_LIBCURL += -lcrypto
                endif
@@@ -1655,6 -1653,9 +1662,9 @@@ endi
  ifdef NO_D_INO_IN_DIRENT
        BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
  endif
+ ifdef NO_GECOS_IN_PWENT
+       BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
+ endif
  ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
        BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
  endif
@@@ -1748,6 -1749,9 +1758,9 @@@ endi
  ifdef NO_SYS_POLL_H
        BASIC_CFLAGS += -DNO_SYS_POLL_H
  endif
+ ifdef NEEDS_SYS_PARAM_H
+       BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H
+ endif
  ifdef NO_INTTYPES_H
        BASIC_CFLAGS += -DNO_INTTYPES_H
  endif
@@@ -1768,7 -1772,7 +1781,7 @@@ ifdef OBJECT_CREATION_USES_RENAME
  endif
  ifdef NO_STRUCT_ITIMERVAL
        COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
 -      NO_SETITIMER=YesPlease
 +      NO_SETITIMER = YesPlease
  endif
  ifdef NO_SETITIMER
        COMPAT_CFLAGS += -DNO_SETITIMER
@@@ -1884,6 -1888,10 +1897,10 @@@ ifdef HAVE_LIBCHARSET_
        EXTLIBS += $(CHARSET_LIB)
  endif
  
+ ifdef HAVE_STRINGS_H
+       BASIC_CFLAGS += -DHAVE_STRINGS_H
+ endif
  ifdef HAVE_DEV_TTY
        BASIC_CFLAGS += -DHAVE_DEV_TTY
  endif
@@@ -1898,9 -1906,6 +1915,9 @@@ ifdef NO_REGE
        COMPAT_CFLAGS += -Icompat/regex
        COMPAT_OBJS += compat/regex/regex.o
  endif
 +ifdef CYGWIN_V15_WIN32API
 +      COMPAT_CFLAGS += -DCYGWIN_V15_WIN32API
 +endif
  
  ifdef USE_NED_ALLOCATOR
         COMPAT_CFLAGS += -Icompat/nedmalloc
@@@ -1920,15 -1925,15 +1937,15 @@@ ifneq (,$(XDL_FAST_HASH)
  endif
  
  ifeq ($(TCLTK_PATH),)
 -NO_TCLTK=NoThanks
 +NO_TCLTK = NoThanks
  endif
  
  ifeq ($(PERL_PATH),)
 -NO_PERL=NoThanks
 +NO_PERL = NoThanks
  endif
  
  ifeq ($(PYTHON_PATH),)
 -NO_PYTHON=NoThanks
 +NO_PYTHON = NoThanks
  endif
  
  QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
@@@ -1975,13 -1980,13 +1992,13 @@@ PROFILE_DIR := $(CURDIR
  ifeq ("$(PROFILE)","GEN")
        CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
        EXTLIBS += -lgcov
 -      export CCACHE_DISABLE=t
 -      V=1
 +      export CCACHE_DISABLE = t
 +      V = 1
  else
  ifneq ("$(PROFILE)","")
        CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
 -      export CCACHE_DISABLE=t
 -      V=1
 +      export CCACHE_DISABLE = t
 +      V = 1
  endif
  endif
  
@@@ -2461,10 -2466,6 +2478,10 @@@ git-http-push$X: revision.o http.o http
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
 +git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
 +      $(VCSSVN_LIB)
 +
  $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
        $(QUIET_LNCP)$(RM) $@ && \
        ln $< $@ 2>/dev/null || \
@@@ -2830,7 -2831,7 +2847,7 @@@ git.spec: git.spec.in GIT-VERSION-FIL
        sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
        mv $@+ $@
  
 -GIT_TARNAME=git-$(GIT_VERSION)
 +GIT_TARNAME = git-$(GIT_VERSION)
  dist: git.spec git-archive$(X) configure
        ./git-archive --format=tar \
                --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
diff --combined configure.ac
@@@ -753,6 -753,14 +753,14 @@@ AC_CHECK_MEMBER(struct dirent.d_type
  [#include <dirent.h>])
  GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
  #
+ # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
+ # in the C library.
+ AC_CHECK_MEMBER(struct passwd.pw_gecos,
+ [NO_GECOS_IN_PWENT=],
+ [NO_GECOS_IN_PWENT=YesPlease],
+ [#include <pwd.h>])
+ GIT_CONF_SUBST([NO_GECOS_IN_PWENT])
+ #
  # Define NO_SOCKADDR_STORAGE if your platform does not have struct
  # sockaddr_storage.
  AC_CHECK_TYPE(struct sockaddr_storage,
@@@ -872,6 -880,12 +880,12 @@@ AC_CHECK_HEADER([libcharset.h]
  [HAVE_LIBCHARSET_H=YesPlease],
  [HAVE_LIBCHARSET_H=])
  GIT_CONF_SUBST([HAVE_LIBCHARSET_H])
+ #
+ # Define HAVE_STRINGS_H if you have strings.h
+ AC_CHECK_HEADER([strings.h],
+ [HAVE_STRINGS_H=YesPlease],
+ [HAVE_STRINGS_H=])
+ GIT_CONF_SUBST([HAVE_STRINGS_H])
  # Define CHARSET_LIB if libiconv does not export the locale_charset symbol
  # and libcharset does
  CHARSET_LIB=
@@@ -1024,7 -1038,7 +1038,7 @@@ elif test -z "$PTHREAD_CFLAGS"; the
    for opt in -mt -pthread -lpthread; do
       old_CFLAGS="$CFLAGS"
       CFLAGS="$opt $CFLAGS"
 -     AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])
 +     AC_MSG_CHECKING([for POSIX Threads with '$opt'])
       AC_LINK_IFELSE([PTHREADTEST_SRC],
        [AC_MSG_RESULT([yes])
                NO_PTHREADS=
  else
    old_CFLAGS="$CFLAGS"
    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
 -  AC_MSG_CHECKING([Checking for POSIX Threads with '$PTHREAD_CFLAGS'])
 +  AC_MSG_CHECKING([for POSIX Threads with '$PTHREAD_CFLAGS'])
    AC_LINK_IFELSE([PTHREADTEST_SRC],
        [AC_MSG_RESULT([yes])
                NO_PTHREADS=