summarylogtreecommitdiffstats
path: root/0003-libpsl-static-libs.patch
blob: ce33b87eedb53ab8dda9b45e0cc82d7b06149563 (plain)
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
--- curl-7.64.1.orig/configure.ac	2019-03-29 18:14:22.692813700 -0400
+++ curl-7.64.1/configure.ac	2019-03-29 18:52:44.514352300 -0400
@@ -2747,14 +2747,30 @@
            with_libpsl=$withval,
            with_libpsl=yes)
 if test $with_libpsl != "no"; then
-  AC_SEARCH_LIBS(psl_builtin, psl,
-    [curl_psl_msg="enabled";
-     AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
-     ],
-    [curl_psl_msg="no      (libpsl not found)";
-     AC_MSG_WARN([libpsl was not found])
-     ]
-  )
+  CURL_CHECK_PKGCONFIG(libpsl)
+  if test "$PKGCONFIG" != "no" ; then
+    LIB_PSL=`$PKGCONFIG --libs-only-l libpsl`
+    LD_PSL=`$PKGCONFIG --libs-only-L libpsl`
+    CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl`
+    version=`$PKGCONFIG --modversion libpsl`
+    DIR_PSL=`echo $LD_PSL | $SED -e 's/-L//'`
+    
+    AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
+    LDFLAGS="$LDFLAGS $LD_PSL"
+    CPPFLAGS="$CPPFLAGS $CPP_PSL"
+    LIBS="$LIB_PSL $LIBS"
+  else
+    dnl no nghttp2 pkg-config found, deal with it
+    AC_SEARCH_LIBS(psl_builtin, psl,
+      [curl_psl_msg="enabled";
+       AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
+       ],
+      [curl_psl_msg="no      (libpsl not found)";
+       AC_MSG_WARN([libpsl was not found])
+       ]
+    )
+  fi
+
 fi
 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])