about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog27
-rw-r--r--math/Makefile65
-rw-r--r--resolv/res_debug.c1
-rw-r--r--sysdeps/i386/Makefile3
-rw-r--r--sysdeps/libm-ieee754/w_cabsl.c2
-rw-r--r--sysdeps/libm-ieee754/w_hypotl.c2
-rw-r--r--sysdeps/m68k/Makefile3
-rw-r--r--sysdeps/unix/getlogin.c5
-rw-r--r--sysdeps/unix/getlogin_r.c5
-rw-r--r--sysdeps/unix/sysv/linux/schedbits.h1
10 files changed, 70 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index 1048926992..336cb921fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,32 @@
 Tue Jun  4 21:01:20 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>
 
+	* math/Makefile (libm-support, libm-calls): New variables.
+	(libm-routines): Construct this from those.
+	(calls): New variable.
+	(routines): Construct this from it.
+
+	* resolv/res_debug.c: Add missing #include <ctype.h>.
+
+	* sysdeps/unix/getlogin.c: Must pass struct utmp ptr to getutline_r.
+	* sysdeps/unix/getlogin_r.c: Likewise.
+
+	* sysdeps/libm-ieee754/w_hypotl.c: Fix typo.
+
+	* sysdeps/libm-ieee754/w_cabsl.c: __cabsl_complex -> __cabs_complexl
+
+	* math/Makefile (long-m-routines): Define recursive variable as
+	$(long-m-$(long-double-fcts)).
+	(long-m-yes): Put list of routines here.
+	(long-c-routines, long-c-yes): Likewise.
+
+	* sysdeps/unix/sysv/linux/schedbits.h: File removed.
+
+	* sysdeps/i386/Makefile (long-double-fcts): New variable, set to yes.
+	* sysdeps/m68k/Makefile: Likewise.
+
+	* math/Makefile [$(long-double-fcts)!=yes] (CPPFLAGS): Append
+ 	-DNO_LONG_DOUBLE.
+
 	* sysdeps/mach/hurd/getlogin_r.c: New file.
 
 Wed Jun  5 02:11:30 1996  Ulrich Drepper  <drepper@cygnus.com>
diff --git a/math/Makefile b/math/Makefile
index 730b5610e0..b3f49edf48 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -30,47 +30,31 @@ distribute	:= math_private.h machine/asm.h machine/endian.h
 # Build the -lm library.
 
 extra-libs	:= libm
