? color.c ? cvs.diff ? flatten_depends.c Index: Makefile =================================================================== RCS file: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v retrieving revision 1.8 diff -u -b -B -w -p -r1.8 Makefile --- Makefile 9 Jun 2005 17:38:18 -0000 1.8 +++ Makefile 10 Jun 2005 00:24:03 -0000 @@ -18,12 +18,18 @@ # MA 02111-1307, USA. #################################################################### +check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ + then echo "$(1)"; else echo "$(2)"; fi) + #################################################### -WFLAGS := -Wall -Wextra -Wunused -Wimplicit -Wshadow -Wformat=2 \ +WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings \ -Wbad-function-cast -Wnested-externs -Wcomment -Wsequence-point \ - -Wdeclaration-after-statement -Wchar-subscripts -Wcast-align \ - -Winline -Wno-format-nonliteral + -Wchar-subscripts -Wcast-align -Winline -Wno-format-nonliteral + +# =gcc-3.3 does not support these options. +WFLAGS += $(call check_gcc, -Wdeclaration-after-statement -Wextra) + CFLAGS := -O2 -pipe #CFLAGS += -DEBUG -g #LDFLAGS := -pie @@ -47,7 +53,7 @@ MPAGES = man/q.1 all: q @: -debug: all symlinks +debug: symlinks @-/sbin/chpax -permsx $(APPLETS) @-/sbin/paxctl -permsx $(APPLETS) Index: main.c =================================================================== RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.c,v retrieving revision 1.8 diff -u -b -B -w -p -r1.8 main.c --- main.c 10 Jun 2005 00:08:43 -0000 1.8 +++ main.c 10 Jun 2005 00:24:03 -0000 @@ -73,9 +73,22 @@ static char *argv0; exit(EXIT_FAILURE); \ } while (0) #ifdef EBUG +#include + # define DBG(fmt, args...) warnf(fmt, ## args) +# define IF_DEBUG(x) x +void init_coredumps(void); +void init_coredumps(void) { + struct rlimit rl; + int val = 0; + val = RLIM_INFINITY; + rl.rlim_cur = val; + rl.rlim_max = val; + setrlimit(RLIMIT_CORE, &rl); +} #else # define DBG(fmt, args...) +# define IF_DEBUG(x) #endif @@ -417,6 +429,7 @@ void reinitialize_as_needed(void) int main(int argc, char **argv) { + IF_DEBUG(init_coredumps()); argv0 = argv[0]; initialize_portdir(); atexit(reinitialize_as_needed);