automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: first attempt at ocaml support


From: Guillaume Rousse
Subject: Re: first attempt at ocaml support
Date: Wed, 20 Dec 2006 18:09:28 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061109)

Also sprach Guillaume Rousse:
>>> +# Objective Caml
>>> +register_language ('name' => 'ocaml',
>>> +                  'Name' => 'Objective Caml',
>>> +                  'config_vars' => ['OCAMLDEP', 'OCAMLC'],
>>> +             'flags' => ['OCAML_INCLUDES', 'OCAMLFLAGS'],
>>> +             'compiler' => 'COMPILE',
>> Shouldn't this be something like OCAMLCOMPILE?
> I must confess I didn't understood exaclty what it was supposed to do,
> and I filled it just to avoid warnings :(
I just reread documentation a bit more precisely. The couple of
variables 'compiler' and 'compile' in a language declaration define the
name and the content of a compilation rule, supposed to be unique for a
language. Other similars couples are 'linker' and 'link', as well as
'lder' and 'ld'.

I see how to workaround this by using two different ocaml language
declarations. This would not require any structural change in automake,
but I don't see how automake would select which one to apply given they
use the same source files.

Otherwise, each language declarations could declare lists of compiler,
linker and link variable. And use their corresponding ids or list
position to matche them 'use 'default' compiler with 'default' linker).
But it seems to be a huge change in automake :(

Here is an example for C:
# C.
register_language ('name' => 'c',
                   'Name' => 'C',
                   'config_vars' => ['CC'],
                   'ansi' => 1,
                   'autodep' => '',
                   'flags' => ['CFLAGS', 'CPPFLAGS'],
                   'compilers' => {
                       'default' => {
                           'compiler' => 'COMPILE',
                           'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
                        }
                    },
                   'lders' => {
                       'default' => {
                           'lder' => 'CCLD',
                           'ld' => '$(CC)',
                        }
                    },
                   'linkers' => {
                       'default' => {
                           'linker' => 'LINK',
                           'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
                        }
                    },
                   'compile_flag' => '-c',
                   'libtool_tag' => 'CC',
                   'extensions' => ['.c'],
                   '_finish' => \&lang_c_finish);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]