Skip to content

Commit 2d5e748

Browse files
committed
configure: use 'pkg-config --static --libs' on the Darwin platform
1 parent 2c5b012 commit 2d5e748

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

configure

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,15 @@ if test "x${INCLUDE_DIR}${LIB_DIR}" = x; then
21112111
# Check if libgit2 is installed and have a version that is
21122112
# compatible with git2r.
21132113
if $PKG_CONFIG ${PKG_CONFIG_NAME} --atleast-version=${LIBGIT2_MIN_VERSION}; then
2114-
PKGCONFIG_CFLAGS=`"${PKG_CONFIG}" --cflags "${PKG_CONFIG_NAME}"`
2115-
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs "${PKG_CONFIG_NAME}"`
2114+
PKGCONFIG_CFLAGS=`"${PKG_CONFIG}" --cflags --silence-errors "${PKG_CONFIG_NAME}"`
2115+
case "${host_os}" in
2116+
darwin*)
2117+
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs --static "${PKG_CONFIG_NAME}"`
2118+
;;
2119+
*)
2120+
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs "${PKG_CONFIG_NAME}"`
2121+
;;
2122+
esac
21162123
fi
21172124
fi
21182125

configure.ac

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# git2r, R bindings to the libgit2 library.
2-
# Copyright (C) 2013-2024 The git2r contributors
2+
# Copyright (C) 2013-2025 The git2r contributors
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License, version 2,
@@ -52,8 +52,15 @@ if test "x${INCLUDE_DIR}${LIB_DIR}" = x; then
5252
# Check if libgit2 is installed and have a version that is
5353
# compatible with git2r.
5454
if $PKG_CONFIG ${PKG_CONFIG_NAME} --atleast-version=${LIBGIT2_MIN_VERSION}; then
55-
PKGCONFIG_CFLAGS=`"${PKG_CONFIG}" --cflags "${PKG_CONFIG_NAME}"`
56-
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs "${PKG_CONFIG_NAME}"`
55+
PKGCONFIG_CFLAGS=`"${PKG_CONFIG}" --cflags --silence-errors "${PKG_CONFIG_NAME}"`
56+
case "${host_os}" in
57+
darwin*)
58+
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs --static "${PKG_CONFIG_NAME}"`
59+
;;
60+
*)
61+
PKGCONFIG_LIBS=`"${PKG_CONFIG}" --libs "${PKG_CONFIG_NAME}"`
62+
;;
63+
esac
5764
fi
5865
fi
5966

0 commit comments

Comments
 (0)