Skip to content

Commit 259f753

Browse files
committed
Merge pull request open-mpi#662 from miked-mellanox/topic/pr_build
v2.x - BUILD: add configury logic to specify patch dir as --with-platform-patches-dir=DIR
2 parents 3d02a42 + 36d88eb commit 259f753

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

config/opal_load_platform.m4

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ dnl
2323
# OPAL_LOAD_PLATFORM()
2424
# --------------------
2525
AC_DEFUN([OPAL_LOAD_PLATFORM], [
26+
AC_ARG_WITH([platform-patches-dir],
27+
[AC_HELP_STRING([--with-platform-patches-dir=DIR],
28+
[Location of the platform patches directory. If you use this option, you must also use --with-platform.])])
29+
2630
AC_ARG_WITH([platform],
2731
[AC_HELP_STRING([--with-platform=FILE],
2832
[Load options for build from FILE. Options on the
@@ -98,6 +102,19 @@ AC_DEFUN([OPAL_LOAD_PLATFORM], [
98102
fi
99103

100104
patch_dir="${with_platform}.patches"
105+
if test -n "$with_platform_patches_dir"; then
106+
if test "$with_platform_patches_dir" = "yes"; then
107+
patch_dir="${with_platform}.patches"
108+
elif test "$with_platform_patches_dir" = "no"; then
109+
AC_MSG_NOTICE([Disabling platform patches on user request])
110+
patch_dir=""
111+
elif test -d "$with_platform_patches_dir"; then
112+
patch_dir=$with_platform_patches_dir
113+
else
114+
AC_MSG_ERROR([User provided patches directory: $with_platform_patches_dir not found])
115+
fi
116+
fi
117+
101118
patch_done="${srcdir}/.platform_patches"
102119
patch_found=no
103120

@@ -155,15 +172,16 @@ AC_DEFUN([OPAL_LOAD_PLATFORM], [
155172

156173
AC_MSG_NOTICE([Platform patches applied, created stamp file ${patch_done}])
157174
touch ${patch_done}
175+
else
176+
AC_MSG_NOTICE([No platform patches in ${patch_dir}])
158177
fi
159178

160179
else
161180
AC_MSG_WARN([Platform patches already applied, skipping. ${patch_done} can be removed to re-apply ])
162181
fi
163-
else
164-
AC_MSG_NOTICE([No platform patches in ${patch_dir}])
182+
elif test -n "${patch_dir}"; then
183+
AC_MSG_NOTICE([No platform patches in ${patch_dir}])
165184
fi
166-
167185
else
168186
AC_SUBST(OPAL_DEFAULT_MCA_PARAM_CONF, [openmpi-mca-params.conf])
169187
fi

0 commit comments

Comments
 (0)