LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Getting printer drivers (hpijs) on Mini2440 ARM9 (cross compiling) (https://www.linuxquestions.org/questions/linux-software-2/getting-printer-drivers-hpijs-on-mini2440-arm9-cross-compiling-790764/)

PJvG 02-22-2010 08:00 AM

Getting printer drivers (hpijs) on Mini2440 ARM9 (cross compiling)
 
Hello, I'm still rather new to Linux and Embedded Linux. I started working with it last November.

I'm working on a project where I have to send print commands to a USB
printer (HP Deskjet D2660) from a Mini2440 ARM9. I only have to print text.
I received the Mini2440 ARM9 on February 2 this year.

I've successfully cross compiled CUPS with the linux-arm cross compiler (or at least I think so since I managed to get no errors after configure, make and sudo make install).
However I don't seem to be able to cross compile HPIJS, I'm sure I should be able to fix it.. but the error I get seems pretty useless to me.

After getting ownership of everything with chown I've configured this way:
CXX=arm-linux-g++ CC=arm-linux-gcc AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure --host=arm-linux --prefix=/opt/FriendlyARM/mini2440/root_qtopia/ --enable-hpijs-only-build --enable-qt4 --disable-doc-build
--enable-hpijs-install


Then I try to run make, but get error message:
arm-linux-g++ "-DPACKAGE_NAME=\"HP Linux Imaging and Printing\"" -DPACKAGE_TARNAME=\"hplip\" -DPACKAGE_VERSION=\"3.9.12\" "-DPACKAGE_STRING=\"HP Linux Imaging and Printing 3.9.12\"" -DPACKAGE_BUGREPORT=\"3.9.12.29\" -DPACKAGE=\"hplip\" -DVERSION=\"3.9.12\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_LIBDL=1 -DHAVE_PTHREAD_H=1 -DHAVE_JPEGLIB_H=1 -DHAVE_UINT32_T=1 -I. -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -DAPDK_DJ660 -DAPDK_DJ6xx -DAPDK_DJ6xxPhoto -DAPDK_DJ8xx -DAPDK_DJ9xx -DAPDK_DJ9xxVIP -DAPDK_DJ630 -DAPDK_APOLLO2XXX -DAPDK_APOLLO21XX -DAPDK_APOLLO2560 -DAPDK_DJ600 -DAPDK_DJ350 -DAPDK_DJ8x5 -DAPDK_PSP100 -DAPDK_AUTODUPLEX -DAPDK_HIGH_RES_MODES -DAPDK_LJMONO -DAPDK_DJ540 -DAPDK_DJ850 -DAPDK_DJ890 -DAPDK_DJ3320 -DAPDK_LJCOLOR -DAPDK_DJGENERICVIP -DAPDK_LJJETREADY -DAPDK_LJFASTRASTER -DAPDK_BUFFER_SEND -DAPDK_LDL_COMPRESS -DAPDK_EXTENDED_MEDIASIZE -DAPDK_MLC_PRINTER -DAPDK_DJ3600 -DAPDK_LJZJS_MONO -DAPDK_LJZJS_COLOR -DAPDK_LJM1005 -DAPDK_QUICKCONNECT -DAPDK_LITTLE_ENDIAN -DAPDK_AUTO_INCLUDE -DAPDK_LINUX -DNDEBUG -g -O2 -MT libapdk_la-models.lo -MD -MP -MF .deps/libapdk_la-models.Tpo -c prnt/hpijs/models.cpp -fPIC -DPIC -o .libs/libapdk_la-models.o
arm-none-linux-gnueabi-g++: Linux: No such file or directory
arm-none-linux-gnueabi-g++: Imaging: No such file or directory
arm-none-linux-gnueabi-g++: and: No such file or directory
arm-none-linux-gnueabi-g++: Printing": No such file or directory
arm-none-linux-gnueabi-g++: Linux: No such file or directory
arm-none-linux-gnueabi-g++: Imaging: No such file or directory
arm-none-linux-gnueabi-g++: and: No such file or directory
arm-none-linux-gnueabi-g++: Printing: No such file or directory
arm-none-linux-gnueabi-g++: 3.9.12": No such file or directory
<command-line>: warning: missing terminating " character
<command-line>: warning: missing terminating " character
make: *** [libapdk_la-models.lo] Error 1

Can someone help me with this?

I could run make -d to get extra debug information, I could post the output here if it's needed.


Also, might it be a better possibility to only copy the right driver of the HP Deskjet D2660 to my embedded computer? Would copying the ppd file be enough then or do I really have to cross compile libraries in order to print with this printer from my mini2440?


For my cross compile environment on the pc I use Ubuntu 9.10 and I'm running Linux 2.6 on the Mini2440 ARM9.

PJvG 02-24-2010 04:35 AM

Does anyone know something about Makefiles?

I think somewhere around these lines something goes wrong:

COMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)

