diff options
| author | David M. Syzdek <david@syzdek.net> | 2021-05-05 15:44:31 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2021-05-05 15:44:31 -0800 |
| commit | 55d899cb668a08f3b02067474c51ca8360527bb2 (patch) | |
| tree | 4fa53ad4ad2fd8ca15bb84a2aa36b6fb0ba927f8 /acinclude.m4 | |
| parent | be8524854de433287f12d300bb2c304fd5b48b16 (diff) | |
| download | bbfw-55d899cb668a08f3b02067474c51ca8360527bb2.tar.gz bbfw-55d899cb668a08f3b02067474c51ca8360527bb2.tar.bz2 bbfw-55d899cb668a08f3b02067474c51ca8360527bb2.tar.xz bbfw-55d899cb668a08f3b02067474c51ca8360527bb2.zip | |
autotools: changing configure options for init scripts
Diffstat (limited to 'acinclude.m4')
| -rw-r--r-- | acinclude.m4 | 121 |
1 files changed, 43 insertions, 78 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 65200f0..5ef1d60 100644 --- a/acinclude.m4 +++ b/acinclude.m4 | |||
| @@ -57,100 +57,65 @@ AC_DEFUN([AC_BBFW_EXAMPLES],[dnl | |||
| 57 | ])dnl | 57 | ])dnl |
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | # AC_BBFW_SLACKWARE() | 60 | # AC_BBFW_INIT() |
| 61 | # ----------------------------------- | 61 | # ----------------------------------- |
| 62 | AC_DEFUN([AC_BBFW_SLACKWARE],[dnl | 62 | AC_DEFUN([AC_BBFW_INIT],[dnl |
| 63 | 63 | ||
| 64 | # display options | 64 | # display options |
| 65 | enableval="" | 65 | withval="" |
| 66 | AC_ARG_ENABLE( | 66 | AC_ARG_WITH( |
| 67 | slackware, | 67 | init, |
| 68 | [AS_HELP_STRING([--enable-slackware], [enable Slackware specific scripts [default=auto]])], | 68 | [AS_HELP_STRING([--with-init=type], [init system type of slackware, systemd, or init.d [default=auto]])], |
| 69 | [ ESLACKWARE=$enableval ], | 69 | [ WINIT=$withval ], |
| 70 | [ ESLACKWARE=$enableval ] | 70 | [ WINIT=$withval ] |
| 71 | ) | 71 | ) |
| 72 | |||
| 73 | # determine slackware version | ||
| 74 | SLACKWARE_VERSION="unknown" | ||
| 75 | if test -f /etc/slackware-version;then | ||
| 76 | SLACKWARE_VERSION=`cat /etc/slackware-version` | ||
| 77 | fi | ||
| 78 | KERNEL_NAME=`uname -s` | ||
| 79 | |||
| 80 | # sets options | ||
| 81 | if test "x${ESLACKWARE}" == "xyes";then | ||
| 82 | ENABLE_SLACKWARE=yes | ||
| 83 | elif test "x${ESLACKWARE}" == "xno";then | ||
| 84 | ENABLE_SLACKWARE=no | ||
| 85 | else | ||
| 86 | if test "x${SLACKWARE_VERSION}" = "xunknown" || test "x${KERNEL_NAME}" != "xLinux";then | ||
| 87 | ENABLE_SLACKWARE=no | ||
| 88 | else | ||
| 89 | ENABLE_SLACKWARE=yes | ||
| 90 | fi | ||
| 91 | fi | ||
| 92 | |||
| 93 | AM_CONDITIONAL([ENABLE_SLACKWARE], [test "${ENABLE_SLACKWARE}" == "yes"]) | ||
| 94 | ])dnl | ||
| 95 | |||
| 96 | |||
| 97 | # AC_BBFW_INITD() | ||
| 98 | # ----------------------------------- | ||
| 99 | AC_DEFUN([AC_BBFW_INITD],[dnl | ||
| 100 | |||
| 101 | # display options | ||
| 102 | enableval="" | 72 | enableval="" |
| 103 | AC_ARG_ENABLE( | 73 | AC_ARG_ENABLE( |
| 104 | initd, | 74 | init, |
| 105 | [AS_HELP_STRING([--enable-initd], [enable init.d script [default=auto]])], | 75 | [AS_HELP_STRING([--disable-init], [install init scripts [default=auto]])], |
| 106 | [ EINITD=$enableval ], | 76 | [ EINIT=$enableval ], |
| 107 | [ EINITD=$enableval ] | 77 | [ EINIT=$enableval ] |
| 108 | ) | 78 | ) |
| 109 | 79 | ||
| 110 | # sets options | 80 | # used specified init system |
| 111 | if test "x${EINITD}" == "xyes";then | 81 | ENABLE_INIT=auto |
| 82 | if test "x${EINIT}" == "xno";then | ||
| 83 | ENABLE_INIT=no | ||
| 84 | elif test "x${WINIT}" == "xinit.d";then | ||
| 85 | ENABLE_INIT=init.d | ||
| 112 | ENABLE_INITD=yes | 86 | ENABLE_INITD=yes |
| 113 | elif test "x${EINITD}" == "xno";then | 87 | elif test "x${WINIT}" == "xslackware";then |
| 114 | ENABLE_INITD=no | 88 | ENABLE_INIT=slackware |
| 115 | else | 89 | ENABLE_SLACKWARE=yes |
| 116 | if test -d "/etc/init.d/";then | 90 | elif test "x${WINIT}" == "xsystemd";then |
| 117 | ENABLE_INITD=yes | 91 | ENABLE_INIT=systemd |
| 118 | else | 92 | ENABLE_SYSTEMD=yes |
| 119 | ENABLE_INITD=no | 93 | elif test ""x${WINIT}" != "xno" && test ""x${WINIT}" != "xyes" && test "x${WINIT}" != "x";then |
| 120 | fi | 94 | AC_MSG_ERROR([unknown init system, must be slackware, systemd, or init.d.]) |
| 121 | fi | 95 | fi |
| 122 | 96 | ||
| 123 | AM_CONDITIONAL([ENABLE_INITD], [test "${ENABLE_INITD}" == "yes"]) | 97 | # auto detects init system |
| 124 | ])dnl | 98 | if test "${ENABLE_INIT}" == "auto";then |
| 125 | 99 | if test -f /etc/slackware-version;then | |
| 126 | 100 | ENABLE_INIT=slackware | |
| 127 | # AC_BBFW_SYSTEMD() | 101 | ENABLE_SLACKWARE=yes |
| 128 | # ----------------------------------- | 102 | elif test -d "/etc/systemd/system/";then |
| 129 | AC_DEFUN([AC_BBFW_SYSTEMD],[dnl | 103 | ENABLE_INIT=systemd |
| 130 | |||
| 131 | # display options | ||
| 132 | enableval="" | ||
| 133 | AC_ARG_ENABLE( | ||
| 134 | systemd, | ||
| 135 | [AS_HELP_STRING([--enable-systemd], [enable systemd unit file [default=auto]])], | ||
| 136 | [ ESYSTEMD=$enableval ], | ||
| 137 | [ ESYSTEMD=$enableval ] | ||
| 138 | ) | ||
| 139 | |||
| 140 | # sets options | ||
| 141 | if test "x${ESYSTEMD}" == "xyes";then | ||
| 142 | ENABLE_SYSTEMD=yes | ||
| 143 | elif test "x${ESYSTEMD}" == "xno";then | ||
| 144 | ENABLE_SYSTEMD=no | ||
| 145 | else | ||
| 146 | if test -d "/etc/systemd/system/";then | ||
| 147 | ENABLE_SYSTEMD=yes | 104 | ENABLE_SYSTEMD=yes |
| 105 | elif test -d "/etc/init.d/";then | ||
| 106 | ENABLE_INIT=init.d | ||
| 107 | ENABLE_INITD=yes | ||
| 108 | elif test "x${EINIT}" == "xyes";then | ||
| 109 | AC_MSG_ERROR([unable to determine init system type]) | ||
| 148 | else | 110 | else |
| 149 | ENABLE_SYSTEMD=no | 111 | ENABLE_INIT=no |
| 150 | fi | 112 | fi |
| 151 | fi | 113 | fi |
| 152 | 114 | ||
| 153 | AM_CONDITIONAL([ENABLE_SYSTEMD], [test "${ENABLE_SYSTEMD}" == "yes"]) | 115 | AM_CONDITIONAL([ENABLE_SLACKWARE], [test "x${ENABLE_SLACKWARE}" == "xyes"]) |
| 116 | AM_CONDITIONAL([ENABLE_INITD], [test "x${ENABLE_INITD}" == "xyes"]) | ||
| 117 | AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x${ENABLE_SYSTEMD}" == "xyes"]) | ||
| 154 | ])dnl | 118 | ])dnl |
| 155 | 119 | ||
| 120 | |||
| 156 | # end of m4 file | 121 | # end of m4 file |
