TimeLinux1

Wednesday, May 8, 2013

Linux - Compiling a kernel steps:


[root@redhat4 ~]# cd /tmp
[root@redhat4 tmp]# mkdir mskernel
[root@redhat4 tmp]# cd mskernel
[root@redhat4 mskernel]# uname -a
Linux redhat4 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

[root@redhat4 mskernel]# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.12.tar.xz

--2013-05-08 09:56:32--  https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.12.tar.xz
Resolving www.kernel.org... 198.145.20.140, 149.20.4.69
Connecting to www.kernel.org|198.145.20.140|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71001428 (68M) [application/x-xz]
Saving to: “linux-3.8.12.tar.xz”

100%[===========================================================================>] 71,001,428  5.21M/s   in 12s  

2013-05-08 09:56:44 (5.70 MB/s) - “linux-3.8.12.tar.xz” saved [71001428/71001428]


[root@redhat4 mskernel]# tar xvJf linux-3.8.12.tar.xz 
linux-3.8.12/
linux-3.8.12/.gitignore
linux-3.8.12/.mailmap
linux-3.8.12/COPYING
linux-3.8.12/CREDITS
linux-3.8.12/Documentation/
linux-3.8.12/Documentation/.gitignore
linux-3.8.12/Documentation/00-INDEX
linux-3.8.12/Documentation/ABI/
linux-3.8.12/Documentation/ABI/README
linux-3.8.12/Documentation/ABI/obsolete/
linux-3.8.12/Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads
linux-3.8.12/Documentation/ABI/obsolete/sysfs-bus-usb
linux-3.8.12/Documentation/ABI/obsolete/sysfs-class-rfkill
linux-3.8.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
linux-3.8.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus
linux-3.8.12/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra
linux-3.8.12/Documentation/ABI/removed/
linux-3.8.12/Documentation/ABI/removed/devfs
linux-3.8.12/Documentation/ABI/removed/dv1394
linux-3.8.12/Documentation/ABI/removed/ip_queue
linux-3.8.12/Documentation/ABI/removed/o2cb
linux-3.8.12/Documentation/ABI/removed/raw1394
linux-3.8.12/Documentation/ABI/removed/video1394
.....



[root@redhat4 linux-3.8.12]# make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 ***
 *** Install ncurses (ncurses-devel) and try again.
 ***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

To overcome this error, I ran -
[root@redhat4 linux-3.8.12]# yum install ncurses-devel -y
This installed the missing packages and then re-ran menuconfig (see below):


[root@redhat4 linux-3.8.12]# make menuconfig
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in /boot/config-2.6.32-220.el6.x86_64
#
/boot/config-2.6.32-220.el6.x86_64:555:warning: symbol value 'm' invalid for PCCARD_NONSTATIC
/boot/config-2.6.32-220.el6.x86_64:2567:warning: symbol value 'm' invalid for MFD_WM8400
/boot/config-2.6.32-220.el6.x86_64:2568:warning: symbol value 'm' invalid for MFD_WM831X
/boot/config-2.6.32-220.el6.x86_64:2569:warning: symbol value 'm' invalid for MFD_WM8350
/boot/config-2.6.32-220.el6.x86_64:2582:warning: symbol value 'm' invalid for MFD_WM8350_I2C
/boot/config-2.6.32-220.el6.x86_64:2584:warning: symbol value 'm' invalid for AB3100_CORE
/boot/config-2.6.32-220.el6.x86_64:3502:warning: symbol value 'm' invalid for MMC_RICOH_MMC

The menuconfig option allows gui based kernel configuration (see sample config menus here)

...
Once satisfied, save changes

...

#
# configuration written to .config
#

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.


Then run make..
[root@redhat4 linux-3.8.12]# make
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
  SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/asm/unistd_32_ia32.h
  SYSHDR  arch/x86/syscalls/../include/generated/asm/unistd_64_x32.h
  SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_64.h
  HOSTCC  arch/x86/tools/relocs
  WRAP    arch/x86/include/generated/asm/clkdev.h
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/genksyms/genksyms.o

