Skip to content

Add conditional include for sm.h based on AUTO_RELOAD - #521

Merged
troglobit merged 2 commits into
finit-project:masterfrom
firasuke:firasuke-patch-1
Nov 12, 2026
Merged

troglobit merged 2 commits into
finit-project:masterfrom
firasuke:firasuke-patch-1

Conversation

@firasuke

@firasuke firasuke commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Hey there,

I was attempting to configure finit version 5.0-rc1 with:

./configure \
  --prefix=/usr \
  --enable-auto-reload \
  --enable-pic \
  --enable-fastboot \
  --disable-logrotate \
  --disable-dbus \
  --disable-doc \
  --disable-contrib \
  --disable-rescue \
  --disable-dbus-plugin

and the build failed with the following error in both src/cgroup.c and src/conf.c:

error: implicit declaration of function ‘sm_reload’

All of the following solutions worked:
1- I tried removing --enable-auto-reload and it built fine, but I want the auto reload feature so I tried something else
2- I tried passing -Wno-implicit-function-declaration in CFLAGS and it worked, but I do not think it is a good idea
3- I tried to include sm.h conditionally based on the value of AUTO_RELOAD inside src/cgroup.c and src/conf.c and it also worked (I wonder if a conditional include is better than an absolute one here).

@troglobit troglobit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good finding!

@troglobit
troglobit merged commit b6f0d53 into finit-project:master Nov 12, 2026
4 checks passed
@firasuke

Copy link
Copy Markdown
Contributor Author

Glad I could help!

@firasuke
firasuke deleted the firasuke-patch-1 branch November 12, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants