This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa libmudflap] portability tweaks


Hi -

The following patch improves libmudflap buildability somewhat.

2003-11-19  Frank Ch. Eigler  <fche@redhat.com>

	libmudflap/12939
	* mf-hooks2.c (semctl): Tolerate FreeBSD.

	* configure.in: Reorganize check for <pthread.h>.
	* configure: Regenerated.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/configure.in,v
retrieving revision 1.1.2.18
diff -u -p -s -r1.1.2.18 configure.in
--- configure.in	29 Jul 2003 21:11:45 -0000	1.1.2.18
+++ configure.in	19 Nov 2003 22:33:17 -0000
@@ -39,7 +39,7 @@ AC_TRY_COMPILE([
 [AC_MSG_RESULT(no)
 enable_shared=no])
 
-AC_CHECK_HEADERS(stdint.h execinfo.h signal.h pthread.h dlfcn.h)
+AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h)
 AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal)
 
 dnl Check for 64-bit stdio calls related to Large File Support
@@ -76,6 +76,12 @@ then
 fi
 
 pthread_create_version='""'
+AC_CHECK_HEADER(pthread.h,[
+AC_DEFINE_UNQUOTED(HAVE_PTHREAD_H, 1, [define if you have <pthread.h>])
+ac_have_pthread_h=yes
+],[
+ac_have_pthread_h=
+])
 AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$ac_have_pthread_h" != ""])
 
 AC_CHECK_LIB(dl, dlsym)
Index: mf-hooks2.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks2.c,v
retrieving revision 1.1.2.4
diff -u -p -s -r1.1.2.4 mf-hooks2.c
--- mf-hooks2.c	4 Nov 2003 18:13:28 -0000	1.1.2.4
+++ mf-hooks2.c	19 Nov 2003 22:33:17 -0000
@@ -1653,10 +1653,13 @@ WRAPPER2(int, semctl, int semid, int sem
       "semctl array");
     break;
 #ifdef IPC_INFO
+  /* FreeBSD 5.1 headers include IPC_INFO but not the __buf field.  */
+#if !defined(__FreeBSD__)
   case IPC_INFO:
     MF_VALIDATE_EXTENT (arg.__buf, sizeof (*arg.__buf), __MF_CHECK_WRITE,
       "semctl __buf");
     break;
+#endif
 #endif
   default:
     break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]