Skip to content

Commit

Permalink
Compile oovbaapi and basic.
Browse files Browse the repository at this point in the history
Change-Id: I8dd391c103113121e6c7b3fd6864e071710bf3e6
  • Loading branch information
jpakkane committed Feb 16, 2020
1 parent e5a4963 commit faf6209
Show file tree
Hide file tree
Showing 9 changed files with 231 additions and 1 deletion.
81 changes: 81 additions & 0 deletions basic/meson.build
@@ -0,0 +1,81 @@
scripting_sources = files(
'source/basmgr/basicmanagerrepository.cxx',
'source/basmgr/basmgr.cxx',
'source/basmgr/vbahelper.cxx',
'source/classes/codecompletecache.cxx',
'source/classes/eventatt.cxx',
'source/classes/global.cxx',
'source/classes/image.cxx',
'source/classes/propacc.cxx',
'source/classes/sb.cxx',
'source/classes/sbunoobj.cxx',
'source/classes/sbxmod.cxx',
'source/comp/basiccharclass.cxx',
'source/comp/buffer.cxx',
'source/comp/codegen.cxx',
'source/comp/dim.cxx',
'source/comp/exprtree.cxx',
'source/comp/exprgen.cxx',
'source/comp/exprnode.cxx',
'source/comp/io.cxx',
'source/comp/loops.cxx',
'source/comp/parser.cxx',
'source/comp/sbcomp.cxx',
'source/comp/scanner.cxx',
'source/comp/symtbl.cxx',
'source/comp/token.cxx',
'source/uno/dlgcont.cxx',
'source/uno/modsizeexceeded.cxx',
'source/uno/namecont.cxx',
'source/uno/scriptcont.cxx',
'source/runtime/comenumwrapper.cxx',
'source/runtime/ddectrl.cxx',
'source/runtime/inputbox.cxx',
'source/runtime/iosys.cxx',
'source/runtime/props.cxx',
'source/runtime/stdobj.cxx',
'source/runtime/stdobj1.cxx',
'source/runtime/runtime.cxx',
'source/classes/errobject.cxx',
)

common_sources = files(
'source/runtime/basrdll.cxx',
'source/runtime/methods.cxx',
'source/runtime/methods1.cxx',
'source/classes/sbintern.cxx',
'source/sbx/sbxarray.cxx',
'source/sbx/sbxbool.cxx',
'source/sbx/sbxbyte.cxx',
'source/sbx/sbxchar.cxx',
'source/sbx/sbxcoll.cxx',
'source/sbx/sbxcurr.cxx',
'source/sbx/sbxbase.cxx',
'source/sbx/sbxdate.cxx',
'source/sbx/sbxdbl.cxx',
'source/sbx/sbxdec.cxx',
'source/sbx/sbxexec.cxx',
'source/sbx/sbxform.cxx',
'source/sbx/sbxint.cxx',
'source/sbx/sbxlng.cxx',
'source/sbx/sbxobj.cxx',
'source/sbx/sbxres.cxx',
'source/sbx/sbxscan.cxx',
'source/sbx/sbxsng.cxx',
'source/sbx/sbxstr.cxx',
'source/sbx/sbxuint.cxx',
'source/sbx/sbxulng.cxx',
'source/sbx/sbxvalue.cxx',
'source/sbx/sbxvar.cxx',
)

sb_lib = shared_library('sb',
scripting_sources,
common_sources,
'source/runtime/dllmgr-none.cxx',
udk_fake_h, off_fake_h, oovba_fake_h, basicide_hxx,
cpp_args: ['-DBASIC_DLLIMPLEMENTATION',
'-DLIBO_INTERNAL_ONLY'],
include_directories: [main_inc, udkh_inc, offapi_inc, oovbaapi_inc, 'source/inc', 'inc', setup_inc],
link_with: [comphelper_lib, cppuhelper_lib, cppu_lib, salhelper_lib, sal_lib, i18nlangtag_lib, sot_lib, svl_lib, svt_lib, tl_lib, utl_lib, vcl_lib, xmlscript_lib]
)
15 changes: 15 additions & 0 deletions config_host/config_extensions.h.meson
@@ -0,0 +1,15 @@
#ifndef CONFIG_EXTENSION_UPDATE
#define CONFIG_EXTENSION_UPDATE

/* EXTENSIONS - Whether we have any extension mechanism at all
*
* Primarily intended for non-desktop platforms where supporting
* extensions can be complicated, or even prohibited by the OS (as on
* iOS).
*/

#mesondefine HAVE_FEATURE_EXTENSIONS

#mesondefine ENABLE_EXTENSION_UPDATE

#endif
7 changes: 7 additions & 0 deletions config_host/meson.build
Expand Up @@ -78,6 +78,9 @@ cdata.set10('ENABLE_GIO', gio_dep.found())

cdata.set_quoted('OOO_VENDOR', 'Vogon high comman')

cdata.set10('HAVE_FEATURE_EXTENSIONS', 1)
cdata.set10('ENABLE_EXTENSION_UPDATE', 1)

