Hello, As suggested by jer@g.o in bug #321165, I would like to raise a proposal on extending toolchain-funcs.eclass with helper functions to compile applications directly. There are many simple applications which come without neither a sophisticated build system or even a tiny Makefile. In some cases, such applications aren't even packages as tarball -- a single, compressed source file is published instead. In case of these applications, ebuilds inherit toolchain-funcs.eclass to retrieve compiler information (tc-getCC/tc-getCXX) and call compiler manually, passing appropriate flags. This way, we get certain amount of code being repeated in many ebuilds, slightly differing in the way of calling the compiler and order of arguments being passed to it (see examples below). Although I haven't heard of any problems related to that, it is certainly not fool-proof and hard to maintain. As jer suggested, I'm providing below a listing of example ebuilds calling the compiler directly and notes on differences between the way they call it. Similar list could be obtained through calling: $ grep tc-getCXX.*CXXFLAGS.*-o /usr/portage/*/*/*.ebuild $ grep tc-getCC.*CFLAGS.*-o /usr/portage/*/*/*.ebuild C++ examples include: * app-misc/clockywock - single C++ file, ${LDFLAGS} before ${CXXFLAGS}, * app-pda/iripdb - two C++ files, with echoing the commands, ${LDFLAGS} ignored, * app-text/duconv - single C++ file with separate compilation and linking, ${LDFLAGS} after ${CXXFLAGS}, * dev-cpp/tree - single C++ file, ${LDFLAGS} ignored, * games-arcade/gunocide2ex - multiple C++ files, ${LDFLAGS} after ${CXXFLAGS}, * mail-filter/normalizemime, * media-sound/hearnet/hearnet, * net-misc/l7-protocols, * x11-apps/amlc. C examples include: * app-admin/hwreport - single C file, ${LDFLAGS} after ${CFLAGS}, * app-admin/sysrqd - single C file, ${LDFLAGS} ignored, * app-arch/unlzx - single C file, ${LDFLAGS} after ${CFLAGS}, * app-arch/unmakeself - single C file, '-o' after libraries, * app-cdr/bchunk - ${LDFLAGS} ignored, * app-cdr/{cddetect,nrg2iso,uif2iso} * app-crypt/scsign - '-pthread' at the beginning, '-o' after sources, * app-emacs/mpg123-el - ${LDFLAGS} ignored, * app-forensics/{cmospwd,galleta,pasco,rifiuti} - ${LDFLAGS} ignored, '-o' after sources, * app-misc/hilite - ${LDFLAGS} before ${CFLAGS}, * app-misc/irtrans-irclient - ${LDFLAGS} ignored, * app-misc/sl - '-o' after libs, command echoed, * app-text/unpaper - ${LDFLAGS} before ${CFLAGS}, '-o' after sources, * dev-games/paklib - ${LDFLAGS} ignored, '-o' after sources, * dev-java/rxtx - ${LDFLAGS} before ${CFLAGS}, '-o' after sources, * dev-lang/bff, * dev-libs/libhash - ${LDFLAGS} ignored, * dev-libs/libmemcache - ${LDFLAGS} ignored, * dev-libs/nss - (pseudo-configure check), seems ugly anyway, * dev-tcltk/tclperl - ${LDFLAGS} ignored, '-o' in the middle of flags, * dev-tex/tex4ht - ${CPPFLAGS} used (not many ebuilds care about them), * dev-tinyos/{channelgen,listen,serial-forwarder} - ${LDFLAGS} ignored, * dev-util/bsdiff, * dev-util/lockrun - ${LDFLAGS} ignored, '-o' after sources, * games-puzzle/trimines - creating pseudo-Makefile, ${LDFLAGS} ignored, 'sdl-config --cflags' after '-o', '-o' after sources, * games-server/tetrix - ${LDFLAGS} ignored, * games-util/biounzip, * mail-filter/qmail-scanner - ${LDFLAGS} ignored, * media-gfx/pngrewrite - ${LDFLAGS} before ${CFLAGS}, '-o' after libs, * media-sound/cd-discid - echoing commands, * media-sound/modplugplay, * media-sound/mserv - '-o' after sources, * media-sound/mup, * media-sound/wavegain - ${LDFLAGS} before ${CFLAGS}, '-o' after sources, defines after '-o', * media-tv/mythtv - ${LDFLAGS} after sources, * media-video/cpvts - echoing commands, * net-analyzer/bigeye - ${LDFLAGS} ignored, * net-analyzer/nagios-nrpe - ${LDFLAGS} ignored, * net-analyzer/nipper - ${LDFLAGS} ignored, '-o' after sources, * net-analyzer/ttcp - ${LDFLAGS} ignored, * net-dns/bind-dns-keygen - ${LDFLAGS} ignored, * net-dns/tinystats - ${LDFLAGS} after '-o', * net-fs/mount-cifs - ${LDFLAGS} ignored, * net-fs/samba-client, * net-im/bitlbee - ${LDFLAGS} ignored, * net-irc/ircd-hybrid - ${LDFLAGS} ignored, * net-mail/qmailanalog - ${LDFLAGS} ignored, '-o' after sources, * net-misc/connect, * net-misc/{datapipe,getdate} - ${LDFLAGS} ignored, * net-misc/ifenslave, * net-print/cups-pdf - ${LDFLAGS} ignored, * net-print/poster - ${LDFLAGS} ignored, '-o' after libs, * sci-biology/consed - ${LDFLAGS} ignored, '-o' after sources, * sci-chemistry/imosflm - separate compiling and linking, einfo printing, * sci-libs/ufconfig - separate compiling and linking, * sys-apps/netboot-base - ${LDFLAGS} ignored, * sys-apps/usb_modeswitch, * sys-apps/util-linux - (configure-like check), * sys-block/lsiutil, * sys-devel/gcc-config, * x11-libs/gl2ps - separate compiling and linking, * x11-misc/blockdpy, * x11-misc/xidle - echoing, using eval. And that's all for gentoo-x86 -- that's over 80 packages, with over 30 ignoring ${LDFLAGS}, not counting lesser issues. There's also 5 similar packages in Sunrise. I think that number is large enough to seriously consider adding such functions into toolchain-funcs.eclass. I'm attaching an example implementation (as a diff to toolchain-funcs.eclass) and a diff to a sample ebuild (zpaq-1.10.ebuild from Sunrise, in particular). Please notice that I'm not really attached to the calling syntax I used there, and I'm open to hear better ideas. I've decided to pass all additional arguments (flags) through environmental variables to allow user to intuitively supply long input file lists. -- Best regards, Michał Górny