From patchwork Sat Nov 29 22:42:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 41713 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A663420AEC for ; Sat, 29 Nov 2014 22:43:28 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf5289630wgh.9 for ; Sat, 29 Nov 2014 14:43:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=+6Zn4Uj3CfuQIE7MmB15Sbq1L5cYRrJ8FicMusMcto8=; b=ZZ2e+oELn+KY4G4Ep3ue2647gRhULKIjRzaelxy8ehVLPjDLLcFkb8CfstBntzh9ft K/SeuGlakyP+/JWTD7H2p4vMiJSA/8mVcOY72Wv1S34c4sUbfSki78Q8Tl6Z6ldeiQk6 OdvowB/j+9CzvLTvQWhNPst9ryNbf1kNvMLVIL8Nh8RBcgMeoAjLSH6ZZ2faYj/E95f3 BnDbd4Qgy3iYlEINYCf1Q+6hnst9CJhnCgeBFkZzqZyhkG7ETGJGC7kmc6IZCY+6qIt0 BoET02RK5JtqzlMxUWjfn/SuXbNFnesrlzGQK4Rv5G0uUMppNiMmxbFJlcFDPRBb8fo0 GN4g== X-Gm-Message-State: ALoCoQlxZyoTEw6ZbmcjSzwgToetmG8WG2/uIzR31GyfbcJJ91p26E6nVJNEdRZKBkr+WjNKCRHM X-Received: by 10.152.5.2 with SMTP id o2mr10188701lao.1.1417301007826; Sat, 29 Nov 2014 14:43:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.100 with SMTP id p4ls954345laj.46.gmail; Sat, 29 Nov 2014 14:43:27 -0800 (PST) X-Received: by 10.112.166.5 with SMTP id zc5mr43073339lbb.20.1417301007026; Sat, 29 Nov 2014 14:43:27 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id n3si13637088lah.1.2014.11.29.14.43.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 29 Nov 2014 14:43:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id s18so6956312lam.7 for ; Sat, 29 Nov 2014 14:43:26 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr48745707lbr.74.1417301006934; Sat, 29 Nov 2014 14:43:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp80211lbc; Sat, 29 Nov 2014 14:43:26 -0800 (PST) X-Received: by 10.224.137.2 with SMTP id u2mr20090510qat.102.1417301005649; Sat, 29 Nov 2014 14:43:25 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id o1si16044803qar.14.2014.11.29.14.43.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 29 Nov 2014 14:43:25 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xuqja-0006l6-Vr; Sat, 29 Nov 2014 22:43:23 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XuqjN-0006eO-I7 for lng-odp@lists.linaro.org; Sat, 29 Nov 2014 22:43:09 +0000 Received: by mail-lb0-f170.google.com with SMTP id w7so7081985lbi.1 for ; Sat, 29 Nov 2014 14:43:04 -0800 (PST) X-Received: by 10.112.132.2 with SMTP id oq2mr50052925lbb.11.1417300983807; Sat, 29 Nov 2014 14:43:03 -0800 (PST) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id ed8sm3575843lbb.41.2014.11.29.14.43.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Nov 2014 14:43:03 -0800 (PST) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Sat, 29 Nov 2014 23:42:57 +0100 Message-Id: <1417300979-6248-3-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1417300979-6248-1-git-send-email-anders.roxell@linaro.org> References: <1417300979-6248-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 2/4] configure: cleanup OpenSSL configuration X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Configure's AC_CHECK_LIBS (using internal compilation checks) doesn't use AM_*FLAGS, therefore we need to temporarily add these to *FLAGS when running the checks when we try to compile against packages that are not in default search paths (--with-*-path=). We need to reset these temporary settings to not clobber users manually set *FLAGS when the check is complete. Always check OpenSSL dependency Signed-off-by: Anders Roxell --- configure.ac | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 3752f3d..acd0060 100644 --- a/configure.ac +++ b/configure.ac @@ -126,21 +126,37 @@ if test -z "$DOXYGEN"; fi ########################################################################## -# Check for openssl availability +# Set optional OpenSSL path ########################################################################## - AC_ARG_WITH([openssl-path], AC_HELP_STRING([--with-openssl-path=DIR Path to openssl libs and headers], [(or in the default path if not specified).]), -[OPENSSL_PATH=$withval -AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include" -AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib -lcrypto" -],[ + [OPENSSL_PATH=$withval + AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include" + AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib" + ],[AC_MSG_RESULT([no])]) + +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_LDFLAGS=$LDFLAGS +OLD_CFLAGS=$CFLAGS +LDFLAGS="$AM_LDFLAGS $LDFLAGS" +CFLAGS="$AM_CFLAGS $CFLAGS" + +########################################################################## +# Check for OpenSSL availability +########################################################################## AC_CHECK_LIB([crypto], [EVP_EncryptInit], [], - [AC_MSG_FAILURE([can't find openssl crypto lib])]) + [AC_MSG_FAILURE([OpenSSL libraries required])]) AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [], - [AC_MSG_FAILURE([can't find openssl crypto headers])]) - ]) + [AC_MSG_ERROR([OpenSSL headers required])]) + +########################################################################## +# Restore old saved variables +########################################################################## +LDFLAGS=$OLD_LDFLAGS +CFLAGS=$OLD_CFLAGS ########################################################################## # Default warning setup