Posts filed under 'Compiling Stuff'
Sorry for not posting so much lately. Work has been busier than ever – it’s quite incredible. Just a quick post on compiling Python 2.6, which was giving me a few problems.
I’d recommend throwing on ncurses and readline from the Solaris 10 companion CD, the packages are SFWncur and SFWrline. The full dependency list is:
P SFWncur P SFWrline P SUNWbzip P SUNWcry P SUNWcsl P SUNWcslr P SUNWcsr P SUNWgccruntime P SUNWlibms P SUNWlibmsr P SUNWopenssl-libraries P SUNWzlib
The _ctype module fails to compile with Sun Studio 12. Rather than fix this, I simply used gcc instead. Also Python seemed to be missing _ssl, so I popped in the appropriate library paths. Thus:
export "LDFLAGS=-L/opt/sfw/lib -R/opt/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" export "CPPFLAGS=-I/usr/sfw/include -I/opt/sfw/include -I/opt/sfw/include/ncurses" export "CFLAGS=-I/opt/sfw/include" export "LIBS=-lncurses" export CC=gcc CXX=g++ ./configure --prefix=/opt/python26 --enable-shared --disable-ipv6 --with-threads --with-libs="-lncurses" --with-wctype-functions gmake gmake install
Not all the modules will compile, but the ones that were missing were not of importance (sqlite, bsdbd, etc).
1 comment January 27th, 2009
A very boring first post – but I thought I’d blog about this since it’s fresh in my mind!
Sun’s Web Stack – CoolStack
We’ve been using Solaris in an ever increasing way here at EveryCity for a while now. Solaris is an excellent operating system for many reasons, and I’ll no doubt be blogging about it plenty in the weeks and months to come. But one of the key areas Solaris currently lags behind Linux with is the availability of well made, precompiled packages of popular open source software. A very large number of servers these days are deployed to run web services, including Apache, PHP, MySQL, Ruby on Rails, etc, and installing this on Linux can be as simple as “yum install apache php mysql”.
So Sun set out to provide a solution to this on Solaris – enter CoolStack. CoolStack has a good selection of software, including:
- Apache HTTP Server
- PHP Hypertext Processor
- MySQL Database
- Perl Scripting Language
- Ruby (Including rubygems and rails)
- Tomcat J2EE/Java Web Server
- Squid Caching Proxy Server
The PHP package includes a good selection of libraries, so you can get started straight out of the box.
Adding mcrypt Support to PHP on CoolStack 1.3.1
One of the things that CoolStack is missing however is the mcrypt extension, which is used in a number of PHP applications, for example PHPMyAdmin. I was surprised this was missed out, as so many others are included. However it’s not too hard to add this ourself. This example is for CoolStack 1.3.1, but assuming the stack doesn’t change too much, the principles should be the same.
Head on over to http://sourceforge.net/projects/mcrypt and download the latest libmcrypt source. You’ll need a healthy development environment, which I’m hoping to blog about in a future post (Hint: Grab Sun Studio 11 and put /opt/SUNWspro/bin at the front of your path).
You’ll want to choose a sensible place to install libmcrypt to – since I was producing a package for deployment to other servers, I chose “/opt/libs/libmcrypt”, but where you place this is up to you – “/opt/coolstack” is another suitable PREFIX path.
Let’s now compile and install libmcrypt (Using cc rather than gcc):
unset CC LDFLAGS CFLAGS export CC=cc ./configure --prefix=/opt/libs/libmcrypt --enable-dynamic-loading \ --with-included-algos=cast-128,gost,rijndael-128,twofish,arcfour,cast-256,loki97,rijndael-192,saferplus,wake,blowfish-compat,des,rijndael-256,serpent,xtea,blowfish,enigma,rc2,tripledes make make install
Et Voilà! You now have libmcrypt installed. If your compiler barfs, post a printout of what you get in the comments and I’ll assist if I can.
Compiling the php mcrypt extension
Assuming you have already downloaded, installed and configured CoolStack, all we need to do is fetch two CoolStack source packages. Nip on over to http://cooltools.sunsource.net/coolstack/, click the link to download, and choose “Source” as the Platform.
Download and install CSKruntime_1.3.1_Src.pkg.bz2 and CSKamp_1.3.1_Src.pkg.bz2 – this should place files under /opt/coolstack/src. Now lets compile the mcrypt extension:
cd /opt/coolstack/src/php5/ ./prepare_src cd php-5.2.6/ext/mcrypt /opt/coolstack/php5/bin/phpize ./configure --with-php-config=/opt/coolstack/php5/bin/php-config \ --with-mcrypt=/opt/libs/libmcrypt/ make make install
You can check to make sure the resulting mcrypt.so file is safe to use by doing:
This should not show any “(file not found)” errors.
Finally, add extension=mcrypt.so to /opt/coolstack/php5/lib/php.ini. Restart Apache (svcadm restart http) – phpinfo(); in a php file should now show a happy mcrypt installation :)
14 comments October 26th, 2008