-libm-routines	 = e_acos e_acosf e_acosh e_acoshf e_asin e_asinf	\
-		   e_atan2 e_atan2f e_atanh e_atanhf e_cosh e_coshf	\
-		   e_exp e_expf e_fmod e_fmodf e_hypot e_hypotf e_j0	\
-		   e_j0f e_j1 e_j1f e_jn e_jnf e_lgamma_r e_lgammaf_r	\
-		   e_log e_log10 e_log10f e_logf e_pow e_powf		\
-		   e_rem_pio2 e_rem_pio2f e_remainder e_remainderf	\
-		   e_scalb e_scalbf e_sinh e_sinhf e_sqrt e_sqrtf k_cos	\
-		   k_cosf k_rem_pio2 k_rem_pio2f k_sin k_sinf		\
-		   k_standard k_tan k_tanf s_asinh s_asinhf s_atan	\
-		   s_atanf s_cbrt s_cbrtf s_ceil s_ceilf s_copysign	\
-		   s_copysignf s_cos s_cosf s_erf s_erff s_expm1	\
-		   s_expm1f s_fabs s_fabsf s_finite s_finitef s_floor	\
-		   s_floorf s_frexp s_frexpf s_ilogb s_ilogbf		\
-		   s_ldexp s_ldexpf s_lib_version s_log1p s_log1pf	\
-		   s_logb s_logbf s_matherr s_modf s_modff s_nextafter	\
-		   s_nextafterf s_rint s_rintf s_scalbn s_scalbnf	\
-		   s_signgam s_significand s_significandf s_sin s_sinf	\
-		   s_tan s_tanf s_tanh s_tanhf w_acos w_acosf w_acosh	\
-		   w_acoshf w_asin w_asinf w_atan2 w_atan2f w_atanh	\
-		   w_atanhf w_cabs w_cabsf w_cosh w_coshf w_drem	\
-		   w_dremf w_exp w_expf w_fmod w_fmodf w_gamma		\
-		   w_gamma_r w_gammaf w_gammaf_r w_hypot w_hypotf w_j0	\
-		   w_j0f w_j1 w_j1f w_jn w_jnf w_lgamma w_lgamma_r	\
-		   w_lgammaf w_lgammaf_r w_log w_log10 w_log10f w_logf	\
-		   w_pow w_powf w_remainder w_remainderf w_scalb	\
-		   w_scalbf w_sinh w_sinhf w_sqrt w_sqrtf		\
-		   $(long-m-routines)
-
-ifeq ($(long-double-fcts),yes)
-long-m-routines	:= s_ceill s_copysignl s_fabsl s_finitel s_floorl	\
-		   s_nextafterl s_rintl s_significandl
-endif
+
+libm-support = k_standard s_lib_version s_matherr s_signgam
+libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod	\
+	     e_hypot e_j0 e_j1 e_jn e_lgamma_r e_log e_log10 e_pow	\
+	     e_rem_pio2 e_remainder e_scalb e_sinh e_sqrt k_cos		\
+	     k_rem_pio2 k_sin k_tan s_asinh s_atan s_cbrt		\
+	     s_ceil s_copysign s_cos s_erf s_expm1 s_fabs s_finite	\
+	     s_floor s_frexp s_ilogb s_ldexp s_log1p s_logb 		\
+	     s_modf s_nextafter s_rint s_scalbn s_significand		\
+	     s_sin s_tan s_tanh w_acos w_acosh w_asin			\
+	     w_atan2 w_atanh w_cabs w_cosh w_drem w_exp w_fmod w_gamma	\
+	     w_gamma_r w_hypot w_j0 w_j1 w_jn w_lgamma w_lgamma_r	\
+	     w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt
+libm-routines = $(libm-support) $(libm-calls) \
+		$(patsubst %_rf,%f_r,$(libm-calls:=f))	\
+		$(long-m-$(long-double-fcts))
+#long-m-yes = $(patsubst %_rl,%l_r,$(libm-calls:=l)) # not ready yet
+
 
 # These functions are in libc instead of libm because __printf_fp
 # calls them, so any program using printf will need them linked in,
 # and we don't want to have to link every program with -lm.
-routines = s_isinf s_isinff s_isnan s_isnanf $(long-c-routines)
-
-ifeq ($(long-double-fcts),yes)
-long-c-routines	:= s_isinfl s_isnanl
-endif
+calls = s_isinf s_isnan
+routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts))
+long-c-yes = $(calls:=l)
 
 
 include ../Rules
@@ -84,5 +68,12 @@ CPPFLAGS-s_lib_version.c := -D_POSIX_MODE
 # only the fdlibm code.
 CPPFLAGS += -D__NO_MATH_INLINES
 
+ifneq ($(long-double-fcts),yes)
+# The `double' and `long double' types are the same on this machine.
+# We won't compile the `long double' code at all.  Tell the `double' code
+# to define aliases for the `FUNCl' names.
+CPPFLAGS += -DNO_LONG_DOUBLE
+endif
+
 # The fdlibm code generates a lot of these warnings but is otherwise clean.
 override CFLAGS += -Wno-uninitialized -Wno-write-strings
diff --git a/resolv/res_debug.c b/resolv/res_debug.c
index c2fefb4750..4cbed577f8 100644
--- a/resolv/res_debug.c
+++ b/resolv/res_debug.c
@@ -66,6 +66,7 @@ static char rcsid[] = "$Id$";
 #include <arpa/nameser.h>
 
 #include <stdio.h>
+#include <ctype.h>
 #include <netdb.h>
 #include <resolv.h>
 #if defined(BSD) && (BSD >= 199103) && defined(AF_INET6)
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index 29676784a2..e1e098788d 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -1,3 +1,6 @@
 # The mpn functions need a #define for asm syntax flavor.
 # Every i386 port in use uses gas syntax (I think).
 asm-CPPFLAGS := $(asm-CPPFLAGS) -DGAS_SYNTAX
