diff options
| author | Michael Forney <mforney@mforney.org> | 2020-05-25 21:01:32 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-05-25 21:11:21 -0700 |
| commit | f0fb0e517737860133352382ec082e4690be9b3a (patch) | |
| tree | 8a3cfc3b9cc4dc468b2531b8d99d50749b3f053e /src | |
| parent | cdf748ea39cb023b364240569a57ad5bc3e00171 (diff) | |
Start to support configurable prefix
Diffstat (limited to 'src')
| -rw-r--r-- | src/devd.c | 7 | ||||
| -rw-r--r-- | src/gen.lua | 6 |
2 files changed, 10 insertions, 3 deletions
@@ -24,8 +24,11 @@ triggering "add" uevents for each one. #include <linux/netlink.h> -#define HOTPLUG "/etc/hotplug" -#define TRIGGER "/libexec/devd-trigger" +#ifndef PREFIX +#define PREFIX +#endif +#define HOTPLUG PREFIX "/etc/hotplug" +#define TRIGGER PREFIX "/libexec/devd-trigger" #define LEN(a) (sizeof(a) / sizeof((a)[0])) diff --git a/src/gen.lua b/src/gen.lua index 1ca09640..98e9a6e0 100644 --- a/src/gen.lua +++ b/src/gen.lua @@ -3,7 +3,11 @@ cflags{ '-std=c11', '-Wall', '-Wextra', '-Wpedantic', '-Wno-unused-parameter', } -cc('devd.c', 'pkg/linux-headers/headers', {cflags='$cflags -I $builddir/pkg/linux-headers/include'}) +cc('devd.c', 'pkg/linux-headers/headers', {cflags={ + '$cflags', + '-I $builddir/pkg/linux-headers/include', + string.format([[-D 'PREFIX="%s"']], config.prefix), +}}) file('libexec/applyperms', '755', exe('applyperms', {'applyperms.c'})) file('libexec/devd-trigger', '755', exe('devd-trigger', {'devd-trigger.c'})) |
