summaryrefslogtreecommitdiff
blob: 7f603028e63920edb8dc6ef4b1ccf836a015fee8 (plain)
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
https://gitlab.gnome.org/GNOME/network-manager-sstp/-/merge_requests/44

From abe1e3aa7e2cd71e979035168ffa54268bb26b9b Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Tue, 10 May 2022 19:29:26 +0000
Subject: [PATCH] configure.ac: fix bashism, use x prefix

configure scripts are expected to work with POSIX compliant shells providing
/bin/sh so use = instead of == to work with both Bash and other shells.

Also, throw in x"$var" == xvar guards (x) because it's a lot easier to just
have them and avoid pitfalls when a variable ends up not defined and having
a syntax error, even though it's not needed in every context depending
on shell.

Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AC_CACHE_CHECK([if pppd/mppe.h defines mppe_keys_xyz() functions], ac_cv_working
             return 0;]])],
     [ac_cv_working_mppe_h=yes],
     [ac_cv_working_mppe_h=no])])
-if test $ac_cv_working_mppe_h = yes; then
+if test $ac_cv_working_mppe_h = xyes; then
     AC_DEFINE(HAVE_MPPE_KEYS_FUNCTIONS, 1,
         [Define to 1 if you have <pppd/mppe.h> and it declares the mppe_keys_xyz() functions])
 fi
@@ -70,11 +70,11 @@ dnl  Support for the auth notify callback in pppd >= 2.4.9
 AC_ARG_WITH([pppd-auth-notify-support],
     [AS_HELP_STRING([--with-pppd-auth-notify-support], [is the auth-notifier supported by pppd])])
 if test x"$with_pppd_auth_notify_support" != xyes; then
-    if test x"$pppd_pkgconfig_support" == xyes; then        # pkgconfig implies pppd > 2.4.9
+    if test x"$pppd_pkgconfig_support" = xyes; then        # pkgconfig implies pppd > 2.4.9
         AS_VAR_SET([with_pppd_auth_notify_support],[yes])
     fi
 fi
-if test x"$with_pppd_auth_notify_support" == xyes; then
+if test x"$with_pppd_auth_notify_support" = xyes; then
     AC_DEFINE(USE_PPPD_AUTH_HOOK,1,[Define if pppd has support for client side authentication complete notification])
 else
     AS_VAR_SET([with_pppd_auth_notify_support],[no])
@@ -85,11 +85,11 @@ dnl Enable support for extended tls settings in pppd > 2.4.9
 AC_ARG_WITH([pppd-ext-tls-settings-suppport],
     [AS_HELP_STRING([--with-pppd-ext-tls-settings-support], [is settings such as pkcs12, tls-verify-method, tls-verify-key-usage and max-tls-version supported in by pppd])])
 if test x"$with_pppd_ext_tls_settings_support" != xyes; then
-    if test x"$pppd_pkgconfig_support" == xyes; then        # pkgconfig implies pppd > 2.4.9
+    if test x"$pppd_pkgconfig_support" = xyes; then        # pkgconfig implies pppd > 2.4.9
         AS_VAR_SET([with_pppd_ext_tls_settings_support],[yes])
     fi
 fi
-if test x"$with_pppd_ext_tls_settings_support" == xyes; then
+if test x"$with_pppd_ext_tls_settings_support" = xyes; then
     AC_DEFINE(USE_PPP_EXT_TLS_SETTINGS,1,[Define if pppd has support for extended tls-settings like pkcs12, tls-verify-method, tls-verify-key-usage, max-tls-version])
 else
     AS_VAR_SET([with_pppd_ext_tls_settings_support],[no])
@@ -102,7 +102,7 @@ AC_ARG_WITH([pppd-plugin-dir],
 if test -n "$with_pppd_plugin_dir" ; then
 	PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
 else
-    if test x"$pppd_pkgconfig_support" == xyes; then
+    if test x"$pppd_pkgconfig_support" = xyes; then
         PKG_CHECK_VAR(PPPD_PLUGIN_DIR, [pppd], [plugindir])
     else
 	    PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.7"
@@ -134,29 +134,29 @@ dnl
 AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-sstp without GNOME support, e.g. vpn service only]), [], [with_gnome_specified=no])
 AC_ARG_WITH(gtk4, AS_HELP_STRING([--with-gtk4], [Build NetworkManager-sstp with libnma-gtk4 support]), [], [with_gtk4_specified=no])
 AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--with-libnm-glib], [Build NetworkManager-sstp with libnm-glib comatibility (deprecated)]), [], [with_libnm_glib_specified=no])
-if test "$with_libnm_glib_specified" != no -a "$with_libnm_glib" != no; then
-	if test "$with_gnome_specified" != no -a "$with_gnome" == no; then
+if test x"$with_libnm_glib_specified" != xno -a x"$with_libnm_glib" != xno; then
+	if test x"$with_gnome_specified" != xno -a x"$with_gnome" = xno; then
 		AC_MSG_ERROR(Building --with-libnm-glib conflicts with --without-gnome)
 	fi
 fi
-if test "$with_gnome" != no; then
+if test x"$with_gnome" != xno; then
 	with_gnome=yes
 fi
-if test "$with_gtk4_specified" == no; then
+if test x"$with_gtk4_specified" = xno; then
 	with_gtk4=no
 fi
-if test "$with_gtk4" != yes; then
+if test x"$with_gtk4" != xyes; then
 	with_gtk4=no
 fi
-if test "$with_libnm_glib_specified" == no; then
+if test x"$with_libnm_glib_specified" = xno; then
 	with_libnm_glib=no
 fi
-if test "$with_libnm_glib" != yes; then
+if test x"$with_libnm_glib" != xyes; then
 	with_libnm_glib=no
 fi
-AM_CONDITIONAL(WITH_GNOME, test "$with_gnome" != no)
-AM_CONDITIONAL(WITH_GTK4, test "$with_gtk4" != no)
-AM_CONDITIONAL(WITH_LIBNM_GLIB, test "$with_libnm_glib" != no)
+AM_CONDITIONAL(WITH_GNOME, test x"$with_gnome" != xno)
+AM_CONDITIONAL(WITH_GTK4, test x"$with_gtk4" != xno)
+AM_CONDITIONAL(WITH_LIBNM_GLIB, test x"$with_libnm_glib" != xno)
 AC_ARG_ENABLE(absolute-paths, AS_HELP_STRING([--enable-absolute-paths], [Use absolute paths to in .name files. Useful for development. (default is no)]))
 
 GETTEXT_PACKAGE=NetworkManager-sstp
@@ -223,7 +223,7 @@ NM_COMPILER_WARNINGS([yes])
 
 NM_PLUGIN_DIR="$libdir/NetworkManager"
 AC_SUBST(NM_PLUGIN_DIR)
-if test x"$enable_absolute_paths" == x"yes"; then
+if test x"$enable_absolute_paths" = x"yes"; then
 	NM_PLUGIN_DIR_NAME_FILE="$NM_PLUGIN_DIR/"
 else
 	enable_absolute_paths=no
GitLab