{"id":1100,"url":"https://patchwork.libcamera.org/api/1.1/patches/1100/?format=json","web_url":"https://patchwork.libcamera.org/patch/1100/","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":"<20190424110044.12608-2-giulio.benetti@micronovasrl.com>","date":"2019-04-24T11:00:43","name":"[libcamera-devel,1/2] meson: check if secure_getenv() is present","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4717a752b895d418a774b2e4bec9a7da3dca95cc","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/1100/mbox/","series":[{"id":268,"url":"https://patchwork.libcamera.org/api/1.1/series/268/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=268","date":"2019-04-24T11:00:42","name":"improve secure_getenv()","version":1,"mbox":"https://patchwork.libcamera.org/series/268/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1100/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1100/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 3448860DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Apr 2019 13:00:50 +0200 (CEST)","from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\tby mail.micronovasrl.com (Postfix) with ESMTP id E8500B0067F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Apr 2019 13:00:49 +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 vDdjjH0f-eDW for <libcamera-devel@lists.libcamera.org>; \n\tWed, 24 Apr 2019 13:00:49 +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 11BF9B00E68;\n\tWed, 24 Apr 2019 13:00:48 +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=1556103649; x=1556967650; bh=yQ\n\tGfnMYf5LN5nTypVnVmtCXSzoZBFx6U1IcbdqBAHGk=; b=jIqi8lRTv6E+YY/vMr\n\tkNBNyzCMAMPqlo4AuwDB+TkTNRaIK2RSZ0xMfBgGj6Ns8rhyq/AkespYJxVAkYZ1\n\tAjQQGTGAQScVCnwMIoUlI1TNNMeWVwginQtmGtPfTODu9j+zWh1orftBYIpd1pDS\n\tKiJ8GdOE/laB4i9zrjj0EH64I=","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":"Wed, 24 Apr 2019 13:00:43 +0200","Message-Id":"<20190424110044.12608-2-giulio.benetti@micronovasrl.com>","X-Mailer":"git-send-email 2.17.1","In-Reply-To":"<20190424110044.12608-1-giulio.benetti@micronovasrl.com>","References":"<364aa322-85ca-2c17-984e-1e807bd832ca@micronovasrl.com>\n\t<20190424110044.12608-1-giulio.benetti@micronovasrl.com>","Subject":"[libcamera-devel] [PATCH 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":"Wed, 24 Apr 2019 11:00:50 -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---\n meson.build | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/meson.build b/meson.build\nindex 6e68c3e..ee9f5bf 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -25,6 +25,18 @@ add_project_arguments(cpp_arguments, language: 'cpp')\n \n libcamera_includes = include_directories('include')\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+add_project_arguments('-include', 'config.h', language: 'c')\n+add_project_arguments('-include', 'config.h', language: 'cpp')\n+\n subdir('include')\n subdir('src')\n subdir('utils')\n","prefixes":["libcamera-devel","1/2"]}