From: Roy Marples Date: Mon, 24 Mar 2008 20:09:30 +0000 (+0000) Subject: Add alternative building method to save around 500 bytes. X-Git-Tag: v4.0.2~536 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c39cf2100b087d1da5958af7f4f23927ea991b99;p=thirdparty%2Fdhcpcd.git Add alternative building method to save around 500 bytes. --- diff --git a/dhcp.h b/dhcp.h index e2c910c0..dbd57287 100644 --- a/dhcp.h +++ b/dhcp.h @@ -37,7 +37,9 @@ #include #include #include +#define __FAVOR_BSD /* Nasty hack so we can use BSD semantics for UDP */ #include +#undef __FAVOUR_BSD #include #include "dhcpcd.h" diff --git a/dhcpcd.c b/dhcpcd.c index 23372199..56865860 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -210,12 +210,12 @@ main(int argc, char **argv) case 'd': debug++; switch (debug) { - case 1: - setloglevel(LOG_DEBUG); - break; - case 2: - options->daemonise = false; - break; + case 1: + setloglevel(LOG_DEBUG); + break; + case 2: + options->daemonise = false; + break; } break; #ifdef THERE_IS_NO_FORK @@ -224,7 +224,7 @@ main(int argc, char **argv) close_fds(); break; case 'g': - dhcpcd_skiproutes = xstrdup (optarg); + dhcpcd_skiproutes = xstrdup(optarg); break; #endif case 'h': diff --git a/if.c b/if.c index 462afbec..fd4eaeff 100644 --- a/if.c +++ b/if.c @@ -488,6 +488,7 @@ log_route(struct in_addr destination, struct in_addr netmask, free(dstd); } + int add_address(const char *ifname, struct in_addr address, struct in_addr netmask, struct in_addr broadcast) diff --git a/logger.c b/logger.c index 6e976403..5e0bdb42 100644 --- a/logger.c +++ b/logger.c @@ -25,7 +25,9 @@ * SUCH DAMAGE. */ -#define SYSLOG_NAMES +#ifndef SYSLOG_NAMES +# define SYSLOG_NAMES +#endif #include #include diff --git a/mk/prog.mk b/mk/prog.mk index 6161bb55..85d544a9 100644 --- a/mk/prog.mk +++ b/mk/prog.mk @@ -17,6 +17,14 @@ all: ${PROG} ${MAN} ${PROG}: ${SCRIPTS} ${OBJS} ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} +# We could save about 500 bytes by building it like this +# instead of the more traditional method above +#${PROG}: ${SRCS} +# echo "" > _${PROG}.c +# for src in ${SRCS}; do echo "#include \"$$src\"" >> _${PROG}.c; done +# ${CC} ${CFLAGS} -DSYSLOG_NAMES -c _${PROG}.c -o _${PROG}.o +# ${CC} ${LDFLAGS} -o $@ _${PROG}.o ${LDADD} + _proginstall: ${PROG} ${INSTALL} -d ${DESTDIR}${BINDIR} ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR} @@ -28,7 +36,7 @@ include ${MK}/dist.mk install: _proginstall maninstall clean: - rm -f ${OBJS} ${PROG} ${CLEANFILES} + rm -f ${OBJS} ${PROG} _${PROG}.c _${PROG}.o ${CLEANFILES} LINTFLAGS?= -hx LINTFLAGS+= -X 159,247,352