{"id":1103,"url":"https://patchwork.libcamera.org/api/1.1/patches/1103/?format=json","web_url":"https://patchwork.libcamera.org/patch/1103/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190426084220.71500-2-giulio.benetti@micronovasrl.com>","date":"2019-04-26T08:42:19","name":"[libcamera-devel,v2,1/2] meson: check if secure_getenv() is present","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"ce6020ca4e9856db6bf37a7bd5f6173700b5c406","submitter":{"id":16,"url":"https://patchwork.libcamera.org/api/1.1/people/16/?format=json","name":"Giulio Benetti","email":"giulio.benetti@micronovasrl.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1103/mbox/","series":[{"id":269,"url":"https://patchwork.libcamera.org/api/1.1/series/269/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=269","date":"2019-04-26T08:42:18","name":"improve secure_getenv()","version":2,"mbox":"https://patchwork.libcamera.org/series/269/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1103/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1103/checks/","tags":{},"headers":{"Return-Path":"<giulio.benetti@micronovasrl.com>","Received":["from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5200F60E9C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2019 10:42:23 +0200 (CEST)","from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\tby mail.micronovasrl.com (Postfix) with ESMTP id 1B61BB0156E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2019 10:42:23 +0200 (CEST)","from mail.micronovasrl.com ([127.0.0.1])\n\tby mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\t(amavisd-new, port 10026)\n\twith ESMTP id zfnrsyKLuJ0f for <libcamera-devel@lists.libcamera.org>; \n\tFri, 26 Apr 2019 10:42:22 +0200 (CEST)","from ubuntu.localdomain (88-149-228-83.v4.ngi.it [88.149.228.83])\n\tby mail.micronovasrl.com (Postfix) with ESMTPSA id 85D4EB01544;\n\tFri, 26 Apr 2019 10:42:21 +0200 (CEST)"],"Authentication-Results":"mail.micronovasrl.com (amavisd-new); dkim=pass\n\treason=\"pass (just generated, assumed good)\" header.d=micronovasrl.com","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com;\n\th=references:in-reply-to:x-mailer:message-id:date:date:subject\n\t:subject:to:from:from; s=dkim; t=1556268142; x=1557132143; bh=BN\n\tZ+RGuL8UmR8tGaVB57NvfgFu83L3c3JMzEZksaHSc=; b=WtoEpLcm7gLOSjfXlN\n\tjo6keVrGhb5JlRK4TCpPhiaPKqApVs8h7r2amuT0nzZdoOIambYRDTfju8Bd/ib7\n\t7qMt3imfbwS6tDGnlX8e/CIOfq8MrqFiZ4hzXrCAPCgCyamh5rVFDY0uCbGakX9D\n\tIPKUsBmcqDTw3xarhLwhfbcmQ=","X-Virus-Scanned":"Debian amavisd-new at mail.micronovasrl.com","X-Spam-Flag":"NO","X-Spam-Score":"-2.9","X-Spam-Level":"","X-Spam-Status":"No, score=-2.9 tagged_above=-10 required=4.5\n\ttests=[ALL_TRUSTED=-1, BAYES_00=-1.9]\n\tautolearn=unavailable autolearn_force=no","From":"Giulio Benetti <giulio.benetti@micronovasrl.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 26 Apr 2019 10:42:19 +0200","Message-Id":"<20190426084220.71500-2-giulio.benetti@micronovasrl.com>","X-Mailer":"git-send-email 2.17.1","In-Reply-To":"<20190426084220.71500-1-giulio.benetti@micronovasrl.com>","References":"<20190424110044.12608-1-giulio.benetti@micronovasrl.com>\n\t<20190426084220.71500-1-giulio.benetti@micronovasrl.com>","Subject":"[libcamera-devel] [PATCH v2 1/2] meson: check if secure_getenv() is\n\tpresent","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 26 Apr 2019 08:42:23 -0000"},"content":"Not all libc make secure_getenv() available, this could lead to build\nfailure on certain build systems.\n\nCheck if secure_getenv() and emit #define HAVE_SECURE_GETENV to config.h\nInclude config.h to every c/c++ file during building by adding `-include\nconfig.h` to project arguments for both c and c++.\n\nSigned-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>\n---\nChanges:\nV1->V2: use common_arguments to -include config.h and move secure_getenv()\n        check before common_arguments list.\n\n meson.build | 11 +++++++++++\n 1 file changed, 11 insertions(+)","diff":"diff --git a/meson.build b/meson.build\nindex 6e68c3e..9099909 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -13,8 +13,19 @@ project('libcamera', 'c', 'cpp',\n #       generated from this too.\n api_version = '0.1'\n \n+cc = meson.get_compiler('c')\n+config_h = configuration_data()\n+\n+if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix: '#define _GNU_SOURCE')\n+    config_h.set('HAVE_SECURE_GETENV', 1)\n+else\n+    message('C library does not support secure_getenv, using getenv instead')\n+endif\n+configure_file(output: 'config.h', configuration: config_h)\n+\n common_arguments = [\n     '-Wno-unused-parameter',\n+    '-include', 'config.h',\n ]\n \n c_arguments = common_arguments\n","prefixes":["libcamera-devel","v2","1/2"]}