app-laptop/tp_smapi-0.31 fails to compile for two reasons: 1) its makefile modifies CFLAGS and is rejected by the kernel Makefile.build; see error message: /usr/src/linux-2.6.24-tuxonice-r4/scripts/Makefile.build:46: *** CFLAGS was changed in "/var/portage/portage/app-laptop/tp_smapi-0.31/work/tp_smapi-0.31/Makefile". Fix it to use EXTRA_CFLAGS. Stop. 2) the ebuild does not respect the setting of KBUILD_OUTPUT in make.conf; hence it cannot find the kernel configuration; see error message: Makefile:25: *** This driver requires kernel 2.6.15 or newer, and matching kernel headers.. Stop. the Makefile code that produces this error message is: ifneq ($(shell [ -f $(KSRC)/include/linux/platform_device.h ] && echo 1),1) $(error This driver requires kernel 2.6.15 or newer, and matching kernel headers.) endif Reproducible: Always Steps to Reproduce: 1. Set KBUILD_OUTPUT in /etc/make.conf 2. install kernel 2.6.24-tuxonice-r4 (although I suspect it would happen on any kernel) 3. emerge tp_smapi Actual Results: emerge fails when the tp_smapi makefile can't find platform_device.h, or when that error is fixed, emerge fails when the kernel Makefile.build detects that the tp_smapi makefile modified CFLAGS Expected Results: successful compilation of the tp_smapi modules the first error can be fixed by modifying line 34 of tp_smapi-0.31.ebuild to read: BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}" instead of the current: BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_DIR}" the second error can be fixed by adding the following line to the end of the src_unpack section in tp_smapi-0.31.ebuild: sed -i 's,CFLAGS := $(CFLAGS),EXTRA_CFLAGS :=,' Makefile patch attached # emerge --info Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-tuxonice-r4 i686) ================================================================= System uname: 2.6.24-tuxonice-r4 i686 Intel(R) Pentium(R) M processor 2.00GHz Timestamp of tree: Fri, 25 Apr 2008 16:04:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 3.2_p17-r1 dev-java/java-config: 1.3.7, 2.1.4 dev-lang/python: 2.4.4-r9 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/init.d /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe" DISTDIR="/var/portage/distfiles" FEATURES="buildpkg distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv" GENTOO_MIRRORS="http://gentoo.llarian.net/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo" LINGUAS="en zh_TW" MAKEOPTS="-j2" PKGDIR="/var/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/portage" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi adns alsa ao audiofile bash-completion berkdb bidi bluetooth branding bzip2 cairo cddb cdparanoia cdr cjk cli cracklib crypt cscope cups curl dbus dga directfb dri dts dvd dvdr dvdread eds emboss encode evo exif expat fam fbcon ffmpeg firefox flac foomaticdb fortran ftp gd gdbm ggi gif gimp gmp gnutls gphoto2 gpm graphviz gstreamer gtk gtkhtml hal iconv idn imagemagick imap imlib isdnlog java jbig jikes joystick jpeg jpeg2k kde kdeenablefinal kerberos lame lcms ldap libnotify libsamplerate lirc lm_sensors mad matroska midi mikmod mmap mmx mng mono mp3 mpeg mplayer mudflap musepack musicbrainz mysql ncurses nls nptl nptlonly nsplugin ogg openal openexr opengl openmp pam pango pcmcia pcre pdf perl plotutils png portaudio ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba sasl scanner sdl session slang slp sndfile snmp speex spell spl sse sse2 ssl startup-notification svg tcl tcpd theora threads tiff tk truetype unicode usb vcd vim-syntax vorbis win32codecs wmf wxwindows x264 x86 xcomposite xine xinerama xml xorg xosd xpm xprint xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en zh_TW" LIRC_DEVICES="sir" USERLAND="GNU" VIDEO_CARDS="fbdev radeon vesa" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 150960 [details, diff] fixes compilation errors similar simple patches could be applied to the other tp_smapi ebuilds
Created attachment 150964 [details, diff] fixes compilation errors for versions 0.31 through 0.37 versions 0.33 and 0.37 didn't need the EXTRA_CFLAGS patch. Patches for all for versions tested successfully on my machine.
Hi, I can't compile the build with your second patch. The error is: /var/tmp/portage/app-laptop/tp_smapi-0.37-r2/work/tp_smapi-0.37/thinkpad_ec.c:37:31: error: linux/thinkpad_ec.h: No such file or directory Please advise.
Created attachment 157201 [details] build.log with the error
ok, the correct patch should be: sed -i 's,EXTRA_CFLAGS := $(CFLAGS),EXTRA_CFLAGS :=,' Makefile the fixed ebuild is in the sectools overlay: http://gentoo.o0o.nu/sectools.xml or http://gentoo.o0o.nu/portage/app-laptop/tp_smapi/ Works for me.
*** Bug 238541 has been marked as a duplicate of this bug. ***
Created attachment 179731 [details, diff] fix for environments that have KBUILD_OUTPUT set The EXTRA_CFLAGS bug was different from what my patch originally addressed. The EXTRA_CFLAGS problem seems to have been fixed in .37 and .39, but there is still a compilation error when KBUILD_OUTPUT is set in make.conf since the ebuild does not correctly use the KV_OUT_DIR variable. The patch fixes this for versions 0.30 through 0.39.
I've also suggested to apply the same patch in the bug #254043 (0.40 version bump)
Please mark as "fixed" this bug report since bug #254043 with that patch is in the tree.
already fixed. closing. please move your votes. thanks.