[OpenAFS-devel] initial afsconfig.h.in patch

Nathan Neulinger nneul@umr.edu
Mon, 30 Apr 2001 09:55:28 -0500


--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

This adds an afsconfig.h.in file in the config/ subdir of the project. The 
make links target is modified to symlink afsconfig.h.in to afsconfig.h in the
object directory - this would be removed when autoconf is building the
file directly.

The config/Makefile has been modified to add afsconfig.h targets similar
to the param.h targets so that the afsconfig.h file gets installed. The 
file is named afsconfig.h so that when it is installed it into the dest 
include dir it doesn't interfere with any other project config.h file. 
It's being installed for the same reason that param.h is currently being 
installed.

Also, right now, since this afsconfig.h.in file depends on the afs 
param.h file being included, the include is after the param.h include. I 
suppose that afsconfig.h.in could #include <afs/param.h> within itself if 
that is preferred. Eventually, this won't be necessary. (As soon as a 
minimal autoconf environment is made that can determine which 
AFS_XXX_ENV's to define.)

I started modifying afsd.c to make use of the afs/afsconfig.h include. 
For now, it's being included as #include <afs/afsconfig.h>, but when the 
autoconf stuff is developed, I think that the Makefile should be doing 
-I$(srcdir) etc. and just use #include "afsconfig.h".

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216

--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="afs-config-h.diff"

Index: Makefile
===================================================================
RCS file: /cvs/openafs/src/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- Makefile	2001/04/14 17:45:16	1.18
+++ Makefile	2001/04/30 14:49:29
@@ -523,7 +512,12 @@
 	cd src; \
 	for file in `find [!NW]* -type f -print` ; do \
 		/bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \
-	done;
+	done; \
+	/bin/ln -s afsconfig.h.in $${here}/obj/config/afsconfig.h ;
+
+# config.h link will eventually be replaced with generating the file 
+# directly from config.h.in via configure run. I'm linking instead of
+# copying to ease development for now
 
 #
 # Below targets are all deprecated, insecure, or obsolte, 
Index: config/Makefile
===================================================================
RCS file: /cvs/openafs/src/config/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- config/Makefile	2001/03/27 22:03:01	1.4
+++ config/Makefile	2001/04/30 14:49:29
@@ -65,10 +65,13 @@
 ${KERNELDIR}/afs/param.h ${DESTDIR}include/afs/param.h :: param.${SYS_NAME}.h
 	-$(RM) -f $@; $(CP) $? $@
 
+${KERNELDIR}/afs/afsconfig.h ${DESTDIR}include/afs/afsconfig.h :: afsconfig.h
+	-$(RM) -f $@; $(CP) $? $@
+
 ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}include/afs/afs_sysnames.h :: afs_sysnames.h
 	$(RM) -f $@; $(CP) $? $@
 
-DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h  ${DESTDIR}include/afs/param.h  ${DESTDIR}include/afs/stds.h  ${DESTDIR}include/afs/icl.h 
+DESTINCLS = ${DESTDIR}include/afs/afsconfig.h ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h  ${DESTDIR}include/afs/param.h  ${DESTDIR}include/afs/stds.h  ${DESTDIR}include/afs/icl.h 
 
 ${KERNELDIR}/afs/stds.h ${DESTDIR}include/afs/stds.h :: stds.h
 	$(RM) -f $@; $(CP) $? $@
@@ -97,6 +100,9 @@
 ${UKERNELDIR}/afs/param.h :: param.${SYS_NAME}_usr.h
 	-$(RM) -f $@; $(CP) $? $@
 
+${UKERNELDIR}/afs/afsconfig.h :: afsconfig.h
+	-$(RM) -f $@; $(CP) $? $@
+
 ${UKERNELDIR}/afs/afs_sysnames.h :: afs_sysnames.h
 	$(RM) -f $@; $(CP) $? $@
 
