jirib writes

Hi,

I’m building 1.21.6 on OpenBSD 5.9-current from 2016-04-02 with --with-inotify and it fails because OpenBSD does put libinotify inside /usr/local/include/inotify and /usr/local/lib/inotify.

Following causes the build pass the issue but I suppose there is much cleaner solution - based on results on configure script.

--- mk/OpenBSD.orig     Mon Apr 18 20:21:46 2016
+++ mk/OpenBSD  Mon Apr 18 20:25:38 2016
@@ -2,5 +2,5 @@ include $(depth)/mk/commondefs
 include $(depth)/mk/localdefs

 ALL_CXXFLAGS = $(CXXFLAGS) $(COMMONCXXFLAGS) $(LOCALCXXFLAGS) \
-        -pthread  -I/usr/include
+        -pthread  -I/usr/include -I/usr/local/include/inotify -L/usr/local/lib/inotify -linotify
 LIBSYS =

Here’s original fail output.

iofactory.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::less<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >  >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >  >::find(std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const&)':
iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE4findERS1_+0x125): warning: undefined reference to `__stack_smash_handler'
iofactory.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::less<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >  >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >  >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* > const&)':
iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE9_M_insertEPSt18_Rb_tree_node_baseSD_RKS5_+0x127): warning: undefined reference to `__stack_smash_handler'
iofactory.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::less<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >  >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >  >::_M_insert_unique(std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* > const&)':
iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE16_M_insert_uniqueERKS5_+0x199): warning: undefined reference to `__stack_smash_handler'
iofactory.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::less<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >  >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >  >::lower_bound(std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const&)':
iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE11lower_boundERS1_+0xc1): warning: undefined reference to `__stack_smash_handler'
iofactory.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::less<std::basic_string<char, std::char_traits<char >, std::allocator<char >  >  >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >  >::_M_insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* >  >, std::pair<std::basic_string<char, std::char_traits<char >, std::allocator<char >  > const, Binc::IODevice* > const&)':
iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE16_M_insert_uniqueESt17_Rb_tree_iteratorIS5_ERKS5_+0x36c): warning: undefined reference to `__stack_smash_handler'
iofactory.o:iofactory.cc:(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairIKSsPN4Binc8IODeviceEESt10_Select1stIS5_ESt4lessISsESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E+0xc2): warning: more undefined references to `__stack_smash_handler' follow
rm -f librecoll.so
ln -s librecoll.so.1.21.6 librecoll.so
make -C index depend recollindex
c++ -M -O2 -pipe  -I.  -I../aspell  -I../bincimapmime  -I../common  -I../index  -I../internfile  -I../rcldb  -I../unac  -I../utils  -Wall -Wno-unused  -I/usr/local/lib/../include -I/usr/local/include   -DRECOLL_DATADIR=\"/usr/local/share/recoll\"  -fPIC -DPIC  -DHAVE_CONFIG_H  -pthread  -I/usr/include recollindex.cpp rclmonrcv.cpp rclmonprc.cpp  > alldeps
rclmonrcv.cpp:525:25: error: sys/inotify.h: No such file or directory
*** Error 1 in index (../mk/commontargets:7 'alldeps.stamp')
*** Error 1 in /home/jirib/openbsd/pobj/recoll-1.21.6-no_x11/recoll-1.21.6 (Makefile:21 'all')
*** Error 1 in . (/home/jirib/cvs/openbsd-ports/infrastructure/mk/bsd.port.mk:2722 '/home/jirib/openbsd/pobj/recoll-1.21.6-no_x11/.build_done')
*** Error 1 in /home/jirib/git/openbsd-mystuff/x11/recoll (/home/jirib/cvs/openbsd-ports/infrastructure/mk/bsd.port.mk:2444 'all')

And here is my WIP OpenBSD port Makefile.

# $OpenBSD$

COMMENT=        full-text search tool for desktops
DISTNAME=       recoll-1.21.6
CATEGORIES=     x11

HOMEPAGE=       http://www.lesbonscomptes.com/recoll/

# GPLv2+
PERMIT_PACKAGE_CDROM=   Yes

MASTER_SITES=   ${HOMEPAGE}

MODULES =       lang/python

FLAVORS=        no_x11
FLAVOR?=

MODPY_RUNDEP=   Yes

BUILD_DEPENDS=  databases/xapian-core \
                ${MODPY_LIB_DEPENDS}
LIB_DEPENDS=    devel/libinotify
RUN_DEPENDS=    archivers/unrar \
                archivers/unzip \
                audio/py-mutagen \
                databases/xapian-core \
                graphics/djvulibre \
                graphics/p5-Image-EXIF \
                misc/shared-mime-info \
                print/detex \
                print/lyx \
                print/poppler-utils \
                print/texlive/base \
                textproc/antiword \
                textproc/catdoc \
                textproc/libwpd \
                textproc/libxslt \
                textproc/unrtf

CONFIGURE_STYLE=gnu
CONFIGURE_ARGS+=--with-inotify --without-fam
CONFIGURE_ENV+= QMAKE=qmake4


.if ${FLAVOR:Mno_x11}
CONFIGURE_ARGS+=--disable-qtgui --disable-webkit --disable-x11mon
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include -I${LOCALBASE}/include/inotify" \
                LDFLAGS="-L${LOCALBASE}/lib -L${LOCALBASE}/lib/inotify"
.else
MODULES+=       x11/qt4
RUN_DEPENDS+=   devel/desktop-file-utils
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include -I${LOCALBASE}/include/inotify"
CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib -L${LOCALBASE}/lib/inotify"
.endif

# XXX: no hardcoded /usr/local and python
pre-configure:
        ${SUBST_CMD} ${WRKSRC}/configure
        ${SUBST_CMD} ${WRKSRC}/python/recoll/Makefile

# XXX
pre-install:
        ${SUBST_CMD} ${WRKSRC}/recollinstall

# XXX: python scripts for various files
post-install:
        cd ${PREFIX}/share/recoll/filters ; \
                for i in *; do \
                        ${MODPY_BIN_ADJ} $$i; \
                done

.include <bsd.port.mk >

Thank you for help.

j.

jirib writes

Correction for original fail output.

jirib writes

It seems CPPFLAGS and LDFLAGS which are set during configure (see CONFIGURE_ENV in my OpenBSD port Makefile) are "lost" later during build.

jirib writes

PEBKAC issue. Solved by passing CPPFLAGS and LDFLAGS via MAKE_ENV and it works now.

jirib writes

not a bug