+
+# The i386 `long double' is a distinct type we support.
+long-double-fcts = yes
diff --git a/sysdeps/libm-ieee754/w_cabsl.c b/sysdeps/libm-ieee754/w_cabsl.c
index e82130d46d..21ef860a95 100644
--- a/sysdeps/libm-ieee754/w_cabsl.c
+++ b/sysdeps/libm-ieee754/w_cabsl.c
@@ -11,7 +11,7 @@
 
 long double
 __cabsl(z)
-	struct __cabsl_complex z;
+	struct __cabs_complexl z;
 {
 	return __hypotl(z.x, z.y);
 }
diff --git a/sysdeps/libm-ieee754/w_hypotl.c b/sysdeps/libm-ieee754/w_hypotl.c
index 9f92e950d6..2ec215fd13 100644
--- a/sysdeps/libm-ieee754/w_hypotl.c
+++ b/sysdeps/libm-ieee754/w_hypotl.c
@@ -27,7 +27,7 @@ static char rcsid[] = "$NetBSD: $";
 
 
 #ifdef __STDC__
-	long double __hypotl(longdouble x, long double y)/* wrapper hypotl */
+	long double __hypotl(long double x, long double y)/* wrapper hypotl */
 #else
 	long double __hypotl(x,y)			 /* wrapper hypotl */
 	long double x,y;
diff --git a/sysdeps/m68k/Makefile b/sysdeps/m68k/Makefile
index 3d35ac56ba..ffdc68274e 100644
--- a/sysdeps/m68k/Makefile
+++ b/sysdeps/m68k/Makefile
@@ -36,3 +36,6 @@ asm-CPPFLAGS += $(m68k-syntax-flag)
 
 # Make sure setjmp.c is compiled with a frame pointer
 CFLAGS-setjmp.c := -fno-omit-frame-pointer
+
+# The 68k `long double' is a distinct type we support.
+long-double-fcts = yes
diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c
index 00baf6875a..7446f25786 100644
--- a/sysdeps/unix/getlogin.c
+++ b/sysdeps/unix/getlogin.c
@@ -36,7 +36,7 @@ DEFUN_VOID(getlogin)
   char *real_tty_path = tty_pathname;
   char *result = NULL;
   static struct utmp_data utmp_data;
-  struct utmp *ut;
+  struct utmp *ut, line;
 
   {
     int err = 0;
@@ -58,7 +58,8 @@ DEFUN_VOID(getlogin)
   real_tty_path += 5;		/* Remove "/dev/".  */
 
   setutent_r (&utmp_data);
-  if (getutline_r (real_tty_path, &ut, &utmp_data) < 0)
+  strncpy (line.ut_line, real_tty_path, sizeof line.ut_line);
+  if (getutline_r (&line, &ut, &utmp_data) < 0)
     {
       if (errno == ESRCH)
 	/* The caller expects ENOENT if nothing is found.  */
diff --git a/sysdeps/unix/getlogin_r.c b/sysdeps/unix/getlogin_r.c
index 15afdee63c..154a9d3a59 100644
--- a/sysdeps/unix/getlogin_r.c
+++ b/sysdeps/unix/getlogin_r.c
@@ -39,7 +39,7 @@ getlogin_r (name, name_len)
   char *real_tty_path = tty_pathname;
   int result = 0;
   struct utmp_data utmp_data;
-  struct utmp *ut;
+  struct utmp *ut, line;
 
   {
     int err;
@@ -61,7 +61,8 @@ getlogin_r (name, name_len)
   real_tty_path += 5;		/* Remove "/dev/".  */
 
   setutent_r (&utmp_data);
-  if (getutline_r (real_tty_path, &ut, &utmp_data) < 0)
+  strncpy (line.ut_line, real_tty_path, sizeof line.ut_line);
+  if (getutline_r (&line, &ut, &utmp_data) < 0)
     {
       if (errno == ESRCH)
 	/* The caller expects ENOENT if nothing is found.  */
diff --git a/sysdeps/unix/sysv/linux/schedbits.h b/sysdeps/unix/sysv/linux/schedbits.h
deleted file mode 100644
index 7b887aab25..0000000000
--- a/sysdeps/unix/sysv/linux/schedbits.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <linux/posix_sched.h>