lvm2-2.02.129-static-pkgconfig-libs.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --- LVM2.2.02.129/configure.in
  2. +++ LVM2.2.02.129/configure.in
  3. @@ -1287,6 +1287,7 @@
  4. fi])
  5. if test "$BLKID_WIPING" = yes; then
  6. BLKID_PC="blkid"
  7. + BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
  8. DEFAULT_USE_BLKID_WIPING=1
  9. AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
  10. else
  11. @@ -1332,6 +1333,7 @@
  12. if test "$UDEV_SYNC" = yes; then
  13. pkg_config_init
  14. PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
  15. + UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
  16. AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
  17. fi
  18. @@ -1558,19 +1560,32 @@
  19. if test "$SELINUX" = yes; then
  20. AC_CHECK_LIB([sepol], [sepol_check_context], [
  21. AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
  22. - SELINUX_LIBS="-lsepol"])
  23. + SEPOL_LIBS="-lsepol"])
  24. +
  25. + dnl -- init pkgconfig if required
  26. + if test x$PKGCONFIG_INIT != x1; then
  27. + pkg_config_init
  28. + fi
  29. + PKG_CHECK_MODULES(SELINUX, libselinux, [
  30. + SELINUX_PC="libselinux"
  31. + SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
  32. + SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
  33. + AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
  34. + ],[
  35. + dnl -- old non-pkgconfig method, is buggy with static builds
  36. AC_CHECK_LIB([selinux], [is_selinux_enabled], [
  37. AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
  38. AC_CHECK_HEADERS([selinux/label.h])
  39. AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
  40. - SELINUX_LIBS="-lselinux $SELINUX_LIBS"
  41. + SELINUX_LIBS="-lselinux $SEPOL_LIBS"
  42. SELINUX_PC="libselinux"
  43. HAVE_SELINUX=yes ], [
  44. AC_MSG_WARN(Disabling selinux)
  45. SELINUX_LIBS=
  46. SELINUX_PC=
  47. HAVE_SELINUX=no ])
  48. + ])
  49. fi
  50. ################################################################################
  51. @@ -1902,6 +1917,7 @@
  52. ################################################################################
  53. AC_SUBST(APPLIB)
  54. AC_SUBST(AWK)
  55. +AC_SUBST(BLKID_STATIC_LIBS)
  56. AC_SUBST(BLKID_PC)
  57. AC_SUBST(BUILD_CMIRRORD)
  58. AC_SUBST(BUILD_DMEVENTD)
  59. @@ -2005,6 +2021,7 @@
  60. AC_SUBST(SALCK_CFLAGS)
  61. AC_SUBST(SALCK_LIBS)
  62. AC_SUBST(SELINUX_LIBS)
  63. +AC_SUBST(SELINUX_STATIC_LIBS)
  64. AC_SUBST(SELINUX_PC)
  65. AC_SUBST(SNAPSHOTS)
  66. AC_SUBST(STATICDIR)
  67. @@ -2020,6 +2037,7 @@
  68. AC_SUBST(CACHE_DUMP_CMD)
  69. AC_SUBST(CACHE_REPAIR_CMD)
  70. AC_SUBST(CACHE_RESTORE_CMD)
  71. +AC_SUBST(UDEV_STATIC_LIBS)
  72. AC_SUBST(UDEV_PC)
  73. AC_SUBST(UDEV_RULES)
  74. AC_SUBST(UDEV_SYNC)
  75. --- LVM2.2.02.129/make.tmpl.in
  76. +++ LVM2.2.02.129/make.tmpl.in
  77. @@ -43,7 +43,7 @@
  78. LIBS = @LIBS@
  79. # Extra libraries always linked with static binaries
  80. -STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
  81. +STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
  82. DEFS += @DEFS@
  83. # FIXME set this only where it's needed, not globally?
  84. CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
  85. @@ -58,10 +58,13 @@
  86. PTHREAD_LIBS = @PTHREAD_LIBS@
  87. READLINE_LIBS = @READLINE_LIBS@
  88. SELINUX_LIBS = @SELINUX_LIBS@
  89. +SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
  90. UDEV_CFLAGS = @UDEV_CFLAGS@
  91. UDEV_LIBS = @UDEV_LIBS@
  92. +UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
  93. BLKID_CFLAGS = @BLKID_CFLAGS@
  94. BLKID_LIBS = @BLKID_LIBS@
  95. +BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
  96. VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
  97. TESTING = @TESTING@