configure_file(input: 'config_typesizes.h.meson',
output: 'config_typesizes.h',
configuration: cdata)
Expand Down Expand Up @@ -173,3 +176,7 @@ configure_file(input: 'config_langs.h.meson',
configure_file(input: 'config_vendor.h.meson',
output: 'config_vendor.h',
configuration: cdata)

configure_file(input: 'config_extensions.h.meson',
output: 'config_extensions.h',
configuration: cdata)
2 changes: 2 additions & 0 deletions meson.build
Expand Up @@ -76,6 +76,7 @@ subdir('unoidl')
subdir('codemaker')
subdir('udkapi')
subdir('offapi')
subdir('oovbaapi')
subdir('i18nlangtag')
subdir('cppu')
subdir('xmlreader')
Expand All @@ -101,3 +102,4 @@ subdir('vcl')
subdir('xmlscript')
subdir('toolkit')
subdir('svtools')
subdir('basic')
17 changes: 17 additions & 0 deletions officecfg/Office/meson.build
Expand Up @@ -29,3 +29,20 @@ common_hxx = custom_target('Common.hxx',
'-o',
'@OUTPUT@',
'@INPUT@'])

basicide_hxx = custom_target('BasicIDE.hxx',
output: 'BasicIDE.hxx',
input: ['../registry/cppheader.xsl',
'../registry/schema/org/openoffice/Office/BasicIDE.xcs'],
command: [xslt_bin,
'--nonet',
'--stringparam',
'ns1',
'Office',
'--stringparam',
'ns2',
'BasicIDE',
'-o',
'@OUTPUT@',
'@INPUT@'])

1 change: 0 additions & 1 deletion officecfg/meson.build
Expand Up @@ -39,5 +39,4 @@ vcl_hxx = custom_target('VCL.hxx',
'@OUTPUT@',
'@INPUT@'])


setup_inc = include_directories('..') # HACK
28 changes: 28 additions & 0 deletions oovbaapi/meson.build
@@ -0,0 +1,28 @@
oovbaapiurbcompiler = find_program('oovbaapiurbcompiler.py')
oovbabuilder = find_program('oovbaapihbuilder.py')

oovbaapi_rdb = custom_target('oovbaapi_urb',
output: 'oovbaapi.urb',
command: [oovbaapiurbcompiler,
unoidl_write_exe,
udkapi_rdb,
offapi_rdb,
meson.current_source_dir(),
'@PRIVATE_DIR@',
'@OUTPUT@'])


oovba_fake_h = custom_target('oovbaapi_h',
output: 'oovba_fake.h',
command: [oovbabuilder,
cppumaker_exe,
udkapi_rdb,
offapi_rdb,
oovbaapi_rdb,
'@OUTDIR@',
'@PRIVATE_DIR@',
'@OUTPUT@',
meson.current_source_dir()]
)

oovbaapi_inc = include_directories('.')
44 changes: 44 additions & 0 deletions oovbaapi/oovbaapihbuilder.py
@@ -0,0 +1,44 @@
#!/usr/bin/env python3

from pathlib import Path
import sys, os, subprocess

# FIXME: mostly a duplicate of the same script in udkapi.
# Make these use some sort of common functionality eventually.

# command: [offbuilder,
# cppumaker_exe,
# offapi_urbm,
# udkapi_urb,
# '@OUTDIR@',
# '@PRIVATE_DIR@',
# meson.current_source_dir()]

cppumaker = sys.argv[1]
udkapi_urb = sys.argv[2]
udkapi_urb_abs = os.path.join(os.getcwd(), udkapi_urb)
offapi_urb = sys.argv[3]
offapi_urb_abs = os.path.join(os.getcwd(), offapi_urb)
oovbaapi_urb = sys.argv[4]
oovbaapi_urb_abs = os.path.join(os.getcwd(), oovbaapi_urb)
out_dir = sys.argv[5]
out_dir_abs = os.path.join(os.getcwd(), out_dir)
private_dir = sys.argv[6]
private_dir_abs = os.path.join(os.getcwd(), private_dir)
fakeout = sys.argv[7]
source_dir = sys.argv[8]

if not os.path.exists(private_dir):
os.mkdir(private_dir)

subprocess.check_call([cppumaker,
'-Gc',
'-L',
'-O' + out_dir_abs, # FIXME, should be priv_dir_abs
oovbaapi_urb_abs,
'-X',
offapi_urb_abs,
'-X',
udkapi_urb_abs])

open(fakeout, 'w')
37 changes: 37 additions & 0 deletions oovbaapi/oovbaapiurbcompiler.py
@@ -0,0 +1,37 @@
#!/usr/bin/env python3

from pathlib import Path
import sys, os, subprocess

idlwrite = sys.argv[1]
udkapi_urb = sys.argv[2]
udkapi_urb_abs = os.path.join(os.getcwd(), udkapi_urb)
offapi_urb = sys.argv[3]
offapi_urb_abs = os.path.join(os.getcwd(), offapi_urb)
source_dir = sys.argv[4]
priv_dir = sys.argv[5]
priv_dir_abs = os.path.join(os.getcwd(), priv_dir)
classnamefile = os.path.join(priv_dir, 'classnames')
rdbfile = os.path.join(os.getcwd(), sys.argv[6])

if not os.path.exists(priv_dir):
os.mkdir(priv_dir)

def glob_and_write(of, tld):
fnames = Path(source_dir).glob(tld + '/**/*.idl')
for fname in fnames:
dotname = str(fname.relative_to(source_dir).with_suffix('')).replace('/', '.')
if dotname.endswith('.modules'):
continue
of.write(dotname)
of.write(' ')

with open(classnamefile, 'w') as of:
glob_and_write(of, 'ooo')

subprocess.check_call([idlwrite,
udkapi_urb_abs,
offapi_urb_abs,
source_dir,
'@' + classnamefile,
rdbfile])

0 comments on commit faf6209

Please sign in to comment.