From 3d90d399245c62521428b355c341c46190d1f52a Mon Sep 17 00:00:00 2001 From: hag Date: Tue, 29 Oct 1996 23:22:20 +0000 Subject: [PATCH] Fix building problem under Linux ELF systems; no nlist.h --- configure | 2 +- configure.in | 2 +- sysdep.h.in | 4 ++++ unix.c | 17 ++++++++--------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 50f073f..64bfb27 100755 --- a/configure +++ b/configure @@ -1620,7 +1620,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in libgen.h sys/timeb.h posix/time.h sys/select.h +for ac_hdr in libgen.h sys/timeb.h posix/time.h sys/select.h nlist.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff --git a/configure.in b/configure.in index 4ba38bc..dff9614 100644 --- a/configure.in +++ b/configure.in @@ -328,7 +328,7 @@ AC_CHECK_LIB(dld, shl_findsym) dnl AC_CHECK_LIB(mld, main) AC_RETSIGTYPE -AC_HAVE_HEADERS(libgen.h sys/timeb.h posix/time.h sys/select.h) +AC_HAVE_HEADERS(libgen.h sys/timeb.h posix/time.h sys/select.h nlist.h) AC_HAVE_FUNCS(strerror) AC_HAVE_FUNCS(dlopen gettimeofday ftime nlist select setitimer sigaction) AC_HAVE_FUNCS(socket chroot) diff --git a/sysdep.h.in b/sysdep.h.in index f5ae24b..a5c440e 100644 --- a/sysdep.h.in +++ b/sysdep.h.in @@ -44,6 +44,10 @@ not-very-portable way of looking up external symbols. */ #undef HAVE_NLIST +/* Define if you have the nlist.h header file. Some systems (linux) + have nlist, but not nlist.h */ +#undef HAVE_NLIST_H + /* Define if struct nlist, defined in , has an n_name component. If it doesn't then we expect it to have an n_un component. */ #undef NLIST_HAS_N_NAME diff --git a/unix.c b/unix.c index 3cd3770..9ae5742 100644 --- a/unix.c +++ b/unix.c @@ -90,7 +90,7 @@ # include /* for ftime() */ #endif -#if defined(HAVE_NLIST) +#if defined(HAVE_NLIST_H) # include /* conforms to "SVID2", whatever that is */ #endif @@ -105,7 +105,7 @@ extern long Spending_interruptsS; static RETSIGTYPE when_keyboard_interrupt(sig, code, scp) - int sig, code; + int sig, code; struct sigcontext *scp; { Spending_interruptsS |= (1 << INTERRUPT_KEYBOARD); @@ -117,7 +117,7 @@ when_keyboard_interrupt(sig, code, scp) static RETSIGTYPE when_alarm_interrupt(sig, code, scp) - int sig, code; + int sig, code; struct sigcontext *scp; { Spending_interruptsS |= (1 << INTERRUPT_ALARM); @@ -148,7 +148,7 @@ sysdep_init() sa.sa_handler = SIG_IGN; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - sigaction(SIGPIPE, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); } } @@ -479,7 +479,7 @@ fill_the_table(void) fprintf(stderr, "Error during external name lookup\n"); return; } - + if ((f = ldopen(reloc_info_file, NULL)) == NULL) { fprintf(stderr, "Error during external name lookup\n"); return; @@ -522,7 +522,7 @@ fill_the_table(void) if (cur_entry) cur_entry->next = NULL; - + ldclose(f); } @@ -538,7 +538,7 @@ really_lookup_external_name(char *name) } return(0); } - + long lookup_external_name(char *name, long *location) { @@ -632,7 +632,7 @@ lookup_external_name(char *name, long *location) name_list[0].n_name = nm; name_list[1].n_name = 0; - + status = nlist(reloc_info_file, name_list); if (status != 0 || (name_list[0].n_value == 0 @@ -665,4 +665,3 @@ get_reloc_file() return(NULL); } } -