From d456bd9b258445f60745867c34ef7c7a8c7be187 Mon Sep 17 00:00:00 2001 From: Marcio Barbosa Date: Mon, 14 Feb 2022 15:09:27 -0800 Subject: [PATCH] build: Select param.h in sysname.m4 Currently, the way the file that will be used as param.h is selected doesn't allow us to choose headers from other architectures, making cross-compiling difficult. In an effort to facilitate this process, select the header that will be used as param.h in sysname.m4. By doing this, we will have more flexibility to select which header should be used (in future commits). Change-Id: I5c77e9e061b847e770bf25f454fe891b5ead9429 Reviewed-on: https://gerrit.openafs.org/14914 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/cf/sysname.m4 | 6 ++++++ src/cf/variables.m4 | 1 + src/config/Makefile.config.in | 1 + src/config/Makefile.in | 6 +++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cf/sysname.m4 b/src/cf/sysname.m4 index a5a83607ae..5c205af76a 100644 --- a/src/cf/sysname.m4 +++ b/src/cf/sysname.m4 @@ -375,4 +375,10 @@ case $AFS_SYSNAME in *_linux_26) AFS_PARAM_COMMON=param.linux26.h ;; *_fbsd_*) AFS_PARAM_COMMON=param.generic_fbsd.h ;; esac + +case $AFS_SYSNAME in + *) + AFS_PARAM=param.${AFS_SYSNAME}.h + ;; +esac ]) diff --git a/src/cf/variables.m4 b/src/cf/variables.m4 index 9ff3ad1d92..c9494c290d 100644 --- a/src/cf/variables.m4 +++ b/src/cf/variables.m4 @@ -1,6 +1,7 @@ AC_DEFUN([OPENAFS_OUTPUT_VARIABLES],[ AC_SUBST(VFSCK) AC_SUBST(AFS_SYSNAME) +AC_SUBST(AFS_PARAM) AC_SUBST(AFS_PARAM_COMMON) AC_SUBST(ENABLE_KERNEL_MODULE) AC_SUBST(ENABLE_PTHREADED_UBIK) diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index aed51da7d9..d7434ded2a 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -81,6 +81,7 @@ LINUX_VERS = @LINUX_VERSION@ LWP_OPTMZ = @LWP_OPTMZ@ LWP_DBG = @LWP_DBG@ MKAFS_OSTYPE = @MKAFS_OSTYPE@ +AFS_PARAM = @AFS_PARAM@ AFS_PARAM_COMMON = @AFS_PARAM_COMMON@ MT_CC = @MT_CC@ MT_CFLAGS = @MT_CFLAGS@ diff --git a/src/config/Makefile.in b/src/config/Makefile.in index 31eadd5968..0bdd5bdce1 100644 --- a/src/config/Makefile.in +++ b/src/config/Makefile.in @@ -58,11 +58,11 @@ config.o: config.c AFS_component_version_number.c # Include installation targets # -param.h.new: ${srcdir}/param.${SYS_NAME}.h ${AFS_PARAM_COMMON} +param.h.new: ${srcdir}/${AFS_PARAM} ${AFS_PARAM_COMMON} if [ "X${AFS_PARAM_COMMON}" != "X" ] ; then \ - cat ${srcdir}/${AFS_PARAM_COMMON} ${srcdir}/param.${SYS_NAME}.h > param.h.new ; \ + cat ${srcdir}/${AFS_PARAM_COMMON} ${srcdir}/${AFS_PARAM} > param.h.new ; \ else \ - cat ${srcdir}/param.${SYS_NAME}.h > param.h.new ; \ + cat ${srcdir}/${AFS_PARAM} > param.h.new ; \ fi ${DEST}/include/afs/param.h ${DESTDIR}${includedir}/afs/param.h ${TOP_INCDIR}/afs/param.h: param.h.new