xref: /OK3568_Linux_fs/buildroot/package/git/git.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# git
4#
5################################################################################
6
7GIT_VERSION = 2.31.1
8GIT_SOURCE = git-$(GIT_VERSION).tar.xz
9GIT_SITE = $(BR2_KERNEL_MIRROR)/software/scm/git
10GIT_LICENSE = GPL-2.0, LGPL-2.1+
11GIT_LICENSE_FILES = COPYING LGPL-2.1
12GIT_CPE_ID_VENDOR = git-scm
13GIT_SELINUX_MODULES = apache git
14GIT_DEPENDENCIES = zlib $(TARGET_NLS_DEPENDENCIES)
15# We're patching configure.ac
16GIT_AUTORECONF = YES
17
18ifeq ($(BR2_PACKAGE_OPENSSL),y)
19GIT_DEPENDENCIES += host-pkgconf openssl
20GIT_CONF_OPTS += --with-openssl
21GIT_MAKE_OPTS += LIB_4_CRYPTO="`$(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`"
22else
23GIT_CONF_OPTS += --without-openssl
24endif
25
26ifeq ($(BR2_PACKAGE_PCRE2),y)
27GIT_DEPENDENCIES += pcre2
28GIT_CONF_OPTS += --with-libpcre2
29else
30GIT_CONF_OPTS += --without-libpcre2
31endif
32
33ifeq ($(BR2_PACKAGE_LIBCURL),y)
34GIT_DEPENDENCIES += libcurl
35GIT_CONF_OPTS += --with-curl
36GIT_CONF_ENV += \
37	ac_cv_prog_CURL_CONFIG=$(STAGING_DIR)/usr/bin/$(LIBCURL_CONFIG_SCRIPTS)
38else
39GIT_CONF_OPTS += --without-curl
40endif
41
42ifeq ($(BR2_PACKAGE_EXPAT),y)
43GIT_DEPENDENCIES += expat
44GIT_CONF_OPTS += --with-expat
45else
46GIT_CONF_OPTS += --without-expat
47endif
48
49ifeq ($(BR2_PACKAGE_LIBICONV),y)
50GIT_DEPENDENCIES += libiconv
51GIT_CONF_ENV_LIBS += -liconv
52GIT_CONF_OPTS += --with-iconv=/usr/lib
53else
54GIT_CONF_OPTS += --without-iconv
55endif
56
57ifeq ($(BR2_PACKAGE_TCL),y)
58GIT_DEPENDENCIES += tcl
59GIT_CONF_OPTS += --with-tcltk
60else
61GIT_CONF_OPTS += --without-tcltk
62endif
63
64ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
65GIT_MAKE_OPTS += NO_GETTEXT=1
66endif
67
68GIT_CFLAGS = $(TARGET_CFLAGS)
69
70ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)
71GIT_CFLAGS += -O0
72endif
73
74GIT_CONF_OPTS += CFLAGS="$(GIT_CFLAGS)"
75
76GIT_INSTALL_TARGET_OPTS = $(GIT_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
77
78# assume yes for these tests, configure will bail out otherwise
79# saying error: cannot run test program while cross compiling
80GIT_CONF_ENV += \
81	ac_cv_fread_reads_directories=yes \
82	ac_cv_snprintf_returns_bogus=yes LIBS='$(GIT_CONF_ENV_LIBS)'
83
84$(eval $(autotools-package))
85