# HG changeset patch # User Ben Wing # Date 1266667380 21600 # Node ID 861f2601a38bbcfeecbbaf86a4c2d04e41a2fabb # Parent f62141fe007d3342b80943f58dfb65da7ea14a8e Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff --- ChangeLog 2010-02-20 Ben Wing * configure: * configure.ac (XE_EXPAND_VARIABLE): * configure.ac (TAB): irix6-0.h renamed to irix6-5.h; sco7.h deleted. bsd4-3.h renamed to bsd-common.h. Simplify setting machine= for intel386, mips. Put back linux.h. Incorporate some stuff about debug/optimization flags in irix6-5.h into configure.ac. Add a comment about LCC stuff with optimization flags that should be fixed up. --- src/ChangeLog 2010-02-20 Ben Wing * sysdep.c: * sysdep.c (qxe_reliable_signal): * sysdep.c (retry_open_1): * sysdep.c (retry_close): * sysdep.c (retry_read_1): * sysdep.c (retry_write_1): * sysdep.c (retry_fopen): * sysdep.c (retry_fclose): * sysdep.c (retry_fread): * sysdep.c (retry_fwrite): Remove conditionalization on INTERRUPTIBLE_IO, INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE -- always check for EINTR as there's no harm in it. Remove old #if 0'ed out SA_RESTART code. Use manifest constant IRIX6_5 instead of IRIX. * Makefile.in.in: * dired.c: * dired.c (Ffile_attributes): Use manifest constant IRIX6_5 instead of IRIX. Eliminate constant BSD4_2, use BSD4_3 instead. * getloadavg.c: * getloadavg.c (getloadavg): * getloadavg.c (LDAV_PRIVILEGED): * getloadavg.c (LDAV_DONE): Sync with GNU 23.1.92. 2010-02-20 Ben Wing * s/README: * s/aix4-2.h: * s/aix4-2.h (MAIL_USE_LOCKF): * s/bsd-common.h: * s/freebsd.h: * s/freebsd.h (Carey): * s/freebsd.h (or): * s/gnu.h: * s/gnu.h (DATA_START): * s/hpux11-shr.h: * s/hpux11.h: * s/hpux11.h (random): * s/irix6-5.h: * s/linux.h: * s/mach-bsd4-3.h: * s/netbsd.h: * s/netbsd.h (or): * s/netbsd.h (A_TEXT_OFFSET): * s/netbsd.h (NO_MATHERR): * s/openbsd.h: * s/sol2.h: * s/usg5-4-2.h: * s/usg5-4.h: * s/usg5-4.h (or): * s/usg5-4.h (ORDINARY_LINK): Sync with GNU 23.1.92. Put back linux.h. Rename: bsd4-3.h -> bsd-common.h; irix6-0.h -> irix6-5.h. Delete: template.h (useless). Delete a whole bunch of obsolete stuff in sol2.h, linux.h, freebsd.h -- assume anything over 10 years old is sufficiently obsolete to be deleted. Remove LIBS_DEBUG, C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH, KERNEL_FILE, LDAV_SYMBOL, most remaining PTY stuff, remaining TERMINFO/TERMCAP stuff. Update README appropriately. Remove stuff in hpux11-shr.h duplicated in hpux11.h. Remove sco7.h, identical with usg5-4-2.h. Remove unused POSIX flag, BROKEN_TIOC*, NO_SIOCTL_H. 2010-02-20 Ben Wing * m/arm.h: * m/hp800.h: * m/intel386.h: * m/mips.h: * m/powerpc.h: * m/sparc.h: * m/template.h: Temporarily ifdef out all defines involving load-average stuff -- using define ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF, which is not defined. I'm pretty sure getloadavg.c will take care of defining stuff properly on all systems without the need to duplicate the info in m/*. --ben Delete LIBS_TERMCAP; configure auto-handles this. Delete extra stuff in hp800.h. Delete C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH, LDAV_SYMBOL; incorporate some stuff into configure.ac. diff -r f62141fe007d -r 861f2601a38b ChangeLog --- a/ChangeLog Fri Feb 19 22:41:03 2010 -0600 +++ b/ChangeLog Sat Feb 20 06:03:00 2010 -0600 @@ -1,3 +1,21 @@ +2010-02-20 Ben Wing + + * configure: + * configure.ac (XE_EXPAND_VARIABLE): + * configure.ac (TAB): + irix6-0.h renamed to irix6-5.h; sco7.h deleted. + bsd4-3.h renamed to bsd-common.h. + + Simplify setting machine= for intel386, mips. + + Put back linux.h. + + Incorporate some stuff about debug/optimization flags in irix6-5.h + into configure.ac. + + Add a comment about LCC stuff with optimization flags that should be + fixed up. + 2010-02-08 Ben Wing * configure: diff -r f62141fe007d -r 861f2601a38b configure --- a/configure Fri Feb 19 22:41:03 2010 -0600 +++ b/configure Sat Feb 20 06:03:00 2010 -0600 @@ -5798,23 +5798,25 @@ case "$ac_cv_build" in sparc-*-* ) machine=sparc ;; alpha*-*-* ) machine=alpha ;; - mips*-linux ) machine=mips ;; + mips*-* ) machine=mips ;; rs6000-ibm-aix* ) machine=ibmrs6000 ;; powerpc-ibm-aix* ) machine=ibmrs6000 ;; powerpc*-* ) machine=powerpc ;; hppa-*-* ) machine=hp800 ;; arm* ) machine=arm ;; + i[3-9]86-*-* ) machine=intel386 ;; esac case "$ac_cv_build" in + *-*-linux* ) opsys=linux ;; *-*-netbsd* ) opsys=netbsd ;; *-*-openbsd* ) opsys=openbsd ;; *-*-aix[4-9]* ) opsys=aix4-2 ;; *-gnu* ) opsys=gnu ;; - *-*-bsd4.3 ) opsys=bsd4-3 ;; - *-*-aos* ) opsys=bsd4-3 ;; + *-*-bsd4.3 ) opsys=bsd-common ;; + *-*-aos* ) opsys=bsd-common ;; *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* ) if test -z "$NON_GNU_CPP" ; then @@ -5829,18 +5831,6 @@ case "$ac_cv_build" in - *-*-netbsd* ) - case "${ac_cv_build}" in - i[3-9]86-*-netbsd*) machine=intel386 ;; - esac - ;; - - *-*-openbsd* ) - case "${ac_cv_build}" in - i386-*-openbsd*) machine=intel386 ;; - esac - ;; - *-*-darwin*) opsys=darwin $as_echo "#define USE_PARAM_H 1" >>confdefs.h @@ -5853,16 +5843,12 @@ case "$ac_cv_build" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac ;; - mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;; - mips-mips-* ) machine=mips opsys=usg5-4-2 ;; - - mips-sgi-irix6* ) opsys=irix6-0 ;; + mips-mips-bsd* ) opsys=bsd-common ;; + mips-mips-* ) opsys=usg5-4-2 ;; + + mips-sgi-irix6* ) opsys=irix6-5 ;; *-*-solaris* | *-sun-mach* | *-sun-bsd* ) - case "$ac_cv_build" in - i*86-*-* ) machine=intel386 ;; - esac - case "$ac_cv_build" in *-sunos5*) ac_cv_build=`echo $ac_cv_build | sed -e s/sunos5/solaris2/`;; esac @@ -5888,17 +5874,16 @@ ;; *-mach* ) opsys=mach-bsd4-3 ;; - * ) opsys=bsd4-3 ;; + * ) opsys=bsd-common ;; esac test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC="" ;; i[3-9]86-*-* ) - machine=intel386 case "$ac_cv_build" in *-mach* ) opsys=mach-bsd4-3 ;; - *-sysv5* ) opsys=sco7 ;; + *-sysv5* ) opsys=usg5-4-2 ;; *-freebsd* ) opsys=freebsd ;; *-pc-cygwin* ) opsys=cygwin32 ;; *-pc-mingw* ) opsys=mingw32 ; @@ -9599,7 +9584,9 @@ with_cflags_optimization="-O3 -qstrict -qnoansialias -qlibansi -qmaxmem=20000" elif test "$__ICC" = "yes"; then with_cflags_optimization="-O3 -Ob2" - else + elif test "$opsys" = "irix6-5"; then + with_cflags_optimization="-O -OPT:Olimit=3500" + else with_cflags_optimization="-O" ; fi elif test "$XEMACS_CC_GPP" = "yes" ; then with_cflags_optimization="-fno-strict-aliasing" @@ -9612,10 +9599,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for preferred debugging flags" >&5 $as_echo_n "checking for preferred debugging flags... " >&6; } if test "$cflags_debugging_specified" = "no"; then + if test "$GCC" = "no" -a "$opsys" = "irix6-5" -a "$with_optimization" = "yes" ; then + with_cflags_debugging="-g3" + else with_cflags_debugging="-g" + fi debugging_ok_with_optimization=no - if test "$GCC" = "yes" -o "$CC" = "xlc" -o "$__ICC" = "yes"; then + if test "$GCC" = "yes" -o "$CC" = "xlc" -o "$__ICC" = "yes" -o "$opsys" = "irix6-5"; then debugging_ok_with_optimization=yes fi diff -r f62141fe007d -r 861f2601a38b configure.ac --- a/configure.ac Fri Feb 19 22:41:03 2010 -0600 +++ b/configure.ac Sat Feb 20 06:03:00 2010 -0600 @@ -1320,16 +1320,18 @@ case "$ac_cv_build" in sparc-*-* ) machine=sparc ;; alpha*-*-* ) machine=alpha ;; - mips*-linux ) machine=mips ;; + mips*-* ) machine=mips ;; rs6000-ibm-aix* ) machine=ibmrs6000 ;; powerpc-ibm-aix* ) machine=ibmrs6000 ;; powerpc*-* ) machine=powerpc ;; hppa-*-* ) machine=hp800 ;; arm* ) machine=arm ;; + i[[3-9]]86-*-* ) machine=intel386 ;; esac dnl Straightforward OS determination case "$ac_cv_build" in + *-*-linux* ) opsys=linux ;; *-*-netbsd* ) opsys=netbsd ;; *-*-openbsd* ) opsys=openbsd ;; @@ -1338,8 +1340,8 @@ dnl Other generic OSes *-gnu* ) opsys=gnu ;; - *-*-bsd4.3 ) opsys=bsd4-3 ;; - *-*-aos* ) opsys=bsd4-3 ;; + *-*-bsd4.3 ) opsys=bsd-common ;; + *-*-aos* ) opsys=bsd-common ;; *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; *-*-sysv4.[[2-9]]* | *-sysvr4.[[2-9]]* ) if test -z "$NON_GNU_CPP" ; then @@ -1354,20 +1356,6 @@ case "$ac_cv_build" in - dnl NetBSD ports - *-*-netbsd* ) - case "${ac_cv_build}" in - i[[3-9]]86-*-netbsd*) machine=intel386 ;; - esac - ;; - - dnl OpenBSD ports - *-*-openbsd* ) - case "${ac_cv_build}" in - i386-*-openbsd*) machine=intel386 ;; - esac - ;; - dnl Darwin, a.k.a. MacOS X (based on Mach and Freebsd) *-*-darwin*) opsys=darwin @@ -1385,20 +1373,15 @@ dnl Workstations sold by MIPS dnl This is not necessarily all workstations using the MIPS processor - dnl Irises are produced by SGI, and DECstations by DEC. - mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;; - mips-mips-* ) machine=mips opsys=usg5-4-2 ;; + mips-mips-bsd* ) opsys=bsd-common ;; + mips-mips-* ) opsys=usg5-4-2 ;; dnl Silicon Graphics machines dnl Iris 4D - mips-sgi-irix6* ) opsys=irix6-0 ;; + mips-sgi-irix6* ) opsys=irix6-5 ;; dnl Suns *-*-solaris* | *-sun-mach* | *-sun-bsd* ) - dnl Hardware type - case "$ac_cv_build" in - i*86-*-* ) machine=intel386 ;; - esac - dnl Make $canonical even more so. case "$ac_cv_build" in *-sunos5*) ac_cv_build=`echo $ac_cv_build | sed -e s/sunos5/solaris2/`;; @@ -1422,7 +1405,7 @@ AC_DEFINE_UNQUOTED(OS_RELEASE, $os_release) ;; *-mach* ) opsys=mach-bsd4-3 ;; - * ) opsys=bsd4-3 ;; + * ) opsys=bsd-common ;; esac dnl Watch out for a compiler guaranteed not to work. @@ -1431,10 +1414,9 @@ dnl Intel 386 machines where we do not care about the manufacturer i[[3-9]]86-*-* ) - machine=intel386 case "$ac_cv_build" in *-mach* ) opsys=mach-bsd4-3 ;; - *-sysv5* ) opsys=sco7 ;; + *-sysv5* ) opsys=usg5-4-2 ;; *-freebsd* ) opsys=freebsd ;; *-pc-cygwin* ) opsys=cygwin32 ;; *-pc-mingw* ) opsys=mingw32 ; @@ -1990,6 +1972,16 @@ with_cflags_optimization="-O3 -qstrict -qnoansialias -qlibansi -qmaxmem=20000" elif test "$__ICC" = "yes"; then with_cflags_optimization="-O3 -Ob2" + elif test "$opsys" = "irix6-5"; then + dnl Optimize, inaccurate debugging, increase limit on size of what's + dnl optimized. + dnl + dnl This should also be applicable other than on Irix 6.5, but I don't + dnl know for which compiler versions. -- fx + with_cflags_optimization="-O -OPT:Olimit=3500" + dnl #### FIXME FOR LCC: + dnl elif test "USE_LCC" = "yes"; then + dnl with_cflags_optimization="-O4 -Oi" dnl ### Add optimal cflags_optimization support for other compilers HERE! else with_cflags_optimization="-O" ;dnl The only POSIX-approved flag @@ -2006,11 +1998,16 @@ AC_MSG_CHECKING([for preferred debugging flags]) if test "$cflags_debugging_specified" = "no"; then + if test "$GCC" = "no" -a "$opsys" = "irix6-5" -a "$with_optimization" = "yes" ; then + dnl MIPSpro C special debugging stuff for use with optimization + with_cflags_debugging="-g3" dnl ### Add optimal debugging support for other compilers HERE! - with_cflags_debugging="-g" + else + with_cflags_debugging="-g" + fi debugging_ok_with_optimization=no - if test "$GCC" = "yes" -o "$CC" = "xlc" -o "$__ICC" = "yes"; then + if test "$GCC" = "yes" -o "$CC" = "xlc" -o "$__ICC" = "yes" -o "$opsys" = "irix6-5"; then debugging_ok_with_optimization=yes fi @@ -4479,6 +4476,7 @@ AC_CHECK_HEADERS(strtio.h) dnl TIOCSIGNAL fi +dnl There is also AC_FUNC_GETLOADAVG; why don't we use it? dnl Check whether the system provides getloadavg(). AC_CHECK_FUNCS(getloadavg) diff -r f62141fe007d -r 861f2601a38b src/ChangeLog --- a/src/ChangeLog Fri Feb 19 22:41:03 2010 -0600 +++ b/src/ChangeLog Sat Feb 20 06:03:00 2010 -0600 @@ -1,3 +1,107 @@ +2010-02-20 Ben Wing + + * sysdep.c: + * sysdep.c (qxe_reliable_signal): + * sysdep.c (retry_open_1): + * sysdep.c (retry_close): + * sysdep.c (retry_read_1): + * sysdep.c (retry_write_1): + * sysdep.c (retry_fopen): + * sysdep.c (retry_fclose): + * sysdep.c (retry_fread): + * sysdep.c (retry_fwrite): + Remove conditionalization on INTERRUPTIBLE_IO, INTERRUPTIBLE_OPEN, + INTERRUPTIBLE_CLOSE -- always check for EINTR as there's no harm + in it. + + Remove old #if 0'ed out SA_RESTART code. + + Use manifest constant IRIX6_5 instead of IRIX. + + * Makefile.in.in: + * dired.c: + * dired.c (Ffile_attributes): + Use manifest constant IRIX6_5 instead of IRIX. + Eliminate constant BSD4_2, use BSD4_3 instead. + + * getloadavg.c: + * getloadavg.c (getloadavg): + * getloadavg.c (LDAV_PRIVILEGED): + * getloadavg.c (LDAV_DONE): + Sync with GNU 23.1.92. + +2010-02-20 Ben Wing + + * s/README: + * s/aix4-2.h: + * s/aix4-2.h (MAIL_USE_LOCKF): + * s/bsd-common.h: + * s/freebsd.h: + * s/freebsd.h (Carey): + * s/freebsd.h (or): + * s/gnu.h: + * s/gnu.h (DATA_START): + * s/hpux11-shr.h: + * s/hpux11.h: + * s/hpux11.h (random): + * s/irix6-5.h: + * s/linux.h: + * s/mach-bsd4-3.h: + * s/netbsd.h: + * s/netbsd.h (or): + * s/netbsd.h (A_TEXT_OFFSET): + * s/netbsd.h (NO_MATHERR): + * s/openbsd.h: + * s/sol2.h: + * s/usg5-4-2.h: + * s/usg5-4.h: + * s/usg5-4.h (or): + * s/usg5-4.h (ORDINARY_LINK): + Sync with GNU 23.1.92. + + Put back linux.h. + + Rename: bsd4-3.h -> bsd-common.h; irix6-0.h -> irix6-5.h. + Delete: template.h (useless). + + Delete a whole bunch of obsolete stuff in sol2.h, linux.h, + freebsd.h -- assume anything over 10 years old is sufficiently + obsolete to be deleted. + + Remove LIBS_DEBUG, C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH, KERNEL_FILE, + LDAV_SYMBOL, most remaining PTY stuff, remaining TERMINFO/TERMCAP + stuff. Update README appropriately. + + Remove stuff in hpux11-shr.h duplicated in hpux11.h. + + Remove sco7.h, identical with usg5-4-2.h. + + Remove unused POSIX flag, BROKEN_TIOC*, NO_SIOCTL_H. + +2010-02-20 Ben Wing + + * m/arm.h: + * m/hp800.h: + * m/intel386.h: + * m/mips.h: + * m/powerpc.h: + * m/sparc.h: + * m/template.h: + Temporarily ifdef out all defines involving load-average stuff -- + using define ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF, which is not + defined. + + I'm pretty sure getloadavg.c will take care of defining stuff + properly on all systems without the need to duplicate the info + in m/*. --ben + + Delete LIBS_TERMCAP; configure auto-handles this. + + Delete extra stuff in hp800.h. + + Delete C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH, LDAV_SYMBOL; incorporate + some stuff into configure.ac. + 2010-02-10 Ben Wing * text.h: diff -r f62141fe007d -r 861f2601a38b src/Makefile.in.in --- a/src/Makefile.in.in Fri Feb 19 22:41:03 2010 -0600 +++ b/src/Makefile.in.in Sat Feb 20 06:03:00 2010 -0600 @@ -683,7 +683,7 @@ ## Position-independent code for shared library creation #if USE_GCC pic_arg = -fpic -#elif defined (IRIX) +#elif defined (IRIX6_5) pic_arg = -KPIC # else pic_arg = -K pic @@ -770,17 +770,17 @@ extw_link_end = # endif # elif defined (USG5) -# if defined (IRIX) +# if defined (IRIX6_5) # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations objs -o output extw_link_beg = $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations extw_link_mid = -o extw_link_end = -# else /* not IRIX */ +# else /* not IRIX6_5 */ # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output extw_link_beg = $(CC) -G extw_link_mid = -z text -o extw_link_end = -# endif /* not IRIX */ +# endif /* not IRIX6_5 */ # else /* not USG5 */ # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output extw_link_beg = $(LD) -dc diff -r f62141fe007d -r 861f2601a38b src/dired.c --- a/src/dired.c Fri Feb 19 22:41:03 2010 -0600 +++ b/src/dired.c Sat Feb 20 06:03:00 2010 -0600 @@ -1,6 +1,6 @@ /* Lisp functions for making directory listings. Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2010 Ben Wing. This file is part of XEmacs. @@ -862,7 +862,7 @@ return Qnil; } -#ifdef BSD4_2 +#ifdef BSD4_3 directory = Ffile_name_directory (filename); #endif @@ -912,7 +912,7 @@ filemodestring (&s, modes); values[8] = make_string ((Ibyte *) modes, 10); -#if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */ +#ifdef BSD4_3 /* file gid will be dir gid */ { struct stat sdir; @@ -923,7 +923,7 @@ } #else /* file gid will be egid */ values[9] = (s.st_gid != getegid ()) ? Qt : Qnil; -#endif /* BSD4_2 or BSD4_3 */ +#endif /* BSD4_3 */ values[10] = make_int (s.st_ino); values[11] = make_int (s.st_dev); UNGCPRO; diff -r f62141fe007d -r 861f2601a38b src/getloadavg.c --- a/src/getloadavg.c Fri Feb 19 22:41:03 2010 -0600 +++ b/src/getloadavg.c Sat Feb 20 06:03:00 2010 -0600 @@ -1,6 +1,10 @@ /* Get the system load averages. - Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995 - Free Software Foundation, Inc. + Copyright (C) 1985-1989, 1991-1995, 1997, 2001-2008 + Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. + + NOTE: The canonical source of this file is maintained with gnulib. + Bugs can be reported to bug-gnulib@gnu.org. This file is part of XEmacs. @@ -19,20 +23,38 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing. */ + /* Compile-time symbols that this file uses: + HAVE_SYS_PSTAT_H Defined if the pstat() function is available + (HPUX only); the GNU version uses + pstat_getdynamic() and HAVE_PSTAT_GETDYNAMIC. + + [[ GNU says: The best way to get the + definition is through the AC_FUNC_GETLOADAVG + macro that comes with autoconf 2.13 or newer. + If that isn't an option, then just put + AC_CHECK_FUNCS(pstat_getdynamic) in your + configure.in file. ]] But we don't do this, + apparently we do the equivalent of + AC_FUNC_GETLOADAVG dynamically. + FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist. KERNEL_FILE Pathname of the kernel to nlist. LDAV_CVT() Scale the load average from the kernel. Returns a double. LDAV_SYMBOL Name of kernel symbol giving load average. LOAD_AVE_TYPE Type of the load average array in the kernel. - Must be defined; otherwise, no load average - is available. + Must be defined; or we have libkstat; + otherwise, no load average is available. NLIST_STRUCT Include nlist.h, not a.out.h, and the nlist n_name element is a pointer, not an array. LINUX_LDAV_FILE [__linux__]: File containing load averages. + HAVE_LOCALE_H locale.h is available. + HAVE_SETLOCALE The `setlocale' function is available. Specific system predefines this file uses, aside from setting default values if not emacs: @@ -55,12 +77,19 @@ /* This should always be first. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include "lisp.h" #include "sysfile.h" /* for encapsulated open, close, read, write */ +#ifdef HAVE_LOCALE_H +# include +#endif +#ifndef HAVE_SETLOCALE +# define setlocale(Category, Locale) /* empty */ +#endif + #ifndef HAVE_GETLOADAVG /* The existing Emacs configuration files define a macro called @@ -73,248 +102,253 @@ LOAD_AVE_CVT, but future machine config files should just define LDAV_CVT directly. */ -#if !defined(LDAV_CVT) && defined(LOAD_AVE_CVT) -#define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) -#endif +# if !defined(LDAV_CVT) && defined(LOAD_AVE_CVT) +# define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) +# endif #if defined (HAVE_KSTAT_H) #include #endif /* HAVE_KSTAT_H */ +/* Same issues as for NeXT apply to the HURD-based GNU system. */ +# ifdef __GNU__ +# undef BSD +# undef FSCALE +# endif /* __GNU__ */ + /* Set values that are different from the defaults, which are set a little farther down with #ifndef. */ /* Some shorthands. */ -#if defined (HPUX) && !defined (hpux) -#define hpux -#endif +# if defined (HPUX) && !defined (hpux) +# define hpux +# endif + +# if defined (__hpux) && !defined (hpux) +# define hpux +# endif -#if (defined(sun) && defined(SVR4)) || defined (SOLARIS2) -#define SUNOS_5 -#endif +# if defined (__sun) && !defined (sun) +# define sun +# endif + +# if defined (__SVR4) && !defined (SVR4) +# define SVR4 +# endif -#if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) -#define OSF_ALPHA -#include -#include /* Needed for Digital UNIX V3 */ -#include -#include -#endif +# if (defined(sun) && defined(SVR4)) || defined (SOLARIS2) +# define SUNOS_5 +# endif + +# if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) +# define OSF_ALPHA +# /* XEmacs: First three below from FSF 23.1.92. */ +# include +# include +# include +# include +# include /* Needed for Digital UNIX V3 */ +# include +# include +# endif #if defined (__osf__) && (defined (mips) || defined (__mips__)) -#define OSF_MIPS -#include +# define OSF_MIPS +# include #endif /* VAX C can't handle multi-line #ifs, or lines longer than 256 chars. */ -#ifndef LOAD_AVE_TYPE +# ifndef LOAD_AVE_TYPE -#ifdef sun -#define LOAD_AVE_TYPE long -#endif +# ifdef sun +# define LOAD_AVE_TYPE long +# endif -#ifdef decstation -#define LOAD_AVE_TYPE long -#endif +# ifdef decstation +# define LOAD_AVE_TYPE long +# endif -#ifdef sgi -#define LOAD_AVE_TYPE long -#endif +# ifdef sgi +# define LOAD_AVE_TYPE long +# endif -#ifdef SVR4 -#define LOAD_AVE_TYPE long -#endif +# ifdef SVR4 +# define LOAD_AVE_TYPE long +# endif -#ifdef sony_news -#define LOAD_AVE_TYPE long -#endif +# ifdef sony_news +# define LOAD_AVE_TYPE long +# endif -#ifdef OSF_ALPHA -#define LOAD_AVE_TYPE long -#endif +# ifdef OSF_ALPHA +# define LOAD_AVE_TYPE long +# endif -#if defined (ardent) && defined (titan) -#define LOAD_AVE_TYPE long -#endif +# if defined (ardent) && defined (titan) +# define LOAD_AVE_TYPE long +# endif -#ifdef _AIX -#define LOAD_AVE_TYPE long -#endif +# ifdef _AIX +# define LOAD_AVE_TYPE long +# endif -#endif /* No LOAD_AVE_TYPE. */ +# endif /* No LOAD_AVE_TYPE. */ -#ifdef OSF_ALPHA +# ifdef OSF_ALPHA /* defines an incorrect value for FSCALE on Alpha OSF/1, according to ghazi@noc.rutgers.edu. */ -#undef FSCALE -#define FSCALE 1024.0 -#endif +# undef FSCALE +# define FSCALE 1024.0 +# endif -#ifndef FSCALE +# ifndef FSCALE /* SunOS and some others define FSCALE in sys/param.h. */ -#if defined(MIPS) || defined(SVR4) || defined(decstation) -#define FSCALE 256 -#endif +# if defined(MIPS) || defined(SVR4) || defined(decstation) +# define FSCALE 256 +# endif -#if defined (sgi) +# if defined (sgi) /* Sometimes both MIPS and sgi are defined, so FSCALE was just defined above under #ifdef MIPS. But we want the sgi value. */ -#undef FSCALE -#define FSCALE 1000.0 -#endif - -#if defined (ardent) && defined (titan) -#define FSCALE 65536.0 -#endif +# undef FSCALE +# define FSCALE 1000.0 +# endif -#ifdef _AIX -#define FSCALE 65536.0 -#endif +# if defined (ardent) && defined (titan) +# define FSCALE 65536.0 +# endif -#endif /* Not FSCALE. */ - -#if !defined (LDAV_CVT) && defined (FSCALE) -#define LDAV_CVT(n) (((double) (n)) / FSCALE) -#endif +# ifdef _AIX +# define FSCALE 65536.0 +# endif -/* VAX C can't handle multi-line #ifs, or lines longer that 256 characters. */ -#ifndef NLIST_STRUCT +# endif /* Not FSCALE. */ -#ifdef sun -#define NLIST_STRUCT -#endif +# if !defined (LDAV_CVT) && defined (FSCALE) +# define LDAV_CVT(n) (((double) (n)) / FSCALE) +# endif -#ifdef decstation -#define NLIST_STRUCT -#endif - -#ifdef hpux -#define NLIST_STRUCT -#endif - -#ifdef sgi -#define NLIST_STRUCT +#if 0 /* XEmacs change ... we check for nlist.h during configure and + automatically set NLIST_STRUCT if so; we have no HAVE_NLIST_H. */ +# ifndef NLIST_STRUCT +# if HAVE_NLIST_H +# define NLIST_STRUCT +# endif +# endif #endif -#ifdef SVR4 -#define NLIST_STRUCT -#endif - -#ifdef sony_news -#define NLIST_STRUCT -#endif - -#ifdef OSF_ALPHA -#define NLIST_STRUCT -#endif +# if defined(sgi) || (defined(mips) && !defined(BSD)) +# define FIXUP_KERNEL_SYMBOL_ADDR(nl) ((nl)[0].n_value &= ~(1 << 31)) +# endif -#if defined (ardent) && defined (titan) -#define NLIST_STRUCT -#endif - -#ifdef butterfly -#define NLIST_STRUCT -#endif - -#ifdef _AIX -#define NLIST_STRUCT -#endif +# if !defined (KERNEL_FILE) && defined (hpux) +# define KERNEL_FILE "/hp-ux" +# endif -#endif /* defined (NLIST_STRUCT) */ - - -#if defined(sgi) || (defined(mips) && !defined(BSD)) -#define FIXUP_KERNEL_SYMBOL_ADDR(nl) ((nl)[0].n_value &= ~(1 << 31)) -#endif - -#if !defined (KERNEL_FILE) && defined (hpux) -#define KERNEL_FILE "/hp-ux" -#endif +# if !defined(KERNEL_FILE) && (defined(MIPS) || defined(SVR4) || defined(ISC) || defined (sgi) || (defined (ardent) && defined (titan))) +# define KERNEL_FILE "/unix" +# endif -#if !defined(KERNEL_FILE) && (defined(MIPS) || defined(SVR4) || defined(ISC) || defined (sgi) || defined(SVR4) || (defined (ardent) && defined (titan))) -#define KERNEL_FILE "/unix" -#endif +# if !defined(LDAV_SYMBOL) && (defined(hpux) || defined(SVR4) || defined(ISC) || defined(sgi) || (defined (ardent) && defined (titan)) || defined (_AIX)) +# define LDAV_SYMBOL "avenrun" +# endif -#if !defined(LDAV_SYMBOL) && (defined(hpux) || defined(SVR4) || defined(ISC) || defined(sgi) || (defined (ardent) && defined (titan)) || defined (_AIX)) -#define LDAV_SYMBOL "avenrun" -#endif +# ifdef HAVE_UNISTD_H +# include +# endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include +# include /* LOAD_AVE_TYPE should only get defined if we're going to use the nlist method. */ -#if !defined(LOAD_AVE_TYPE) && (defined(BSD) || defined(LDAV_CVT) || defined(KERNEL_FILE) || defined(LDAV_SYMBOL)) -#define LOAD_AVE_TYPE double -#endif +# if !defined(LOAD_AVE_TYPE) && (defined(BSD) || defined(LDAV_CVT) || defined(KERNEL_FILE) || defined(LDAV_SYMBOL)) +# define LOAD_AVE_TYPE double +# endif + +# ifdef LOAD_AVE_TYPE -#ifdef LOAD_AVE_TYPE +# ifndef __linux__ +# ifndef NLIST_STRUCT +# include +# else /* NLIST_STRUCT */ +# include +# endif /* NLIST_STRUCT */ -#ifndef NLIST_STRUCT -#include -#else /* NLIST_STRUCT */ -#include -#endif /* NLIST_STRUCT */ +# ifdef SUNOS_5 +# include +# include +# include +# endif -#ifdef SUNOS_5 -#include -#include -#endif + /* XEmacs: GNU says: defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC) */ +# if defined (HAVE_SYS_PSTAT_H) +# include +# endif /* HAVE_SYS_PSTAT_H (on HPUX) */ + +# ifndef KERNEL_FILE +# define KERNEL_FILE "/vmunix" +# endif /* KERNEL_FILE */ -#ifndef KERNEL_FILE -#define KERNEL_FILE "/vmunix" -#endif /* KERNEL_FILE */ +# ifndef LDAV_SYMBOL +# define LDAV_SYMBOL "_avenrun" +# endif /* LDAV_SYMBOL */ +# endif /* __linux__ */ -#ifndef LDAV_SYMBOL -#define LDAV_SYMBOL "_avenrun" -#endif /* LDAV_SYMBOL */ +# ifndef LDAV_CVT +# define LDAV_CVT(n) ((double) (n)) +# endif /* !LDAV_CVT */ + +# endif /* LOAD_AVE_TYPE */ -#ifndef LDAV_CVT -#define LDAV_CVT(n) ((double) (n)) -#endif /* !LDAV_CVT */ - -#endif /* LOAD_AVE_TYPE */ +# if defined(__GNU__) && !defined (NeXT) +/* XEmacs -- FSF added code for the HURD, which depends on some NeXT + code that we deleted as outdated. We hardly care about compiling + on the HURD, but I'm leaving this stuff here just in case; if someone + wants to get this working, figure out which NeXT code needs to be + restored. */ +# error "Code not working currently" +/* Note that NeXT Openstep defines __GNU__ even though it should not. */ +/* GNU system acts much like NeXT, for load average purposes, + but not exactly. */ +# define NeXT +# define host_self mach_host_self +# endif /* defined(__GNU__) && !defined (NeXT) */ -#ifdef sgi -#include -#endif /* sgi */ +/* (ifdef NeXT ... deleted) */ -#if defined (HAVE_SYS_PSTAT_H) -#include -#endif /* HAVE_SYS_PSTAT_H (on HPUX) */ +# ifdef sgi +# include +# endif /* sgi */ /* Avoid static vars inside a function since in HPUX they dump as pure. */ -#ifdef LOAD_AVE_TYPE -/* File descriptor open to /dev/kmem */ +#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE) +/* File descriptor open to /dev/kmem or VMS load ave driver. */ static int channel; -/* Nonzero iff channel is valid. */ +/* Nonzero if channel is valid. */ static int getloadavg_initialized; /* Offset in kmem to seek to read load average, or 0 means invalid. */ static long offset; -#ifndef sgi -static struct nlist nl[2]; -#endif /* not sgi */ +# if !defined(sgi) && !defined(__linux__) +static struct nlist name_list[2]; +# endif /* Not Linux or sgi */ -#ifdef SUNOS_5 +# ifdef SUNOS_5 static kvm_t *kd; -#endif /* SUNOS_5 */ +# endif /* SUNOS_5 */ #ifndef countof # define countof(x) (sizeof (x) / sizeof (*(x))) #endif -#endif /* LOAD_AVE_TYPE */ +#endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */ /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. @@ -328,87 +362,97 @@ { int elem = 0; /* Return value. */ -#ifdef NO_GET_LOAD_AVG -#define LDAV_DONE +# ifdef NO_GET_LOAD_AVG +# define LDAV_DONE /* Set errno to zero to indicate that there was no particular error; this function just can't work at all on this system. */ errno = 0; elem = -2; -#endif /* NO_GET_LOAD_AVG */ +# endif /* NO_GET_LOAD_AVG */ #if ! defined (LDAV_DONE) && defined (HAVE_KSTAT_H) && defined (HAVE_LIBKSTAT) -#define LDAV_DONE -/* getloadavg is best implemented using kstat (kernel stats), on - systems (like SunOS5) that support it, since you don't need special - privileges to use it. - - Initial implementation courtesy Zlatko Calusic . - Integrated to XEmacs by Hrvoje Niksic . - Additional cleanup by Hrvoje Niksic, based on code published by - Casper Dik . */ +/* Use libkstat because we don't have to be root. */ +# define LDAV_DONE kstat_ctl_t *kc; kstat_t *ksp; - static char *avestrings[] = { "avenrun_1min", - "avenrun_5min", - "avenrun_15min" }; - - if (nelem > countof (avestrings)) - nelem = countof (avestrings); + kstat_named_t *kn; kc = kstat_open (); - if (!kc) + if (kc == 0) return -1; ksp = kstat_lookup (kc, "unix", 0, "system_misc"); - if (!ksp) + if (ksp == 0 ) + return -1; + if (kstat_read (kc, ksp, 0) == -1) + return -1; + + + kn = kstat_data_lookup (ksp, "avenrun_1min"); + if (kn == 0) { - kstat_close (kc); - return -1; + /* Return -1 if no load average information is available. */ + nelem = 0; + elem = -1; } - if (kstat_read (kc, ksp, 0) < 0) - { - kstat_close (kc); - return -1; - } - for (elem = 0; elem < nelem; elem++) + + if (nelem >= 1) + loadavg[elem++] = (double) kn->value.ul/FSCALE; + + if (nelem >= 2) { - kstat_named_t *kn = - (kstat_named_t *) kstat_data_lookup (ksp, avestrings[elem]); - if (!kn) + kn = kstat_data_lookup (ksp, "avenrun_5min"); + if (kn != 0) { - kstat_close (kc); - return -1; + loadavg[elem++] = (double) kn->value.ul/FSCALE; + + if (nelem >= 3) + { + kn = kstat_data_lookup (ksp, "avenrun_15min"); + if (kn != 0) + loadavg[elem++] = (double) kn->value.ul/FSCALE; + } } - loadavg[elem] = (double)kn->value.ul / FSCALE; } + kstat_close (kc); -#endif /* HAVE_KSTAT_H && HAVE_LIBKSTAT */ - -#if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H) -#define LDAV_DONE +# endif /* HAVE_LIBKSTAT */ +# if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H) + /* GNU says: .... && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC) */ +# define LDAV_DONE /* This is totally undocumented, and is not guaranteed to work, but mayhap it might .... If it does work, it will work only on HP-UX 8.0 or later. -- Darryl Okahata */ -#undef LOAD_AVE_TYPE /* Make sure these don't exist. */ -#undef LOAD_AVE_CVT -#undef LDAV_SYMBOL - struct pst_dynamic procinfo; - union pstun statbuf; +# undef LOAD_AVE_TYPE +# undef LOAD_AVE_CVT +# undef LDAV_SYMBOL - statbuf.pst_dynamic = &procinfo; - if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (struct pst_dynamic), 0, 0) == -1) - return (-1); - loadavg[elem++] = procinfo.psd_avg_1_min; - loadavg[elem++] = procinfo.psd_avg_5_min; - loadavg[elem++] = procinfo.psd_avg_15_min; -#endif /* HPUX */ + struct pst_dynamic dyn_info; +#if 0 /* GNU 23.1.92 */ + /* Use pstat_getdynamic() because we don't have to be root. */ + if (pstat_getdynamic (&dyn_info, sizeof (dyn_info), 0, 0) < 0) + return -1; +#else + union pstun statbuf; + statbuf.pst_dynamic = &dyn_info; + if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (dyn_info), 0, 0) == -1) + return -1; +#endif + if (nelem > 0) + loadavg[elem++] = dyn_info.psd_avg_1_min; + if (nelem > 1) + loadavg[elem++] = dyn_info.psd_avg_5_min; + if (nelem > 2) + loadavg[elem++] = dyn_info.psd_avg_15_min; -#if !defined (LDAV_DONE) && defined (__linux__) -#define LDAV_DONE -#undef LOAD_AVE_TYPE +# endif /* HAVE_SYS_PSTAT_H (GNU: hpux && HAVE_PSTAT_GETDYNAMIC) */ -#ifndef LINUX_LDAV_FILE -#define LINUX_LDAV_FILE "/proc/loadavg" -#endif +# if !defined (LDAV_DONE) && defined (__linux__) +# define LDAV_DONE +# undef LOAD_AVE_TYPE + +# ifndef LINUX_LDAV_FILE +# define LINUX_LDAV_FILE "/proc/loadavg" +# endif char ldavgbuf[40]; double load_ave[3]; @@ -422,22 +466,28 @@ if (count <= 0) return -1; + /* The following sscanf must use the C locale. */ + setlocale (LC_NUMERIC, "C"); count = sscanf (ldavgbuf, "%lf %lf %lf", &load_ave[0], &load_ave[1], &load_ave[2]); + setlocale (LC_NUMERIC, ""); if (count < 1) return -1; for (elem = 0; elem < nelem && elem < count; elem++) loadavg[elem] = load_ave[elem]; -#endif /* __linux__ */ + + return elem; + +# endif /* __linux__ */ -#if !defined (LDAV_DONE) && defined (__NetBSD__) || defined (__OpenBSD__) -#define LDAV_DONE -#undef LOAD_AVE_TYPE +# if !defined (LDAV_DONE) && (defined (__NetBSD__) || defined (__OpenBSD__)) +# define LDAV_DONE +# undef LOAD_AVE_TYPE -#ifndef NETBSD_LDAV_FILE -#define NETBSD_LDAV_FILE "/kern/loadavg" -#endif +# ifndef NETBSD_LDAV_FILE +# define NETBSD_LDAV_FILE "/kern/loadavg" +# endif unsigned long int load_ave[3], scale; int count; @@ -471,83 +521,84 @@ /* UNIX-specific code -- read the average from /dev/kmem. */ -#define LDAV_PRIVILEGED /* This code requires special installation. */ +# define LDAV_PRIVILEGED /* This code requires special installation. */ LOAD_AVE_TYPE load_ave[3]; /* Get the address of LDAV_SYMBOL. */ if (offset == 0) { -#ifndef sgi -#ifndef NLIST_STRUCT - strcpy (nl[0].n_name, LDAV_SYMBOL); - strcpy (nl[1].n_name, ""); -#else /* NLIST_STRUCT */ - nl[0].n_name = (char *) LDAV_SYMBOL; - nl[1].n_name = 0; -#endif /* NLIST_STRUCT */ +# ifndef sgi +# ifndef NLIST_STRUCT + strcpy (name_list[0].n_name, LDAV_SYMBOL); + strcpy (name_list[1].n_name, ""); +# else /* NLIST_STRUCT */ + /* #### XEmacs deletes HAVE_STRUCT_NLIST_N_UN_N_NAME code. Why? */ + name_list[0].n_name = (char *) LDAV_SYMBOL; + name_list[1].n_name = 0; +# endif /* NLIST_STRUCT */ -#ifndef SUNOS_5 +# ifndef SUNOS_5 if ( -#if !(defined (_AIX) && !defined (ps2)) - nlist (KERNEL_FILE, nl) -#else /* _AIX */ - knlist (nl, 1, sizeof (nl[0])) -#endif +# if !(defined (_AIX) && !defined (ps2)) + nlist (KERNEL_FILE, name_list) +# else /* _AIX */ + knlist (name_list, 1, sizeof (name_list[0])) +# endif >= 0) - /* Omit "&& nl[0].n_type != 0 " -- it breaks on Sun386i. */ + /* Omit "&& name_list[0].n_type != 0 " -- it breaks on Sun386i. */ { -#ifdef FIXUP_KERNEL_SYMBOL_ADDR - FIXUP_KERNEL_SYMBOL_ADDR (nl); -#endif - offset = nl[0].n_value; +# ifdef FIXUP_KERNEL_SYMBOL_ADDR + FIXUP_KERNEL_SYMBOL_ADDR (name_list); +# endif + offset = name_list[0].n_value; } -#endif /* !SUNOS_5 */ -#else /* sgi */ - int ldav_off; +# endif /* !SUNOS_5 */ +# else /* sgi */ + int ldav_off; - ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN); - if (ldav_off != -1) - offset = (long) ldav_off & 0x7fffffff; -#endif /* sgi */ - } + ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN); + if (ldav_off != -1) + offset = (long) ldav_off & 0x7fffffff; +# endif /* sgi */ + } /* Make sure we have /dev/kmem open. */ if (!getloadavg_initialized) { -#ifndef SUNOS_5 +# ifndef SUNOS_5 channel = retry_open ("/dev/kmem", 0); if (channel >= 0) { /* Set the channel to close on exec, so it does not litter any child's descriptor table. */ -#ifdef FD_SETFD -#ifndef FD_CLOEXEC -#define FD_CLOEXEC 1 -#endif +# ifdef F_SETFD +# ifndef FD_CLOEXEC +# define FD_CLOEXEC 1 +# endif (void) fcntl (channel, F_SETFD, FD_CLOEXEC); -#endif +# endif getloadavg_initialized = 1; } -#else /* SUNOS_5 */ +# else /* SUNOS_5 */ /* We pass 0 for the kernel, corefile, and swapfile names to use the currently running kernel. */ kd = kvm_open (0, 0, 0, O_RDONLY, 0); if (kd != 0) { /* nlist the currently running kernel. */ - kvm_nlist (kd, nl); - offset = nl[0].n_value; + kvm_nlist (kd, name_list); + offset = name_list[0].n_value; getloadavg_initialized = 1; } -#endif /* SUNOS_5 */ +# endif /* SUNOS_5 */ } /* If we can, get the load average values. */ if (offset && getloadavg_initialized) { /* Try to read the load. */ -#ifndef SUNOS_5 +# ifndef SUNOS_5 if (lseek (channel, offset, 0) == -1L || retry_read (channel, (char *) load_ave, sizeof (load_ave)) != sizeof (load_ave)) @@ -555,14 +606,14 @@ retry_close (channel); getloadavg_initialized = 0; } -#else /* SUNOS_5 */ +# else /* SUNOS_5 */ if (kvm_read (kd, offset, (char *) load_ave, sizeof (load_ave)) != sizeof (load_ave)) { kvm_close (kd); getloadavg_initialized = 0; } -#endif /* SUNOS_5 */ +# endif /* SUNOS_5 */ } if (offset == 0 || !getloadavg_initialized) @@ -575,8 +626,8 @@ if (nelem > 2) loadavg[elem++] = LDAV_CVT (load_ave[2]); -#define LDAV_DONE -#endif /* !LDAV_DONE && LOAD_AVE_TYPE */ +# define LDAV_DONE +# endif /* !LDAV_DONE && LOAD_AVE_TYPE */ return elem; } @@ -621,3 +672,6 @@ exit (0); } #endif /* TEST */ + +/* arch-tag: 2b37a242-6289-41f4-8cd5-0e73fd615db1 + (do not change this comment) */ diff -r f62141fe007d -r 861f2601a38b src/m/arm.h --- a/src/m/arm.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/arm.h Sat Feb 20 06:03:00 2010 -0600 @@ -43,6 +43,8 @@ #ifdef USG5_4 /* Older USG systems do not support the load average. */ /* Data type of load average, as read out of kmem. */ +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + #define LOAD_AVE_TYPE long /* Convert that into an integer that is 100 for a load average of 1.0 */ @@ -61,7 +63,9 @@ #endif #define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE)) -#endif +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + +#endif /* USG5_4 */ /* this brings in alloca() if we're using cc */ diff -r f62141fe007d -r 861f2601a38b src/m/hp800.h --- a/src/m/hp800.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/hp800.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,5 +1,6 @@ /* machine description file for hp9000 series 800 machines. Copyright (C) 1987 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. This file is part of GNU Emacs. @@ -34,13 +35,8 @@ #ifdef __hpux -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically: - Ones defined so far include vax, m68000, ns16000, pyramid, - orion, tahoe, APOLLO and many others */ -#ifndef hp9000s800 -# define hp9000s800 -#endif + +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF /* Data type of load average, as read out of kmem. */ @@ -50,6 +46,8 @@ #define LOAD_AVE_CVT(x) ((int) (x * 100.0)) +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + /* the data segment on this machine always starts at address 0x40000000. */ #ifdef DATA_START @@ -74,18 +72,8 @@ #define UNEXEC "unexhp9k800.o" -#define LIBS_MACHINE -#define LIBS_DEBUG - -/* The symbol in the kernel where the load average is found - is named _avenrun. At this time there are two major flavors - of hp-ux (there is the s800 and s300 (s200) flavors). The - differences are thusly moved to the corresponding machine description file. -*/ - -/* no underscore please */ -#define LDAV_SYMBOL "avenrun" +/* Deleted LDAV_SYMBOL, handled in getloadavg.c */ #if 0 /* Supposedly no longer true. */ /* In hpux, for unknown reasons, S_IFLNK is defined even though diff -r f62141fe007d -r 861f2601a38b src/m/intel386.h --- a/src/m/intel386.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/intel386.h Sat Feb 20 06:03:00 2010 -0600 @@ -58,6 +58,9 @@ #define DOT_GLOBAL_START #ifdef SOLARIS2 + +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -65,6 +68,8 @@ /* This is totally uncalibrated. */ #define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE)) +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + /* configure thinks solaris X86 has gethostname, but it does not work, so undefine it. */ #undef HAVE_GETHOSTNAME @@ -73,6 +78,8 @@ #ifdef USG5_4 /* Older USG systems do not support the load average. */ /* Data type of load average, as read out of kmem. */ +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + #define LOAD_AVE_TYPE long /* Convert that into an integer that is 100 for a load average of 1.0 */ @@ -80,6 +87,9 @@ #define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE)) #define FSCALE 256.0 + +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + #endif #endif /* not SOLARIS2 */ diff -r f62141fe007d -r 861f2601a38b src/m/mips.h --- a/src/m/mips.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/mips.h Sat Feb 20 06:03:00 2010 -0600 @@ -37,6 +37,8 @@ # define mips #endif +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -45,11 +47,18 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / 256.0) +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + #ifndef linux /* CDC EP/IX 1.4.3 uses /unix */ +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + #undef KERNEL_FILE #define KERNEL_FILE "/unix" + +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + #endif /* ! linux */ /* Define NO_REMAP if memory segmentation makes it not work well @@ -94,10 +103,10 @@ #define LD_SWITCH_MACHINE "-D 800000 -g3" #define START_FILES "pre-crt0.o /usr/lib/crt1.o" #define LIB_STANDARD "-lbsd -lc /usr/lib/crtn.o" -#define LIBS_TERMCAP "-lcurses" +/* LIBS_TERMCAP deleted */ #define C_SWITCH_MACHINE "-I/usr/include/bsd" -#define C_DEBUG_SWITCH "-O -g3" +/* XEmacs deleted C_DEBUG_SWITCH */ #endif /* not BSD */ #endif /* !linux */ diff -r f62141fe007d -r 861f2601a38b src/m/powerpc.h --- a/src/m/powerpc.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/powerpc.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,6 +1,7 @@ /* machine description file for Power PC Copyright (C) 1987, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois + Copyright (C) 2010 Ben Wing. This file is part of XEmacs. @@ -31,19 +32,13 @@ # endif #endif -#ifdef __GNUC__ -# define C_OPTIMIZE_SWITCH "-O" -#else -/* XEmacs change */ -# ifdef USE_LCC -# define C_OPTIMIZE_SWITCH "-O4 -Oi" -# else - /* This level of optimization is reported to work. */ -# define C_OPTIMIZE_SWITCH "-O2" -# endif -#endif +/* Delete C_OPTIMIZE_SWITCH stuff, moved (currently brokenly) to + configure.ac */ #ifndef __linux__ + +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -51,6 +46,9 @@ /* Convert that into an integer that is 100 for a load average of 1.0 */ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) + +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + #else /* mklinux */ /* Define addresses, macros, change some setup for dump */ diff -r f62141fe007d -r 861f2601a38b src/m/sparc.h --- a/src/m/sparc.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/sparc.h Sat Feb 20 06:03:00 2010 -0600 @@ -49,6 +49,8 @@ #if ! defined (__NetBSD__) && ! defined (__linux__) && !defined (__OpenBSD__) /* This really belongs in s/sun.h. */ +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -57,6 +59,8 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + /* Say that the text segment of a.out includes the header; the header actually occupies the first few bytes of the text segment and is counted in hdr.a_text. */ diff -r f62141fe007d -r 861f2601a38b src/m/template.h --- a/src/m/template.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/m/template.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,5 +1,6 @@ /* machine description file template. Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. This file is part of GNU Emacs. @@ -29,6 +30,8 @@ Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ +#ifdef ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -37,6 +40,8 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) +#endif /* ENABLE_SM_FILE_DECLS_OF_LOADAVG_STUFF */ + /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp diff -r f62141fe007d -r 861f2601a38b src/s/README --- a/src/s/README Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/README Sat Feb 20 06:03:00 2010 -0600 @@ -4,9 +4,6 @@ ../config.h to include the appropriate one of these files, and then each emacs source file includes config.h. -template.h is a generic template for system descriptions; it describes -the parameters a system file can specify. - General XEmacs Changes --------------------------- The following is a list of those changes made globally across all @@ -65,10 +62,10 @@ 14. Removed references to SYSV_SYSTEM_DIR, NONSYSTEM_DIR_LIBRARY, HAVE_SOCKETS, HAVE_SYSVIPC. configure detects these. -15. Removed defines of HAVE_TERMIOS, HAVE_TERMIO, and - HAVE_TCATTR (when HAVE_TERMIOS was also defined). - configure detects these and systty.h automatically defines - HAVE_TCATTR when HAVE_TERMIOS is defined. +15. Removed defines of HAVE_TERMIOS, HAVE_TERMIO, HAVE_TCATTR (when + HAVE_TERMIOS was also defined), and SIGNALS_VIA_CHARACTERS. configure + detects these and systty.h automatically defines HAVE_TCATTR when + HAVE_TERMIOS is defined. 16. Removed SETPGRP_RELEASES_CTTY. Not necessary any more, with fixed definitions of EMACS_SEPARATE_PROCESS_GROUP et al. @@ -80,3 +77,21 @@ 19. Removed all '#define static' business. Defines NO_REMAP instead. 20. Removed defines of HAVE_MACH_MACH_H. configure detects this. + +21. Removed KERNEL_FILE and LDAV_SYMBOL from most if not all files. + getloadavg.c has all sorts of conditional defns to define these. + +22. Got rid of most PTY-related stuff. We try hard to autodetect the + proper way of allocating PTY's. Removed HAVE_PTYS defn. + +23. Removed HAVE_SOCKETS, we autodetect this. + +24. Removed CLASH_DETECTION; this is now a configurable option. + +25. Removed BSD_PGRPS; this is autodetected. + +26. Removed NARROWPROTO; this is autodetected. + +27. Removed LIBS_DEBUG, C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH. + None of them are used any more. Any such stuff goes into + configure.ac. \ No newline at end of file diff -r f62141fe007d -r 861f2601a38b src/s/aix4-2.h --- a/src/s/aix4-2.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/aix4-2.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,5 +1,6 @@ /* Definitions file for XEmacs running on IBM AIX version 4.2 * Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. + * Copyright (C) 2010 Ben Wing. * * This file is part of XEmacs. * @@ -46,43 +47,18 @@ #define SYSTEM_TYPE "aix" -/* The file containing the kernel's symbol table is called /unix. */ - -#define KERNEL_FILE "/unix" - -/* The symbol in the kernel where the load average is found - * is named avenrun. */ - -#define LDAV_SYMBOL "avenrun" - /* Special itemss needed to make Emacs run on this system. */ -/* On USG systems the system calls are interruptible by signals - * that the user program has elected to catch. Thus the system call - * must be retried in these cases. To handle this without massive - * changes in the source code, we remap the standard system call names - * to names for our own functions in sysdep.c that do the system call - * with retries. */ - -#define INTERRUPTIBLE_OPEN -#define INTERRUPTIBLE_IO - #ifndef __GNUC__ #define LINKER "cc" #endif -/* Prevent -lg from being used for debugging. Not needed. */ - -#define LIBS_DEBUG +/* Deleted LIBS_DEBUG */ /* No need to specify -lc when linking. */ #define LIB_STANDARD -/* Use terminfo instead of termcap. */ - -#define TERMINFO - /* AIX doesn't define this. */ #define unix 1 @@ -101,16 +77,6 @@ * to beep after a mouse click. */ #define X11R5_INHIBIT_I18N -/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g" - * because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because - * "cc -g" crashes. Go figure. --floppy@merlin.mit.edu */ -#ifndef __GNUC__ -#undef C_DEBUG_SWITCH -#undef C_OPTIMIZE_SWITCH -#define C_DEBUG_SWITCH -#define C_OPTIMIZE_SWITCH "-O" -#endif - #define MAIL_USE_LOCKF /* XEmacs: from dkeller@VNET.IBM.COM */ @@ -158,15 +124,4 @@ #undef _NO_PROTO #endif -/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g" - * because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because - * "cc -g" crashes. Go figure. --floppy@merlin.mit.edu. - * 4.1 seems to need -g again. -- larry@vaquita.mitra.com. */ -/* David Edelsohn says that this actually depends - * on the version of XLC, which can't be predicted from the system version. - * What a mess! */ -#ifndef __GNUC__ -#undef C_DEBUG_SWITCH -#undef C_OPTIMIZE_SWITCH -#define C_DEBUG_SWITCH "-g" -#endif +/* XEmacs: C_DEBUG_SWITCH, C_OPTIMIZE_SWITCH no longer used */ diff -r f62141fe007d -r 861f2601a38b src/s/bsd-common.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/bsd-common.h Sat Feb 20 06:03:00 2010 -0600 @@ -0,0 +1,66 @@ +/* Definitions file for GNU Emacs running on bsd 4.3 + Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synced up with: FSF 23.1.92 */ +/* Synced by: Ben Wing, 2-17-10 */ + +/* + * Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. + */ + +/* We give these symbols the numeric values found in to + avoid warnings about redefined macros. */ +#ifndef BSD4_3 +#define BSD4_3 1 +#endif /* BSD4_3 */ + +#ifndef BSD_SYSTEM +#define BSD_SYSTEM 43 +#endif /* BSD_SYSTEM */ + +/* SYSTEM_TYPE should indicate the kind of system you are using. + * It sets the Lisp variable system-type. */ + +#define SYSTEM_TYPE "berkeley-unix" + +/* Deleted INTERRUPT_INPUT, FIRST_PTY_LETTER, HAVE_PTYS, HAVE_SOCKETS, + BSTRING -- unnecessary and/or autoconfigured on XEmacs */ + +/* define MAIL_USE_FLOCK if the mailer uses flock + to interlock access to /usr/spool/mail/$USER. + The alternative is that a lock file named + /usr/spool/mail/$USER.lock. */ + +#define MAIL_USE_FLOCK + +/* Deleted CLASH_DETECTION, KERNEL_FILE, LDAV_SYMBOL, SIGNALS_VIA_CHARACTERS + -- unnecessary and/or autoconfigured on XEmacs */ + +/* arch-tag: 0c367245-bde3-492e-9029-3ff6898beb95 + (do not change this comment) */ + +/* XEmacs addition: `ifdef BSD' used in many places */ + +#ifndef BSD +#define BSD 43 +#endif /* BSD */ diff -r f62141fe007d -r 861f2601a38b src/s/bsd4-3.h --- a/src/s/bsd4-3.h Fri Feb 19 22:41:03 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* Definitions file for XEmacs running on bsd 4.3 - Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -XEmacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: FSF 19.31. */ - -#ifndef BSD -#define BSD 43 -#endif /* BSD */ - -/* SYSTEM_TYPE should indicate the kind of system you are using. - * It sets the Lisp variable system-type. */ - -#define SYSTEM_TYPE "berkeley-unix" - -/* The file containing the kernel's symbol table is called /vmunix. */ - -#define KERNEL_FILE "/vmunix" - -/* The symbol in the kernel where the load average is found - * is named _avenrun. */ - -#define LDAV_SYMBOL "_avenrun" - -/* We give these symbols the numeric values found in to - avoid warnings about redefined macros. */ -#ifndef BSD4_3 -#define BSD4_3 1 -#endif /* BSD4_3 */ - -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK diff -r f62141fe007d -r 861f2601a38b src/s/freebsd.h --- a/src/s/freebsd.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/freebsd.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,105 +1,154 @@ -/* Synched up with: FSF 19.31. */ +/* System description header for FreeBSD systems. + This file describes the parameters that system description files + should define or not. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. -/* s/ file for freebsd system. */ +Author: Shawn M. Carey +(according to authors.el) + +This file is part of XEmacs. + +XEmacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. -/* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up. - Earlier versions do not have shared libraries, so inhibit them. - You can inhibit them on newer systems if you wish - by defining NO_SHARED_LIBS. */ -#ifndef __FreeBSD__ -#define NO_SHARED_LIBS -#endif +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs. If not, see . */ + +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ -/* Get most of the stuff from bsd4.3 */ -#include "bsd4-3.h" +/* Get the correct __FreeBSD_version, even if this is before that was + defined. */ +#ifndef __FreeBSD_version +#include +#endif /* !defined __FreeBSD_version */ -/* For mem-limits.h. */ -#define BSD4_2 +/* XEmacs: Delete obsolete stuff for FreeBSD v1 and v2 */ +/* Get most of the stuff from bsd-common */ +#include "bsd-common.h" -/* These aren't needed, since we have getloadavg. */ -#undef KERNEL_FILE -#undef LDAV_SYMBOL +/* Delete BSD4_2 -- unused in XEmacs */ +/* KERNEL_FILE, LDAV_SYMBOL deleted */ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -#define INTERRUPTIBLE_OPEN +/* XEmacs deleted LIBS_DEBUG */ -#define LIBS_DEBUG -/* FreeBSD 2.2 or later */ -#ifndef __FreeBSD_version -#include -#endif #if __FreeBSD_version >= 199701 && __FreeBSD_version < 600006 +/* XEmacs: */ #define LIBS_SYSTEM "-lutil -lxpg4" #else #define LIBS_SYSTEM "-lutil" #endif +/* LIBS_TERMCAP, TERMINFO deleted */ + +/* SYSV_SYSTEM_DIR, BSD_PGRPS deleted */ + +#ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */ +/* XEmacs: */ +#ifndef NOT_C_CODE +#include +#endif + +/* GNU: [[ Let `ld' find image libs and similar things in /usr/local/lib. The + system compiler, GCC, has apparently been modified to not look + there, contrary to what a stock GCC would do. ]] But we don't add + /usr/local/lib to LD_SWITCH_SYSTEM; there are configure flags for that. */ + +#define LD_SWITCH_SYSTEM /* -L/usr/local/lib */ +#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o +#define UNEXEC "unexelf.o" +#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o +/* XEmacs addition this line: */ +#define LINKER "$(CC) -nostdlib" +#undef LIB_GCC +#define LIB_GCC + +#else /* not __ELF__ */ + +#error "Obsolete pre-v3 versions not supported" + +#endif /* not __ELF__ */ + +/* HAVE_GETLOADAVG, HAVE_TERMIOS, NO_TERMIO deleted */ +#define DECLARE_GETPWUID_WITH_UID_T + +/* freebsd uses OXTABS instead of the expected TAB3. */ +#define TABDLY OXTABS +#define TAB3 OXTABS + +/* this silences a few compilation warnings */ +#undef BSD_SYSTEM +/* XEmacs: Delete obsolete stuff for FreeBSD v1 and v2 */ +#define BSD_SYSTEM 199506 +#endif + +/* DONT_REOPEN_PTY deleted -- unused in XEmacs */ + +/* If the system's imake configuration file defines `NeedWidePrototypes' + as `NO', we must define NARROWPROTO manually. Such a define is + generated in the Makefile generated by `xmkmf'. If we don't + define NARROWPROTO, we will see the wrong function prototypes + for X functions taking float or double parameters. */ + +/* NARROWPROTO deleted */ + +/* The following is needed to make `configure' find Xpm, Xaw3d and + image include and library files if using /usr/bin/gcc. That + compiler seems to be modified to not find headers in + /usr/local/include or libs in /usr/local/lib by default. */ + +/* XEmacs: let configure flags do this */ +/* #define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/local/include -L/usr/local/lib */ + +#if 0 /* unnecessary GNU stuff */ +/* Circumvent a bug in FreeBSD. In the following sequence of + writes/reads on a PTY, read(2) returns bogus data: + + write(2) 1022 bytes + write(2) 954 bytes, get EAGAIN + read(2) 1024 bytes in process_read_output + read(2) 11 bytes in process_read_output + + That is, read(2) returns more bytes than have ever been written + successfully. The 1033 bytes read are the 1022 bytes written + successfully after processing (for example with CRs added if the + terminal is set up that way which it is here). The same bytes will + be seen again in a later read(2), without the CRs. */ + +#define BROKEN_PTY_READ_AFTER_EAGAIN 1 + +/* Deleted GC_SETJMP_WORKS, GC_MARK_STACK, USE_MMAP_FOR_BUFFERS, + POSIX_SIGNALS -- unnecessary and/or autoconfigured on XEmacs */ + +/* The `combreloc' setting became the default, and it seems to be + incompatible with unexec. Symptom is an immediate SEGV in + XtInitializeWidget when starting Emacs under X11. */ + +#if defined __FreeBSD_version && __FreeBSD_version >= 500042 +#define LD_SWITCH_SYSTEM_TEMACS -znocombreloc +#endif +#endif /* 0 */ + +/* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb + (do not change this comment) */ + +/* Begin XEmacs additions */ + #ifndef NOT_C_CODE #ifdef BSD /* fixing BSD define */ #undef BSD #endif #include -/* Kludge to work around setlocale(LC_ALL,...) not working after 01/1997 */ -#if __FreeBSD_version >= 199701 && __FreeBSD_version < 226000 -#ifdef HAVE_X_WINDOWS -#include -#define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec) -#endif /* HAVE X */ -#endif /* FreeBSD >= 199701 && < 226000 */ #endif /* C code */ - -#define LIBS_TERMCAP "-ltermcap" - -#ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */ -#ifndef NOT_C_CODE -#include -#endif -#define LD_SWITCH_SYSTEM -#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -#define UNEXEC "unexelf.o" -#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o -#define LINKER "$(CC) -nostdlib" -#undef LIB_GCC -#define LIB_GCC - -#else /* not __ELF__ */ - -#ifndef NO_SHARED_LIBS -#if 0 /* mrb */ -#define LIB_GCC "-lgcc" -#define LD_SWITCH_SYSTEM "-dc -dp -e start" -#define START_FILES "pre-crt0.o /usr/lib/crt0.o" -#else /* mrb */ -#define ORDINARY_LINK -#undef LIB_GCC -#undef LD_SWITCH_SYSTEM -#undef START_FILES -#endif /* mrb */ - -#define HAVE_TEXT_START /* No need to define `start_of_text'. */ -#define UNEXEC "unexfreebsd.o" -#define RUN_TIME_REMAP - -#ifndef N_TRELOFF -#define N_PAGSIZ(x) __LDPGSZ -#define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data)) -#define N_TRELOFF(x) N_RELOFF(x) -#endif -#else /* NO_SHARED_LIBS */ -#ifdef __FreeBSD__ /* shared libs are available, but the user prefers - not to use them. */ -#define LD_SWITCH_SYSTEM "-Bstatic" -#define A_TEXT_OFFSET(x) (sizeof (struct exec)) -#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) -#endif /* __FreeBSD__ */ -#endif /* NO_SHARED_LIBS */ - -#endif /* not __ELF__ */ - -/* #define NO_TERMIO */ /* detected in configure */ -#define DECLARE_GETPWUID_WITH_UID_T - -/* freebsd uses OXTABS instead of the expected TAB3. */ -#define TABDLY OXTABS -#define TAB3 OXTABS diff -r f62141fe007d -r 861f2601a38b src/s/gnu.h --- a/src/s/gnu.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/gnu.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,5 +1,6 @@ /* Definitions file for XEmacs running on the GNU Hurd. Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. This file is part of XEmacs. @@ -23,13 +24,12 @@ /* Get most of the stuff from bsd4.3 */ #include "bsd4-3.h" -/* For mem-limits.h. */ -#define BSD4_2 +/* Delete BSD4_2 -- unused in XEmacs */ #undef SYSTEM_TYPE #define SYSTEM_TYPE "gnu" -#define LIBS_DEBUG +/* XEmacs deleted LIBS_DEBUG */ /* GNU needs its own crt0, and libc defines data_start. */ #define ORDINARY_LINK diff -r f62141fe007d -r 861f2601a38b src/s/hpux11-shr.h --- a/src/s/hpux11-shr.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/hpux11-shr.h Sat Feb 20 06:03:00 2010 -0600 @@ -20,25 +20,10 @@ /* Synched up with: FSF 19.31. */ -#define ORDINARY_LINK - /* XEmacs change */ #define HPUX_USE_SHLIBS -/* XEmacs: */ -/* Don't tell the linker to link statically */ -#ifdef NOT_C_CODE -#define START_FILES -#define LINKER "$(CC)" -#endif /* THIS IS YMAKEFILE */ - -/* get call to brk() when rerunning XEmacs */ -#define RUN_TIME_REMAP - #include "hpux11.h" /* We must turn off -g since it forces -static. */ -#ifdef __GNUC__ -#undef C_DEBUG_SWITCH -#define C_DEBUG_SWITCH -#endif +/* XEmacs deleted C_DEBUG_SWITCH */ diff -r f62141fe007d -r 861f2601a38b src/s/hpux11.h --- a/src/s/hpux11.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/hpux11.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,5 +1,6 @@ /* Definitions file for XEmacs running on HPUX release 11.0. * Copyright (C) 1985, 1986 Free Software Foundation, Inc. + * Copyright (C) 2010 Ben Wing. * * This file is part of XEmacs. * @@ -29,7 +30,7 @@ #ifdef NOT_C_CODE #define START_FILES #define LINKER "$(CC)" -#endif /* THIS IS YMAKEFILE */ +#endif /* NOT_C_CODE */ /* get call to brk() when rerunning XEmacs */ /* #ifndef USE_GCC */ @@ -47,37 +48,14 @@ #define SYSTEM_TYPE "hpux" -/* `nomultiplejobs' should be defined if your system's shell - * does not have "job control" (the ability to stop a program, - * run some other program, then continue the first one). - * - * On hpux this depends on the precise kind of machine in use, - * so the m- file defines this symbol if appropriate. */ - -/* Letter to use in finding device name of first pty, - * if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */ - -#define FIRST_PTY_LETTER 'p' +/* Delete FIRST_PTY_LETTER -- same as default in XEmacs */ /* The symbol in the kernel where the load average is found * depends on the cpu type, so we let the m- files define LDAV_SYMBOL. */ /* Special hacks needed to make Emacs run on this system. */ -/* On USG systems the system calls are interruptible by signals - * that the user program has elected to catch. Thus the system call - * must be retried in these cases. To handle this without massive - * changes in the source code, we remap the standard system call names - * to names for our own functions in sysdep.c that do the system call - * with retries. */ - -#define INTERRUPTIBLE_OPEN -#define INTERRUPTIBLE_IO -/* XEmacs change */ -#define INTERRUPTIBLE_CLOSE - -/* Use the system provided termcap(3) library */ -#define TERMINFO +/* Delete TERMINFO -- autodetected in XEmacs */ /* The 48-bit versions are more winning for Emacs; * the ordinary ones don't give even 32 bits. */ diff -r f62141fe007d -r 861f2601a38b src/s/irix6-0.h --- a/src/s/irix6-0.h Fri Feb 19 22:41:03 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* Synched up with: FSF 19.31. */ - -#include "usg5-4.h" - -#define IRIX6 - -#ifdef LIBS_SYSTEM -#undef LIBS_SYSTEM -#endif - -#ifdef LIB_STANDARD -#undef LIB_STANDARD -#endif - -#ifdef SYSTEM_TYPE -#undef SYSTEM_TYPE -#endif -#define SYSTEM_TYPE "irix" - -#ifdef SETUP_SLAVE_PTY -#undef SETUP_SLAVE_PTY -#endif - -/* jpff@maths.bath.ac.uk reports `struct exception' is not defined - * on this system, so inhibit use of matherr. */ -#define NO_MATHERR - -/* Tell process_send_signal to use VSUSP instead of VSWTCH. */ -#define PREFER_VSUSP - -/* use K&R C */ -/* XEmacs change -- use ANSI, not K&R */ -#ifndef __GNUC__ -#define C_SWITCH_SYSTEM "-xansi" -#endif - -/* jackr@engr.sgi.com says that you can't mix different kinds of - * signal-handling functions under IRIX 5.3. I'm going to assume - * that that was the reason this got broken. Now that the - * signal routines are fixed up, maybe this will work. --ben */ -/* Nope, it doesn't. I've tried lots of things; it must be - * genuinely broken. */ -/* XEmacs addition: People on IRIX 5.2 and IRIX 5.3 systems have - * reported that they can't break out of (while t) using C-g or C-G. - * This does not occur on other systems, so let's assume that SIGIO - * is broken on these systems. */ -#define BROKEN_SIGIO - -/* #### Questionable define. */ -#define IRIX - -/* By Tor Arntsen for XEmacs. - * With the following kludge the above LD_SWITCH_SYSTEM will still work just - * fine even with USE_GCC, and additional tweaking of config.h or ymakefile - * is avoided. */ -#ifdef NOT_C_CODE -# ifdef USE_GCC -# undef LINKER -# undef LIB_GCC -# define LINKER "ld" -# define LIB_GCC "`gcc --print`" -# endif -#endif diff -r f62141fe007d -r 861f2601a38b src/s/irix6-5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/irix6-5.h Sat Feb 20 06:03:00 2010 -0600 @@ -0,0 +1,120 @@ +/* Definitions file for XEmacs running on Silicon Graphics Irix system 6.5. + +Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright (C) 2010 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs. If not, see . */ + +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ + +#define IRIX6_5 /* [[ used in m/iris4d ]] -- not currently */ +#include "usg5-4.h" + +/* Delete sigsetmask, _longjmp, _setjmp */ + +/* Delete SETPGRP_RELEASES_CTTY */ + +#ifdef LIB_STANDARD +#undef LIB_STANDARD +#endif + +#ifdef SYSTEM_TYPE +#undef SYSTEM_TYPE +#endif +#define SYSTEM_TYPE "irix" + +/* Delete SETUP_SLAVE_PTY -- unused in XEmacs */ + +/* Delete SIGNALS_VIA_CHARACTERS, PTY_TTY_NAME_SPRINTF, PTY_NAME_SPRINTF, + PTY_ITERATION, PTY_OPEN -- unnecessary and/or autoconfigured on XEmacs */ + +/* Delete POSIX_SIGNALS -- autoconfigured in XEmacs */ + +/* Ulimit(UL_GMEMLIM) is busted... */ +#define ULIMIT_BREAK_VALUE 0x14000000 + +/* Delete PREFER_VSUSP -- unused in XEmacs */ + +/* define MAIL_USE_FLOCK if the mailer uses flock + to interlock access to /usr/spool/mail/$USER. + The alternative is that a lock file named + /usr/spool/mail/$USER.lock. */ + +#define MAIL_USE_FLOCK + +/* Delete NARROWPROTO -- autoconfigured in XEmacs */ + +/* Delete USE_MMAP_FOR_BUFFERS -- unused in XEmacs */ + +/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b + (do not change this comment) */ + + +#if _MIPS_SZLONG == 64 /* -mabi=64 (gcc) or -64 (MIPSpro) */ +#define _LP64 /* lisp.h takes care of the rest */ +#endif /* _MIPS_SZLONG */ + +/* #### Delete C_DEBUG_SWITCH, but should be moved to configure.ac; + see comments there under with_cflags_debugging */ +/* #define C_DEBUG_SWITCH -g3 -O -OPT:Olimit=3500 */ + +/* Delete undef of SA_RESTART, TIOCSIGSEND -- unused in XEmacs */ + +/* Delete GC_SETJMP_WORKS, GC_MARK_STACK -- unused in XEmacs */ + +/* arch-tag: d7ad9ec2-54ad-4b2f-adf2-0070c5c63e83 + (do not change this comment) */ + + + +/* XEmacs additions: */ + +/* jpff@maths.bath.ac.uk reports `struct exception' is not defined + * on this system, so inhibit use of matherr. */ +#define NO_MATHERR + +/* use K&R C */ +/* XEmacs change -- use ANSI, not K&R */ +#ifndef __GNUC__ +#define C_SWITCH_SYSTEM "-xansi" +#endif + +/* jackr@engr.sgi.com says that you can't mix different kinds of + * signal-handling functions under IRIX 5.3. I'm going to assume + * that that was the reason this got broken. Now that the + * signal routines are fixed up, maybe this will work. --ben */ +/* Nope, it doesn't. I've tried lots of things; it must be + * genuinely broken. */ +/* XEmacs addition: People on IRIX 5.2 and IRIX 5.3 systems have + * reported that they can't break out of (while t) using C-g or C-G. + * This does not occur on other systems, so let's assume that SIGIO + * is broken on these systems. */ +#define BROKEN_SIGIO + +/* By Tor Arntsen for XEmacs. + * With the following kludge the above LD_SWITCH_SYSTEM will still work just + * fine even with USE_GCC, and additional tweaking of config.h or ymakefile + * is avoided. */ +#ifdef NOT_C_CODE +# ifdef USE_GCC +# undef LINKER +# undef LIB_GCC +# define LINKER "ld" +# define LIB_GCC "`gcc --print`" +# endif +#endif diff -r f62141fe007d -r 861f2601a38b src/s/linux.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/linux.h Sat Feb 20 06:03:00 2010 -0600 @@ -0,0 +1,92 @@ +/* This file is the configuration file for the GNU/Linux operating system, + prior to version 1.1.56. + Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: FSF 19.31 (called, ahem ... lignux.h in FSF). */ + +/* This file was put together by Michael K. Johnson and Rik Faith. */ + +#define USG +#define LINUX + +/* SYSTEM_TYPE should indicate the kind of system you are using. + It sets the Lisp variable system-type. */ + +#define SYSTEM_TYPE "linux" /* All the best software is free. */ + + + +/* Deleted GNU_LIBRARY_PENDING_OUTPUT_COUNT -- unused in XEmacs */ + +/* This is needed for sysdep.c */ + +#define HAVE_SYS_SIGLIST + +/* #define POSIX -- not used in XEmacs */ + +/* Deleted TERM stuff -- probably hugely obsolete */ + +#define UNEXEC "unexelf.o" +#define UNEXEC_USE_MAP_PRIVATE + +/* mrb - Ordinary link is simple and effective */ +/* slb - Not any more ... :-( */ +/* jwj - slb's comment does not seem relevant to current Linuxes */ +#define ORDINARY_LINK + +#define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0) +#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) +#define ADJUST_EXEC_HEADER \ + unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr) + +/* HAVE_XRMSETDATABASE deleted */ + +/* The regex.o routines are a part of the GNU C-library used with Linux. */ +/* However, sometimes they disagree with the src/regex.h that comes with Emacs, + and that can make trouble in etags.c because it gets the regex.h from Emacs + and the function definitions in libc. So turn this off. */ +/* XEmacs: in any case, Mule uses different regex routines. */ +/* #define REGEXP_IN_LIBC */ + +/* XEmacs change: the standard linux libc includes regex routines in + it. We have to use our own and have to avoid name conflicts. */ + +#if 0 /* Probably not necessary any more */ +#define re_compile_pattern sys_re_compile_pattern +#define re_search sys_re_search +#define re_search_2 sys_re_search_2 +#define re_match_2 sys_re_match_2 +#define re_max_failures sys_re_max_failures +#define re_set_syntax sys_re_set_syntax +#define re_set_registers sys_re_set_registers +#define re_compile_fastmap sys_re_compile_fastmap +#define re_match sys_re_match +#define regcomp sys_regcomp +#define regexec sys_regexec +#define regerror sys_regerror +#define regfree sys_regfree +#endif /* 0 */ + +/* The in-built malloc does not work on PPC64 or Alpha, so use the system + malloc for now. */ +#if defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) +#define SYSTEM_MALLOC +#endif diff -r f62141fe007d -r 861f2601a38b src/s/mach-bsd4-3.h --- a/src/s/mach-bsd4-3.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/mach-bsd4-3.h Sat Feb 20 06:03:00 2010 -0600 @@ -20,11 +20,11 @@ /* Synched up with: FSF 19.31. */ -/* I don't care if this doesn't do more than including bsd4-3.h; - Mach is not bsd4-3 and the moment you forget it chances are that +/* I don't care if this doesn't do more than including bsd-common.h; + Mach is not BSD and the moment you forget it chances are that you're in deep shit. */ -#include "bsd4-3.h" +#include "bsd-common.h" /* The rest of this stuff is XEmacs additions. */ @@ -37,13 +37,8 @@ /* Don't send signals to subprocesses by "typing" special chars at them. */ #undef SIGNALS_VIA_CHARACTERS -/* XEmacs change */ -/* unistd.h defines _POSIX_VERSION, which leads some things to believe - that _POSIX_PATH_MAX should be defined. Unfortunately, it isn't. */ -#ifndef NOT_C_CODE -#include -#define _POSIX_PATH_MAX MAXPATHLEN -#endif +/* Delete defn of _POSIX_PATH_MAX -- we check for being defined before using + it */ #ifndef NOT_C_CODE typedef int pid_t; diff -r f62141fe007d -r 861f2601a38b src/s/netbsd.h --- a/src/s/netbsd.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/netbsd.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,10 +1,132 @@ -/* Synched up with: FSF 19.31. */ +/* s/ file for netbsd system. + + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, + Copyright (C) 2010 Ben Wing. + 2008, 2009, 2010 Free Software Foundation, Inc. + +This file is part of XEmacs. + +XEmacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs. If not, see . */ + +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ + +/* Get most of the stuff from bsd-common */ +#include "bsd-common.h" + +#if defined (__alpha__) && !defined (__ELF__) +#define NO_SHARED_LIBS +#endif -/* s/ file for netbsd system. */ +/* Delete BSD4_2 -- unused in XEmacs */ + +/* KERNEL_FILE, LDAV_SYMBOL HAVE_GETLOADAVG deleted */ + +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) + +/* netbsd uses OXTABS instead of the expected TAB3. */ +#define TABDLY OXTABS +#define TAB3 OXTABS + +/* HAVE_TERMIOS, NO_TERMIO deleted */ + +/* XEmacs deleted LIBS_DEBUG */ +/* -lutil is not needed for NetBSD >0.9. */ +/* #define LIBS_SYSTEM -lutil */ +/* LIBS_TERMCAP deleted */ + +#define NEED_ERRNO +/* SYSV_SYSTEM_DIR deleted */ + +/* BSD_PGRPS deleted */ + +#if !defined (NO_SHARED_LIBS) && defined (__ELF__) +#define UNEXEC "unexelf.o" +#endif + +#if 0 /* Following mrb, this stuff is probably unneeded for XEmacs */ +#if !defined (NO_SHARED_LIBS) && defined (__ELF__) +#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o +#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1 +#undef LIB_GCC +#define LIB_GCC +#endif -/* Get most of the stuff from bsd4.3 */ -#include "bsd4-3.h" +#ifdef HAVE_CRTIN +#define START_FILES_1 /usr/lib/crti.o +#define END_FILES_1 /usr/lib/crtn.o +#else +#define START_FILES_1 +#define END_FILES_1 +#endif +#else /* not 0 */ +/* XEmacs: */ +#define HAVE_TEXT_START /* No need to define `start_of_text'. */ +#define ORDINARY_LINK +#endif /* 0 */ + +#define AMPERSAND_FULL_NAME + +#if 0 /* Following mrb, this stuff is probably unneeded for XEmacs */ +#ifdef __ELF__ +/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option + says where to find X windows at run time. We convert it to a -rpath option + which is what OSF1 uses. */ +#define LD_SWITCH_SYSTEM_tmp `echo LD_SWITCH_X_SITE_AUX | sed -e 's/-R/-Wl,-rpath,/'` +#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib + +/* The following is needed to make `configure' find Xpm, Xaw3d and + image include and library files if using /usr/bin/gcc. That + compiler seems to be modified to not find headers in + /usr/local/include or libs in /usr/local/lib by default. */ + +#define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/pkg/include -I/usr/local/include -L/usr/pkg/lib -L/usr/local/lib +/* Link temacs with -z nocombreloc so that unexec works right, whether or + not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD + switches, so this also works with older versions that don't implement + -z combreloc. */ + +#define LD_SWITCH_SYSTEM_TEMACS -Wl,-z,nocombreloc +#endif /* __ELF__ */ + +/* On post 1.3 releases of NetBSD, gcc -nostdlib also clears + the library search parth, i.e. it won't search /usr/lib + for libc and friends. Using -nostartfiles instead avoids + this problem, and will also work on earlier NetBSD releases */ + +#define LINKER "$(CC) -nostartfiles" + +#endif /* 0 */ + +/* NARROWPROTO deleted */ + +/* #define DEFAULT_SOUND_DEVICE "/dev/audio" -- unused in XEmacs */ + +/* #include no need in XEmacs */ + +/* DONT_REOPEN_PTY deleted -- unused in XEmacs */ + +/* Delete GC_SETJMP_WORKS, GC_MARK_STACK -- unused in XEmacs */ + +/* POSIX_SIGNALS deleted */ + +/* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81 + (do not change this comment) */ +#endif /* 0 */ + +/* Begin XEmacs additions */ #undef BSD #ifndef NOT_C_CODE @@ -12,63 +134,7 @@ #include #endif /* C_CODE */ -/* For mem-limits.h. */ -#define BSD4_2 - -#undef KERNEL_FILE -#undef LDAV_SYMBOL - -#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) - #define A_TEXT_OFFSET(x) (sizeof (struct exec)) #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) -#define LIBS_DEBUG -/* -lutil is not needed for NetBSD >0.9. */ -/* #define LIBS_SYSTEM -lutil */ -/* XEmacs change */ -#define LIBS_TERMCAP "-ltermcap" - -#define NEED_ERRNO - -#if 0 /* mrb */ -#ifndef NO_SHARED_LIBS -/* These definitions should work for either dynamic or static linking, - whichever is the default for `cc -nostdlib'. */ -/* but they probably don't, and life's too short - jrg@doc.ic.ac.uk - ask for no shared libs if you have 0.9 */ -/* mrb -- ORDINARY_LINK works just fine... */ -#define LD_SWITCH_SYSTEM "-e start" -#define START_FILES "pre-crt0.o /usr/lib/crt0.o" -#define RUN_TIME_REMAP -#else -#define START_FILES "crt0.o" - -#endif /* not NO_SHARED_LIBS */ -#endif /* 0 - mrb */ - -#define HAVE_TEXT_START /* No need to define `start_of_text'. */ -#define ORDINARY_LINK - -/* As of this writing (Netbsd 1.5 was just released), Netbsd is - converting from a.out to elf - x86 and Sparc are using ELF. - But we're clever and let the compiler tell us which one to use. */ -#ifdef __ELF__ -#define UNEXEC "unexelf.o" -#else -#define UNEXEC "unexfreebsd.o" /* ironic, considering history of unexfreebsd */ -#endif - -#if 0 -/* Try to make this work for both 0.9 and >0.9. */ -#define N_PAGSIZ(x) __LDPGSZ -#define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data)) -/* #define N_TRELOFF(x) N_RELOFF(x) */ -/* the 1.0 way.. */ -#endif /* 0 */ - -#define N_RELOFF(x) N_TRELOFF(x) - #define NO_MATHERR - -#define AMPERSAND_FULL_NAME diff -r f62141fe007d -r 861f2601a38b src/s/openbsd.h --- a/src/s/openbsd.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/openbsd.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,12 +1,42 @@ -/* s/ file for openbsd systems. */ +/* s/ file for openbsd systems. */ + +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ + +/* Mostly the same as NetBSD. */ +#include "netbsd.h" -/* Get most of the stuff from bsd4.3 */ -#include "bsd4-3.h" +#if 0 /* Following mrb, this stuff is probably unneeded for XEmacs */ +/* This very-badly named symbol is conditionally defined in netbsd.h. + Better would be either to not need it in the first place, or to choose + a more descriptive name. */ +#ifndef LD_SWITCH_SYSTEM_tmp +#define LD_SWITCH_SYSTEM_tmp /* empty */ +#endif +#endif /* 0 */ + +/* TERMINFO, LIBS_TERMCAP deleted */ -/* OpenBSD alpha has no shared libs yet. */ -#if defined (__alpha__) && !defined (__ELF__) -#define NO_SHARED_LIBS +#if 0 /* Following mrb, this stuff is probably unneeded for XEmacs */ +#undef LD_SWITCH_SYSTEM_TEMACS +#undef LD_SWITCH_SYSTEM +#ifdef __ELF__ + + /* Han Boetes says this + is necessary, otherwise Emacs dumps core on elf systems. */ +#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp "-Z" + +/* The version of gcc on OpenBSD doesn't search /usr/local/lib by + default. */ +#define LD_SWITCH_X_DEFAULT "-L/usr/local/lib" + +#else + +#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp +#define LD_SWITCH_X_DEFAULT "-L/usr/local/lib" + #endif +#endif /* 0 */ -/* Get the rest of the stuff from NetBSD */ -#include "netbsd.h" +/* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2 + (do not change this comment) */ diff -r f62141fe007d -r 861f2601a38b src/s/sco7.h --- a/src/s/sco7.h Fri Feb 19 22:41:03 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* Definitions file for XEmacs running on SCO System V release 4.2 - Copyright (C) 1999 Ron Record - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* Synched up with: FSF 19.31. */ - -#include "usg5-4.h" - -/* Motif needs -lgen. */ -#undef LIBS_SYSTEM -#define LIBS_SYSTEM "-lsocket -lnsl -lelf -lgen" - -#define VFORK_RETURN_TYPE pid_t - -/* XEmacs change: communicate to m/intel386.h */ -#define USG5_4_2 diff -r f62141fe007d -r 861f2601a38b src/s/sol2.h --- a/src/s/sol2.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/sol2.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,14 +1,6 @@ /* Synched up with: Completely divergent from FSF. */ #define SOLARIS2 1 -#define POSIX 1 - -#ifndef USG -#define USG -#endif - -#ifndef USG5_4 -#define USG5_4 -#endif +/* #define POSIX -- not used in XEmacs */ /* Fix understandable GCC lossage on Solaris 2.6 */ #if defined(__GNUC__) && OS_RELEASE >= 506 && OS_RELEASE < 510 && !defined(NOT_C_CODE) @@ -41,13 +33,7 @@ /* SIGIO seems to be working under Solaris and it makes ^G work better... */ #undef BROKEN_SIGIO -/* eggert@twinsun.com said these work in Solaris. - Perhaps they work in all kinds of SVR4, but this is more conservative. */ -#undef BROKEN_TIOCGETC -#undef BROKEN_TIOCGWINSZ - #ifdef NOT_C_CODE -#define ORDINARY_LINK /* XEmacs change -- some Motif packages need -lgen to get regex and regcmp */ #undef LIBS_SYSTEM @@ -58,79 +44,14 @@ /* We want to be able to test out ralloc.c. */ /* #define SYSTEM_MALLOC */ -/* XEmacs: there used to be a special definition of - PTY_TTY_NAME_SPRINTF here that was identical to the - other SYSV R4 definitions except that it didn't - block SIGCHLD around the call to grantpt(). This - is *not* in 19.29 and is almost certainly incorrect. - */ - #undef UNEXEC -#if OS_RELEASE < 506 -#define UNEXEC "unexsol2.o" -#else #define UNEXEC "unexsol2-6.o" -#endif #else /* C_CODE */ -#if OS_RELEASE <= 503 -/* Solaris 2.3 has a bug in XListFontsWithInfo. */ -#define BROKEN_XLISTFONTSWITHINFO -#endif - -/* XEmacs addition: Raymond Toy says XEmacs completely misses SIGCHLD - when compiled with GCC 2.7.0 (but not, apparently, with SunPro C?), - X11R6, and Solaris 2.4. - - Someone else submitted a simple test program that duplicates this - behavior, and says it has something to do with the fact that X11R6 - links with the threads library. */ - -#ifdef THIS_IS_X11R6 -#define BROKEN_SIGCHLD -#endif - -#if OS_RELEASE < 505 - -#if __STDC__ == 1 && defined(__SUNPRO_C) -#define _POSIX_C_SOURCE 1 -#include -#undef _POSIX_C_SOURCE -#endif /* cc -Xc */ - -/* Missing prototype, added in Solaris 2.5 */ -extern void *__builtin_alloca (size_t); -#endif /* before SunOS 5.5 */ - -#if OS_RELEASE == 505 -/* The following functions were added in Solaris 2.5, - but they forgot to add prototypes to the system header files. */ -int getpagesize (void); -long random (void); -void srandom (unsigned int seed); -int usleep (unsigned int useconds); -#endif /* SunOS 5.5 */ - /* 2.5 now has `random' back in libc but we don't want to use it. */ -#if OS_RELEASE >= 505 #undef HAVE_RANDOM -/* Apparently not necessary here, and it causes 10% CPU chewage. */ -#undef BROKEN_SIGCHLD -#endif /* >= SunOS 5.5 */ - -#if OS_RELEASE < 506 -/* Missing prototypes, added in Solaris 2.6 */ -struct timeval; -int utimes (char *file, struct timeval *tvp); -int gethostname (char *name, int namelen); -#endif /* before SunOS 5.6 */ #include /* warning: macro redefined: SYS_NMLN */ -/* XEmacs: Solaris has sigsetjmp but using it leads to core dumps at - least under 2.4 */ -#undef _setjmp -#define _setjmp setjmp - #endif /* C_CODE */ diff -r f62141fe007d -r 861f2601a38b src/s/template.h --- a/src/s/template.h Fri Feb 19 22:41:03 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* Template for system description header files. - This file describes the parameters that system description files - should define or not. - Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -XEmacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: FSF 19.31. */ - -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ - -/* #define UNIPLUS */ -/* #define USG5 */ -/* #define USG */ -/* #define HPUX */ -/* #define UMAX */ -/* #define BSD4_3 */ -/* #define BSD */ - -/* SYSTEM_TYPE should indicate the kind of system you are using. - It sets the Lisp variable system-type. */ - -#define SYSTEM_TYPE "berkeley-unix" - -/* Letter to use in finding device name of first pty, - if system supports pty's. 'a' means it is /dev/ptya0 */ - -#define FIRST_PTY_LETTER 'p' - -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ - -/* #define COFF */ - -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - -/* If the character used to separate elements of the executable path - is not ':', #define this to be the appropriate character constant. */ -/* #define SEPCHAR ':' */ - -/* ============================================================ */ - -/* Here, add any special hacks needed - to make Emacs work on this system. For example, - you might define certain system call names that don't - exist on your system, or that do different things on - your system and must be used only through an encapsulation - (Which you should place, by convention, in sysdep.c). */ - -/* ============================================================ */ - -/* After adding support for a new system, modify the large case - statement in the `configure' script to recognize reasonable - configuration names, and add a description of the system to - `etc/MACHINES'. - - If you've just fixed a problem in an existing configuration file, - you should also check `etc/MACHINES' to make sure its descriptions - of known problems in that configuration should be updated. */ diff -r f62141fe007d -r 861f2601a38b src/s/usg5-4-2.h --- a/src/s/usg5-4-2.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/usg5-4-2.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,14 +1,47 @@ -/* Synched up with: FSF 19.31. */ +/* s/ file for System V release 4.2. + + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. + +This file is part of XEmacs. -/* s/ file for System V release 4.2. */ +XEmacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +XEmacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs. If not, see . */ + +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ #include "usg5-4.h" +/* fnf@cygnus.com says these exist. */ +#define HAVE_TCATTR +/* Delete HAVE_GETWD, POSIX_SIGNALS, sigsetmask, HAVE_SYSV_SIGPAUSE -- + unused or autoconfigured in XEmacs */ + /* Motif needs -lgen. */ #undef LIBS_SYSTEM #define LIBS_SYSTEM "-lsocket -lnsl -lelf -lgen" -#define VFORK_RETURN_TYPE pid_t +/* Delete redefinition of PTY_TTY_NAME_SPRINTF, unnecessary since we + handle signal-calling better -- XEmacs */ + +/* Delete NEED_LIBW, LIB_MOTIF -- unused in XEmacs */ + +/* arch-tag: 9bbfcfc1-19be-45a1-9699-af57b87da2c6 + (do not change this comment) */ + +/* XEmacs addition: */ /* XEmacs change: communicate to m/intel386.h */ #define USG5_4_2 diff -r f62141fe007d -r 861f2601a38b src/s/usg5-4.h --- a/src/s/usg5-4.h Fri Feb 19 22:41:03 2010 -0600 +++ b/src/s/usg5-4.h Sat Feb 20 06:03:00 2010 -0600 @@ -1,24 +1,25 @@ -/* Definitions file for XEmacs running on AT&T's System V Release 4 - Copyright (C) 1987, 1990 Free Software Foundation, Inc. +/* Definitions file for GNU Emacs running on AT&T's System V Release 4 + Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. -This file is part of XEmacs. +This file is part of GNU Emacs. -XEmacs is free software; you can redistribute it and/or modify +GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. -XEmacs is distributed in the hope that it will be useful, +GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +along with GNU Emacs. If not, see . */ -/* Synched up with: FSF 19.31. */ +/* Synced up with: FSF 23.1.92. */ +/* Synced by: Ben Wing, 2-18-10. */ /* This file written by James Van Artsdalen of Dell Computer Corporation. * james@bigtex.cactus.org. Subsequently improved for Dell 2.2 by Eric @@ -34,80 +35,26 @@ #define SYSTEM_TYPE "usg-unix-v" -/* Letter to use in finding device name of first pty, - * if system supports pty's. 'p' means it is /dev/ptyp0 */ - -#define FIRST_PTY_LETTER 'z' - -/* define MAIL_USE_FLOCK if the mailer uses flock - * to interlock access to /usr/spool/mail/$USER. - * The alternative is that a lock file named - * /usr/spool/mail/$USER.lock. */ - -/* #define MAIL_USE_FLOCK */ - -/* The file containing the kernel's symbol table is called /unix. */ - -#define KERNEL_FILE "/unix" - -/* The symbol in the kernel where the load average is found - * is named avenrun. */ - -#define LDAV_SYMBOL "avenrun" - -/* Special hacks needed to make Emacs run on this system. */ - -/* On USG systems the system calls are interruptible by signals - * that the user program has elected to catch. Thus the system call - * must be retried in these cases. To handle this without massive - * changes in the source code, we remap the standard system call names - * to names for our own functions in sysdep.c that do the system call - * with retries. */ +/* Delete HAVE_TERMIO, SYSV_SYSTEM_DIR, KERNEL_FILE, LDAV_SYMBOL, + sigsetmask, _setjmp, _longjmp, HAVE_INDEX, HAVE_RINDEX, TERMINFO, + HAVE_SYSV_SIGPAUSE, BSTRING, SIGTYPE -- not used in XEmacs or found by + configure */ -#define INTERRUPTIBLE_OPEN -#define INTERRUPTIBLE_IO - -/* Compiler bug bites on many systems when default ADDR_CORRECT is used. */ - -#define ADDR_CORRECT(x) (x) - -/* Prevent -lg from being used for debugging. Not implemented? */ - -#define LIBS_DEBUG - -/* Use terminfo instead of termcap. */ - -#define TERMINFO - -/* 5.3 apparently makes close() interruptible */ - -#define INTERRUPTIBLE_CLOSE - -/* Apparently -lg is provided in 5.3 */ - -#undef LIBS_DEBUG - -/* Enable support for shared libraries in unexec. */ - -#define USG_SHARED_LIBRARIES - -#define LIBS_SYSTEM "-lsocket -lnsl -lelf" #define ORDINARY_LINK -#define LIB_STANDARD /* there are no -lg libraries on this system, and no libPW */ -#define LIBS_DEBUG +/* XEmacs deleted LIBS_DEBUG, LIB_STANDARD */ -/* No */ +/* Undump with ELF */ -#define NO_SIOCTL_H +#undef COFF #define UNEXEC "unexelf.o" -/* Get to get struct +/* Get FIONREAD from . Get to get struct * tchars. But get first to make sure ttold.h doesn't - * interfere. + * interfere. And don't try to use SIGIO yet. */ #ifndef NOT_C_CODE @@ -118,54 +65,41 @@ #include #include #include +/* Delete #include */ #include +#include #include -#endif - -/* This sets the name of the master side of the PTY. */ - -#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); - -/* This sets the name of the slave side of the PTY. On SysVr4, - grantpt(3) forks a subprocess, so keep sigchld_handler() from - intercepting that death. If any child but grantpt's should die - within, it should be caught after EMACS_UNBLOCK_SIGNAL. */ - -/* XEmacs change */ -#ifndef NOT_C_CODE -# if !__STDC__ && !defined(STDC_HEADERS) -char *ptsname (); -# endif +/* XEmacs -- GNU added this, but we never had it defined and C-g apparently + worked fine before, so don't define it */ +/* #define BROKEN_SIGIO */ #endif -#define PTY_TTY_NAME_SPRINTF \ - { \ - char *ptyname; \ - \ - EMACS_BLOCK_SIGCHLD; \ - if (grantpt (fd) == -1) \ - { close (fd); return -1; } \ - EMACS_UNBLOCK_SIGCHLD; \ - if (unlockpt (fd) == -1) \ - { close (fd); return -1; } \ - if (!(ptyname = ptsname (fd))) \ - { close (fd); return -1; } \ - strncpy (pty_name, ptyname, sizeof (pty_name)); \ - pty_name[sizeof (pty_name) - 1] = 0; \ - } +/* Delete NSIG_MINIMUM -- unused in XEmacs */ + +/* Delete CLASH_DETECTION (config option), HAVE_PTYS, HAVE_TERMIOS, + wait3, WRETCODE, TIOCSIGSEND -- not used in XEmacs or found by configure */ + +/* Delete FIRST_PTY_LETTER, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF -- + duplicative of code already in process-unix.c */ + +/* Delete SETUP_SLAVE_PTY -- unused in XEmacs */ + +/* Delete HAVE_SOCKETS -- autodetected */ + -/* Push various streams modules onto a PTY channel. */ + +/* Begin XEmacs additions */ + +/* Compiler bug bites on many systems when default ADDR_CORRECT is used. */ + +#define ADDR_CORRECT(x) (x) -#define SETUP_SLAVE_PTY \ - if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ - fatal ("ioctl I_PUSH ptem: errno %d\n", errno); \ - if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \ - fatal ("ioctl I_PUSH ldterm: errno %d\n", errno); \ - if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \ - fatal ("ioctl I_PUSH ttcompat: errno %d\n", errno); +/* Enable support for shared libraries in unexec. */ -/* Tell x11term.c and keyboard.c we have the system V streams feature. */ -#define SYSV_STREAMS +#define USG_SHARED_LIBRARIES + +#define LIBS_SYSTEM "-lsocket -lnsl -lelf" + /* On Some SysV System , w3 freeze. If freeze your xemacs , Add below definition */ /* This definition added by Shogo Fujii(shogo@bsd1.kbnes.nec.co.jp) */ #define PROCESS_IO_BLOCKING diff -r f62141fe007d -r 861f2601a38b src/sysdep.c --- a/src/sysdep.c Fri Feb 19 22:41:03 2010 -0600 +++ b/src/sysdep.c Sat Feb 20 06:03:00 2010 -0600 @@ -2166,37 +2166,18 @@ #ifdef HAVE_SIGPROCMASK -/* #### Is there any reason this is static global rather than local? */ -static struct sigaction new_action, old_action; - signal_handler_t qxe_reliable_signal (int signal_number, signal_handler_t action) { -#if 0 - - /* XEmacs works better if system calls are *not* restarted. + static struct sigaction new_action, old_action; + + /* XEmacs works better if system calls are not restarted. This allows C-g to interrupt reads and writes, on most systems. #### Another possibility is to just longjmp() out of the signal handler. According to W.R. Stevens, this should be OK on all systems. However, I don't want to deal with the potential evil ramifications of this at this point. */ - - sigemptyset (&new_action.sa_mask); - new_action.sa_handler = action; -#if defined (SA_RESTART) - /* Emacs mostly works better with restartable system services. If this - * flag exists, we probably want to turn it on here. - */ - new_action.sa_flags = SA_RESTART; -#else - new_action.sa_flags = 0; -#endif - sigaction (signal_number, &new_action, &old_action); - return (old_action.sa_handler); - -#else /* not 0 */ - sigemptyset (&new_action.sa_mask); new_action.sa_handler = action; #if defined (SA_INTERRUPT) /* don't restart system calls, under SunOS */ @@ -2206,8 +2187,6 @@ #endif sigaction (signal_number, &new_action, &old_action); return (signal_handler_t) (old_action.sa_handler); - -#endif /* not 0 */ } #elif defined (HAVE_SIGBLOCK) @@ -2241,7 +2220,7 @@ #ifndef HAVE_STRERROR -#if !defined(__alpha) && !defined(MACH) && !defined(LINUX) && !defined(IRIX) && !defined(__NetBSD__) +#if !defined(__alpha) && !defined(MACH) && !defined(LINUX) && !defined(IRIX6_5) && !defined(__NetBSD__) /* Linux added here by Raymond L. Toy for XEmacs. */ /* Irix added here by gparker@sni-usa.com for XEmacs. */ /* NetBSD added here by James R Grinter for XEmacs */ @@ -2328,17 +2307,11 @@ static int retry_open_1 (const Extbyte *path, int oflag, int mode) { -#ifdef INTERRUPTIBLE_OPEN - { - int rtnval; - while ((rtnval = underlying_open (path, oflag, mode)) == -1 - && (errno == EINTR)) - DO_NOTHING; - return rtnval; - } -#else - return underlying_open (path, oflag, mode); -#endif + int rtnval; + while ((rtnval = underlying_open (path, oflag, mode)) == -1 + && (errno == EINTR)) + DO_NOTHING; + return rtnval; } /* A version of open() that retries when interrupted. Operates on @@ -2432,7 +2405,6 @@ int retry_close (int filedes) { -#ifdef INTERRUPTIBLE_CLOSE int did_retry = 0; REGISTER int rtnval; @@ -2447,9 +2419,6 @@ return 0; return rtnval; -#else - return close (filedes); -#endif } static ssize_t @@ -2457,7 +2426,6 @@ { ssize_t rtnval; - /* No harm in looping regardless of the INTERRUPTIBLE_IO setting. */ while ((rtnval = read (fildes, buf, nbyte)) == -1 && (errno == EINTR)) { @@ -2479,7 +2447,6 @@ ssize_t bytes_written = 0; const char *b = (const char *) buf; - /* No harm in looping regardless of the INTERRUPTIBLE_IO setting. */ while (nbyte > 0) { ssize_t rtnval = write (fildes, b, nbyte); @@ -2581,16 +2548,12 @@ return NULL; return _fdopen (fd, mode_save); -#elif defined (INTERRUPTIBLE_OPEN) - { - FILE *rtnval; - while (!(rtnval = fopen (path, mode)) && (errno == EINTR)) - DO_NOTHING; - return rtnval; - } #else - return fopen (path, mode); -#endif /* defined (INTERRUPTIBLE_OPEN) */ + FILE *rtnval; + while (!(rtnval = fopen (path, mode)) && (errno == EINTR)) + DO_NOTHING; + return rtnval; +#endif /* (not) WIN32_NATIVE */ } FILE * @@ -2604,22 +2567,17 @@ int retry_fclose (FILE *stream) { -#ifdef INTERRUPTIBLE_CLOSE int rtnval; while ((rtnval = fclose (stream)) == EOF && (errno == EINTR)) ; return rtnval; -#else - return fclose (stream); -#endif } size_t retry_fread (void *ptr, size_t size, size_t nitem, FILE *stream) { -#ifdef INTERRUPTIBLE_IO size_t rtnval; size_t items_read = 0; char *b = (char *) ptr; @@ -2639,15 +2597,11 @@ items_read += rtnval; } return (items_read); -#else - return fread (ptr, size, nitem, stream); -#endif } size_t retry_fwrite (const void *ptr, size_t size, size_t nitem, FILE *stream) { -#ifdef INTERRUPTIBLE_IO size_t rtnval; size_t items_written = 0; const char *b = (const char *) ptr; @@ -2667,9 +2621,6 @@ items_written += rtnval; } return (items_written); -#else - return fwrite (ptr, size, nitem, stream); -#endif } /********************* directory calls *******************/