]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build-sys: add basic support for ./configure && make && make install
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 Jul 2017 00:57:43 +0000 (20:57 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Jul 2017 14:05:06 +0000 (10:05 -0400)
This adds the basic make support required by
https://github.com/cgwalters/build-api. CFLAGS, CXXFLAGS, DESTDIR variables are
supported:
   ./configure CFLAGS=... CXXFLAGS=... && make && make install DESTDIR=

Makefile [new file with mode: 0644]
configure [new file with mode: 0755]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..0922212
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+all:
+       ninja -C build
+
+install:
+       DESTDIR=$(DESTDIR) ninja -C build
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..a9db8a1
--- /dev/null
+++ b/configure
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+
+cflags=CFLAGS="$CFLAGS"
+cxxflags=CXXFLAGS="$CXXFLAGS"
+declare -a args
+j=0
+for i in "$@"; do
+    case "$i" in
+        CFLAGS=*)
+            cflags="$i";;
+        CXXFLAGS=*)
+            cxxflags="$i";;
+       *)
+           args[$j]="$i"
+           j=$((j+1))
+    esac
+done
+
+export "$cflags" "$cxxflags"
+set -x
+exec meson build "${args[@]}"