<div dir="ltr">Hello everyone, <div><br></div><div>The latest update is that by changing a couple of things in <a title="source-builder/config/ptpd-2-1.cfg" class="gmail-link-gray-dark" href="https://github.com/RTEMS/rtems-source-builder/commit/200b83b105265e6b52f6265ee7390c4c483df116#diff-0f49c6def4c177b0c2ab54bd81c54327" style="box-sizing:border-box;background-color:rgb(250,251,252);text-decoration-line:none;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;color:rgb(36,41,46)">source-builder/config/ptpd-2-1.cfg</a><font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace"><span style="font-size:12px;background-color:rgb(250,251,252)"> which are:</span></font></div><div><font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace"><span style="font-size:12px;background-color:rgb(250,251,252)"><br></span></font></div><div>"%source setup ptpd -q -n ptpd-%{ptpd_version}<br>%patch setup ptpd -p1<br><br>+automake --add-missing <br>+autoreconf --install --force <br>cd ${build_top}<br><br>%build"<font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace"><span style="font-size:12px;background-color:rgb(250,251,252)"><br></span></font></div><div><br></div><div>GitHub Link: <a href="https://github.com/RTEMS/rtems-source-builder/commit/413ea684f1e8672f921ce80abbc59f1e352acbc2">https://github.com/RTEMS/rtems-source-builder/commit/413ea684f1e8672f921ce80abbc59f1e352acbc2</a></div><div><br></div><div>The earlier configure: error: cannot find install-sh, install.sh, or shtool in build-aux "../ptpd-master"/build-aux has gone</div><div>but another error has come as follows:</div><div><br></div><div>"<a href="http://configure.ac:28">configure.ac:28</a>: installing './compile'</div><a href="http://configure.ac:16">configure.ac:16</a>: installing './install-sh'<br><a href="http://configure.ac:16">configure.ac:16</a>: installing './missing'<br><a href="http://configure.ac:13">configure.ac:13</a>: error: required file '<a href="http://config.h.in">config.h.in</a>' not found<br>src/Makefile.am: installing './depcomp'<br>shell cmd failed: /bin/sh -ex  /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build<br>error: building ptpd-master-arm-rtems5-1"<div><br></div><div>What can be the reason for this? Should I create another tar of this and set it as the source?</div><div>The trace and report are attached. The tutorial by Heinz has again helped me a lot! </div><div>Thank you for that again!</div><div><br></div><div>Thanks,</div><div>Mritunjay<br><div><font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace"><span style="font-size:12px;background-color:rgb(250,251,252)"><br></span></font></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 14, 2020 at 3:07 AM Mritunjay Sharma <<a href="mailto:mritunjaysharma394@gmail.com">mritunjaysharma394@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">First of all Heinz, I would like to thank you for such a wonderful guide which really helped me fix a lot of errors. <div>After following your advice, I made certain changes to make PTPd work, <div>few errors came again but I managed to remove them with the use of Google. </div><div><br></div><div>However, the recent most error has caught me in a fix and I am still trying to figure it out where I went wrong. </div><div><br></div><div><a href="https://github.com/mritunjaysharma394/rtems-source-builder/tree/master/source-builder" target="_blank">https://github.com/mritunjaysharma394/rtems-source-builder/tree/master/source-builder</a><br></div><div><a href="https://github.com/ptpd/ptpd/compare/master...mritunjaysharma394:master" target="_blank">https://github.com/ptpd/ptpd/compare/master...mritunjaysharma394:master</a><br></div><div><br></div><div>The above two links will tell what changes I have made and the error that I am receiving now is: </div><div>"configure: WARNING: unrecognized options: --disable-shared</div>configure: error: cannot find install-sh, install.sh, or shtool in build-aux "../ptpd-master"/build-aux<br>shell cmd failed: /bin/sh -ex  /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build<br>error: building ptpd-master-arm-rtems5-1"<div><br></div><div><br></div><div>I have attached the trace log file and error report. </div></div><div>I tried to google and made few more changes in ptpd Makefile.am but it didn't help.</div><div><br></div><div>It will be very kind of you all to help me figure out on how to tackle this bug.</div><div><br></div><div>Thanks</div><div>Mritunjay</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 7, 2020 at 10:19 AM junkes <<a href="mailto:junkes@fhi-berlin.mpg.de" target="_blank">junkes@fhi-berlin.mpg.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p><span>This is an unusually long text for the mailing list. I tried to write a kind <br>of tutorial using an example for a GSOC student. I'm looking forward to the <br>comments from the pros and can write it down completely. <br><br>Hello, Mritunjay<br><br>if I understood it correctly, one idea of the rtems source builder is to make existing <br>software packages usable for RTEMS. Most existing software packages do not work without <br>changes in the RTEMS environment. You have already noticed this with ptpd ;-) <br><br>The most common auto-tools and configure have trouble making the correct <br>assumptions for the rtems environment. Here you have to intervene. This can <br>be done with the builder-cfg files. <br><br>This is a bit of hard work and you have to approach it with small steps. <br>You also have to use not so clean tricks in different places. When you have <br>achieved the integration you can/must then try to optimize it so that it becomes <br>generally valid. <br><br>That's my policy. Maybe the others here in the maillist have more ideas, also for me. <br><br>I have now tried to implement what I mean using a similar example (openntp). <br>Unfortunately, I haven't finished yet, but I hope to clear a few hurdles for you. <br><br>I was doing some digging around and I came across this: <br><a href="https://github.com/openntpd-portable/openntpd-portable" target="_blank">https://github.com/openntpd-portable/openntpd-portable</a> <br><br>Here I was then confronted with the same problems as you with autoreconf etc. Here it <br>didn't work, just run autoreconf twice and generate a tar-file for installation like <br>I did with the ptpd from github. <br>Then I found this: <a href="https://artfiles.org/openbsd/OpenNTPD/openntpd-6.2p3.tar.gz" target="_blank">https://artfiles.org/openbsd/OpenNTPD/openntpd-6.2p3.tar.gz</a> <br><br>Now I have made a "standard" config file for rsb: <br><br># <br># OpenNTPd 6.2p3 Version 1. <br># <br># This configuration file configure's, make's and install's OpenNTPd. <br># <br><br>%if %{release} == %{nil} <br>%define release 1 <br>%endif <br><br>Name:      openntpd-%{openntpd_version}-%{_host}-%{release} <br>Summary:   NTP is the Network Time Protocol. <br>Version:   %{openntpd_version} <br>Release:   %{release} <br>URL:       <a href="https://github.com/openntpd-portable" target="_blank">https://github.com/openntpd-portable</a> <br><br># <br># NTP Source <br># <br>%source set openntpd <a href="https://artfiles.org/openbsd/OpenNTPD/openntpd-%%7Bopenntpd_version%7D.tar.gz" target="_blank">https://artfiles.org/openbsd/OpenNTPD/openntpd-%{openntpd_version}.tar.gz</a> <br>%hash sha512 openntpd-%{openntpd_version}.tar.gz 56a04bfd8b161b365607673ac80086ff53ae943938fa49bf52edbc541432eca30730a46a4af581fe26ce3bbceb144cb25982a38959b7a3f9304c727fe60f9<br>f50 <br><br># <br># Prepare the source code. <br># <br>%prep<br></span><span style="font-size:10pt">build_top=$(pwd) </span><span><br></span></p>
<p><span><br> source_dir_openntpd="openntpd-%{openntpd_version}" <br> %source setup openntpd -q -n openntpd-%{openntpd_version} <br> %patch setup openntpd -p1 <br><br> cd ${build_top} <br><br>%build <br> build_top=$(pwd) <br><br> %{build_directory} <br><br> mkdir -p ${build_dir} <br> cd ${build_dir} <br><br> %{host_build_flags} <br><br> ../${source_dir_openntpd}/configure \ <br>   --host=%{_host} \ <br>   --prefix=%{_prefix} \ <br>   --bindir=%{_bindir} \ <br>   --exec_prefix=%{_exec_prefix} \ <br>   --includedir=%{_includedir} \ <br>   --libdir=%{_libdir} \ <br>   --libexecdir=%{_libexecdir} \ <br>   --mandir=%{_mandir} \ <br>   --infodir=%{_infodir} \ <br>   --datadir=%{_datadir} \ <br>   --disable-shared \ <br>   --enable-static \ <br>   --with-gnu-ld \ <br>   --disable-https-constraint <br><br> %{__make} all <br><br> cd ${build_top} <br><br>%install <br> build_top=$(pwd) <br><br> %{__rmdir} $SB_BUILD_ROOT <br></span></p>
<p><span>cd ${build_dir} <br> %{__make} DESTDIR=$SB_BUILD_ROOT install <br> cd ${build_top} <br><br><br>Then I "executed" that. <br>[h1@earth rtems (master *)]$ ../source-builder/sb-set-builder --log log.ntpd.txt --with-rtems-bsp=xilinx_zynq_a9_qemu --host=arm-rtems5 --prefix /home/h1/GSOC/RTEMS/5.0.0-m20<br>03 net/ntpd <br>RTEMS Source Builder - Set Builder, 5 (26e335ca159e modified) <br>Build Set: net/ntpd <br>config: net/openntpd-6.2p3-1.cfg <br>package: openntpd-6.2p3-arm-rtems5-1 <br>building: openntpd-6.2p3-arm-rtems5-1 <br>error: building openntpd-6.2p3-arm-rtems5-1 <br>Build FAILED <br> See error report: rsb-report-openntpd-6.2p3-arm-rtems5-1.txt <br>error: building openntpd-6.2p3-arm-rtems5-1 <br>Build Set: Time 0:00:16.036623 <br>Build FAILED <br><br>Error! I looked at that one: <br>[h1@earth rtems (master *)]$ tail -20 rsb-report-openntpd-6.2p3-arm-rtems5-1.txt <br> CC       setproctitle.lo <br> CC       bsd-setresgid.lo <br> CC       bsd-setresuid.lo <br> CCLD     <a href="http://libcompat.la" target="_blank">libcompat.la</a> <br>arm-rtems5-ar: `u' modifier ignored since `D' is the default (see `U') <br> CCLD     <a href="http://libcompatnoopt.la" target="_blank">libcompatnoopt.la</a> <br>arm-rtems5-ar: `u' modifier ignored since `D' is the default (see `U') <br>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/compat' <br>Making all in src <br>make[1]: Entering directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br> CC       ntpd-client.o <br>arm-rtems5-gcc: fatal error: /home/h1/GSOC/RTEMS/5.0.0-m2003/arm-rtems5/xilinx_zynq_a9_qemu/lib/bsp_specs: attempt to rename spec 'endfile' to already defined spec 'old_endfi<br>le' <br>compilation terminated. <br>Makefile:526: recipe for target 'ntpd-client.o' failed <br>make[1]: *** [ntpd-client.o] Error 1 <br>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br>Makefile:401: recipe for target 'all-recursive' failed <br>make: *** [all-recursive] Error 1 <br>shell cmd failed: /bin/sh -ex  /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/do-build <br><br></span><span>In build/openntpd-6.2p3-arm-rtems5-1/openntpd-6.2p3/src/Makefile.am I found that CFLAGS gets includes twice which leads to this error "attempt to rename..." <br>... <br>ntpd_CFLAGS = $(CFLAGS) <br>ntpd_CFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\" <br>ntpd_CFLAGS += -DLOCALSTATEDIR=\"$(localstatedir)\" <br>... <br><br>Then I changed the cfg-file: <br><br>... <br>%{host_build_flags} <br><br># src/Makefile.am includes CFLAGS twice? <br># this leads to : bsp_specs: attempt to rename spec 'endfile' to already defined spec 'old_endfile' <br># <br> sed -i 's/ntpd_CFLAGS = $(CFLAGS)/ntpd_CFLAGS = $(CFLAGS)/g' ../${source_dir_openntpd}/src/Makefile.am <br> sed -i 's/ntpd_CFLAGS += -DSYSCONFDIR=/ntpd_CFLAGS = -DSYSCONFDIR=/g' ../${source_dir_openntpd}/src/Makefile.am <br><br> ../${source_dir_openntpd}/configure \ <br>   --host=%{_host} \ <br>... <br><br>Now I've come a long way, but <br><br>[h1@earth rtems (master *)]$ tail -20 rsb-report-openntpd-6.2p3-arm-rtems5-1.txt <br>      asnprintf <br> CC       ntpd-ntp.o <br> CC       ntpd-ntp_dns.o <br>../../openntpd-6.2p3/src/ntp_dns.c: In function 'ntp_dns': <br>../../openntpd-6.2p3/src/ntp_dns.c:58:6: warning: implicit declaration of function 'setpriority'; did you mean 'setprotoent'? [-Wimplicit-function-declaration] <br> if (setpriority(PRIO_PROCESS, 0, 0) == -1) <br>     ^~~~~~~~~~~ <br>     setprotoent <br>../../openntpd-6.2p3/src/ntp_dns.c:58:18: error: 'PRIO_PROCESS' undeclared (first use in this function); did you mean 'EINPROGRESS'? <br> if (setpriority(PRIO_PROCESS, 0, 0) == -1) <br>                 ^~~~~~~~~~~~ <br>                 EINPROGRESS <br>../../openntpd-6.2p3/src/ntp_dns.c:58:18: note: each undeclared identifier is reported only once for each function it appears in <br>Makefile:624: recipe for target 'ntpd-ntp_dns.o' failed <br>make[1]: *** [ntpd-ntp_dns.o] Error 1 <br>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br>make: *** [all-recursive] Error 1<br></span><span>Makefile:401: recipe for target 'all-recursive' failed <br>shell cmd failed: /bin/sh -ex  /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/do-build <br><br>Now a little bit of searching... <br><br>Adding "#include <rtems/bsd/sys/resource.h>" solves the problem. <br><br>But the next one arises: <br><br>make[1]: Entering directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br> CC       ntpd-ntpd.o <br> CC       ntpd-parse.o <br>parse.y: In function 'yyerror': <br>parse.y:473:6: warning: implicit declaration of function 'vasprintf'; did you mean 'vasnprintf'? [-Wimplicit-function-declaration] <br>parse.y: In function 'yylex': <br>parse.y:686:22: warning: implicit declaration of function 'strtonum'; did you mean 'strtoul'? [-Wimplicit-function-declaration] <br> CC       ntpd-fake-sensors.o <br> CC       ntpd-server.o <br>../../openntpd-6.2p3/src/server.c: In function 'setup_listeners': <br>../../openntpd-6.2p3/src/server.c:65:21: error: 'struct if_data' has no member named 'ifi_rdomain'; did you mean 'ifi_addrlen'? <br>     rdomain = ifd->ifi_rdomain; <br>                    ^~~~~~~~~~~ <br>                    ifi_addrlen <br>Makefile:708: recipe for target 'ntpd-server.o' failed <br><br>That looks a little more complicated. It uses an if_data structure that is probably only available in openbsd? <br><br>But also here google helps ;-) <br>Here I found a patch : <a href="https://github.com/freebsd/freebsd-ports/tree/master/net/openntpd/files" target="_blank">https://github.com/freebsd/freebsd-ports/tree/master/net/openntpd/files</a> <br><br>[h1@earth build-cxc (master *)]$ patch ../openntpd-6.2p3/src/server.c /tmp/openntp/openntpd-6.2p3/patch-src_server.c <br><br>And it's gotten me this far: <br><br>[h1@earth build-cxc (master *)]$ make <br>Making all in include <br>make[1]: Entering directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/include' <br>make[1]: Nothing to be done for 'all'. <br>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/include' <br>Making all in compat <br>make[1]: Entering directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/compat' <br>make[1]: Nothing to be done for 'all'.<br></span><span>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/compat' <br>Making all in src <br>make[1]: Entering directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br> CC       ntpd-server.o <br> CC       ntpd-util.o <br> CCLD     ntpd <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntp_dns.o: in function `ntp_dns': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntp_dns.c:59: undefined reference to `setpriority' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `main': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:243: undefined reference to `setpriority' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/b<br>uild-cxc/src/../../openntpd-6.2p3/src/ntpd.c:251: undefined reference to `daemon' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/b<br>uild-cxc/src/../../openntpd-6.2p3/src/ntpd.c:330: undefined reference to `daemon' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `dispatch_imsg': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:435: undefined reference to `daemon' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `ntpd_adjtime': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:487: undefined reference to `update_time_sy<br>nc_status' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `ntpd_adjfreq': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:498: undefined reference to `adjfreq' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/b<br>uild-cxc/src/../../openntpd-6.2p3/src/ntpd.c:522: undefined reference to `adjfreq' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `ntpd_settime': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:542: undefined reference to `settimeofday' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: ntpd-ntpd.o: in function `readfreq': <br>/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src/../../openntpd-6.2p3/src/ntpd.c:565: undefined reference to `adjfreq' <br>/home/h1/GSOC/RTEMS/5.0.0-m2003/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: /home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/b<br>uild-cxc/src/../../openntpd-6.2p3/src/ntpd.c:574: undefined reference to `adjfreq' <br>collect2: error: ld returned 1 exit status <br>Makefile:476: recipe for target 'ntpd' failed <br>make[1]: *** [ntpd] Error 1 <br>make[1]: Leaving directory '/home/h1/GSOC/RTEMS_DEV/rtems-source-builder/rtems/build/openntpd-6.2p3-arm-rtems5-1/build-cxc/src' <br>Makefile:401: recipe for target 'all-recursive' failed <br>make: *** [all-recursive] Error 1 <br><br>This is where I am now. From now on, it's gonna be exciting. Now it's all about anchoring the daemon process in RTEMS. <br>But that is nice work now. I still have to do it. <br><br>But I wanted to show you this step-by-step so you can get over the first hurdles. <br>I hope this helps you and it was not too long. <br>Heinz<br><br></span></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p id="gmail-m_-8701921339156426664gmail-m_-2733793547016710434reply-intro">On 2020-06-06 01:31, Mritunjay Sharma wrote:</p>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
<div id="gmail-m_-8701921339156426664gmail-m_-2733793547016710434replybody1">
<div dir="ltr">
<div> </div>
<div>Thank you so much Heinz for such a detailed response. </div>
<div>It really helped me a lot.</div>
<div> </div>
As advised by you and Heinz, I changed the source to <a href="https://github.com/mritunjaysharma394/ptpd/archive/master.zip" rel="noopener noreferrer" target="_blank">https://github.com/mritunjaysharma394/ptpd/archive/master.zip</a>
<div>with suggested changes. However, I have encountered few bugs again related to autoreconf. </div>
<div>It looks somewhat like this: </div>
<div> </div>
<div>+ autoreconf -i -v<br>autoreconf: Entering directory `.'<br>autoreconf: <a href="http://configure.ac" rel="noopener noreferrer" target="_blank">configure.ac</a>: not using Gettext<br>autoreconf: running: aclocal -I m4<br>autoreconf: <a href="http://configure.ac" rel="noopener noreferrer" target="_blank">configure.ac</a>: tracing<br>autoreconf: <a href="http://configure.ac" rel="noopener noreferrer" target="_blank">configure.ac</a>: creating directory build-aux<br>autoreconf: <a href="http://configure.ac" rel="noopener noreferrer" target="_blank">configure.ac</a>: not using Libtool<br>autoreconf: running: /home/mritunjay/development/rtems/5/bin/autoconf<br><a href="http://configure.ac:28" rel="noopener noreferrer" target="_blank">configure.ac:28</a>: error: possibly undefined macro: AC_PROG_LIBTOOL<br>      If this token and others are legitimate, please use m4_pattern_allow.<br>      See the Autoconf documentation.<br>autoreconf: /home/mritunjay/development/rtems/5/bin/autoconf failed with exit status: 1<br>shell cmd failed: /bin/sh -ex  /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build<br>error: building ptpd-master-arm-rtems5-1</div>
<div> </div>
<div>I have attached the error report as well and changes in cfg files can be found here:</div>
<div><a href="https://github.com/mritunjaysharma394/rtems-source-builder/commit/6b6bb2b3bd778ebe56e9a1bf3aec1747b078fd39" rel="noopener noreferrer" target="_blank">https://github.com/mritunjaysharma394/rtems-source-builder/commit/6b6bb2b3bd778ebe56e9a1bf3aec1747b078fd39</a></div>
<div> </div>
<div>Thanks,</div>
<div>Mritunjay</div>
<div> </div>
</div>
<br>
<div>
<div dir="ltr">On Fri, Jun 5, 2020 at 2:53 AM Gedare Bloom <<a href="mailto:gedare@rtems.org" rel="noreferrer" target="_blank">gedare@rtems.org</a>> wrote:</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Jun 4, 2020 at 1:38 PM junkes <<a href="mailto:junkes@fhi-berlin.mpg.de" rel="noreferrer" target="_blank">junkes@fhi-berlin.mpg.de</a>> wrote:<br>><br>> Hallo Mritunjay,<br>><br>> You can't just take the github ptpd sources and make them work in RTEMS. You have to make some configuration<br>> and sources changes before you can build the with the rsb.<br>><br>> Some things like the sys/cpuset.h seems not to be fully compatible yet and so the configure simply makes<br>> "wrong" decisions. E.g. defines HAVE_SYS_CPUSET_H = 1 as sys/cpuset.h exists.I played a little bit with it and reset<br>> the definition in ptpd-master/src/ptpd.h  (quick and dirty) and could reduce the error messages because there is a query for<br>> this variable in the code (src/dep/sys.c):<br>><br>> in ptpd.h after the include of the created configs :<br>><br>> ...<br>> #ifdef HAVE_CONFIG_H<br>> # include <config.h><br>> #endif /* HAVE_CONFIG_H */<br>><br>> #undef HAVE_NTP_GETTIME<br>> #undef HAVE_SYS_CPUSET_H<br>><br>> #ifdef linux<br>> ...<br>><br>> in src/dep/sys.c<br>><br>> ...<br>> #ifdef HAVE_SYS_CPUSET_H<br>>        cpuset_t mask;<br>>        CPU_ZERO(&mask);<br>>        if(cpu >= 0) {<br>>            CPU_SET(cpu,&mask);<br>>        } else {<br>>                int i;<br>>                for(i = 0;  i < CPU_SETSIZE; i++) {<br>>                        CPU_SET(i, &mask);<br>>                }<br>>        }<br>>        return(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,<br>>                              -1, sizeof(mask), &mask));<br>> #endif /* HAVE_SYS_CPUSET_H */<br>><br>> In src/dep/constants_dep.h  one can find:<br>><br>> * platform dependent */<br>><br>> #if !defined(linux) && !defined(__NetBSD__) && !defined(__FreeBSD__) && \<br>> !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNXNTO__)<br>> #error PTPD hasn't been ported to this OS - should be possible \<br>> if it's POSIX compatible, if you succeed, report it to <a href="mailto:ptpd-devel@sourceforge.net" rel="noreferrer" target="_blank">ptpd-devel@sourceforge.net</a><br>> #endif<br>><br>> here I added "&& !defined(__rtems__)<br>><br>> and here:<br>> ...<br>> #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun) || defined(__QNXNTO__) || defined(__rtems__)<br>> # include <sys/types.h><br>> # include <sys/socket.h><br>> #ifdef HAVE_SYS_SOCKIO_H<br>> #include <sys/sockio.h><br>> #endif /* HAVE_SYS_SOCKIO_H */<br>> # include <netinet/in.h><br>> # include <net/if.h><br>> # include <net/if_dl.h><br>> # include <net/if_types.h><br>> #ifdef HAVE_NET_IF_ETHER_H<br>> #  include <net/if_ether.h><br>> ...<br>><br>> and so on... You'd have to bite through it once and then you will surely get it compiled.<br>><br>Great start Heinz! Mritunjay, I think this definitely the way forward.<br>Later, you might try to circle back and fix the hacks in nicer ways by<br>learning how to make the autoconf stuff work correctly, and contribute<br>those fixes back upstream to ptpd project.<br><br>> HTH Heinz<br>><br>><br>><br>> On 2020-06-04 20:29, Mritunjay Sharma wrote:<br>><br>><br>><br>> On Thu, Jun 4, 2020 at 11:07 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" rel="noreferrer" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br>><br>> On 04/06/2020 16:22, Gedare Bloom wrote:<br>><br>> >>> In the github version this code is conditional on sys/cpuset.h being present.<br>> >>><br>> > Well, we do have a sys/cpuset.h in newlib. It doesn't have these BSD<br>> > definitions though. Probably either:<br>> > 1. Add more stuff to sys/cpuset.h to make it support BSDisms. This<br>> > would mean adding cpuset_setaffinity support in rtems, I guess.<br>> > 2. Figure out how to disable the conditional code using the<br>> > cpuset_setaffinity function.<br>> The <sys/cpuset.h> is already as compatible as possible to glibc and<br>> FreeBSD. There is always room for improvement, however, in this area it<br>> will be difficult.<br>><br>><br>> Please it would be kind of you all to guide on what is the best thing I can do next. It is looking<br>> a little difficult. If something similar has been done earlier, sharing it can be a lot helpful to take a cue.<br>><br>> Mritunjay<br>><br>> _______________________________________________<br>> devel mailing list<br>> <a href="mailto:devel@rtems.org" rel="noreferrer" target="_blank">devel@rtems.org</a><br>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noopener noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>><br>><br>> _______________________________________________<br>> devel mailing list<br>> <a href="mailto:devel@rtems.org" rel="noreferrer" target="_blank">devel@rtems.org</a><br>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noopener noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote>
</div>
</div>
</blockquote>
<p><br></p>

</div>
</blockquote></div>
</blockquote></div>