summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2023-04-18 07:29:37 -0600
committerTodd C. Miller <Todd.Miller@sudo.ws>2023-04-18 07:29:37 -0600
commit62eb0a713c83dc803e2823dad34ab8e4399dd132 (patch)
tree819b6916ba55d3afcb126971103f447dbf2db96a
parentacce6fe718a98046a7acd0ac20779358086e682e (diff)
downloadsudo-62eb0a713c83dc803e2823dad34ab8e4399dd132.tar.gz
Move CONFIGURE_ARGS from sudo_usage.h.in to config.h.in.
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure8
-rw-r--r--configure.ac12
-rw-r--r--src/sudo.c1
-rw-r--r--src/sudo_usage.h.in5
5 files changed, 19 insertions, 10 deletions
diff --git a/config.h.in b/config.h.in
index ce197bf73..6389dc68f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,6 +3,9 @@
#ifndef SUDO_CONFIG_H
#define SUDO_CONFIG_H
+/* Configure script arguments used to build sudo. */
+#undef CONFIGURE_ARGS
+
/* Define to 1 if you want the insults from the "classic" version sudo. */
#undef CLASSIC_INSULTS
diff --git a/configure b/configure
index 3a088d229..003dc6e42 100755
--- a/configure
+++ b/configure
@@ -809,7 +809,6 @@ LIBCRYPTO
LIBINTL
LIBRT
LIBDL
-CONFIGURE_ARGS
LIBTOOL_DEPS
ZLIB_SRC
ZLIB
@@ -3604,7 +3603,6 @@ AAMAN=0
devdir='$(srcdir)'
PRELOAD_MODULE='-module'
LDAP='#'
-CONFIGURE_ARGS=$@
SUDO_NLS=disabled
exampledir='$(docdir)/examples'
PYTHON_PLUGIN='#'
@@ -3714,6 +3712,7 @@ devsearch="/dev/pts:/dev/vt:/dev/term:/dev/zcons:/dev/pty:/dev"
: ${SUDOERS_MODE='0440'}
: ${SUDOERS_UID='0'}
: ${SUDOERS_GID='0'}
+CONFIGURE_ARGS="$@"
AUTH_REG=
AUTH_EXCL=
AUTH_EXCL_DEF=
@@ -17519,6 +17518,11 @@ fi
fi
sudo_cv_prev_host="$host"
+cat >>confdefs.h <<EOF
+#define CONFIGURE_ARGS "$CONFIGURE_ARGS"
+EOF
+
+
if test -n "$host_os"
then :
diff --git a/configure.ac b/configure.ac
index 64c6a02f4..fd3e033ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,7 +86,6 @@ AC_SUBST([LOGINCAP_USAGE])dnl
AC_SUBST([ZLIB])dnl
AC_SUBST([ZLIB_SRC])dnl
AC_SUBST([LIBTOOL_DEPS])dnl
-AC_SUBST([CONFIGURE_ARGS], [$@])dnl
AC_SUBST([LIBDL])dnl
AC_SUBST([LIBRT])dnl
AC_SUBST([LIBINTL])dnl
@@ -240,6 +239,7 @@ dnl
dnl
dnl Other variables
dnl
+CONFIGURE_ARGS="$@"
AUTH_REG=
AUTH_EXCL=
AUTH_EXCL_DEF=
@@ -1737,6 +1737,11 @@ AS_IF([test -n "$sudo_cv_prev_host"], [
sudo_cv_prev_host="$host"
dnl
+dnl Store configure arguments for "sudo -V"
+dnl
+SUDO_DEFINE_UNQUOTED([CONFIGURE_ARGS], "$CONFIGURE_ARGS")
+
+dnl
dnl We want to be able to differentiate between different rev's
dnl
AS_IF([test -n "$host_os"], [
@@ -4686,7 +4691,10 @@ dnl
dnl Bits to copy verbatim into config.h.in
dnl
AH_TOP([#ifndef SUDO_CONFIG_H
-#define SUDO_CONFIG_H])
+#define SUDO_CONFIG_H
+
+/* Configure script arguments used to build sudo. */
+#undef CONFIGURE_ARGS])
AH_BOTTOM([#ifndef HAVE_SIG_ATOMIC_T
typedef int sig_atomic_t;
diff --git a/src/sudo.c b/src/sudo.c
index 288b6970a..974309d79 100644
--- a/src/sudo.c
+++ b/src/sudo.c
@@ -64,7 +64,6 @@
# include <prot.h>
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
-#include <sudo_usage.h>
#include "sudo.h"
#include "sudo_plugin.h"
#include "sudo_plugin_int.h"
diff --git a/src/sudo_usage.h.in b/src/sudo_usage.h.in
index c020e24d4..557dbde55 100644
--- a/src/sudo_usage.h.in
+++ b/src/sudo_usage.h.in
@@ -31,9 +31,4 @@
#define SUDO_USAGE4 " [-ABbEHkNnPS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C num] [-D directory] @LOGINCAP_USAGE@[-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i | -s] [command [arg ...]]"
#define SUDO_USAGE5 " -e [-ABkNnS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C num] @LOGINCAP_USAGE@[-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ..."
-/*
- * Configure script arguments used to build sudo.
- */
-#define CONFIGURE_ARGS "@CONFIGURE_ARGS@"
-
#endif /* SUDO_USAGE_H */