.....
after about 2 hours...
.....

 IHEX    firmware/mts_gsm.fw
  IHEX    firmware/mts_edge.fw
  H16TOFW firmware/edgeport/boot.fw
  H16TOFW firmware/edgeport/boot2.fw
  H16TOFW firmware/edgeport/down.fw
  H16TOFW firmware/edgeport/down2.fw
  IHEX    firmware/edgeport/down3.bin
  IHEX2FW firmware/whiteheat_loader.fw
  IHEX2FW firmware/whiteheat.fw
  IHEX2FW firmware/keyspan_pda/keyspan_pda.fw
  IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
[root@redhat4 linux-3.8.12]#

[root@redhat4 linux-3.8.12]# make modules_install
  INSTALL Documentation/connector/cn_test.ko
  INSTALL Documentation/filesystems/configfs/configfs_example_explicit.ko
  INSTALL Documentation/filesystems/configfs/configfs_example_macros.ko
  INSTALL arch/x86/crypto/ablk_helper.ko
  INSTALL arch/x86/crypto/aes-x86_64.ko
  INSTALL arch/x86/crypto/aesni-intel.ko
  INSTALL arch/x86/crypto/crc32c-intel.ko
  INSTALL arch/x86/crypto/ghash-clmulni-intel.ko
  INSTALL arch/x86/crypto/salsa20-x86_64.ko
  INSTALL arch/x86/crypto/twofish-x86_64.ko
  INSTALL arch/x86/kernel/cpu/mcheck/mce-inject.ko
  INSTALL arch/x86/kernel/microcode.ko
  INSTALL arch/x86/kernel/test_nx.ko
  INSTALL arch/x86/kvm/kvm-amd.ko
  INSTALL arch/x86/kvm/kvm-intel.ko
  INSTALL arch/x86/kvm/kvm.ko
  INSTALL arch/x86/oprofile/oprofile.ko
  INSTALL crypto/ansi_cprng.ko
  INSTALL crypto/anubis.ko
  INSTALL crypto/arc4.ko
  INSTALL crypto/async_tx/async_memcpy.ko
  INSTALL crypto/async_tx/async_pq.ko
  INSTALL crypto/async_tx/async_raid6_recov.ko
.....
  INSTALL /lib/firmware/ti_3410.fw
  INSTALL /lib/firmware/ti_5052.fw
  INSTALL /lib/firmware/mts_cdma.fw
  INSTALL /lib/firmware/mts_gsm.fw
  INSTALL /lib/firmware/mts_edge.fw
  INSTALL /lib/firmware/edgeport/boot.fw
  INSTALL /lib/firmware/edgeport/boot2.fw
  INSTALL /lib/firmware/edgeport/down.fw
  INSTALL /lib/firmware/edgeport/down2.fw
  INSTALL /lib/firmware/edgeport/down3.bin
  INSTALL /lib/firmware/whiteheat_loader.fw
  INSTALL /lib/firmware/whiteheat.fw
  INSTALL /lib/firmware/keyspan_pda/keyspan_pda.fw
  INSTALL /lib/firmware/keyspan_pda/xircom_pgs.fw
  DEPMOD  3.8.12
[root@redhat4 linux-3.8.12]# 

[root@redhat4 linux-3.8.12]# make install
sh /tmp/mskernel/linux-3.8.12/arch/x86/boot/install.sh 3.8.12 arch/x86/boot/bzImage \
System.map "/boot"
[root@redhat4 grub]# 

Then you can cd to /boot dir and verify the new kernel is present there..
[root@redhat4 boot]# cd /boot
[root@redhat4 boot]# ls -lart
total 45631
-rw-r--r--.  1 root root      166 Nov  9  2011 .vmlinuz-2.6.32-220.el6.x86_64.hmac
-rw-r--r--.  1 root root  2312369 Nov  9  2011 System.map-2.6.32-220.el6.x86_64
-rw-r--r--.  1 root root   100943 Nov  9  2011 config-2.6.32-220.el6.x86_64
-rwxr-xr-x.  1 root root  3938800 Nov  9  2011 vmlinuz-2.6.32-220.el6.x86_64
-rw-r--r--.  1 root root   171087 Nov  9  2011 symvers-2.6.32-220.el6.x86_64.gz
drwx------.  2 root root    12288 Jun 19  2012 lost+found
drwxr-xr-x.  3 root root     1024 Jun 19  2012 efi
-rw-r--r--.  1 root root 15558855 Jun 19  2012 initramfs-2.6.32-220.el6.x86_64.img
-rw-------.  1 root root  4301773 Jun 19  2012 initrd-2.6.32-220.el6.x86_64kdump.img
dr-xr-xr-x. 25 root root     4096 Mar  5 08:56 ..
-rw-r--r--.  1 root root  4272784 May  8 11:36 vmlinuz-3.8.12
lrwxrwxrwx.  1 root root       20 May  8 11:36 vmlinuz -> /boot/vmlinuz-3.8.12
-rw-r--r--.  1 root root  2621147 May  8 11:36 System.map-3.8.12
lrwxrwxrwx.  1 root root       23 May  8 11:36 System.map -> /boot/System.map-3.8.12
dr-xr-xr-x.  5 root root     1024 May  8 11:37 .
-rw-r--r--.  1 root root 13406914 May  8 11:37 initramfs-3.8.12.img
drwxr-xr-x.  2 root root     1024 May  8 11:37 grub

