Much thanks for the __STDC__ info, Stephen.   Beware that the second  
solution doesn't work as the compiler complains:
"database.c", line 61.9: 1506-188 (E) Reserved name __STDC__ cannot be  
defined as a macro name.
The first solution (I modified db.h) fixed the compile.   I was a  
little surprised to see Berkeley db being compiled at all and then  
later surprised that esd was being compiled --- the configure process  
apparently automatically looked in /opt/freeware/include --- but then  
didn't add /opt/freeware/lib.   I'm now avoiding that whole business by  
adding "--with-sound=none --with-database=no" to configure.
I've gotten to the temacs link, and new problems have cropped up.  I  
had a very similar list when I tried to build 21.4.12 a week or so ago.  
  I've been using 'nm' to try and locate missing symbols and have only  
been partially successful.  I resolved a few by adding '-lcrypt', but  
the rest have resisted by efforts of discovery.
The list of symbols is below.  Any ideas where they are supposed to  
come from?
Travis
_____________
ld: 0711-318 ERROR: Undefined symbols were found.
         The following symbols are in error:
  Symbol                    Inpndx  TY CL Source-File(Object-File) OR  
Import-File{Shared-object}
                               RLD: Address  Section  Rld-type  
Referencing Symbol
   
------------------------------------------------------------------------ 
----------------------
  __crypt_r                 [676]   ER DS (/usr/ccs/lib/libc.a[shr.o])
                                    00043aa0 .data    R_POS    [3464]   
<__crypt_r>
  __setkey_r                [680]   ER DS (/usr/ccs/lib/libc.a[shr.o])
                                    00043aa4 .data    R_POS    [3466]   
<__setkey_r>
  __encrypt_r               [678]   ER DS (/usr/ccs/lib/libc.a[shr.o])
                                    00043aa8 .data    R_POS    [3468]   
<__encrypt_r>
  smgetbuff                 [258]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c9c .data    R_POS    [794]    
<smgetbuff>
  XGetSelectedExtensionEvents [314]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b790 .data    R_POS    [610]    
<XGetSelectedExtensionEvents>
  XSelectExtensionEvent     [322]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b794 .data    R_POS    [612]    
<XSelectExtensionEvent>
  XGetExtensionVersion      [312]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b79c .data    R_POS    [616]    
<XGetExtensionVersion>
  XListInputDevices         [318]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b7a0 .data    R_POS    [618]    
<XListInputDevices>
  XOpenDevice               [320]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b7a4 .data    R_POS    [620]    
<XOpenDevice>
  XFreeDeviceList           [316]   ER DS  
(/usr/X11R6/lib/libXt.a[shr4.o])
                                    0000b918 .data    R_POS    [806]    
<XFreeDeviceList>
  smsendbuff                [264]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c3c .data    R_POS    [746]    
<smsendbuff>
  smfreebuff                [262]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c40 .data    R_POS    [748]    
<smfreebuff>
  smrcvbuff                 [260]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c44 .data    R_POS    [750]    
<smrcvbuff>
  smconnect                 [256]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c48 .data    R_POS    [752]    
<smconnect>
  smsocket                  [254]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00022c4c .data    R_POS    [754]    
<smsocket>
  smwait                    [266]   ER DS  
(/usr/X11R6/lib/libX11.a[shr4.o])
                                    00023190 .data    R_POS    [1428]   
<smwait>
  _kgrantpt                 [0]     ER DS (/usr/ccs/lib/libc.a[pty.o])
                                    00000058 .data    R_POS    [4]      
<_kgrantpt>
Link command:
cc -qnoansialias -qmaxmem=-1 -O  
-Wl,-bnso,-bnodelcsect,-bI:/lib/syscalls.exp,-bI:/lib/threads.exp,- 
bloadmap:lm \
-L/sup/xpm-3.4k/lib \
-L/sup/zlib-1.1.4/lib \
-L/sup/libpng-1.2.5/lib \
-L/usr/ccs/lib \
-L/usr/X11R6/lib -o temacs \
abbrev.o alloc.o alloca.o blocktype.o buffer.o bytecode.o callint.o  
casefiddle.o casetab.o chartab.o filelock.o \
cmdloop.o cmds.o console.o console-stream.o data.o debug.o tests.o  
device.o dired.o doc.o doprnt.o dynarr.o \
editfns.o elhash.o emacs.o eval.o events.o event-stream.o  
event-unixoid.o unexaix.o getloadavg.o terminfo.o \
extents.o faces.o file-coding.o fileio.o filemode.o floatfns.o fns.o  
font-lock.o frame.o general.o dgif_lib.o \
gif_io.o glyphs.o glyphs-eimage.o glyphs-shared.o glyphs-widget.o gui.o  
menubar.o scrollbar.o toolbar.o gutter.o \
hash.o imgproc.o indent.o insdel.o intl.o keymap.o line-number.o  
lread.o lstream.o macros.o marker.o md5.o minibuf.o \
objects.o opaque.o print.o process.o process-unix.o profile.o  
rangetab.o realpath.o redisplay.o redisplay-output.o \
regex.o search.o select.o sysdll.o emodules.o signal.o sound.o  
specifier.o strftime.o symbols.o syntax.o sysdep.o \
text.o console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o  
redisplay-tty.o cm.o undo.o unicode.o \
console-x.o device-x.o event-Xt.o frame-x.o glyphs-x.o objects-x.o  
redisplay-x.o select-x.o xgccache.o intl-x.o \
gui-x.o menubar-x.o scrollbar-x.o toolbar-x.o toolbar-common.o widget.o  
window.o lastfile.o ralloc.o EmacsFrame.o \
EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o  
../lwlib/liblw.a \
-lcrypt \
-lpng -lz -lXpm -lXmu -lXt \
-lXext -lX11 -lSM -lICE -lcurses -lm -lrts -lIM -liconv -lC