aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-01-20 20:20:10 -0800
committerSteven Fackler <[email protected]>2014-01-20 20:20:10 -0800
commite2554ea6af256c6ed3d7fd5a541ca2caac212181 (patch)
tree14496f8f210ce338390e7b17429433bc71d9e574
parentSwitch doc link to rust-ci (diff)
downloadrust-openssl-e2554ea6af256c6ed3d7fd5a541ca2caac212181.tar.xz
rust-openssl-e2554ea6af256c6ed3d7fd5a541ca2caac212181.zip
Add a configure script and an install target
-rw-r--r--.gitignore2
-rw-r--r--Makefile.in (renamed from Makefile)4
-rwxr-xr-xconfigure18
3 files changed, 23 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 0c3fa56c..ff7df192 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-/.rust/
/doc/
/build/
+/Makefile
diff --git a/Makefile b/Makefile.in
index 7a1d064b..fc694754 100644
--- a/Makefile
+++ b/Makefile.in
@@ -1,6 +1,7 @@
RUSTC = rustc
BUILDDIR = build
RUSTFLAGS = -O -Z debug-info
+INSTALL_DIR = %PREFIX%
OPENSSL_LIB = lib.rs
OPENSSL = $(BUILDDIR)/$(shell $(RUSTC) --crate-file-name $(OPENSSL_LIB))
@@ -30,6 +31,9 @@ clean:
doc: $(OPENSSL)
rustdoc $(OPENSSL_LIB)
+install: $(OPENSSL)
+ install $(OPENSSL) $(INSTALL_DIR)
+
print-target:
@echo $(OPENSSL)
diff --git a/configure b/configure
new file mode 100755
index 00000000..55cf6a0b
--- /dev/null
+++ b/configure
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+TEMP=`getopt -o "" --long prefix: -n "$0" -- "$@"`
+
+if [ $? != 0 ]; then exit 1; fi
+
+eval set -- "$TEMP"
+
+PREFIX=/usr/lib
+
+while true ; do
+ case "$1" in
+ --prefix) PREFIX=$2; shift 2;;
+ --) shift; break;;
+ esac
+done
+
+sed -e "s|%PREFIX%|$PREFIX|" < Makefile.in > Makefile