skia2/third_party/libmicrohttpd/build.py
bungeman 51190df040 Add SkDrawPosTextHCommand JSON, fix skiaserve build.
Adds SkDrawPosTextHCommand ::fromJSON and ::toJSON.

Both SkDrawPosTextCommand and SkDrawPosTextHCommand's
::toJSON write the correct number of positions, preventing reading
uninitialized memory.

The microhttpd build is now done in the build tree as opposed to in a
temporary directory.

The microhttpd build script uses os.path.join so that absolute paths
do not confuse the build. This allows compatibility with the cmake
gyp generator as CMake likes to pass absolute paths.

The microhttpd gyp target is now marked as 'none' since it is not
a 'static_library' target (which directs gyp to compile sources into
a static library). The dependencies to the action are updated to the
minimum required for sane re-building.

The everything gyp target now depends on the skiaserve gyp target.
This means that when using skia_build_server=1, building 'most' will
build skiaserve, but when skia_build_server is not defined the
skiaserve target will still be available if specified manually.

The old json.gyp is removed as it currently does not build anything.
All of the files currently referenced by it as sources no longer exist.

Review URL: https://codereview.chromium.org/1775203002
2016-03-09 07:42:54 -08:00

39 lines
1.0 KiB
Python

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