summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-19 19:43:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-07-19 19:43:55 -0700
commitcf117291f8e2956c8156b170c1ed59e9520262c3 (patch)
treed5e5f5d615d80ac3e989cee74415cbdb80333816 /configure
parent48fb45fc49128d64fc7b78e7359fc5753976632f (diff)
downloadtxr-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-xconfigure45
1 files changed, 45 insertions, 0 deletions
diff --git a/configure b/configure
index e6d402ee..e9d2a192 100755
--- a/configure
+++ b/configure
@@ -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