GUILE_CFLAGS += -DGC_NO_DLOPEN
endif
+# It can use readline, but on the condition that it was build against
+# ncurses. If both aren't present disable readline support since the
+# host readline/ncurses support can poison the build.
+ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_READLINE),yy)
+GUILE_CONF_OPTS += --with-libreadline-prefix=$(STAGING_DIR)/usr
+GUILE_DEPENDENCIES += readline
+else
+GUILE_CONF_OPTS += --without-libreadline-prefix
+endif
+
GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \
CFLAGS="$(TARGET_CFLAGS) $(GUILE_CFLAGS)"