Search This Blog

Sunday, September 28, 2014

Compile and install error of email 3.2.0-git

http://www.cleancode.org/projects/email

The current version of email 3.2.0-git has a problem in 'configure.in.' Some environment variables are defined out of scope, then prevent the installation process.

1. Problem

a. Download source code from GitHub

$ git clone https://github.com/deanproxy/eMail.git
$ cd eMail/
$ git clone https://github.com/deanproxy/dlib.git

b. Compile and install

$ ./configure
$ make
$ sudo make install

output

./install.sh --bindir "/usr/local/bin" --sysconfdir "/usr/local/etc" \
--mandir "/usr/local/share/man" --binext "" --version "" \
        --docdir "/usr/local/share/doc/"
error: You MUST specify the --version flag
make: *** [install] Error 2

This is because some environment variables, 'version' and 'cwd', is defined out of scope in 'configure.in'. Every check in 'configure.in' or 'configure.ac' must be between AC_INIT and AC_OUTPUT.
http://www.gnu.org/software/autoconf/manual/autoconf.html#Autoconf-Input-Layout

2. Solution

It is necessary to move these variable declarations into somewhere between AC_INIT and AC_OUTPUT. The revised 'configure.in' will look like the following:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
version=`cat VERSION`
cwd=`pwd`

AC_PREREQ(2.57)

AC_INIT(email, 3, )
AC_CONFIG_SRCDIR([src/addr_parse.c])
AC_CONFIG_HEADER([include/config.h])
AC_GNU_SOURCE

version=`cat VERSION`

cwd=`pwd`

# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
...

a. Reconfiguration

$ make clean
$ autoconf

b. Compile and install again

$ ./configure
$ make
$ sudo make install

output

./install.sh --bindir "/usr/local/bin" --sysconfdir "/usr/local/etc" \
--mandir "/usr/local/share/man" --binext "" --version "3.2.0-git" \
        --docdir "/usr/local/share/doc/"
Installing email v3.2.0-git...
Binary directory: /usr/local/bin
Man directory: /usr/local/share/man
System configuration file directory: /usr/local/etc
Copying src/email to /usr/local/bin...
Creating Email Directory... 
Created '/usr/local/etc/email'... 
Copying Files to '/usr/local/etc/email' directory... 
Copying man pages to /usr/local/share/man/man1...
Copying email help documentation to /usr/local/share/doc//email-3.2.0-git... 
 Success!

#######################################################
# Done installing E-Mail client.                      #
# Please read README for information on setup and use.#
#                                                     #
# If you have any questions or concerns...            #
# Please e-mail: software@cleancode.org               #
#######################################################

No comments:

Post a Comment

Blog Archive