"Gerald I. Evenden" <geraldi.even...@gmail.com> writes: > I am quite new to using this system but managed to get it to make a > distribution of a shared library. The first try was, however, simple > and straight forward. > > However, I want selectively add two files to the library based upon the > condition that they are *not* present on the target computer. In > configure.ac I added the lines: > > AC_CHECK_FUNCS([strcasecmp strncasecmp],[CASECMP=1],[CASECMP=0]) > AM_CONDITIONAL([NOCASECMP],[test CASECMP = 0])
You need a $CASECMP here, not CASECMP. However, more fundamentally, you're reinventing AC_REPLACE_FUNC, which you probably don't want to do. Check the Autoconf manual for AC_REPLACE_FUNC, which does exactly what you're trying to do, even down to how it adds additional source files to a variable that you can use in Makefile.am. > In Makefile.am I added the lines: > > if NOCASECMP > libproject_la_sources += strcasecmp.c strncasecmp.c You need an endif here, which may also be part of the problem with the errors you're seeing. Taking yet another step back, do you have a target system in mind that doesn't have strcasecmp? It's required by POSIX and is usually in the set of things that aren't worth bothering checking for unless you're porting to Windows (which particularly for shared libraries involves quite a bit of work that Automake can't entirely help with). -- Russ Allbery (r...@stanford.edu) <http://www.eyrie.org/~eagle/>