shell: do not play duplicated definition games to shrink the executable
Playing with linker games to shrink git-shell did not go well with various other platforms and compilers. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 19, 2008 at 18:05 UTC
4cfc24afc9ffa4d3f1623be8990eea118e82d4fd
2 files changed
+1
-16
Makefile
+1
-8
@@ -333,7 +333,6 @@ endif
333
export PERL_PATH
334
335
LIB_FILE=libgit.a
336
-COMPAT_LIB = compat/lib.a
336
XDIFF_LIB=xdiff/lib.a
337
338
LIB_H += archive.h
@@ -1223,12 +1222,6 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
1222
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1223
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1224
1226
-$(COMPAT_LIB): $(COMPAT_OBJS)
1227
- $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(COMPAT_OBJS)
1228
-
1229
-git-shell$X: abspath.o ctype.o exec_cmd.o quote.o strbuf.o usage.o wrapper.o shell.o $(COMPAT_LIB)
1230
- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(COMPAT_LIB)
1231
-
1225
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
1226
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
1227
builtin-revert.o wt-status.o: wt-status.h
@@ -1441,7 +1434,7 @@ distclean: clean
1434
1435
clean:
1436
$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
1444
- $(LIB_FILE) $(XDIFF_LIB) $(COMPAT_LIB)
1437
+ $(LIB_FILE) $(XDIFF_LIB)
1438
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
1439
$(RM) $(TEST_PROGRAMS)
1440
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
shell.c
-8
@@ -3,14 +3,6 @@
3
#include "exec_cmd.h"
4
#include "strbuf.h"
5
6
-/* Stubs for functions that make no sense for git-shell. These stubs
7
- * are provided here to avoid linking in external redundant modules.
8
- */
9
-void release_pack_memory(size_t need, int fd){}
10
-void trace_argv_printf(const char **argv, const char *fmt, ...){}
11
-void trace_printf(const char *fmt, ...){}
12
-
13
-
6
static int do_generic_cmd(const char *me, char *arg)
7
{
8
const char *my_argv[4];