Viktor, Maurilio, Przemek:

Thanks for comments

> IMHO it will be good to create doc/os2howto.txt file to collect
>such information as David presented because it may be very useful in
>some farther developing saving the time.

>For beta tools and other non-mature / experimental stuff,
>doc/howtoos2.txt is fine.

I am not agree for "doc/os2howto.txt" and/or "doc/howtoos2.txt"
All these info can be included in INSTALL. Just comments about options of library type.

gcc346, 404, 432, 433, 44 are not exactly non-mature or beta as Maurilio stated Paul Smedley and others, working many months just found the good-way, tips and tricks to port these gcc versions, and many systems/programs are build with them now

So are as stable as gcc335 found in netlabs, where are many versions too

I consider important to add gcc4xx to Harbour because it left many tricks we have used for gcc335 (at least Przemek, along history, has made that adjustments for os2-gcc335 when Harbour does not build in my machine)

So OS/2 can be in the "main-stream" for gcc. Allmost rest of OS supported by Harbour are using newer gcc than 335

At last my proposal is simple: to add support of OMF type to os2-gcc-Harbour, so it can work with gcc335 and/or gcc4xx

I send summary of changes for OMF type support BEFORE any changes to gcc.mk commented by Przemek, Maurilio to delete "tricks" used due older make. Perhaps some of that tricks should be used for gcc4xx

If we do not add support now we may be blocking/complicating a future work to include it


The main change is replacement of create_library:
----------------------------
Replacement of define create_library (emxomfar.exe work different):
define create_library
    $(if $(wildcard $(subst /,$(DIRSEP),$(LIB_FILE))),@$(RM) $(subst
/,$(DIRSEP),$(LIB_FILE)),)
    for %i in ( *$(OBJ_EXT) ) do $(AR) $(ARFLAGS) $(HB_USER_AFLAGS)
-p128 r $(LIB_DIR)/$@ %i$(ECHOQUOTE)
endef
----------------------------

because I explained that emxomfar.exe work in a file-basis (one file at a time). Details are in original message "Harbour under OS/2 - eCS gcc", 17 August 2009

In .dll creation seem to exist a similar case


Do you have some comment/suggestion/action for my proposal ?
--------------------------
My proposal is to use and environmental variable to choose code in
gcc.mk and hbmk2.prg
Something like HB_OS2_TCP32 which was included to choose "tcp/ip stack"
in OS/2
--------------------------

Perhaps
 HB_OS2_AOUT=yes if OMF is default
 HB_OS2_OMF=yes if a.out is default
I suggested OMF default because is common to gcc335, gcc4xx, and a.out is not able in gcc4xx due problem with emxbind
OpenWatcom use OMF too and OMF is "native" in OS/2


Updated info:

An Makefile for Python in OS/2 have something as:

------------------------------

# The output of the build is a largish Python26.DLL containing the
# essential modules of Python and a small Python.exe program to start
# the interpreter. When embedding Python within another program, only
# Python26.DLL is needed. We also build python_s.a static library (which
# can be converted into OMF (.lib) format using emxomf tool) and both
# python.a and python.lib import libraries.  Then the optional
# extension modules, which are OS/2 DLLs renamed with a PYD file extension.
[...]

# We're using the OMF format since EMX's ld has a obscure bug
# because of which it sometimes fails to build relocations
# in .data segment that point to another .data locations
# (except for the final linking if the .EXEs)
OMF=            yes

[...]

# File extensions
MODULE.EXT=     .pyd
MODLIB.EXT=     .dll
ifeq ($(OMF),yes)
  O=            .obj
  A=            .lib
  AR=           emxomfar
  CFLAGS+=      -Zomf
  LDFLAGS+=     -Zomf
  ifeq ($(MODE),debug)
    ARFLAGS=    -p64 crs
  else
    ARFLAGS=    -p32 crs
  endif
else
  O=            .o
  A=            .a
  AR=           ar
endif

[...]

ifeq ($(EXEOMF),yes)
  PYTHON.EXEIMP=        $(PYTHON.IMPLIB)
  LDMODE.EXE=           -Zomf
else
  PYTHON.EXEIMP=        $(PYTHON_LIB).a
  LDMODE.EXE =
endif
PYTHON.DLL=     $(PYTHON_LIB).dll
PYTHON.DEF=     $(PYTHON_LIB).def

[...]

$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
$(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
        $(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES)

------------------------------


David Macias


_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to