unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reported bad code in Emacs configure file
@ 2002-05-01  7:14 Richard Stallman
  2002-05-01  7:26 ` Jim Meyering
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2002-05-01  7:14 UTC (permalink / raw)
  Cc: Alexandre Oliva, Akim Demaille, James Meyering, Tom Tromey,
	Paul Eggert, Pavel Roskin

Since this code is generated by autoconf, does someone see
a way to solve this problem?

Is this an autoconf bug?  Should it be generating
doublequotes in such tests?


From: "Daniel Ortmann" <dortmann@lsil.com>
To: <rms@gnu.org>
Subject: emacs configure: a configure script fix for the march 16 emacs version 21.2
Date: Tue, 30 Apr 2002 13:34:47 -0500
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

Hello,

As an experiment, I compiled the march 16 release of emacs 21.2 on a sun
system using "-without-gcc", and had configure crash on the line marked with
"!".

The fix is to put double quotes around the "$emacs_cv_speed_t" variable.  I
have not attempted to analyze and find all such cases.

The system is:
rm22:emacs-21.2$ uname -a
SunOS rm22 5.8 Generic_108528-11 sun4u sparc SUNW,Ultra-Enterprise


*** configure.~1~       Fri Mar 15 06:46:09 2002
--- configure   Tue Apr 30 13:26:28 2002
***************
*** 3039,3045 ****
  fi

  echo "$ac_t""$emacs_cv_speed_t" 1>&6
! if test $emacs_cv_speed_t = yes; then
    cat >> confdefs.h <<\EOF
  #define HAVE_SPEED_T 1
  EOF
--- 3039,3045 ----
  fi

  echo "$ac_t""$emacs_cv_speed_t" 1>&6
! if test "$emacs_cv_speed_t" = yes; then
    cat >> confdefs.h <<\EOF
  #define HAVE_SPEED_T 1
  EOF

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reported bad code in Emacs configure file
  2002-05-01  7:14 Reported bad code in Emacs configure file Richard Stallman
@ 2002-05-01  7:26 ` Jim Meyering
  2002-05-02  7:43   ` Akim Demaille
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Meyering @ 2002-05-01  7:26 UTC (permalink / raw)
  Cc: emacs-devel, Alexandre Oliva, Akim Demaille, Tom Tromey,
	Paul Eggert, Pavel Roskin

That code comes from configure.in:

dnl Check for speed_t typedef.
AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
  emacs_cv_speed_t=yes, emacs_cv_speed_t=no))
if test $emacs_cv_speed_t = yes; then
  AC_DEFINE(HAVE_SPEED_T, 1, [Define to 1 if `speed_t' is declared by <termios.h>.])
fi

Since that variable is defined either to no or to yes just above
(in the absence of a cached value), I don't see a need for double
quotes, unless he's doing something strange:

  -- he is using a corrupted cache file, or
  -- he has set emacs_cv_speed_t to the empty string in his environment

...
> *** configure.~1~       Fri Mar 15 06:46:09 2002
> --- configure   Tue Apr 30 13:26:28 2002
> ***************
> *** 3039,3045 ****
>   fi
>
>   echo "$ac_t""$emacs_cv_speed_t" 1>&6
> ! if test $emacs_cv_speed_t = yes; then
>     cat >> confdefs.h <<\EOF
>   #define HAVE_SPEED_T 1
>   EOF
> --- 3039,3045 ----
>   fi
>
>   echo "$ac_t""$emacs_cv_speed_t" 1>&6
> ! if test "$emacs_cv_speed_t" = yes; then
>     cat >> confdefs.h <<\EOF
>   #define HAVE_SPEED_T 1
>   EOF

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reported bad code in Emacs configure file
  2002-05-01  7:26 ` Jim Meyering
@ 2002-05-02  7:43   ` Akim Demaille
  0 siblings, 0 replies; 3+ messages in thread
From: Akim Demaille @ 2002-05-02  7:43 UTC (permalink / raw)
  Cc: rms, emacs-devel, Alexandre Oliva, Tom Tromey, Paul Eggert,
	Pavel Roskin


| That code comes from configure.in:
| dnl Check for speed_t typedef.
| AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
| AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
|   emacs_cv_speed_t=yes, emacs_cv_speed_t=no))
| if test $emacs_cv_speed_t = yes; then
|   AC_DEFINE(HAVE_SPEED_T, 1, [Define to 1 if `speed_t' is declared by <termios.h>.])
| fi

This is code is fragile.  It should read


# Check for speed_t typedef.
AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
[AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
  emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
if test $emacs_cv_speed_t = yes; then
  AC_DEFINE(HAVE_SPEED_T, 1, 
            [Define to 1 if `speed_t' is declared by <termios.h>.])
fi

The important being the quotes around AC_TRY_COMPILE.



Please, use autoconf@gnu.org.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-05-02  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01  7:14 Reported bad code in Emacs configure file Richard Stallman
2002-05-01  7:26 ` Jim Meyering
2002-05-02  7:43   ` Akim Demaille

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).