RELEASE ENGINEERING AND CONFIGURATION MANAGEMENT
SPRING 2015
Autoconf / Autotools Use for Prime Numbers
- If your not using Docker to run this example
- please skip to line 54
We use docker because it can isolate a test environment on our laptop without without the need to install tools directly on the laptio. Visit http://boot2docker.io/ for more information to quickyly and easily get started
boot2docker up
docker build -t primes .
docker run -it --rm --name a4 primes /bin/bash
docker attach a4
This will generate all needed inforamation to build the package You can cat autogen.sh to see how it works.
$ ./autogen.sh
This will configure the build to install into /usr/bin
$./configure --prefix=/usr/
This will make build the needed object files from src/prime.c and build primes
$ make
This will install primes in /usr/
$ make install
Program is installed run Primes
(sample output)
$ primes
Enter the number of prime numbers required
5
First 5 prime numbers are :
2
3
5
7
11
$ make clean
$ make dist
$ exit
- Make sure gcc, autoconf, autotools-dev, and make are installed
- (make autogen.sh executable) chmod 755 autogen.sh
- ./autogen.sh
- ./configure --prefex= (e.g. /usr/ or /usr/local/)
- make
- make install
You can then run the program "primes"
(sample output)
$ primes
Enter the number of prime numbers required
5
First 5 prime numbers are :
2
3
5
7
11