<div dir="ltr">SOLUZIONE:<br><div style="font-family:arial,sans-serif;font-size:13px">Passi suggeriti:</div><div style="font-family:arial,sans-serif;font-size:13px">1) installare uno storage USB come filesystem principale <a href="http://wiki.openwrt.org/doc/howto/usb.storage" target="_blank">http://wiki.openwrt.org/doc/howto/usb.storage</a></div>
<div style="font-family:arial,sans-serif;font-size:13px">2) installare i pacchetti per la stampa e cups come consigliato da Francisco Borges <a href="https://github.com/FranciscoBorges/openwrt-printing-packages" target="_blank">https://github.com/FranciscoBorges/openwrt-printing-packages</a> . Non è un pacchetto ufficiale, ma è citato qui: <a href="http://wiki.openwrt.org/doc/howto/cups.server" target="_blank">http://wiki.openwrt.org/doc/howto/cups.server</a></div>
<div style="font-family:arial,sans-serif;font-size:13px">3) installare python sul router</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Passi successivi:</div>
<div style="font-family:arial,sans-serif;font-size:13px">3) scaricare sul PC l'ambiente di compilazione openwrt con mips. Seguire questa guida</div><div style="font-family:arial,sans-serif;font-size:13px"><a href="http://wiki.openwrt.org/doc/howto/buildroot.exigence" target="_blank">http://wiki.openwrt.org/doc/howto/buildroot.exigence</a><br>
</div><div style="font-family:arial,sans-serif;font-size:13px">4) copiare le cartelle /usr/lib e /usr/include dal router alla propria cartella di staging sul PC, all'interno dell'ambiente di compilazione</div><div style="font-family:arial,sans-serif;font-size:13px">
5) Sul computer, sostituire temporaneamente il file /usr/include/python2.7/pyconfig.h con quello resente all'interno del router</div><div style="font-family:arial,sans-serif;font-size:13px">6) scaricare il pacchetto pycups in una cartella sul PC</div>
<div style="font-family:arial,sans-serif;font-size:13px"><a href="https://pypi.python.org/pypi/pycups" target="_blank">https://pypi.python.org/pypi/pycups</a><br></div><div style="font-family:arial,sans-serif;font-size:13px">
7) entrare nella cartella di pycups e lanciare make come indicato nella procedura di cross compiling</div><div style="font-family:arial,sans-serif;font-size:13px">8) la procedura si bloccherà per un errore nella fase di link dei file ".o" (objects).</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Errore "collect2: error: ld returned 1 exit status</div><div style="font-family:arial,sans-serif;font-size:13px">
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1</div><div style="font-family:arial,sans-serif;font-size:13px">make: *** [cups.so] Error 1"</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Comando che ha generato l'errore:</div><div style="font-family:arial,sans-serif;font-size:13px">"x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security /home/linuxlover/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib /home/linuxlover/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include build/temp.linux-x86_64-2.7/cupsmodule.o build/temp.linux-x86_64-2.7/cupsconnection.o build/temp.linux-x86_64-2.7/cupsppd.o build/temp.linux-x86_64-2.7/cupsipp.o -lcups -o build/lib.linux-x86_64-2.7/cups.so</div>
<div style="font-family:arial,sans-serif;font-size:13px">"</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">9) sostituire "x86_64-linux-gnu-gcc" (o simile) con "mips-openwrt-linux-gcc" e rimuovere "-fstack-protector". Rimuovere anche i percorsi relativi alle cartelle include e lib presenti nella staging_dir</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">10) lanciare "</div><div style="font-family:arial,sans-serif;font-size:13px">mips-openwrt-linux-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g --param=ssp-buffer-size=4 -Wformat -Werror=format-security  build/temp.linux-x86_64-2.7/cupsmodule.o build/temp.linux-x86_64-2.7/cupsconnection.o build/temp.linux-x86_64-2.7/cupsppd.o build/temp.linux-x86_64-2.7/cupsipp.o -lcups -o build/lib.linux-x86_64-2.7/cups.so<br>
</div><div style="font-family:arial,sans-serif;font-size:13px">"</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">11)  copiare la cartella pycup sul router</div>
<div style="font-family:arial,sans-serif;font-size:13px">12)  sul router rinominare lib.linux-x86_64-2.7 e temp.linux-x86_64-2.7 con lib.linux-mips-2.7 e lib.linux-mips-2.7</div><div style="font-family:arial,sans-serif;font-size:13px">
13) sul router, lanciare python setup.py install</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/31 Adm <span dir="ltr"><<a href="mailto:linuxloverstaff@gmail.com" target="_blank">linuxloverstaff@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>ho ancora bisogno di aiuto, intanto: tutti i passaggi che ho fatto</div><div><a href="https://forum.openwrt.org/viewtopic.php?id=47094" target="_blank">https://forum.openwrt.org/viewtopic.php?id=47094</a><br>
</div></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/31 Adm <span dir="ltr"><<a href="mailto:linuxloverstaff@gmail.com" target="_blank">linuxloverstaff@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">quello che vi ho mandato ieri non era il vero errore di compilazione. Era una stupidaggine.<div>Quello che vi mando ora è il vero problema:</div><div><br></div><div><div>linuxlover@hide:~/openwrt_py/pycups-1.9.63$ echo $PATH</div>


