Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 146258 Details for
Bug 211470
sys-power/acpid-1.0.6-r1 gives a battery-event about every 2 seconds when i'm on battery
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against acpid-1.0.6 to bring it to CVS 2007-11-25
acpid-1.0.6_p20071125.patch (text/plain), 19.82 KB, created by
Gautam Iyer
on 2008-03-16 01:02:18 UTC
(
hide
)
Description:
Patch against acpid-1.0.6 to bring it to CVS 2007-11-25
Filename:
MIME Type:
Creator:
Gautam Iyer
Created:
2008-03-16 01:02:18 UTC
Size:
19.82 KB
patch
obsolete
>diff -ruN --exclude CVS acpid-1.0.6/acpid.8 acpid-cvs/acpid.8 >--- acpid-1.0.6/acpid.8 2007-05-24 21:35:31.000000000 -0700 >+++ acpid-cvs/acpid.8 2007-11-24 21:30:03.000000000 -0800 >@@ -1,6 +1,6 @@ > .TH acpid 8 "" > .\" Portions Copyright (c) 2001 Sun Microsystems >-.\" Portions Copyright (c) Tim Hockin (thockin@hockin.org.com) >+.\" Portions Copyright (c) Tim Hockin (thockin@hockin.org) > .SH NAME > acpid \- Advanced Configuration and Power Interface event daemon > .SH SYNOPSIS >@@ -8,14 +8,14 @@ > > .SH DESCRIPTION > \fBacpid\fP is designed to notify user-space programs of ACPI events. >-\fBacpid\fP should be started during the system boot, and will run as a >-background process, by default. It will open an events file >-(\fI/proc/acpi/event\fP by default) and attempt to read whole lines. When >-a line is received (an \fIevent\fP), \fBacpid\fP will examine a list of rules, >-and execute the rules that match the event. >+\fBacpid\fP should be started during the system boot, and will run as a >+background process, by default. It will open an events file >+(\fI/proc/acpi/event\fP by default) and attempt to read whole lines. When >+a line is received (an \fIevent\fP), \fBacpid\fP will examine a list of rules, >+and execute the rules that match the event. > .PP > \fIRules\fP are defined by simple configuration files. \fBacpid\fP >-will look in a configuration directory (\fI/etc/acpi/events\fP by default), >+will look in a configuration directory (\fI/etc/acpi/events\fP by default), > and parse all files that do not begin with a period ('.'). Each file must > define two things: an \fIevent\fP and an \fIaction\fP. Any blank lines, or > lines where the first character is a pound sign ('#') are ignored. Extraneous >@@ -31,19 +31,19 @@ > include shell-special characters, and they will be preserved. The only special > characters in an action value are "%" escaped. The string "%e" will be > replaced by the literal text of the event for which the action was invoked. >-This string may contain spaces, so the commandline must take care to quote the "%e" if it wants a single token. The string "%%" will be replaced by a >-literal "%". All other "%" escapes are reserved, and will cause a rule to >+This string may contain spaces, so the commandline must take care to quote the "%e" if it wants a single token. The string "%%" will be replaced by a >+literal "%". All other "%" escapes are reserved, and will cause a rule to > not load. > .PP > This feature allows multiple rules to be defined for the same event (though no > ordering is guaranteed), as well as one rule to be defined for multiple events. > To force \fBacpid\fP to reload the rule configuration, send it a SIGHUP. > .PP >-In addition to rule files, \fBacpid\fP also accepts connections on a UNIX >-domain socket (\fI/var/run/acpid.socket\fP by default). Any application may >-connect to this socket. Once connected, \fBacpid\fP will send the text of >+In addition to rule files, \fBacpid\fP also accepts connections on a UNIX >+domain socket (\fI/var/run/acpid.socket\fP by default). Any application may >+connect to this socket. Once connected, \fBacpid\fP will send the text of > all ACPI events to the client. The client has the responsibility of filtering >-for messages about which it cares. \fBacpid\fP will not close the client >+for messages about which it cares. \fBacpid\fP will not close the client > socket except in the case of a SIGHUP or \fBacpid\fP exiting. > .PP > .B acpid >@@ -54,7 +54,7 @@ > .SH OPTIONS > .TP 12 > .BI \-c "\fR, \fP" \--confdir " directory" >-This option changes the directory in which \fBacpid\fP looks for rule >+This option changes the directory in which \fBacpid\fP looks for rule > configuration files. Default is \fI/etc/acpi/events\fP. > .TP 12 > .BI \-d "\fR, \fP" \--debug >@@ -69,9 +69,11 @@ > .BI \-f "\fR, \fP" \--foreground > This option keeps \fBacpid\fP in the foreground by not forking at startup. > .TP >+.BI \-l "\fR, \fP" \--logevents >+This option tells \fBacpid\fP to log information about all events and actions. > .TP > .BI \-g "\fR, \fP" \--socketgroup " groupname" >-This option changes the group ownership of the UNIX domain socket to which >+This option changes the group ownership of the UNIX domain socket to which > \fBacpid\fP publishes events. > .TP > .BI \-m "\fR, \fP" \--socketmode " mode" >@@ -83,9 +85,14 @@ > Default is \fI/var/run/acpid.socket\fP. > .TP > .BI \-S "\fR, \fP" \--nosocket " filename" >-This option tells \fBacpid\fP not to open a UNIX domain socket. This >+This option tells \fBacpid\fP not to open a UNIX domain socket. This > overrides the \fI-s\fP option, and negates all other socket options. > .TP >+.BI \-p "\fR, \fP" \--pidfile " filename" >+This option tells \fBacpid\fP to use the specified file as it's pidfile. If >+the file exists, it will be removed and over-written. >+Default is \fI/var/run/acpid.pid\fP. >+.TP > .BI \-v "\fR, \fP" \--version > Print version information and exit. > .TP >@@ -101,7 +108,7 @@ > action=/usr/local/sbin/power.sh "%e" > .PP > The script power.sh gets called and will see the complete event string >-as parameter $1. >+as parameter $1. > .SH DEPENDENCIES > \fBacpid\fP should work on any linux kernel released since 2003. > .SH FILES >@@ -112,6 +119,8 @@ > .br > .B /var/run/acpid.socket > .br >+.B /var/run/acpid.pid >+.br > .PD > .SH BUGS > There are no known bugs. To file bug reports, see \fBAUTHORS\fP below. >diff -ruN --exclude CVS acpid-1.0.6/acpid.c acpid-cvs/acpid.c >--- acpid-1.0.6/acpid.c 2007-05-24 21:19:23.000000000 -0700 >+++ acpid-cvs/acpid.c 2007-11-24 21:50:50.000000000 -0800 >@@ -42,6 +42,7 @@ > static void close_fds(void); > static int daemonize(void); > static int open_log(void); >+static int create_pidfile(void); > static void clean_exit(int sig); > static void reload_conf(int sig); > static char *read_line(int fd); >@@ -49,14 +50,18 @@ > /* global debug level */ > int acpid_debug; > >+/* do we log event info? */ >+int logevents; >+ > static const char *progname; >-static const char *confdir = ACPI_CONFDIR; >-static const char *eventfile = ACPI_EVENTFILE; >-static const char *socketfile = ACPI_SOCKETFILE; >+static const char *confdir = ACPID_CONFDIR; >+static const char *eventfile = ACPID_EVENTFILE; >+static const char *socketfile = ACPID_SOCKETFILE; > static int nosocket; > static const char *socketgroup; >-static mode_t socketmode = ACPI_SOCKETMODE; >+static mode_t socketmode = ACPID_SOCKETMODE; > static int foreground; >+static const char *pidfile = ACPID_PIDFILE; > > int > main(int argc, char **argv) >@@ -168,9 +173,18 @@ > signal(SIGPIPE, SIG_IGN); > > /* read in our configuration */ >- acpid_read_conf(confdir); >+ if (acpid_read_conf(confdir)) { >+ exit(EXIT_FAILURE); >+ } >+ >+ /* create our pidfile */ >+ if (create_pidfile() < 0) { >+ exit(EXIT_FAILURE); >+ } > > /* main loop */ >+ acpid_log(LOG_INFO, "waiting for events: event logging is %s\n", >+ logevents ? "on" : "off"); > while (1) { > struct pollfd ar[2]; > int r; >@@ -205,18 +219,22 @@ > /* read and handle an event */ > event = read_line(event_fd); > if (event) { >- acpid_log(LOG_INFO, >- "received event \"%s\"\n", event); >+ if (logevents) { >+ acpid_log(LOG_INFO, >+ "received event \"%s\"\n", event); >+ } > acpid_handle_event(event); >- acpid_log(LOG_INFO, >- "completed event \"%s\"\n", event); >+ if (logevents) { >+ acpid_log(LOG_INFO, >+ "completed event \"%s\"\n", event); >+ } > } else if (errno == EPIPE) { > acpid_log(LOG_WARNING, > "events file connection closed\n"); > break; > } else { > static int nerrs; >- if (++nerrs >= ACPI_MAX_ERRS) { >+ if (++nerrs >= ACPID_MAX_ERRS) { > acpid_log(LOG_ERR, > "too many errors reading " > "events file - aborting\n"); >@@ -246,6 +264,7 @@ > strerror(errno)); > continue; > } >+ fcntl(cli_fd, F_SETFD, FD_CLOEXEC); > snprintf(buf, sizeof(buf)-1, "%d[%d:%d]", > creds.pid, creds.uid, creds.gid); > acpid_add_client(cli_fd, buf); >@@ -268,10 +287,12 @@ > {"debug", 0, 0, 'd'}, > {"eventfile", 1, 0, 'e'}, > {"foreground", 0, 0, 'f'}, >+ {"logevents", 0, 0, 'l'}, > {"socketgroup", 1, 0, 'g'}, > {"socketmode", 1, 0, 'm'}, > {"socketfile", 1, 0, 's'}, > {"nosocket", 1, 0, 'S'}, >+ {"pidfile", 1, 0, 'p'}, > {"version", 0, 0, 'v'}, > {"help", 0, 0, 'h'}, > {NULL, 0, 0, 0}, >@@ -281,10 +302,12 @@ > "Increase debugging level (implies -f).",/* debug */ > "Use the specified file for events.", /* eventfile */ > "Run in the foreground.", /* foreground */ >+ "Log all event activity.", /* logevents */ > "Set the group on the socket file.", /* socketgroup */ > "Set the permissions on the socket file.",/* socketmode */ > "Use the specified socket file.", /* socketfile */ > "Do not listen on a UNIX socket (overrides -s).",/* nosocket */ >+ "Use the specified PID file.", /* pidfile */ > "Print version information.", /* version */ > "Print this message.", /* help */ > }; >@@ -294,7 +317,8 @@ > > for (;;) { > int i; >- i = getopt_long(*argc, *argv, "c:de:fg:m:s:Svh", opts, NULL); >+ i = getopt_long(*argc, *argv, >+ "c:de:flg:m:s:Sp:vh", opts, NULL); > if (i == -1) { > break; > } >@@ -312,6 +336,9 @@ > case 'f': > foreground = 1; > break; >+ case 'l': >+ logevents = 1; >+ break; > case 'g': > socketgroup = optarg; > break; >@@ -324,6 +351,9 @@ > case 'S': > nosocket = 1; > break; >+ case 'p': >+ pidfile = optarg; >+ break; > case 'v': > printf(PACKAGE "-" VERSION "\n"); > exit(EXIT_SUCCESS); >@@ -399,7 +429,7 @@ > int log_opts; > > /* open /dev/null */ >- nullfd = open("/dev/null", O_RDONLY, 0640); >+ nullfd = open("/dev/null", O_RDONLY); > if (nullfd < 0) { > fprintf(stderr, "%s: can't open %s: %s\n", progname, > "/dev/null", strerror(errno)); >@@ -431,23 +461,57 @@ > return 0; > } > >+static int >+create_pidfile(void) >+{ >+ int fd; >+ >+ /* JIC */ >+ unlink(pidfile); >+ >+ /* open the pidfile */ >+ fd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0644); >+ if (fd >= 0) { >+ FILE *f; >+ >+ /* write our pid to it */ >+ f = fdopen(fd, "w"); >+ if (f != NULL) { >+ fprintf(f, "%d\n", getpid()); >+ fclose(f); >+ /* leave the fd open */ >+ return 0; >+ } >+ close(fd); >+ } >+ >+ /* something went wrong */ >+ acpid_log(LOG_ERR, "can't create pidfile %s: %s\n", >+ pidfile, strerror(errno)); >+ return -1; >+} >+ > static void >-clean_exit(int sig) >+clean_exit(int sig __attribute__((unused))) > { > acpid_cleanup_rules(1); > acpid_log(LOG_NOTICE, "exiting\n"); >+ unlink(pidfile); > exit(EXIT_SUCCESS); > } > > static void >-reload_conf(int sig) >+reload_conf(int sig __attribute__((unused))) > { > acpid_log(LOG_NOTICE, "reloading configuration\n"); > acpid_cleanup_rules(0); > acpid_read_conf(confdir); > } > >-int >+int >+#ifdef __GNUC__ >+__attribute__((format(printf, 2, 3))) >+#endif > acpid_log(int level, const char *fmt, ...) > { > va_list args; >diff -ruN --exclude CVS acpid-1.0.6/acpid.h acpid-cvs/acpid.h >--- acpid-1.0.6/acpid.h 2007-05-23 23:33:33.000000000 -0700 >+++ acpid-cvs/acpid.h 2007-11-24 21:30:04.000000000 -0800 >@@ -30,11 +30,12 @@ > #include <sys/stat.h> > > #define ACPI_PROCDIR "/proc/acpi" >-#define ACPI_EVENTFILE ACPI_PROCDIR "/event" >-#define ACPI_CONFDIR "/etc/acpi/events" >-#define ACPI_SOCKETFILE "/var/run/acpid.socket" >-#define ACPI_SOCKETMODE 0666 >-#define ACPI_MAX_ERRS 5 >+#define ACPID_EVENTFILE ACPI_PROCDIR "/event" >+#define ACPID_CONFDIR "/etc/acpi/events" >+#define ACPID_SOCKETFILE "/var/run/acpid.socket" >+#define ACPID_SOCKETMODE 0666 >+#define ACPID_PIDFILE "/var/run/acpid.pid" >+#define ACPID_MAX_ERRS 5 > > #define PACKAGE "acpid" > >@@ -42,6 +43,7 @@ > * acpid.c > */ > extern int acpid_debug; >+extern int logevents; > extern int acpid_log(int level, const char *fmt, ...); > > /* >diff -ruN --exclude CVS acpid-1.0.6/acpi_listen.c acpid-cvs/acpi_listen.c >--- acpid-1.0.6/acpi_listen.c 2007-01-16 23:57:51.000000000 -0800 >+++ acpid-cvs/acpi_listen.c 2007-11-24 21:30:03.000000000 -0800 >@@ -43,11 +43,11 @@ > static char *read_line(int fd); > > static const char *progname; >-static const char *socketfile = ACPI_SOCKETFILE; >+static const char *socketfile = ACPID_SOCKETFILE; > static int max_events; > > static void >-time_expired(int signum) >+time_expired(int signum __attribute__((unused))) > { > exit(EXIT_SUCCESS); > } >@@ -94,7 +94,7 @@ > break; > } else { > static int nerrs; >- if (++nerrs >= ACPI_MAX_ERRS) { >+ if (++nerrs >= ACPID_MAX_ERRS) { > fprintf(stderr, "too many errors - aborting\n"); > ret = 1; > break; >diff -ruN --exclude CVS acpid-1.0.6/Changelog acpid-cvs/Changelog >--- acpid-1.0.6/Changelog 2007-06-30 12:17:22.000000000 -0700 >+++ acpid-cvs/Changelog 2007-11-24 21:50:50.000000000 -0800 >@@ -1,4 +1,29 @@ > %changelog >+* Sat Nov 24 2007 Tim Hockin <thockin@hockin.org> >+ - Build with -O2 flag (Makefile). >+ - Add -l (--logevents) option to enable logging of all events. Due to a >+ number of reports of log flooding (bad ACPI BIOS?) The new default is to >+ NOT log events. (acpid.c acpid.h event.h acpid.8) >+ - Add pidfile support and a -p (--pidfile) option to change the pidfile. >+ Default is /var/run/acpid.pid. (acpid.c acpid.8) (Javier Pello >+ <jpello@users.sourceforge.net>) >+ - Rename ACPI_* constants to ACPID_*. (acpid.c acpi_listen.c) >+ - Remove a bad cast of malloc()'s return value. (event.c) >+ - Add proper make dependencies. (Makefile) >+ - Close client file descriptors on exec(). (acpid.c) (Zdenek Prikryl >+ <zprikryl@redhat.com>) >+ >+* Mon Sep 24 2007 Tim Hockin <thockin@hockin.org> >+ - Don't use a mode argument on open("/dev/null") (acpid.c) (Steve Grubb >+ <sgrubb@redhat.com>) >+ - Use GCC "__attribute__((format(printf)))" for acpid_log (acpid.c) (Steve >+ Grubb <sgrubb@redhat.com>) >+ - Fix a shadowed variable name (event.c) (Steve Grubb <sgrubb@redhat.com>) >+ - Fix a leaked fd on error (event.c) (Steve Grubb <sgrubb@redhat.com>) >+ - Fix a signed/unsigned comparison (event.c) (Steve Grubb >+ <sgrubb@redhat.com>) >+ - Compile with more warnings (Makefile) (Steve Grubb <sgrubb@redhat.com>) >+ > * Sat June 30 2007 Tim Hockin <thockin@hockin.org> > - Bump version to 1.0.6 for release. > >diff -ruN --exclude CVS acpid-1.0.6/.cvsignore acpid-cvs/.cvsignore >--- acpid-1.0.6/.cvsignore 1969-12-31 16:00:00.000000000 -0800 >+++ acpid-cvs/.cvsignore 2003-11-24 11:09:30.000000000 -0800 >@@ -0,0 +1,2 @@ >+acpid >+acpi_listen >diff -ruN --exclude CVS acpid-1.0.6/event.c acpid-cvs/event.c >--- acpid-1.0.6/event.c 2007-05-24 21:26:09.000000000 -0700 >+++ acpid-cvs/event.c 2007-11-24 21:30:04.000000000 -0800 >@@ -131,7 +131,7 @@ > > len += strlen(confdir) + 2; > >- file = (char *)malloc(len); >+ file = malloc(len); > if (!file) { > acpid_log(LOG_ERR, "malloc(): %s\n", strerror(errno)); > unlock_rules(); >@@ -282,9 +282,9 @@ > } > rv = regcomp(r->event, val, RULE_REGEX_FLAGS); > if (rv) { >- char buf[128]; >- regerror(rv, r->event, buf, sizeof(buf)); >- acpid_log(LOG_ERR, "regcomp(): %s\n", buf); >+ char rbuf[128]; >+ regerror(rv, r->event, rbuf, sizeof(rbuf)); >+ acpid_log(LOG_ERR, "regcomp(): %s\n", rbuf); > free_rule(r); > fclose(fp); > return NULL; >@@ -318,6 +318,7 @@ > file); > } > free_rule(r); >+ fclose(fp); > return NULL; > } > fclose(fp); >@@ -476,7 +477,7 @@ > struct rule *pnext = p->next; > if (!regexec(p->event, event, 0, NULL, 0)) { > /* a match! */ >- if (acpid_debug) { >+ if (acpid_debug && logevents) { > acpid_log(LOG_DEBUG, > "rule from %s matched\n", > p->origin); >@@ -492,7 +493,7 @@ > p->type); > } > } else { >- if (acpid_debug >= 3) { >+ if (acpid_debug >= 3 && logevents) { > acpid_log(LOG_DEBUG, > "rule from %s did not match\n", > p->origin); >@@ -504,7 +505,7 @@ > > unlock_rules(); > >- if (acpid_debug) { >+ if (acpid_debug && logevents) { > acpid_log(LOG_DEBUG, "%d total rule%s matched\n", > nrules, (nrules == 1)?"":"s"); > } >@@ -564,7 +565,10 @@ > case 0: /* child */ > /* parse the commandline, doing any substitutions needed */ > action = parse_cmd(rule->action.cmd, event); >- acpid_log(LOG_INFO, "executing action \"%s\"\n", action); >+ if (logevents) { >+ acpid_log(LOG_INFO, >+ "executing action \"%s\"\n", action); >+ } > > /* reset signals */ > signal(SIGHUP, SIG_DFL); >@@ -574,8 +578,9 @@ > signal(SIGPIPE, SIG_DFL); > sigprocmask(SIG_UNBLOCK, signals_handled(), NULL); > >- if (acpid_debug) >+ if (acpid_debug && logevents) { > fprintf(stdout, "BEGIN HANDLER MESSAGES\n"); >+ } > execl("/bin/sh", "/bin/sh", "-c", action, NULL); > /* should not get here */ > acpid_log(LOG_ERR, "execl(): %s\n", strerror(errno)); >@@ -584,17 +589,21 @@ > > /* parent */ > waitpid(pid, &status, 0); >- if (acpid_debug) >+ if (acpid_debug && logevents) { > fprintf(stdout, "END HANDLER MESSAGES\n"); >- if (WIFEXITED(status)) { >- acpid_log(LOG_INFO, "action exited with status %d\n", >- WEXITSTATUS(status)); >- } else if (WIFSIGNALED(status)) { >- acpid_log(LOG_INFO, "action exited on signal %d\n", >- WTERMSIG(status)); >- } else { >- acpid_log(LOG_INFO, "action exited with status %d\n", >- status); >+ } >+ >+ if (logevents) { >+ if (WIFEXITED(status)) { >+ acpid_log(LOG_INFO, "action exited with status %d\n", >+ WEXITSTATUS(status)); >+ } else if (WIFSIGNALED(status)) { >+ acpid_log(LOG_INFO, "action exited on signal %d\n", >+ WTERMSIG(status)); >+ } else { >+ acpid_log(LOG_INFO, "action exited with status %d\n", >+ status); >+ } > } > > return 0; >@@ -606,12 +615,15 @@ > int r; > int client = rule->action.fd; > >- acpid_log(LOG_INFO, "notifying client %s\n", rule->origin); >+ if (logevents) { >+ acpid_log(LOG_INFO, "notifying client %s\n", rule->origin); >+ } > > r = safe_write(client, event, strlen(event)); > if (r < 0 && errno == EPIPE) { > /* closed */ >- acpid_log(LOG_NOTICE, "client has disconnected\n"); >+ acpid_log(LOG_NOTICE, >+ "client %s has disconnected\n", rule->origin); > delist_rule(&client_list, rule); > close(rule->action.fd); > free_rule(rule); >@@ -660,7 +672,7 @@ > parse_cmd(const char *cmd, const char *event) > { > static char buf[4096]; >- int i; >+ size_t i; > const char *p; > > p = cmd; >@@ -672,7 +684,7 @@ > p++; > if (*p == 'e') { > /* handle an event expansion */ >- int size = sizeof(buf) - i; >+ size_t size = sizeof(buf) - i; > size = snprintf(buf+i, size, "%s", event); > i += size; > p++; >diff -ruN --exclude CVS acpid-1.0.6/Makefile acpid-cvs/Makefile >--- acpid-1.0.6/Makefile 2007-06-30 12:15:45.000000000 -0700 >+++ acpid-cvs/Makefile 2007-11-24 21:38:55.000000000 -0800 >@@ -1,7 +1,7 @@ > # Makefile for ACPI daemon > > # update these numbers for new releases >-VERSION = 1.0.6 >+VERSION = 1.0.7b1 > > INSTPREFIX = > BINDIR = $(INSTPREFIX)/usr/bin >@@ -18,10 +18,12 @@ > acpi_listen_SRCS = acpi_listen.c ud_socket.c > acpi_listen_OBJS = $(acpi_listen_SRCS:.c=.o) > >+all_SRCS = $(acpid_SRCS) $(acpi_listen_SRCS) >+ > MAN8 = acpid.8 acpi_listen.8 > MAN8GZ = $(MAN8:.8=.8.gz) > >-CFLAGS = -Wall -Werror -g $(DEFS) >+CFLAGS = -W -Wall -Werror -Wundef -Wshadow -O2 -g $(DEFS) > DEFS = -DVERSION="\"$(VERSION)\"" > > all: $(PROGS) >@@ -52,5 +54,32 @@ > rm -rf $(DISTTMP)/acpid-$(VERSION) > > clean: >- $(RM) $(PROGS) $(MAN8GZ) *.o >+ $(RM) $(PROGS) $(MAN8GZ) *.o .depend > >+dep depend: >+ @$(RM) .depend >+ @$(MAKE) .depend >+ >+.depend: $(all_SRCS) >+ @for f in $^; do \ >+ OBJ=$$(echo $$f | sed 's/\.cp*$$/.o/'); \ >+ $(CPP) $(PP_INCLUDES) -MM $$f -MT $$OBJ; \ >+ done > $@ >+ >+# NOTE: 'sinclude' is "silent-include". This suppresses a warning if >+# .depend does not exist. Since Makefile includes this file, and this >+# file includes .depend, .depend is itself "a makefile" and Makefile is >+# dependent on it. Any makefile for which there is a rule (as above for >+# .depend) will be evaluated before anything else. If the rule executes >+# and the makefile is updated, make will reload the original Makefile and >+# start over. >+# >+# This means that the .depend rule will always be checked first. If >+# .depend gets rebuilt, then the dependencies we have already sincluded >+# must have been stale. Make starts over, the old dependencies are >+# tossed, and the new dependencies are sincluded. >+# >+# So why use 'sinclude' instead of 'include'? We want to ALWAYS make >+# Makefile depend on .depend, even if .depend doesn't exist yet. But we >+# don't want that pesky warning. >+sinclude .depend
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211470
:
146178
|
146179
| 146258 |
146260