autoconf and erlang

Hal Snyder hal@REDACTED
Wed May 12 16:35:51 CEST 2004


We are using autoconf to build all our Erlang apps these days.
It helps with the following things:

a. portability (we need to run on several platforms)

b. selection of development vs. production environments when building

c. integrates well with packaging system (pkgsrc) which helps config &
   release management

This sort of relates to EPAN idea and recent publicity thread, if a
consistent build setup can be developed.


Here's one simple offering. To use, put it into otp.m4 or such in
$PREFIX/share/aclocal. In configure.ac, include the line
AX_WITH_ERL_RUN_TOP. It will look around for an Erlang run-time
distribution but allow you to override its best guess by specifying a
value e.g. sh configure --with-erl-run-top=/u1/lib/erlang.


dnl @synopsis AX_WITH_ERL_RUN_TOP()
## 
## Locates an installed Erlang run-time tree, placing the result in the precious
## variable $ERL_RUN_TOP. Accepts a present $ERL_RUN_TOP, then --with-erl-top.
## 
## Example:
##
##   AX_WITH_ERL_RUN_TOP
##
AC_DEFUN([AX_WITH_ERL_RUN_TOP],[
  AC_MSG_CHECKING([for --with-erl-run-top])
  AC_ARG_WITH([erl-run-top],
    AC_HELP_STRING([--with-erl-run-top],[Erlang run-time, e.g. /usr/pkg/lib/erlang]),
    [ERL_RUN_TOP="$withval"],
    [ERL_RUN_TOP=$prefix/lib/erlang
     if test -d "$ERL_RUN_TOP"; then
       :
     else
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ERL_RUN_TOP])
     fi
    ])
  AC_MSG_RESULT([$ERL_RUN_TOP])
  AC_SUBST([ERL_RUN_TOP])
])



More information about the erlang-questions mailing list