[libvoikko] Libreoffice-voikko build broken on MacOSX

Sjur Moshagen sjurnm at mac.com
Tue May 28 15:56:53 EEST 2013


28. mai 2013 kl. 14:50 skrev Sjur Moshagen <sjurnm at mac.com>:

> Sorry for the noise, I managed to fix this myself (still learning really trivial things…)

The saga continues, this time with what I believe is a real bug in the Makefile. It contains the following:



# Link the shared library
build/oxt/$(VOIKKO_EXTENSION_SHAREDLIB): $(patsubst %,build/src/%.$(OBJ_EXT),$(VOIKKO_OBJECTS))
ifeq "$(PLATFORM)" "windows"
	$(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \
	/MAP:build/voikko.map $^ \
	 $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) msvcrt.lib kernel32.lib $(LIBVOIKKO_PATH)\lib\libvoikko-1.lib
	mt -manifest build/oxt/voikko.dll.manifest -outputresource:build/oxt/voikko.dll;2
else
ifeq "$(PLATFORM)" "macosx"
		cat $(PRJ)/settings/component.uno.map > build/voikko.map
		nm -gx $^ | $(ADDSYMBOLS) >> build/voikko.map
		$(LINK) $(COMP_LINK_FLAGS) build/voikko.map $(LINK_LIBS) -o $@ $^ \
		$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) \
        -lvoikko
		$(INSTALL_NAME_URELIBS)  $@
else
		$(LINK) $(LINK_FLAGS) $^ -o $@ $(LINK_LIBS)
endif
endif




The problem is that $(ADDSYMBOLS) is never defined, and is thus empty. This makes the file build/voikko.map virtually empty (just a few comment lines), which makes for invalid input to the compiler. The nm command expands as follows:



nm -gx build/src/registry.o build/src/common.o build/src/PropertyManager.o build/src/VoikkoHandlePool.o build/src/spellchecker/SpellAlternatives.o build/src/spellchecker/SpellChecker.o build/src/hyphenator/Hyphenator.o build/src/hyphenator/HyphenatedWord.o build/src/hyphenator/PossibleHyphens.o build/src/grammar/GrammarChecker.o build/src/settings/SettingsEventHandler.o |  >> build/voikko.map



Together with other object files, this is sent to the linker:



g++-4.0 -dynamiclib -single_module -Wl,-multiply_defined,suppress  build/voikko.map -L/Users/adminis//MACOSXexample.out/lib -L/Users/adminis//macosx/lib -L"/Applications/LibreOffice.app/Contents/ure-link/lib" -o build/oxt/voikko.dylib build/src/registry.o build/src/common.o build/src/PropertyManager.o build/src/VoikkoHandlePool.o build/src/spellchecker/SpellAlternatives.o build/src/spellchecker/SpellChecker.o build/src/hyphenator/Hyphenator.o build/src/hyphenator/HyphenatedWord.o build/src/hyphenator/PossibleHyphens.o build/src/grammar/GrammarChecker.o build/src/settings/SettingsEventHandler.o \
        -luno_cppuhelpergcc3 -luno_cppu -luno_sal -Wl,-dylib_file, at __________________________________________________URELIB/libuno_cppuhelper'gcc3.dylib.3:/Applications/LibreOffice.app/Contents/ure-link/lib/libuno_cppuhelpergcc3.dylib' -Wl,-dylib_file, at __________________________________________________URELIB/libuno_cppu.dylib.3:'/Applications/LibreOffice.app/Contents/ure-link/lib/libuno_cppu.dylib' -Wl,-dylib_file, at __________________________________________________URELIB/libuno_sal.dylib.3:'/Applications/LibreOffice.app/Contents/ure-link/lib/libuno_sal.dylib' \
        -lvoikko



This generates the following error:



/usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool: file: build/voikko.map is not an object file (not allowed in a library)



Regards,
Sjur




More information about the Libvoikko mailing list