Commit 68c59dc8 authored by Pontus Freyhult's avatar Pontus Freyhult

Check whatever we're part of lsh or stand-alone and act accordingly.

Rev: src/sftp/ChangeLog:1.7
Rev: src/sftp/configure.ac:1.3
parent 71a4e680
2002-02-25 Pontus <pont@it.uu.se> 2002-02-25 Pontus <pont@it.uu.se>
* configure.ac: Added ugly fix to detect if we're part of the main
lsh distribution. If we are, assume $bindir/lshg works
satisfactionary.
* sftp_bind.c (lsftp_install_lsftp_cb): Return a pointer to the * sftp_bind.c (lsftp_install_lsftp_cb): Return a pointer to the
callback instead. callback instead.
(lsftp_do_rm): Adopted for new use of lsftp_install_lsftp_cb. (lsftp_do_rm): Adopted for new use of lsftp_install_lsftp_cb.
......
...@@ -11,6 +11,8 @@ AM_CONFIG_HEADER(config.h) ...@@ -11,6 +11,8 @@ AM_CONFIG_HEADER(config.h)
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
echo "srcdir:$srcdir: top:$top_srcdir:"
dnl We take options dnl We take options
AC_ARG_WITH(secsh, AC_ARG_WITH(secsh,
...@@ -41,9 +43,28 @@ fi ...@@ -41,9 +43,28 @@ fi
dnl Choose the correct secsh client dnl Choose the correct secsh client
dnl FIXME: If compiled together with lsh, won't find lshg? dnl FIXME: Ugly check to see if we're a part of lsh, how to do this better?
if test -f $srcdir/../lsh.c; then
# We're a part of lsh
# FIXME: We should probably do something smart with program_transform_name
# here, but what if we're configured with another
# --program-{prefix,suffix,transform-name} when the main lsh system?
# (But then again, that could be the case with bindir too.
transport_prog="$bindir/lshg"
before_opts="--subsystem=sftp"
after_opts="-G"
# Now, make sure these are included properly when compiling.
if test -z "$transport_prog"; then CPPFLAGS="$CPPFLAGS -DTRANSPORT_PROG='\"$transport_prog\"'"
CPPFLAGS="$CPPFLAGS -DTRANSPORT_BEFORE_OPTS='\"$before_opts\"'"
CPPFLAGS="$CPPFLAGS -DTRANSPORT_AFTER_OPTS='\"$after_opts\"'"
else
# Stand alone
if test -z "$transport_prog"; then
# No sech-client given, try to find an lshg # No sech-client given, try to find an lshg
AC_CHECK_PROG(found_lshg, lshg, [lshg]) AC_CHECK_PROG(found_lshg, lshg, [lshg])
...@@ -81,12 +102,12 @@ if test -z "$transport_prog"; then ...@@ -81,12 +102,12 @@ if test -z "$transport_prog"; then
fi fi
fi fi
fi fi
fi fi
dnl If we still haven't defined either of before_opts and after_opts, try to decide from transport_prog dnl If we still haven't defined either of before_opts and after_opts, try to decide from transport_prog
dnl (happens if the user told us what to use, but not how). dnl (happens if the user told us what to use, but not how).
if test -z "$before_opts" -a -z "$after_opts"; then if test -z "$before_opts" -a -z "$after_opts"; then
if test "$transport_prog" = "ssh"; then if test "$transport_prog" = "ssh"; then
before_opts="-s" before_opts="-s"
after_opts="sftp" after_opts="sftp"
...@@ -94,15 +115,15 @@ if test -z "$before_opts" -a -z "$after_opts"; then ...@@ -94,15 +115,15 @@ if test -z "$before_opts" -a -z "$after_opts"; then
if test "$transport_prog" = "lshg"; then if test "$transport_prog" = "lshg"; then
before_opts="--subsystem=sftp" before_opts="--subsystem=sftp"
fi fi
fi fi
AC_DEFINE_UNQUOTED(TRANSPORT_PROG, "$transport_prog", Program used for connecting)
AC_DEFINE_UNQUOTED(TRANSPORT_BEFORE_OPTS, "$before_opts", Options sent before argv)
AC_DEFINE_UNQUOTED(TRANSPORT_AFTER_OPTS, "$after_opts", Options sent after argv)
AC_MSG_NOTICE([Using $transport_prog as secsh-client, adding $before_opts in front of arguments and $after_opts after them.]) AC_DEFINE_UNQUOTED(TRANSPORT_PROG, "$transport_prog", Program used for connecting)
AC_DEFINE_UNQUOTED(TRANSPORT_BEFORE_OPTS, "$before_opts", Options sent before argv)
AC_DEFINE_UNQUOTED(TRANSPORT_AFTER_OPTS, "$after_opts", Options sent after argv)
fi
AC_MSG_NOTICE([Using $transport_prog as secsh-client, adding $before_opts in front of arguments and $after_opts after them.])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment