From 466eb22ad4be6bf074a93e918e3f3b4465e3d745 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Mon, 14 May 2001 23:23:12 +0000 Subject: [PATCH] initial-afsconfig-h-file-20010514 start of config file work for autoconf ==================== 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. ==================== make Makefile use top-level location rather than config as Nathan intended --- src/Makefile | 9 ++++++-- src/afsconfig.h.in | 52 ++++++++++++++++++++++++++++++++++++++++++++++ src/afsd/Makefile | 2 +- src/afsd/afsd.c | 36 +++++++++++++++++++++----------- 4 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 src/afsconfig.h.in diff --git a/src/Makefile b/src/Makefile index fcf927f33..14b593ebe 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,7 +36,7 @@ WITH_DEPRECATED=YES all: set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED) - $(MAKE) install "COMPILE_PART1=cd obj; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} "WASHTOOL=echo No washtool: " + $(MAKE) install "COMPILE_PART1=cd obj; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=`pwd`/${SYS_NAME}/obj" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=`pwd`/${SYS_NAME}/obj" SYS_NAME=${SYS_NAME} "WASHTOOL=echo No washtool: " basics: -if test -f "${WASHTOOL}"; \ @@ -523,7 +523,12 @@ links: cd src; \ for file in `find [!NW]* -type f -print` ; do \ /bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \ - done; + done; \ + /bin/ln -s $${here}/obj/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, diff --git a/src/afsconfig.h.in b/src/afsconfig.h.in new file mode 100644 index 000000000..5f8e26521 --- /dev/null +++ b/src/afsconfig.h.in @@ -0,0 +1,52 @@ +/* + * 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 AFSCONFIG_H +#define AFSCONFIG_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 /* AFSCONFIG_H */ diff --git a/src/afsd/Makefile b/src/afsd/Makefile index 6dd79b00f..454b0e10b 100644 --- a/src/afsd/Makefile +++ b/src/afsd/Makefile @@ -19,7 +19,7 @@ include ../config/Makefile.version INSTALLro = ${INSTALL} -m 644 INSTALLex = ${INSTALL} -m 755 -CFLAGS = -g -I${SRCDIR}include ${XCFLAGS} +CFLAGS = -g -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} LDFLAGS = -g ${XLDFLAGS} noversion: install diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 9c761189d..6962f3397 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -54,6 +54,7 @@ #define VFS 1 #include +#include "afsconfig.h" #include #include @@ -72,30 +73,41 @@ #include #include #include -#ifdef AFS_DEC_ENV +#include + +#ifdef HAVE_SYS_PARAM_H #include -#include #endif -#if defined(AFS_SUN_ENV) -#include + +#ifdef HAVE_SYS_FS_TYPES_H +#include #endif -#ifndef AFS_AIX41_ENV + +#ifdef HAVE_SYS_MOUNT_H #include #endif -#include -#ifdef AFS_SUN5_ENV + +#ifdef HAVE_SYS_FCNTL_H #include +#endif + +#ifdef HAVE_SYS_MNTTAB_H #include +#endif + +#ifdef HAVE_SYS_MNTENT_H #include -#else -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) -#include #endif + +#ifdef HAVE_MNTENT_H +#include #endif -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#ifdef HAVE_SYS_MOUNT_H #include -#else +#endif + +#ifdef HAVE_SYS_VFS_H #include #endif -- 2.39.5