Applied bash-2.05b-beos.patch.001.txt from Fran��oi Revol (alias mmu_man)
Doesn't include part of patch concerning bash-2.05b/lib/sh/fmtulong.c Includes configure scripts, though not tested Thanks to yellowTAB for this official contribution git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8468 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f17a2e57e5
commit
62b6801d11
@ -138,6 +138,8 @@ GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \
|
||||
|
||||
GCC_LINT_CFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(GCC_LINT_FLAGS)
|
||||
|
||||
BEOSSETVERSION =
|
||||
|
||||
#
|
||||
# Support libraries
|
||||
#
|
||||
@ -464,7 +466,7 @@ CREATED_MAKEFILES = Makefile builtins/Makefile doc/Makefile \
|
||||
# Keep GNU Make from exporting the entire environment for small machines.
|
||||
.NOEXPORT:
|
||||
|
||||
.made: $(Program) bashbug
|
||||
.made: $(Program) $(BEOSSETVERSION) bashbug
|
||||
@echo "$(Program) last made for a $(Machine) running $(OS)" >.made
|
||||
|
||||
$(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
|
||||
@ -482,6 +484,11 @@ $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
|
||||
@echo " ***********************************************************"
|
||||
@echo
|
||||
|
||||
beos-setversion:
|
||||
setversion $(Program) -app `$(BUILD_DIR)/$(VERSPROG) -r` \
|
||||
`$(BUILD_DIR)/$(VERSPROG) -v | sed 's/./& /g'` $(PatchLevel) \
|
||||
-short "$(Version)" -long "$(Version) `echo -n -e '\302\251'` 2002 The Free Software Foundation"
|
||||
|
||||
bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG)
|
||||
@sed -e "s%!MACHINE!%$(Machine)%" -e "s%!OS!%$(OS)%" \
|
||||
-e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \
|
||||
|
18
src/apps/bin/bash/README.BeOS
Normal file
18
src/apps/bin/bash/README.BeOS
Normal file
@ -0,0 +1,18 @@
|
||||
Notes for the BeOS and Zeta port of bash.
|
||||
This port merges the 2.03 version from Be and the 2.04 GeekGadgets patch.
|
||||
Some stuff which isn't needed anymore have been removed.
|
||||
|
||||
./configure --prefix=/ --disable-job-control --disable-net-redirections --enable-static-link
|
||||
|
||||
Notes:
|
||||
* added checks for libsocket and libbind (BONE) to configure.in
|
||||
* mkfifo() exists, but no filesystem currently supports creating a fifo, so
|
||||
process substitutions won't work.
|
||||
* job control isn't implemented in BeOS, but configure tries to use it anyway.
|
||||
* No /dev/tcp in BeOS.
|
||||
* O_TRUNC seems fixed at least since R5.1 (BONE)
|
||||
* select() does work since R5.1
|
||||
* old ports set SYS_PROFILE to /boot/beos/etc/profile, which is unneeded, since the kernel does symlink /boot/beos/etc to /etc at boot.
|
||||
* about input.c:sync_buffered_stream: not casting to off_t makes the result on the heredoc test to be such as lseek fails but the fd is reset (seeked to 0L) so the script is read again, and again). Seems a bug in BeOS, but the operation was wrong anyway.
|
||||
* sig.c: not sure this is still required.
|
||||
|
@ -238,6 +238,9 @@ ulimit (cmd, newlim)
|
||||
int cmd;
|
||||
long newlim;
|
||||
{
|
||||
if (cmd == 1)
|
||||
return RLIM_INFINITY; /* A system without ulimit() and getrlimit() */
|
||||
/* probably dosen't support limits at all. */
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
@ -617,7 +617,11 @@ dnl check for GNU libintl if gettext/textdomain/bindtextdomain
|
||||
dnl are not found in libc
|
||||
if test "$ac_cv_func_bindtextdomain" = "no"; then
|
||||
AC_CHECK_LIB(intl,bindtextdomain)
|
||||
if test "$ac_cv_lib_intl" = "yes"; then
|
||||
if test "$ac_cv_lib_intl_bindtextdomain" = "yes"; then
|
||||
dnl undo caching
|
||||
unset ac_cv_func_gettext
|
||||
unset ac_cv_func_textdomain
|
||||
unset ac_cv_func_bindtextdomain
|
||||
AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
|
||||
fi
|
||||
fi
|
||||
@ -633,17 +637,19 @@ fi
|
||||
dnl this defines SYS_SIGLIST_DECLARED
|
||||
AC_DECL_SYS_SIGLIST
|
||||
|
||||
dnl network functions -- check for inet_aton again
|
||||
if test "$ac_cv_func_inet_aton" != 'yes'; then
|
||||
BASH_FUNC_INET_ATON
|
||||
fi
|
||||
|
||||
dnl libraries
|
||||
dnl this is reportedly no longer necessary for irix[56].?
|
||||
case "$host_os" in
|
||||
irix4*) AC_CHECK_LIB(sun, getpwent) ;;
|
||||
*beos*) AC_CHECK_LIB(bind, gethostbyname)
|
||||
AC_CHECK_LIB(socket, getpeername) ;;
|
||||
esac
|
||||
|
||||
dnl network functions -- check for inet_aton again
|
||||
if test "$ac_cv_func_inet_aton" != 'yes'; then
|
||||
BASH_FUNC_INET_ATON
|
||||
fi
|
||||
|
||||
dnl check for getpeername in the socket library only if it's not in libc
|
||||
if test "$ac_cv_func_getpeername" = no; then
|
||||
BASH_CHECK_LIB_SOCKET
|
||||
|
@ -43,7 +43,7 @@
|
||||
# include "bashhist.h"
|
||||
#endif
|
||||
|
||||
extern int EOF_reached;
|
||||
extern int EOF_Reached;
|
||||
extern int indirection_level;
|
||||
extern int posixly_correct;
|
||||
extern int subshell_environment, running_under_emacs;
|
||||
|
@ -490,7 +490,7 @@ sync_buffered_stream (bfd)
|
||||
if (buffers == 0 || (bp = buffers[bfd]) == 0)
|
||||
return (-1);
|
||||
|
||||
chars_left = bp->b_used - bp->b_inputp;
|
||||
chars_left = bp->b_used - (off_t)bp->b_inputp; /* mmu_man: force substract on LL for BeOS. */
|
||||
if (chars_left)
|
||||
lseek (bp->b_fd, -chars_left, SEEK_CUR);
|
||||
bp->b_used = bp->b_inputp = 0;
|
||||
|
@ -346,12 +346,6 @@ history_truncate_file (fname, lines)
|
||||
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
||||
{
|
||||
write (file, bp, chars_read - (bp - buffer));
|
||||
|
||||
#if defined (__BEOS__)
|
||||
/* BeOS ignores O_TRUNC. */
|
||||
ftruncate (file, chars_read - (bp - buffer));
|
||||
#endif
|
||||
|
||||
close (file);
|
||||
}
|
||||
|
||||
|
@ -445,6 +445,19 @@ sigint_sighandler (sig)
|
||||
if (interrupt_immediately)
|
||||
{
|
||||
interrupt_immediately = 0;
|
||||
#ifdef __BEOS__
|
||||
/* XXXdbg -- throw_to_top_level() calls longjmp() which leaves our
|
||||
sigmask in a screwed up state so we reset it here. */
|
||||
/* FIXME - fnf: Is this a generic problem with bash, or something
|
||||
Be specific? */
|
||||
{
|
||||
sigset_t oset;
|
||||
sigemptyset(&oset);
|
||||
sigprocmask(SIG_BLOCK, NULL, &oset);
|
||||
sigdelset(&oset, SIGINT);
|
||||
sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
}
|
||||
#endif
|
||||
throw_to_top_level ();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user