Skip to content

Commit

Permalink
#i125501# build fixes for enabling Category B also in OS/2 port.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1621121 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Yuri Dario committed Aug 28, 2014
1 parent 4d340ee commit 1b8c19f
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 3 deletions.
90 changes: 90 additions & 0 deletions ext_libraries/coinmp/coinmp-1.6.0-os2.patch
@@ -0,0 +1,90 @@
--- misc/CoinMP-1.6.0/CoinUtils/src/CoinSignal.hpp 2014-08-27 13:57:26.000000000 +0200
+++ misc/build/CoinMP-1.6.0/CoinUtils/src/CoinSignal.hpp 2014-08-27 12:15:58.000000000 +0200
@@ -29,7 +29,7 @@

//-----------------------------------------------------------------------------

-#if defined(__CYGWIN__) && defined(__GNUC__)
+#if defined(__CYGWIN__) && defined(__GNUC__) || defined(__KLIBC__)
typedef typeof(SIG_DFL) CoinSighandler_t;
# define CoinSighandler_t_defined
#endif
--- misc/CoinMP-1.6.0/CoinUtils/src/CoinTime.hpp 2011-01-04 00:31:00.000000000 +0100
+++ misc/build/CoinMP-1.6.0/CoinUtils/src/CoinTime.hpp 2014-08-27 12:58:06.000000000 +0200
@@ -23,6 +23,9 @@
#include <sys/time.h>
#endif
#if !defined(__MSVCRT__)
+#ifdef __KLIBC__
+#include <sys/types.h>
+#endif
#include <sys/resource.h>
#endif
#endif
@@ -121,6 +124,12 @@
cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC);
#endif

