Perl interface: add build-time configuration to allow building with -fPIC
On x86-64 it seems that Git.xs does not link without compiling the main git objects with -fPIC. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jun 23, 2006 at 17:57 UTC
f6af75d29c7e01e1d538dc3458c743e1a34defb6
1 file changed
+13
-7
Makefile
+13
-7
@@ -1,11 +1,6 @@
1
# The default target of this Makefile is...
2
all:
3
4
-# Define MOZILLA_SHA1 environment variable when running make to make use of
5
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
6
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
7
-# choice) has very fast version optimized for i586.
8
-#
4
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
5
# This also implies MOZILLA_SHA1.
6
#
@@ -39,6 +34,14 @@ all:
34
# Define ARM_SHA1 environment variable when running make to make use of
35
# a bundled SHA1 routine optimized for ARM.
36
#
37
+# Define MOZILLA_SHA1 environment variable when running make to make use of
38
+# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
39
+# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
40
+# choice) has very fast version optimized for i586.
41
+#
42
+# Define USE_PIC if you need the main git objects to be built with -fPIC
43
+# in order to build and link perl/Git.so. x86-64 seems to need this.
44
+#
45
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
46
#
47
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
@@ -65,13 +68,13 @@ all:
68
# Define COLLISION_CHECK below if you believe that SHA1's
69
# 1461501637330902918203684832716283019655932542976 hashes do not give you
70
# sufficient guarantee that no collisions between objects will ever happen.
68
-
71
+#
72
# Define USE_NSEC below if you want git to care about sub-second file mtimes
73
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
74
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
75
# randomly break unless your underlying filesystem supports those sub-second
76
# times (my ext3 doesn't).
74
-
77
+#
78
# Define USE_STDEV below if you want git to care about the underlying device
79
# change being considered an inode change from the update-cache perspective.
80
@@ -464,6 +467,9 @@ else
467
endif
468
endif
469
endif
470
+ifdef USE_PIC
471
+ ALL_CFLAGS += -fPIC
472
+endif
473
ifdef NO_ACCURATE_DIFF
474
ALL_CFLAGS += -DNO_ACCURATE_DIFF
475
endif