Easiest way is to let the autoscan
create your configure.scan file then you can cut-n-paste what you need.
$ cd myCproject
$ autoscan
aclocal.m4:16: warning: this file was generated for autoconf 2.63.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
configure.ac:6: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2672: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2689: AC_LINK_IFELSE is expanded from...
aclocal.m4:1037: _LT_SYS_MODULE_PATH_AIX is expanded from...
aclocal.m4:4176: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:5251: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:159: _LT_SETUP is expanded from...
aclocal.m4:88: LT_INIT is expanded from...
configure.ac:6: the top level
configure.ac:6: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2672: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2689: AC_LINK_IFELSE is expanded from...
aclocal.m4:4176: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:5251: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:159: _LT_SETUP is expanded from...
aclocal.m4:88: LT_INIT is expanded from...
configure.ac:6: the top level
configure.ac: warning: missing AC_CHECK_FUNCS([clock_gettime]) wanted by: acs.c:405
configure.ac: warning: missing AC_CHECK_FUNCS([gethrtime]) wanted by: atomicclock.c:52
configure.ac: warning: missing AC_CHECK_FUNCS([gettimeofday]) wanted by: atomicclock.c:99
configure.ac: warning: missing AC_CHECK_HEADERS([mach/mach.h]) wanted by: atomicclock.c:16
configure.ac: warning: missing AC_CHECK_HEADERS([sys/time.h]) wanted by: atomicclock.c:13
configure.ac: warning: missing AC_PROG_CXX wanted by: ltmain.sh:677
configure.ac: warning: missing AC_PROG_RANLIB wanted by: ltmain.sh:1601
configure.ac: warning: missing AC_TYPE_UINT64_T wanted by: acs.c:338
$
At completion, the configure.scan
file gets created. An actual example of my personal project is shown as:
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lrt':
AC_CHECK_LIB([rt], [main])
# Checks for header files.
AC_CHECK_HEADERS([mach/mach.h stdint.h stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_CHECK_FUNCS([clock_gettime gethrtime gettimeofday])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS([automake-1.15])
AC_OUTPUT
You can cut-and-paste what you need from the configure.scan
and insert it under its appropriate section within your own configure.am
(or configure.in
) file.
autoscan
utility is part of the autoconf package.