From patchwork Thu Aug 2 01:03:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 952518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41gsQ62PGKz9s3q for ; Thu, 2 Aug 2018 11:04:14 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="UigypEDA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nC7qcOEh"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41gsQ60qNfzF1mc for ; Thu, 2 Aug 2018 11:04:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="UigypEDA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nC7qcOEh"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="UigypEDA"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nC7qcOEh"; dkim-atps=neutral Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41gsPh2PS2zF1Qn for ; Thu, 2 Aug 2018 11:03:52 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B2BEC21DEC; Wed, 1 Aug 2018 21:03:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 01 Aug 2018 21:03:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=mx5bMsaysZVKKfysOnNFx483Sn9aIPOhCkccRzFdrEw=; b=UigypEDA yMa3g7SlhVWw3cQBCWmzRN84+0ZGV2GhOjIizwEdEfMh10DsOjx5gc5H4mvacoKl gAeJSEW9uKOSorbabcMMmMhWDToN2yUFIkiX/EJO6sFyysPrmgAHOwlLCl0wDwWK Pm63CJXxvBR3qRMEflZ64MIj0M4kZeArDX6L/zeUg/TcYOeIRHyN+D8JlI03+LUt riQKZj9agIX5x6Vzzsp4wsht1frbU9zPDTSYvNY1q8pFnUZOHiKplpuyljYdPjL2 ysdXko7u8GOgFq7z9JKNW6DESpp51D1fWQgnF0LATED7wq2xvTH2p1CTiqnnyKG/ kyTN3eDZmMKGHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=mx5bMsaysZVKKfysOnNFx483Sn9aIPOhCkccRzFdrEw=; b=nC7qcOEh dNL/vqmePRMV1aYr3z9YsJK9sn+mkpSWr2Jka7at014zVyECfOVyKMHaev2U+PBG A7OIOl9qeW43ZcZqvSMBxtAcnBaUVtDOF/+Dikavi3e1akUIhSufxymdKLFfjdQq EvO5azkxS5h+Eg68+T4Utsj20lXIdS0DLTZNjlm9h7j/swrrQJZP6TXvbGgPnldj Ia8KtrXxWU0ufycJ3XaH/hweUuMJhoRy5gwj16gbu+pE3RCvr3BuH6LttuqBEWzQ FWzEUa5R02mZvlgubV4m9c/swGWrh4dE5YpgoTJYeB73K2d7pwuDBPuQLATxhPIn KiEzQhmBSo+2Mw== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 6568710279; Wed, 1 Aug 2018 21:03:48 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH v2 3/3] docker: Pass extra options to configure Date: Thu, 2 Aug 2018 11:03:34 +1000 Message-Id: <20180802010334.28764-3-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180802010334.28764-1-sam@mendozajonas.com> References: <20180802010334.28764-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Pass extra configure options and CFLAGS/LDFLAGS to docker to enable building multiple configurations. Signed-off-by: Samuel Mendoza-Jonas --- docker/build-pb | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/docker/build-pb b/docker/build-pb index ad08ef9..6ed2af6 100755 --- a/docker/build-pb +++ b/docker/build-pb @@ -12,21 +12,24 @@ usage () { echo "${name} - Builds the petitboot programs using a pb-builder container." >&2 echo "Usage: ${name} [flags]" >&2 echo "Option flags:" >&2 - echo " -c --check - Run 'make check'." >&2 - echo " -d --dry-run - Do not run docker commands." >&2 - echo " -h --help - Show this help and exit." >&2 - echo " -i --interactive - Run an interactive pb-builder container." >&2 - echo " -t --tag - Print Docker tag to stdout and exit." >&2 - echo " -v --verbose - Verbose execution." >&2 + echo " -c --check - Run 'make check'." >&2 + echo " -d --dry-run - Do not run docker commands." >&2 + echo " -h --help - Show this help and exit." >&2 + echo " -i --interactive - Run an interactive pb-builder container." >&2 + echo " -o --configure-opts - Extra arguments for configure." >&2 + echo " -t --tag - Print Docker tag to stdout and exit." >&2 + echo " -v --verbose - Verbose execution." >&2 echo "Environment:" >&2 - echo " DOCKER_TAG - Default: '${DOCKER_TAG}'" >&2 + echo " DOCKER_TAG - Default: '${DOCKER_TAG}'" >&2 + echo " CFLAGS - Default: '${CFLAGS}'" >&2 + echo " LDFLAGS - Default: '${LDFLAGS}'" >&2 echo "Examples:" >&2 echo " ${name} -vc" echo " ${name} -v" } -short_opts="cdhitv" -long_opts="check,dry-run,help,interactive,tag,verbose" +short_opts="cdhio:tv" +long_opts="check,dry-run,help,interactive,configure-opts:,tag,verbose" opts=$(getopt --options ${short_opts} --long ${long_opts} -n "${name}" -- "$@") @@ -55,6 +58,11 @@ while true ; do interactive=1 shift ;; + -o | --configure-opts) + shift + configure_opts=${1} + shift + ;; -t | --tag) tag=1 shift @@ -112,8 +120,10 @@ else docker_extra="true" fi +flags="CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS}" + cd "${TOP_DIR}" docker_args="${docker_base_args} ${docker_user_args}" run_cmd "docker run ${docker_args} ${DOCKER_TAG} /bin/bash \ -e ${bash_debug} \ - -c './bootstrap && ./configure --with-ncurses && make && ${docker_extra}'" + -c './bootstrap && ${flags} ./configure ${configure_opts[@]} && make && ${docker_extra}'"