Integrating hylafaxplus into yocto

Christo Labuschagne <[email protected]> Wed, 31 Oct 2018 20:56:19 +0200
Newsgroups gmane.comp.telephony.fax.hylafax.user
Message-ID <CALPXzFjKRM8xe-WkTmKb4TBDHR1yFoiATGyiXFg51tcT_PnNrg@mail.gmail.com>
--000000000000c0ad5705798ade87
Content-Type: text/plain; charset="UTF-8"

Good day all

I've been having fun integrating hylafax+ into yocto using a bitbake
recipe.  The problem is the non standard way it requires for running the
compiler.  On buildroot we could just use
arm-none-linux-gnueabi-cpp
but for yocto the compiler is
arm-poky-linux-gnueabi-g++
but also requires the following fields:
-march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5
--sysroot=/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot.

The problem is that you cannot call the compiler without the flags and
passing the flags to all the compiler check and make check functions has
proven to be a bit of a hassle.

I have been able to fix the compiler functions by doing something like this:
checkCompiler()
{
    compiler=$1

*shift    compilerParams=$@*
    if isGNU $compiler; then
    ISGXX=yes
    checkGCCVersion $compiler 2 6 1 || return 1
    else
    ISGXX=no
    fi
    $RM dummy dummy.o
    capture $compiler *${compilerParams}* -o dummy dummy.C && {
    CXX="$compiler *${compilerParams}"*;
    test -z "${CXXCOMPILER:-}" && CXXCOMPILER*1*=`findApp $compiler $PATH`
    *CXXCOMPILER="${CXXCOMPILER1} ${compilerParams}";*
    return 0
    }
    return 1
}

Something similar for the gcc checks.  Now I'm having issues with the make
part.  I can try and fix that as well, but I'm wondering if I'm not doing
something wrong as I'm not to schooled with configure.

calling configure like follows (added newlines just to make reading easier):
./configure
--with-CC="arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mfpu=neon
-mfloat-abi=hard -mcpu=cortex-a5
--sysroot=/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot"

--with-CXX="arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon
-mfloat-abi=hard -mcpu=cortex-a5
--sysroot=/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot"

--nointeractive
--disable-nls
--disable-pam
--disable-ldap
--with-AWK="/usr/bin/awk"
--with-TIFFBIN="/usr/bin"
--with-LIBTIFF="-ltiff -lm -lc"
--with-LIBJPEG="-ljpeg"
--with-LIBZ="-lz"
--with-LIBJBIG="-ljbig"
--with-LIBLCMS="-llcms2"
--with-TIFFINC="-I/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot/usr/include"

--with-ZLIBINC="-I/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot/usr/include"

--with-PATH_AFM="/usr/share/ghostscript/9.21/Resource/Init:
/usr/share/ghostscript/9.21/lib:/usr/share/ghostscript/9.21/Resource/Font:
/usr/share/ghostscript/fonts:/usr/share/fonts"
--with-FONTMAP="/var/spool/hylafax/etc"
--with-INSTALLROOT="/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/image"

--with-PATH_GSRIP="/usr/bin/gs"
--with-SCRIPT_SH="/bin/sh"

Currently stuck a if it makes a difference)t:
| Missing C++ runtime support for arm-poky-linux-gnueabi-g++ -march=armv7-a
-marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5
--sysroot=/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot
(/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
-march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5
--sysroot=/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot).
|
| Compilation of the following test program failed:
|
| ----------------------------------------------------------
| #include <iostream>
| int main(){ std::cout << "Hello World!" << std::endl; return 0;}
|
| #include <iostream>
| int main(){ std::cout << "Hello World!" << std::endl; return 0;}
| ----------------------------------------------------------
|
| Usually this is because you do not have a standard C++ library
| installed on your system or you have installed it in a non-standard
| location.  If you do not have a C++ library installed, then you must
| install it.  If it is installed in a non-standard location, then you
| should configure the compiler so that it will automatically be found.
|
| (For recent gcc releases this is libstdc++, for older gcc - libg++)

