How to include .m4 files in Autoconf?

前端 未结 5 938
孤街浪徒
孤街浪徒 2021-02-05 04:46

I have downloaded a macro from Autoconf Archive, and I want to use it. What do I have to put in my configure.ac file to make use this macro?

5条回答
  •  轮回少年
    2021-02-05 05:20

    I had this exact same question, and it was harder to find an answer than I thought. It looked like AC_CONFIG_MACRO_DIR was what I wanted, but if you are not using libtoolize, it appears that AC_CONFIG_MACRO_DIR is useless at present.

    If you're using automake, I think the answer above is right.

    I'm not using automake, so the only way I've found is to use the m4_include macro to suck in each .m4 file individually. I found this approach here:

    http://www.flameeyes.eu/autotools-mythbuster/autoconf/macros.html

    Hope this helps. (Considering how long autoconf has been around, it boggles my mind somewhat that there's no built-in way to just specify a directory in the .ac file. Seems like it would be an awefully common use case. Oh, well.)

提交回复
热议问题