This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

glibc 2.2.3 + autoconf 2.52


	I don't see any discussion of this in the libc-alpha or
libc-hacker archives, so I'll just mention this in case the
information might be helpful.  Also, I'm a little unclear
if this belong in libc-alpha, libc-hackers or bug-glibc.  I'll
start here, and, if anyone wants to direct me to a different
forum, please feel free to do so.

	I've started trying to get glibc-2.2.3 to build with autoconf-2.52
(after autoconf has regenerated ./configure, et al).  I have attached
a patch with how far I have gotten so far, in case someone might fine
it useful to look at.  It should not be applied for reasons I will
discuss below.

	First, the stuff that might be correct are the patches to
the top level configure.in and aclocal.m4 files.  There are a few
places where autoconf-2.52 seems to need a few more things to be
quoted, and that is what these changes do.

	The part that I am sure is wrong are the changes to the
other configure.in files in sysdeps/.  The primary problem with the
original files  was that the top level configure script wants to
source a bunch of configure script "fragments" in sysdeps/, and,
later, during "make all", these script "fragments" are also
run as independent shell scripts.  Autoconf-2.52 does not like this,
because it needs some initialization that is done in AC_INIT to be
done in each of the configure.in files in sysdeps/ in order to get the
definitions of some macros to do the configure.in --> configure
creation.  Unfortunately, other parts of AC_INIT do things like
clearing variables and erasing files, so just putting
AC_INIT(configure.in) in the top of each configure.in in sysdeps/.  So,
when the top level configure script sources these subordinate scripts as
"fragments" the would clear the results of a bunch of tests if they
were changed to begin with AC_INIT.

	My changes to the configure.in files in sysdeps/ is to have them
call just the parts of AC_INIT that they seem to need.  Unfortunately,
they seem to need AC_LANG_PUSH(C), and, for some reason that I do
not understand, adding a matching AC_LANG_POP(C) at the bottom of
these scripts causes autoconf to complain.  I am looking into this.

	I think that, ultimately, the correction solution is probably
for these configure.in scripts to become separate standalone scripts,
which the top level configure script could call relatively early in the
configure process (invoking each a separate program with something like
AC_OUTPUT_SUBDIRS).  Then, the top level configure script could fish
out the results that it needs from files generated by these subordinate
configure scripts.

	Anyhow, I have attached a diff of what I have so far.  If
anyone else is working on this, I'd be interested in knowing to avoid
duplication of effort.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."
./aclocal.m4
--- glibc-2.2.3/./aclocal.m4	Tue Jun  1 10:41:16 1999
+++ glibc/./aclocal.m4	Sun Jul 29 06:02:43 2001
@@ -3,8 +3,8 @@
 dnl Each sysdep configure.in does GLIBC_PROVIDES first, to avoid any
 dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
 dnl
