hbmk2 improvement

175 views
Skip to first unread message

Алексей Запольский (alex;)

unread,
Aug 10, 2025, 4:11:25 AMAug 10
to Harbour Developers
Hello, clever guys. )) I don't know if it's critical.
F.e. SET HB_PLATFORM=android
SET HB_COMPILER=clang
--hbmk2.prg--       DO CASE
      CASE HBMK_ISPLAT( "dos|os2" )
         AAdd( aDf, "__LITTLE_ENDIAN__" )
         AAdd( aDf, "__ARCH32BIT__" )
      CASE HBMK_ISPLAT( "wce|win" )
         AAdd( aDf, "__LITTLE_ENDIAN__" ) /* Windows is currently little-endian on all supported CPUs. */
         IF hbmk[ _HBMK_cCOMP ] == "mingw64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvc64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvcarm64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "pocc64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvcia64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "iccia64"
            AAdd( aDf, "__ARCH64BIT__" )
         ELSE
            AAdd( aDf, "__ARCH32BIT__" )
         ENDIF
      OTHERWISE
         /* NOTE: Users will have to manually #define fitting macros for
                  given platform + compiler settings. We could only guess.
                  Let us assume the most probable CPU platform (as of 2009). */
         AAdd( aDf, "__LITTLE_ENDIAN__" )
         AAdd( aDf, "__ARCH32BIT__" )
      ENDCASE
--may be?--       DO CASE
      CASE HBMK_ISPLAT( "dos|os2" )
         AAdd( aDf, "__LITTLE_ENDIAN__" )
         AAdd( aDf, "__ARCH32BIT__" )
      CASE HBMK_ISPLAT( "wce|win" )
         AAdd( aDf, "__LITTLE_ENDIAN__" ) /* Windows is currently little-endian on all supported CPUs. */
         IF hbmk[ _HBMK_cCOMP ] == "mingw64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvc64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvcarm64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "pocc64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "msvcia64" .OR. ;
            hbmk[ _HBMK_cCOMP ] == "iccia64" .OR. ;
            "64" $ hbmk[ _HBMK_cCPU ]
           
            AAdd( aDf, "__ARCH64BIT__" )
         ELSE
            AAdd( aDf, "__ARCH32BIT__" )
         ENDIF
      OTHERWISE
         /* NOTE: Users will have to manually #define fitting macros for
                  given platform + compiler settings. We could only guess.
                  Let us assume the most probable CPU platform (as of 2009). */
         AAdd( aDf, "__LITTLE_ENDIAN__" )
         IF "64" $ hbmk[ _HBMK_cCPU ]
            AAdd( aDf, "__ARCH64BIT__" )
         ELSE
            AAdd( aDf, "__ARCH32BIT__" )
         ENDIF
      ENDCASE
---------------------------

WBR, alex;

Алексей Запольский (alex;)

unread,
Aug 10, 2025, 4:15:28 AMAug 10
to Harbour Developers
sorry forgot ))
and

SET HB_CPU=arm64

WBR alex;

воскресенье, 10 августа 2025 г. в 11:11:25 UTC+3, Алексей Запольский (alex;):

Алексей Запольский (alex;)

unread,
Aug 10, 2025, 3:57:47 PMAug 10
to Harbour Developers
And I had to redo config/linux.clang.mk.

воскресенье, 10 августа 2025 г. в 11:15:28 UTC+3, Алексей Запольский (alex;):
clang.mk

Алексей Запольский (alex;)

unread,
Sep 2, 2025, 6:03:22 PM (3 days ago) Sep 2
to Harbour Developers
Sorry, I think I made a mistake in  config/linux.clang.mk
need to check

WBR, alex;
воскресенье, 10 августа 2025 г. в 22:57:47 UTC+3, Алексей Запольский (alex;):

Aleksander Czajczynski

unread,
Sep 3, 2025, 10:33:44 AM (3 days ago) Sep 3
to harbou...@googlegroups.com
Hello!

It would help a bit if you tell what combination of compiler tools lack this definiton:
AAdd( aDf, "__ARCH64BIT__" )

Something like Right( hbmk[ _HBMK_cCPU ], 2 ) == "64" or hb_RightEq ( hbmk[ _HBMK_cCPU ], "64" ) may be sensible.

If you're redoing clang.mk for linux from windows template, for sure many parts are not needed, related to the linker, sh/cmd shell detection, (back)slash mangling, MSYSTEM, etc.

Best regards, Aleksander
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/d299882e-5c6b-41a5-ba64-b22e3c98e34cn%40googlegroups.com.

Алексей Запольский

unread,
Sep 3, 2025, 12:47:28 PM (2 days ago) Sep 3
to harbou...@googlegroups.com
Hello, Aleksander.
Thanks for responding.

These scripts are the result of two days of torment. )

It's need to be cleaned and put in order. But you can understand.   I was just glad that I got the result. 

Yes in clang.mkmigrated the logic to form __dyn__.tmp
clang -shared -L../../../../../lib/android/clang --target=aarch64-linux-androideabi24 -o ../../../../../lib/android/clang/libharbour.so @__dyn__.tmp -ldl -lm -llog -Wl,--out-implib,,--output-def,../../../../../lib/android/clang/libharbour.def

, but I messed up with the dynamic flags in if_else. Later I'll try to repeat the build process from the beginning. And I'll check it out.
WBR, alex;

ср, 3 сент. 2025 г. в 17:33, Aleksander Czajczynski <h...@fki.pl>:
You received this message because you are subscribed to a topic in the Google Groups "Harbour Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-devel/JlNuMjVzQWU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/68B851B9.80203%40fki.pl.

Алексей Запольский

unread,
Sep 3, 2025, 12:50:44 PM (2 days ago) Sep 3
to harbou...@googlegroups.com
And in android\clang.mk one string
include $(TOP)$(ROOT)config/linux/clang.mk


ср, 3 сент. 2025 г. в 19:47, Алексей Запольский <alexeyz...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages