I am writing my first project that will use autoconf and teaching it to myself as I go. For the most part, things are going extremely well. I have one last significant hurdle. I am having trouble locating library and header files that may be named differently from one system to the next.
For example, I need to compile with Mozilla's SpiderMonkey. When compiled from source, SpiderMonkey becomes libjs.so. On my Linux variant, however, SpiderMonkey is installed as libmozjs.so. It's the same library, just a different name, thus a different linker flag.
Is there a proper way to go about detecting the name of the library? Do I just default it to 'js' and give a configure option to override it?
I have the same situation with header files. The header files for SpiderMonkey are installed at /usr/include/mozjs/ on my operating system. I am sure that on other systems, it will be /usr/include/js/ or maybe even simply /usr/include/. How do I find the proper header file location? I was hesitant to do a vanilla "find" since it would be slow and I might find the wrong copy of the file (finding the file in a user's home directory instead of /usr/include/ for instance.)