aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--acinclude.m4121
-rw-r--r--configure.ac8
2 files changed, 45 insertions, 84 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# -----------------------------------
62AC_DEFUN([AC_BBFW_SLACKWARE],[dnl 62AC_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# -----------------------------------
99AC_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
129AC_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
diff --git a/configure.ac b/configure.ac
index a01515b..20fda78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,9 +68,7 @@ AC_BINDLE_GIT_PACKAGE_VERSION([contrib/bindletools/build-aux/git-package-version
68 68
69# custom configure options 69# custom configure options
70AC_BBFW_EXAMPLES 70AC_BBFW_EXAMPLES
71AC_BBFW_SLACKWARE 71AC_BBFW_INIT
72AC_BBFW_INITD
73AC_BBFW_SYSTEMD
74 72
75 73
76# Creates outputs 74# Creates outputs
@@ -82,9 +80,7 @@ AC_MSG_NOTICE([ ])
82AC_MSG_NOTICE([ Bindle Binaries Linux Firewall $GIT_PACKAGE_VERSION ($GIT_PACKAGE_BUILD)]) 80AC_MSG_NOTICE([ Bindle Binaries Linux Firewall $GIT_PACKAGE_VERSION ($GIT_PACKAGE_BUILD)])
83AC_MSG_NOTICE([ ]) 81AC_MSG_NOTICE([ ])
84AC_MSG_NOTICE([ Install:]) 82AC_MSG_NOTICE([ Install:])
85AC_MSG_NOTICE([ Slackware Init Script: ${ENABLE_SLACKWARE}]) 83AC_MSG_NOTICE([ Init Files: ${ENABLE_INIT}])
86AC_MSG_NOTICE([ Init.d Scriptb: ${ENABLE_INITD}])
87AC_MSG_NOTICE([ System Unit: ${ENABLE_SYSTEMD}])
88AC_MSG_NOTICE([ Example Files: ${ENABLE_EXAMPLES}]) 84AC_MSG_NOTICE([ Example Files: ${ENABLE_EXAMPLES}])
89AC_MSG_NOTICE([ ]) 85AC_MSG_NOTICE([ ])
90AC_MSG_NOTICE([ Please send suggestions to: $PACKAGE_BUGREPORT]) 86AC_MSG_NOTICE([ Please send suggestions to: $PACKAGE_BUGREPORT])