Git.pm: assorted build related fixes.
- We passed our own *.a archives as LIBS to the submake that runs in perl/; separate LIBS and EXTLIBS and pass the latter which tells what the system libraries are used. - The quoting of preprocesor symbol definitions passed down to perl/ submake was loose and we lost double quotes around include directives. Use *_SQ to quote them properly. - The installation location of perl/ submake is not architecture neutral anymore, so use SITEARCH instead of SITELIB. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Petr Baudis committed
Jun 24, 2006 at 18:35 UTC
d595a473ee628d0f88989d06871d9752caafa7e9
3 files changed
+20
-13
Makefile
+17
-9
@@ -235,7 +235,7 @@ BUILTIN_OBJS = \
235
builtin-update-ref.o
236
237
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
238
-LIBS = $(GITLIBS) -lz
238
+EXTLIBS = -lz
239
240
#
241
# Platform specific tweaks
@@ -393,14 +393,14 @@ ifdef NEEDS_LIBICONV
393
else
394
ICONV_LINK =
395
endif
396
- LIBS += $(ICONV_LINK) -liconv
396
+ EXTLIBS += $(ICONV_LINK) -liconv
397
endif
398
ifdef NEEDS_SOCKET
399
- LIBS += -lsocket
399
+ EXTLIBS += -lsocket
400
SIMPLE_LIB += -lsocket
401
endif
402
ifdef NEEDS_NSL
403
- LIBS += -lnsl
403
+ EXTLIBS += -lnsl
404
SIMPLE_LIB += -lnsl
405
endif
406
ifdef NO_D_TYPE_IN_DIRENT
@@ -463,7 +463,7 @@ ifdef MOZILLA_SHA1
463
LIB_OBJS += mozilla-sha1/sha1.o
464
else
465
SHA1_HEADER = <openssl/sha.h>
466
- LIBS += $(LIB_4_CRYPTO)
466
+ EXTLIBS += $(LIB_4_CRYPTO)
467
endif
468
endif
469
endif
@@ -489,9 +489,13 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
489
PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
490
GIT_PYTHON_DIR_SQ = $(subst ','\'',$(GIT_PYTHON_DIR))
491
492
+LIBS = $(GITLIBS) $(EXTLIBS)
493
+
494
ALL_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS)
495
LIB_OBJS += $(COMPAT_OBJS)
496
export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
497
+
498
+
499
### Build rules
500
501
all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk
@@ -615,11 +619,15 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
619
rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS)
620
621
618
-perl/Makefile: perl/Git.pm perl/Makefile.PL
622
+PERL_DEFINE = $(ALL_CFLAGS) -DGIT_VERSION='"$(GIT_VERSION)"'
623
+PERL_DEFINE_SQ = $(subst ','\'',$(PERL_DEFINE))
624
+PERL_LIBS = $(EXTLIBS)
625
+PERL_LIBS_SQ = $(subst ','\'',$(PERL_LIBS))
626
+perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS
627
(cd perl && $(PERL_PATH) Makefile.PL \
620
- PREFIX="$(prefix)" \
621
- DEFINE="$(ALL_CFLAGS) -DGIT_VERSION=\\\"$(GIT_VERSION)\\\"" \
622
- LIBS="$(LIBS)")
628
+ PREFIX='$(prefix_SQ)' \
629
+ DEFINE='$(PERL_DEFINE_SQ)' \
630
+ LIBS='$(PERL_LIBS_SQ)')
631
632
doc:
633
$(MAKE) -C Documentation all
perl/Git.xs
+2
-3
@@ -29,7 +29,7 @@ report_xs(const char *prefix, const char *err, va_list params)
29
return buf;
30
}
31
32
-void
32
+static void NORETURN
33
die_xs(const char *err, va_list params)
34
{
35
char *str;
@@ -37,13 +37,12 @@ die_xs(const char *err, va_list params)
37
croak(str);
38
}
39
40
-int
40
+static void
41
error_xs(const char *err, va_list params)
42
{
43
char *str;
44
str = report_xs("error: ", err, params);
45
warn(str);
46
- return -1;
46
}
47
48
perl/Makefile.PL
+1
-1
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
3
sub MY::postamble {
4
return <<'MAKE_FRAG';
5
instlibdir:
6
- @echo $(INSTALLSITELIB)
6
+ @echo $(INSTALLSITEARCH)
7
8
MAKE_FRAG
9
}