1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
From 6b5d92a5c705dccf8f54c66eeabd29ffa512a90f Mon Sep 17 00:00:00 2001
From: taotieren <admin@taotieren.com>
Date: Mon, 18 Mar 2024 22:43:54 +0800
Subject: [PATCH] Compile using system libraries
---
configure.ac | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7bc7027..a2cd32c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,17 +92,13 @@ AC_ARG_WITH([static-libplist],
[AS_HELP_STRING(["--with-static-libplist[=/path/to/static/libplist"]],
[link against a static libplist])],
[with_static_libplist=$withval],
- [with_static_libplist=yes])
-if test "x$with_static_libplist" != "xno"; then
- if test "x$with_static_libplist" = "xyes"; then
- STATIC_LIBPLIST="`pkg-config --libs-only-L ${LIBPLIST} |sed "s/^..//; s/[ ]*$/\/${LIBPLIST}.a/"`"
- else
- STATIC_LIBPLIST="$with_static_libplist"
- fi
- if ! test -f "$STATIC_LIBPLIST"; then
- AC_MSG_ERROR([The file ${STATIC_LIBPLIST} passed to --with-static-libplist does not exist])
- fi
- AC_SUBST(libplist_LIBS, [$STATIC_LIBPLIST])
+ [with_static_libplist=no])
+if test "x$with_static_libplist" = xno; then
+ PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
+else
+ # Use the static libplist from the specified path
+ AC_SUBST(libplist_CFLAGS, "-I${with_static_libplist}/include")
+ AC_SUBST(libplist_LIBS, "${with_static_libplist}/lib/libplist.a")
fi
AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-g -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter")
--
2.44.0
|