libnids can make use of libglib2 for multi-threading support, so use
that when available.
The configure.in script is flawed: passing either --enable-libglib or
--disabel-libglib will both disable support for libglib. Only when
neither is passed will the autodetection test be executed, at which
point (hopefully) libglib2 will be enabled if found.
So, unlike our usual practice, we can;t explcitly enable it; we can only
explicitly disable it, and rely on autodetection to enable it.
Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
[yann.morin.1998@free.fr:
- add missing dependency on libglib2
- expand commit log to explain why we don't --enable-libglib
- add a simmilar blurb in the .mk
- fix condition, use positive logic since we have an else-clause
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
LIBNIDS_INSTALL_STAGING = YES
LIBNIDS_DEPENDENCIES = host-pkgconf libpcap
LIBNIDS_AUTORECONF = YES
-LIBNIDS_CONF_OPTS = \
- --disable-libglib \
- --disable-libnet
+LIBNIDS_CONF_OPTS = --disable-libnet
+
+# disable libglib2 if not available
+# The test in configure.in is flawed: passing --enable-libglib would also
+# disable it. Only when neither is passed will the autodetection test be
+# executed.
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+LIBNIDS_DEPENDENCIES += libglib2
+else
+LIBNIDS_CONF_OPTS += --disable-libglib
+endif
+
# hand-written Makefile.in, not using automake, needs a custom
# variable for the installation path.
LIBNIDS_INSTALL_STAGING_OPTS = install_prefix=$(STAGING_DIR) install