Skip to contentSkip to conversation

Fix non-Linux build

PATCH Applied Samuel Thibault 2 participants 3 messages Sep 17, 2023 – Sep 18, 2023 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hello,

Here are some fixes for non-linux build.

Samuel

configure.ac +2 -1
index 5f609dec7..061e22e15 100644
@@ -1906,7 +1906,8 @@ AS_IF([test "x$build_enosys" = xyes], [
 ])
 AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes])
 
-UL_BUILD_INIT([lsclocks], [yes])
+UL_BUILD_INIT([lsclocks], [check])
+UL_REQUIRES_LINUX([lsclocks])
 AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes])
 
 UL_BUILD_INIT([getopt], [yes])
libmount/src/hooks.c +2 -0
index dcfe69fa4..39d9d1337 100644
@@ -315,9 +315,11 @@ static int call_hook(struct libmnt_context *cxt, struct hookset_hook *hook)
 {
 	int rc = 0;
 
+#if LINUX
 	if (mnt_context_is_fake(cxt))
 		DBG(CXT, ul_debugobj(cxt, " FAKE call"));
 	else
+#endif
 		rc = hook->func(cxt, hook->hookset, hook->data);
 
 	hook->executed = 1;
maintainer Applied
#1 lore raw
Quoted 1 line · Samuel Thibault

Here are some fixes for non-linux build.

Thanks!

configure.ac AS_IF([test "x$build_enosys" = xyes], [ · line 1911

Quoted 12 lines
configure.ac +2 -1
index 5f609dec7..061e22e15 100644
@@ -1906,7 +1906,8 @@ AS_IF([test "x$build_enosys" = xyes], [
 ])
 AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes])
 
-UL_BUILD_INIT([lsclocks], [yes])
+UL_BUILD_INIT([lsclocks], [check])
+UL_REQUIRES_LINUX([lsclocks])
 AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes])

Applied.

libmount/src/hooks.c static int call_hook(struct libmnt_context *cxt, struct hookset_hook *hook) · line 323

Quoted 12 lines
libmount/src/hooks.c +2 -0
@@ -315,9 +315,11 @@ static int call_hook(struct libmnt_context *cxt, struct hookset_hook *hook)
 {
 	int rc = 0;
 
+#if LINUX
 	if (mnt_context_is_fake(cxt))
 		DBG(CXT, ul_debugobj(cxt, " FAKE call"));
 	else
+#endif
 		rc = hook->func(cxt, hook->hookset, hook->data);

It seems better to not use libmount/src/hooks.c on non-Linux systems. Fixed (but not tested:-).

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw

Karel Zak, le lun. 18 sept. 2023 13:11:09 +0200, a ecrit:

Quoted 7 lines · Samuel Thibault
Quoted 6 lines
libmount/src/hooks.c +0 -0
@@ -315,9 +315,11 @@ static int call_hook(struct libmnt_context *cxt, struct hookset_hook *hook)
 {
 	int rc = 0;
 
Quoted 9 lines

libmount/src/hooks.c static int call_hook(struct libmnt_context *cxt, struct hookset_hook *hook) · line 323

Quoted 6 lines
libmount/src/hooks.c +2 -0
+#if LINUX
 	if (mnt_context_is_fake(cxt))
 		DBG(CXT, ul_debugobj(cxt, " FAKE call"));
 	else
+#endif
 		rc = hook->func(cxt, hook->hookset, hook->data);

It seems better to not use libmount/src/hooks.c on non-Linux systems. Fixed (but not tested:-).

That works, thanks!

Samuel