Bug 1999491

Summary: whatsup fails to build from source in Fedora 36 with autoconf-2.71: ./configure: line 15855: syntax error near unexpected token `as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`'
Product: [Fedora] Fedora Reporter: Ondrej Dubaj <odubaj>
Component: whatsupAssignee: Petr Pisar <ppisar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: david.brown, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/build/11062227
Whiteboard:
Fixed In Version: whatsup-1.14-37.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-26 15:10:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1936597, 1992484    

Description Ondrej Dubaj 2021-08-31 08:08:09 UTC
Your package fails to build with the newest autoconf-2.71, which was part of a recent wide Fedora change. More information about Fedora autoconf Change available here: https://fedoraproject.org/wiki/Changes/Autoconf_271#How_To_Test. The easiest way to reproduce the problem is to execute a fedora scratch-build on your package. Thank you for cooperation!

Comment 1 Petr Pisar 2021-11-26 13:11:22 UTC
From the build log:

./configure --build=aarch64-redhat-linux-gnu --host=aarch64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --with-perl-extensions --with-perl-vendor-arch --with-perl-destdir=/builddir/build/BUILDROOT/whatsup-1.14-36.fc36.aarch64
[...]
checking for GNU libc compatible malloc... yes
./configure: line 15855: syntax error near unexpected token `as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`'
./configure: line 15855: `  as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`'
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.LfkFO0 (%build)
    extra tokens at the end of %else directive in line 186:  %else # EPEL thing
    extra tokens at the end of %else directive in line 204:  %else # EPEL thing
    extra tokens at the end of %else directive in line 223:  %else #EPEL thing
    Bad exit status from /var/tmp/rpm-tmp.LfkFO0 (%build)
Child return code was: 1
EXCEPTION: [Error()]

Comment 2 Petr Pisar 2021-11-26 13:23:50 UTC
There is an escaping error:

  for ac_func in strcpy strdup strchr \ strlen \ strcat \ strtok \
do :
  as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
  cat >>confdefs.h <<_ACEOF
#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi

Because of the backslashes at "for" line,  the "do" word is not recognized as keyword. Also ac_func variable contains " strlen" value instead of "strlen".

Comment 3 Petr Pisar 2021-11-26 13:37:23 UTC
This comes from configure.ac:

AC_CHECK_FUNCS( \
  strcpy \
  strdup \
  strchr \
  strlen \
  strcat \
  strtok \
)

Old autoconf converts it into:

for ac_func in \
  strcpy \
  strdup \
  strchr \
  strlen \
  strcat \
  strtok \

do :

New autoconf into:

  for ac_func in strcpy strdup strchr \ strlen \ strcat \ strtok \
do :

Comment 4 Petr Pisar 2021-11-26 14:54:12 UTC
There were blank lines at the end of the lines. I will fix it.