On 14 Jul, Pedro Giffuni wrote:
> 
> 
> On 07/14/15 02:32, Don Lewis wrote:
>> Next problem:
>>
>> /bin/sh ../../libtool --tag=CXX   --mode=link c++  -g -O2   -o chmorph 
>> chmorph.o ../parsers/libparsers.a ../hunspell/libhunspell-1.3.la
>> libtool: link: c++ -g -O2 -o chmorph chmorph.o  ../parsers/libparsers.a 
>> ../hunspell/.libs/libhunspell-1.3.a
>> c++ -DHAVE_CONFIG_H -I. -I../.. -I../../src/hunspell -I../../src/parsers  
>> -I/include -D_THREAD_SAFE -I/usr/local/include  -g -O2 -MT hunspell.o -MD 
>> -MP -MF .deps/hunspell.Tpo -c -o hunspell.o hunspell.cxx
>> hunspell.cxx:112:14: fatal error: '../../intl/libintl.h' file not found
>> #    include <../../intl/libintl.h>
>>               ^
>> 1 error generated.
>> Makefile:524: recipe for target 'hunspell.o' failed
>> gmake[3]: *** [hunspell.o] Error 1
>> gmake[3]: Leaving directory 
>> '/tmp/openoffice/aoo-4.2.0/ext_libraries/hunspell/unxfbsdx.pro/misc/build/hunspell-1.3.2/src/tools'
>>
>>
>> No libintl.h around here ...
>> % find ext_libraries main -name libintl.h -print
>> %
>>
>> There is one in /usr/local/include that is installed by gettext, but it
>> isn't under an intl/ directory.
>>
> gettext was included in OpenOffice before the licensing cleanup.
> 
> It is expected that you have a system gettext and encoding the
> path instead of -I including it is a bad practice, IMHO. However,
> this doesn't seem to be an auto-inflicted error but something
> that upstream hunspell does. How does the FreeBSD port
> work around that?

It appears that hunspell has a way of generating that header in the that
location on systems that don't have gettext, but for whatever reason it
decided not to do so.  The real problem is this fragment of
ext_libraries/hunspell/makefile.mk:

.ELIF "$(OS)"=="FREEBSD" # "$(SYSBASE)"!=""
CONFIGURE_FLAGS+=CPPFLAGS="-I$(LIBINTL_PREFIX)/include" 
--with-libintl-prefix="$(LIBINTL_PREFIX)"
.ENDIF

The problem is that $(LIBINTL_PREFIX) does not seem to be defined
anywhere, so we end up passing
  CPPFLAGS=-I/include --with-libintl-prefix=
to configure, so it does not find the header.  This is especially dumb
since we are passing CPPFLAGS=-I/usr/local/include and
LDFLAGS=-L/usr/local/lib to the build. By setting
LIBINTL_PREFIX=/usr/local in the environment, I was able to sucessfully
build hunspell.

I thought that changing the above to CPPFLAGS="$(CPPFLAGS)" would do the
trick, but when I tried the build, it got expanded to CPPFLAGS="". There
were two reasons for that.  One was an error in my build script that
caused CPPFLAGS not not actually get set.  The other is this line in
solenv/inc/settings.mk:
  CPPFLAGS=
The latter doesn't seem to affect everything because fixing my build
script allowed the python build to find libintl.h, but I suspect this is
the reason for the LIBINTL_PREFIX hack.

Unfortunately this seems to break the icu build.  It looks like the icu
build is finding the headers installed by the icu FreeBSD port instead
of its own because it is appending to CPPFLAGS and thus gets the search
order wrong.  Unfortunately icu is an indirect dependency of gtk:

gtk2 -> pango -> harfbuzz -> icu

cc -I/usr/local/include -D_REENTRANT -I. -I../i18n   -DU_COMMON_IMPLEMENTATION 
-O    -fvisibility=hidden -c   -o putil.ao putil.c
In file included from putil.c:67:
./cstring.h:77:12: warning: 'uprv_stricmp' macro redefined
#   define uprv_stricmp(str1, str2) T_CString_stricmp(str1, str2)
           ^
/usr/local/include/unicode/urename.h:1349:9: note: previous definition is here
#define uprv_stricmp U_ICU_ENTRY_POINT_RENAME(uprv_stricmp)
        ^
In file included from putil.c:67:
./cstring.h:78:12: warning: 'uprv_strnicmp' macro redefined
#   define uprv_strnicmp(str1, str2, n) T_CString_strnicmp(str1, str2, n)
           ^