<div>/home/linuxlover/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/linuxlover/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/bin</div><div>linuxlover@hide:~/openwrt_py/pycups-1.9.63$ make clean</div>


<div>rm -rf build cups.so *.pyc *~</div><div>linuxlover@hide:~/openwrt_py/pycups-1.9.63$ make CC=mips-openwrt-linux-uclibc-gcc LD=mips-openwrt-linux-uclibc-ld V=spython setup.py build</div><div><div>running build</div>
<div>running build_ext</div>
<div>building 'cups' extension</div></div><div>creating build</div><div>creating build/temp.linux-x86_64-2.7</div><div><div>mips-openwrt-linux-uclibc-gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVERSION="1.9.63" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o</div>


</div><div>In file included from /usr/include/python2.7/Python.h:58:0,</div><div>                 from cupsmodule.c:22:</div><div>/usr/include/python2.7/pyport.h:873:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."</div>


<div>cupsmodule.c:23:23: fatal error: cups/cups.h: No such file or directory</div><div>compilation terminated.</div><div><div>error: command 'mips-openwrt-linux-uclibc-gcc' failed with exit status 1</div>
<div>make: *** [cups.so] Error 1</div>
</div></div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/31 Adm <span dir="ltr"><<a href="mailto:linuxloverstaff@gmail.com" target="_blank">linuxloverstaff@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">sto provando a compilare la libraria pycups per i dispositivi supportati da opewrt.<div><br></div><div>

Non ci riesco.</div>
<div><br></div><div>Mi dareste una mano?</div><div><br></div><div>Guida openwrt:</div>
<div><a href="http://wiki.openwrt.org/doc/devel/crosscompile" target="_blank">http://wiki.openwrt.org/doc/devel/crosscompile</a><br></div><div><br></div><div>La libreria:</div><div><a href="https://pypi.python.org/pypi/pycups" target="_blank">https://pypi.python.org/pypi/pycups</a><br>



</div><div><br></div><div>Il mio output:</div><div><div>make CC=mips-openwrt-linux-uclibc-gcc LD=mips-openwrt-linux-uclibc-ld V=s</div><div>python setup.py build</div><div>running build</div><div>running build_ext</div><div>



building 'cups' extension</div><div>mips-openwrt-linux-uclibc-gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVERSION="1.9.63" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o</div>



<div>unable to execute mips-openwrt-linux-uclibc-gcc: No such file or directory</div><div>error: command 'mips-openwrt-linux-uclibc-gcc' failed with exit status 1</div><div>make: *** [cups.so] Error 1</div></div>


<div>
<br></div><div><br></div><div>grazie</div><span><font color="#888888"><div>ADM</div></font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>