Perforce for Ruby ----------------- Requirements ------------ You *need* the Perforce API (p4api.tar) from the Perforce FTP site. The URL is: ftp://ftp.perforce.com/pub/perforce or http://www.perforce.com/downloads/perforce NOTE TO GCC USERS: If you're using gcc3, please make sure you use a Perforce API build compiled with gcc3. Using the gcc2 versions won't work. For Linux users this means you should NOT use the 'bin.linux24x86' builds. Building -------- To build P4Ruby, use the p4conf.rb script to build a makefile and then use your platform's 'make' tool to do the actual build. You must have downloaded and unpacked the Perforce API first. Usage: ruby p4conf.rb --apidir [ --apibuild ] [ --gccver 2|3 ] Where: --apidir - is the path to the Perforce API --apibuild - is the build identifier of the Perforce API. For example: ntx86 - Windows NT linux24x86 - Linux w/ gcc 2.95 linux3x86 - Linux w/ gcc 3.x linux26amd64 - Linux on AMD 64-bit This is the same as the directory name from which you downloaded the Perforce API (without the leading 'bin.' obviously) Most people won't need to use this as the script tries to detect this automatically. --gccver 2|3 - Which version of gcc you're using. Some platforms (Cygwin/Darwin) install both gcc2 and gcc3 and if you want to use gcc2 you have to use a different command line. Using --gccver=2 allows you to do this. UNIX Builds: Unpack the Perforce API into a new directory - but *NOT* in the same directory as this extension (mkmf won't like it). Then run: ruby p4conf.rb --apidir make make install For the last step, you'll probably need to be root. Windows Builds: You will need Visual Studio to build P4/Ruby as mkmf generates nmake compatible makefiles. Unpack the Perforce API into a new directory - but *NOT* in the same directory as this extension (mkmf won't like it). Then run: ruby p4conf.rb --apidir nmake nmake install Cygwin Builds: Do NOT attempt to build the P4Ruby for use with Cygwin's Ruby build without using the Cygwin version of the Perforce API! Many people think they can use the Windows build of the API, but it won't work, so don't waste your time. Troubleshooting --------------- See the FAQ