I'm trying to set up autoconf for my project. I have everything working "properly" except that the ac_set_<...> functions are not being found in ./configure. They work fine in configure.status if I run it directly.
Specifically, I am having trouble with as_fn_set_status and as_fn_exit.
If I manually edit the config file and move the two functions to the top of the configure script, everything works fine.
To get to this point I:
- Wrote configure.ac
- ran autoreconf -i
- ran ./configure
The resulting lines are something like:
./configure: line 1366: as_fn_set_status: command not found
There are 3-4 lines on which the error occurs.
Any ideas on what might be producing this effect? Here is my configure.ac:
##########################################
# Autoconf Configuration File for RPDB #
##########################################
# RPDB: An Object-Oriented Wrapper for Oracle's Berkeley Database (BDB/libdb),
# which is available at: http://www.oracle.com/technology/software/products/berkeley-db/index.html
###########################
# Init Autoconf >= 2.61 #
###########################
AC_CANONICAL_SYSTEM
AC_PREREQ(2.61)
AC_INIT([rpdb], [0.1.0], [[email protected]])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
#################################
# Check for Library Functions #
#################################
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_CHECK_FUNCS([strdup])
################################
# Check for Working Compiler #
################################
AC_PROG_CC
AC_PROG_RANLIB
#########################
# Check for Libraries #
#########################
AC_SEARCH_LIBS([db_create], [db], [have_libdb=yes])
#######################
# "Root Sourcefile" #
#######################
# "Root Sourcefile" is only used nominally to specify base path
AC_CONFIG_SRCDIR([src/RPDB_Base/RPDB.h])
#######################
# Check for Headers #
#######################
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# If we found libdb then check for db.h - we need to have both or we throw an error
if test "x${have_libdb}" = xyes; then
AC_CHECK_HEADERS([db.h], [], [have_libdb=no])
fi
if test "x${have_libdb}" = xno; then
echo "------------------------------------------"
echo " Oracle's Berkeley Database (libdb) "
echo " library and header file is required to "
echo " build RPDB. Stopping... "
echo " Check 'config.log' for more information. "
echo "------------------------------------------"
(exit 1); exit 1;
fi
#####################################################
# Check For Type-Related Compiler Characteristics #
#####################################################
AC_C_CONST
AC_HEADER_STDBOOL
AC_TYPE_INT32_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
###############################
# Generate Configure Script #
###############################
AC_OUTPUT