[root@redhat4 grub]# cd /boot/grub
[root@redhat4 grub]# ls -lart
total 279
-rw-r--r--. 1 root root   1341 May  6  2010 splash.xpm.gz
-rw-r--r--. 1 root root  13964 Jun 19  2012 xfs_stage1_5
-rw-r--r--. 1 root root  11364 Jun 19  2012 vstafs_stage1_5
-rw-r--r--. 1 root root  12024 Jun 19  2012 ufs2_stage1_5
-rw-r--r--. 1 root root    512 Jun 19  2012 stage1
-rw-r--r--. 1 root root  14412 Jun 19  2012 reiserfs_stage1_5
-rw-r--r--. 1 root root  11956 Jun 19  2012 minix_stage1_5
lrwxrwxrwx. 1 root root     11 Jun 19  2012 menu.lst -> ./grub.conf
-rw-r--r--. 1 root root  13268 Jun 19  2012 jfs_stage1_5
-rw-r--r--. 1 root root  11756 Jun 19  2012 iso9660_stage1_5
-rw-r--r--. 1 root root  11748 Jun 19  2012 ffs_stage1_5
-rw-r--r--. 1 root root  12620 Jun 19  2012 fat_stage1_5
-rw-r--r--. 1 root root  13380 Jun 19  2012 e2fs_stage1_5
-rw-r--r--. 1 root root     63 Jun 19  2012 device.map
-rw-r--r--. 1 root root 125976 Jun 19  2012 stage2
dr-xr-xr-x. 5 root root   1024 May  8 11:37 ..
-rw-------. 1 root root   1172 May  8 11:37 grub.conf
drwxr-xr-x. 2 root root   1024 May  8 11:37 .
[root@redhat4 grub]# 

You can verify that the new kernel is now in the grub.conf:
[root@redhat4 grub]# vim grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (3.8.12)
        root (hd0,0)
        kernel /vmlinuz-3.8.12 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
        initrd /initramfs-3.8.12.img
