Today, I’ve been setting up autotools for a little project of mine because it started using too many cflags to type in all the time. I used autotools before but still had to look up a lot of things, this document was quite helpful. If you’re searching for a beginner friendly tutorial, look here.
However, my earlier autotools-using projects did not use pthreads, and
autoscan apparently does not handle this case automatically. Well, how do I get autotools to set the right flags?
Searching the net for a while, I found that
ACX_PTHREAD from the AC Autoconf Macro Archive should do the trick. Gentoo has an ebuild for this macro library (sys-devel/ac-archive), so installing it was no problem. I just needed to figure out how to let autotools find the macro from the library. Solution:
- Add the macro to
- Use the
I added the following to
created a file called
acinclude.m4. This file will be used automatically by the normal autotools run, and that’s it. 🙂
Update 2013-07-10: On Ubuntu, the packet containing the
ACX_PTHREAD macro is called
acinclude is not necessary. A normal
autoreconf will do.