Build TinyX + GTK graphics environment under Redhat9

Source: Internet
Author: User
Tags gtk
Overview recently, we want to port RedHat9.02 to an embedded 586 motherboard, with limited space and a graphical environment that supports Chinese characters. Therefore, to establish a simplified image environment, select TinyX + GTK for research. TinyX is an embedded compilation option for XFree86, which is small in size and fast to start. This article uses virtual machine vmware to install the Redhat-9.02 text system, then compile TinyX with the XFree86-4.3.0, and finally compile GTK +-2.0. 1. Security

Overview

Recently, we have to port RedHat9.02 to an embedded 586 motherboard, with limited space and a graphical environment that supports Chinese characters. Therefore, to establish a simplified image environment, select TinyX + GTK for research. TinyX is an embedded compilation option for XFree86, which is small in size and fast to start.

This article uses virtual machine vmware to install the Redhat-9.02 text system, then compile TinyX with the XFree86-4.3.0, and finally compile GTK +-2.0.


1. Install Redhat-9.02

Create a new virtual machine in vmware with a hard disk space of 4 GB and memory of 512 MB. Start to install Redhat-9.02, select linux text mode, Chinese language, swap partition is 512 MB, the rest of the space is mounted to the root directory. You can use Grub to customize the Installation Software Package for bootloader. The selected software package is as follows:

Administration tools

Development Tools

Editors

Ftp Server

Kernel Development

NetWork Server

Printing Support

Server Configuration Tools

Sound and Video

System Tool

Select the language supported by the system as Chinese + English.


After installation, modify the i18n file under/etc/sysconfig/as follows:

LC_CTYPE = "zh_CN.GB2312"

SUPPORTED = "Maid: en_US.UTF-8: en_US: en"

SYSFONT = "latercyrheb-sun16"

SYSFONTACM = "iso01"


2. Compile libpng-1.2.16

When compiling TinyX, png. H files are required. Therefore, you must reinstall libpng. First Delete the original libpng:

Rm-rf/usr/lib/libpng *


Download libpng-1.2.16.tar.bz2, copy it to the/root directory, and decompress it:

Tar-xvjf libpng-1.2.16.tar.bz2


The README and INSTALL files in the source code package have detailed information about libpng and the compilation and installation methods. Use the following command to compile and INSTALL libpng:

Cd/root/libpng-1.2.16

./Configure

Make

Make install

Installed in the/usr/local/directory by default. pkg-config is supported. The pkg-config file is stored in the/usr/lib/pkg-config/directory. To uninstall libpng, run: make uninstall.


3. Compile freetype-2.2.1

Delete the original freetype:

Rm-rf/usr/lib/libfreetype *


Download freetype-2.2.1.tar.gz:

Http://download.savannah.gnu.org/releases/freetype/

Copy to/root/directory and decompress the package:

Tar-xvzf freetype-2.2.1.tar.gz


Compilation and installation:

Cd/root/freetype-2.2.1

./Configure

Make

Make install

Installed in the/usr/local/directory by default. pkg-config is supported.


4. Compile TinyX

First Delete the X-window of the original system:

Rm-rf/usr/X11R6

Rm-rf/etc/X11


Download the XFree86-4.3.0: ftp://ftp.xfree86.org/pub/xfree86/4.3.0/, a total of 7 software package:

X430src-1.tgz

X430src-2.tgz

X430src-3.tgz
X430src-4.tgz
X430src-5.tgz
X430src-6.tgz
X430src-7.tgz

Copy all the files to/root and decompress them. The decompressed source code is stored in the/root/xc directory.


Compile an lndir tool first:

Cd/root/xc/config/util

Make-f Makefile. ini lndir

Cd ../../../

Use lndir to create a symbolic link directory of the source file:

Mkdir build

Cd build

../Xc/config/util/lndir ../xc


Install using the configuration of TinyX. cf:

Cd config/cf

Cp-Arn TinyX. cf host. def

Modify host. def:

[Cpp]

  1. # Define KDriveXServer YES
  2. # Define TinyXServer YES
  3. # Define XfbdevServer YES
  4. # Define BuildLBX YES
  5. # Define BuildFonts YES
  6. # Define BuildAppgroup NO
  7. # Define BuildDBE NO
  8. # Define BuildXCSecurity YES
  9. # Define FontServerAccess NO
  10. # Undef BuildXF86RushExt
  11. # Define BuildXF86RushExt NO
  12. # Undef BuildRender
  13. # Define BuildRender YES
  14. # Define UseRgbTxt YES
  15. # Define BuildFontServer NO

Cd ../../

Touch xf86Date. h

Touch xf86Version. h

Make World

Make install

The main libraries, header files, executable files, and configuration files are installed in/etc/X11 and/usr/X11R6.


TinyX depends on framebuffer. You need to enable framebuffer. Modify the/etc/grub. conf file and add:

Vga = 0x311 fb: on

0x311 is 640x480, 16bpp.

Then restart the system. At startup, a penguin Logo will appear in the upper-left corner of the screen.


Run/usr/X11R6/bin/Xfbdev after restart to start Xserver. An X-shaped mouse is displayed on the gray background.

Create a symbolic link for Xfbdev:

Ln-s Xfbdev X

In this way, you can use the startx command to start X-window. Press Ctrl + Alt + Backspace to exit X-window.


An error may occur when loading the Linked database. Check whether/usr/X11R6/lib exists in the/etc/ld. so. conf file, and then run ldconfig-v.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.