bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Five bugs (IBM-PC systems)


From: Pavel Jan Lastovicka
Subject: Five bugs (IBM-PC systems)
Date: Thu, 31 Jul 2003 11:25:56 +0200

Hello,

I am going to describe some problems with configure scripts 
generated by Autoconf (I have used the script from grep 2.5, 
which was generated by Autoconf 2.53).
These problems apply to systems commonly used on IBM PC
(excluding Unix-like systems).

1. search for installed programs

the following is produced:  
   for ac_exec_ext in '' $ac_executable_extensions;

but ac_executable_extensions is nowhere defined.

2. the check whether make sets ${MAKE}

I have to insert 'SHELL=sh' before 'all:'
- a Unix shell is not the default shell on non-Unix systems...

3. the check for environ variable separator

  if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$DJ_GPP" = yes ; 
then
  ac_cv_sep=yes
else
  ac_cv_sep=no

Excuse me, this should mean what? 
Is djgpp the only port of gcc for DOS? No!
(not mentioning that apart from Windows and DOS there's
 IBM OS/2 which is superior to Microsoft OSs...)

IMHO you should use $PATH_SEPARATOR which is determined as one of
first things in the configure script.

4. the check whether $CC accepts -g

This check overwrites user's CFLAGS setting which is bad:
in my environment (which is derived from the emx)
I launch the configure by  CFLAGS='-Zomf' ./configure
(simplified, my command line is actually much longer).
The -Zomf flag tells the gcc driver to produce an object
file in different format, with different extension.
Without this flag a configure script of course cannot find 
the conftest.obj and thinks that -g is not accepted.

  configure.:2242: checking whether gcc accepts -g
  configure.:2266: gcc -c -g  conftest.c >&5
  configure.:2269: $? = 0
  configure.:2272: test -s conftest.obj
  configure.:2275: $? = 1

This is just a visual problem because CFLAGS set by user
is preserved in config.status.

5.

  configure.:6279: checking for strerror in -lcposix
  configure.:6312: gcc -o conftest.exe -Zomf  conftest.c -lcposix  >&5
  
  LINK386 :  warning L4051: cposix.lib : cannot find library
  LINK386 :  warning L4071: application type not specified; assuming 
WINDOWCOMPAT
  configure.:6315: $? = 0
  configure.:6318: test -s conftest.exe
  configure.:6321: $? = 0
  configure.:6332: result: yes

As you can see this check does not prove that strerror
is in library cposix. First check for strerror function and then
(i.e. if it isn't found in default libraries) check whether
it is contained in cposix library.
AFAIK strerror is an ANSI/ISO function, not POSIX-specific.

------------------------------------------------------
Summary

I have always used a sed script for patching the configure file
as a part of the process of porting/compiling GNU packages.
For configuring grep 2.5 (autoconf 2.53) I had to create
the following script:

/^all:/i\
SHELL=sh
s!'' $ac_executable_extensions!'.exe'!
s!^CFLAGS="-g"!CFLAGS="-g $CFLAGS"!
s!SEP=":"!SEP=$PATH_SEPARATOR!
s!"${ac_cv_lib_cposix_strerror+set}" = set!& -o $ac_cv_func_strerror = yes!
/ac_cv_lib_cposix_strerror+set/a\
if test "${ac_cv_lib_cposix_strerror+set}" != set; then\
  ac_cv_lib_cposix_strerror=no\
fi


Regards
Pavel Lastovicka





reply via email to

[Prev in Thread] Current Thread [Next in Thread]