From 331fa07679209d834bc93062dfdaee170cf7c103 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 8 Sep 2009 12:59:02 +0000 Subject: [PATCH] 2009-09-08 14:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/darwin/clang.mk + Added comment with option to force C++ mode with clang. * utils/hbmk2/hbmk2.prg + Added (not yet tested) darwin/clang support. Probably it could be added for other platforms, too. Also for GNU Make. clang cmdline is compatible with GCC for the most part, so it's easy to do and if the few differences can be sorted out, it can be done without duplicating .mk file logic. * config/darwin/gcc.mk - Disabled '-no-cpp-precomp' option for darwin/gcc. Most probably it's not needed anymore. For users using older darwin systems, this can be added manually. --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/config/darwin/clang.mk | 1 + harbour/config/darwin/gcc.mk | 2 +- harbour/utils/hbmk2/hbmk2.prg | 19 ++++++++++++------- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6d8395bd56..6d42bd3d71 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-08 14:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/darwin/clang.mk + + Added comment with option to force C++ mode with clang. + + * utils/hbmk2/hbmk2.prg + + Added (not yet tested) darwin/clang support. + Probably it could be added for other platforms, too. Also + for GNU Make. clang cmdline is compatible with GCC for the most + part, so it's easy to do and if the few differences can be sorted out, + it can be done without duplicating .mk file logic. + + * config/darwin/gcc.mk + - Disabled '-no-cpp-precomp' option for darwin/gcc. Most probably + it's not needed anymore. For users using older darwin systems, this + can be added manually. + 2009-09-08 14:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbsetup.h * config/darwin/clang.mk diff --git a/harbour/config/darwin/clang.mk b/harbour/config/darwin/clang.mk index 6214b4deef..e18b7d61cb 100644 --- a/harbour/config/darwin/clang.mk +++ b/harbour/config/darwin/clang.mk @@ -3,6 +3,7 @@ # ifeq ($(HB_BUILD_MODE),cpp) + # -ccc-clang-cxx HB_CMP := clang else HB_CMP := clang diff --git a/harbour/config/darwin/gcc.mk b/harbour/config/darwin/gcc.mk index 2c997fdd87..3bb686f9b2 100644 --- a/harbour/config/darwin/gcc.mk +++ b/harbour/config/darwin/gcc.mk @@ -23,7 +23,7 @@ CC_OUT := -o$(subst x,x, ) CPPFLAGS := -I. -I$(HB_INC_COMPILE) # -no-cpp-precomp prevents from using buggy precompiled headers -CPPFLAGS += -no-cpp-precomp +# CPPFLAGS += -no-cpp-precomp # -fno-common enables building .dylib files CFLAGS := -fno-common diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index eb371e7641..f46afcb8f5 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -871,7 +871,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) CASE hbmk[ _HBMK_cPLAT ] == "linux" aCOMPSUP := { "gcc", "watcom", "icc", "sunpro" } CASE hbmk[ _HBMK_cPLAT ] == "darwin" - aCOMPSUP := { "gcc", "icc" } + aCOMPSUP := { "gcc", "icc", "clang" } CASE hbmk[ _HBMK_cPLAT ] == "sunos" aCOMPSUP := { "gcc", "sunpro" } OTHERWISE @@ -2040,7 +2040,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ( hbmk[ _HBMK_cPLAT ] == "sunos" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; ( hbmk[ _HBMK_cPLAT ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; ( hbmk[ _HBMK_cPLAT ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ) .OR. ; - ( hbmk[ _HBMK_cPLAT ] == "darwin" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ) + ( hbmk[ _HBMK_cPLAT ] == "darwin" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ) .OR. ; + ( hbmk[ _HBMK_cPLAT ] == "darwin" .AND. hbmk[ _HBMK_cCOMP ] == "clang" ) nCmd_Esc := _ESC_NIX IF hbmk[ _HBMK_lDEBUG ] @@ -2061,12 +2062,16 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ENDIF cOpt_Lib := "{FA} rcs {OL} {LO}" ENDIF - IF hbmk[ _HBMK_cCOMP ] == "icc" + DO CASE + CASE hbmk[ _HBMK_cCOMP ] == "icc" cBin_CompC := iif( hbmk[ _HBMK_lCPP ] != NIL .AND. hbmk[ _HBMK_lCPP ], "icpc", "icc" ) AAdd( hbmk[ _HBMK_aOPTC ], "-D_GNU_SOURCE" ) - ELSE + CASE hbmk[ _HBMK_cCOMP ] == "clang" + cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + "clang" + hbmk[ _HBMK_cCCPOSTFIX ] + AAdd( hbmk[ _HBMK_aOPTC ], "-DHB_CC_CLANG" ) + OTHERWISE cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + iif( hbmk[ _HBMK_lCPP ] != NIL .AND. hbmk[ _HBMK_lCPP ], "g++", "gcc" ) + hbmk[ _HBMK_cCCPOSTFIX ] - ENDIF + ENDCASE cOpt_CompC := "-c" IF hbmk[ _HBMK_lOPTIM ] cOpt_CompC += " -O3" @@ -2103,7 +2108,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) AAdd( hbmk[ _HBMK_aOPTL ], "-static" ) ENDIF IF hbmk[ _HBMK_cPLAT ] == "darwin" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" - AAdd( hbmk[ _HBMK_aOPTC ], "-no-cpp-precomp" ) +/* AAdd( hbmk[ _HBMK_aOPTC ], "-no-cpp-precomp" ) */ /* AAdd( hbmk[ _HBMK_aOPTC ], "-Wno-long-double" ) */ IF hbmk[ _HBMK_lSHARED ] AAdd( hbmk[ _HBMK_aOPTL ], "-bind_at_load" ) @@ -6791,7 +6796,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) "",; I_( "Supported values for each supported value:" ),; " - linux : gcc, watcom, icc, sunpro",; - " - darwin : gcc, icc",; + " - darwin : gcc, icc, clang",; " - win : mingw, msvc, bcc, watcom, icc, pocc, cygwin, xcc,",; " - mingw64, msvc64, msvcia64, iccia64, pocc64",; " - wce : mingwarm, mingw, msvcarm, poccarm",;