Menu

autobld script for NEED_function token

Developers
2002-11-11
2013-10-17
  • Charlie Zender

    Charlie Zender - 2002-11-11

    Hi Rorik,

    We need an autobuild mechanism to define tokens indicating the absence
    of a function. In other words, a mechanism which checks for the
    presence of a function, and if the result is negative it defines the
    token NEED_XYZ (instead of _not_ defining HAVE_XYZ). Is there such
    a beast or can you create one? If so then I want to make use of
    this mechanism in the compilation of ncap when the presence/absence
    of math functions is checked.

    Thanks,
    Charlie

     
    • Rorik Peterson

      Rorik Peterson - 2002-11-11

      I made this change by defining a new macro.  Now in configure.in, use NCO_CHECK_FUNCS instead of AC_CHECK_FUNCS when you want NEED_func defined if it is not found. 

      I am curious why this is needed, however.  Why doesn't
      #ifndef HAVE_func
      ...
      #endif

      suffice?

      rorik

       
      • Charlie Zender

        Charlie Zender - 2002-11-11

        90% of the functions which NCO needs on a given
        platform are already present, so it is much quicker
        to specify which functions are needed, rather than
        those that are not needed. This is particularly true
        for ncap on MACOSX. Thus the new macro will help
        clarify the logic in the code (#ifdef is more straightforward
        than #ifndef) and shorten the Makefile.old (which is
        still required on many platforms).

        Thanks,
        Charlie

         
    • Rorik Peterson

      Rorik Peterson - 2002-11-11

      I made this change by defining a new macro.  Now in configure.in, use NCO_CHECK_FUNCS instead of AC_CHECK_FUNCS when you want NEED_func defined if it is not found. 

      I am curious why this is needed, however.  Why doesn't
      #ifndef HAVE_func
      ...
      #endif

      suffice?

      rorik

       

Log in to post a comment.