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

Re: Autoconf 2.50 - question



Hi,

Raja R Harinath <harinath@cs.umn.edu> writes:
> Ben Burton <benb@acm.org> writes:
> > Okay, I've seen my way through half of the k* autoconf problems.  Now I'm 
> > stuck again.
> > 
> > Does anyone know what to do with the following 2.13 macros in converting to 
> > 2.50?  I've had no success with autoupdate.
> > 
> > configure:1831: error: possibly undefined macro: AC_PROG_CXX_WORKS
> > configure:1530: error: possibly undefined macro: AC_PROG_CC_WORKS
> > configure:1531: error: possibly undefined macro: AC_PROG_CC_GNU
> > configure:5819: error: possibly undefined macro: AC_PATH_X_DIRECT
> > configure:1832: error: possibly undefined macro: AC_PROG_CXX_GNU
> > configure:1544: error: possibly undefined macro: AC_PROG_CC_G
> > configure:1843: error: possibly undefined macro: AC_PROG_CXX_G
> > configure:5824: error: possibly undefined macro: AC_PATH_X_XMKMF
> 
> Those are internal 'autoconf' macros.  It looks like some of the K_*
> macros try to replace AC_PROG_CC, AC_PROG_CXX and AC_PATH_X.  Try the
> following:
> 
>   1. Replace AC_PROG_CC_WORKS with _AC_PROG_CC_WORKS, and likewise for
>      the others (add a leading underscore).
> 
>   2. Add the following to the beginning of your acinclude.m4:
> 
>        # forward compatibility macros: make autoconf 2.13 look like 2.50
>        ifdef([_AC_PROG_CC_WORKS],[],
>              [AC_DEFUN([_AC_PROG_CC_WORKS],[AC_PROG_CC_WORKS])])
> 
>      and likewise for the others.  (You don't need this step if you
>      don't want to support autoconf 2.13).

Actually, the above only applies AC_PATH_X_DIRECT, AC_PATH_X_XMKMF,
AC_PROG_CC_G, and AC_PROG_CXX_G.

There has been much more deep plumbing changes in the AC_PROG_*
macros.  Here's an ***UGLY*** hack (untested).

  ifdef([AC_PROG_CC_WORKS],
        [define([MY_CC_WORKS],[AC_PROG_CC_WORKS])dnl
  define([MY_CC_GNU],[AC_PROG_CC_GNU])dnl
  # ... repeat for CXX
  ],
        [define([MY_CC_WORKS],
                [AC_LANG_PUSH(C)dnl
  _AC_COMPILER_EXEEXT_WORKS
  AC_LANG_POP()])
  define([MY_CC_GNU],
         [AC_LANG_PUSH(C)dnl
  _AC_LANG_COMPILER_GNU
  AC_LANG_POP()])
  #... repeat for CXX -- Use AC_LANG_PUSH(C++) instead
  ])

You can now probably use MY_CC_GNU and MY_CC_WORKS.

The real fix is, of course, clean up the K_* macros not to need to
replace the autoconf macros.

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash



Reply to: