# This file: # ftp://ftp.u.washington.edu/pub/user-supported/donn/ssh-beosppc-patch # # With these patches to the 1.2.26_src from BeWare, ssh builds and works # for me on BeOS 4.5 PPC (Macintosh PPC 604). # # There's also a fix here for the BeBox. I haven't checked this patch # to verify that I remembered the fix right. If it doesn't work, fix # config.guess as needed to match uname -a. I guess everything could # still work with BeOS 4.0 PPC. # # I don't think it matters very much, as this setup still doesn't get # us the asm arithmetic from the GNU mp library. Look into configure # in gmp-* to see how it checks the .s files. That's where it fails, # probably because mwcc's asm handling (if any) is not compatible. # Meanwhile, we get by on generic C arithmetic. # # I used the BeOS (MetroWerks) ar, and just rewrote the Makefile to # avoid the lib repacking. I got rid of -lroot et al., it appeared # to be redundant in a noisy way, and it looks like the configure # substituted -L/usr/local/lib. Think I should have defined LIB empty, # but anyway it's harmless unless you have similar libraries there. # # They're context diffs. To apply: # (... get ssh PPC source from BeWare ...) # $ cd ssh-1.2.26 # $ patch -p0 < ../ssh-patch # $ ./configure --prefix=/boot/home/config > configure.log 2>&1 # $ make > make.log 2>&1 # # Donn Cave, donn@u.washington.edu # *** configure.dist Sun Jan 24 10:54:03 1999 --- configure Thu Jul 1 13:05:39 1999 *************** *** 652,663 **** echo "$ac_t""$host" 1>&6 # begin __BEOS__ ! if test "$host_vendor" = "be" && test "$host_cpu" = "i386"; then ! LIBS="-L/boot/develop/lib/x86 -lroot -lbe" ! fi if test "$host_vendor" = "be" && test "$host_cpu" = "powerpc"; then ! LIBS="-L/boot/develop/lib/ppc -lroot -lbe" CFLAGS="-relax_pointers" fi # end __BEOS__ --- 652,663 ---- echo "$ac_t""$host" 1>&6 # begin __BEOS__ ! # if test "$host_vendor" = "be" && test "$host_cpu" = "i386"; then ! # LIBS="-L/boot/develop/lib/x86 -lroot -lbe" ! # fi if test "$host_vendor" = "be" && test "$host_cpu" = "powerpc"; then ! # LIBS="-L/boot/develop/lib/ppc -lroot -lbe" CFLAGS="-relax_pointers" fi # end __BEOS__ *************** *** 3190,3196 **** fi done ! for ac_hdr in sys/resource.h login_cap.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --- 3190,3196 ---- fi done ! for ac_hdr in login_cap.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 *************** *** 4310,4316 **** fi ! for ac_func in gettimeofday times getrusage ftruncate revoke makeutx do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:4306: checking for $ac_func" >&5 --- 4310,4316 ---- fi ! for ac_func in gettimeofday times ftruncate revoke makeutx do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:4306: checking for $ac_func" >&5 *** config.guess.dist Mon Jan 25 14:14:41 1999 --- config.guess Thu Jul 1 11:29:01 1999 *************** *** 58,64 **** BeMac:BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; ! BeBox::BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; # end __BEOS__ --- 58,64 ---- BeMac:BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; ! BeBox::BeOS:4.*:*|bebox::BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; # end __BEOS__ *** Makefile.in.dist Wed Jul 8 09:40:39 1998 --- Makefile.in Thu Jul 1 13:11:26 1999 *************** *** 294,301 **** SHELL = /bin/sh GMPDIR = gmp-2.0.2-ssh-2 ! GMPLIBS = -L$(GMPDIR) -lgmp ! GMPDEP = $(GMPDIR)/gmp.h $(GMPDIR)/libgmp.a ZLIBDIR = zlib-1.0.4 ZLIBDEP = $(ZLIBDIR)/libz.a --- 294,301 ---- SHELL = /bin/sh GMPDIR = gmp-2.0.2-ssh-2 ! GMPLIBS = $(GMPDIR)/libgmp.a $(GMPDIR)/mpn/libmpn.a $(GMPDIR)/mpz/libmpz.a ! GMPDEP = $(GMPDIR)/gmp.h $(GMPLIBS) ZLIBDIR = zlib-1.0.4 ZLIBDEP = $(ZLIBDIR)/libz.a *************** *** 391,397 **** #endif F_SECURE_COMMERCIAL SCRIPT_PROGRAMS = make-ssh-known-hosts SBIN_PROGRAMS = sshd ! PROGRAMS = ssh $(SBIN_PROGRAMS) $(NORMAL_PROGRAMS) $(SCRIPT_PROGRAMS) \ $(X_PROGRAMS) $(OTHER_PROGRAMS) SSH_PROGRAM = $(bindir)/ssh1 --- 391,397 ---- #endif F_SECURE_COMMERCIAL SCRIPT_PROGRAMS = make-ssh-known-hosts SBIN_PROGRAMS = sshd ! PROGRAMS = ssh $(NORMAL_PROGRAMS) $(SCRIPT_PROGRAMS) \ $(X_PROGRAMS) $(OTHER_PROGRAMS) SSH_PROGRAM = $(bindir)/ssh1 *************** *** 457,465 **** mkdir $(ZLIBDIR); \ cp $(srcdir)/$(ZLIBDIR)/Makefile $(ZLIBDIR); \ fi ! cd $(ZLIBDIR); $(MAKE) VPATH=$(srcdir)/$(ZLIBDIR):../$(srcdir)/$(ZLIBDIR) \ ! CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I$(srcdir)/$(ZLIBDIR) \ ! -I../$(srcdir)/$(GMPDIR)" RANLIB="$(RANLIB)" libz.a $(RSAREFSRCDIR)/librsaref.a: -if test '!' -d $(RSAREFDIR); then \ --- 457,465 ---- mkdir $(ZLIBDIR); \ cp $(srcdir)/$(ZLIBDIR)/Makefile $(ZLIBDIR); \ fi ! cd $(ZLIBDIR); $(MAKE) VPATH=$(srcdir)/../$(ZLIBDIR) \ ! CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I$(srcdir)/../$(ZLIBDIR) \ ! -I$(srcdir)/../$(GMPDIR)" RANLIB="$(RANLIB)" libz.a $(RSAREFSRCDIR)/librsaref.a: -if test '!' -d $(RSAREFDIR); then \ *** readpass.c.dist Mon Oct 26 14:06:35 1998 --- readpass.c Tue Jun 8 12:31:40 1999 *************** *** 92,118 **** #ifdef USING_SGTTY struct sgttyb tio; #endif FILE *f; UserFile uf; int i; if (from_stdin) { f = stdin; } else { #ifdef __BEOS__ ! debug( "tty = %s", getenv( "TTY" ) ); ! f = fopen( getenv( "TTY" ), "r" ); #else /* Read the passphrase from /dev/tty to make it possible to ask it even when stdin has been redirected. */ f = fopen("/dev/tty", "r"); #endif ! if (!f) { if (getenv("DISPLAY")) { char command[512]; --- 92,145 ---- #ifdef USING_SGTTY struct sgttyb tio; #endif + #ifdef __BEOS__ + #define USING_UNIXIO + #endif + #ifdef USING_UNIXIO + # define VALID_FILE(f) (f >= 0) + # define UNIX_FILE(f) (f) + # define STDINPUT(f) (f == 0) + int f, nr; + #else + # define VALID_FILE(f) (f != 0) + # define UNIX_FILE(f) fileno(f) + # define STDINPUT(f) (f == stdin) FILE *f; + #endif UserFile uf; int i; if (from_stdin) { + #ifdef USING_UNIXIO + f = 0; + #else f = stdin; + #endif } else { #ifdef __BEOS__ ! /* ! ** PPC BeOS quirk, stdio fopen() fails with Device Busy. ! ** open() O_RDONLY works though, and is fine for this purpose. ! ** DC. ! */ ! char *ttyname = getenv("TTY"); ! debug( "tty = %s", ttyname); ! f = open(ttyname, O_RDONLY); #else /* Read the passphrase from /dev/tty to make it possible to ask it even when stdin has been redirected. */ f = fopen("/dev/tty", "r"); #endif ! if (!VALID_FILE(f)) { + #ifdef __BEOS__ + if (1) + #else if (getenv("DISPLAY")) + #endif { char command[512]; *************** *** 174,180 **** } #ifdef __BEOS__ ! (void)fcntl( fileno(f), F_SETFL, 0 ); #endif for(p = (unsigned const char *) prompt, i = 0; --- 201,207 ---- } #ifdef __BEOS__ ! (void)fcntl(UNIX_FILE(f), F_SETFL, 0 ); #endif for(p = (unsigned const char *) prompt, i = 0; *************** *** 202,211 **** /* Get terminal modes. */ #ifdef USING_TERMIOS ! tcgetattr(fileno(f), &tio); #endif #ifdef USING_SGTTY ! ioctl(fileno(f), TIOCGETP, &tio); #endif saved_tio = tio; /* Save signal handler and set the new handler. */ --- 229,238 ---- /* Get terminal modes. */ #ifdef USING_TERMIOS ! tcgetattr(UNIX_FILE(f), &tio); #endif #ifdef USING_SGTTY ! ioctl(UNIX_FILE(f), TIOCGETP, &tio); #endif saved_tio = tio; /* Save signal handler and set the new handler. */ *************** *** 214,255 **** /* Set new terminal modes disabling all echo. */ #ifdef USING_TERMIOS tio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); ! tcsetattr(fileno(f), TCSANOW, &tio); #endif #ifdef USING_SGTTY tio.sg_flags &= ~(ECHO); ! ioctl(fileno(f), TIOCSETP, &tio); #endif /* Read the passphrase from the terminal. */ if (fgets(buf, sizeof(buf), f) == NULL) { /* Got EOF. Just exit. */ /* Restore terminal modes. */ #ifdef USING_TERMIOS ! tcsetattr(fileno(f), TCSANOW, &saved_tio); #endif #ifdef USING_SGTTY ! ioctl(fileno(f), TIOCSETP, &saved_tio); #endif /* Restore the signal handler. */ signal(SIGINT, old_handler); /* Print a newline (the prompt probably didn\'t have one). */ fprintf(stderr, "\n"); #ifdef __BEOS__ ! (void)fcntl( fileno(f), F_SETFL, O_NONBLOCK ); #endif /* Close the file. */ if (f != stdin) fclose(f); exit(1); } /* Restore terminal modes. */ #ifdef USING_TERMIOS ! tcsetattr(fileno(f), TCSANOW, &saved_tio); #endif #ifdef USING_SGTTY ! ioctl(fileno(f), TIOCSETP, &saved_tio); #endif /* Restore the signal handler. */ (void)signal(SIGINT, old_handler); --- 241,295 ---- /* Set new terminal modes disabling all echo. */ #ifdef USING_TERMIOS tio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); ! tcsetattr(UNIX_FILE(f), TCSANOW, &tio); #endif #ifdef USING_SGTTY tio.sg_flags &= ~(ECHO); ! ioctl(UNIX_FILE(f), TIOCSETP, &tio); #endif /* Read the passphrase from the terminal. */ + #ifdef USING_UNIXIO + nr = read(f, buf, sizeof(buf) - 1); + if (nr > 0) + buf[nr] = 0; + else + #else if (fgets(buf, sizeof(buf), f) == NULL) + #endif { /* Got EOF. Just exit. */ /* Restore terminal modes. */ #ifdef USING_TERMIOS ! tcsetattr(UNIX_FILE(f), TCSANOW, &saved_tio); #endif #ifdef USING_SGTTY ! ioctl(UNIX_FILE(f), TIOCSETP, &saved_tio); #endif /* Restore the signal handler. */ signal(SIGINT, old_handler); /* Print a newline (the prompt probably didn\'t have one). */ fprintf(stderr, "\n"); #ifdef __BEOS__ ! /* (What is this for? DC.) */ ! (void)fcntl(f, F_SETFL, O_NONBLOCK ); #endif /* Close the file. */ + #ifdef USING_UNIXIO + if (f != 0) + close(f); + #else if (f != stdin) fclose(f); + #endif exit(1); } /* Restore terminal modes. */ #ifdef USING_TERMIOS ! tcsetattr(UNIX_FILE(f), TCSANOW, &saved_tio); #endif #ifdef USING_SGTTY ! ioctl(UNIX_FILE(f), TIOCSETP, &saved_tio); #endif /* Restore the signal handler. */ (void)signal(SIGINT, old_handler); *************** *** 264,274 **** /* Print a newline since the prompt probably didn\'t have one. */ fprintf(stderr, "\n"); #ifdef __BEOS__ ! (void)fcntl( fileno(f), F_SETFL, O_NONBLOCK ); #endif /* Close the file. */ if (f != stdin) fclose(f); return cp; } --- 304,319 ---- /* Print a newline since the prompt probably didn\'t have one. */ fprintf(stderr, "\n"); #ifdef __BEOS__ ! (void)fcntl(f, F_SETFL, O_NONBLOCK ); #endif /* Close the file. */ + #ifdef USING_UNIXIO + if (f != 0) + close(f); + #else if (f != stdin) fclose(f); + #endif return cp; } *** gmp-2.0.2-ssh-2/configure.dist Wed Jul 8 09:40:44 1998 --- gmp-2.0.2-ssh-2/configure Thu Jul 1 12:45:43 1999 *************** *** 2006,2043 **** fi ! # Check whether an underscore gets prepended in names ! echo $ac_n "checking whether underscore gets prepended in C function names""... $ac_c" 1>&6 ! echo "configure:2012: checking whether underscore gets prepended in C function names" >&5 ! if eval "test \"`echo '$''{'ac_cv_c_underscore'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ! cat > conftest.c </dev/null ! if test -n "`nm conftest.o | grep _foobarzappafunction`" 2>/dev/null; then ! ac_cv_c_underscore=yes ! elif test -n "`nm conftest.o | grep foobarzappafunction`" 2>/dev/null; then ! ac_cv_c_underscore=no ! else ! echo "configure: warning: CHECK FAILED" 1>&2 ! path="" ! fi ! rm -f conftest.o conftest.c ! fi ! ! echo "$ac_t""$ac_cv_c_underscore" 1>&6 ! if test "$ac_cv_c_underscore" = "yes"; then ! cat >> confdefs.h <<\EOF ! #define C_UNDERSCORE 1 ! EOF ! ! echo "Underscores are prepended in function names." >&5 ! else ! echo "Underscores are not prepended in function names." >&5 ! fi # Check for asm files functions="${extra_functions} inlines add_n addmul_1 cmp divmod_1 --- 2006,2012 ---- fi ! echo "Underscores are not prepended in function names." >&5 # Check for asm files functions="${extra_functions} inlines add_n addmul_1 cmp divmod_1 *************** *** 2047,2053 **** path="$path generic" if test '!' -d mpn; then mkdir mpn; fi ! echo $ac_n "checking asm code""... $ac_c" 1>&6 echo "configure:2052: checking asm code" >&5 if eval "test \"`echo '$''{'ac_cv_gmp_asm_status'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2016,2022 ---- path="$path generic" if test '!' -d mpn; then mkdir mpn; fi ! echo $ac_n "checking asm code $path""... $ac_c" 1>&6 echo "configure:2052: checking asm code" >&5 if eval "test \"`echo '$''{'ac_cv_gmp_asm_status'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2087,2092 **** --- 2056,2062 ---- remaining_functions="$remaining_functions $fn" fi done + echo $asm_links >&6 # Check whether --enable-asm or --disable-asm was given. if test "${enable_asm+set}" = set; then *** gmp-2.0.2-ssh-2/config.guess.dist Mon Jan 25 14:14:42 1999 --- gmp-2.0.2-ssh-2/config.guess Thu Jul 1 11:58:50 1999 *************** *** 58,64 **** BeMac:BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; ! BeBox::BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; # end __BEOS__ --- 58,64 ---- BeMac:BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; ! BeBox::BeOS:4.*:*|bebox::BeOS:4.*:*) echo powerpc-be-pef exit 0 ;; # end __BEOS__ *** gmp-2.0.2-ssh-2/Makefile.in.dist Wed Jul 8 09:40:46 1998 --- gmp-2.0.2-ssh-2/Makefile.in Thu Jul 1 12:02:06 1999 *************** *** 92,98 **** SUBDIRS = mpn mpz mpf mpq mpbsd demos ! lib_LIBRARIES = libgmp.a libmp.a info_TEXINFOS = gmp.texi include_HEADERS = gmp.h mp.h noinst_HEADERS = gmp-impl.h longlong.h stack-alloc.h urandom.h --- 92,98 ---- SUBDIRS = mpn mpz mpf mpq mpbsd demos ! lib_LIBRARIES = libgmp.a info_TEXINFOS = gmp.texi include_HEADERS = gmp.h mp.h noinst_HEADERS = gmp-impl.h longlong.h stack-alloc.h urandom.h *************** *** 558,577 **** libgmp.a: $(libgmp_a_OBJECTS) $(libgmp_a_LIBADD) all-recursive ! -rm -rf tmpdirgmp ! -mkdir tmpdirgmp ! for i in mpn mpz mpf mpq; \ ! do \ ! mkdir tmpdirgmp/$$i; \ ! ( cd tmpdirgmp/$$i; $(AR) x ../../$$i/lib$$i.a ); \ ! done ! cd tmpdirgmp; for i in */*.o; do mv $$i `echo $$i | sed 's@/@_@g'`;done ! cp $(libgmp_a_OBJECTS) $(libgmp_a_LIBADD) tmpdirgmp ! cd tmpdirgmp; $(AR) cru $@ *.o ! $(RANLIB) tmpdirgmp/$@ ! -rm -f $@ ! mv tmpdirgmp/$@ . ! -rm -rf tmpdirgmp # There appear to be strange problems with ar and parallel makes; I've added # dummy depend on libgmp.a here to serialize these. --- 558,565 ---- libgmp.a: $(libgmp_a_OBJECTS) $(libgmp_a_LIBADD) all-recursive ! rm -rf $@ ! $(AR) cru $@ $(libgmp_a_OBJECTS) $(libgmp_a_LIBADD) # There appear to be strange problems with ar and parallel makes; I've added # dummy depend on libgmp.a here to serialize these. *** zlib-1.0.4/Makefile.in.dist Wed Mar 19 07:06:36 1997 --- zlib-1.0.4/Makefile.in Thu Jul 1 12:04:23 1999 *************** *** 40,46 **** RANLIB=ranlib TAR=tar ! OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o TEST_OBJS = example.o minigzip.o --- 40,46 ---- RANLIB=ranlib TAR=tar ! OBJS = adler32.o compress.o gzio.o uncompr.o deflate.o trees.o \ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o TEST_OBJS = example.o minigzip.o