diff options
| author | Michael Forney <mforney@mforney.org> | 2017-09-17 00:03:34 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-09-25 19:23:06 -0700 |
| commit | ba94a8513d9a0aadb3f2c834c74b64aa644c61e8 (patch) | |
| tree | 48ac6c85baa7b9d960b9e1e726a906e61ca60967 /pkg/libnl | |
| parent | cb362b531d79708a259bbf070dee5104fd63df08 (diff) | |
Rewrite ninja generation scripts in Lua
Diffstat (limited to 'pkg/libnl')
| -rw-r--r-- | pkg/libnl/gen.lua | 61 | ||||
| -rw-r--r-- | pkg/libnl/gen.rc | 55 |
2 files changed, 61 insertions, 55 deletions
diff --git a/pkg/libnl/gen.lua b/pkg/libnl/gen.lua new file mode 100644 index 00000000..2fdd5363 --- /dev/null +++ b/pkg/libnl/gen.lua @@ -0,0 +1,61 @@ +cflags{ + '-D _GNU_SOURCE', + [[-D 'SYSCONFDIR="/etc/libnl"']], + '-I include', + '-I $dir', + '-I $outdir/include', + '-I $srcdir/include', + '-I $srcdir/include/linux-private', +} + +build('sed', '$outdir/include/netlink/version.h', '$srcdir/include/netlink/version.h.in', { + expr={ + '-e s,@PACKAGE_STRING@,\'libnl 3.3.0\',', + '-e s,@PACKAGE_VERSION@,3.3.0,', + '-e s,@MAJ_VERSION@,3,', + '-e s,@MIN_VERSION@,3,', + '-e s,@MIC_VERSION@,0,', + '-e s,@LT_CURRENT@,225,', + '-e s,@LT_REVISION@,0,', + '-e s,@LT_AGE@,25,', + }, +}) + +pkg.hdrs = { + copy('$outdir/include/netlink', '$srcdir/include/netlink', { + 'addr.h', + 'attr.h', + 'cache.h', + 'cache-api.h', + 'data.h', + 'errno.h', + 'handlers.h', + 'hash.h', + 'hashtable.h', + 'list.h', + 'msg.h', + 'netlink.h', + 'netlink-compat.h', + 'netlink-kernel.h', + 'object.h', + 'object-api.h', + 'socket.h', + 'types.h', + 'utils.h', + 'genl/ctrl.h', + 'genl/family.h', + 'genl/genl.h', + 'genl/mngt.h', + }), + '$outdir/include/netlink/version.h', +} + +lib('libnl-3.a', [[lib/( + addr.c attr.c cache.c cache_mngr.c cache_mngt.c data.c + error.c handlers.c msg.c nl.c object.c socket.c utils.c + version.c hash.c hashtable.c +)]], {'$dir/headers'}) + +lib('libnl-genl-3.a', 'lib/genl/(ctrl.c family.c genl.c mngt.c)', {'$dir/headers'}) + +fetch 'git' diff --git a/pkg/libnl/gen.rc b/pkg/libnl/gen.rc deleted file mode 100644 index 90abf3ea..00000000 --- a/pkg/libnl/gen.rc +++ /dev/null @@ -1,55 +0,0 @@ -cflags\ - -D _GNU_SOURCE\ - -D 'SYSCONFDIR=''"/etc/libnl"''' \ - -I include\ - -I '$dir' \ - -I '$outdir'/include\ - -I '$srcdir'/include\ - -I '$srcdir'/include/linux-private - -hdrs=include/netlink/^(\ - addr.h\ - attr.h\ - cache.h\ - cache-api.h\ - data.h\ - errno.h\ - handlers.h\ - hash.h\ - hashtable.h\ - list.h\ - msg.h\ - netlink.h\ - netlink-compat.h\ - netlink-kernel.h\ - object.h\ - object-api.h\ - socket.h\ - types.h\ - utils.h\ - genl/^(ctrl.h family.h genl.h mngt.h)\ -) -for(hdr in $hdrs) build '$outdir'/$hdr copy '$srcdir'/$hdr -build '$outdir'/include/netlink/version.h sed '$srcdir'/include/netlink/version.h.in ; exprs=(\ - -e s,@PACKAGE_STRING@,'''libnl 3.3.0''',\ - -e s,@PACKAGE_VERSION@,3.3.0,\ - -e s,@MAJ_VERSION@,3,\ - -e s,@MIN_VERSION@,3,\ - -e s,@MIC_VERSION@,0,\ - -e s,@LT_CURRENT@,225,\ - -e s,@LT_REVISION@,0,\ - -e s,@LT_AGE@,25,\ -) with expr $"exprs -hdrs=($hdrs include/netlink/version.h) -phony headers '$outdir'/$hdrs - -lib libnl-3.a -d '$dir'/headers lib/^(\ - addr.c attr.c cache.c cache_mngr.c cache_mngt.c data.c\ - error.c handlers.c msg.c nl.c object.c socket.c utils.c\ - version.c hash.c hashtable.c\ -) - -lib libnl-genl-3.a -d '$dir'/headers\ - lib/genl/^(ctrl.c family.c genl.c mngt.c) - -fetch git |
