[erlang-questions] autoconf and erlang

Alceste Scalas alceste@REDACTED
Mon Nov 12 11:18:49 CET 2007


Il giorno gio, 08/11/2007 alle 14.53 +1100, jm ha scritto:
> 1) How do I work out where to put the beam files and the compiled c-port?

>From the GNU Autoconf documentation:

        For the more specific installation of Erlang libraries, the
        following variables are defined:
        
        — Variable: ERLANG_INSTALL_LIB_DIR
                The common parent directory of Erlang library
                installation directories. This variable is set by
                calling the AC_ERLANG_SUBST_INSTALL_LIB_DIR macro in
                configure.ac. 
        
        — Variable: ERLANG_INSTALL_LIB_DIR_library
                The installation directory for Erlang library library.
                This variable is set by calling the
                `AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(library, version)'
                macro in configure.ac. 


> 2) What is the best way to alter the code so that the open_port() 
> function knowns what to execute? At the moment, there's a
> 
>     -define(PORTPROG, "./inotify").
> 
> near the top of the erlang source file. Include file? How do i go about 
> finding the correct path and inserting this automatically?

You could use code:priv_dir/1 (and possibly put your executable in the
module private directory).

Regards,
-- 
Alceste Scalas <alceste@REDACTED>
CRS4 - http://www.crs4.it/




More information about the erlang-questions mailing list