gnu: pjproject: Fix problem in pkg-config file.
[jackhill/guix/guix.git] / gnu / packages / patches / pjproject-correct-the-cflags-field.patch
1 From 44f8f6c1c71bec6bf00269b075a2dc801ae6fd45 Mon Sep 17 00:00:00 2001
2 From: Vladimir Stoiakin <VStoiakin@lavabit.com>
3 Date: Thu, 23 Apr 2020 14:06:40 +0300
4 Subject: [PATCH 1/2] libpjproject.pc: correct the field 'cflags'
5
6 ---
7 Makefile | 6 ++----
8 aconfigure | 4 ++++
9 aconfigure.ac | 3 +++
10 build.mak.in | 7 +++----
11 libpjproject.pc.in | 4 ++--
12 5 files changed, 14 insertions(+), 10 deletions(-)
13
14 diff --git a/Makefile b/Makefile
15 index ffaf638dd..3fd5cab40 100644
16 --- a/Makefile
17 +++ b/Makefile
18 @@ -132,10 +132,8 @@ install:
19 sed -e "s!@INCLUDEDIR@!$(includedir)!" | \
20 sed -e "s!@LIBDIR@!$(libdir)!" | \
21 sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
22 - sed -e "s!@PJ_LDLIBS@!!" | \
23 - sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \
24 - sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \
25 - sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
26 + sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
27 + sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
28
29 uninstall:
30 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
31 diff --git a/aconfigure b/aconfigure
32 index 2abbcf533..1ab932bda 100755
33 --- a/aconfigure
34 +++ b/aconfigure
35 @@ -706,6 +706,7 @@ GREP
36 CPP
37 ac_cross_compile
38 ac_shlib_suffix
39 +ac_cflags
40 ac_build_mak_vars
41 ac_pjdir
42 CC_CFLAGS
43 @@ -3952,6 +3953,7 @@ if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi
44
45
46
47 +
48 case $host in
49 *mingw* | *cygw* | *win32* | *w32* )
50 if pwd -W 2&> /dev/null; then
51 @@ -5138,8 +5140,10 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
52
53 if test "x$ac_cv_c_bigendian" = "xyes"; then
54 CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
55 + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
56 else
57 CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
58 + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
59 fi
60
61
62 diff --git a/aconfigure.ac b/aconfigure.ac
63 index 83d3559ed..b1d493c08 100644
64 --- a/aconfigure.ac
65 +++ b/aconfigure.ac
66 @@ -71,6 +71,7 @@ AC_SUBST(CC_CFLAGS)
67
68 AC_SUBST(ac_pjdir)
69 AC_SUBST(ac_build_mak_vars)
70 +AC_SUBST(ac_cflags)
71
72 case $host in
73 *mingw* | *cygw* | *win32* | *w32* )
74 @@ -144,8 +145,10 @@ AC_C_BIGENDIAN
75
76 if test "x$ac_cv_c_bigendian" = "xyes"; then
77 CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
78 + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
79 else
80 CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
81 + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
82 fi
83
84 dnl
85 diff --git a/build.mak.in b/build.mak.in
86 index abc0c4fa0..a9078bb25 100644
87 --- a/build.mak.in
88 +++ b/build.mak.in
89 @@ -299,7 +299,7 @@ export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \
90 -lstdc++ \
91 $(APP_LDLIBS)
92
93 -# Here are the variabels to use if application is using the library
94 +# Here are the variables to use if application is using the library
95 # from within the source distribution
96 export PJ_CC := $(APP_CC)
97 export PJ_CXX := $(APP_CXX)
98 @@ -317,6 +317,5 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES)
99 export PJ_INSTALL_DIR := @prefix@
100 export PJ_INSTALL_INC_DIR := @includedir@
101 export PJ_INSTALL_LIB_DIR := @libdir@
102 -export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
103 -export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
104 -export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
105 +export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
106 +export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
107 diff --git a/libpjproject.pc.in b/libpjproject.pc.in
108 index fa8d39114..30ea05c07 100644
109 --- a/libpjproject.pc.in
110 +++ b/libpjproject.pc.in
111 @@ -9,5 +9,5 @@ Name: libpjproject
112 Description: Multimedia communication library
113 URL: http://www.pjsip.org
114 Version: @PJ_VERSION@
115 -Libs: -L${libdir} @PJ_LDXXLIBS@
116 -Cflags: -I${includedir} @PJ_INSTALL_CXXFLAGS@
117 +Libs: @PJ_INSTALL_LDFLAGS@
118 +Cflags: @PJ_INSTALL_CFLAGS@
119 --
120 2.27.0
121