GithubHelp home page GithubHelp logo

guozht / cups Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jianglei12138/cups

0.0 0.0 0.0 13.56 MB

cups for android (UNIX通用打印系统)

License: Other

Makefile 1.43% C 85.40% Shell 5.87% HTML 0.03% M4 1.23% C++ 5.66% PostScript 0.25% Roff 0.12%

cups's Introduction

How to build cups for android

First of all, forgive my poor English. This is a guide to build cups for android platform, I have modified some files of cups project, to build cups successfully, you should do like this:

1.Get source code

source code should use what i provide in this repository, the cups version is 2.1.3. Just use git clone:

git clone https://github.com/jianglei12138/cups.git

or download this code by click the download button.

2.Configure you environment

It is suggest to use cross compiler toolchain which exported by NDK.

In termial, just cd your NDK path (must in this folder) and input

./build/tools/make-standalone-toolchain.sh --arch=arm --platform=android-17

just like this:

toolchain export

then you'll be able to find you toolchian under /tmp folder. Just put it where you like and unzip. Once your toolchain has ready, you need change some file.

  • (Do not do this) modify the locale.h under toolchain-folder/sysroot/usr/include, change if 1 to if 0 locale.h

  • get the lcoale support library and library from my another repositories, then put the header locale.h under toolchain-folder/sysroot/usr/include(override) and the shared library liblocale.so to toolchain-folder/sysroot/usr/lib

  • add toolchain bin path to your environment variable

  • if you want to enable dns_sd, you can put libdns_sd's header and library into toolchain sysroot. And libdns_sd for android could be found in my resposity.

  • if you want to enable avahi, you can put avahi header and library into toolchain sysroot. And libavahi-common,libavahi-core,libavahi-client for android could be found in my resposity.

3.Configrue cups

Just cd cups folder and configure:

./configure --host=arm-linux-androideabi  --disable-dbus --prefix=/system/usr/root --with-cups-user=system --with-cups-group=system --with-system-groups=root

I put all aim files to /system/usr/root which in android system, so i used --prefix .You maybe found some error during configure ,but you can find all need libraries in my repositories. Then add liblocale support in Makedefs file COMMONLIBS = -pthread -lm -liconv -lz -llocale

locale

4.Make

Then just make

make

5.Make install

make install need root permission,so you must under sudo before you make install.

Then make install

make install

6.Make all ready

  • push liblocale.so to android system lib

    adb push liblocale /system/lib
  • copy all the files to the android system. You can use adb push, but this will ignore some folder, so I suggest just put the zip file to the android system folder and install an app which named busybox (you'll get unzip command), and unzip the zip file to you corrent location. Anyway, you can copy aim files to sdcard and use RootExplorer copy them to the correct path, don't forget give correct promission.

  • copy libraries under cups/lib to /system/lib

7.start cupsd

You can start cupsd by adb shell or you can install an app terminal for android. And all this should be under root.(The mime in the picture was i added to debug).

CUPSD

8.Test

Now, you could be able to open brower to see if the cups running successfully.

Home page:

test

Administration page, and the administrator is root and password is whatever except null.

test

Add Printer Page:

test

if you enable avahi or dns-sd support, you can find your network printers like this

finder

Help pager:

test

From now on, you could add some printer, but you maybe need other cups-filters to print successfully. CUPS-filters could be found in my repository

9.Attention!

This cound not be compile on OSX. I cross compile on Ubuntu16.04

cups's People

Contributors

jianglei12138 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.