Cross compilation of Openntpd fails at configure

Hi All,
We are looking at migrating some userspace apps to an openWRT SDK along with some native openWRT packages.
While doing so for openntpd, we are running into the below error, and i see that configure keeps ignoring any additional option that i try to add via Makefile.

 ./configure --target=i486-openwrt-linux --host=i486-openwrt-linux --build=x86_64-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  ; fi; )
configure: loading site script /home/developer1/owrt_sasi/openwrt_packages/openwrt-21.02/include/site/i386
checking for i486-openwrt-linux-gcc... i486-openwrt-linux-musl-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i486-openwrt-linux-musl-gcc accepts -g... yes
checking for i486-openwrt-linux-musl-gcc option to accept ANSI C... none needed
checking for i486-openwrt-linux-ranlib... i486-openwrt-linux-musl-gcc-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for ar... /usr/bin/ar
checking for inline... inline
checking build system type... x86_64-pc-linux-gnu
checking host system type... i486-openwrt-linux-gnu
checking how to run the C preprocessor... i486-openwrt-linux-musl-gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking ctype.h usability... yes

checking for u_char... yes
checking for sig_atomic_t... yes
checking for socklen_t... yes
checking OpenSSL header version... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
make[2]: *** [/home/developer1/owrt_sasi/openwrt_packages/openwrt-21.02/build_dir/target-i386_pentium4_musl/openntpd-3.6.1p1/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1

Is there any way out of this, and we tried passing the openssl path via -with-ssl-dir option, also tried --with-builtin-arc4random (which works on manual execution), but when the same package is compiled as part of full make, these options are getting ignored.

Below is the Make compile snippet:

define Build/Compile
        (cd $(PKG_BUILD_DIR); autoconf; autoheader; rm -f config.cache; \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
                ./configure \
                --with-ssl-dir=$(TARGET_DIR)/etc/ssl \
                --target=$(GNU_TARGET_NAME) \
                --host=$(GNU_TARGET_NAME) \
                --build=$(GNU_HOST_NAME) \
                --prefix=/usr \
                --sysconfdir=/etc \
                --with-builtin-arc4random \
        touch $(OPENNTPD_DIR)/.configured;

Any pointers would be of great help!

Thanks in advance!

I don’t see this in openwrt/packages. What version of OpenWrt are you running?

the version we are using is 21.02

The issue got resolved , using ntpd, native openwrt package. Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.