Added SSHD_BIN in configure.ac

This commit is contained in:
Olof hagsand 2023-11-28 17:02:13 +01:00
parent b9ed302de1
commit 81b4fdb274
5 changed files with 64 additions and 5 deletions

55
configure vendored
View file

@ -654,6 +654,7 @@ CLIGEN_DIR
WC_BIN WC_BIN
TAIL_BIN TAIL_BIN
GREP GREP
SSHD_BIN
SSH_BIN SSH_BIN
LEXLIB LEXLIB
LEX_OUTPUT_ROOT LEX_OUTPUT_ROOT
@ -5685,7 +5686,7 @@ if test "$LEX" = ":"; then
as_fn_error $? "CLIXON does not find lex or flex." "$LINENO" 5 as_fn_error $? "CLIXON does not find lex or flex." "$LINENO" 5
fi fi
# SSH binary path # SSH binary path for client and test
# Extract the first word of "ssh", so it can be a program name with args. # Extract the first word of "ssh", so it can be a program name with args.
set dummy ssh; ac_word=$2 set dummy ssh; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@ -5732,7 +5733,57 @@ fi
printf "%s\n" "#define SSH_BIN \"$SSH_BIN\"" >>confdefs.h printf "%s\n" "#define SSH_BIN \"${SSH_BIN}\"" >>confdefs.h
# SSHD binary path for test
# Extract the first word of "sshd", so it can be a program name with args.
set dummy sshd; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_SSHD_BIN+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $SSHD_BIN in
[\\/]* | ?:[\\/]*)
ac_cv_path_SSHD_BIN="$SSHD_BIN" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_SSHD_BIN="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
SSHD_BIN=$ac_cv_path_SSHD_BIN
if test -n "$SSHD_BIN"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SSHD_BIN" >&5
printf "%s\n" "$SSHD_BIN" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
printf "%s\n" "#define SSHD_BIN \"${SSHD_BIN}\"" >>confdefs.h
# For cli pipe output functions # For cli pipe output functions

View file

@ -151,9 +151,13 @@ if test "$LEX" = ":"; then
AC_MSG_ERROR(CLIXON does not find lex or flex.) AC_MSG_ERROR(CLIXON does not find lex or flex.)
fi fi
# SSH binary path # SSH binary path for client and test
AC_PATH_PROG(SSH_BIN, ssh) AC_PATH_PROG(SSH_BIN, ssh)
AC_DEFINE_UNQUOTED(SSH_BIN, "$SSH_BIN", [SSH binary]) AC_DEFINE_UNQUOTED(SSH_BIN, "${SSH_BIN}", [SSH binary])
# SSHD binary path for test
AC_PATH_PROG(SSHD_BIN, sshd)
AC_DEFINE_UNQUOTED(SSHD_BIN, "${SSHD_BIN}", [SSHD binary])
# For cli pipe output functions # For cli pipe output functions
AC_PROG_GREP AC_PROG_GREP

View file

@ -171,6 +171,9 @@
/* Default restconf network namespace */ /* Default restconf network namespace */
#undef RESTCONF_NETNS_DEFAULT #undef RESTCONF_NETNS_DEFAULT
/* SSHD binary */
#undef SSHD_BIN
/* SSH binary */ /* SSH binary */
#undef SSH_BIN #undef SSH_BIN

View file

@ -78,6 +78,7 @@
#include "clixon_yang_schema_mount.h" #include "clixon_yang_schema_mount.h"
#include "clixon_xml_nsctx.h" #include "clixon_xml_nsctx.h"
#include "clixon_xml_io.h" #include "clixon_xml_io.h"
#include "clixon_xml_bind.h"
#include "clixon_xml_default.h" #include "clixon_xml_default.h"
#include "clixon_xml_map.h" #include "clixon_xml_map.h"
#include "clixon_datastore.h" #include "clixon_datastore.h"

View file

@ -83,7 +83,7 @@ sudo clixon_netconf_ssh_callhome -a 127.0.0.1 -c /var/tmp/./test_netconf_ssh_cal
#include <sys/socket.h> #include <sys/socket.h>
#define NETCONF_CH_SSH 4334 #define NETCONF_CH_SSH 4334
#define SSHDBIN_DEFAULT CLIXON_CONFIG_SBINDIR "/sshd" #define SSHDBIN_DEFAULT SSHD_BIN
#define UTIL_OPTS "hD:f:a:p:s:c:C:" #define UTIL_OPTS "hD:f:a:p:s:c:C:"
static int static int