DEFS = -DPACKAGE_NAME=\"HP\ Linux\ Imaging\ and\ Printing\" -DPACKAGE_TARNAME=\"hplip\" -DPACKAGE_VERSION=\"3.9.12\" -DPACKAGE_STRING=\"HP\ Linux\ Imaging\ and\ Printing\ 3.9.12\" -DPACKAGE_BUGREPORT=\"3.9.12.29\" -DPACKAGE=\"hplip\" -DVERSION=\"3.9.12\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_LIBDL=1 -DHAVE_PTHREAD_H=1 -DHAVE_JPEGLIB_H=1 -DHAVE_UINT32_T=1

libapdk_la-models.lo: prnt/hpijs/models.cpp
$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libapdk_la_CXXFLAGS) $(CXXFLAGS) -MT libapdk_la-models.lo -MD -MP -MF $(DEPDIR)/libapdk_la-models.Tpo -c -o libapdk_la-models.lo `test -f 'prnt/hpijs/models.cpp' || echo '$(srcdir)/'`prnt/hpijs/models.cpp
$(am__mv) $(DEPDIR)/libapdk_la-models.Tpo $(DEPDIR)/libapdk_la-models.Plo
# source='prnt/hpijs/models.cpp' object='libapdk_la-models.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libapdk_la_CXXFLAGS) $(CXXFLAGS) -c -o libapdk_la-models.lo `test -f 'prnt/hpijs/models.cpp' || echo '$(srcdir)/'`prnt/hpijs/models.cpp

As you can see from my previous post an extra " character gets placed somewhere around these lines, how do I fix it?

knudfl 02-24-2010 04:45 AM

Quote:

arm-none-linux-gnueabi-g++
This is the compiler, which make is attempting to use.

Have you got these executables / cross compiler :
CXX=arm-linux-g++ CC=arm-linux-gcc ?

May be 'arm-linux-g++' is not in the path ?
Or something in e.g. configure thinks you have this :
arm-none-linux-gnueabi-g++

Please tell the exact name of the file(s) you are compiling.
Like : hplip_3.9.12.tar.gz → hplip_3.9.12/ .
.....

PJvG 02-24-2010 05:00 AM

From the Makefile:

CC = arm-linux-gcc
CXX = arm-linux-g++


My cross compiler works without problems while cross compiling other applications, so there shouldn't be a problem there..

I downloaded HPLIP tar package from http://prdownloads.sourceforge.net/h...-3.9.12.tar.gz, placed it in /tmp, extracted it to /opt/hplip/hplip-3.9.12

I've tried to configure on several ways, but I still get the same error when doing make.

knudfl 02-24-2010 05:10 AM

1) May be omit this configure option : --host=arm-linux
.. so configure doesn't get phony ideas.
( Using CXX=arm-linux-g++ CC=arm-linux-gcc should be
sufficient to create "arm executables", I guess.)

2) grep -n "arm-none-linux-gnueabi-g++" Makefile*

.. to see a) which file b) which line number has the text
"arm-none-linux-gnueabi-g++"
.....

Example Makefile, x86 , hplip-3.9.12/ , with the default g++ :

grep -n "g++" Makefile*
Makefile:2127:CXX = g++
Makefile:2128:CXXCPP = g++ -E
Makefile:2193:ac_ct_CXX = g++

.. Which shows some g++ , line 2127 .... 2193.
.....

PJvG 02-24-2010 05:25 AM

1) Leaving out --host=arm-linux gives error:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for style of include used by make... GNU
checking for gcc... arm-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/opt/hplip/hplip-3.9.12':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

2) grep -n "arm-none-linux-gnueabi-g++" Makefile* returns nothing..

Should I be using arm-none-linux-gnueabi- instead of arm-linux- ?


grep -n "g++" Makefile* returns:
Makefile:2127:CXX = arm-linux-g++
Makefile:2128:CXXCPP = arm-linux-g++ -E

PJvG 02-25-2010 06:27 AM

Oh I hadn't notice yet these forums have an Embedded Linux sub-forum..

Could an admin or mod please move this thread from Linux > Linux - Software to Linux > Linux - Hardware > Linux - Embedded as it seems to be more fitting there?

Sorry for the inconvenience..

PJvG 03-17-2010 10:18 AM

Hello again! :)

I wanted to share with you that I have been able to cross compile HPIJS
with Buildroot.

First of all I followed the Buildroot usage documentation located here:
http://buildroot.uclibc.org/buildroot.html