Kind regards
Christo

--000000000000c0ad5705798ade87
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>Good day all</div><div><br=
></div><div>I&#39;ve been having fun integrating hylafax+ into yocto using =
a bitbake recipe.=C2=A0 The problem is the non standard way it requires for=
 running the compiler.=C2=A0 On buildroot we could just use <br></div><div>=
arm-none-linux-gnueabi-cpp <br></div><div>but for yocto the compiler is <br=
></div><div>arm-poky-linux-gnueabi-g++ <br></div><div>but also requires the=
 following fields:</div><div>-march=3Darmv7-a -marm -mfpu=3Dneon -mfloat-ab=
i=3Dhard -mcpu=3Dcortex-a5 --sysroot=3D/home/cl/workspace/yokto/poky/build-=
microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/=
recipe-sysroot.</div><div><br></div><div>The problem is that you cannot cal=
l the compiler without the flags and passing the flags to all the compiler =
check and make check functions has proven to be a bit of a hassle.</div><di=
v><br></div><div>I have been able to fix the compiler functions by doing so=
mething like this:</div><div>checkCompiler()<br>{<br>=C2=A0=C2=A0=C2=A0 com=
piler=3D$1<br>=C2=A0=C2=A0=C2=A0 <b>shift<br>=C2=A0=C2=A0=C2=A0 compilerPar=
ams=3D$@</b><br>=C2=A0=C2=A0=C2=A0 if isGNU $compiler; then<br>=C2=A0=C2=A0=
=C2=A0 ISGXX=3Dyes<br>=C2=A0=C2=A0=C2=A0 checkGCCVersion $compiler 2 6 1 ||=
 return 1<br>=C2=A0=C2=A0=C2=A0 else<br>=C2=A0=C2=A0=C2=A0 ISGXX=3Dno<br>=
=C2=A0=C2=A0=C2=A0 fi<br>=C2=A0=C2=A0=C2=A0 $RM dummy dummy.o<br>=C2=A0=C2=
=A0=C2=A0 capture $compiler <b>${compilerParams}</b> -o dummy dummy.C &amp;=
&amp; {<br>=C2=A0=C2=A0=C2=A0 CXX=3D&quot;$compiler <b>${compilerParams}&qu=
ot;</b>;<br>=C2=A0=C2=A0=C2=A0 test -z &quot;${CXXCOMPILER:-}&quot; &amp;&a=
mp; CXXCOMPILER<b>1</b>=3D`findApp $compiler $PATH`<br>=C2=A0=C2=A0=C2=A0 <=
b>CXXCOMPILER=3D&quot;${CXXCOMPILER1} ${compilerParams}&quot;;</b><br>=C2=
=A0=C2=A0=C2=A0 return 0<br>=C2=A0=C2=A0=C2=A0 }<br>=C2=A0=C2=A0=C2=A0 retu=
rn 1<br>}</div><div><br></div><div>Something similar for the gcc checks.=C2=
=A0 Now I&#39;m having issues with the make part.=C2=A0 I can try and fix t=
hat as well, but I&#39;m wondering if I&#39;m not doing something wrong as =
I&#39;m not to schooled with configure.</div><div><br></div><div>calling co=
nfigure like follows (added newlines just to make reading easier):</div><di=
v>./configure <br>--with-CC=3D&quot;arm-poky-linux-gnueabi-gcc -march=3Darm=
v7-a -marm -mfpu=3Dneon -mfloat-abi=3Dhard -mcpu=3Dcortex-a5 --sysroot=3D/h=
ome/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-l=
inux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot&quot; <br>--with-CXX=3D&qu=
ot;arm-poky-linux-gnueabi-g++ -march=3Darmv7-a -marm -mfpu=3Dneon -mfloat-a=
bi=3Dhard -mcpu=3Dcortex-a5 --sysroot=3D/home/cl/workspace/yokto/poky/build=
-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0=
/recipe-sysroot&quot; <br>--nointeractive <br>--disable-nls <br>--disable-p=
am <br>--disable-ldap <br>--with-AWK=3D&quot;/usr/bin/awk&quot; <br>--with-=
TIFFBIN=3D&quot;/usr/bin&quot; <br>--with-LIBTIFF=3D&quot;-ltiff -lm -lc&qu=
ot; <br>--with-LIBJPEG=3D&quot;-ljpeg&quot; <br>--with-LIBZ=3D&quot;-lz&quo=
t; <br>--with-LIBJBIG=3D&quot;-ljbig&quot; <br>--with-LIBLCMS=3D&quot;-llcm=
s2&quot; <br>--with-TIFFINC=3D&quot;-I/home/cl/workspace/yokto/poky/build-m=
icrochip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/r=
ecipe-sysroot/usr/include&quot; <br>--with-ZLIBINC=3D&quot;-I/home/cl/works=
pace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi=
/hylafaxplus/5.5.9-r0/recipe-sysroot/usr/include&quot; <br>--with-PATH_AFM=
=3D&quot;/usr/share/ghostscript/9.21/Resource/Init: /usr/share/ghostscript/=
9.21/lib:/usr/share/ghostscript/9.21/Resource/Font: /usr/share/ghostscript/=
fonts:/usr/share/fonts&quot; <br>--with-FONTMAP=3D&quot;/var/spool/hylafax/=
etc&quot; <br>--with-INSTALLROOT=3D&quot;/home/cl/workspace/yokto/poky/buil=
d-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r=
0/image&quot; <br>--with-PATH_GSRIP=3D&quot;/usr/bin/gs&quot; <br>--with-SC=
RIPT_SH=3D&quot;/bin/sh&quot;</div><div><br></div><div>Currently stuck a if=
 it makes a difference)t:</div><div>| Missing C++ runtime support for arm-p=
oky-linux-gnueabi-g++ -march=3Darmv7-a -marm -mfpu=3Dneon -mfloat-abi=3Dhar=
d -mcpu=3Dcortex-a5 --sysroot=3D/home/cl/workspace/yokto/poky/build-microch=
ip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-=
sysroot (/home/cl/workspace/yokto/poky/build-microchip/tmp/work/cortexa5hf-=
neon-poky-linux-gnueabi/hylafaxplus/5.5.9-r0/recipe-sysroot-native/usr/bin/=
arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -march=3Darmv7-a -marm -m=
fpu=3Dneon -mfloat-abi=3Dhard -mcpu=3Dcortex-a5 --sysroot=3D/home/cl/worksp=
ace/yokto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/=
hylafaxplus/5.5.9-r0/recipe-sysroot).<br>| <br>| Compilation of the followi=
ng test program failed:<br>| <br>| ----------------------------------------=
------------------<br>| #include &lt;iostream&gt;<br>| int main(){ std::cou=
t &lt;&lt; &quot;Hello World!&quot; &lt;&lt; std::endl; return 0;}<br>| <br=
>| #include &lt;iostream&gt;<br>| int main(){ std::cout &lt;&lt; &quot;Hell=
o World!&quot; &lt;&lt; std::endl; return 0;}<br>| ------------------------=
----------------------------------<br>| <br>| Usually this is because you d=
o not have a standard C++ library<br>| installed on your system or you have=
 installed it in a non-standard<br>| location.=C2=A0 If you do not have a C=
++ library installed, then you must<br>| install it.=C2=A0 If it is install=
ed in a non-standard location, then you<br>| should configure the compiler =
so that it will automatically be found.<br>| <br>| (For recent gcc releases=
 this is libstdc++, for older gcc - libg++)<br></div><div><br></div><div>Ki=
nd regards</div><div>Christo<br></div></div></div></div></div></div></div><=
/div>

--000000000000c0ad5705798ade87--


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe [email protected] < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail [email protected].*