LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   regarding cross compilation of ntp (https://www.linuxquestions.org/questions/linux-newbie-8/regarding-cross-compilation-of-ntp-4175541951/)

sumanthlinux 05-08-2015 02:52 AM

regarding cross compilation of ntp
 
hi all,
I am new to cross compilation .I am trying to cross compile ntp for arm based zync soc board. so i have downloaded ntp source code version ntp-4.2.8-p2

i gave options for confiure file like this ./configure --host=arm-xilinix-linux-gnueabi --build=x86_64-pc-linux-gnu --prefix=/home/sntp CC=arm-xilinx-linux-gnueabi-gcc -with-yeilding-select=yes
configuration is succesful but when i am going for make it is throwing an error like this

cd ./html && \
../scripts/build/checkHtmlFileDates
cd . && \
./scripts/build/checkChangeLog
make all-recursive
make[1]: Entering directory `/home/SNTP/ntp-4.2.8p2'
Making all in sntp
make[2]: Entering directory `/home/SNTP/ntp-4.2.8p2/sntp'
[ ! -r ./../COPYRIGHT ] \
|| [ check-COPYRIGHT-submake -nt ./../COPYRIGHT ] \
|| make check-COPYRIGHT-submake
cd ../libntp && make libntp.a
make[3]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/libntp'
CC systime.o
In file included from ../include/ntp.h:14:0,
from systime.c:9:
../include/ntp_crypto.h:27:25: fatal error: openssl/evp.h: No such file or directory
#include "openssl/evp.h"
^
compilation terminated.
make[3]: *** [systime.o] Error 1
make[3]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/libntp'
make[2]: *** [../libntp/libntp.a] Error 2
make[2]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2'
make: *** [all] Error 2

suggest me how to fix this?

Regards
sumanth

jpollard 05-08-2015 07:18 AM

Have you already cross compiled openssl?

The libraries and header include files need to be specified too (using a -I option to include the path to the cross compiled result for program development).

What frequently happens in a .configure is that it looks for the library (which may exist), but not always look for the development include files. Without the direction to the include file it will attempt to use the systems /usr/include directory instead - and possibly get the wrong definitions. In this case, the missing include file.

You will have to check with the .configure help reference (normally included...) to see what you have to add for this. Usually something like "SSLLIB=...." or just "LIBS=...", and "INCLUDES=...".

sumanthlinux 05-08-2015 09:25 AM

i have downloaded openssl-10.2.a source file , i have cross compiled it libcrypto.so,libssl.so files are not generated only .a files generated .
when i am going for cross compilation of ntp it is showing like this

cd ./html && \
../scripts/build/checkHtmlFileDates
cd . && \
./scripts/build/checkChangeLog
make all-recursive
make[1]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2'
Making all in sntp
make[2]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
[ ! -r ./../COPYRIGHT ] \
|| [ check-COPYRIGHT-submake -nt ./../COPYRIGHT ] \
|| make check-COPYRIGHT-submake
make all-recursive
make[3]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
Making all in include
make[4]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/include'
Making all in scripts
make[4]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/scripts'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/scripts'
Making all in libevent
make[4]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libevent'
make all-am
make[5]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libevent'
make[5]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libevent'
make[4]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libevent'
Making all in libopts
make[4]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libopts'
make all-am
make[5]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libopts'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libopts'
make[4]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp/libopts'
make[4]: Entering directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
env CSET=`cat ./scm-rev` ./../scripts/build/mkver sntp
Version <sntp 4.2.8p2@1.3265-o Fri May 8 10:55:32 UTC 2015 (3)>
env CCACHE_DISABLE=1 arm-xilinx-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I./../include -I./../lib/isc/include -I./../lib/isc/pthreads/include -I./../lib/isc/unix/include -I./libopts -I./libevent/include -I./libevent/include -Wall -Wcast-align -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Winit-self -Wstrict-overflow -Wno-strict-prototypes -g -O2 -c version.c -o version.o
CCLD sntp
/home/zynq/peta_linux/2014.4/installation/petalinux-v2014.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.8.3/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lssl
/home/zynq/peta_linux/2014.4/installation/petalinux-v2014.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.8.3/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make[4]: *** [sntp] Error 1
make[4]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2/sntp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sumanth/SNTP/ntp-4.2.8p2'
make: *** [all] Error 2

jpollard 05-08-2015 03:31 PM

The .a file should be ok. The problem is still that the compiler isn't being pointed to the libraries.

suicidaleggroll 05-08-2015 03:59 PM

You need to tell the configure script where to look for your cross-compiled ssl.

It'll often look something like:
./configure --with-openssl=/path/to/your/openssl/directory

You can run "./configure --help" to get a list of options

sumanthlinux 05-14-2015 04:28 AM

regarding cross compilation of ntp Reply to Thread
 
i have cross compiled ntp for my target ,it has generated bin files for ntp like ntpdate,ntpd .now i will place these files in my board bin folder .after that i need to configure my board as ntp client how i can i do that?
i have found ntp.conf file in /etc but it is readonly .if i adding my server to it is showing readonly file
whether we have to change the permissions for that ?


All times are GMT -5. The time now is 09:12 AM.