Hi Dan
On Thursday 10 November 2005 22:43, Dan Hatton wrote:
I mentioned this in passing in a thread last week, so apologies to anyone who's heard it before: I'd like idle-timer-based power management on my FC4 machine, but can't get sleepd 1.2.14 to compile. Can anyone suggest how to make it work, please?
FC4 - Hrmmm.. Doesn't that release ship with gcc-4. ?
The details:
If I point my CPATH at the apm.h and acpi.h files provided by my kernel, running "make" in the sleepd directory fails with the series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from sleepd.c:21: acpi.h:20: error: syntax error before ?apm_info? sleepd.c: In function ?main_loop?: sleepd.c:132: error: ?apm_info? undeclared (first use in this function)
Correct me if I'm wrong, but sleepd is a user space application, not a kernel module. Therefore, you should not be using includes from the kernel tree, only the ones from /usr/include/ (and any headers in the sleepd tarball).
whereas, if I point CPATH at the acpi.h and apm.h provided by sleepd, "make" fails with the slightly different series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from ./apm.h:1, from ./apm.h:1, [repeated _many_times] from sleepd.c:20: ./apm.h:1:17: error: #include nested too deeply In file included from sleepd.c:21: acpi.h:20: error: syntax error before ?apm_info? sleepd.c: In function ?main_loop?: sleepd.c:132: error: ?apm_info? undeclared (first use in this function) sleepd.c:132: error: (Each undeclared identifier is reported only once sleepd.c:132: error: for each function it appears in.) sleepd.c:132: error: syntax error before ?ai? sleepd.c:177: error: ?ai? undeclared (first use in this function) sleepd.c:179: warning: implicit declaration of function ?apm_read? sleepd.c: In function ?main?: sleepd.c:307: warning: implicit declaration of function ?apm_exists? make: *** [sleepd.o] Error 1
Something appears to be screwed here... Downloading and grepping the sleepd sources reveals a couple of problems that may cause "issues"... The first line in sleepd's apm.h reads "#include <apm.h>"... Do you have libapm-devel installed on your system ?
sleepd compiles out of the box on my Debian Testing machine, so it occurred to me to ftp the resulting binaries to where I want them. Unfortunately, once there, the sleepd binary refuses to run, with the error message
sleepd: error while loading shared libraries: libapm.so.1: cannot open shared object file: No such file or directory
Unless a binary is compiled and statically linked to the libraries, building on one system and running on another is a minefield of problems. IF both systems are using the same library versions (e.g. libc6-2.3.5 & libapm-3.2.2), you would probably find it works..
Gimme a shout after you have libapm-devel installed, and we can work on fixing any other problems.
Regards, Paul.