blob: f09a360204fffd17c0450f9a7b05454b3df096f6 [file] [log] [blame]
joshualitt8cc3f4e2016-01-25 10:50:04 -08001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# this script will configure and build microhttpd in a temp directory and then
7# copy the static library generated to a destination folder
8import argparse
9import os
10from subprocess import call
11import shutil
12import tempfile
13
14parser = argparse.ArgumentParser()
15parser.add_argument("--src", help="microhttpd src directory")
bungeman51190df2016-03-09 07:42:54 -080016parser.add_argument("--out", help="build directory")
17parser.add_argument("--dst", help="output for final build products")
joshualitt8cc3f4e2016-01-25 10:50:04 -080018args = parser.parse_args()
19
bungeman51190df2016-03-09 07:42:54 -080020out_dir = args.out
joshualitt8cc3f4e2016-01-25 10:50:04 -080021cwd = os.getcwd()
bungeman51190df2016-03-09 07:42:54 -080022try:
23 os.makedirs(out_dir)
24except OSError as e:
25 pass
26
27os.chdir(out_dir)
28call([os.path.join(cwd, args.src, "configure"),
joshualitt8cc3f4e2016-01-25 10:50:04 -080029 "--disable-doc",
30 "--disable-examples",
31 "--enable-https=no",
32 "--disable-curl",
33 "--enable-spdy=no",
34 "--enable-shared=no"])
35call(["make", "--silent"])
36call(["cp",
bungeman51190df2016-03-09 07:42:54 -080037 "src/microhttpd/.libs/libmicrohttpd.a",
38 os.path.join(cwd, args.dst)])