summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7b6c3c)
raw | patch | inline | side by side (parent: d7b6c3c)
author | Dennis Stosberg <dennis@stosberg.net> | |
Tue, 15 Aug 2006 09:01:31 +0000 (11:01 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 15 Aug 2006 10:13:47 +0000 (03:13 -0700) |
- Add the CFLAGS variable to config.mak.in to override the Makefile's
default, which is gcc-specific and won't work with Sun CC.
- Prefer "cc" over "gcc", because Pasky's Git.pm will not compile with gcc
on Solaris at all. On Linux and the free BSDs "cc" is linked to "gcc"
anyway.
- Set correct flag to generate position-independent code.
- Add "-xO3" (= use default optimization level) to CFLAGS.
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
default, which is gcc-specific and won't work with Sun CC.
- Prefer "cc" over "gcc", because Pasky's Git.pm will not compile with gcc
on Solaris at all. On Linux and the free BSDs "cc" is linked to "gcc"
anyway.
- Set correct flag to generate position-independent code.
- Add "-xO3" (= use default optimization level) to CFLAGS.
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history | |
config.mak.in | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/Makefile b/Makefile
index ac42ae32bad42536da717810c77fa38901028e63..4e7a37aa3c27225a86b16566fb96dc94362cd0d6 100644 (file)
--- a/Makefile
+++ b/Makefile
# CFLAGS and LDFLAGS are for the users to override from the command line.
CFLAGS = -g -O2 -Wall
+PIC_FLAG = -fPIC
LDFLAGS =
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
ifneq (,$(findstring arm,$(uname_M)))
ARM_SHA1 = YesPlease
endif
+ifeq ($(uname_M),sun4u)
+ USE_PIC = YesPlease
+endif
ifeq ($(uname_M),x86_64)
USE_PIC = YesPlease
endif
endif
endif
ifdef USE_PIC
- ALL_CFLAGS += -fPIC
+ ALL_CFLAGS += $(PIC_FLAG)
endif
ifdef NO_ACCURATE_DIFF
BASIC_CFLAGS += -DNO_ACCURATE_DIFF
diff --git a/config.mak.in b/config.mak.in
index 369e6116e0aa63bc9e6ca88996b2dcfc12ebb967..addda4f16c243b6b4ce875a39909c95b2afe94db 100644 (file)
--- a/config.mak.in
+++ b/config.mak.in
# @configure_input@
CC = @CC@
+CFLAGS = @CFLAGS@
+PIC_FLAG = @PIC_FLAG@
AR = @AR@
TAR = @TAR@
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
diff --git a/configure.ac b/configure.ac
index 36f9cd94d847f1dc95d293ebafbab74cf37fec53..0f93f6fe2948f338167d3c019b0fba014eeba508 100644 (file)
--- a/configure.ac
+++ b/configure.ac
## Checks for programs.
AC_MSG_NOTICE([CHECKS for programs])
#
-AC_PROG_CC
+AC_PROG_CC([cc gcc])
+if test -n "$GCC"; then
+ PIC_FLAG="-fPIC"
+else
+ AC_CHECK_DECL(__SUNPRO_C, [CFLAGS="$CFLAGS -xO3"; PIC_FLAG="-KPIC"])
+fi
+AC_SUBST(PIC_FLAG)
+
#AC_PROG_INSTALL # needs install-sh or install.sh in sources
AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_PROGS(TAR, [gtar tar])