On (04/27/12 12:06), Mike Frysinger wrote: > On Friday 27 April 2012 11:02:34 Sergey Senozhatsky wrote: > > PKG_CHECK_MODULES([LIBNIL], [libnl-1],[],[ > > - PKG_CHECK_MODULES([LIBNIL], [libnl-2.0],[] ,[ > > - PKG_CHECK_MODULES([LIBNIL], [libnl-3.0],[] > > ,[AC_MSG_ERROR([libnl is required but was not found])]) > > + PKG_CHECK_MODULES([LIBNIL], > > [libnl-2.0],[AC_DEFINE([HAVE_LIBNL20],[1],[Define if you have libnl-2.0 or > > higher])], > > + [ > > + PKG_CHECK_MODULES([LIBNIL], [libnl-3.0 libnl-genl-3.0], > > + [AC_DEFINE([HAVE_LIBNL20],[1],[Define if > > you have libnl-3.0 or higher])], > > + [AC_MSG_ERROR([libnl is required but was > > not found])]) > > ]) > > ]) > > does autoheader allow the same symbol to be defined multiple times ? how > about: >
Good catch. I think this is undocumented behavior, which is translated to `do not do that'. It seems, however, that the last AC_DEFINE() executed wins, and sice we only set HAVE_LIBNL20 to 1, there is unlikely probability of HAVE_LIBNL20 having some suprsing value at the end. Yet I agree, that only one AC_DEFINE() should be reached for HAVE_LIBNL20. > PKG_CHECK_MODULES([LIBNIL], [libnl-1],[libnl_ver=1],[ > PKG_CHECK_MODULES([LIBNIL], [libnl-2.0],[libnl_ver=2],[ > PKG_CHECK_MODULES([LIBNIL], [libnl-3.0 libnl-genl-3.0], > [libnl_ver=3],[ > AC_MSG_ERROR([libnl is required but was not found]) > ]) > ]) > ]) > AS_IF([test 1 != "$libnl_ver"], [ > AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher]) > ]) > -ss _______________________________________________ Power mailing list Power@bughost.org https://bughost.org/mailman/listinfo/power