summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2024-09-22 16:05:27 +0300
committerNakidai <nakidai@disroot.org>2024-09-22 16:05:27 +0300
commit13feee2e6c44417f9f5a1a9560eccc463aaef449 (patch)
treea4f9734635725d76b0c13f551c9bfb95dca55e64 /configure
downloadcpetpet-13feee2e6c44417f9f5a1a9560eccc463aaef449.tar.gz
cpetpet-13feee2e6c44417f9f5a1a9560eccc463aaef449.zip
Add files
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure46
1 files changed, 46 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..b6b0736
--- /dev/null
+++ b/configure
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+usage()
+{
+    echo "Use environment variables to pass values:
+    CC         - compiler (default: cc)
+    CFLAGS     - flags for compiler
+    LDFLAGS    - flags for linker
+    DESTDIR    - path to make install (default: /usr/local)"
+    exit 1
+}
+
+while test $# -gt 0; do
+    case "$1" in
+        -h) usage
+            ;;
+        --help) usage
+            ;;
+    esac
+    shift
+done
+
+CC=${CC:-cc}
+CFLAGS=${CFLAGS:-}
+LDFLAGS=${LDFLAGS:-}
+DESTDIR=${DESTDIR:-/usr/local}
+
+echo "Configuration:
+    Compiler: $CC
+    CFLAGS: $CFLAGS
+    LDFLAGS: $LDFLAGS
+    DESTDIR: $DESTDIR"
+
+echo "
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define SHAREDIR \"$DESTDIR/share/cpetpet\"
+#define FRAMES 10
+
+#endif
+" > config.h
+
+echo "
+DESTDIR=$DESTDIR
+" > config.mk