File: 0002-libs-cleanup.patch

package info (click to toggle)
lvm2 2.02.168-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,500 kB
  • ctags: 15,264
  • sloc: ansic: 142,688; sh: 22,776; python: 6,500; makefile: 2,288; ruby: 332; awk: 20; cpp: 10
file content (115 lines) | stat: -rw-r--r-- 4,909 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From 8826ff3faa77992cc5016650001ee4c2da438b4a Mon Sep 17 00:00:00 2001
From: Bastian Blank <waldi@debian.org>
Date: Tue, 30 Jun 2015 11:46:05 +0200
Subject: libs-cleanup

---
 configure.in | 67 +++++++-----------------------------------------------------
 1 file changed, 7 insertions(+), 60 deletions(-)

diff --git a/configure.in b/configure.in
index cc77aaba9..f67f00434 100644
--- a/configure.in
+++ b/configure.in
@@ -668,7 +668,7 @@ dnl -- Disable readline
 AC_MSG_CHECKING(whether to enable readline)
 AC_ARG_ENABLE([readline],
 	      AC_HELP_STRING([--disable-readline], [disable readline support]),
-	      READLINE=$enableval, READLINE=maybe)
+	      READLINE=$enableval, READLINE=yes)
 AC_MSG_RESULT($READLINE)
 
 ################################################################################
@@ -1635,21 +1635,9 @@ AC_MSG_RESULT($SELINUX)
 ################################################################################
 dnl -- Check for selinux
 if test "$SELINUX" = yes; then
-	AC_CHECK_LIB([sepol], [sepol_check_context], [
-		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
-		SELINUX_LIBS="-lsepol"])
-
-	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
-		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
-		AC_CHECK_HEADERS([selinux/label.h])
-		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-		SELINUX_PC="libselinux"
-		HAVE_SELINUX=yes ], [
-		AC_MSG_WARN(Disabling selinux)
-		SELINUX_LIBS=
-		SELINUX_PC=
-		HAVE_SELINUX=no ])
+	AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+	SELINUX_LIBS="$(pkg-config --libs libselinux)"
+	SELINUX_LIBS_STATIC="$(pkg-config --libs --static libselinux)"
 fi
 
 ################################################################################
@@ -1683,49 +1671,6 @@ dnl -- Check for getopt
 AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
 
 ################################################################################
-dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
-if test "$READLINE" != no; then
-	lvm_saved_libs=$LIBS
-	AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
-		READLINE_LIBS=$ac_cv_search_tgetent, [
-		if test "$READLINE" = yes; then
-			AC_MSG_ERROR(
-[termcap could not be found which is required for the
---enable-readline option (which is enabled by default).  Either disable readline
-support with --disable-readline or download and install termcap from:
-	ftp.gnu.org/gnu/termcap
-Note: if you are using precompiled packages you will also need the development
-  package as well (which may be called termcap-devel or something similar).
-Note: (n)curses also seems to work as a substitute for termcap.  This was
-  not found either - but you could try installing that as well.])
-		fi])
-	dnl -- Old systems may need extra termcap dependency explicitly in LIBS
-	AC_CHECK_LIB([readline], [readline], [
-		AC_DEFINE([READLINE_SUPPORT], 1,
-			[Define to 1 to include the LVM readline shell.])
-		dnl -- Try only with -lreadline and check for different symbol
-		LIBS=$lvm_saved_libs
-		AC_CHECK_LIB([readline], [rl_line_buffer],
-			[ READLINE_LIBS="-lreadline" ], [
-			  AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
-			  READLINE_LIBS="-lreadline $READLINE_LIBS"
-			]) ], [
-		READLINE_LIBS=
-		if test "$READLINE" = yes; then
-			AC_MSG_ERROR(
-[GNU Readline could not be found which is required for the
---enable-readline option (which is enabled by default).  Either disable readline
-support with --disable-readline or download and install readline from:
-	ftp.gnu.org/gnu/readline
-Note: if you are using precompiled packages you will also need the development
-package as well (which may be called readline-devel or something similar).])
-		fi ])
-	LIBS="$READLINE_LIBS $lvm_saved_libs"
-	AC_CHECK_FUNCS([rl_completion_matches])
-	LIBS=$lvm_saved_libs
-fi
-
-################################################################################
 dnl -- Internationalisation stuff
 AC_MSG_CHECKING(whether to enable internationalisation)
 AC_ARG_ENABLE(nls,
@@ -1808,7 +1753,8 @@ AC_ARG_WITH(tmpfilesdir,
 ################################################################################
 dnl -- Ensure additional headers required
 if test "$READLINE" = yes; then
-	AC_CHECK_HEADERS(readline/readline.h readline/history.h,,hard_bailout)
+	AC_CHECK_LIB([readline], [readline], [READLINE_LIBS="-lreadline"], AC_MSG_ERROR(bailing out))
+	AC_DEFINE([READLINE_SUPPORT], 1, [Define to 1 to include the LVM readline shell.])
 fi
 
 if test "$BUILD_CMIRRORD" = yes; then
@@ -2095,6 +2041,7 @@ AC_SUBST(SACKPT_LIBS)
 AC_SUBST(SALCK_CFLAGS)
 AC_SUBST(SALCK_LIBS)
 AC_SUBST(SELINUX_LIBS)
+AC_SUBST(SELINUX_LIBS_STATIC)
 AC_SUBST(SELINUX_PC)
 AC_SUBST(SNAPSHOTS)
 AC_SUBST(STATICDIR)