[{"id":25913,"web_url":"https://patchwork.libcamera.org/comment/25913/","msgid":"<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>","date":"2022-11-28T05:29:56","subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Christian,\n\nThank you for the patch.\n\nOn Mon, Nov 28, 2022 at 12:01:10AM +0100, Christian Rauch via libcamera-devel wrote:\n> Defining libraries via shared_library() prevents compiling libcamera as\n> static library. The meson project recommends using library() instead of\n> shared_library(), static_library() or both_libraries():\n> https://mesonbuild.com/Reference-manual_functions.html#library\n\nI'm curious, do you personally have use cases for libcamera as a static\nlibrary ?\n\n> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n> ---\n>  src/android/meson.build        | 16 ++++++++--------\n>  src/gstreamer/meson.build      |  2 +-\n>  src/libcamera/base/meson.build | 18 +++++++++---------\n>  src/libcamera/meson.build      | 18 +++++++++---------\n>  src/v4l2/meson.build           | 12 ++++++------\n>  5 files changed, 33 insertions(+), 33 deletions(-)\n> \n> diff --git a/src/android/meson.build b/src/android/meson.build\n> index 1bba54de..51b365e3 100644\n> --- a/src/android/meson.build\n> +++ b/src/android/meson.build\n> @@ -67,11 +67,11 @@ android_camera_metadata = static_library('camera_metadata',\n>                                           c_args : '-Wno-shadow',\n>                                           include_directories : android_includes)\n> \n> -libcamera_hal = shared_library('libcamera-hal',\n> -                               android_hal_sources,\n> -                               name_prefix : '',\n> -                               link_with : android_camera_metadata,\n> -                               install : true,\n> -                               cpp_args : android_cpp_args,\n> -                               include_directories : android_includes,\n> -                               dependencies : android_deps)\n> +libcamera_hal = library('libcamera-hal',\n> +                        android_hal_sources,\n> +                        name_prefix : '',\n> +                        link_with : android_camera_metadata,\n> +                        install : true,\n> +                        cpp_args : android_cpp_args,\n> +                        include_directories : android_includes,\n> +                        dependencies : android_deps)\n\nI'm curious, how do you envision the HAL to be loaded by the Android\ncamera service if it's a static library ? :-)\n\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index eda246d7..b364837d 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -39,7 +39,7 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')\n>      libcamera_gst_cpp_args += ['-Wno-unused-function']\n>  endif\n> \n> -libcamera_gst = shared_library('gstlibcamera',\n> +libcamera_gst = library('gstlibcamera',\n\nSame here, and for the V4L2 compat library.\n\n>      libcamera_gst_sources,\n>      cpp_args : libcamera_gst_cpp_args,\n>      dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index 7a7fd7e4..91dc1e71 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -48,15 +48,15 @@ libcamera_base_deps = [\n>  # the use of headers which must not be exposed to the libcamera public api.\n>  libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> \n> -libcamera_base_lib = shared_library('libcamera-base',\n> -                                    [libcamera_base_sources, libcamera_base_headers],\n> -                                    version : libcamera_version,\n> -                                    soversion : libcamera_soversion,\n> -                                    name_prefix : '',\n> -                                    install : true,\n> -                                    cpp_args : libcamera_base_args,\n> -                                    include_directories : libcamera_includes,\n> -                                    dependencies : libcamera_base_deps)\n> +libcamera_base_lib = library('libcamera-base',\n> +                             [libcamera_base_sources, libcamera_base_headers],\n> +                             version : libcamera_version,\n> +                             soversion : libcamera_soversion,\n> +                             name_prefix : '',\n> +                             install : true,\n> +                             cpp_args : libcamera_base_args,\n> +                             include_directories : libcamera_includes,\n> +                             dependencies : libcamera_base_deps)\n> \n>  libcamera_base = declare_dependency(sources : [\n>                                          libcamera_base_headers,\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 0494e808..cd1bf4ed 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -163,15 +163,15 @@ libcamera_deps = [\n>  # runtime if the library is running from an installed location by checking\n>  # for the presence or abscence of the dynamic tag.\n> \n> -libcamera = shared_library('libcamera',\n> -                           libcamera_sources,\n> -                           version : libcamera_version,\n> -                           soversion : libcamera_soversion,\n> -                           name_prefix : '',\n> -                           install : true,\n> -                           include_directories : includes,\n> -                           build_rpath : '/',\n> -                           dependencies : libcamera_deps)\n> +libcamera = library('libcamera',\n> +                    libcamera_sources,\n> +                    version : libcamera_version,\n> +                    soversion : libcamera_soversion,\n> +                    name_prefix : '',\n> +                    install : true,\n> +                    include_directories : includes,\n> +                    build_rpath : '/',\n> +                    dependencies : libcamera_deps)\n\nDo libcameraBuildPath() and libcameraSourcePath() still work as expected\nwhen compiling libcamera as a static library ?\n\n> \n>  libcamera_public = declare_dependency(sources : [\n>                                            libcamera_ipa_headers,\n> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> index f132103c..46dab168 100644\n> --- a/src/v4l2/meson.build\n> +++ b/src/v4l2/meson.build\n> @@ -27,12 +27,12 @@ v4l2_compat_cpp_args = [\n>      '-fvisibility=hidden',\n>  ]\n> \n> -v4l2_compat = shared_library('v4l2-compat',\n> -                             v4l2_compat_sources,\n> -                             name_prefix : '',\n> -                             install : true,\n> -                             dependencies : [libcamera_private, libdl],\n> -                             cpp_args : v4l2_compat_cpp_args)\n> +v4l2_compat = library('v4l2-compat',\n> +                      v4l2_compat_sources,\n> +                      name_prefix : '',\n> +                      install : true,\n> +                      dependencies : [libcamera_private, libdl],\n> +                      cpp_args : v4l2_compat_cpp_args)\n> \n>  # Provide a wrapper script to support easily loading applications with the V4L2\n>  # adaptation layer.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 17B6EBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Nov 2022 05:30:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5AFCA63335;\n\tMon, 28 Nov 2022 06:30:14 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D1A7761F24\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Nov 2022 06:30:11 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C64B55A;\n\tMon, 28 Nov 2022 06:30:11 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669613414;\n\tbh=mwEVyfBxLwhTxR1e5C3Rgckqr8GvMMIRFdKNzO0Wr3U=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=odzfK2gryZkrzU9boVQox5cav5ihQ9U6+Chto54jPgs+NR6uQAyMk75tntnUpj9k7\n\tsS83HO/I5cZXDdPfXesD0l4DWtd4zhhr/XrBJKNvhYTHwQz6CREJVKnlHvXCInQ4Zw\n\t/aPNVAHeHg7Xz5MajnUZq3DTl5YSt1o2YqXSPDYhDN0UVXBEgMGrwCbbLuyF2wDZHh\n\tHzMDyMwmNVC1/F2mKPxfsZuNnXd9ovWZOfatdQrrD/lsL6+Tt/x+QLsKo74kWj/AjU\n\t0aVVWeqXtPELVcdRM76Wa+o1877JiI+qog7eTLyO11/Blo+MokZcW1ggOw/Fjm2nRM\n\tH/LkUqNkFPKxg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669613411;\n\tbh=mwEVyfBxLwhTxR1e5C3Rgckqr8GvMMIRFdKNzO0Wr3U=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=r/nTAUEeSyisqH4kyTbv3ZoarierxruaR19qUyDwiGgxjWhcvW9CcbONHJ4LJH/5f\n\tFAeqQpp/y494+T7SNOZAiJ5CjD6G2fLt5TPRA+JELNa7h0z6ZNvY4JZZNWQdCsXjRm\n\tEeLeflOH8XP7aHEvZh4J2jHqO/O2y72fKR2xnp14="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"r/nTAUEe\"; dkim-atps=neutral","Date":"Mon, 28 Nov 2022 07:29:56 +0200","To":"Christian Rauch <Rauch.Christian@gmx.de>","Message-ID":"<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>","References":"<20221127230110.192298-1-Rauch.Christian@gmx.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221127230110.192298-1-Rauch.Christian@gmx.de>","Subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25919,"web_url":"https://patchwork.libcamera.org/comment/25919/","msgid":"<07bfb0d1-fe6c-e377-1b8a-cf8351e088bd@gmx.de>","date":"2022-11-28T23:00:26","subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","submitter":{"id":111,"url":"https://patchwork.libcamera.org/api/people/111/","name":"Christian Rauch","email":"Rauch.Christian@gmx.de"},"content":"Hi Laurent,\n\nAm 28.11.22 um 06:29 schrieb Laurent Pinchart:\n> Hi Christian,\n>\n> Thank you for the patch.\n>\n> On Mon, Nov 28, 2022 at 12:01:10AM +0100, Christian Rauch via libcamera-devel wrote:\n>> Defining libraries via shared_library() prevents compiling libcamera as\n>> static library. The meson project recommends using library() instead of\n>> shared_library(), static_library() or both_libraries():\n>> https://mesonbuild.com/Reference-manual_functions.html#library\n>\n> I'm curious, do you personally have use cases for libcamera as a static\n> library ?\n\nYes. I want/have to distribute my application with a statically linked\nlibcamera in order to avoid dynamic linking issues with the libcamera\npackage distributed by Ubuntu.\n\n>\n>> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n>> ---\n>>   src/android/meson.build        | 16 ++++++++--------\n>>   src/gstreamer/meson.build      |  2 +-\n>>   src/libcamera/base/meson.build | 18 +++++++++---------\n>>   src/libcamera/meson.build      | 18 +++++++++---------\n>>   src/v4l2/meson.build           | 12 ++++++------\n>>   5 files changed, 33 insertions(+), 33 deletions(-)\n>>\n>> diff --git a/src/android/meson.build b/src/android/meson.build\n>> index 1bba54de..51b365e3 100644\n>> --- a/src/android/meson.build\n>> +++ b/src/android/meson.build\n>> @@ -67,11 +67,11 @@ android_camera_metadata = static_library('camera_metadata',\n>>                                            c_args : '-Wno-shadow',\n>>                                            include_directories : android_includes)\n>>\n>> -libcamera_hal = shared_library('libcamera-hal',\n>> -                               android_hal_sources,\n>> -                               name_prefix : '',\n>> -                               link_with : android_camera_metadata,\n>> -                               install : true,\n>> -                               cpp_args : android_cpp_args,\n>> -                               include_directories : android_includes,\n>> -                               dependencies : android_deps)\n>> +libcamera_hal = library('libcamera-hal',\n>> +                        android_hal_sources,\n>> +                        name_prefix : '',\n>> +                        link_with : android_camera_metadata,\n>> +                        install : true,\n>> +                        cpp_args : android_cpp_args,\n>> +                        include_directories : android_includes,\n>> +                        dependencies : android_deps)\n>\n> I'm curious, how do you envision the HAL to be loaded by the Android\n> camera service if it's a static library ? :-)\n\nIsn't it possible to link the libraries statically on Android too?\n\n>\n>> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n>> index eda246d7..b364837d 100644\n>> --- a/src/gstreamer/meson.build\n>> +++ b/src/gstreamer/meson.build\n>> @@ -39,7 +39,7 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')\n>>       libcamera_gst_cpp_args += ['-Wno-unused-function']\n>>   endif\n>>\n>> -libcamera_gst = shared_library('gstlibcamera',\n>> +libcamera_gst = library('gstlibcamera',\n>\n> Same here, and for the V4L2 compat library.\n\nI might have overdone this. How is this library supposed to be used? Do\nyou preload it in order to emulate V4L2 APIs? Could this also be done\nwith a 'shared_module'?\n\n>\n>>       libcamera_gst_sources,\n>>       cpp_args : libcamera_gst_cpp_args,\n>>       dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>> index 7a7fd7e4..91dc1e71 100644\n>> --- a/src/libcamera/base/meson.build\n>> +++ b/src/libcamera/base/meson.build\n>> @@ -48,15 +48,15 @@ libcamera_base_deps = [\n>>   # the use of headers which must not be exposed to the libcamera public api.\n>>   libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>>\n>> -libcamera_base_lib = shared_library('libcamera-base',\n>> -                                    [libcamera_base_sources, libcamera_base_headers],\n>> -                                    version : libcamera_version,\n>> -                                    soversion : libcamera_soversion,\n>> -                                    name_prefix : '',\n>> -                                    install : true,\n>> -                                    cpp_args : libcamera_base_args,\n>> -                                    include_directories : libcamera_includes,\n>> -                                    dependencies : libcamera_base_deps)\n>> +libcamera_base_lib = library('libcamera-base',\n>> +                             [libcamera_base_sources, libcamera_base_headers],\n>> +                             version : libcamera_version,\n>> +                             soversion : libcamera_soversion,\n>> +                             name_prefix : '',\n>> +                             install : true,\n>> +                             cpp_args : libcamera_base_args,\n>> +                             include_directories : libcamera_includes,\n>> +                             dependencies : libcamera_base_deps)\n>>\n>>   libcamera_base = declare_dependency(sources : [\n>>                                           libcamera_base_headers,\n>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>> index 0494e808..cd1bf4ed 100644\n>> --- a/src/libcamera/meson.build\n>> +++ b/src/libcamera/meson.build\n>> @@ -163,15 +163,15 @@ libcamera_deps = [\n>>   # runtime if the library is running from an installed location by checking\n>>   # for the presence or abscence of the dynamic tag.\n>>\n>> -libcamera = shared_library('libcamera',\n>> -                           libcamera_sources,\n>> -                           version : libcamera_version,\n>> -                           soversion : libcamera_soversion,\n>> -                           name_prefix : '',\n>> -                           install : true,\n>> -                           include_directories : includes,\n>> -                           build_rpath : '/',\n>> -                           dependencies : libcamera_deps)\n>> +libcamera = library('libcamera',\n>> +                    libcamera_sources,\n>> +                    version : libcamera_version,\n>> +                    soversion : libcamera_soversion,\n>> +                    name_prefix : '',\n>> +                    install : true,\n>> +                    include_directories : includes,\n>> +                    build_rpath : '/',\n>> +                    dependencies : libcamera_deps)\n>\n> Do libcameraBuildPath() and libcameraSourcePath() still work as expected\n> when compiling libcamera as a static library ?\n\nI haven't tested this yet. I only tested that I can build and link\nlibcamera statically. I added this option in order to test this and get\nsome feedback. The default behaviour will still build a shared library.\n\n>\n>>\n>>   libcamera_public = declare_dependency(sources : [\n>>                                             libcamera_ipa_headers,\n>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n>> index f132103c..46dab168 100644\n>> --- a/src/v4l2/meson.build\n>> +++ b/src/v4l2/meson.build\n>> @@ -27,12 +27,12 @@ v4l2_compat_cpp_args = [\n>>       '-fvisibility=hidden',\n>>   ]\n>>\n>> -v4l2_compat = shared_library('v4l2-compat',\n>> -                             v4l2_compat_sources,\n>> -                             name_prefix : '',\n>> -                             install : true,\n>> -                             dependencies : [libcamera_private, libdl],\n>> -                             cpp_args : v4l2_compat_cpp_args)\n>> +v4l2_compat = library('v4l2-compat',\n>> +                      v4l2_compat_sources,\n>> +                      name_prefix : '',\n>> +                      install : true,\n>> +                      dependencies : [libcamera_private, libdl],\n>> +                      cpp_args : v4l2_compat_cpp_args)\n>>\n>>   # Provide a wrapper script to support easily loading applications with the V4L2\n>>   # adaptation layer.\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 97FF3BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Nov 2022 23:00:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4C666333C;\n\tTue, 29 Nov 2022 00:00:29 +0100 (CET)","from mout.gmx.net (mout.gmx.net [212.227.15.15])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4977363326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 00:00:27 +0100 (CET)","from [192.168.0.158] ([88.152.184.103]) by mail.gmx.net (mrgmx004\n\t[212.227.17.190]) with ESMTPSA (Nemesis) id\n\t1MgeoI-1oWCSU2N5Q-00h9Ha; Tue, 29 Nov 2022 00:00:26 +0100"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669676429;\n\tbh=vQbWocJmO0jPLluVs6YxCI/k5sI+ByyKMNcm80IwJoY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=G9ifgmHoRUFX4sXck1YupAEyt0WX/H1wa+fw7l1fhDZqlDCsH6sezrMNrFniyfcKd\n\tUbRwJin4JMk9jb/UL6hUADwZfJaxbKzxEa++RqVDsZvWpQBPgP39/vUpgVPl/dNz5a\n\trBZ8sBZrXc0RNvf5zcbAV1V3KVvRa6M76pXjfkbv6r79oH+3FvNHjqpfoOgozHGjOE\n\t74/4Ug74zP3rHe4CI9s2qpukLwstnyPkiczNnmazrOKgPB6w9bll1XWdK3TVbaFmYs\n\twhjMCBntjzPhcVKB4ZwT9mgqKKq+l1ltCqs4p+HM7hbSnGUFMWsalao7gMlKRGE97R\n\t6gNh4ToToP4oQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; \n\tt=1669676426; bh=vQbWocJmO0jPLluVs6YxCI/k5sI+ByyKMNcm80IwJoY=;\n\th=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;\n\tb=g1717y1AQM5AbmAQ364eEJWPzGP3P1pRW5IzEtD+vBBm1f+KIjJMoyBg9L4yMXz4L\n\tQ2Y+snZ5bwS8UHLgMO42tWyuF5Grnk5SSHt0rOUchiewp8BGcN928XyVoWNGAuxHV8\n\tVJuTVkkYd0bO+0AvmNph3mnoC//CfIY5cffpbLK89tXg0IW3ec2L5I9sBsAnzhHyX0\n\tNhqO/aN7l+lknVYOP6NKSySRuaLmadoofRhX/BQYfUfoWLOXuA6dP2YN7D7skE8M7X\n\tDfLkWonpD+VuCC9ikdIBa/G9OM5800ERGwJ/FF0/xOMTRjqVZGwl00kkNkV7T5GxN9\n\t+EMsz5t30GJMg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmx.de header.i=@gmx.de\n\theader.b=\"g1717y1A\"; dkim-atps=neutral","X-UI-Sender-Class":"724b4f7f-cbec-4199-ad4e-598c01a50d3a","Message-ID":"<07bfb0d1-fe6c-e377-1b8a-cf8351e088bd@gmx.de>","Date":"Tue, 29 Nov 2022 00:00:26 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.4.2","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20221127230110.192298-1-Rauch.Christian@gmx.de>\n\t<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>","Content-Language":"en-GB","In-Reply-To":"<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"quoted-printable","X-Provags-ID":"V03:K1:/mnglrIFw+ON4I/aPXWE2dzd3sMJQA2tuXFYBK69Uc35MoLhDNN\n\t0uDqfVvhe0alhSXdK4EsdZarwPFgys6FZSf2VVRhvm5CQCJ1kOE6k40UBetnWqAY6hhte9i\n\tQNTnj5OvSUf8rdcCr7xu6RmOR0G6aoj5aEMuvTCbQtsLyzhAUAKBG8PoqW6n4t3iG9Z84i+\n\tHoC+WBBMBhCAiaPMp49rA==","X-Spam-Flag":"NO","UI-OutboundReport":"notjunk:1; M01:P0:zmsk++Iu4FY=;\n\ta4PgN6lLDHPOGnhiRNn9K84j7Gf\n\tRm01ctf7VRHROmJdYEhjzYSDNyfpBI6Yrwc9EKLH+IAqgwBGLuJJC5YkE1Ag6UHd5B2qR7X9z\n\tiRaViqV3IUMY1sZ6KX9rKUNd2HG7FQlztFCMCBDkWY/qs8/R8q5O3i9Ex4396LVI08CXUJTmG\n\t5vF4/tfqxbpFSV0oj/e4k7dlUsOvdOjuYWn+nrD95jMfzWS04E4ILEBcBLl0vtYa19PlCS4i8\n\tyn2l+CtuxMHhhFFSjPrdTEgL5gQeoewyzzzB/l2L5EB+DLQsbCeoAOE12BaBosggpW3fcIkwe\n\t/+jT0+OvK6HNJJM3+zNzhmc5jbr61TRWxEmhHqqllSLajqvoOI0DTqxoWFrqPWV74VdC51+xG\n\tZBMUezM/pPQ2GVAC1jjDbrLvWHL5FTS5u4S5T7SEjrB7ZzZ2aPHo7q8cQLDJ62I4mdLzCKdeK\n\t8juXfJUcgVNkyRynXpjkfPAtbSTAVnB0Lvx28bu8BtBFK16XPMIPd5XsJFWmDUpyAeRfj31r4\n\tooQTnHj7h7pELbyWkTXyOv+YxjNqF4NINUgkoyPTcgh56H0cWTAA0PTDEBRxjPNtMCWLoFpTu\n\t+oHVchvsqxbIv84KhrRdfNEKIf7dhIO8b+C572uo3AwkKNZHNXPkGuZgceGXsK6us3iWOHtn6\n\tm3o1bh+wYQQ1kQOZFv8WQvwts52eq7HSB/MybAA2ZLvtlRv9N0M3vKrKEVo8mUieT8SL3jew/\n\tFi1a5p6w4DUWfMKItxHO2GrEVal1tumsXU4cUM98grZahUTcRhgcPUtnUEKPC4u+InimooHKW\n\tFf6Tf+Y/4Ds/MpOJiejgOZOjiHTusn3nq4z9jgBZA4vdragj4JKgk1julaugm3ZPVRIRhMVKs\n\tECdFy8EgGjRXm9gI4s3M+3fPtb0Z86JSmzy2ZDT8eBwgHUnO2aYm9B0GAhSLKjOBajn33Kjhm\n\tBynDZ0UbINrd+MT0XmjP99SF3wo=","Subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","From":"Christian Rauch via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Christian Rauch <Rauch.Christian@gmx.de>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25920,"web_url":"https://patchwork.libcamera.org/comment/25920/","msgid":"<Y4VC6ea/t/jqp6bi@pendragon.ideasonboard.com>","date":"2022-11-28T23:23:21","subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Christian,\n\nOn Tue, Nov 29, 2022 at 12:00:26AM +0100, Christian Rauch wrote:\n> Am 28.11.22 um 06:29 schrieb Laurent Pinchart:\n> > On Mon, Nov 28, 2022 at 12:01:10AM +0100, Christian Rauch via libcamera-devel wrote:\n> >> Defining libraries via shared_library() prevents compiling libcamera as\n> >> static library. The meson project recommends using library() instead of\n> >> shared_library(), static_library() or both_libraries():\n> >> https://mesonbuild.com/Reference-manual_functions.html#library\n> >\n> > I'm curious, do you personally have use cases for libcamera as a static\n> > library ?\n> \n> Yes. I want/have to distribute my application with a statically linked\n> libcamera in order to avoid dynamic linking issues with the libcamera\n> package distributed by Ubuntu.\n\nNote that IPA modules are always loaded dynamically.\n\n> >> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n> >> ---\n> >>   src/android/meson.build        | 16 ++++++++--------\n> >>   src/gstreamer/meson.build      |  2 +-\n> >>   src/libcamera/base/meson.build | 18 +++++++++---------\n> >>   src/libcamera/meson.build      | 18 +++++++++---------\n> >>   src/v4l2/meson.build           | 12 ++++++------\n> >>   5 files changed, 33 insertions(+), 33 deletions(-)\n> >>\n> >> diff --git a/src/android/meson.build b/src/android/meson.build\n> >> index 1bba54de..51b365e3 100644\n> >> --- a/src/android/meson.build\n> >> +++ b/src/android/meson.build\n> >> @@ -67,11 +67,11 @@ android_camera_metadata = static_library('camera_metadata',\n> >>                                            c_args : '-Wno-shadow',\n> >>                                            include_directories : android_includes)\n> >>\n> >> -libcamera_hal = shared_library('libcamera-hal',\n> >> -                               android_hal_sources,\n> >> -                               name_prefix : '',\n> >> -                               link_with : android_camera_metadata,\n> >> -                               install : true,\n> >> -                               cpp_args : android_cpp_args,\n> >> -                               include_directories : android_includes,\n> >> -                               dependencies : android_deps)\n> >> +libcamera_hal = library('libcamera-hal',\n> >> +                        android_hal_sources,\n> >> +                        name_prefix : '',\n> >> +                        link_with : android_camera_metadata,\n> >> +                        install : true,\n> >> +                        cpp_args : android_cpp_args,\n> >> +                        include_directories : android_includes,\n> >> +                        dependencies : android_deps)\n> >\n> > I'm curious, how do you envision the HAL to be loaded by the Android\n> > camera service if it's a static library ? :-)\n> \n> Isn't it possible to link the libraries statically on Android too?\n\nThe Android camera HAL is a shared object loaded dynamically by the\ncamera service.\n\n> >> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> >> index eda246d7..b364837d 100644\n> >> --- a/src/gstreamer/meson.build\n> >> +++ b/src/gstreamer/meson.build\n> >> @@ -39,7 +39,7 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')\n> >>       libcamera_gst_cpp_args += ['-Wno-unused-function']\n> >>   endif\n> >>\n> >> -libcamera_gst = shared_library('gstlibcamera',\n> >> +libcamera_gst = library('gstlibcamera',\n> >\n> > Same here, and for the V4L2 compat library.\n> \n> I might have overdone this. How is this library supposed to be used? Do\n> you preload it in order to emulate V4L2 APIs?\n\nYes, it's LD_PRELOADed and overrides several libc symbols.\n\n> Could this also be done with a 'shared_module'?\n\nPossibly, but\nhttps://mesonbuild.com/Reference-manual_functions.html#shared_module\nnotes that\n\n  Linking to a shared module on platforms other than Android is\n  deprecated, and will be an error in the future. It was previously\n  allowed because it was the only way to have a shared-library-like\n  target that contained references to undefined symbols. However, since\n  0.40.0, the override_options: build_target() keyword argument can be\n  used to create such a shared_library() by passing override_options:\n  'b_lundef=false'. Shared modules have other characteristics that make\n  them incompatible with linking, such as a lack of SONAME. On macOS and\n  iOS, linking to shared modules is disallowed by the linker, so we\n  disallow it at configure time. On Android, if a shared module foo uses\n  symbols from another shared module bar, foo must also be linked to\n  bar. Hence, linking one shared module to another will always be\n  allowed when building for Android.\n\nBut in any case, I think you can keep using shared_library() here (and\nin src/android/meson.build) while switching libcamera and libcamera-base\nto library().\n\n> >>       libcamera_gst_sources,\n> >>       cpp_args : libcamera_gst_cpp_args,\n> >>       dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n> >> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> >> index 7a7fd7e4..91dc1e71 100644\n> >> --- a/src/libcamera/base/meson.build\n> >> +++ b/src/libcamera/base/meson.build\n> >> @@ -48,15 +48,15 @@ libcamera_base_deps = [\n> >>   # the use of headers which must not be exposed to the libcamera public api.\n> >>   libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> >>\n> >> -libcamera_base_lib = shared_library('libcamera-base',\n> >> -                                    [libcamera_base_sources, libcamera_base_headers],\n> >> -                                    version : libcamera_version,\n> >> -                                    soversion : libcamera_soversion,\n> >> -                                    name_prefix : '',\n> >> -                                    install : true,\n> >> -                                    cpp_args : libcamera_base_args,\n> >> -                                    include_directories : libcamera_includes,\n> >> -                                    dependencies : libcamera_base_deps)\n> >> +libcamera_base_lib = library('libcamera-base',\n> >> +                             [libcamera_base_sources, libcamera_base_headers],\n> >> +                             version : libcamera_version,\n> >> +                             soversion : libcamera_soversion,\n> >> +                             name_prefix : '',\n> >> +                             install : true,\n> >> +                             cpp_args : libcamera_base_args,\n> >> +                             include_directories : libcamera_includes,\n> >> +                             dependencies : libcamera_base_deps)\n> >>\n> >>   libcamera_base = declare_dependency(sources : [\n> >>                                           libcamera_base_headers,\n> >> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> >> index 0494e808..cd1bf4ed 100644\n> >> --- a/src/libcamera/meson.build\n> >> +++ b/src/libcamera/meson.build\n> >> @@ -163,15 +163,15 @@ libcamera_deps = [\n> >>   # runtime if the library is running from an installed location by checking\n> >>   # for the presence or abscence of the dynamic tag.\n> >>\n> >> -libcamera = shared_library('libcamera',\n> >> -                           libcamera_sources,\n> >> -                           version : libcamera_version,\n> >> -                           soversion : libcamera_soversion,\n> >> -                           name_prefix : '',\n> >> -                           install : true,\n> >> -                           include_directories : includes,\n> >> -                           build_rpath : '/',\n> >> -                           dependencies : libcamera_deps)\n> >> +libcamera = library('libcamera',\n> >> +                    libcamera_sources,\n> >> +                    version : libcamera_version,\n> >> +                    soversion : libcamera_soversion,\n> >> +                    name_prefix : '',\n> >> +                    install : true,\n> >> +                    include_directories : includes,\n> >> +                    build_rpath : '/',\n> >> +                    dependencies : libcamera_deps)\n> >\n> > Do libcameraBuildPath() and libcameraSourcePath() still work as expected\n> > when compiling libcamera as a static library ?\n> \n> I haven't tested this yet. I only tested that I can build and link\n> libcamera statically. I added this option in order to test this and get\n> some feedback. The default behaviour will still build a shared library.\n\nThe default behaviour is fine, but I'd like to know if\nlibcameraBuildPath() and libcameraSourcePath() work as expected with\nstatic libraries or if we should fix them. It could possibly be done on\ntop.\n\n> >>\n> >>   libcamera_public = declare_dependency(sources : [\n> >>                                             libcamera_ipa_headers,\n> >> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> >> index f132103c..46dab168 100644\n> >> --- a/src/v4l2/meson.build\n> >> +++ b/src/v4l2/meson.build\n> >> @@ -27,12 +27,12 @@ v4l2_compat_cpp_args = [\n> >>       '-fvisibility=hidden',\n> >>   ]\n> >>\n> >> -v4l2_compat = shared_library('v4l2-compat',\n> >> -                             v4l2_compat_sources,\n> >> -                             name_prefix : '',\n> >> -                             install : true,\n> >> -                             dependencies : [libcamera_private, libdl],\n> >> -                             cpp_args : v4l2_compat_cpp_args)\n> >> +v4l2_compat = library('v4l2-compat',\n> >> +                      v4l2_compat_sources,\n> >> +                      name_prefix : '',\n> >> +                      install : true,\n> >> +                      dependencies : [libcamera_private, libdl],\n> >> +                      cpp_args : v4l2_compat_cpp_args)\n> >>\n> >>   # Provide a wrapper script to support easily loading applications with the V4L2\n> >>   # adaptation layer.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 157D7BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Nov 2022 23:23:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4E8696333C;\n\tTue, 29 Nov 2022 00:23:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 74A9C63326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 00:23:37 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD2D34DA;\n\tTue, 29 Nov 2022 00:23:36 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669677819;\n\tbh=PTDdLZs11Ssq0eaTMdrSqzyRDeKVrdYWzl+PGoM8lOM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=tdwxQUBN4H/mp1ahp0IN2RXBUw9JisNuzKbrLOTa9UkWNBvkOfUH+V9v9FcL7Y32f\n\tdJ0prNwWBKxE85UBB+kXAbub2Uz6APlWAshGvi2yDsWCf5swCGCEnAj6TKxVocxYgy\n\tb8Ax0eZlrpWk9o+OYKGl+XjSmDFxla91v1e0arAjUfK8fVEyZRIGbNS8boEg4L1Ovw\n\tofviHrAEJE0hr9xpOeL/E3cxYYFmJ+OjvCnuXU+BtRWEN+ETIWCLRY8QR2+ub2f2Tk\n\t2rPhN3CIAMX3ynHbNtJMJQwto6zWz1ppdS9iAEmtRPCscMLO8/wFDwUDDRDCahjYMi\n\twQncfSopGK4uA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669677817;\n\tbh=PTDdLZs11Ssq0eaTMdrSqzyRDeKVrdYWzl+PGoM8lOM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WZc+WNMK9kv9mYQYzfxSmP8M7F83nls/c1S+0Ucsl+D7h+wGJqlGJsPFxh97+lKPb\n\tp7ZwMPlTbfXjzgDBTdA2GtGL4h0hmccAWm2r9mzY2E/kUo/rz4ypMKopzIZ+hTuB9u\n\tbDxDl2JgqHXV1f5FRnesVNOjMB+TC7Pqxc0Zwr3s="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WZc+WNMK\"; dkim-atps=neutral","Date":"Tue, 29 Nov 2022 01:23:21 +0200","To":"Christian Rauch <Rauch.Christian@gmx.de>","Message-ID":"<Y4VC6ea/t/jqp6bi@pendragon.ideasonboard.com>","References":"<20221127230110.192298-1-Rauch.Christian@gmx.de>\n\t<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>\n\t<07bfb0d1-fe6c-e377-1b8a-cf8351e088bd@gmx.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<07bfb0d1-fe6c-e377-1b8a-cf8351e088bd@gmx.de>","Subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25996,"web_url":"https://patchwork.libcamera.org/comment/25996/","msgid":"<acf39cb5-978c-a8ba-a6ae-96f9bee8d19c@gmx.de>","date":"2022-12-02T20:56:10","subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","submitter":{"id":111,"url":"https://patchwork.libcamera.org/api/people/111/","name":"Christian Rauch","email":"Rauch.Christian@gmx.de"},"content":"Hi Laurent,\n\nAm 29.11.22 um 00:23 schrieb Laurent Pinchart:\n> Hi Christian,\n>\n> On Tue, Nov 29, 2022 at 12:00:26AM +0100, Christian Rauch wrote:\n>> Am 28.11.22 um 06:29 schrieb Laurent Pinchart:\n>>> On Mon, Nov 28, 2022 at 12:01:10AM +0100, Christian Rauch via libcamera-devel wrote:\n>>>> Defining libraries via shared_library() prevents compiling libcamera as\n>>>> static library. The meson project recommends using library() instead of\n>>>> shared_library(), static_library() or both_libraries():\n>>>> https://mesonbuild.com/Reference-manual_functions.html#library\n>>>\n>>> I'm curious, do you personally have use cases for libcamera as a static\n>>> library ?\n>>\n>> Yes. I want/have to distribute my application with a statically linked\n>> libcamera in order to avoid dynamic linking issues with the libcamera\n>> package distributed by Ubuntu.\n>\n> Note that IPA modules are always loaded dynamically.\n>\n>>>> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n>>>> ---\n>>>>    src/android/meson.build        | 16 ++++++++--------\n>>>>    src/gstreamer/meson.build      |  2 +-\n>>>>    src/libcamera/base/meson.build | 18 +++++++++---------\n>>>>    src/libcamera/meson.build      | 18 +++++++++---------\n>>>>    src/v4l2/meson.build           | 12 ++++++------\n>>>>    5 files changed, 33 insertions(+), 33 deletions(-)\n>>>>\n>>>> diff --git a/src/android/meson.build b/src/android/meson.build\n>>>> index 1bba54de..51b365e3 100644\n>>>> --- a/src/android/meson.build\n>>>> +++ b/src/android/meson.build\n>>>> @@ -67,11 +67,11 @@ android_camera_metadata = static_library('camera_metadata',\n>>>>                                             c_args : '-Wno-shadow',\n>>>>                                             include_directories : android_includes)\n>>>>\n>>>> -libcamera_hal = shared_library('libcamera-hal',\n>>>> -                               android_hal_sources,\n>>>> -                               name_prefix : '',\n>>>> -                               link_with : android_camera_metadata,\n>>>> -                               install : true,\n>>>> -                               cpp_args : android_cpp_args,\n>>>> -                               include_directories : android_includes,\n>>>> -                               dependencies : android_deps)\n>>>> +libcamera_hal = library('libcamera-hal',\n>>>> +                        android_hal_sources,\n>>>> +                        name_prefix : '',\n>>>> +                        link_with : android_camera_metadata,\n>>>> +                        install : true,\n>>>> +                        cpp_args : android_cpp_args,\n>>>> +                        include_directories : android_includes,\n>>>> +                        dependencies : android_deps)\n>>>\n>>> I'm curious, how do you envision the HAL to be loaded by the Android\n>>> camera service if it's a static library ? :-)\n>>\n>> Isn't it possible to link the libraries statically on Android too?\n>\n> The Android camera HAL is a shared object loaded dynamically by the\n> camera service.\n>\n>>>> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n>>>> index eda246d7..b364837d 100644\n>>>> --- a/src/gstreamer/meson.build\n>>>> +++ b/src/gstreamer/meson.build\n>>>> @@ -39,7 +39,7 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')\n>>>>        libcamera_gst_cpp_args += ['-Wno-unused-function']\n>>>>    endif\n>>>>\n>>>> -libcamera_gst = shared_library('gstlibcamera',\n>>>> +libcamera_gst = library('gstlibcamera',\n>>>\n>>> Same here, and for the V4L2 compat library.\n>>\n>> I might have overdone this. How is this library supposed to be used? Do\n>> you preload it in order to emulate V4L2 APIs?\n>\n> Yes, it's LD_PRELOADed and overrides several libc symbols.\n>\n>> Could this also be done with a 'shared_module'?\n>\n> Possibly, but\n> https://mesonbuild.com/Reference-manual_functions.html#shared_module\n> notes that\n>\n>    Linking to a shared module on platforms other than Android is\n>    deprecated, and will be an error in the future. It was previously\n>    allowed because it was the only way to have a shared-library-like\n>    target that contained references to undefined symbols. However, since\n>    0.40.0, the override_options: build_target() keyword argument can be\n>    used to create such a shared_library() by passing override_options:\n>    'b_lundef=false'. Shared modules have other characteristics that make\n>    them incompatible with linking, such as a lack of SONAME. On macOS and\n>    iOS, linking to shared modules is disallowed by the linker, so we\n>    disallow it at configure time. On Android, if a shared module foo uses\n>    symbols from another shared module bar, foo must also be linked to\n>    bar. Hence, linking one shared module to another will always be\n>    allowed when building for Android.\n>\n> But in any case, I think you can keep using shared_library() here (and\n> in src/android/meson.build) while switching libcamera and libcamera-base\n> to library().\n>\n>>>>        libcamera_gst_sources,\n>>>>        cpp_args : libcamera_gst_cpp_args,\n>>>>        dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n>>>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>>>> index 7a7fd7e4..91dc1e71 100644\n>>>> --- a/src/libcamera/base/meson.build\n>>>> +++ b/src/libcamera/base/meson.build\n>>>> @@ -48,15 +48,15 @@ libcamera_base_deps = [\n>>>>    # the use of headers which must not be exposed to the libcamera public api.\n>>>>    libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>>>>\n>>>> -libcamera_base_lib = shared_library('libcamera-base',\n>>>> -                                    [libcamera_base_sources, libcamera_base_headers],\n>>>> -                                    version : libcamera_version,\n>>>> -                                    soversion : libcamera_soversion,\n>>>> -                                    name_prefix : '',\n>>>> -                                    install : true,\n>>>> -                                    cpp_args : libcamera_base_args,\n>>>> -                                    include_directories : libcamera_includes,\n>>>> -                                    dependencies : libcamera_base_deps)\n>>>> +libcamera_base_lib = library('libcamera-base',\n>>>> +                             [libcamera_base_sources, libcamera_base_headers],\n>>>> +                             version : libcamera_version,\n>>>> +                             soversion : libcamera_soversion,\n>>>> +                             name_prefix : '',\n>>>> +                             install : true,\n>>>> +                             cpp_args : libcamera_base_args,\n>>>> +                             include_directories : libcamera_includes,\n>>>> +                             dependencies : libcamera_base_deps)\n>>>>\n>>>>    libcamera_base = declare_dependency(sources : [\n>>>>                                            libcamera_base_headers,\n>>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>>>> index 0494e808..cd1bf4ed 100644\n>>>> --- a/src/libcamera/meson.build\n>>>> +++ b/src/libcamera/meson.build\n>>>> @@ -163,15 +163,15 @@ libcamera_deps = [\n>>>>    # runtime if the library is running from an installed location by checking\n>>>>    # for the presence or abscence of the dynamic tag.\n>>>>\n>>>> -libcamera = shared_library('libcamera',\n>>>> -                           libcamera_sources,\n>>>> -                           version : libcamera_version,\n>>>> -                           soversion : libcamera_soversion,\n>>>> -                           name_prefix : '',\n>>>> -                           install : true,\n>>>> -                           include_directories : includes,\n>>>> -                           build_rpath : '/',\n>>>> -                           dependencies : libcamera_deps)\n>>>> +libcamera = library('libcamera',\n>>>> +                    libcamera_sources,\n>>>> +                    version : libcamera_version,\n>>>> +                    soversion : libcamera_soversion,\n>>>> +                    name_prefix : '',\n>>>> +                    install : true,\n>>>> +                    include_directories : includes,\n>>>> +                    build_rpath : '/',\n>>>> +                    dependencies : libcamera_deps)\n>>>\n>>> Do libcameraBuildPath() and libcameraSourcePath() still work as expected\n>>> when compiling libcamera as a static library ?\n>>\n>> I haven't tested this yet. I only tested that I can build and link\n>> libcamera statically. I added this option in order to test this and get\n>> some feedback. The default behaviour will still build a shared library.\n>\n> The default behaviour is fine, but I'd like to know if\n> libcameraBuildPath() and libcameraSourcePath() work as expected with\n> static libraries or if we should fix them. It could possibly be done on\n> top.\n>\nThose functions will not work, i.e. it will assume libcamera got\ninstalled and return an empty string.\n\nThe way the source/build path is determined looks quite unreliable. I\nguess one could use meson to set the source or build path in a config\nvariable more robustly.\n\nNevertheless, if I compile and install libcamera via:\n   meson build_inst --prefix=/tmp/libcamera-install --default-library=static\n   meson install -C build_inst\n\nand run the cam demo with debug information:\n   LIBCAMERA_LOG_LEVELS=*:DEBUG /tmp/libcamera-install/bin/cam -l\n\nthen I can see that IPAs are correctly loaded, but there are still no\ncameras:\n\nDEBUG IPAModule ipa_module.cpp:329 ipa_ipu3.so: IPA module\n/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_ipu3.so is signed\nDEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module\n'/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_ipu3.so'\nDEBUG IPAModule ipa_module.cpp:329 ipa_rkisp1.so: IPA module\n/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_rkisp1.so is\nsigned\nDEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module\n'/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_rkisp1.so'\nDEBUG IPAModule ipa_module.cpp:329 ipa_rpi.so: IPA module\n/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_rpi.so is signed\nDEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module\n'/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_rpi.so'\nDEBUG IPAModule ipa_module.cpp:329 ipa_vimc.so: IPA module\n/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_vimc.so is signed\nDEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module\n'/tmp/libcamera-install/lib/x86_64-linux-gnu/libcamera/ipa_vimc.so'\n  INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-9a08048e\nDEBUG Camera camera_manager.cpp:108 Starting camera manager\nDEBUG DeviceEnumerator device_enumerator.cpp:224 New media device\n\"uvcvideo\" created from /dev/media0\nDEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device\n/dev/media0 due to 2 missing dependencies\nDEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies\nfor media device /dev/media0 found\nDEBUG DeviceEnumerator device_enumerator.cpp:252 Added device\n/dev/media0: uvcvideo\nDEBUG DeviceEnumerator device_enumerator.cpp:224 New media device\n\"uvcvideo\" created from /dev/media1\nDEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device\n/dev/media1 due to 2 missing dependencies\nDEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies\nfor media device /dev/media1 found\nDEBUG DeviceEnumerator device_enumerator.cpp:252 Added device\n/dev/media1: uvcvideo\nAvailable cameras:\n\n\n>>>>\n>>>>    libcamera_public = declare_dependency(sources : [\n>>>>                                              libcamera_ipa_headers,\n>>>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n>>>> index f132103c..46dab168 100644\n>>>> --- a/src/v4l2/meson.build\n>>>> +++ b/src/v4l2/meson.build\n>>>> @@ -27,12 +27,12 @@ v4l2_compat_cpp_args = [\n>>>>        '-fvisibility=hidden',\n>>>>    ]\n>>>>\n>>>> -v4l2_compat = shared_library('v4l2-compat',\n>>>> -                             v4l2_compat_sources,\n>>>> -                             name_prefix : '',\n>>>> -                             install : true,\n>>>> -                             dependencies : [libcamera_private, libdl],\n>>>> -                             cpp_args : v4l2_compat_cpp_args)\n>>>> +v4l2_compat = library('v4l2-compat',\n>>>> +                      v4l2_compat_sources,\n>>>> +                      name_prefix : '',\n>>>> +                      install : true,\n>>>> +                      dependencies : [libcamera_private, libdl],\n>>>> +                      cpp_args : v4l2_compat_cpp_args)\n>>>>\n>>>>    # Provide a wrapper script to support easily loading applications with the V4L2\n>>>>    # adaptation layer.\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4BE84BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 20:56:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B09F063336;\n\tFri,  2 Dec 2022 21:56:13 +0100 (CET)","from mout.gmx.net (mout.gmx.net [212.227.15.19])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B654160483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 21:56:11 +0100 (CET)","from [192.168.0.158] ([88.152.184.103]) by mail.gmx.net (mrgmx005\n\t[212.227.17.190]) with ESMTPSA (Nemesis) id\n\t1MgesQ-1oVTIU3frw-00h4MK; Fri, 02 Dec 2022 21:56:11 +0100"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670014573;\n\tbh=TQC2Y/6Lx22Uvge422YB10NjpWPM3nAoX32cY7E5P7k=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=qB/iAx3FJilUQPNs/DUGSkciMHJ8qj90JmyCSCTGsMbfLg1c6o6gnr9XBKec6du3T\n\t9UHB+7OH8H2A9iK4DpW/F59kSK4d6PM7/rqMK+d6n2ePIlpUczXndDc+oA7brh9yRM\n\tOLziVGNGIJUeDk5YCWJaKUXMIxVbMLoHL9h/GZZojhkXJKmwKJC8uLZKC11i/CfnF5\n\tGecAtpa6ncNfDqfKFGXIK+UMcuqoDL+uVdzKm7z3WqL58wmDn7+AfUAzzptQ85zIdi\n\tFvCWuOyebWj8+WWEb6IaSnU2ur6GnYBAIjx62R8knCI65Za4znWezo2i7eY0ECECCK\n\titxCB2MalV5wQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; \n\tt=1670014571; bh=TQC2Y/6Lx22Uvge422YB10NjpWPM3nAoX32cY7E5P7k=;\n\th=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;\n\tb=mamXyyxYPc/skryXU4ZTE8YH2oVQM3iygL4aC8Z+1jCeIegHaw1dhMiF6FcLzzRiQ\n\t6whLTW/JTlqgnID5h4MMWZqgp4jbB1s66fJMbM/YEOcwJ//PvfrugKoBnVGZ6irlYM\n\tyaoih40JFg/Bdy0Eesol/1pNTai637ksw7NrXcKZGu0lygPAgiPK5w+a5vC4lFtQi4\n\tkEQI9Purvo//ps4wApTr4U8O0190f+Rp85T50i4VVIbhKjzEy1nrPuMc4Sdwc9dHG8\n\tQbcF1kxnJB2t61WOOX1NgYkEpiyTv3vu3dew3sfpwzi39XVUgjnUsI4LJLjhhaygpe\n\tlR8bXbD1OjFOQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmx.de header.i=@gmx.de\n\theader.b=\"mamXyyxY\"; dkim-atps=neutral","X-UI-Sender-Class":"724b4f7f-cbec-4199-ad4e-598c01a50d3a","Message-ID":"<acf39cb5-978c-a8ba-a6ae-96f9bee8d19c@gmx.de>","Date":"Fri, 2 Dec 2022 21:56:10 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.4.2","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20221127230110.192298-1-Rauch.Christian@gmx.de>\n\t<Y4RHVOrFMbw5JafO@pendragon.ideasonboard.com>\n\t<07bfb0d1-fe6c-e377-1b8a-cf8351e088bd@gmx.de>\n\t<Y4VC6ea/t/jqp6bi@pendragon.ideasonboard.com>","Content-Language":"en-GB","In-Reply-To":"<Y4VC6ea/t/jqp6bi@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"quoted-printable","X-Provags-ID":"V03:K1:mNDolCCXAPmIqcspXLFGEN88t+uBvfjCMMVePsY2yMWMA0smh3+\n\tmIL3rZHVicYcjU7BHRaKQBE966yoeiaYTMfqTDFKZFcMvwFgx0EVW1YcYzIf56jA5VJEJhm\n\trXfHH5YU4jHIWTabC2al6zWeTz3YuyvH0BebzP6i6dH3jmsYKlqOvkEfIQaK/zFwSsVmcSl\n\tKWuPeBzmsBvfX+eIHsR6Q==","X-Spam-Flag":"NO","UI-OutboundReport":"notjunk:1; M01:P0:Y0TRJdONSyA=;\n\tQO+W59RagxYwDuI3IP4bcv66OY0\n\tyoqgOKRolFbsnTabn0FtA+6f4nWFlRbvFFQZ+2fylaQmFaNTcSeXH/Mh54jYBYW8p2NMeO/w1\n\tQe/Vr97nTLS5Fs+aneZYTZiPkqLABSKBzr5gnM2HSXmGAQAQdPmwW62OGb4NMz7rX6RcHcXdI\n\tpVI8Hd7IHUyKXhY+EJqY0BbsmgKi0VqVVZ85X/bqVKvTDt2ZamODz9LCu4e31INzMgLfl8b4f\n\tRsySZMe33qzSbZjFtfHXGvmhQqbzXOayoDbOINb9T4ElZ+en6rjq8w43Ws7eo9WsxgpmLz3kb\n\t+euir2HohvJgAaGOZLh8YWBCP+mK4naRvApewsVN3IAneuxRCgTb+Qgf/YVLICFOAvuofDcyD\n\tNrOeO41tYcK+OWKVCBny2rbOgYLc8Agc59WwnCYq6QJvwK58z+cVWvHcvqVTky8CX3GWXIi8T\n\tGG9DNHUJ5wxKhP7f4O6yTgzpdDOTKXSHTcg5HmSuXV90xZhQH5sNK+HzR+g4jlUyXWt7Q06Wd\n\td9OENVErHaIFhdM1m0pQYrhbxN8JEZcIHuyCNVz6HEeN/SHd2bxA5ljE47m4Ld1Rfaiq9B5sh\n\tC8kI0PqlrdKXpv+dUDh8/fa36DtOLZKkNgCNzJnPxpcIF3XDfH/jkLzTPWBuchtQAuCPcdif6\n\tZfjR1eUvKs0xUz89yY+yApHKu/iWhf1o/hW3SPqxws9pCoMvZTqUAH3J9QYoy+w2XycJB3jzZ\n\t6+ZjJvaf9ZXo1x7ODKv0uM9H0So4GEnaLI9UecbjurF67V+nPTfOuEdl9yJzlmd1JiCHizPbQ\n\ttda95iHNkwlEQ8DlQVIR6pdjpHPD2To7X+8wExqZTbVHk01HYZNp2FsPaa9FHI4VEBAxp7CVK\n\t1lhlx15lcJFOuY6lBE7CTcOOuMjGFNZ/Q9kk/r1vt8R33r4hl2RH4UJSCmRMwm2XpV2aEIn7T\n\ttFWiiA==","Subject":"Re: [libcamera-devel] [PATCH] meson: Use library() in order to let\n\tuser chose the library type","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","From":"Christian Rauch via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Christian Rauch <Rauch.Christian@gmx.de>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]