From c9aaa428368f9a3eb0d1bff45c185929fcfaa5b2 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 18 Mar 2004 05:12:18 +0000 Subject: [PATCH] irix-attempt-to-detect-kernel-mem-routines-20040317 FIXES 3651 first pass at routine to detect kernel mem* routines ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== FIXES 3651 second try ==================== FIXES 3651 third try ==================== FIXES 3651 this time for sure. includes the definitions too, this way we can not have macros conflict with headers we don't need ==================== FIXES 3651 this time for sure. includes the definitions too, this way we can not have macros conflict with headers we don't need ==================== FIXES 3651 this time for sure. includes the definitions too, this way we can not have macros conflict with headers we don't need --- acconfig.h | 1 + src/cf/irix-test.m4 | 20 ++++++++++++++++++++ src/cf/osconf.m4 | 1 + src/config/param.sgi_65.h | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 src/cf/irix-test.m4 diff --git a/acconfig.h b/acconfig.h index 47ec12f08..8a1f21efe 100644 --- a/acconfig.h +++ b/acconfig.h @@ -34,6 +34,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #undef EXPORTED_IA32_SYS_CALL_TABLE #undef EXPORTED_TASKLIST_LOCK #undef INODE_SETATTR_NOT_VOID +#undef IRIX_HAS_MEM_FUNCS #undef RECALC_SIGPENDING_TAKES_VOID #undef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK diff --git a/src/cf/irix-test.m4 b/src/cf/irix-test.m4 new file mode 100644 index 000000000..354d15945 --- /dev/null +++ b/src/cf/irix-test.m4 @@ -0,0 +1,20 @@ +AC_DEFUN(IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS, [ +AC_MSG_CHECKING(for mem* in sys/systm.h) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" +AC_CACHE_VAL(ac_cv_irix_sys_systm_h_has_mem_funcs, +[ +AC_TRY_COMPILE( +[#include +#include ], +[ +extern void *memcpy(char *, const void *, size_t); +], +ac_cv_irix_sys_systm_h_has_mem_funcs=no, +ac_cv_irix_sys_systm_h_has_mem_funcs=yes)]) +CPPFLAGS="$save_CPPFLAGS" +if test "$ac_cv_irix_sys_systm_h_has_mem_funcs" = "yes"; then + AC_DEFINE(IRIX_HAS_MEM_FUNCS, 1, [define if irix has memcpy and friends]) +fi +AC_MSG_RESULT($ac_cv_irix_sys_systm_h_has_mem_funcs) +]) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 7feca7920..32334d762 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -734,6 +734,7 @@ esac # case $AFS_SYSNAME in sgi_6*) + IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS XFS_SIZE_CHECK="xfs_size_check" install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check' dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check' diff --git a/src/config/param.sgi_65.h b/src/config/param.sgi_65.h index 239d4167c..d69c1e16e 100644 --- a/src/config/param.sgi_65.h +++ b/src/config/param.sgi_65.h @@ -115,9 +115,11 @@ #define AFS_EVENT_LOCK 1 /* osi_Sleep/osi_Wakeup use spinlock. */ #define AFS_SGI_DUAL_FS_CACHE 1 /* implies supports EFS or XFS cache */ +#ifndef IRIX_HAS_MEM_FUNCS #define memset(A, B, S) bzero(A, S) #define memcpy(B, A, S) bcopy(A, B, S) #define memcmp(A, B, S) bcmp(A, B, S) +#endif #endif /* KERNEL */ -- 2.39.5