[F03] EXTENDS_TYPE_OF, CLASS IS and libgfortran

Janus Weil janus@gcc.gnu.org
Wed Nov 4 12:12:00 GMT 2009


2009/11/4 Janus Weil <janus@gcc.gnu.org>:
> Hi all,
>
>>> Now, first technical question: How do I correctly tell the libgfortran
>>> Makefile to pick up this file, and add the function to the library?
>>
>> You add the file to Makefile.am, probably to the gfor_helper_src
>> variable.  Then you build everything.
>>
>> This regenerates Makefile.in by running autoconf automatically.  Make
>> sure (beforehand :-) that you have the correct version of autoconf, and
>> make sure to check Makefile.in against the SVN version to catch any
>> unpleasant surprises that may suddenly raise their ugly head.
>>
>> Declare your function if you want it to be callable from the front end,
>> and use the export_proto macro on the declaration.  You can do that in
>> the file itself, unless you want to call it from somewhere else; then it
>> should go into libgfortran.h (and you should use iexport_proto).
>>
>> Add your new global symbol to gfortran.map.
>
> Ok, I have now concocted a patch, following Thomas' suggestions.
> However, when I use it to compile a simple test case, I get the
> following:
>
> /tmp/ccOHXez5.o: In function `MAIN__':
> test.f90:(.text+0x6a): undefined reference to `_gfortran_is_extension_of'

Uh, sorry for the noise, guys. I simply had a syntax error in the
gfortran.map file (it was just too late last night). It works now, and
I can successfully compile and link my test program.

Now I just need to replace the arguments, so that the function can
give sensible results.

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extends_type_of.diff
Type: text/x-diff
Size: 11574 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091104/bae1d75a/attachment.bin>


More information about the Fortran mailing list