From: Stephen Waits Date: 2006-04-02T01:23:09+09:00 Subject: Re: Compile requirements of Ruby and Extensions --Apple-Mail-1-245096190 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Apr 1, 2006, at 7:48 AM, Markus Kolb wrote: > is there anywhere a list what libs ruby and a extension needs to be > configured and compiled? Unfortunately, no. I dug around until I figured it out. See attached script for help. --Steve --Apple-Mail-1-245096190 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0755; name="go.sh" Content-Disposition: attachment; filename=go.sh #!/bin/sh FETCH="fetch -ar" #FETCH="wget" #FETCH="curl -O" WORKDIR=`pwd`/work BOOTSTRAPDIR=`pwd`/bootstrap BUNDIR=`pwd`/bundle rm -rf build $BUNDIR $WORKDIR $BOOTSTRAPDIR mkdir -p build mkdir -p pkg mkdir -p $BUNDIR mkdir -p $WORKDIR mkdir -p $BOOTSTRAPDIR export LDFLAGS="-L$WORKDIR/lib" export CPPFLAGS="-I$WORKDIR/include" ORIGINAL_PATH="$PATH" export PATH="$WORKDIR/bin:$PATH" hash -r ################# ## Downloads ## ################# # can we auto download *latest* packages??? cd pkg $FETCH ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz $FETCH http://www.zlib.net/zlib-1.2.3.tar.gz $FETCH http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz $FETCH http://www.openssl.org/source/openssl-0.9.8a.tar.gz $FETCH ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz $FETCH ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.8.3.tar.gz $FETCH http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz $FETCH http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz cd .. cd build ############### ## ncurses ## ############### tar zxvf ../pkg/ncurses-5.5.tar.gz cd ncurses-5.5 # build once so we can get the database and infocmp ./configure \ --prefix=$BOOTSTRAPDIR \ --with-static \ --with-shared \ --without-debug \ --without-profile \ --without-ada && \ make && \ make install || exit 1 OLD_PATH="$PATH" export PATH="$BOOTSTRAPDIR/bin:$PATH" hash -r # build a second time, except embed a few termcaps (needed db & infocmp 1st) FALLBACKS="ansi,linux,screen,screen-w,vt52,vt100,vt102,vt220,xterm,xterm-color,xterm-mono" ./configure \ --prefix=$WORKDIR \ --with-static \ --without-shared \ --without-rpath \ --without-debug \ --without-profile \ --without-ada \ --without-progs \ --disable-database \ --with-fallbacks=$FALLBACKS && \ make && \ make install || exit 1 export PATH="$OLD_PATH" hash -r cd .. ################ ## readline ## ################ tar zxvf ../pkg/readline-5.1.tar.gz cd readline-5.1 ./configure \ --prefix=$WORKDIR \ --enable-static \ --disable-shared && \ make && \ make install || exit 1 cd .. ############ ## zlib ## ############ tar zxvf ../pkg/zlib-1.2.3.tar.gz cd zlib-1.2.3/ ./configure \ --prefix=$WORKDIR && \ make && \ make install || exit 1 cd .. ############# ## iconv ## ############# tar zxvf ../pkg/libiconv-1.9.1.tar.gz cd libiconv-1.9.1/ ./configure \ --prefix=$WORKDIR \ --enable-static \ --disable-shared \ --disable-rpath && \ make && \ make install || exit 1 cd .. ############### ## OpenSSL ## ############### # cannot link statically with openssl # conflicts with digest extension!!! #tar zxvf ../pkg/openssl-0.9.8a.tar.gz #cd openssl-0.9.8a/ ## cannot build with zlib b/c ruby's ext mkmf fails to add -lz #./config \ # --prefix=$WORKDIR \ # --openssldir=$WORKDIR \ # -L$WORKDIR/lib \ # -I$WORKDIR/include \ # no-shared \ # no-asm && \ #make && \ #make install || exit 1 #cd .. ############ ## gdbm ## ############ tar zxvf ../pkg/gdbm-1.8.3.tar.gz cd gdbm-1.8.3/ ./configure \ --prefix=$WORKDIR \ --enable-static \ --disable-shared && \ make && \ make install BINOWN=$USER BINGRP=$GROUP && \ make install-compat BINOWN=$USER BINGRP=$GROUP || exit 1 cd .. ############ ## Ruby ## ############ tar zxvf ../pkg/ruby-1.8.4.tar.gz cd ruby-1.8.4 ./configure \ --prefix=$BUNDIR \ --enable-static \ --disable-shared \ --disable-rpath \ --with-static-linked-ext \ --enable-install-doc \ --with-curses-dir=$WORKDIR \ --with-dbm-dir=$WORKDIR \ --with-gdbm-dir=$WORKDIR \ --with-iconv-dir=$WORKDIR \ --with-openssl-dir=$WORKDIR \ --with-readline-dir=$WORKDIR \ --with-zlib-dir=$WORKDIR && \ make && \ make install || exit 1 cd .. ############################## ## Setup Ruby Environment ## ############################## export PATH="$BUNDIR/bin:$ORIGINAL_PATH" hash -r ######################## ## Install RubyGems ## ######################## tar xzvf ../pkg/rubygems-0.8.11.tgz cd rubygems-0.8.11 ruby setup.rb cd .. ############ ## Gems ## ############ tar xzvf ../pkg/rubygems-0.8.11.tgz gem update --system -y gem install rails -y gem install capistrano -y cd .. echo "Bundle complete!" --Apple-Mail-1-245096190--