Fix compilation with Sun CC
- 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>
This commit is contained in:
parent
d7b6c3c0f5
commit
60a144f280
6
Makefile
6
Makefile
@ -112,6 +112,7 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
|
|||||||
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
||||||
|
|
||||||
CFLAGS = -g -O2 -Wall
|
CFLAGS = -g -O2 -Wall
|
||||||
|
PIC_FLAG = -fPIC
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
ALL_CFLAGS = $(CFLAGS)
|
ALL_CFLAGS = $(CFLAGS)
|
||||||
ALL_LDFLAGS = $(LDFLAGS)
|
ALL_LDFLAGS = $(LDFLAGS)
|
||||||
@ -402,6 +403,9 @@ endif
|
|||||||
ifneq (,$(findstring arm,$(uname_M)))
|
ifneq (,$(findstring arm,$(uname_M)))
|
||||||
ARM_SHA1 = YesPlease
|
ARM_SHA1 = YesPlease
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(uname_M),sun4u)
|
||||||
|
USE_PIC = YesPlease
|
||||||
|
endif
|
||||||
ifeq ($(uname_M),x86_64)
|
ifeq ($(uname_M),x86_64)
|
||||||
USE_PIC = YesPlease
|
USE_PIC = YesPlease
|
||||||
endif
|
endif
|
||||||
@ -544,7 +548,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef USE_PIC
|
ifdef USE_PIC
|
||||||
ALL_CFLAGS += -fPIC
|
ALL_CFLAGS += $(PIC_FLAG)
|
||||||
endif
|
endif
|
||||||
ifdef NO_ACCURATE_DIFF
|
ifdef NO_ACCURATE_DIFF
|
||||||
BASIC_CFLAGS += -DNO_ACCURATE_DIFF
|
BASIC_CFLAGS += -DNO_ACCURATE_DIFF
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
PIC_FLAG = @PIC_FLAG@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
TAR = @TAR@
|
TAR = @TAR@
|
||||||
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
|
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
|
||||||
|
@ -95,7 +95,14 @@ AC_SUBST(PYTHON_PATH)
|
|||||||
## Checks for programs.
|
## Checks for programs.
|
||||||
AC_MSG_NOTICE([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_PROG_INSTALL # needs install-sh or install.sh in sources
|
||||||
AC_CHECK_TOOL(AR, ar, :)
|
AC_CHECK_TOOL(AR, ar, :)
|
||||||
AC_CHECK_PROGS(TAR, [gtar tar])
|
AC_CHECK_PROGS(TAR, [gtar tar])
|
||||||
|
Loading…
Reference in New Issue
Block a user