/usr/local/include/unicode/urename.h:1351:9: note: previous definition is here
#define uprv_strnicmp U_ICU_ENTRY_POINT_RENAME(uprv_strnicmp)
        ^
putil.c:1673:1: error: conflicting types for 'u_versionToString_55'
u_versionToString(UVersionInfo versionArray, char *versionString) {
^
/usr/local/include/unicode/urename.h:405:27: note: expanded from macro 
'u_versionToString'
#define u_versionToString U_ICU_ENTRY_POINT_RENAME(u_versionToString)
                          ^
/usr/local/include/unicode/uvernum.h:112:40: note: expanded from macro 
'U_ICU_ENTRY_POINT_RENAME'
#define U_ICU_ENTRY_POINT_RENAME(x)    
U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
                                       ^
/usr/local/include/unicode/uvernum.h:111:44: note: expanded from macro 
'U_DEF2_ICU_ENTRY_POINT_RENAME'
#define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
                                           ^
/usr/local/include/unicode/uvernum.h:110:43: note: expanded from macro 
'U_DEF_ICU_ENTRY_POINT_RENAME'
#define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
                                          ^
<scratch space>:204:1: note: expanded from here
u_versionToString_55
^
/usr/local/include/unicode/uversion.h:181:1: note: previous declaration is here
u_versionToString(const UVersionInfo versionArray, char *versionString);
^
/usr/local/include/unicode/urename.h:405:27: note: expanded from macro 
'u_versionToString'
#define u_versionToString U_ICU_ENTRY_POINT_RENAME(u_versionToString)
                          ^
/usr/local/include/unicode/uvernum.h:112:40: note: expanded from macro 
'U_ICU_ENTRY_POINT_RENAME'
#define U_ICU_ENTRY_POINT_RENAME(x)    
U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
                                       ^
/usr/local/include/unicode/uvernum.h:111:44: note: expanded from macro 
'U_DEF2_ICU_ENTRY_POINT_RENAME'
#define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
                                           ^
/usr/local/include/unicode/uvernum.h:110:43: note: expanded from macro 
'U_DEF_ICU_ENTRY_POINT_RENAME'
#define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
                                          ^
<scratch space>:10:1: note: expanded from here
u_versionToString_55
^
2 warnings and 1 error generated.
../config/mh-bsd-gcc:41: recipe for target 'putil.ao' failed
gmake[1]: *** [putil.ao] Error 1
gmake[1]: Leaving directory 
'/tmp/openoffice/aoo-4.2.0/main/icu/unxfbsdx.pro/misc/build/icu/source/common'
Makefile:103: recipe for target 'all-recursive' failed
gmake: *** [all-recursive] Error 2
dmake:  Error code 2, while making './unxfbsdx.pro/misc/build/so_built_so_icu'

1 module(s): 
        icu
need(s) to be rebuilt


This is just a build problem because libgtk isn't linked to any of
libicu*.  I think that clearing CPPFLAGS in solenv/inc/settings.mk does
*not* fix this.  It either has to be cleared in the icu makefile.mk or
we can't pass CPPFLAGS to build and have to rely on the LIBINTL_PREFIX
hack.

With the following somewhat hacking patch, I'm able to get farther, but
have run into two more errors.

Index: ext_libraries/hunspell/makefile.mk
===================================================================
--- ext_libraries/hunspell/makefile.mk  (revision 1690824)
+++ ext_libraries/hunspell/makefile.mk  (working copy)
@@ -64,7 +64,7 @@
 .ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!=""
 CONFIGURE_FLAGS+=CPPFLAGS="$(EXTRA_CDEFS)"
 .ELIF "$(OS)"=="FREEBSD" # "$(SYSBASE)"!=""
-CONFIGURE_FLAGS+=CPPFLAGS="-I$(LIBINTL_PREFIX)/include" 
--with-libintl-prefix="$(LIBINTL_PREFIX)"
+CONFIGURE_FLAGS+=CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
 .ENDIF
 
 BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
Index: main/solenv/inc/settings.mk
===================================================================
--- main/solenv/inc/settings.mk (revision 1690824)
+++ main/solenv/inc/settings.mk (working copy)
@@ -248,7 +248,10 @@
 
 BFLAGS=
 COBFLAGS=
+# FreeBSD wants to pass CPPFLAGS through the environment
+.IF "$(OS)"!=="FREEBSD"
 CPPFLAGS=
+.ENDIF
 CXXFLAGS=
 FFLAGS=
 PFLAGS=
Index: main/icu/makefile.mk
===================================================================
--- main/icu/makefile.mk        (revision 1690824)
+++ main/icu/makefile.mk        (working copy)
@@ -87,7 +87,7 @@
 
 CONFIGURE_DIR=source
 
-CONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" 
LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout 
--enable-static --enable-shared=yes $(DISABLE_64BIT)'
+CONFIGURE_ACTION+=sh -c 'CPPFLAGS="" CFLAGS="$(icu_CFLAGS)" 
CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure 
--enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)'
 
 #CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes 
