NTP 4.2.8P9 Cross-compilation under Cygwin

Source: Internet
Author: User
Tags openssl library

Summary: NTP (Network Time Protocol) is the protocol that is a time-of-day protocol for a PC, handheld device, other terminal, or server to calibrate. For example, both Windows and Linux systems have a corresponding time calibration, which uses the NTP protocol. The NTP protocol is implemented based on C, and the code is cross-platform and can be compiled and run on Windows, Linux, and other platforms. NTP's official Protocol implementation Library, currently the latest version is 4.2.8P9. NTP4.2.8P9 for security reasons, this version relies on the OpenSSL library, the author tried to support the version of OpenSSL 0.98, with openssl1.1.0e version can be supported.
1. Preparation
1) Openssl:openssl 1.1.0. (The cross-compiled article see "Cygwin Cross-compiling openssl1.1.0e")

2) Cygwin 32

3) Third-party compilation tool chain
2. Compiling the configuration
#./configure--host=arm-linux--prefix=/usr/local/arm-ntp--with-yielding-select=no CFLAGS=-I/usr/local/arm/ 3.3.4/arm-linux/sys-root/usr/include ldflags= "-l/usr/local/arm/3.3.4/arm-linux/sys-root/lib-l/usr/local/arm/ 3.3.4/arm-linux/sys-root/usr/lib "--with-openssl-libdir=/usr/local/arm-ssl/lib--with-openssl-incdir=/usr/local/ Arm-ssl/include
here is a description of the Configure configuration parameters:
1) Where--host=arm-linux specifies the environment in which the target is to run, Arm-linux actually crosses the compiler prefix, configure script recognizes the Arm-linux keyword and identifies the target system as a Linux arm platform.
2)--prefix=/usr/local/arm-ntp This parameter indicates that running make install after compiling will install the generated target program, library, Help, configuration, and so on to this directory.
3) cflags=-i/usr/local/arm/3.3.4/arm-linux/sys-root/usr/include indicates the parameters at compile time,-I indicates the header file directory to include, or the header file directory of the cross-compilation toolchain.
4) ldflags= "-l/usr/local/arm/3.3.4/arm-linux/sys-root/lib-l/usr/local/arm/3.3.4/arm-linux/sys-root/usr/lib" Indicates the link parameter,-l indicates the directory where the link library resides, or the library file directory of the cross-compilation toolchain.
5)--with-openssl-libdir=/usr/local/arm-ssl/lib indicates the corresponding path to the OpenSSL library.
6)--with-openssl-incdir=/usr/local/arm-ssl/include indicates the corresponding path of the OpenSSL header file.
any of the above configuration is not good, there will be compile or link problems.

3. Compiling
#make
#make Install

in the current generation process LIBNTP, SNTP, ntpdate and so on can compile the link normally, but in the ntpd compile problems, but not with OpenSSL is related to limits.h header file, there may be a configuration problem, is still in the solution.

This article is from "Some ideas" blog, be sure to keep this source http://wangyw.blog.51cto.com/4075460/1928676

NTP 4.2.8P9 Cross-compilation under Cygwin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.