2004-06-04  Per Bothner  <per@bothner.com>

	* configure.in (LIBMUDFLAPTH):  Fix thinko.

	* configure.in:  Check for more headers.
	* mf-hooks2.c:  Conditionalize on HAVE_SYS_SOCKET_H etc.

	* mf-runtime.c:  In two places conditionalize on SIUSR1 rather than
	HAVE_SIGNAL as mingw has signal.h but not SIUSR1.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/configure.in,v
retrieving revision 1.3
diff -u -p -r1.3 configure.in
--- configure.in	1 Jun 2004 05:21:07 -0000	1.3
+++ configure.in	4 Jun 2004 00:13:47 -0000
@@ -62,7 +62,8 @@ AC_TRY_COMPILE([
 [AC_MSG_RESULT(no)
 enable_shared=no])
 
-AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h)
+AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h \
+  netdb.h sys/ipc.h sys/sem.h sys/wait.h sys/socket.h)
 AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal)
 
 dnl Check for 64-bit stdio calls related to Large File Support
Index: mf-hooks2.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/mf-hooks2.c,v
retrieving revision 1.2
diff -u -p -r1.2 mf-hooks2.c
--- mf-hooks2.c	13 May 2004 06:41:03 -0000	1.2
+++ mf-hooks2.c	4 Jun 2004 00:13:47 -0000
@@ -1206,6 +1206,8 @@ WRAPPER2(struct dirent *, readdir, DIR *
 }
 #endif
 
+#ifdef HAVE_SYS_SOCKET_H
+
 #ifdef WRAP_recv
 #include <sys/socket.h>
 WRAPPER2(int, recv, int s, void *buf, size_t len, int flags)
@@ -1327,6 +1329,8 @@ WRAPPER2(int, connect, int sockfd, const
 }
 #endif
 
+#endif /* HAVE_SYS_SOCKET_H */
+
 #ifdef WRAP_gethostname
 WRAPPER2(int, gethostname, char *name, size_t len)
 {
@@ -1345,6 +1349,8 @@ WRAPPER2(int, sethostname, const char *n
 }
 #endif
 
+#ifdef HAVE_NETDB_H
+
 #ifdef WRAP_gethostbyname
 #include <netdb.h>
 WRAPPER2(struct hostent *, gethostbyname, const char *name)
@@ -1425,6 +1431,10 @@ WRAPPER2(struct hostent *, gethostbyname
 }
 #endif
 
+#endif /* HAVE_NETDB_H */
+
+#ifdef SYS_WAIT_H
+
 #ifdef WRAP_wait
 #include <sys/wait.h>
 WRAPPER2(pid_t, wait, int *status)
@@ -1449,6 +1459,8 @@ WRAPPER2(pid_t, waitpid, pid_t pid, int 
 }
 #endif
 
+#endif /* HAVE_SYS_WAIT_H */
+
 #ifdef WRAP_popen
 WRAPPER2(FILE *, popen, const char *command, const char *mode)
 {
@@ -1651,6 +1663,8 @@ WRAPPER2(void *, dlsym, void *handle, ch
 }
 #endif
 
+#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H)
+
 #ifdef WRAP_semop
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -1765,3 +1779,5 @@ WRAPPER2(int, shmdt, const void *shmaddr
 }
 #endif
 
+#endif /* defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) */
+
Index: mf-runtime.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/mf-runtime.c,v
retrieving revision 1.3
diff -u -p -r1.3 mf-runtime.c
--- mf-runtime.c	17 May 2004 20:34:18 -0000	1.3
+++ mf-runtime.c	4 Jun 2004 00:13:48 -0000
@@ -296,7 +296,7 @@ options [] =
     {"collect-stats", 
      "collect statistics on mudflap's operation",
      set_option, 1, &__mf_opts.collect_stats},
-#if HAVE_SIGNAL
+#ifdef SIGUSR1
     {"sigusr1-report",
      "print report upon SIGUSR1",
      set_option, 1, &__mf_opts.sigusr1_report},
@@ -2354,7 +2354,7 @@ __mf_sigusr1_respond ()
 {
   static int handler_installed;
 
-#if HAVE_SIGNAL
+#ifdef SIGUSR1
   /* Manage handler */
   if (__mf_opts.sigusr1_report && ! handler_installed)
     {
