Discussion:
[Oyranos-devel] Oyranos-0.9.6 and FreeBSD (libintl)
Boris Samorodov
2016-12-25 22:13:45 UTC
Permalink
Hi All,

I get the following at the configure stage:
[...]
-- Looking for libintl.h
-- Looking for libintl.h - not found
[...]

However, libintl is installed at the system:
---
% ls -l /usr/local/include/libintl.h
-rw-r--r-- 1 root wheel 16654 Dec 10 04:41 /usr/local/include/libintl.h

% ls -l /usr/local/lib/libintl.*
-rw-r--r-- 1 root wheel 110318 Dec 10 04:41 /usr/local/lib/libintl.a
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41 /usr/local/lib/libintl.so
-> libintl.so.8.1.5
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41
/usr/local/lib/libintl.so.8 -> libintl.so.8.1.5
-rw-r--r-- 1 root wheel 55245 Dec 10 04:41
/usr/local/lib/libintl.so.8.1.5
---

Seems that the relevant checks do not look at /usr/local prefix:
---
CHECK_INCLUDE_FILE(libintl.h HAVE_LIBINTL_H)
FIND_LIBRARY( LIBINTL_LIBRARIES NAMES intl libintl libintl-8 )
IF(LIBINTL_LIBRARIES)
SET( EXTRA_LIBS ${EXTRA_LIBS} ${LIBINTL_LIBRARIES} )
SET( EXTRA_LIBS_CORE ${EXTRA_LIBS_CORE} ${LIBINTL_LIBRARIES} )
ELSE(LIBINTL_LIBRARIES)
MESSAGE( "-- libintl not found" )
ENDIF(LIBINTL_LIBRARIES)
---

Any help is appreciated. Thanks.
--
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
Kai-Uwe Behrmann
2016-12-26 08:15:56 UTC
Permalink
Hello Boris,
...
Post by Boris Samorodov
Hi All,
[...]
-- Looking for libintl.h
-- Looking for libintl.h - not found
[...]
---
% ls -l /usr/local/include/libintl.h
-rw-r--r-- 1 root wheel 16654 Dec 10 04:41 /usr/local/include/libintl.h
% ls -l /usr/local/lib/libintl.*
-rw-r--r-- 1 root wheel 110318 Dec 10 04:41 /usr/local/lib/libintl.a
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41 /usr/local/lib/libintl.so
-> libintl.so.8.1.5
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41
/usr/local/lib/libintl.so.8 -> libintl.so.8.1.5
-rw-r--r-- 1 root wheel 55245 Dec 10 04:41
/usr/local/lib/libintl.so.8.1.5
---
---
CHECK_INCLUDE_FILE(libintl.h HAVE_LIBINTL_H)
FIND_LIBRARY( LIBINTL_LIBRARIES NAMES intl libintl libintl-8 )
IF(LIBINTL_LIBRARIES)
SET( EXTRA_LIBS ${EXTRA_LIBS} ${LIBINTL_LIBRARIES} )
SET( EXTRA_LIBS_CORE ${EXTRA_LIBS_CORE} ${LIBINTL_LIBRARIES} )
ELSE(LIBINTL_LIBRARIES)
MESSAGE( "-- libintl not found" )
ENDIF(LIBINTL_LIBRARIES)
---
Any help is appreciated. Thanks.
I believe to remember, there is the possibility to suggest paths for
library and include file search to the cmake macros.

If you are familiar with cmake, you could try yourself. Here is the docu:
https://cmake.org/cmake/help/v3.0/command/find_path.html

I am astound that the standard /usr/local prefix is not supported by
default in the search.

best regards
Kai-Uwe
Boris Samorodov
2016-12-26 15:56:40 UTC
Permalink
Hi Kai-Uwe,

thanks for your help.
Post by Kai-Uwe Behrmann
Hello Boris,
...
Post by Boris Samorodov
Hi All,
[...]
-- Looking for libintl.h
-- Looking for libintl.h - not found
[...]
---
% ls -l /usr/local/include/libintl.h
-rw-r--r-- 1 root wheel 16654 Dec 10 04:41 /usr/local/include/libintl.h
% ls -l /usr/local/lib/libintl.*
-rw-r--r-- 1 root wheel 110318 Dec 10 04:41 /usr/local/lib/libintl.a
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41 /usr/local/lib/libintl.so
-> libintl.so.8.1.5
lrwxr-xr-x 1 root wheel 16 Dec 10 04:41
/usr/local/lib/libintl.so.8 -> libintl.so.8.1.5
-rw-r--r-- 1 root wheel 55245 Dec 10 04:41
/usr/local/lib/libintl.so.8.1.5
---
---
CHECK_INCLUDE_FILE(libintl.h HAVE_LIBINTL_H)
FIND_LIBRARY( LIBINTL_LIBRARIES NAMES intl libintl libintl-8 )
IF(LIBINTL_LIBRARIES)
SET( EXTRA_LIBS ${EXTRA_LIBS} ${LIBINTL_LIBRARIES} )
SET( EXTRA_LIBS_CORE ${EXTRA_LIBS_CORE} ${LIBINTL_LIBRARIES} )
ELSE(LIBINTL_LIBRARIES)
MESSAGE( "-- libintl not found" )
ENDIF(LIBINTL_LIBRARIES)
---
Any help is appreciated. Thanks.
I believe to remember, there is the possibility to suggest paths for
library and include file search to the cmake macros.
https://cmake.org/cmake/help/v3.0/command/find_path.html
OK, the following patch helped:
=====
--- CMakeLists.txt.orig 2016-12-09 13:36:53.000000000 +0300
+++ CMakeLists.txt 2016-12-26 17:57:38.831330000 +0300
@@ -66,6 +66,10 @@
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
ENDIF(UNIX)

+# Add /usr/local/include to search path
+IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ SET(CMAKE_REQUIRED_INCLUDES "/usr/local/include" "/usr/include")
+ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")

# detect top level projects
IF(USE_SYSTEM_YAJL)
=====

I used a strict match which may be too broad, but is enough for my case.
Post by Kai-Uwe Behrmann
I am astound that the standard /usr/local prefix is not supported by
default in the search.
Well, yes. And the thing is that some libraries (not includes, i.e.
libcups.so) are got found. However, libiconv.so is not detected.
Weird.

Thank you!
--
WBR, bsam
Loading...