[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSH on ETRAX?



And note that you have to patch the Configure.in or otherwise
work around that autoconf sucks at cross-compiling :-)
I posted a patch to the openssh-unix-dev mailinglist a long time ago
(2000-12-18) but below is a mail with patches I sent to another guy
a couple of months ago, hope it helps - it's probably not entirely up
to date with what we have in our CVS though.

We should probably put the real patch in the download section of
developer.axis.com, but... so much to be done - so little time.

Hope this helps
/Johan


---------
It was a while since I worked on that and I didn't quite completed the test.
I have gotten the openssh 2.3.0p1 to configure and compile but I haven't
been able to run it successfully.
I believe the problem lies in the regexp implemenetation in
uC-libc that we use (we have now updated the regexp part to the glibc
version
but I haven't had the time to test to see if that helps).

I haven't checked the latest releases to see if any of the patches I
submitted
ever made it to real version.

Below is a clip from the Makefile I use to do the configure and build stuff
and after that a diff of the configure.in compared to openssh 2.3.0p1.

openssl 0.9.6 was rather easy (especially compared to 0.9.4 I tried a long
time ago)
I did something like this: (The __FreeBSD kludge is there since -DUSE_TOD
didn't work as I believe it should.. :-)
I had to add support for configuring the value of AR in Configure as well.
The zlib we already had ported, just make sure it's installed in
$(prefix)/lib and the
includefiles in $(prefix)/include.

Hope ths helps!
/Johan

----openssl wrapper Makefile---
ifdef ELINUX
CONFTARGET = elinux-aout-etrax100 -D__FreeBSD__
else
ifdef CLINUX
CONFTARGET = linux-elf-cris -D__FreeBSD__
else
CONFTARGET = linux-elf
endif
endif
ifndef OPENSSLOPTIONS
OPENSSLOPTIONS = no-asm no-threads
# no-idea
endif
openssl/Makefile:
        (cd openssl; ./Configure
$(CONFTARGET) --prefix=$(prefix) --openssldir=$(prefix
) -DUSE_TOD  $(OPENSSLOPTIONS); )


---openssh wrapper Makefile:-------
WRAPDIR=openssh
#Include correct definitions of CC, CPP, LD etc.
include $(APPS)/Rules.elinux

LIBMODE  = 0644
INSTMODE  = 0755
OWNER = -o root -g root

CONFOPTIONS = \
--with-random=/dev/urandom \
--prefix= \
--with-ssl-dir=$(prefix) \
--localstatedir=/var \
--sysconfdir=/etc

#--disable-pthreads
ifdef ELINUX
CONFTARGET = elinux-aout-etrax100
CONFOPTIONS
+= --includedir=$(prefix)/include/uC-libc --target=elinux-etrax --host=elinu
x-etrax
else
ifdef CLINUX
CONFTARGET = linux-elf-cris
CONFOPTIONS
+= --includedir=$(prefix)/include/uC-libc --target=linux-cris --host=linux-c
ris
else
CONFTARGET = linux-elf

endif
endif
CFLAGS += -I$(prefix)/include
LDFLAGS += -L$(prefix)/lib

#CFLAGS += -static
#LDFLAGS += -static

OPTS= -DGETPGRP_VOID=1
#-DHAVE_SNPRINTF=1
#-DHAVE_UNISTD_H=1 -DHAVE_GETOPT=1  -DHAVE_VSNPRINTF=1

ENVSETTINGS = WANTS_RSAREF=0
ENVSETTINGS += no_dev_ptmx=1
ENVSETTINGS += no_dev_ptc=1
ENVSETTINGS += rsa_works=1

all: build


configure $(WRAPDIR)/Makefile: $(WRAPDIR)/Makefile.in
rm -f $(WRAPDIR)/config.cache
echo "## CPP: $(CPP)"
(cd $(WRAPDIR); RANLIB="$(RANLIB)" AR="$(AR)" INSTALL="$(INSTALL)"
CC="$(CC)" CPP="$(CPP)" CPPLAGS="$(CPPLAGS)" CFLAGS="$(CFLAGS) $(OPTS)"
LDFLAGS="$(LDFLAGS)" HOST="\"elinux\"" $(ENVSETTINGS) DESTDIR=$(prefix)
./configure $(CONFOPTIONS)  )
#host elinux clinux:
# make -C $(WRAPDIR) $@

build: $(WRAPDIR)/Makefile
@xxxxxxx.a apps/crypto/openssl
make NO_SHARED_LIB=1 -C $(WRAPDIR)

clean:
-make -C $(WRAPDIR) $@
-rm -f $(WRAPDIR)/Makefile

# Installs a lot of things...
install: all
@xxxxxxx. instead ##"
make DESTDIR=$(prefix) -C $(WRAPDIR) $@

# Install only what we want
libssh.a: $(WRAPDIR)/Makefile
make -C $(WRAPDIR) $@
$(INSTALL) -d $(prefix)/lib
$(INSTALL) -m $(LIBMODE) $(OWNER) $(WRAPDIR)/$@ $(prefix)/lib

ssh: $(WRAPDIR)/Makefile
make -C $(WRAPDIR) $@
$(INSTALL) -d $(prefix)/bin
$(INSTALL) -d $(prefix)/etc
$(INSTALL) -m $(INSTMODE) $(OWNER) $(WRAPDIR)/$@ $(prefix)/bin
$(INSTALL) -m 0644 $(OWNER) $(WRAPDIR)/ssh_config $(prefix)/etc

---------------
RCS file: /n/cvsroot/apps/crypto/openssh/openssh/configure.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- configure.in 2000/12/18 18:21:48 1.1.1.1
+++ configure.in 2000/12/18 18:24:13 1.2
@@ -332,11 +332,22 @@ int main(void){char b[5];snprintf(b,5,"1
  AC_MSG_RESULT(no)
  AC_DEFINE(BROKEN_SNPRINTF)
  AC_MSG_WARN([****** Your snprintf() function is broken, complain to your
vendor])
+ ],
+

+ AC_MSG_RESULT(yes)
+ AC_MSG_WARN([** Cross compiling, assuming correct snprintf ])
  ]
  )
 fi

+# AC_FUNC_GETPGRP doesn't handle cross compiling
+if test "$cross_compiling" = no; then
 AC_FUNC_GETPGRP
+else
+AC_MSG_WARN([** Cross compiling, assuming getpgrp() takes argument
+ use -DGETGRP_VOID=1 to override.
+]);
+fi

 PAM_MSG="no"
 AC_ARG_WITH(pam,
@@ -409,11 +420,12 @@ AC_CACHE_CHECK([for OpenSSL directory],

  # Basic test to check for compatible version and correct linking
  # *does not* test for RSA - that comes later.
- AC_TRY_RUN(
+ AC_TRY_LINK(
  [
 #include <string.h>
 #include <openssl/rand.h>
-int main(void)
+ ],
+ [
 {
  char a[2048];
  memset(a, 0, sizeof(a));
@@ -484,8 +496,12 @@ int main(void)
  ],
  [
  rsa_works=1
+ break;
+ ], [],
+

+ AC_MSG_WARN( [** Cross compiling, use rsa_works=1 if RSA works])
  break;
- ], [])
+ ])
 done

 if test ! -z "$no_rsa" ; then
@@ -947,15 +963,17 @@ if test -z "$no_dev_ptmx" ; then
  [
  AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
  have_dev_ptmx=1
+ ], []
+ )
+fi
+if test -z "$no_dev_ptc" ; then
+ AC_CHECK_FILE("/dev/ptc",
+ [
+ AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
+ have_dev_ptc=1
  ]
  )
 fi
-AC_CHECK_FILE("/dev/ptc",
- [
- AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
- have_dev_ptc=1
- ]
-)

 # Options from here on. Some of these are preset by platform above





----- Original Message -----
From: "Henrik Eriksson" <henriken@xxxxxxx.com>
To: <dstocks@xxxxxxx.com>
Sent: den 5 december 2001 19:14
Subject: RE: SSH on ETRAX?


> Hi
>
> > Has anyone ported the SSH Server (sshd) to the ETRAX
> > processor?  If so, drop me a note.
>
> OpenSSHs sshd runs on both ETRAX100 and ETRAX100LX.
> Beware of the flash and RAM footprints though.
>
> /henrik
>