--enable-64bit-libs=no
 CONFIGURE_FLAGS=




This is the first error:

cat pyuno.flt > ../../unxfbsdx.pro/misc/pyuno.flt
-----------------------------
SHL1FILTERFILE not set!
-----------------------------
dummy file to keep the dependencies for later use.
Making:    libpyuno.so
c++ -Wl,-z,combreloc -L/usr/local/lib -Wl,-z,origin -Wl,-rpath,'$ORIGIN' 
-shared -L../../unxfbsdx.pro/lib -L../lib 
-L/tmp/openoffice/aoo-4.2.0/main/solenv/unxfbsdx/lib 
-L/tmp/openoffice/aoo-4.2.0/main/solver/420/unxfbsdx.pro/lib 
-L/tmp/openoffice/aoo-4.2.0/main/solenv/unxfbsdx/lib -L/usr/local/openjdk7/lib 
-L/usr/local/openjdk7/jre/lib/amd64 -L/usr/local/openjdk7/jre/lib/amd64/server 
-L/usr/local/openjdk7/jre/lib/amd64/native_threads -L/usr/local/lib 
../../unxfbsdx.pro/slo/pyuno_version.o -o ../../unxfbsdx.pro/lib/libpyuno.so 
../../unxfbsdx.pro/slo/pyuno_runtime.o ../../unxfbsdx.pro/slo/pyuno.o 
../../unxfbsdx.pro/slo/pyuno_callable.o ../../unxfbsdx.pro/slo/pyuno_module.o 
../../unxfbsdx.pro/slo/pyuno_type.o ../../unxfbsdx.pro/slo/pyuno_util.o 
../../unxfbsdx.pro/slo/pyuno_except.o ../../unxfbsdx.pro/slo/pyuno_adapter.o 
../../unxfbsdx.pro/slo/pyuno_gc.o -luno_cppu -luno_cppuhelpergcc3 -luno_sal 
-lpython2.7 -Wl,--as-needed -pthread -lm -Wl,--no-as-needed 
rm -f ../../unxfbsdx.pro/lib/check_libpyuno.so
mv ../../unxfbsdx.pro/lib/libpyuno.so ../../unxfbsdx.pro/lib/check_libpyuno.so
/tmp/openoffice/aoo-4.2.0/main/solenv/bin/checkdll.sh -L../../unxfbsdx.pro/lib 
-L/tmp/openoffice/aoo-4.2.0/main/solver/420/unxfbsdx.pro/lib  
../../unxfbsdx.pro/lib/check_libpyuno.so
Checking DLL ../../unxfbsdx.pro/lib/check_libpyuno.so ...: ERROR: 
../../unxfbsdx.pro/lib/check_libpyuno.so: Undefined symbol 
"PyUnicodeUCS2_GetSize"
dmake:  Error code 1, while making '../../unxfbsdx.pro/lib/libpyuno.so'

1 module(s): 
        pyuno
need(s) to be rebuilt

Reason(s):

ERROR: error 65280 occurred while making 
/tmp/openoffice/aoo-4.2.0/main/pyuno/source/module

When you have fixed the errors in that module you can resume the build by 
running:

        build --all:pyuno



This is the second error:

