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
Re: [gentoo-dev] How to set CXX compiler?
On Fri, 03 Jul 2020 22:35:30 + Xianwen Chen (陈贤文) wrote: > In the Makefile, it is written that > > cc = g++ > > I would like to use sed to patch it so that it ebuild knows which g++ to > use. For example, depending on whether ccache is set, ebuild shall know > whether to use ccache. Rather than patch it, start the build with: emake cc="$(tc-getCXX)" You'll probably need to do more to respect CXXFLAGS and such though. -- James Le Cuirot (chewi) Gentoo Linux Developer pgpUk0gHCJfvA.pgp Description: OpenPGP digital signature
Re: [gentoo-dev] How to set CXX compiler?
On 2020-07-03 18:35, Xianwen Chen (陈贤文) wrote: > > In the Makefile, it is written that > > cc = g++ > > I would like to use sed to patch it so that it ebuild knows which g++ to > use. For example, depending on whether ccache is set, ebuild shall know > whether to use ccache. First, you should suggest to upstream that they don't force a particular compiler in their Makefile. One uncontroversial way to do this is by setting the default only if the user does not already have one set, with the "?=" assignment operator: cc ?= g++ Then, you should suggest that they change the name of that variable to the relatively-standard "CXX" that is used for the C++ compiler: CXX ?= g++ Finally, in your ebuild, you should run emake CXX=$(tc-getCXX) ... to override the default CXX in the Makefile. Even if upstream doesn't respond right away, you can patch the Makefile with these suggestions in Gentoo and send them the patch.
[gentoo-dev] How to set CXX compiler?
Dear all, I got a newbie question. I need to patch a Makefile, for a package I am working on my own layman repo. The package is sci-geosciences/sosicon. It converts spatial data that is in sosi format, which is the national standard format in Norway, to a shape file or to PostGIS. In the Makefile, it is written that cc = g++ I would like to use sed to patch it so that it ebuild knows which g++ to use. For example, depending on whether ccache is set, ebuild shall know whether to use ccache. I tried to replace g++ with ${CXX}$. I also tried to replace g++ with $(tc-getCXX). Neither was working. I have also tried a number of other potential solutions that I thought might work. Any hint, please? Yours sincerely, Xianwen