On 05/15/18 17:41, Magnus Fromreide wrote:
One other issue with --enable-minimalist is that it is kind of broken
since it requires that you pass information back from the agent building
pass to the lib building pass and from the mib pass to the agent pass
but that happens to late. I have been toying with a partial cpp
implementation in awk in order to handle this but not gotten it clean
enough to use (and the windows people would probably hate me forever if
I made awk a requirement (awk is faster than C when you have to compile
the C code first but C is more portable - choose your poison))

Although I admire your efforts to make the current system for computing dependencies work, I'm not sure that's what we should do. Personally I think we should take all dependency computation mechanisms (features + config_require()) out of the .c and .h source files such that the compiler is not needed to compute dependencies. Here is an example how dependency calculation works in another open source project (Valgrind) that supports multiple operating systems:
* The configure script determines whether or not pthread_barrier_init()
  is supported. If that function is supported, the automake variable
  HAVE_PTHREAD_BARRIER is set.
* The following construct decides whether or not regression tests that
  need pthread_barrier_init() are built (from drd/tests/Makefile.am):

if HAVE_PTHREAD_BARRIER
check_PROGRAMS +=               \
        bug322621               \
        matinv                  \
        pth_barrier             \
        pth_barrier_race        \
        pth_barrier_reinit      \
        pth_barrier_thr_cr      \
        thread_name
endif

The Linux kernel uses a similar but more complex approach. Net-SNMP is the only software project I know of that has information about which files should be built embedded in source code files instead of in (the equivalent of) makefiles.

Bart.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to