+#elif defined(__KLIBC__)
+
+ unsigned int ticksnow; /* clock_t is same as int */
+ ticksnow = (unsigned int)clock();
+ cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC);
+
#else
struct rusage usage;
# ifdef ZEROFAULT
@@ -141,7 +150,7 @@
static inline double CoinSysTime()
{
double sys_temp;
-#if defined(_MSC_VER) || defined(__MSVCRT__)
+#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__KLIBC__)
sys_temp = 0.0;
#else
struct rusage usage;
@@ -161,7 +170,7 @@
static inline double CoinCpuTimeJustChildren()
{
double cpu_temp;
-#if defined(_MSC_VER) || defined(__MSVCRT__)
+#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__KLIBC__)
cpu_temp = 0.0;
#else
struct rusage usage;
--- misc/CoinMP-1.6.0/CoinMP/src/Makefile.in 2011-08-07 17:09:46.000000000 +0200
+++ misc/build/CoinMP-1.6.0/CoinMP/src/Makefile.in 2014-08-28 00:29:22.000000000 +0200
@@ -20,6 +20,10 @@

# Author: Andreas Waechter IBM 2006-04-13

+OS2_LA_NAME=CoinMP
+OS2_DLL_NAME=CoinMP
+OS2_DLL_OBJ=$(libCoinMP_la_OBJECTS:%.lo=%.o)
+OS2_DLL_LIBS=../../Cbc/src/.libs/CbcSolver.a ../../Cbc/src/.libs/Cbc.a ../../Cgl/src/.libs/Cgl.a ../../Clp/src/OsiClp/.libs/OsiClp.a ../../Clp/src/.libs/Clp.a ../../Osi/src/Osi/.libs/Osi.a ../../CoinUtils/src/.libs/CoinUtils.a -lstdc++ $(LIBS)

srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -547,7 +551,7 @@
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h config_coinmp.h
+all-am: Makefile $(LTLIBRARIES) $(OS2_DLL_NAME).dll $(HEADERS) config.h config_coinmp.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
@@ -656,3 +660,13 @@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+
+$(OS2_DLL_NAME).dll: lib$(OS2_LA_NAME).la
+ cp .libs/$(OS2_LA_NAME).a .libs/$(OS2_LA_NAME)_s.a
+ echo "LIBRARY $(OS2_DLL_NAME) INITINSTANCE TERMINSTANCE" > $(OS2_DLL_NAME).def
+ echo "DATA MULTIPLE" >> $(OS2_DLL_NAME).def
+ echo "EXPORTS" >> $(OS2_DLL_NAME).def
+ emxexp $(OS2_DLL_OBJ) >> $(OS2_DLL_NAME).def
+ gcc -g -Zbin-files -Zhigh-mem -Zomf -Zdll $(OS2_DLL_NAME).def -o $@ $(OS2_DLL_OBJ) $(OS2_DLL_LIBS)
+ emximp -o .libs/$(OS2_LA_NAME).a $(OS2_DLL_NAME).def
+ emximp -o .libs/$(OS2_LA_NAME).lib $(OS2_DLL_NAME).def
10 changes: 10 additions & 0 deletions ext_libraries/coinmp/makefile.mk
Expand Up @@ -46,6 +46,9 @@ TARFILE_NAME=CoinMP-1.7.6
TARFILE_MD5=1cce53bf4b40ae29790d2c5c9f8b1129

PATCH_FILES=coinmp-1.7.6.patch coinmp-1.7.6-clang.patch
.IF "$(OS)"=="OS2"
PATCH_FILES+=coinmp-1.6.0-os2.patch
.ENDIF

.IF "$(COM)"=="MSC"
BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv CoinMP\\MSVisualStudio\\v9\\CoinMP.sln "Release|Win32"
Expand All @@ -57,11 +60,18 @@ CONFIGURE_FLAGS=--disable-pkg-config --disable-bzlib --disable-zlib CC='$(CC) $(
BUILD_ACTION= $(GNUMAKE) -j$(MAXPROCESS)
.ENDIF

.IF "$(OS)"=="OS2"
CONFIGURE_FLAGS+= --disable-shared --enable-static
.ENDIF

OUT2INC+=CoinMP$/src/CoinMP.h

.IF "$(OS)"=="WNT"
OUT2BIN+=CoinMP$/MSVisualStudio$/v9$/release$/CoinMP.dll
OUT2LIB+=CoinMP$/MSVisualStudio$/v9$/release$/CoinMP.lib
.ELIF "$(OS)"=="OS2"
OUT2BIN+=CoinMP$/src$/CoinMP.dll
OUT2LIB+=CoinMP$/src$/.libs/CoinMP.lib
.ELSE
OUT2LIB+=CoinMP$/src$/.libs$/libCoinMP*$(DLLPOST)*
OUT2LIB+=CoinUtils$/src$/.libs$/libCoinUtils*$(DLLPOST)*
Expand Down
2 changes: 1 addition & 1 deletion ext_libraries/hunspell/makefile.mk
Expand Up @@ -90,7 +90,7 @@ BUILD_ACTION= cd src/hunspell && cp ../win_api/config.h . && CDEFS_PRESET=-DBUIL
.ENDIF # "$(GUI)"=="WNT"

.IF "$(GUI)"=="OS2"
BUILD_ACTION=cd src/hunspell && dmake
BUILD_ACTION=cd src/hunspell && touch config.h && dmake
.ENDIF # "$(GUI)"=="OS2"

OUT2INC= \
Expand Down
Expand Up @@ -29,7 +29,7 @@ ENABLE_EXCEPTIONS=TRUE
USE_DEFFILE=TRUE

.IF "$(GUI)"=="OS2"
HNJLIB=hyphen.lib
HNJLIB=-lhyphen
.ELIF "$(GUI)"=="UNX" || "$(COM)"=="GCC"
HNJLIB=-lhyphen
.ELSE
Expand All @@ -54,7 +54,11 @@ SLOFILES= \
$(SLO)$/hreg.obj\
$(SLO)$/hyphenimp.obj

.IF "$(GUI)" == "OS2"
REALNAME:=hyphen_u
.ELSE
REALNAME:=hyphen.uno
.ENDIF
SHL1TARGET= $(REALNAME)$(DLLPOSTFIX)

SHL1STDLIBS= \
Expand Down
4 changes: 4 additions & 0 deletions main/lingucomponent/source/spellcheck/spell/makefile.mk
Expand Up @@ -51,7 +51,11 @@ SLOFILES= \
$(SLO)$/sreg.obj\
$(SLO)$/sspellimp.obj

.IF "$(GUI)" == "OS2"
REALNAME:=$(TARGET)
.ELSE
REALNAME:=$(TARGET).uno
.ENDIF
SHL1TARGET= $(REALNAME)$(DLLPOSTFIX)

SHL1STDLIBS= \
Expand Down
2 changes: 1 addition & 1 deletion main/scp2/source/calc/makefile.mk
Expand Up @@ -36,7 +36,7 @@ TARGETTYPE=CUI
.IF "$(ENABLE_COINMP)" == "YES"
SCPDEFS+=-DENABLE_COINMP
.IF "$(SYSTEM_COINMP)" == "NO"
.IF "$(GUI)"!="WNT"
.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
# For the non-Windows platforms all libraries related to CoinMP have to be
# added explicitly.
SCPDEFS+=-DADD_ALL_COINMP_LIBRARIES
Expand Down
8 changes: 8 additions & 0 deletions main/scp2/source/ooo/file_library_ooo.scp
Expand Up @@ -1384,7 +1384,11 @@ End
File gid_File_Lib_Spell
TXT_FILE_BODY;
Styles = (PACKED);
#ifdef OS2
Name = LIBNAME(spell);
#else
Name = LIBNAME(spell.uno);
#endif
Dir = SCP2_OOO_BIN_DIR;
End
#endif
Expand Down Expand Up @@ -1535,7 +1539,11 @@ End
File gid_File_Lib_Hyph
TXT_FILE_BODY;
Styles = (PACKED);
#ifdef OS2
Name = LIBNAME(hyphen_u);
#else
Name = LIBNAME(hyphen.uno);
#endif
Dir = SCP2_OOO_BIN_DIR;
End
#endif
Expand Down

0 comments on commit 1b8c19f

Please sign in to comment.