From 60a144f28047b4fa0e4a795972c483fa85a7d3c8 Mon Sep 17 00:00:00 2001 From: Dennis Stosberg Date: Tue, 15 Aug 2006 11:01:31 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 36f9cd94d8..0f93f6fe29 100644 --- a/configure.ac +++ b/configure.ac @@ -95,7 +95,14 @@ AC_SUBST(PYTHON_PATH) ## 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]) -- cgit v1.2.3 From f7661ce0b8ee068e53d57249625199dda2829e30 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 29 Sep 2006 00:34:51 -0700 Subject: Remove -fPIC which was only needed for Git.xs The distinction between BASIC_ vs ALL_ is still kept, since it is not Git.xs specific -- we could face the same issue when we do other language bindings (e.g. Python). Signed-off-by: Junio C Hamano --- configure.ac | 7 ------- 1 file changed, 7 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0f93f6fe29..819282691f 100644 --- a/configure.ac +++ b/configure.ac @@ -96,13 +96,6 @@ AC_SUBST(PYTHON_PATH) AC_MSG_NOTICE([CHECKS for programs]) # 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]) -- cgit v1.2.3