@@ -139,7 +145,7 @@
 # kernel include environment.  param.h is, well, param.h.  The afs_sysnames.h
 # file is needed by param.h to create unique identifiers for each SYS_TYPE.
 
-kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \
+kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h ${KERNELDIR}/afs/afsconfig.h\
 	${KERNELDIR}/afs/stds.h \
 	${KERNELDIR}/afs/afs_sysnames.h \
 	${KERNELDIR}/config/Makefile.${SYS_NAME} \
@@ -147,7 +153,7 @@
 	${KERNELDIR}/afs/icl.h \
 	${KERNELDIR}/afs/AFS_component_version_number.c
 
-ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/stds.h \
+ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/afsconfig.h ${UKERNELDIR}/afs/stds.h \
 	${UKERNELDIR}/afs/afs_sysnames.h \
 	${UKERNELDIR}/config/Makefile.${SYS_NAME} \
 	${UKERNELDIR}/afs/afs_args.h \
Index: afsd/afsd.c
===================================================================
RCS file: /cvs/openafs/src/afsd/afsd.c,v
retrieving revision 1.7
diff -u -r1.7 afsd.c
--- afsd/afsd.c	2001/04/14 17:27:53	1.7
+++ afsd/afsd.c	2001/04/30 14:49:30
@@ -54,6 +54,7 @@
 #define VFS 1
 
 #include <afs/param.h>
+#include <afs/afsconfig.h> /* change to "afsconfig.h" eventually */
 #include <afs/cmd.h>
 
 #include <assert.h>
@@ -72,30 +73,41 @@
 #include <sys/file.h>
 #include <errno.h>
 #include <sys/time.h>
-#ifdef	AFS_DEC_ENV
+#include <dirent.h>
+
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
-#include <sys/fs_types.h>
 #endif
-#if	defined(AFS_SUN_ENV)
-#include <sys/vfs.h>
+
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
 #endif
-#ifndef	AFS_AIX41_ENV
+
+#ifdef HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
 #endif
-#include <dirent.h>
-#ifdef	  AFS_SUN5_ENV
+
+#ifdef HAVE_SYS_FCNTL_H
 #include <sys/fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_MNTTAB_H
 #include <sys/mnttab.h>
+#endif
+
+#ifdef HAVE_SYS_MNTENT_H
 #include <sys/mntent.h>
-#else
-#if	defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
-#include <mntent.h>
 #endif
+
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
 #endif
 
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#ifdef HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
-#else
+#endif
+
+#ifdef HAVE_SYS_VFS_H
 #include <sys/vfs.h>
 #endif
 

--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="afsconfig.h.in"

/*
 *  This is a template config.h.in, it is not truly a config.h.in at the moment
 *  but will be converted to one during autoconf switch. The defines below
 *  are all static and hardcoded purely to aid in the cleanup and migration
 *  process.
 *
 */

#ifndef CONFIG_H
#define CONFIG_H

#define HAVE_STDLIB_H
#define HAVE_STRING_H

#ifdef AFS_NT40_ENV
#define HAVE_MALLOC_H
#define HAVE_WINSOCK2_H
#define HAVE_DIRECT_H
#define HAVE_IO_H
#endif

#ifndef AFS_NT40_ENV
#define HAVE_UNISTD_H
#define HAVE_FCNTL_H
#endif

#ifdef AFS_SUN5_ENV
#define HAVE_SYS_FCNTL_H
#define HAVE_SYS_MNTTAB_H
#define HAVE_SYS_MNTENT_H
#endif

#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
#define HAVE_MNTENT_H
#endif

#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#define HAVE_SYS_MOUNT_H
#else
#define HAVE_SYS_VFS_H
#endif

#ifdef AFS_DEC_ENV
#define HAVE_SYS_PARAM_H
#define HAVE_SYS_FS_TYPES_H
#endif

#ifdef AFS_AIX41_ENV
#define HAVE_SYS_MOUNT_H
#endif

#endif

--5vNYLRcllDrimb99--