Question: For more information about autotools-general Linux technology-Linux technology and application, see the following. I used autotools to generate the makefile file. In the/root/chap-2/autotools folder, there are two files: 2.7.main.c and 2.7.avg.c.
2.7.main.c:
/* Optional /*---------------------------------------------------------------------------------------------*/
# Include
Float avg (int var [], int num );
Int main ()
{
Int n, I;
Float average;
Printf ("Enter the number of Integers to be calculated :");
Scanf ("% d", & n );
Int array [n];
For (I = 0; I {
Printf ("Enter the % d INTEGER:", I + 1 );
Scanf ("% d", & array
); } Average = avg (array, n ); Printf ("the average of all % d integers is % 6.2f \ n", n, average ); } /* Optional /*----------------------------------------------------------------------------------------------*/ 2.7.avg.c content: /* Optional /*----------------------------------------------------------------------------------------------*/ Float avg (int var [], int num) { Float avrg = 0.0; Int I; For (I = 0; I { Avrg + = var; } Avrg/= num; Return (avrg ); } /* Optional /*----------------------------------------------------------------------------------------------*/ Use the command root @ ubuntu:/root/chap-2/autotools # The configure. scan file generated by autoscan contains the following content: /* Optional /*----------------------------------------------------------------------------------------------*/ #-*-Autoconf -*- # Process this file with autoconf to produce a configure script.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT ~ "Configure. scan" 20L, 469C /* Optional /*-----------------------------------------------------------------------------------------*/ Why is it 2.7.avg.c instead of 2.7.main.c in the AC_CONFIG_SRCDIR ([2.7.avg.c]) brackets in configure. scan? Please advise P.S.: this operation is performed on the VM.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.