How to optimized software for Intel Atom CPU - Example Case

http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Atom_230.2C_Atom_330.2C_Atom_N-Series

sudo vi /etc//etc/dpkg/buildflags.conf​
APPEND CFLAGS -march=atom -O2 -fomit-frame-pointer -pipe
APPEND CXXFLAGS -march=atom -O2 -fomit-frame-pointer -pipe​
Save exit

dpkg-buildflags 
CFLAGS=-g -O2 -fstack-protector –param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -march=atom -O2 -fomit-frame-pointer -pipe
CPPFLAGS=-D_FORTIFY_SOURCE=2
CXXFLAGS=-g -O2 -fstack-protector –param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -march=atom -O2 -fomit-frame-pointer -pipe
FFLAGS=-g -O2
LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro

 

Example:
Try recompile tomcat-native source
https://launchpad.net/ubuntu/+source/tomcat-native
Download 
tomcat-native_1.1.24-1.debian.tar.gz (4.7 KiB)
tomcat-native_1.1.24-1.dsc (2.0 KiB)

tar vxzf tomcat-native_1.1.24.orig.tar.gz ; cd tomcat-native-1.1.24-src
tar vxzf ../tomcat-native_1.1.24-1.debian.tar.gz 
sudo dpkg-buildpackage -us -uc -nc
​cd ..
dpkg -i libtcnative-1_1.1.24-1_i386.deb

Enable Tomcat Native Library in Tomcat 6.x:
– edit /etc/tomcat6/server.xml to check if AprLifecycleListener is activated
  [you should remove XML comments if present]
– start or restart Tomcat by using /etc/init.d/tomcat6 restart

Check library loading at Tomcat 6.x startup:
– when starting, Tomcat will output the following log message
  to a file named like /var/log/tomcat6/catalina.*.log

org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.24.
org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

sudo service tomcat6 restart