1 sinclude(./aclocal.m4)dnl Autoconf lossage.
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
3 # Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public License
8 # as published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Library General Public License for more details.
16 # You should have received a copy of the GNU Library General Public
17 # License along with the GNU C Library; see the file COPYING.LIB. If
18 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 # Cambridge, MA 02139, USA.
21 dnl configure fragment for Unix-based systems. This is processed by Autoconf,
22 dnl but we just use the AC_MSG_* macros. This file is sourced by the
23 dnl top-level configure script. Note that we use the prefix `unix_' on all
24 dnl shell variables here, to avoid conflicting with any variables the
25 dnl top-level script might be using.
27 sysincludedir=/usr/include # XXX
29 # Find the <syscall.h> file we will be using, or something like it.
31 for unix_dir in $sysnames; do
32 if test -r $sysdep_dir/$unix_dir/syscall.h; then
37 if test $unix_found = stub; then
38 # XXX This list of possibilities duplicates the list in Makefile.
39 for try in sys.s sys/sys.s sys.S sys/sys.S syscall.h sys/syscall.h; do
40 if test -r $sysincludedir/$try; then
41 unix_syscall_h=$sysincludedir/$try
46 unix_syscall_h=$sysdep_dir/$unix_dir/syscall.h
49 test -n "$unix_syscall_h" && {
51 # Where to put the .S files we write.
52 if test "`pwd`" = "`(cd $srcdir; pwd)`"; then
53 unix_generated_dirpfx=sysdeps/unix/
55 # We are running in a separate build directory.
56 unix_generated_dirpfx=
59 # This variable will collect the names of the files we create.
64 # These several functions are system calls on Unix systems which have them.
65 # The details of these calls are universal enough that if a system's
66 # <syscall.h> defines the system call number, we know that the simple
67 # system call implementations in unix/common will be sufficient.
69 for unix_function in \
70 dup2 lstat mkdir rmdir readlink symlink rename swapon \
71 access select getgroups setgroups \
73 getdomainname:getdomain=bsd/bsd4.4 \
74 setdomainname:setdomain=bsd/bsd4.4 \
76 profil=bsd readv=bsd writev=bsd \
77 getpriority setpriority \
81 # $unix_function => $unix_syscall $unix_srcname
86 eval "unix_syscall=`echo $unix_function | \
87 sed -e 's@=\(.*\)$@ unix_srcdir=\1@' \
88 -e 's@:\(.*\)@ unix_srcname=\1@'`"
89 test -z "$unix_srcname" && unix_srcname=$unix_syscall
92 for unix_dir in $sysnames; do
93 if test -r $sysdep_dir/$unix_dir/${unix_srcname}.c ||
94 test -r $sysdep_dir/$unix_dir/${unix_srcname}.S ||
95 test -r $sysdep_dir/$unix_dir/${unix_srcname}.s; then
96 unix_implementor=$unix_dir
101 case $unix_syscall in
103 # mkdir and rmdir have implementations in unix/sysv, but
104 # the simple syscall versions are preferable if available.
105 test $unix_implementor = unix/sysv && unix_implementor=generic
109 case $unix_implementor in
110 none|stub|generic|posix)
111 # The chosen implementation of ${unix_syscall} is a boring one.
112 # We want to use the unix/common implementation instead iff
113 # ${unix_syscall} appears in <syscall.h>.
114 AC_MSG_CHECKING(for ${unix_syscall} system call)
115 changequote(,)dnl We need to use [ and ] for real now.
116 if grep -i "[ _]${unix_syscall}[ ]" $unix_syscall_h >/dev/null
117 changequote([,])dnl Back to Autoconf land.
119 # It does seem to be present in <syscall.h>.
121 unix_dests="$unix_dests ${unix_generated_dirpfx}${unix_srcname}.S"
122 unix_srcs="$unix_srcs sysdeps/unix/${unix_srcdir}/${unix_srcname}.S"
123 unix_generated="$unix_generated $unix_generated_dirpfx${unix_srcname}.S"
133 # Autoconf magic in the top-level configure.in causes config.status to
134 # actually make the links.
135 libc_link_dests="$libc_link_dests $unix_dests"
136 libc_link_sources="$libc_link_sources $unix_srcs"
138 # Store the list of files we created in config.make; Makefile uses it.
139 test -n "$unix_generated" && config_vars="$config_vars
140 unix-generated := \$(addprefix \$(objpfx),${unix_generated})"