title Red Hat Enterprise Linux (2.6.32-220.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
        initrd /initramfs-2.6.32-220.el6.x86_64.img
~                                                


And thats it.
There is tons of useful links on the net eg: this one at wikihow





Tuesday, May 7, 2013

Linux - Installing packages from source tarballs:

Installing a package using - tar.gz, configure, make, make install steps:

1- Download the tarball:

[root@redhat2 linux-2.6.39]# wget http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz
--2013-05-07 15:48:52--  http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz
Resolving www.sqlite.org... 67.18.92.124, 2600:3c00::f03c:91ff:fe96:b959
Connecting to www.sqlite.org|67.18.92.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1720314 (1.6M) [application/x-gzip]
Saving to: “sqlite-autoconf-3070603.tar.gz”

100%[==========================================================================================>] 1,720,314    802K/s   in 2.1s  

2013-05-07 15:48:54 (802 KB/s) - “sqlite-autoconf-3070603.tar.gz” saved [1720314/1720314]

2- Extract the tarball:

root@redhat2 linux-2.6.39]# tar xvfz sqlite-autoconf-3070603.tar.gz 
sqlite-autoconf-3070603/
sqlite-autoconf-3070603/tea/
sqlite-autoconf-3070603/tea/doc/
sqlite-autoconf-3070603/tea/doc/sqlite3.n
sqlite-autoconf-3070603/tea/win/
sqlite-autoconf-3070603/tea/win/rules.vc
sqlite-autoconf-3070603/tea/win/makefile.vc
sqlite-autoconf-3070603/tea/win/nmakehlp.c
sqlite-autoconf-3070603/tea/aclocal.m4
sqlite-autoconf-3070603/tea/README
sqlite-autoconf-3070603/tea/configure
sqlite-autoconf-3070603/tea/configure.in
sqlite-autoconf-3070603/tea/tclconfig/
sqlite-autoconf-3070603/tea/tclconfig/install-sh
sqlite-autoconf-3070603/tea/tclconfig/tcl.m4
sqlite-autoconf-3070603/tea/generic/
sqlite-autoconf-3070603/tea/generic/tclsqlite3.c
sqlite-autoconf-3070603/tea/Makefile.in
sqlite-autoconf-3070603/tea/license.terms
sqlite-autoconf-3070603/tea/pkgIndex.tcl.in
sqlite-autoconf-3070603/depcomp
sqlite-autoconf-3070603/sqlite3.pc
sqlite-autoconf-3070603/aclocal.m4
sqlite-autoconf-3070603/README
sqlite-autoconf-3070603/ltmain.sh
sqlite-autoconf-3070603/configure
sqlite-autoconf-3070603/shell.c
sqlite-autoconf-3070603/configure.ac
sqlite-autoconf-3070603/config.guess
sqlite-autoconf-3070603/install-sh
sqlite-autoconf-3070603/config.sub
sqlite-autoconf-3070603/missing
sqlite-autoconf-3070603/sqlite3.1
sqlite-autoconf-3070603/sqlite3.c
sqlite-autoconf-3070603/sqlite3.h
sqlite-autoconf-3070603/Makefile.am
sqlite-autoconf-3070603/Makefile.in
sqlite-autoconf-3070603/sqlite3ext.h
sqlite-autoconf-3070603/INSTALL
sqlite-autoconf-3070603/sqlite3.pc.in
[root@redhat2 linux-2.6.39]# cd sqlite-autoconf-3070603
[root@redhat2 sqlite-autoconf-3070603]# ls
aclocal.m4    config.sub  configure.ac  INSTALL     ltmain.sh    Makefile.in  README   sqlite3.1  sqlite3ext.h  sqlite3.pc     tea
config.guess  configure   depcomp       install-sh  Makefile.am  missing      shell.c  sqlite3.c  sqlite3.h     sqlite3.pc.in

3- Configure the source:

[root@redhat2 sqlite-autoconf-3070603]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for ranlib... ranlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... (cached) ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for fdatasync... yes
checking for usleep... yes
checking for fullfsync... no
checking for localtime_r... yes
checking for gmtime_r... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... no
checking for library containing tgetent... no
checking for library containing readline... no
checking for readline... no
checking for library containing pthread_create... -lpthread
checking for library containing dlopen... -ldl
checking for whether to support dynamic extensions... yes
checking for posix_fallocate... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlite3.pc
config.status: executing depfiles commands
[root@redhat2 sqlite-autoconf-3070603]# ls
aclocal.m4    config.status  configure.ac  install-sh  Makefile     missing  sqlite3.1     sqlite3.h      tea
config.guess  config.sub     depcomp       libtool     Makefile.am  README   sqlite3.c     sqlite3.pc
config.log    configure      INSTALL       ltmain.sh   Makefile.in  shell.c  sqlite3ext.h  sqlite3.pc.in

4- Compile the source:

[root@redhat2 sqlite-autoconf-3070603]# make
if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.6.3\" -DPACKAGE_STRING=\"sqlite\ 3.7.6.3\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.6.3\" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -I.    -D_REENTRANT=1 -DSQLITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF ".deps/sqlite3.Tpo" -c -o sqlite3.lo sqlite3.c; \
then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f ".deps/sqlite3.Tpo"; exit 1; fi
mkdir .libs
 gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.6.3\" "-DPACKAGE_STRING=\"sqlite 3.7.6.3\"" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.6.3\" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
 gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.6.3\" "-DPACKAGE_STRING=\"sqlite 3.7.6.3\"" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.6.3\" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -o sqlite3.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2   -o libsqlite3.la -rpath /usr/local/lib -no-undefined -version-info 8:6:8 sqlite3.lo  -ldl -lpthread 
