[{"id":30814,"web_url":"https://patchwork.libcamera.org/comment/30814/","msgid":"<1f80d703-2073-47cf-ac1c-ffd62f0605b4@ideasonboard.com>","date":"2024-08-14T22:19:46","subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"On 09/08/2024 01:59, Laurent Pinchart wrote:\n> The libcamera.h header is a top-level library header that contains every\n> other libcamera header. It is currently generated by listing the files\n> in include/libcamera/ and dropping the .in suffix from template files.\n> This assumes a 1:1 mapping between generate header file names and the\n> name of their templates.\n>\n> Drop that assumption and make the libcamera.h generation based on the\n> libcamera public headers listed in meson.build. This makes the\n> libcamera.h header generation more future-proof.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n\nMakes sense to me:\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\n>   include/libcamera/meson.build | 20 ++++++++++----------\n>   utils/codegen/gen-header.sh   |  7 +++----\n>   2 files changed, 13 insertions(+), 14 deletions(-)\n>\n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 36de1c2a393c..87b9a9412fe7 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -107,16 +107,6 @@ formats_h = custom_target('formats_h',\n>                             install_dir : libcamera_headers_install_dir)\n>   libcamera_public_headers += formats_h\n>   \n> -# libcamera.h\n> -libcamera_h = custom_target('gen-header',\n> -                            input : 'meson.build',\n> -                            output : 'libcamera.h',\n> -                            command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],\n> -                            install : true,\n> -                            install_dir : libcamera_headers_install_dir)\n> -\n> -libcamera_public_headers += libcamera_h\n> -\n>   # version.h\n>   version = libcamera_version.split('.')\n>   libcamera_version_config = configuration_data()\n> @@ -129,3 +119,13 @@ version_h = configure_file(input : 'version.h.in',\n>                              configuration : libcamera_version_config,\n>                              install_dir : libcamera_headers_install_dir)\n>   libcamera_public_headers += version_h\n> +\n> +# libcamera.h\n> +libcamera_h = custom_target('gen-header',\n> +                            input : 'meson.build',\n> +                            output : 'libcamera.h',\n> +                            command : [gen_header, '@OUTPUT@', libcamera_public_headers],\n> +                            install : true,\n> +                            install_dir : libcamera_headers_install_dir)\n> +\n> +libcamera_public_headers += libcamera_h\n> diff --git a/utils/codegen/gen-header.sh b/utils/codegen/gen-header.sh\n> index d4692758eeb4..c78f085992ef 100755\n> --- a/utils/codegen/gen-header.sh\n> +++ b/utils/codegen/gen-header.sh\n> @@ -1,7 +1,7 @@\n>   #!/bin/sh\n>   \n> -src_dir=\"$1\"\n> -dst_file=\"$2\"\n> +dst_file=\"$1\"\n> +shift\n>   \n>   cat <<EOF > \"$dst_file\"\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n> @@ -16,9 +16,8 @@ cat <<EOF > \"$dst_file\"\n>   \n>   EOF\n>   \n> -headers=$(for header in \"$src_dir\"/*.h \"$src_dir\"/*.h.in ; do\n> +headers=$(for header in \"$@\" ; do\n>   \theader=$(basename \"$header\")\n> -\theader=\"${header%.in}\"\n>   \techo \"$header\"\n>   done | sort)\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 3A5ECC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Aug 2024 22:19:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D3491633BE;\n\tThu, 15 Aug 2024 00:19:50 +0200 (CEST)","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 F1EDA63394\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 00:19:48 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 092923A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 00:18:50 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MArV4tsM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723673931;\n\tbh=NlHGSIWlaBWDZJ80EWZc10tK1PlnC6yd3IyEAe24OCU=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=MArV4tsM7/0IDYmm+QMgWRFw9dGO+xaoqGXxD7JuvZjw11btaozYcpD9N6NTVEsYZ\n\t4cKTm5NDhaZCb88/qH+qVoB0ty+x/gSuyJd7SXepnuHbI5dJB9yjFoHnMK+mg9rOpI\n\tUXIDBqnQWbImXKuUIwtl1t+U3yJ4O6yUfVYTIYcs=","Message-ID":"<1f80d703-2073-47cf-ac1c-ffd62f0605b4@ideasonboard.com>","Date":"Wed, 14 Aug 2024 23:19:46 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","To":"libcamera-devel@lists.libcamera.org","References":"<20240809005914.20662-1-laurent.pinchart@ideasonboard.com>\n\t<20240809005914.20662-7-laurent.pinchart@ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6Bq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\n\txGj3iVCK4V+ezOYA7c2YolfRCNMTza6vcK/P4tDjjsyBBZrCCzhBvd4VVsnnlZhVaIxoky4K\n\taL+AP+zcQrUZmXmgZjXOLryGnsaeoVrIFyrU6ly90s1y3KLoPsDaTBMtnOdwxPmo1xisH8oL\n\ta/VRgpFBfojLPxMAEQEAAcLBfAQYAQgAJhYhBLHbbfDlj+/vEjX0HpIkLofy/hjEBQJi8nZT\n\tBQkFo5qAAhsMAAoJEJIkLofy/hjEXPcQAMIPNqiWiz/HKu9W4QIf1OMUpKn3YkVIj3p3gvfM\n\tRes4fGX94Ji599uLNrPoxKyaytC4R6BTxVriTJjWK8mbo9jZIRM4vkwkZZ2bu98EweSucxbp\n\tvjESsvMXGgxniqV/RQ/3T7LABYRoIUutARYq58p5HwSP0frF0fdFHYdTa2g7MYZl1ur2JzOC\n\tFHRpGadlNzKDE3fEdoMobxHB3Lm6FDml5GyBAA8+dQYVI0oDwJ3gpZPZ0J5Vx9RbqXe8RDuR\n\tdu90hvCJkq7/tzSQ0GeD3BwXb9/R/A4dVXhaDd91Q1qQXidI+2jwhx8iqiYxbT+DoAUkQRQy\n\txBtoCM1CxH7u45URUgD//fxYr3D4B1SlonA6vdaEdHZOGwECnDpTxecENMbz/Bx7qfrmd901\n\tD+N9SjIwrbVhhSyUXYnSUb8F+9g2RDY42Sk7GcYxIeON4VzKqWM7hpkXZ47pkK0YodO+dRKM\n\tyMcoUWrTK0Uz6UzUGKoJVbxmSW/EJLEGoI5p3NWxWtScEVv8mO49gqQdrRIOheZycDmHnItt\n\t9Qjv00uFhEwv2YfiyGk6iGF2W40s2pH2t6oeuGgmiZ7g6d0MEK8Ql/4zPItvr1c1rpwpXUC1\n\tu1kQWgtnNjFHX3KiYdqjcZeRBiry1X0zY+4Y24wUU0KsEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<20240809005914.20662-7-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30817,"web_url":"https://patchwork.libcamera.org/comment/30817/","msgid":"<236f50de-1ad0-49c9-9852-6b4d5073628c@ideasonboard.com>","date":"2024-08-14T22:29:20","subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Ah, but I forgot to mention:\n\nOn 14/08/2024 23:19, Dan Scally wrote:\n>\n> On 09/08/2024 01:59, Laurent Pinchart wrote:\n>> The libcamera.h header is a top-level library header that contains every\n>> other libcamera header. It is currently generated by listing the files\n>> in include/libcamera/ and dropping the .in suffix from template files.\n>> This assumes a 1:1 mapping between generate header file names and the\ns/generate/generated\n>> name of their templates.\n>>\n>> Drop that assumption and make the libcamera.h generation based on the\n>> libcamera public headers listed in meson.build. \n\n\nperhaps \"and base the libcamera.h generation on the\"?\n\n>> This makes the\n>> libcamera.h header generation more future-proof.\n>>\n>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>> ---\n>\n> Makes sense to me:\n>\n> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n>\n>>   include/libcamera/meson.build | 20 ++++++++++----------\n>>   utils/codegen/gen-header.sh   |  7 +++----\n>>   2 files changed, 13 insertions(+), 14 deletions(-)\n>>\n>> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n>> index 36de1c2a393c..87b9a9412fe7 100644\n>> --- a/include/libcamera/meson.build\n>> +++ b/include/libcamera/meson.build\n>> @@ -107,16 +107,6 @@ formats_h = custom_target('formats_h',\n>>                             install_dir : libcamera_headers_install_dir)\n>>   libcamera_public_headers += formats_h\n>>   -# libcamera.h\n>> -libcamera_h = custom_target('gen-header',\n>> -                            input : 'meson.build',\n>> -                            output : 'libcamera.h',\n>> -                            command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],\n>> -                            install : true,\n>> -                            install_dir : libcamera_headers_install_dir)\n>> -\n>> -libcamera_public_headers += libcamera_h\n>> -\n>>   # version.h\n>>   version = libcamera_version.split('.')\n>>   libcamera_version_config = configuration_data()\n>> @@ -129,3 +119,13 @@ version_h = configure_file(input : 'version.h.in',\n>>                              configuration : libcamera_version_config,\n>>                              install_dir : libcamera_headers_install_dir)\n>>   libcamera_public_headers += version_h\n>> +\n>> +# libcamera.h\n>> +libcamera_h = custom_target('gen-header',\n>> +                            input : 'meson.build',\n>> +                            output : 'libcamera.h',\n>> +                            command : [gen_header, '@OUTPUT@', libcamera_public_headers],\n>> +                            install : true,\n>> +                            install_dir : libcamera_headers_install_dir)\n>> +\n>> +libcamera_public_headers += libcamera_h\n>> diff --git a/utils/codegen/gen-header.sh b/utils/codegen/gen-header.sh\n>> index d4692758eeb4..c78f085992ef 100755\n>> --- a/utils/codegen/gen-header.sh\n>> +++ b/utils/codegen/gen-header.sh\n>> @@ -1,7 +1,7 @@\n>>   #!/bin/sh\n>>   -src_dir=\"$1\"\n>> -dst_file=\"$2\"\n>> +dst_file=\"$1\"\n>> +shift\n>>     cat <<EOF > \"$dst_file\"\n>>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>> @@ -16,9 +16,8 @@ cat <<EOF > \"$dst_file\"\n>>     EOF\n>>   -headers=$(for header in \"$src_dir\"/*.h \"$src_dir\"/*.h.in ; do\n>> +headers=$(for header in \"$@\" ; do\n>>       header=$(basename \"$header\")\n>> -    header=\"${header%.in}\"\n>>       echo \"$header\"\n>>   done | sort)","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 59C8DC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Aug 2024 22:29:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F02D8633BE;\n\tThu, 15 Aug 2024 00:29:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E34E963394\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 00:29:22 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EB3583A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 00:28:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cIZRe8cu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723674505;\n\tbh=SG1zW6GhslwDJ2iQPL4egRDTnGDwPUIKT8w/6mydnPU=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=cIZRe8cugmraawibc5BjBx0Ul/LAIZ+HZ0WiD/T7KCOMFDSYZX0qwaxss6VQOiPcP\n\tuae3J5+KpqMHHq6RkpYbBMlSFgsJvVymAeB6u4jzCNgbVXbTOgNS5Mj8nDaBn94FLD\n\teEG4Zf2WX6Hhz3FpKtPlBlnsub0VZB3GvzSZNk0s=","Message-ID":"<236f50de-1ad0-49c9-9852-6b4d5073628c@ideasonboard.com>","Date":"Wed, 14 Aug 2024 23:29:20 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","To":"libcamera-devel@lists.libcamera.org","References":"<20240809005914.20662-1-laurent.pinchart@ideasonboard.com>\n\t<20240809005914.20662-7-laurent.pinchart@ideasonboard.com>\n\t<1f80d703-2073-47cf-ac1c-ffd62f0605b4@ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6BqkQALgeD6KnXSWwaoCULp18etYW\n\tB31bfgrdphXQ5kUQibB0ADK8DERB4wrzrUb5CMxLBFE7mQty+v5NsP0OFNK9XTaAOcmD+Ove\n\teIjYvqurAaro91jrRVrS1gBRxIFqyPgNvwwL+alMZhn3/2jU2uvBmuRrgnc/e9cHKiuT3Dtq\n\tMHGPKL2m+plk+7tjMoQFfexoQ1JKugHAjxAhJfrkXh6uS6rc01bYCyo7ybzg53m1HLFJdNGX\n\tsUKR+dQpBs3SY4s66tc1sREJqdYyTsSZf80HjIeJjU/hRunRo4NjRIJwhvnK1GyjOvvuCKVU\n\tRWpY8dNjNu5OeAfdrlvFJOxIE9M8JuYCQTMULqd1NuzbpFMjc9524U3Cngs589T7qUMPb1H1\n\tNTA81LmtJ6Y+IV5/kiTUANflpzBwhu18Ok7kGyCq2a2jsOcVmk8gZNs04gyjuj8JziYwwLbf\n\tvzABwp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FDml5GyBAA8+dQYVI0oDwJ3gpZPZ0J5Vx9RbqXe8RDuR\n\tdu90hvCJkq7/tzSQ0GeD3BwXb9/R/A4dVXhaDd91Q1qQXidI+2jwhx8iqiYxbT+DoAUkQRQy\n\txBtoCM1CxH7u45URUgD//fxYr3D4B1SlonA6vdaEdHZOGwECnDpTxecENMbz/Bx7qfrmd901\n\tD+N9SjIwrbVhhSyUXYnSUb8F+9g2RDY42Sk7GcYxIeON4VzKqWM7hpkXZ47pkK0YodO+dRKM\n\tyMcoUWrTK0Uz6UzUGKoJVbxmSW/EJLEGoI5p3NWxWtScEVv8mO49gqQdrRIOheZycDmHnItt\n\t9Qjv00uFhEwv2YfiyGk6iGF2W40s2pH2t6oeuGgmiZ7g6d0MEK8Ql/4zPItvr1c1rpwpXUC1\n\tu1kQWgtnNjFHX3KiYdqjcZeRBiry1X0zY+4Y24wUU0KsEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<1f80d703-2073-47cf-ac1c-ffd62f0605b4@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30830,"web_url":"https://patchwork.libcamera.org/comment/30830/","msgid":"<Zr1tJG5hA9Hn1Zmw@pyrite.rasen.tech>","date":"2024-08-15T02:51:16","subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Aug 09, 2024 at 03:59:10AM +0300, Laurent Pinchart wrote:\n> The libcamera.h header is a top-level library header that contains every\n> other libcamera header. It is currently generated by listing the files\n> in include/libcamera/ and dropping the .in suffix from template files.\n> This assumes a 1:1 mapping between generate header file names and the\n> name of their templates.\n> \n> Drop that assumption and make the libcamera.h generation based on the\n> libcamera public headers listed in meson.build. This makes the\n> libcamera.h header generation more future-proof.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/meson.build | 20 ++++++++++----------\n>  utils/codegen/gen-header.sh   |  7 +++----\n>  2 files changed, 13 insertions(+), 14 deletions(-)\n> \n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 36de1c2a393c..87b9a9412fe7 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -107,16 +107,6 @@ formats_h = custom_target('formats_h',\n>                            install_dir : libcamera_headers_install_dir)\n>  libcamera_public_headers += formats_h\n>  \n> -# libcamera.h\n> -libcamera_h = custom_target('gen-header',\n> -                            input : 'meson.build',\n> -                            output : 'libcamera.h',\n> -                            command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],\n> -                            install : true,\n> -                            install_dir : libcamera_headers_install_dir)\n> -\n> -libcamera_public_headers += libcamera_h\n> -\n>  # version.h\n>  version = libcamera_version.split('.')\n>  libcamera_version_config = configuration_data()\n> @@ -129,3 +119,13 @@ version_h = configure_file(input : 'version.h.in',\n>                             configuration : libcamera_version_config,\n>                             install_dir : libcamera_headers_install_dir)\n>  libcamera_public_headers += version_h\n> +\n> +# libcamera.h\n> +libcamera_h = custom_target('gen-header',\n> +                            input : 'meson.build',\n> +                            output : 'libcamera.h',\n> +                            command : [gen_header, '@OUTPUT@', libcamera_public_headers],\n> +                            install : true,\n> +                            install_dir : libcamera_headers_install_dir)\n> +\n> +libcamera_public_headers += libcamera_h\n> diff --git a/utils/codegen/gen-header.sh b/utils/codegen/gen-header.sh\n> index d4692758eeb4..c78f085992ef 100755\n> --- a/utils/codegen/gen-header.sh\n> +++ b/utils/codegen/gen-header.sh\n> @@ -1,7 +1,7 @@\n>  #!/bin/sh\n>  \n> -src_dir=\"$1\"\n> -dst_file=\"$2\"\n> +dst_file=\"$1\"\n> +shift\n>  \n>  cat <<EOF > \"$dst_file\"\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n> @@ -16,9 +16,8 @@ cat <<EOF > \"$dst_file\"\n>  \n>  EOF\n>  \n> -headers=$(for header in \"$src_dir\"/*.h \"$src_dir\"/*.h.in ; do\n> +headers=$(for header in \"$@\" ; do\n>  \theader=$(basename \"$header\")\n> -\theader=\"${header%.in}\"\n>  \techo \"$header\"\n>  done | sort)\n>  \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 03434BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Aug 2024 02:51:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D15FE633BD;\n\tThu, 15 Aug 2024 04:51:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D00B863382\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 04:51:22 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-024.catv02.itscom.jp\n\t[175.177.49.24])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B6BB2827;\n\tThu, 15 Aug 2024 04:50:23 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sGQh03Wd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723690224;\n\tbh=ataAYKWl37q1Ad6H+P4g14zObo2BvEGSRvqEpCtZwrM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sGQh03WdfImm2BEcD6tb6/EIvvKYQOBqLKcOIXba0mFQ6PPb55uMXSHnhJC9T8pv7\n\tdS3DKCTedX4CR1V0hHHoXLWoH6kDSVLZSO2mIqQree8WFmlPk7PV78QBd1T6u1ymXQ\n\tFsSVMB7pCqZhsICktMAo0H+xgMt6VukOCB3n9r30=","Date":"Thu, 15 Aug 2024 11:51:16 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 06/10] utils: codegen: gen-header.sh: Generate\n\tlibcamera.h based on meson.build","Message-ID":"<Zr1tJG5hA9Hn1Zmw@pyrite.rasen.tech>","References":"<20240809005914.20662-1-laurent.pinchart@ideasonboard.com>\n\t<20240809005914.20662-7-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240809005914.20662-7-laurent.pinchart@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]