diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-07-19 19:43:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-07-19 19:43:55 -0700 |
commit | cf117291f8e2956c8156b170c1ed59e9520262c3 (patch) | |
tree | d5e5f5d615d80ac3e989cee74415cbdb80333816 /configure | |
parent | 48fb45fc49128d64fc7b78e7359fc5753976632f (diff) | |
download | txr-cf117291f8e2956c8156b170c1ed59e9520262c3.tar.gz txr-cf117291f8e2956c8156b170c1ed59e9520262c3.tar.bz2 txr-cf117291f8e2956c8156b170c1ed59e9520262c3.zip |
Adding uname.
* configure: Detect utsname and uname.
* sysif.c (utsname_s, sysname_s, nodename_s, release_s,
version_s, machine_s): New symbol variables.
(uname_wrap): New static function.
(sysif_init): Initialize new symbol variables.
Instantiate utsname struct type. Register uname_wrap
as uname intrinsic function.
* txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -2632,6 +2632,51 @@ else printf "no\n" fi +printf "Checking for uname ... " + +cat > conftest.c <<! +#include <sys/utsname.h> +#include <stdio.h> + +int main(void) +{ + struct utsname utn; + if (uname(&utn) == 0) + printf("%s:%s:%s:%s:%s\n", utn.sysname, + utn.nodename, utn.release, utn.version, + utn.machine); + return 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_UNAME 1\n" >> $config_h +else + printf "no\n" +fi + +printf "Checking for domainname in struct utsname ... " + +cat > conftest.c <<! +#include <sys/utsname.h> +#include <stdio.h> + +int main(void) +{ + struct utsname utn; + if (uname(&utn) == 0) + printf("%s\n", utn.domainname); + return 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_UTSNAME_DOMAINNAME 1\n" >> $config_h +else + printf "no\n" +fi # # Dependent variables |