{"id":1098,"url":"https://patchwork.libcamera.org/api/1.1/patches/1098/?format=json","web_url":"https://patchwork.libcamera.org/patch/1098/","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":"<20190423160448.116834-1-giulio.benetti@micronovasrl.com>","date":"2019-04-23T16:04:48","name":"[libcamera-devel] meson: fix build when sys/auxv.h and getauxval() are not present","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d257afb707b4bccd387b3919655d974d6c51327c","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/1098/mbox/","series":[{"id":267,"url":"https://patchwork.libcamera.org/api/1.1/series/267/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=267","date":"2019-04-23T16:04:48","name":"[libcamera-devel] meson: fix build when sys/auxv.h and getauxval() are not present","version":1,"mbox":"https://patchwork.libcamera.org/series/267/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1098/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1098/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 9643660004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2019 18:04:50 +0200 (CEST)","from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\tby mail.micronovasrl.com (Postfix) with ESMTP id 4AC90B00C38\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2019 18:04:50 +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 xd61gAVfjUVI for <libcamera-devel@lists.libcamera.org>; \n\tTue, 23 Apr 2019 18:04: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 8838DB00AA1;\n\tTue, 23 Apr 2019 18:04:49 +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=x-mailer:message-id:date:date:subject:subject:to:from:from;\n\ts=dkim; t=1556035489; x=1556899490; bh=4WBbbeE/OiJ7BsdHib94EyxJ\n\tUF49GbEq1eeC0xagwqY=; b=fnuhKZFQF+OQbKwbJnhqTrqIk+KpTONdxWKl5kFA\n\tepfwxqPuCrZzXZjc0yL3QYDwsa2bY/KtmJlwXs1omjO/wtN8kYMBdSNFMmwFByO3\n\tPiGwClFsIXl5pPdbxbwkdDU4gR75Mn35FVlygPfEhtQVFq8cC2u2AK7OjpghJ8i6\n\txok=","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] autolearn=ham autolearn_force=no","From":"Giulio Benetti <giulio.benetti@micronovasrl.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 23 Apr 2019 18:04:48 +0200","Message-Id":"<20190423160448.116834-1-giulio.benetti@micronovasrl.com>","X-Mailer":"git-send-email 2.17.1","Subject":"[libcamera-devel] [PATCH] meson: fix build when sys/auxv.h and\n\tgetauxval() are not present","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":"Tue, 23 Apr 2019 16:04:50 -0000"},"content":"On some libc sys/auxv.h could not be present and getauxval() too.\nThis way build will fail.\n\nCheck in meson if they are present and add HAVE_SYS_AUXV_H and\nHAVE_GETAUXVAL defines to cxx arguments.\nAdd #ifdef HAVE_ statements around #include <sys/auxv.h> and getauxval()\nin utils.cpp.\n\nSigned-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>\n---\n meson.build             | 12 ++++++++++++\n src/libcamera/utils.cpp |  4 ++++\n 2 files changed, 16 insertions(+)","diff":"diff --git a/meson.build b/meson.build\nindex 6e68c3e..72a3652 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -20,6 +20,18 @@ common_arguments = [\n c_arguments = common_arguments\n cpp_arguments = common_arguments\n \n+cxx = meson.get_compiler('cpp')\n+\n+# check for header sys/auxv.h\n+if cxx.has_header('sys/auxv.h')\n+  cpp_arguments += ['-DHAVE_SYS_AUXV_H']\n+endif\n+\n+# check for function getauxval()\n+if cxx.has_function('getauxval')\n+  cpp_arguments += ['-DHAVE_GETAUXVAL']\n+endif\n+\n add_project_arguments(c_arguments, language: 'c')\n add_project_arguments(cpp_arguments, language: 'cpp')\n \ndiff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\nindex 66123b1..ae574ab 100644\n--- a/src/libcamera/utils.cpp\n+++ b/src/libcamera/utils.cpp\n@@ -8,7 +8,9 @@\n #include \"utils.h\"\n \n #include <string.h>\n+#ifdef HAVE_SYS_AUXV_H\n #include <sys/auxv.h>\n+#endif\n \n /**\n  * \\file utils.h\n@@ -57,8 +59,10 @@ const char *basename(const char *path)\n  */\n char *secure_getenv(const char *name)\n {\n+#ifdef HAVE_GETAUXVAL\n \tif (getauxval(AT_SECURE))\n \t\treturn NULL;\n+#endif\n \n \treturn getenv(name);\n }\n","prefixes":["libcamera-devel"]}