]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
autoconf detection of label support
authorChaz Chandler <clc31@inbox.com>
Wed, 4 Aug 2010 18:17:03 +0000 (11:17 -0700)
committerDerrick Brashear <shadow@dementia.org>
Thu, 12 Aug 2010 22:07:21 +0000 (15:07 -0700)
acinclude.m4 now has struct label support detection and sets
HAVE_STRUCT_LABEL_SUPPORT in afsconfig.h.  Obviates complicated
ifdefs in various src/afs/ and src/rx/ files.  Must run regen.sh
to generate new configure and afsconfig.h.in, then configure will
detect label support and set afsconfig.h appropriately.  Not sure
what to do for Windows, but should be a step in the right
direction.

Fixes issue with compilation of libuafs on IRIX and sunpro by accurately
detecting label support.

Change-Id: I092eda47c4cfcc2517dc39f5e48b5038c413cb01
Change-Id: I2ff8449b28db645d9cfd27796b5f89e5c328a2b2
Reviewed-on: http://gerrit.openafs.org/2516
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4
src/afs/afs_dcache.c
src/afs/afs_fetchstore.c
src/rx/xdr_len.c
src/rx/xdr_mem.c
src/rx/xdr_rx.c

index 9effae9fa2aacca257724f437611dd859392ab45..5478a22b1cfe1b3a1950bd042a285904cde81dcc 100644 (file)
@@ -1390,4 +1390,22 @@ mkdir -p ${TOP_OBJDIR}/src/JAVA/libjafs
 dnl Check to see if crypt lives in a different library
 AC_CHECK_LIB(crypt, crypt, LIB_crypt="-lcrypt")
 AC_SUBST(LIB_crypt)
+
+dnl Check to see if the compiler support labels in structs
+AC_MSG_CHECKING(for label support in structs)
+AC_TRY_COMPILE([], [
+extern void osi_UFSOpen(void);
+struct labeltest {
+   void (*open) (void);
+};
+struct labeltest struct_labeltest = {
+   .open       = osi_UFSOpen,
+}
+],
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_LABEL_SUPPORT, 1, [Define to 1 if your compiler supports labels in structs.])
+],
+[AC_MSG_RESULT(no)
+])
+
 ])
index ea708f4a2bbbdf7d19c8436dd1394552ec314bc0..e37c81215d6be5e38b9ab7d56e11c3872ff67438 100644 (file)
@@ -100,7 +100,7 @@ afs_int32 afs_dcentries;    /*!< In-memory dcache entries */
 int dcacheDisabled = 0;
 
 struct afs_cacheOps afs_UfsCacheOps = {
-#if defined(__SUNPRO_C) || (defined(AFS_SGI_ENV) && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
     osi_UFSOpen,
     osi_UFSTruncate,
     afs_osi_Read,
@@ -126,7 +126,7 @@ struct afs_cacheOps afs_UfsCacheOps = {
 };
 
 struct afs_cacheOps afs_MemCacheOps = {
-#if defined(__SUNPRO_C) || (defined(AFS_SGI_ENV) && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
     afs_MemCacheOpen,
     afs_MemCacheTruncate,
     afs_MemReadBlk,
index 15206fa32d11575eff5c5105009a964ee51c84ed..ffe6f1c47b1d333c1340236d55f4506097e2dc0e 100644 (file)
@@ -314,7 +314,7 @@ afs_GenericStoreProc(struct storeOps *ops, void *rock,
 
 static
 struct storeOps rxfs_storeUfsOps = {
-#if defined(__SUNPRO_C) || (defined(AFS_SGI_ENV) && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
     rxfs_storeUfsPrepare,
     rxfs_storeUfsRead,
     rxfs_storeUfsWrite,
@@ -341,7 +341,7 @@ struct storeOps rxfs_storeUfsOps = {
 
 static
 struct storeOps rxfs_storeMemOps = {
-#if defined(__SUNPRO_C) || (defined(AFS_SGI_ENV) && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
     rxfs_storeMemPrepare,
     rxfs_storeMemRead,
     rxfs_storeMemWrite,
index 7a55daa58503722559cbf294b6b773ef337ea0d4..8e2c4cbd028a271110743acc058f4c7fae35a23c 100644 (file)
@@ -84,7 +84,7 @@ xdrlen_inline(XDR *xdrs, u_int len)
 }
 
 static struct xdr_ops xdrlen_ops = {
-#if defined(AFS_NT40_ENV) || defined(__SUNPRO_C) || (defined(AFS_SGI_ENV)  && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
 #ifdef AFS_XDR_64BITOPS
     NULL,
     NULL,
index 475ea03c6a664bf542e0a68337527582550470f6..18ea3db67867a1eb0c04f5c92c16ad0f41180ebe 100644 (file)
@@ -62,7 +62,7 @@ static afs_int32 *xdrmem_inline(XDR *, u_int);
 static void xdrmem_destroy(XDR *);
 
 static struct xdr_ops xdrmem_ops = {
-#if defined(AFS_NT40_ENV) || defined(__SUNPRO_C) || (defined(AFS_SGI_ENV)  && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
 #ifdef AFS_XDR_64BITOPS
     NULL,
     NULL,
index 85e3ba274695d1dc779c2ca2c8c0a57d1a26f1e4..500888a6724d7512b17901b6e01659e02c48566a 100644 (file)
@@ -80,7 +80,7 @@ static afs_int32 *xdrrx_inline(XDR *axdrs, u_int len);
  * Ops vector for stdio type XDR
  */
 static struct xdr_ops xdrrx_ops = {
-#if defined(AFS_NT40_ENV) || defined(__SUNPRO_C) || (defined(AFS_SGI_ENV)  && !defined(__c99))
+#ifndef HAVE_STRUCT_LABEL_SUPPORT
 #ifdef AFS_XDR_64BITOPS
     xdrrx_getint64,     /* deserialize an afs_int64 */
     xdrrx_putint64,     /* serialize an afs_int64 */