gcc -shared  .libs/sqlite3.o  -ldl -lpthread  -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6
(cd .libs && rm -f libsqlite3.so.0 && ln -s libsqlite3.so.0.8.6 libsqlite3.so.0)
(cd .libs && rm -f libsqlite3.so && ln -s libsqlite3.so.0.8.6 libsqlite3.so)
ar cru .libs/libsqlite3.a  sqlite3.o
ranlib .libs/libsqlite3.a
creating libsqlite3.la
(cd .libs && rm -f libsqlite3.la && ln -s ../libsqlite3.la libsqlite3.la)
if gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.6.3\" -DPACKAGE_STRING=\"sqlite\ 3.7.6.3\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.6.3\" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -I.    -D_REENTRANT=1 -DSQLITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT shell.o -MD -MP -MF ".deps/shell.Tpo" -c -o shell.o shell.c; \
then mv -f ".deps/shell.Tpo" ".deps/shell.Po"; else rm -f ".deps/shell.Tpo"; exit 1; fi
/bin/sh ./libtool --tag=CC --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2   -o sqlite3  shell.o ./libsqlite3.la  -ldl -lpthread 
gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -o .libs/sqlite3 shell.o  ./.libs/libsqlite3.so -ldl -lpthread  -Wl,--rpath -Wl,/usr/local/lib
creating sqlite3
[root@redhat2 sqlite-autoconf-3070603]# 

5- Install the source:

[root@redhat2 sqlite-autoconf-3070603]# make install
make[1]: Entering directory `/tmp/Django-1.5.1/linux-2.6.39/sqlite-autoconf-3070603'
test -z "/usr/local/lib" || mkdir -p -- "/usr/local/lib"
 /bin/sh ./libtool --mode=install /usr/bin/install -c  'libsqlite3.la' '/usr/local/lib/libsqlite3.la'
/usr/bin/install -c .libs/libsqlite3.so.0.8.6 /usr/local/lib/libsqlite3.so.0.8.6
(cd /usr/local/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so.0 || { rm -f libsqlite3.so.0 && ln -s libsqlite3.so.0.8.6 libsqlite3.so.0; }; })
(cd /usr/local/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so || { rm -f libsqlite3.so && ln -s libsqlite3.so.0.8.6 libsqlite3.so; }; })
/usr/bin/install -c .libs/libsqlite3.lai /usr/local/lib/libsqlite3.la
/usr/bin/install -c .libs/libsqlite3.a /usr/local/lib/libsqlite3.a
chmod 644 /usr/local/lib/libsqlite3.a
ranlib /usr/local/lib/libsqlite3.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
  /bin/sh ./libtool --mode=install /usr/bin/install -c 'sqlite3' '/usr/local/bin/sqlite3'
/usr/bin/install -c .libs/sqlite3 /usr/local/bin/sqlite3
test -z "/usr/local/include" || mkdir -p -- "/usr/local/include"
 /usr/bin/install -c -m 644 'sqlite3.h' '/usr/local/include/sqlite3.h'
 /usr/bin/install -c -m 644 'sqlite3ext.h' '/usr/local/include/sqlite3ext.h'
test -z "/usr/local/share/man/man1" || mkdir -p -- "/usr/local/share/man/man1"
 /usr/bin/install -c -m 644 './sqlite3.1' '/usr/local/share/man/man1/sqlite3.1'
test -z "/usr/local/lib/pkgconfig" || mkdir -p -- "/usr/local/lib/pkgconfig"
 /usr/bin/install -c -m 644 'sqlite3.pc' '/usr/local/lib/pkgconfig/sqlite3.pc'
make[1]: Leaving directory `/tmp/Django-1.5.1/linux-2.6.39/sqlite-autoconf-3070603'
[root@redhat2 sqlite-autoconf-3070603]# 

-Test it out-

[root@redhat2 sqlite-autoconf-3070603]# sqlite3 mrinal.db
SQLite version 3.7.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table mrinal (id integer, name varchar(20));
sqlite> insert into mrinal values(1,'MS');
sqlite> select * from mrinal;
1|MS
sqlite> insert into mrinal values(1,'MS');
sqlite> insert into mrinal values(1,'MS');
sqlite> insert into mrinal values(1,'MS');
sqlite> insert into mrinal values(1,'MS');
sqlite> select * from mrinal;
1|MS
1|MS
1|MS
1|MS
1|MS
sqlite>