After having obtained Buildroot I added the HPLIP package by following the tutorial "Makefile for autotools-based packages" in the Buildroot documentation. (It's located under "Adding new packages to Buildroot")

These are the steps I took:

First cd to the package directory in your buildroot directory
.../buildroot-2010.02/package/
Make directory hplip with "mkdir hplip" and enter it with "cd hplip"
Create a file named Config.in with "touch Config.in"
Edit the file with "gedit Config.in"
Don't have to be much, these are my contents of the file:

Code:

config BR2_PACKAGE_HPLIP
        bool "hplip"
        help
  HP Linux imaging and printing. Print, scan and fax drivers for Linux.

  http://hplipopensource.com/

Next go back to the package directory ("cd ..") and edit the Config.in in that directory.
Simply add this line: source "package/hplip/Config.in"
This is where I placed it:
Code:

...
66. source "package/gamin/Config.in"
67. source "package/hplip/Config.in"
68. source "package/icu/Config.in"
...

Now go back to the hplip directory ("cd hplip")
Do "touch hplip.mk" and "gedit hplip.mk"
These are my contents of the file hplip.mk: (I configured it for hpijs only. --build, --host, --target and --prefix all are unneeded because they are being taken care off by Buildroot)

Code:

################################################################################
#
# hplip
#
################################################################################
HPLIP_VERSION:=3.10.2
HPLIP_SOURCE:=hplip-$(HPLIP_VERSION).tar.gz
HPLIP_SITE:=http://prdownloads.sourceforge.net/hplip/
HPLIP_INSTALL_STAGING = YES
HPLIP_INSTALL_TARGET = YES
HPLIP_CONF_OPT = --enable-shared --disable-network-build
--enable-hpijs-only-build --enable-hpijs-install
--enable-foomatic-ppd-install
HPLIP_DEPENDENCIES =

$(eval $(call AUTOTARGETS,package,hplip))

After making these files go back to the buildroot directory with "cd ../..". (You should be in .../buildroot-2010.02/ again now)
Run "make menuconfig"
As you can see the HPLIP package should be available now.
Choose the target architecture (in my case arm920t) and other options.
Choose the packages you want in your root file system (probably going to be at least cups and perhaps jpeg and png libraries.. I'm not sure what precisely is needed for hplip)

Don't choose hplip just yet!! Else make will fail! because Buildroot wants to make some of hplip's dependencies after hplip. (I suppose this could be fixed by assigning the right dependencies in the hplip.mk file after this line: "HPLIP_DEPENDENCIES = ")

After you're done with "make menuconfig" simply run "make".
You'll see the toolchain and the libraries for your root file system will compile... For my project this takes about 2 hours, so best is to take a coffee or something while you let your build system run.

When your system is done with make run "make menuconfig" again, this time choose the hplip package, exit the menuconfig.
Run "make" again, this will only take a few minutes now.

I managed to get no errors on this. So this should do the trick to cross compile HPLIP with Buildroot. ;)

I'm still struggling with actually getting my cross compiled root file system on my embedded computer. I will notify you when I've done that successfully and when I managed to print from the embedded system.


Thanks,
PJvG

PJvG 04-12-2010 09:19 AM

Well in the end I did manage to get a root file system with printer drivers on a Mini2440 FriendlyARM.
But CUPS was still configured in a wrong way; it wouldn't start the scheduler.

I actually came back here to notify anyone who's reading this that the project I've been working on won't be an Embedded Linux project anymore. The people I've been working for thought it was taking too long with Linux, so now I'll have to continue the project with Windows. The Mini2440 FriendlyARM Embedded Computer won't be used anymore, instead I'll be using a laptop with Windows 7.

wujianwen 04-23-2010 04:20 AM

MINI2440V2
www.developmentboard.net


Compared to the classic MINI2440, the MINI2440v2 is improved in both Hardware experience and Software performance.

On the hardware part,

• the adjusted hardware design on the MINI2440v2 makes it easy to change components, like the Flash, SDram, displays, etc.;

• reported "weak" components like the I2C is now better supported in HW;

• A “clever” display adapter is now implemented, to which additional devices can be connected easily;

• More add-on cards are to be developed;

• While most components and the form factor remain the same with those on the MINI2440



On the software part,

• Ångström is implemented as the official Linux distributon for the MINI2440v2;

• WinC5.0 available now

• WinCE6.0 is now being developed and will be available soon

Product Specification

Specification MINI2440v2
CPU S3C2440A
MHz 400-533
RAM 64MB
NOR flash 2MB
Nand Flash 128MB
Ethernet 10/100M Ethernet, RJ-45 connector
Serial ports 3
RS232 1
USB Host 1
USB Device 1
SD card slot 1
Audio Interface In, Out, Mic
LCD connector 1
Camera Interface 1
JTAG 10pin JTAG connector
Bus 40pin connector
GPIO 34pin connector
Dimension 100x100mm
Linux Open Embeddeed with Ångström
WinCE WinCE 5.0


All times are GMT -5. The time now is 08:37 AM.