aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/libmicrohttpd
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-25 10:50:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-25 10:50:04 -0800
commit8cc3f4e38ff241547a2e1f2a4160491dc8579e7c (patch)
tree792ddf2ec96f4e34b3fed013181b1fc8394c29a6 /third_party/libmicrohttpd
parent89061ed2e74d826fa5d018f117020eb7b1a1032d (diff)
Build and link microhttpd from gyp
Diffstat (limited to 'third_party/libmicrohttpd')
-rw-r--r--third_party/libmicrohttpd/build.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/third_party/libmicrohttpd/build.py b/third_party/libmicrohttpd/build.py
new file mode 100644
index 0000000000..cafcbeac88
--- /dev/null
+++ b/third_party/libmicrohttpd/build.py
@@ -0,0 +1,34 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# this script will configure and build microhttpd in a temp directory and then
+# copy the static library generated to a destination folder
+import argparse
+import os
+from subprocess import call
+import shutil
+import tempfile
+
+parser = argparse.ArgumentParser()
+parser.add_argument("--src", help="microhttpd src directory")
+parser.add_argument("--dst", help="output for build files")
+args = parser.parse_args()
+
+temp_dir = tempfile.mkdtemp()
+cwd = os.getcwd()
+os.chdir(temp_dir)
+call([cwd + "/" + args.src + "/configure",
+ "--disable-doc",
+ "--disable-examples",
+ "--enable-https=no",
+ "--disable-curl",
+ "--enable-spdy=no",
+ "--enable-shared=no"])
+call(["make", "--silent"])
+call(["cp",
+ temp_dir + "/src/microhttpd/.libs/libmicrohttpd.a",
+ cwd + "/" + args.dst])
+shutil.rmtree(temp_dir)
+