Notwithstanding the manual's objection to the practice, it is relatively common for configure scripts to support this via a --with option, so that the appropriate command line takes the form:
~/foo$ ./configure --with-bar-dir=/home/user/.local
That difference follows in large part from the fact that there are only two built-in mechanisms for making configure recognize additional command-line arguments: AC_ARG_ENABLE and AC_ARG_WITH, and these provide for arguments with corresponding idiosyncratic forms. The --with-xyzzy=... form provided by the latter makes more sense for specifying a library directory than the --enable-xyzzy=... form provided by the former.
For example, you might use this in your configure.ac:
AC_ARG_WITH(
[bar-dir],
[AS_HELP_STRING(
[--with-bar-dir=@<:@directory@:>@],
[Specify directory as the location of libbar]
)],
[bar_ldflags="-L${withval}"]
)
Do read the documentation (linked above), as I've given only a taste of what AC_ARG_WITH does.
How you use the data received this way depends on what else you want to do. You might put it straight into an output variable and let configure otherwise ignore it, but if you're using AC_CHECK_LIB or AC_SEARCH_LIBS to check for the library then you will need to put it in LDFLAGS for those tests. LDFLAGS is a user variable, however, so you should not make permanent changes to it:
LDFLAGS_save=$LDFLAGS
LDFLAGS="${LDFLAGS} ${bar_ldflags}"
AC_CHECK_LIB([bar], [bar_init])
LDFLAGS=$LDFLAGS_save
That would be combined with putting the flags from bar_ldflags into an output variable and writing Makefile.in or Makefile.am such that it is included among the link flags.
You also write:
Okay, but when what option should I use "to specify the file name to use to find certain files" [if I don't use a --with argument] ?
Supposing that we also reject --enable arguments, the only other option provided by Autoconf is environment variables. If you plan to rely on an environment variable, then you probably want to use AC_ARG_VAR() to tell Autoconf about it. That will enable you to get it documented in configure's help text, will automatically make it an output variable (without an explicit AC_SUBST) and it will make the variable "precious", such that configure will memorialize its value for re-use when the build system automatically reconfigures.