Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
2aeaf0fb
Commit
2aeaf0fb
authored
Mar 02, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Try to fix use of <ustat.h> for Solaris and older GNU/Linux.
From-SVN: r184828
parent
b5ea8036
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
+53
-3
libgo/config.h.in
+1
-1
libgo/configure
+31
-1
libgo/configure.ac
+16
-1
libgo/mksysinfo.sh
+5
-0
No files found.
libgo/config.h.in
View file @
2aeaf0fb
...
...
@@ -196,7 +196,7 @@
/* Define to 1 if you have the `unshare' function. */
#undef HAVE_UNSHARE
/* Define to 1 if you have the <ustat.h> header file. */
/* Define to 1 if you have the <ustat.h> header file
and it works
. */
#undef HAVE_USTAT_H
/* Define to 1 if you have the <utime.h> header file. */
...
...
libgo/configure
View file @
2aeaf0fb
...
...
@@ -14508,7 +14508,7 @@ no)
;;
esac
for
ac_header
in
sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h u
stat.h u
time.h linux/reboot.h
for
ac_header
in
sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/reboot.h
do
:
as_ac_Header
=
`
$as_echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
ac_fn_c_check_header_mongrel
"
$LINENO
"
"
$ac_header
"
"
$as_ac_Header
"
"
$ac_includes_default
"
...
...
@@ -14542,6 +14542,36 @@ fi
done
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether <ustat.h> can be used"
>
&5
$as_echo_n
"checking whether <ustat.h> can be used... "
>
&6
;
}
if
test
"
${
libgo_cv_c_ustat_h
+set
}
"
=
set
;
then
:
$as_echo_n
"(cached) "
>
&6
else
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#ifdef HAVE_LINUX_FILTER_H
#include <linux/filter.h>
#endif
#include <ustat.h>
_ACEOF
if
ac_fn_c_try_compile
"
$LINENO
"
;
then
:
libgo_cv_c_ustat_h
=
yes
else
libgo_cv_c_ustat_h
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$libgo_cv_c_ustat_h
"
>
&5
$as_echo
"
$libgo_cv_c_ustat_h
"
>
&6
;
}
if
test
$libgo_cv_c_ustat_h
=
yes
;
then
$as_echo
"#define HAVE_USTAT_H 1"
>>
confdefs.h
fi
if
test
"
$ac_cv_header_sys_mman_h
"
=
yes
;
then
HAVE_SYS_MMAN_H_TRUE
=
HAVE_SYS_MMAN_H_FALSE
=
'#'
...
...
libgo/configure.ac
View file @
2aeaf0fb
...
...
@@ -453,7 +453,7 @@ no)
;;
esac
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h u
stat.h u
time.h linux/reboot.h)
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/reboot.h)
AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
...
...
@@ -461,6 +461,21 @@ AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],
#endif
])
AC_CACHE_CHECK([whether <ustat.h> can be used],
[libgo_cv_c_ustat_h],
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
#include <sys/types.h>
#ifdef HAVE_LINUX_FILTER_H
#include <linux/filter.h>
#endif
#include <ustat.h>
])], [libgo_cv_c_ustat_h=yes], [libgo_cv_c_ustat_h=no]))
if test $libgo_cv_c_ustat_h = yes; then
AC_DEFINE(HAVE_USTAT_H, 1,
[Define to 1 if you have the <ustat.h> header file and it works.])
fi
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv)
...
...
libgo/mksysinfo.sh
View file @
2aeaf0fb
...
...
@@ -895,6 +895,11 @@ grep '^type _ustat ' gen-sysinfo.go | \
-e
's/f_fname/Fname/'
\
-e
's/f_fpack/Fpack/'
\
>>
${
OUT
}
# Force it to be defined, as on some older GNU/Linux systems the
# header file fails when using with <linux/filter.h>.
if
!
grep
'type _ustat '
gen-sysinfo.go
>
/dev/null 2>&1
;
then
echo
'type Ustat_t struct { Tfree int32; Tinoe uint64; Fname [5+1]int8; Fpack [5+1]int8; }'
>>
${
OUT
}
fi
# The utimbuf struct.
grep
'^type _utimbuf '
gen-sysinfo.go |
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment