office-gobmx/ios/qa/sc/Makefile
Tor Lillqvist 25d114eec4 Initial experiments with static linking of (some) components / services
Start with the first service needed when running sc's filters_test:
the UniversalContentBroker. It might not be typical as ucb uses the
deprecated XSingleServiceFactory.

This commit is not at all a complete solution, far from it, just an
initial hack. Naturally once I come up with some generic enough way to
do the static linking the necessary macros etc will be added to some
general header.

The macro XSERVICEINFO_IMPL_1 (local to ucbhelper and ucb) is amended
so that it in the disable-dynamic-linking case also emits a function
whose assembler name equal contains the service name. This function
returns the XSingleServiceFactory for the service. Where the service
is instantiated we link directly to that function.

But probably this will be reworked a couple of times... Maybe it would
be better to simply have the service name specific entry point be a
pointer to the component's component_getFactory() function? Those all
have the same prototype.
2012-03-21 00:00:11 +02:00

73 lines
3.2 KiB
Makefile

include ../../../config_host.mk
APP=lo-qa-sc-filters-test
# If run from Xcode, check the CURRENT_ARCH env var for which platform we are
# building, device or simulator
ifeq ($(CURRENT_ARCH),i386)
PLATFORM=iphonesimulator
else
PLATFORM=iphoneos
endif
APPDIR=build/Debug-$(PLATFORM)/$(APP).app
# Stuff lifted from solenv/gbuild/platform/IOS_ARM_GCC.mk
gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -g
gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_Library__FRAMEWORKS := \
Foundation \
CoreFoundation \
CoreGraphics \
CoreText \
UIKit \
SRCS = filters-test.m
CFLAGS = $(SOLARINC)
LIBS = -Wl,$(OUTDIR)/bin/cppunit/cppunittester.a -Wl,$(WORKDIR)/LinkTarget/CppunitTest/libtest_sc_filters_test.a -Wl,$(OUTDIR)/lib/bootstrap.uno.a -Wl,$(OUTDIR)/lib/unoexceptionprotector.a $(SOLARLIB) -lavmedialo -lbasegfxlo -lcanvastoolslo -lcomphelpgcc3 -lcppcanvaslo -lcppunit -ldrawinglayerlo -leditenglo -lforlo -lforuilo -lfwelo -lfwilo -lfwklo -lgcc3_uno -li18nisolang1gcc3 -li18npaperlo -li18nutilgcc3 -licuuc -ljpeg -ljvmfwk -llnglo -lreg -lsal_textenc -lsalcpprt -lsaxlo -lsclo -lsfxlo -lstore -lsvllo -lsvtlo -lsvxlo -lsvxcorelo -lsotlo -ltest -ltklo -ltllo -lucb1 -lucbhelper4gcc3 -luno_cppuhelpergcc3 -luno_cppu -luno_sal -luno_salhelpergcc3 -lunotest -lutllo -lvcllo -lxml2 -lxmlreader -lxolo -lz $(addprefix -framework , $(gb_Library__FRAMEWORKS)) -liconv -lobjc
all: $(APPDIR)/$(APP) stuff
$(APPDIR)/$(APP): $(SRCS)
mkdir -p $(APPDIR)
$(CXX) -Wl,-map,$(APP).map.mangled -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS)
c++filt <$(APP).map.mangled >$(APP).map && rm $(APP).map.mangled
stuff:
# inifile:
echo 'URE_BOOTSTRAP=$${ORIGIN}/fundamentalrc' >$(APPDIR)/rc
#
# URE_BOOTSTRAP file, fundamentalrc:
( \
echo '[Bootstrap]'; \
echo 'BRAND_BASE_DIR=$${ORIGIN}'; \
) >$(APPDIR)/fundamentalrc
#
# .rdb files
cp $(OUTDIR)/bin/udkapi.rdb $(OUTDIR)/bin/types.rdb $(OUTDIR)/xml/ure/services.rdb $(APPDIR)
#
# a bunch of .component files
for F in framework/util/fwk i18npool/util/i18npool sfx2/util/sfx ucb/source/core/ucb1 ucb/source/ucp/file/ucpfile1 unoxml/source/service/unoxml configmgr/source/configmgr basic/util/sb chart2/source/controller/chartcontroller chart2/source/tools/charttools chart2/source/model/chartmodel comphelper/util/comphelp eventattacher/source/evtatt fileaccess/source/fileacc filter/source/config/cache/filterconfig1 oox/util/oox package/source/xstor/xstor package/util/package2 sax/source/expatwrap/expwrap sax/source/fastparser/fastsax sc/util/sc sc/util/scfilt scaddins/source/analysis/analysis scaddins/source/datefunc/date sot/util/sot svl/util/svl toolkit/util/tk ucb/source/ucp/tdoc/ucptdoc1 unotools/util/utl unoxml/source/rdf/unordf; do \
mkdir -p $(APPDIR)/ComponentTarget/`dirname $$F`; \
cp $(WORKDIR)/ComponentTarget/$$F.component $(APPDIR)/ComponentTarget/$$F.component; \
done
#
# .res files
#
# $BRAND_BASE_DIR/program/resource hardcoded in
# ResMgrContainer::init() in tools/source/rc/resmgr.cxx, so let's use
# that.
mkdir -p $(APPDIR)/program/resource
for F in $(OUTDIR)/bin/*.res; do \
cp $$F $(APPDIR)/program/resource; \
done
clean:
rm -rf $(APPDIR)