From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Tomsich Date: Fri, 8 Mar 2019 18:53:28 +0100 Subject: [U-Boot] [U-Boot, v2] Enable expression support for CONFIG_BOARD_SIZE_LIMIT In-Reply-To: <20190308172816.GA12265@mail.duskware.de> References: <20181207192751.30422-1-wd@denx.de> <20181214191642.GM8702@bill-the-cat> <20190308171709.GG5026@bill-the-cat> <20190308172816.GA12265@mail.duskware.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > On 08.03.2019, at 18:28, Martin Husemann wrote: > > On Fri, Mar 08, 2019 at 12:17:09PM -0500, Tom Rini wrote: >> OK, so a few thoughts here. >> - What's the portable way to do hex-based math? If we really need it? > > Use printf(3) to convert to/from hex, and standard shell arithmetic > with $(( )). > > Looks horrible, but something like: > > v=$(( $( printf "%d\n" 0xa0 ) + $( printf "%d\n" 0x10 ) )) > printf "v = %d (%x)\n" $v $v Can we just assume that awk is available? After all, AWK is defined in the top-level Makefile... > > > ... maybe arranged into some sh helper functions. > > Martin > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot