From patchwork Fri Mar 22 10:43:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 784 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 860F5610D5 for ; Fri, 22 Mar 2019 11:43:56 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0676B54A; Fri, 22 Mar 2019 11:43:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1553251435; bh=syqXwei+lrff0N6Mxm3TGoCtgaImKiLq839Z3BFJtNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IVD2rk1LGC6PA5F/X48fL7p0nVyMrBum1ScCGGqvnHNY+rhBvAXjC/XXLlAV/vXoY +ylyPG9wNuG+P1GAyf50v6QNQO4M6jSdO5p6HAUkNpEBO3COf6TEluzjGDOawJa4PB ICCHYbjFmMsOcb7zj7kHbUgP31+we7kTFPP+MKbs= From: Kieran Bingham To: LibCamera Devel Date: Fri, 22 Mar 2019 10:43:47 +0000 Message-Id: <20190322104350.31091-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> References: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/4] meson: Re-order the optional components X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 10:43:56 -0000 Re-order the optional components to make them alphabetical, and fix up the indentation to use two spaces as required by meson. A comment is added to highlight that these optional components are enabled by default. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- meson.build | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 43d4a57602bb..e001cd267c78 100644 --- a/meson.build +++ b/meson.build @@ -29,12 +29,15 @@ subdir('include') subdir('src') subdir('utils') -if get_option('tests') - subdir('test') -endif +# The documentation and test components are optional and can be desabled +# through configuration values. They are enabled by default. if get_option('documentation') - subdir('Documentation') + subdir('Documentation') +endif + +if get_option('tests') + subdir('test') endif pkg_mod = import('pkgconfig') From patchwork Fri Mar 22 10:43:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 785 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 54F65610D5 for ; Fri, 22 Mar 2019 11:43:59 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4E74054E; Fri, 22 Mar 2019 11:43:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1553251435; bh=7H2hwWmelduoz6VprnTIbf1eY7/ZtdZz+Mgi6SWNnnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eozT3ZDbg2GYVC135vrv3lDWp4yQcWHLpPyBy5TXcjJ3SE3oR6f1aFZd+2Wv5M83T CllMmxk3OMvPj41tSbn/eqrJnSMvpKhTDI2pvKtcoAzIPz1xLNk5vryP+VeFSonurV iL9LfY50dK2cfp+3cOs5nNo200fiDs1FoaroI210= From: Kieran Bingham To: LibCamera Devel Date: Fri, 22 Mar 2019 10:43:48 +0000 Message-Id: <20190322104350.31091-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> References: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/4] meson: options: Document the options X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 10:43:59 -0000 Re-order the project options and add documentation which will be presented by 'meson configure'. This produces the following extra information: Project options: Option Current Value Possible Values Description ------ ------------- --------------- ----------- documentation true [true, false] Generate the project documentation tests true [true, false] Compile and include the tests Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- meson_options.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index c5df661a2286..97efc85b4412 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,7 @@ -option('tests', type : 'boolean') -option('documentation', type : 'boolean') +option('documentation', + type : 'boolean', + description : 'Generate the project documentation') + +option('tests', + type : 'boolean', + description: 'Compile and include the tests') From patchwork Fri Mar 22 10:43:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 786 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CF6C6110A for ; Fri, 22 Mar 2019 11:43:59 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 96A2810D2; Fri, 22 Mar 2019 11:43:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1553251435; bh=RJ99mCOaa6LBykVeCADsMPf0dkS0adtrYvIBNu4z06o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnAk8sWeRj96L4RJXBOYNCOJaTb/ZIeWIjft7jvv5JZrDHLs+mWTBuU1GAIBj8Phb 7nQv1SVyjPtpJbkIB7hy1iHa8zk0sDuJ97YYLiM9QEBHfY1eU2B0ely6kCDv6DY549 wQpdb1c8siKmIpWx/ZGWBfoOk+bnrU2TZ8gKOJGs= From: Kieran Bingham To: LibCamera Devel Date: Fri, 22 Mar 2019 10:43:49 +0000 Message-Id: <20190322104350.31091-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> References: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] libcamera: log: Use internal basename implementation. X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 10:43:59 -0000 Differing implementations of basename() exist, some of which may modify the content of the string passed as an argument. The implementation of basename() is trivial, thus to support different toolchains, provide our own version which accepts and returns a const char*. Signed-off-by: Kieran Bingham --- src/libcamera/log.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp index 26ebf410a7a9..7d930cd6b99e 100644 --- a/src/libcamera/log.cpp +++ b/src/libcamera/log.cpp @@ -358,6 +358,12 @@ static const char *log_severity_name(LogSeverity severity) return "UNKWN"; } +static const char *basename(const char *path) +{ + const char *base = strrchr(path, '/'); + return base ? ++base : path; +} + /** * \class LogMessage * \brief Internal log message representation. From patchwork Fri Mar 22 10:43:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 787 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 84469611A2 for ; Fri, 22 Mar 2019 11:44:00 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DEAF111BE; Fri, 22 Mar 2019 11:43:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1553251436; bh=ovX6/D4vHLNwrP4WLTjXURiz1kcNHxYHUGxPg+rPDyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIMm8KF2paPezzCozOr3qyEu9WcUcsFfu30dNWWtN5RxzV3gE/hK5ItfyDneKs4Ui 4pOtwxS1IblYmEe9JBUbd0F6zm3ZTZ3KEAlHhidPEdixr6E6je8ZPYSjbB5x1qQnZj Vmt9eKGiPq3ThRscf5IHT1xrV50ovYBCaSs6jJ98= From: Kieran Bingham To: LibCamera Devel Date: Fri, 22 Mar 2019 10:43:50 +0000 Message-Id: <20190322104350.31091-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> References: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/4] libcamera: log: Fallback to getenv on non-gnu systems X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 10:44:01 -0000 The secure_getenv() call is not provided by all toolchains. Support compilation without this feature by falling back to the default getenv() functionality. Signed-off-by: Kieran Bingham --- src/libcamera/log.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp index 7d930cd6b99e..a44bd941e615 100644 --- a/src/libcamera/log.cpp +++ b/src/libcamera/log.cpp @@ -49,6 +49,15 @@ namespace libcamera { + +/* + * secure_getenv is a GNU-specific extension to the C-Library. + * fall back to the default getenv when it is not available. + */ +#ifndef HAVE_SECURE_GETENV +#define secure_getenv getenv +#endif + /** * \brief Message logger *