2016-01-25 18:50:04 +00:00
|
|
|
# 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")
|
2016-03-09 15:42:54 +00:00
|
|
|
parser.add_argument("--out", help="build directory")
|
|
|
|
parser.add_argument("--dst", help="output for final build products")
|
2016-01-25 18:50:04 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2016-03-09 15:42:54 +00:00
|
|
|
out_dir = args.out
|
2016-01-25 18:50:04 +00:00
|
|
|
cwd = os.getcwd()
|
2016-03-09 15:42:54 +00:00
|
|
|
try:
|
|
|
|
os.makedirs(out_dir)
|
|
|
|
except OSError as e:
|
|
|
|
pass
|
|
|
|
|
|
|
|
os.chdir(out_dir)
|
|
|
|
call([os.path.join(cwd, args.src, "configure"),
|
2016-01-25 18:50:04 +00:00
|
|
|
"--disable-doc",
|
|
|
|
"--disable-examples",
|
|
|
|
"--enable-https=no",
|
|
|
|
"--disable-curl",
|
|
|
|
"--enable-spdy=no",
|
|
|
|
"--enable-shared=no"])
|
|
|
|
call(["make", "--silent"])
|
|
|
|
call(["cp",
|
2016-03-09 15:42:54 +00:00
|
|
|
"src/microhttpd/.libs/libmicrohttpd.a",
|
|
|
|
os.path.join(cwd, args.dst)])
|