[gentoo-dev] Re: How to set CXX compiler?
On 06/07/2020 10:48, Xianwen Chen (陈贤文) wrote: Thank you, Michael and James. Yes, I plan to submit a nice patch to the Makefile to upstream. However, I think something is not right on my computer. I have earlier tried to specify emake CC="$(tc-getCXX)" prefix="${EPREFIX}/usr" DESTDIR="${D}" Somehow, emerge does not know what $(tc-getCXX) is. [...] Below is the content of the ebuild: ### # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 RESTRICT="splitdebug" sosicon_git_commit="655c75a4de75dbd4998ced6473aea255fed2492c" [...] The ebuild is missing an "inherit" line below the "EAPI" one that specifies "toolchain-funcs" (which is the eclass that provides the "tc-*" functions. Try EAPI=7 inherit toolchain-funcs
Re: [gentoo-dev] How to set CXX compiler?
Thank you, Michael and James. Yes, I plan to submit a nice patch to the Makefile to upstream. However, I think something is not right on my computer. I have earlier tried to specify emake CC="$(tc-getCXX)" prefix="${EPREFIX}/usr" DESTDIR="${D}" Somehow, emerge does not know what $(tc-getCXX) is. ### Emerging (1 of 1) sci-geosciences/sosicon-2020.06.04::an-overlay * 655c75a4de75dbd4998ced6473aea255fed2492c.zip BLAKE2B SHA512 size ;-) ... [ ok ] Unpacking source... Unpacking 655c75a4de75dbd4998ced6473aea255fed2492c.zip to /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/work Source unpacked in /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/work Preparing source in /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/work/sosicon-655c75a4de75dbd4998ced6473aea255fed2492c/src ... Source prepared. Configuring source in /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/work/sosicon-655c75a4de75dbd4998ced6473aea255fed2492c/src ... Source configured. Compiling source in /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/work/sosicon-655c75a4de75dbd4998ced6473aea255fed2492c/src ... /var/tmp/portage/sci-geosciences/sosicon-2020.06.04/temp/environment: line 454: tc-getCXX: command not found make -j1 CC= prefix=/usr DESTDIR=/var/tmp/portage/sci-geosciences/sosicon-2020.06.04/image ** Pre build steps... ragel/bin/linux64/ragel -C -L -o parser_ragel.cpp ragel/parser.rl ragel/bin/linux64/ragel -C -L -o sosi_north_east_ragel.cpp ragel/sosi_north_east.rl ragel/bin/linux64/ragel -C -L -o sosi_north_east_height_ragel.cpp ragel/sosi_north_east_height.rl ragel/bin/linux64/ragel -C -L -o sosi_origo_ne_ragel.cpp ragel/sosi_origo_ne.rl ragel/bin/linux64/ragel -C -L -o sosi_ref_ragel.cpp ragel/sosi_ref.rl ** Compiling... o ../bin/cmd/linux64/sosicon main.cpp command_line.cpp factory.cpp logger.cpp utils.cpp byte_order.cpp sosi/sosi_ref_list.cpp sosi_ref_ragel.cpp sosi/sosi_element.cpp sosi/sosi_element_search.cpp sosi/sosi_north_east.cpp sosi_north_east_ragel.cpp sosi_north_east_height_ragel.cpp sosi/sosi_origo_ne.cpp sosi_origo_ne_ragel.cpp sosi/sosi_charset_singleton.cpp sosi/sosi_unit.cpp sosi/sosi_translation_table.cpp shape/shapefile.cpp converter_sosi2shp.cpp converter_sosi2xml.cpp converter_sosi2tsv.cpp converter_sosi2psql.cpp converter_sosi2mysql.cpp converter_sosi_stat.cpp coordinate_collection.cpp parser.cpp parser_ragel.cpp -march=nocona -O2 -pipe; /bin/sh: o: command not found ### Below is the content of the ebuild: ### # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 RESTRICT="splitdebug" sosicon_git_commit="655c75a4de75dbd4998ced6473aea255fed2492c" DESCRIPTION="Converts a sosi file to a shapefile or to PostGIS" HOMEPAGE="https://github.com/espena/sosicon/"; SRC_URI=" https://github.com/espena/sosicon/archive/${sosicon_git_commit}.zip " SLOT="0/3.0" LICENSE="GPL-3" KEYWORDS="amd64 x86" S="${WORKDIR}/sosicon-${sosicon_git_commit}/src" src_prepare(){ default mv makefile Makefile sed -i "s|INSTALL_PATH ?= /usr/local|INSTALL_PATH = ${D}|g" Makefile || die sed -i "s|COMPILER_OPTS =|COMPILER_OPTS = ${CXXFLAGS}|g" Makefile || die } src_compile() { emake CC="$(tc-getCXX)" prefix="${EPREFIX}/usr" DESTDIR="${D}" } src_install() { mkdir ${D}/bin emake install prefix="${EPREFIX}/usr" DESTDIR="${D}" } ### Xianwen