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.
This commit is contained in:
Viktor Szakats
2009-09-08 12:59:02 +00:00
parent c304b78340
commit 331fa07679
4 changed files with 30 additions and 8 deletions

View File

@@ -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

View File

@@ -3,6 +3,7 @@
#
ifeq ($(HB_BUILD_MODE),cpp)
# -ccc-clang-cxx
HB_CMP := clang
else
HB_CMP := clang

View File

@@ -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

View File

@@ -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 <comp> values for each supported <plat> 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",;