You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
6.6 KiB

  1. --- a/configure.ac 2019-03-30 12:47:15.935627522 +0000
  2. +++ b/configure.ac 2019-03-30 12:47:55.590028792 +0000
  3. @@ -272,8 +272,7 @@ AC_ARG_ENABLE(Werror,
  4. [AS_HELP_STRING([--enable-Werror], [compile with warnings being errors])])
  5. AC_ARG_WITH([systemdsystemunitdir],
  6. - AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
  7. - [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
  8. + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])])
  9. # Set the kernel headers path
  10. if test -n "$kernel_src_path"; then
  11. @@ -551,7 +550,7 @@ do
  12. eval $LOCAL_WARN_VAR=yes
  13. add_to_var([KA_CFLAGS], [-W$WARN])
  14. AC_DEFINE_UNQUOTED([$WARN_VAR], [ 1 ])
  15. - AS_IF([test -z $WARN_VAR_SHORT], [],
  16. + AS_IF([test -z "$WARN_VAR_SHORT"], [],
  17. [AC_DEFINE_UNQUOTED([$WARN_VAR_SHORT], [ 1 ])]
  18. )
  19. ],
  20. @@ -2451,41 +2450,39 @@ AM_CONDITIONAL([RPM_BIP], [test $RPM_NO_
  21. dnl ----[ Determine system init type]----
  22. INIT_TYPE=
  23. -if test -z $init_type; then
  24. +AS_IF(
  25. + [test -n "$init_type"], [INIT_TYPE=$init_type],
  26. + [test -n "$with_systemdsystemunitdir"], [INIT_TYPE=systemd],
  27. + [
  28. /sbin/init --version 2>/dev/null | grep -q upstart
  29. - if test $? -eq 0; then
  30. - INIT_TYPE=upstart
  31. - else
  32. + AS_IF(
  33. + [test $? -eq 0], [INIT_TYPE=upstart],
  34. + [
  35. init_path=`which systemctl 2>/dev/null`
  36. - if test \( $? -eq 0 -a -x "$init_path" \); then
  37. + AS_IF([test \( $? -eq 0 -a -x "$init_path" \)],
  38. + [
  39. systemctl | grep -q -- "-\.mount"
  40. - if test $? -eq 0; then
  41. - INIT_TYPE=systemd
  42. - fi
  43. - fi
  44. - if test \( -z "$INIT_TYPE" -a -f /etc/init.d/networking \); then
  45. + AS_IF([test $? -eq 0], [INIT_TYPE=systemd])
  46. + ])
  47. + AS_IF([test \( -z "$INIT_TYPE" -a -f /etc/init.d/networking \)],
  48. + [
  49. init_path=`which openrc-run 2>/dev/null`
  50. - if test \( $? -eq 0 -a -x "$init_path" \); then
  51. + AS_IF([test \( $? -eq 0 -a -x "$init_path" \)],
  52. + [
  53. head -1 /etc/init.d/networking | grep -q "^#! */.*/openrc-run$"
  54. - if test $? -eq 0; then
  55. - INIT_TYPE=openrc
  56. - fi
  57. - fi
  58. - fi
  59. - if test \( -z "$INIT_TYPE" -a -f /etc/init.d/cron -a ! -h /etc/init.d/cron \); then
  60. - INIT_TYPE=SYSV
  61. - fi
  62. - fi
  63. -else
  64. - INIT_TYPE=$init_type
  65. -fi
  66. + AS_IF([test $? -eq 0], [INIT_TYPE=openrc])
  67. + ])
  68. + ])
  69. + AS_IF([test \( -z "$INIT_TYPE" -a -f /etc/init.d/cron -a ! -h /etc/init.d/cron \)], [INIT_TYPE=SYSV])
  70. + ])
  71. + ])
  72. +AS_IF([test \( .$INIT_TYPE = .systemd -a -z "$with_systemdsystemunitdir" \)], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
  73. dnl ----[Default keepalived configuration file]----
  74. AS_IF([test $default_config_file],
  75. [
  76. AS_IF([test $default_config_file = yes -o $default_config_file = no],
  77. - AC_MSG_ERROR([A filename must be specified for default-config-file])
  78. - ])
  79. + [AC_MSG_ERROR([A filename must be specified for default-config-file])])
  80. CONFIG_FILE=$default_config_file
  81. add_config_opt([DEFAULT_CONFIG_FILE=${default_config_file}])
  82. ],
  83. @@ -2493,7 +2490,7 @@ AS_IF([test $default_config_file],
  84. AC_DEFINE_UNQUOTED([DEFAULT_CONFIG_FILE], ["$default_config_file"], [The default configuration file])
  85. AC_SUBST([DEFAULT_CONFIG_FILE], [$default_config_file])
  86. -if test -z $INIT_TYPE; then
  87. +if test -z "$INIT_TYPE"; then
  88. INIT_TYPE=undetected
  89. elif test $INIT_TYPE = systemd; then
  90. AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
  91. --- a/configure 2019-03-30 12:47:25.313485929 +0000
  92. +++ b/configure 2019-03-30 12:48:08.009841269 +0000
  93. @@ -1631,7 +1631,7 @@ Optional Packages:
  94. --with-default-config-file=FILE
  95. Default configuration file
  96. --with-systemdsystemunitdir=DIR
  97. - Directory for systemd service files
  98. + Directory for systemd service files]
  99. Some influential environment variables:
  100. PKG_CONFIG path to pkg-config utility
  101. @@ -3858,8 +3858,6 @@ fi
  102. # Check whether --with-systemdsystemunitdir was given.
  103. if test "${with_systemdsystemunitdir+set}" = set; then :
  104. withval=$with_systemdsystemunitdir;
  105. -else
  106. - with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
  107. fi
  108. @@ -5931,7 +5929,7 @@ $as_echo "yes" >&6; }
  109. #define $WARN_VAR 1
  110. _ACEOF
  111. - if test -z $WARN_VAR_SHORT; then :
  112. + if test -z "$WARN_VAR_SHORT"; then :
  113. else
  114. cat >>confdefs.h <<_ACEOF
  115. @@ -12520,44 +12518,58 @@ fi
  116. INIT_TYPE=
  117. -if test -z $init_type; then
  118. +if test -n "$init_type"; then :
  119. + INIT_TYPE=$init_type
  120. +elif test -n "$with_systemdsystemunitdir"; then :
  121. + INIT_TYPE=systemd
  122. +else
  123. +
  124. /sbin/init --version 2>/dev/null | grep -q upstart
  125. - if test $? -eq 0; then
  126. + if test $? -eq 0; then :
  127. INIT_TYPE=upstart
  128. - else
  129. +else
  130. +
  131. init_path=`which systemctl 2>/dev/null`
  132. - if test \( $? -eq 0 -a -x "$init_path" \); then
  133. + if test \( $? -eq 0 -a -x "$init_path" \); then :
  134. +
  135. systemctl | grep -q -- "-\.mount"
  136. - if test $? -eq 0; then
  137. + if test $? -eq 0; then :
  138. INIT_TYPE=systemd
  139. - fi
  140. - fi
  141. - if test \( -z "$INIT_TYPE" -a -f /etc/init.d/networking \); then
  142. +fi
  143. +
  144. +fi
  145. + if test \( -z "$INIT_TYPE" -a -f /etc/init.d/networking \); then :
  146. +
  147. init_path=`which openrc-run 2>/dev/null`
  148. - if test \( $? -eq 0 -a -x "$init_path" \); then
  149. + if test \( $? -eq 0 -a -x "$init_path" \); then :
  150. +
  151. head -1 /etc/init.d/networking | grep -q "^#! */.*/openrc-run$"
  152. - if test $? -eq 0; then
  153. + if test $? -eq 0; then :
  154. INIT_TYPE=openrc
  155. - fi
  156. - fi
  157. - fi
  158. - if test \( -z "$INIT_TYPE" -a -f /etc/init.d/cron -a ! -h /etc/init.d/cron \); then
  159. +fi
  160. +
  161. +fi
  162. +
  163. +fi
  164. + if test \( -z "$INIT_TYPE" -a -f /etc/init.d/cron -a ! -h /etc/init.d/cron \); then :
  165. INIT_TYPE=SYSV
  166. - fi
  167. - fi
  168. -else
  169. - INIT_TYPE=$init_type
  170. +fi
  171. +
  172. +fi
  173. +
  174. +fi
  175. +if test \( .$INIT_TYPE = .systemd -a -z "$with_systemdsystemunitdir" \); then :
  176. + with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
  177. fi
  178. if test $default_config_file; then :
  179. if test $default_config_file = yes -o $default_config_file = no; then :
  180. as_fn_error $? "A filename must be specified for default-config-file" "$LINENO" 5
  181. -
  182. fi
  183. CONFIG_FILE=$default_config_file
  184. CONFIG_OPTIONS="$CONFIG_OPTIONS DEFAULT_CONFIG_FILE=${default_config_file}"
  185. - ]
  186. +
  187. else
  188. default_config_file="/etc/$PACKAGE/$PACKAGE.conf"
  189. fi
  190. @@ -12569,7 +12581,7 @@ _ACEOF
  191. DEFAULT_CONFIG_FILE=$default_config_file
  192. -if test -z $INIT_TYPE; then
  193. +if test -z "$INIT_TYPE"; then
  194. INIT_TYPE=undetected
  195. elif test $INIT_TYPE = systemd; then
  196. systemdsystemunitdir=$with_systemdsystemunitdir