Making:    i18nsearch.uno.so
c++ -Wl,-z,combreloc -L/usr/local/lib -Wl,-z,defs -Wl,-z,origin 
-Wl,-rpath,'$ORIGIN' -shared -Wl,-O1 -Wl,--version-script 
../../unxfbsdx.pro/misc/component_i18nsearch.uno.map -L../../unxfbsdx.pro/lib 
-L../lib -L/tmp/openoffice/aoo-4.2.0/main/solenv/unxfbsdx/lib 
-L/tmp/openoffice/aoo-4.2.0/main/solver/420/unxfbsdx.pro/lib 
-L/tmp/openoffice/aoo-4.2.0/main/solenv/unxfbsdx/lib -L/usr/local/openjdk7/lib 
-L/usr/local/openjdk7/jre/lib/amd64 -L/usr/local/openjdk7/jre/lib/amd64/server 
-L/usr/local/openjdk7/jre/lib/amd64/native_threads -L/usr/local/lib 
../../unxfbsdx.pro/slo/textsearch.o ../../unxfbsdx.pro/slo/levdis.o 
../../unxfbsdx.pro/slo/i18nsearch.uno_version.o -o 
../../unxfbsdx.pro/lib/i18nsearch.uno.so -luno_cppu -luno_cppuhelpergcc3 
-luno_sal -licui18n -licuuc -Wl,--as-needed -pthread -lm -Wl,--no-as-needed 
../../unxfbsdx.pro/slo/textsearch.o: In function 
`TextSearch::RESrchFrwrd(rtl::OUString const&, int, int)':
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0xe35):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(unsigned short 
const*, int)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x11b1):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x12b5):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
../../unxfbsdx.pro/slo/textsearch.o: In function 
`TextSearch::RESrchBkwrd(rtl::OUString const&, int, int)':
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1450):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(unsigned short 
const*, int)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x182d):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1943):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
../../unxfbsdx.pro/slo/textsearch.o: In function 
`TextSearch::RESrchPrepare(com::sun::star::util::SearchOptions const&)':
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1a74):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(unsigned short 
const*, int)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1aa8):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(char const*, 
int, icu_4_0::UnicodeString::EInvariant)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1aaf):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1b02):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(char const*, 
int, icu_4_0::UnicodeString::EInvariant)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1b09):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1b5b):
 undefined reference to 
`icu_4_0::RegexMatcher::RegexMatcher(icu_4_0::UnicodeString const&, unsigned 
int, UErrorCode&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1b62):
 undefined reference to `icu_4_0::RegexMatcher::~RegexMatcher()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1b91):
 undefined reference to `icu_4_0::RegexMatcher::reset(icu_4_0::UnicodeString 
const&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1bac):
 undefined reference to 
`icu_4_0::RegexMatcher::replaceAll(icu_4_0::UnicodeString const&, UErrorCode&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1bb9):
 undefined reference to 
`icu_4_0::UnicodeString::operator=(icu_4_0::UnicodeString const&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1bc2):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1bce):
 undefined reference to `icu_4_0::RegexMatcher::reset()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1c02):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(char const*, 
int, icu_4_0::UnicodeString::EInvariant)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1c09):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1c5c):
 undefined reference to `icu_4_0::UnicodeString::UnicodeString(char const*, 
int, icu_4_0::UnicodeString::EInvariant)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1c63):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1cb5):
 undefined reference to 
`icu_4_0::RegexMatcher::RegexMatcher(icu_4_0::UnicodeString const&, unsigned 
int, UErrorCode&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1cbc):
 undefined reference to `icu_4_0::RegexMatcher::~RegexMatcher()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1ceb):
 undefined reference to `icu_4_0::RegexMatcher::reset(icu_4_0::UnicodeString 
const&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d09):
 undefined reference to 
`icu_4_0::RegexMatcher::replaceAll(icu_4_0::UnicodeString const&, UErrorCode&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d19):
 undefined reference to 
`icu_4_0::UnicodeString::operator=(icu_4_0::UnicodeString const&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d25):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d31):
 undefined reference to `icu_4_0::RegexMatcher::reset()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d3b):
 undefined reference to `icu_4_0::UMemory::operator new(unsigned long)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d56):
 undefined reference to 
`icu_4_0::RegexMatcher::RegexMatcher(icu_4_0::UnicodeString const&, unsigned 
int, UErrorCode&)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1d88):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1dc9):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1e09):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1e16):
 undefined reference to `icu_4_0::UMemory::operator delete(void*)'
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search/textsearch.cxx:(.text+0x1e27):
 undefined reference to `icu_4_0::UnicodeString::~UnicodeString()'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
dmake:  Error code 1, while making '../../unxfbsdx.pro/lib/i18nsearch.uno.so'

1 module(s): 
        i18npool
need(s) to be rebuilt

Reason(s):

ERROR: error 65280 occurred while making 
/tmp/openoffice/aoo-4.2.0/main/i18npool/source/search

When you have fixed the errors in that module you can resume the build by 
running:

        build --all:i18npool


The second problem appears looks ike it is caused by linking to the
system icu library instead of the bundled one since -L/usr/local/lib is
at the start of the linker arguments.


At this point, I'm going to back out the patch above, and remove
CPPFLAGS and LDFLAGS from the environment passed to build.  I'll pass
LIBINTL_PREFIX instead to fix he hunspell issue.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to