aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-12-07 20:27:07 +0000
committerWarner Losh <imp@FreeBSD.org>2023-12-07 20:42:52 +0000
commitbd234c0d4c8256db7e5a1fdda9ef311c9e0080e4 (patch)
treec72f079356d484175a771661e8d8360d775ccce7
parent3e7e3b5bdf902a375decc11b95179fd2fbc0da2a (diff)
downloadsrc-bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4.tar.gz
src-bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4.zip
sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined
On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the build blows up. Since we don't need this feature for the FreeBSD build process, and since we won't use it unless we actually install the NL files that have this data in it, just #ifdef it out for now. In the extremely unlikely event that the FreeBSD bootstrap/build process grows this dependency, we can evaluate the best solution then (which most likely is going to be not depend on the local's month names). Fixes: 3d44dce90a69 (MacOS builds and github CI) Sponsored by: Netflix Reviewed by: jrtc27, jlduran@gmail.com, markj Differential Revision: https://reviews.freebsd.org/D42868
-rw-r--r--usr.bin/sort/bwstring.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c
index b0c14e996b23..10679fe631ba 100644
--- a/usr.bin/sort/bwstring.c
+++ b/usr.bin/sort/bwstring.c
@@ -113,9 +113,11 @@ initialise_months(void)
const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4,
ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10,
ABMON_11, ABMON_12 };
+#ifdef ALTMON_1
const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4,
ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10,
ALTMON_11, ALTMON_12 };
+#endif
int i;
/*
@@ -132,9 +134,13 @@ initialise_months(void)
if (!populate_cmonth(&cmonths[i].ab,
ab_item[i], i))
continue;
+#ifdef ALTMON_1
if (!populate_cmonth(&cmonths[i].alt,
alt_item[i], i))
continue;
+#else
+ cmonths[i].alt = NULL;
+#endif
}
}
@@ -148,9 +154,13 @@ initialise_months(void)
if (!populate_wmonth(&wmonths[i].ab,
ab_item[i], i))
continue;
+#ifdef ALTMON_1
if (!populate_wmonth(&wmonths[i].alt,
alt_item[i], i))
continue;
+#else
+ wmonths[i].alt = NULL;
+#endif
}
}
}