X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Makefile;h=3dc072fc8162be1b1d57db207a976b8b78928f04;hb=632d3f4b5b80700c6c7c3637d6a4d1d9a457f7e1;hp=5fa893c6fa5602bba9e11684203d3be3985c3f52;hpb=9559910cac77526a95dd5dca93a2e3e6d290c5b9;p=git.git diff --git a/Makefile b/Makefile index 5fa893c6f..3dc072fc8 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,12 @@ all:: # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend # to PATH if your tools in /usr/bin are broken. # +# Define SOCKLEN_T to a suitable type (such as 'size_t') if your +# system headers do not define a socklen_t type. +# +# Define INLINE to a suitable substitute (such as '__inline' or '') if git +# fails to compile with errors about undefined inline functions or similar. +# # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() # or vsnprintf() return -1 instead of number of characters which would # have been written to the final string if enough space had been available. @@ -249,7 +255,7 @@ endif CFLAGS = -g -O2 -Wall LDFLAGS = -ALL_CFLAGS = $(CFLAGS) +ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) ALL_LDFLAGS = $(LDFLAGS) STRIP ?= strip @@ -272,6 +278,7 @@ mandir = share/man infodir = share/info gitexecdir = libexec/git-core sharedir = $(prefix)/share +gitwebdir = $(sharedir)/gitweb template_dir = share/git-core/templates htmldir = share/doc/git-doc ifeq ($(prefix),/usr) @@ -285,11 +292,12 @@ lib = lib # DESTDIR= pathsep = : -export prefix bindir sharedir sysconfdir +export prefix bindir sharedir sysconfdir gitwebdir CC = gcc AR = ar RM = rm -f +DIFF = diff TAR = tar FIND = find INSTALL = install @@ -297,6 +305,7 @@ RPMBUILD = rpmbuild TCL_PATH = tclsh TCLTK_PATH = wish PTHREAD_LIBS = -lpthread +PTHREAD_CFLAGS = export TCL_PATH TCLTK_PATH @@ -627,6 +636,7 @@ LIB_OBJS += tree-diff.o LIB_OBJS += tree.o LIB_OBJS += tree-walk.o LIB_OBJS += unpack-trees.o +LIB_OBJS += url.o LIB_OBJS += usage.o LIB_OBJS += userdiff.o LIB_OBJS += utf8.o @@ -739,6 +749,13 @@ EXTLIBS = # because maintaining the nesting to match is a pain. If # we had "elif" things would have been much nicer... +ifeq ($(uname_S),OSF1) + # Need this for u_short definitions et al + BASIC_CFLAGS += -D_OSF_SOURCE + SOCKLEN_T = int + NO_STRTOULL = YesPlease + NO_NSEC = YesPlease +endif ifeq ($(uname_S),Linux) NO_STRLCPY = YesPlease NO_MKSTEMPS = YesPlease @@ -813,6 +830,18 @@ ifeq ($(uname_S),SunOS) NO_MKDTEMP = YesPlease NO_MKSTEMPS = YesPlease NO_REGEX = YesPlease + ifeq ($(uname_R),5.6) + SOCKLEN_T = int + NO_HSTRERROR = YesPlease + NO_IPV6 = YesPlease + NO_SOCKADDR_STORAGE = YesPlease + NO_UNSETENV = YesPlease + NO_SETENV = YesPlease + NO_STRLCPY = YesPlease + NO_C99_FORMAT = YesPlease + NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp + endif ifeq ($(uname_R),5.7) NEEDS_RESOLV = YesPlease NO_IPV6 = YesPlease @@ -822,18 +851,21 @@ ifeq ($(uname_S),SunOS) NO_STRLCPY = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.8) NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif INSTALL = /usr/ucb/install TAR = gtar @@ -911,7 +943,13 @@ ifeq ($(uname_S),AIX) BASIC_CFLAGS += -D_LARGE_FILES ifeq ($(shell expr "$(uname_V)" : '[1234]'),1) NO_PTHREADS = YesPlease + else + PTHREAD_LIBS = -lpthread endif + ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3) + INLINE='' + endif + GIT_TEST_CMP = cmp endif ifeq ($(uname_S),GNU) # GNU/Hurd @@ -956,6 +994,7 @@ ifeq ($(uname_S),IRIX64) NEEDS_LIBGEN = YesPlease endif ifeq ($(uname_S),HP-UX) + INLINE = __inline NO_IPV6=YesPlease NO_SETENV=YesPlease NO_STRCASESTR=YesPlease @@ -967,6 +1006,20 @@ ifeq ($(uname_S),HP-UX) NO_HSTRERROR = YesPlease NO_SYS_SELECT_H = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease + NO_NSEC = YesPlease + ifeq ($(uname_R),B.11.00) + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif + ifeq ($(uname_R),B.10.20) + # Override HP-UX 11.x setting: + INLINE = + SOCKLEN_T = size_t + NO_PREAD = YesPlease + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif + GIT_TEST_CMP = cmp endif ifeq ($(uname_S),Windows) GIT_VERSION := $(GIT_VERSION).MSVC @@ -1092,6 +1145,14 @@ else BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' endif +ifneq (,$(INLINE)) + BASIC_CFLAGS += -Dinline=$(INLINE) +endif + +ifneq (,$(SOCKLEN_T)) + BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T) +endif + ifeq ($(uname_S),Darwin) ifndef NO_FINK ifeq ($(shell test -d /sw/lib && echo y),y) @@ -1363,6 +1424,7 @@ endif ifdef NO_PTHREADS BASIC_CFLAGS += -DNO_PTHREADS else + BASIC_CFLAGS += $(PTHREAD_CFLAGS) EXTLIBS += $(PTHREAD_LIBS) LIB_OBJS += thread-utils.o endif @@ -1387,6 +1449,10 @@ ifdef USE_NED_ALLOCATOR COMPAT_OBJS += compat/nedmalloc/nedmalloc.o endif +ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT + export GIT_TEST_CMP_USE_COPIED_CONTEXT +endif + ifeq ($(TCLTK_PATH),) NO_TCLTK=NoThanks endif @@ -1443,11 +1509,13 @@ gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) template_dir_SQ = $(subst ','\'',$(template_dir)) htmldir_SQ = $(subst ','\'',$(htmldir)) prefix_SQ = $(subst ','\'',$(prefix)) +gitwebdir_SQ = $(subst ','\'',$(gitwebdir)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) +DIFF_SQ = $(subst ','\'',$(DIFF)) LIBS = $(GITLIBS) $(EXTLIBS) @@ -1474,7 +1542,7 @@ endif ALL_CFLAGS += $(BASIC_CFLAGS) ALL_LDFLAGS += $(BASIC_LDFLAGS) -export TAR INSTALL DESTDIR SHELL_PATH +export DIFF TAR INSTALL DESTDIR SHELL_PATH ### Build rules @@ -1536,6 +1604,7 @@ define cmd_munge_script $(RM) $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ + -e 's|@@DIFF@@|$(DIFF_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e $(BROKEN_PATH_FIX) \ @@ -1563,11 +1632,10 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl sed -e '1{' \ -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ -e ' h' \ - -e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ + -e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "'"$$INSTLIBDIR"'"));=' \ -e ' H' \ -e ' x' \ -e '}' \ - -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ $@.perl >$@+ && \ chmod +x $@+ && \ @@ -1579,45 +1647,38 @@ gitweb: $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all ifdef JSMIN -GITWEB_PROGRAMS += gitweb/gitweb.min.js -GITWEB_JS = gitweb/gitweb.min.js +GITWEB_PROGRAMS += gitweb/static/gitweb.min.js +GITWEB_JS = gitweb/static/gitweb.min.js else -GITWEB_JS = gitweb/gitweb.js +GITWEB_JS = gitweb/static/gitweb.js endif ifdef CSSMIN -GITWEB_PROGRAMS += gitweb/gitweb.min.css -GITWEB_CSS = gitweb/gitweb.min.css +GITWEB_PROGRAMS += gitweb/static/gitweb.min.css +GITWEB_CSS = gitweb/static/gitweb.min.css else -GITWEB_CSS = gitweb/gitweb.css +GITWEB_CSS = gitweb/static/gitweb.css endif OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS) gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS) $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) ifdef JSMIN -gitweb/gitweb.min.js: gitweb/gitweb.js +gitweb/static/gitweb.min.js: gitweb/static/gitweb.js $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) endif # JSMIN ifdef CSSMIN -gitweb/gitweb.min.css: gitweb/gitweb.css +gitweb/static/gitweb.min.css: gitweb/static/gitweb.css $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) endif # CSSMIN -git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js +git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/static/gitweb.js $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ - -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ - -e '/@@GITWEB_CGI@@/d' \ - -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \ - -e '/@@GITWEB_CSS@@/d' \ - -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \ - -e '/@@GITWEB_JS@@/d' \ + -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \ -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ - -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \ - -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \ $@.sh > $@+ && \ chmod +x $@+ && \ mv $@+ $@ @@ -1889,10 +1950,18 @@ GIT-CFLAGS: FORCE GIT-BUILD-OPTIONS: FORCE @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@ + @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@ + @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@ @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@ @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@ +ifdef GIT_TEST_CMP + @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@ +endif +ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT + @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@ +endif ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK @@ -1987,6 +2056,7 @@ install: all $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install ifndef NO_PERL $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install + $(MAKE) -C gitweb install endif ifndef NO_PYTHON $(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install