-define(AC_FD_MSG,6)dnl Autoconf lossage.
-define(AC_FD_CC,5)dnl Autoconf lossage.
+define([AC_FD_MSG],6)dnl Autoconf lossage.
+define([AC_FD_CC],5)dnl Autoconf lossage.
 AC_DEFUN([GLIBC_PROVIDES], [dnl
 AC_PROVIDE([AC_PROG_INSTALL])dnl
 AC_PROVIDE([AC_PROG_RANLIB])dnl
@@ -16,7 +16,7 @@
 dnl
 dnl Check for a symbol
 dnl
-AC_DEFUN(AC_CHECK_SYMBOL, [dnl
+AC_DEFUN([AC_CHECK_SYMBOL], [dnl
 AC_MSG_CHECKING(for $1)
 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
 AC_TRY_LINK(,
@@ -36,7 +36,7 @@
 dnl Locate a program and check that its version is acceptable.
 dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
 dnl 		      [version-extract-regexp], version-glob [, do-if-fail])
-AC_DEFUN(AC_CHECK_PROG_VER,
+AC_DEFUN([AC_CHECK_PROG_VER],
 [AC_CHECK_PROGS([$1], [$2])
 if test -z "[$]$1"; then
   ac_verc_fail=yes
@@ -66,22 +66,26 @@
 dnl In the situation that cross-linking is impossible, the variable
 dnl `cross_linkable' will be substituted with "yes".
 dnl The vercheck macros are expected to have been called already.
-AC_DEFUN(AC_PROG_CC_LOCAL,
+AC_DEFUN([AC_PROG_CC_LOCAL],
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
 
 AC_PROG_CC_WORKS_LOCAL
-AC_PROG_CC_GNU
+AC_PROG_CC
 if test $ac_cv_prog_gcc != yes; then
   AC_MSG_ERROR([GNU libc must be compiled using GNU CC])
 fi
 ])
 
-AC_DEFUN(AC_PROG_CC_WORKS_LOCAL,
+AC_DEFUN([AC_PROG_CC_WORKS_LOCAL],
 [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
 AC_CACHE_VAL(ac_cv_prog_cc_works,
 [AC_LANG_SAVE
 AC_LANG_C
-AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
+AC_TRY_RUN([main(){return(0);}],
+           [ac_cv_prog_cc_works=yes],
+           [ac_cv_prog_cc_works=no],
+	   [ac_cv_prog_cc_works=no;
+	    ac_cv_prog_cc_cross=yes])
 AC_LANG_RESTORE])
 AC_MSG_RESULT($ac_cv_prog_cc_works)
 if test $ac_cv_prog_cc_works = no; then
@@ -98,7 +102,7 @@
 cross_compiling=$ac_cv_prog_cc_cross
 ])
 
-AC_DEFUN(LIBC_PROG_FOO_GNU,
+AC_DEFUN([LIBC_PROG_FOO_GNU],
 [# Most GNU programs take a -v and spit out some text including
 # the word 'GNU'.  Some try to read stdin, so give them /dev/null.
 if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
@@ -108,7 +112,7 @@
 fi
 rm -fr contest*])
 
-AC_DEFUN(LIBC_PROG_BINUTILS,
+AC_DEFUN([LIBC_PROG_BINUTILS],
 [# Was a --with-binutils option given?
 if test -n "$path_binutils"; then
     # Make absolute; ensure a single trailing slash.
./configure.in
--- glibc-2.2.3/./configure.in	Wed Apr 25 14:50:58 2001
+++ glibc/./configure.in	Sun Jul 29 06:02:43 2001
@@ -554,8 +554,13 @@
   AC_MSG_ERROR(*** A pwd binary could not be found.)
 fi
 
+AC_DEFUN(REQUIRE_AC_CHECK_TOOL_PREFIX, [
+	AC_REQUIRE([AC_CHECK_TOOL_PREFIX])])
+AC_DEFUN(REQUIRE_LIBC_KERNEL_ID, [
+	AC_REQUIRE([LIBC_KERNEL_ID])])
+
 # These programs are version sensitive.
-AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+REQUIRE_AC_CHECK_TOOL_PREFIX
 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
   [version \([egcygnustpi-]*[0-9.]*\)],
   [*gcc-2.9[5-9].*|*2.8.[1-9]*|*2.9|*2.9.[0-9]*|2.9[5-9]*|3.[0-9]*|cygnus-2.9[1-9]*|gcc-2.9[5-9]|gcc-2.1[0-9][0-9]|sgicc-*],
@@ -583,7 +588,11 @@
   [3.0[2-9]*|3.[1-9]*|[4-9]*], SED=: aux_missing=t)
 
 AC_PROG_CC_LOCAL
-AC_CANONICAL_BUILD
+
+AC_DEFUN(REQUIRE_AC_CANONICAL_BUILD, [
+	AC_REQUIRE([AC_CANONICAL_BUILD])])
+REQUIRE_AC_CANONICAL_BUILD
+
 if test $host != $build; then
   AC_CHECK_PROGS(BUILD_CC, gcc cc)
 fi
@@ -608,6 +617,13 @@
 CCVERSION=`$CC -v 2>&1 | sed -n 's/gcc version //p'`
 AC_SUBST(CCVERSION)
 
+AC_CHECK_LIB(loginstall, log_event_with_source,
+             AC_DEFINE(HAVE_LIBLOGINSTALL)
+             LIBLOGINSTALL="-lloginstall",
+             LIBLOGINSTALL=""
+            )
+AC_SUBST(LIBLOGINSTALL)
+
 # if using special system headers, find out the compiler's sekrit
 # header directory and add that to the list.  NOTE: Only does the right
 # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
@@ -717,6 +733,8 @@
   else libc_cv_old_debian_install_info=no testfailed=t
   fi
   rm -fr conftest.d])
+AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
+
 if test -n "$testfailed"
 then AC_MSG_WARN([install-info errored out, check config.log])
 fi
@@ -724,8 +742,6 @@
 fi
 AC_SUBST(OLD_DEBIAN_INSTALL_INFO)
 
-AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
-
 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
 echo '#include <stddef.h>
 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
@@ -977,13 +993,6 @@
 int _start (void) { return 42; }
 EOF
   if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,nodlopen 1>&AC_FD_CC])
-  then
-    libc_cv_z_nodlopen=yes
-  else
-    libc_cv_z_nodlopen=no
-  fi
-  rm -f conftest*])
-  AC_SUBST(libc_cv_z_nodlopen)
 
   AC_CACHE_CHECK(for -z initfirst option,
 		 libc_cv_z_initfirst, [dnl
@@ -1012,6 +1021,13 @@
   fi
   rm -f conftest*])
   AC_SUBST(libc_cv_Bgroup)
+  then
+    libc_cv_z_nodlopen=yes
+  else
+    libc_cv_z_nodlopen=no
+  fi
+  rm -f conftest*])
+  AC_SUBST(libc_cv_z_nodlopen)
 fi
 
 if test $elf != yes; then
@@ -1298,6 +1314,54 @@
   ;;
 esac
 
+
+dnl Check whether Linux <asm-i386/sigcontext.h> contains
+dnl old (pre 2.4) or new (since 2.4) _fpstate structure.
+dnl
+if test "x$base_machine" = "xi386"
+ then
+  case "x$host_os"
+   in
+    xlinux|xlinux-gnu|xlinux*|x*-linux|x*-linux-gnu|x*-linux*)
+      AC_CACHE_CHECK([for old-style struct _fpstate],
+         ac_cv_struct_fpstate_old,
+         [AC_TRY_COMPILE([#include <asm/sigcontext.h>],
+             [struct _fpstate s; s.cw;],
+             ac_cv_struct_fpstate_old=yes,
+             ac_cv_struct_fpstate_old=no)
+         ])
+      #
+      if test "x$ac_cv_struct_fpstate_old" = "xyes"
+       then
+        ac_cv_struct_fpstate_new=no,
+       else
+        ac_cv_struct_fpstate_old=no,
+        AC_CACHE_CHECK([for new-style struct _fpstate],
+           ac_cv_struct_fpstate_new,
+           [AC_TRY_COMPILE([#include <asm/sigcontext.h>],
+               [struct _fpstate s; s.fpregs.fsave.cw;],
+               ac_cv_struct_fpstate_new=yes,
+               ac_cv_struct_fpstate_new=no)
+           ])
+        #
+      fi
+      #
+      if test "x$ac_cv_struct_fpstate_old" = "xyes"
+       then
+        AC_DEFINE(HAVE_OLD_STYLE_FPSTATE)
+       else
+        if test "x$ac_cv_struct_fpstate_new" = "xyes"
+         then
+          AC_DEFINE(HAVE_NEW_STYLE_FPSTATE)
+         else
+          AC_MSG_WARN(Unidentified "struct _fpstate" style)
+        fi
+      fi
+      ;;
+  esac
+fi
+
+
 dnl Check whether compiler understands __builtin_expect.
 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
 [cat > conftest.c <<EOF
@@ -1432,7 +1496,7 @@
 ])dnl
 
   AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl
-AC_REQUIRE([LIBC_KERNEL_ID])dnl
+REQUIRE_LIBC_KERNEL_ID()dnl
 changequote(,)dnl
   kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
 changequote([,])dnl
@@ -1450,7 +1514,7 @@
   uname_release="$libc_cv_uname_release"
 
   AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl
-AC_REQUIRE([LIBC_KERNEL_ID])dnl
+REQUIRE_LIBC_KERNEL_ID
 changequote(,)dnl
   kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
 changequote([,])dnl
./sysdeps/generic/configure.in
--- glibc-2.2.3/./sysdeps/generic/configure.in	Thu Dec  8 01:00:46 1994
+++ glibc/./sysdeps/generic/configure.in	Sun Jul 29 06:02:44 2001
@@ -1,3 +1,7 @@
+AC_PLAIN_SCRIPT
+_AC_INIT_CONFIG_LOG
+AC_LANG_PUSH(C)
+
 sinclude(./aclocal.m4)dnl
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
./sysdeps/mach/hurd/configure.in
./sysdeps/unix/sysv/aix/configure.in
./sysdeps/unix/sysv/linux/alpha/configure.in
./sysdeps/unix/sysv/linux/configure.in
--- glibc-2.2.3/./sysdeps/unix/sysv/linux/configure.in	Mon Mar 26 20:53:35 2001
+++ glibc/./sysdeps/unix/sysv/linux/configure.in	Sun Jul 29 06:02:44 2001
@@ -1,3 +1,7 @@
+AC_PLAIN_SCRIPT
+_AC_INIT_CONFIG_LOG
+AC_LANG_PUSH(C)
+
 sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux.
./sysdeps/unix/sysv/sysv4/solaris2/configure.in
./sysdeps/unix/common/configure.in
--- glibc-2.2.3/./sysdeps/unix/common/configure.in	Thu Dec  8 01:02:26 1994
+++ glibc/./sysdeps/unix/common/configure.in	Sun Jul 29 06:02:44 2001
@@ -1,3 +1,7 @@
+AC_PLAIN_SCRIPT
+_AC_INIT_CONFIG_LOG
+AC_LANG_PUSH(C)
+
 sinclude(./aclocal.m4)dnl
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
./sysdeps/unix/configure.in
--- glibc-2.2.3/./sysdeps/unix/configure.in	Wed Feb  7 13:24:17 1996
+++ glibc/./sysdeps/unix/configure.in	Sun Jul 29 06:02:44 2001
@@ -1,3 +1,7 @@
+AC_PLAIN_SCRIPT
+_AC_INIT_CONFIG_LOG
+AC_LANG_PUSH(C)
+
 sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]