summaryrefslogtreecommitdiff
path: root/mcon/U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U')
-rw-r--r--mcon/U/Options.U15
-rw-r--r--mcon/U/d_bfd_lib.U5
-rw-r--r--mcon/U/d_bsearch.U39
-rw-r--r--mcon/U/d_cbrt.U4
-rw-r--r--mcon/U/d_clearenv.U38
-rw-r--r--mcon/U/d_dirent_d_namlen.U42
-rw-r--r--mcon/U/d_dirent_d_type.U11
-rw-r--r--mcon/U/d_dirfd.U42
-rw-r--r--mcon/U/d_fchdir.U40
-rw-r--r--mcon/U/d_fdopendir.U42
-rw-r--r--mcon/U/d_fstatat.U43
-rw-r--r--mcon/U/d_getprogname.U40
-rw-r--r--mcon/U/d_getpwnam.U38
-rw-r--r--mcon/U/d_getpwuid.U38
-rw-r--r--mcon/U/d_openat.U38
-rw-r--r--mcon/U/d_pipe.U4
-rw-r--r--mcon/U/d_pipe2.U46
-rw-r--r--mcon/U/d_proginvocname.U40
-rw-r--r--mcon/U/d_setenv.U38
-rw-r--r--mcon/U/d_setprogname.U40
-rw-r--r--mcon/U/d_unsetenv.U38
21 files changed, 669 insertions, 12 deletions
diff --git a/mcon/U/Options.U b/mcon/U/Options.U
index c9b5632..6dbf001 100644
--- a/mcon/U/Options.U
+++ b/mcon/U/Options.U
@@ -1,4 +1,4 @@
-?RCS: $Id: Options.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: $Id: Options.U 191 2015-04-19 10:04:17Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
@@ -354,8 +354,19 @@ case "$silent" in
true) exec 1>/dev/null;;
esac
-: run the defines and the undefines, if any, but leave the file out there...
+?X: Patch from H.Merijn Brand -- 2015-04-19
+?X: The reasoning behind this change is that optdef.sh gets sourced and the
+?X: arguments, like prefix, are passed around in different quotation styles
+?X: and subshells all around, and the (unescaped) backslash will not be
+?X: pertained in the final config.sh
+?X: Note that -q is POSIX but to be sure, we also silence all output --RAM
touch optdef.sh
+if grep -q '\\' optdef.sh >/dev/null 2>&1; then
+ echo "Configure does not support \\ in -D or -U arguments" >&2
+ exit 1
+fi
+
+: run the defines and the undefines, if any, but leave the file out there...
. ./optdef.sh
: create the posthint manipulation script and leave the file out there...
?X: this file will be perused by Oldconfig.U
diff --git a/mcon/U/d_bfd_lib.U b/mcon/U/d_bfd_lib.U
index cf21c45..a58d1c1 100644
--- a/mcon/U/d_bfd_lib.U
+++ b/mcon/U/d_bfd_lib.U
@@ -42,7 +42,10 @@ int main(void)
}
EOC
cyn="whether the BFD library is available"
+?X: Modern BFD library versions no longer require -lintl and -liberty but do
+?X: require -ldl, on Linux at least. -- RAM, 2014-07-22
set d_bfd_lib '-lbfd -lintl -liberty' '-lbfd -liberty' '-lbfd -liberty -lz' \
- '-lbfd -lintl -liberty -lz' '-lbfd -lz' '-lbfd -lintl -lz'
+ '-lbfd -lintl -liberty -lz' '-lbfd -lz' '-lbfd -lintl -lz' \
+ '-lbfd -lz -ldl'
eval $trylink
diff --git a/mcon/U/d_bsearch.U b/mcon/U/d_bsearch.U
new file mode 100644
index 0000000..17ac23a
--- /dev/null
+++ b/mcon/U/d_bsearch.U
@@ -0,0 +1,39 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_bsearch: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_bsearch:
+?S: This variable conditionally defines the HAS_BSEARCH symbol, which
+?S: indicates to the C program that it can use the bsearch() routine
+?S: to perform a binary search on a sorted array.
+?S:.
+?C:HAS_BSEARCH:
+?C: This symbol, if defined, indicates that the bsearch() routine
+?C: is available to perform a binary search on a sorted array.
+?C:.
+?H:#$d_bsearch HAS_BSEARCH /**/
+?H:.
+?LINT:set d_bsearch
+: see if there is a bsearch
+$cat >try.c <<EOC
+#include <stdlib.h>
+int mycmp(const void *a, const void *b)
+{
+ return (char *) a - (char *) b;
+}
+int main(int argc, char **argv)
+{
+ return NULL == bsearch("foo", argv, argc, sizeof argv[0], mycmp);
+}
+EOC
+cyn=bsearch
+set d_bsearch
+eval $trylink
+
diff --git a/mcon/U/d_cbrt.U b/mcon/U/d_cbrt.U
index 66014e2..c04a7c8 100644
--- a/mcon/U/d_cbrt.U
+++ b/mcon/U/d_cbrt.U
@@ -1,4 +1,4 @@
-?RCS: $Id: d_cbrt.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: $Id: d_cbrt.U 182 2014-11-23 16:40:05Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
@@ -15,7 +15,7 @@
?MAKE:d_cbrt: Trylink cat
?MAKE: -pick add $@ %<
?S:d_cbrt:
-?S: This variable conditionally defines the CBRT symbol, which
+?S: This variable conditionally defines the HAS_CBRT symbol, which
?S: indicates to the C program that the cbrt() (cube root) function
?S: is available.
?S:.
diff --git a/mcon/U/d_clearenv.U b/mcon/U/d_clearenv.U
new file mode 100644
index 0000000..d8e892f
--- /dev/null
+++ b/mcon/U/d_clearenv.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_clearenv: Trylink cat i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_clearenv:
+?S: This variable conditionally defines the HAS_CLEARENV
+?S: symbol, which indicates to the C program that clearenv()
+?S: is available to clear the environment.
+?S:.
+?C:HAS_CLEARENV:
+?C: This symbol is defined when clearenv() is there to clear the
+?C: environment.
+?C:.
+?H:#$d_clearenv HAS_CLEARENV
+?H:.
+?LINT: set d_clearenv
+: do we have clearenv?
+$cat >try.c <<EOC
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(void)
+{
+ return clearenv();
+}
+EOC
+cyn=clearenv
+set d_clearenv
+eval $trylink
+
diff --git a/mcon/U/d_dirent_d_namlen.U b/mcon/U/d_dirent_d_namlen.U
new file mode 100644
index 0000000..00fdfb2
--- /dev/null
+++ b/mcon/U/d_dirent_d_namlen.U
@@ -0,0 +1,42 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_dirent_d_namlen: Trylink cat i_dirent
+?MAKE: -pick add $@ %<
+?S:d_dirent_d_namlen:
+?S: This variable conditionally defines the HAS_DIRENT_D_NAMLEN symbol,
+?S: which indicates to the C program that struct dirent has an
+?S: integer member d_namlen. Better check for HAS_DIRENT_D_NAMLEN than
+?S: DIRNAMLEN since the latter has a weaker test not involving compilation.
+?S:.
+?C:HAS_DIRENT_D_NAMLEN:
+?C: This symbol, if defined, indicates that struct dirent has an
+?C: integer member d_namlen to hold the actual string length of d_name.
+?C:.
+?H:#$d_dirent_d_namlen HAS_DIRENT_D_NAMLEN /**/
+?H:.
+?LINT:set d_dirent_d_namlen
+: check whether struct dirent has a member d_namlen.
+$cat >try.c <<EOC
+#include <sys/types.h>
+#$i_dirent I_DIRENT
+#ifdef I_DIRENT
+#include <dirent.h>
+#endif
+int main(void)
+{
+ static struct dirent dir_entry;
+ dir_entry.d_namlen |= 1;
+ return 0;
+}
+EOC
+cyn="whether struct dirent has a d_namlen member"
+set d_dirent_d_namlen
+eval $trylink
+
diff --git a/mcon/U/d_dirent_d_type.U b/mcon/U/d_dirent_d_type.U
index 6334118..3ee08cc 100644
--- a/mcon/U/d_dirent_d_type.U
+++ b/mcon/U/d_dirent_d_type.U
@@ -1,4 +1,4 @@
-?RCS: $Id: d_dirent_d_type.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: $Id: d_dirent_d_type.U 185 2015-04-17 07:20:44Z rmanfredi $
?RCS:
?RCS: Copyright (c) 2006, Christian Biere
?RCS:
@@ -13,11 +13,13 @@
?S:d_dirent_d_type:
?S: This variable conditionally defines the HAS_DIRENT_D_TYPE symbol,
?S: which indicates to the C program that struct dirent has an
-?S: integer member d_type.
+?S: integer member d_type.
?S:.
?C:HAS_DIRENT_D_TYPE:
?C: This symbol, if defined, indicates that struct dirent has an
-?C: integer member d_type.
+?C: integer member d_type. Note that DT_WHT is BSD-specific and may
+?C: not be available. If DT_UNKNOWN is returned, the filesystem does
+?C: not fill d_type even though it is present in the dir entry.
?C:.
?H:#$d_dirent_d_type HAS_DIRENT_D_TYPE /**/
?H:.
@@ -40,8 +42,7 @@ int main(void)
| DT_BLK
| DT_REG
| DT_LNK
- | DT_SOCK
- | DT_WHT;
+ | DT_SOCK;
return 0;
}
EOC
diff --git a/mcon/U/d_dirfd.U b/mcon/U/d_dirfd.U
new file mode 100644
index 0000000..269b2d4
--- /dev/null
+++ b/mcon/U/d_dirfd.U
@@ -0,0 +1,42 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_dirfd: Trylink cat i_dirent
+?MAKE: -pick add $@ %<
+?S:d_dirfd:
+?S: This variable conditionally defines HAS_DIRFD when dirfd() is
+?S: available to get the underlying file descriptor from opendir().
+?S:.
+?C:HAS_DIRFD:
+?C: This symbol, if defined, indicates that the dirfd() routine is
+?C: available to get the underlying file descriptor from a DIR *
+?C: opened by opendir().
+?C:.
+?H:#$d_dirfd HAS_DIRFD /**/
+?H:.
+?LINT:set d_dirfd
+: see if dirfd exists
+$cat >try.c <<EOC
+#include <sys/types.h>
+#$i_dirent I_DIRENT
+#ifdef I_DIRENT
+#include <dirent.h>
+#endif
+int main(void)
+{
+ static DIR *dir;
+ static int ret;
+ ret = dirfd(dir);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=dirfd
+set d_dirfd
+eval $trylink
+
diff --git a/mcon/U/d_fchdir.U b/mcon/U/d_fchdir.U
new file mode 100644
index 0000000..2ed47e2
--- /dev/null
+++ b/mcon/U/d_fchdir.U
@@ -0,0 +1,40 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_fchdir: Trylink cat i_unistd
+?MAKE: -pick add $@ %<
+?S:d_fchdir:
+?S: This variable conditionally defines HAS_FCHDIR if fchdir() is
+?S: available to change the directory to that of an opened directory.
+?S:.
+?C:HAS_FCHDIR:
+?C: This symbol, if defined, indicates that the fchdir routine is
+?C: available to change the working directory to that of the opened
+?C: directory whose file descriptor is given.
+?C:.
+?H:#$d_fchdir HAS_FCHDIR /**/
+?H:.
+?LINT:set d_fchdir
+: see if fchdir exists
+$cat >try.c <<EOC
+#$i_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+int main(void)
+{
+ static int fd, ret;
+ ret |= fchdir(fd);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=fchdir
+set d_fchdir
+eval $trylink
+
diff --git a/mcon/U/d_fdopendir.U b/mcon/U/d_fdopendir.U
new file mode 100644
index 0000000..02a0ddc
--- /dev/null
+++ b/mcon/U/d_fdopendir.U
@@ -0,0 +1,42 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_fdopendir: Trylink cat i_dirent
+?MAKE: -pick add $@ %<
+?S:d_fdopendir:
+?S: This variable conditionally defines HAS_FDOPENDIR if fdopendir() is
+?S: available to open a directory using an opened file descriptor already
+?S: referring to that directory.
+?S:.
+?C:HAS_FDOPENDIR:
+?C: This symbol, if defined, indicates that the fdopendir() routine is
+?C: available to open directories using an opened file descriptor already
+?C: referring to that directory.
+?C:.
+?H:#$d_fdopendir HAS_FDOPENDIR /**/
+?H:.
+?LINT:set d_fdopendir
+: see if fdopendir exists
+$cat >try.c <<EOC
+#$i_dirent I_DIRENT
+#include <sys/types.h>
+#ifdef I_DIRENT
+#include <dirent.h>
+#endif
+int main(void)
+{
+ static DIR *d;
+ d = fdopendir(0);
+ return (DIR *) 0 == d;
+}
+EOC
+cyn=fdopendir
+set d_fdopendir
+eval $trylink
+
diff --git a/mcon/U/d_fstatat.U b/mcon/U/d_fstatat.U
new file mode 100644
index 0000000..55412f7
--- /dev/null
+++ b/mcon/U/d_fstatat.U
@@ -0,0 +1,43 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_fstatat: Trylink cat i_sysstat
+?MAKE: -pick add $@ %<
+?S:d_fstatat:
+?S: This variable conditionally defines HAS_FSTATAT if fstatat() is
+?S: available to do file stats with a relative path interepreted in
+?S: the context of an opened directory.
+?S:.
+?C:HAS_FSTATAT:
+?C: This symbol, if defined, indicates that the fstatat() routine is
+?C: available to do file stats with a relative path interepreted in
+?C: the context of an opened directory.
+?C:.
+?H:#$d_fstatat HAS_FSTATAT /**/
+?H:.
+?LINT:set d_fstatat
+: see if fstatat exists
+$cat >try.c <<EOC
+#$i_sysstat I_SYS_STAT
+#include <fcntl.h> /* AT_* constants */
+#ifdef I_SYS_STAT
+#include <sys/stat.h>
+#endif
+int main(void)
+{
+ static int ret;
+ struct stat sb;
+ ret |= fstatat(AT_FDCWD, "path", &sb, 0);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=fstatat
+set d_fstatat
+eval $trylink
+
diff --git a/mcon/U/d_getprogname.U b/mcon/U/d_getprogname.U
new file mode 100644
index 0000000..a5a6175
--- /dev/null
+++ b/mcon/U/d_getprogname.U
@@ -0,0 +1,40 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_getprogname: Trylink cat i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_getprogname:
+?S: This variable conditionally defines the HAS_GETPROGNAME
+?S: symbol, which indicates to the C program that getprogname()
+?S: is available to get the program name.
+?S:.
+?C:HAS_GETPROGNAME:
+?C: This symbol is defined when getprogname() is there to get the
+?C: program name.
+?C:.
+?H:#$d_getprogname HAS_GETPROGNAME
+?H:.
+?LINT: set d_getprogname
+: can we use getprogname?
+$cat >try.c <<EOC
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(void)
+{
+ printf("%s\n", getprogname());
+ return 0;
+}
+EOC
+cyn=getprogname
+set d_getprogname
+eval $trylink
+
diff --git a/mcon/U/d_getpwnam.U b/mcon/U/d_getpwnam.U
new file mode 100644
index 0000000..74d117a
--- /dev/null
+++ b/mcon/U/d_getpwnam.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_getpwnam: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_getpwnam:
+?S: This variable conditionally defines the HAS_GETPWNAM symbol, which
+?S: indicates to the C program that it can use the getpwnam() routine
+?S: to get the /etc/passwd structure entries for given user name.
+?S:.
+?C:HAS_GETPWNAM:
+?C: This symbol, if defined, indicates that the getpwnam() routine
+?C: is available to get the /etc/passwd structure entries for given
+?C: user name.
+?C:.
+?H:#$d_getpwnam HAS_GETPWNAM /**/
+?H:.
+?LINT:set d_getpwnam
+: see if there is a getpwnam
+$cat >try.c <<EOC
+#include <pwd.h>
+int main(void)
+{
+ struct passwd pw;
+ pw = *getpwnam("foo");
+ return pw.pw_name ? 0 : 1;
+}
+EOC
+cyn=getpwnam
+set d_getpwnam
+eval $trylink
+
diff --git a/mcon/U/d_getpwuid.U b/mcon/U/d_getpwuid.U
new file mode 100644
index 0000000..8c49ea3
--- /dev/null
+++ b/mcon/U/d_getpwuid.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_getpwuid: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_getpwuid:
+?S: This variable conditionally defines the HAS_GETPWUID symbol, which
+?S: indicates to the C program that it can use the getpwuid() routine
+?S: to get the /etc/passwd structure entries for given user ID.
+?S:.
+?C:HAS_GETPWUID:
+?C: This symbol, if defined, indicates that the getpwuid() routine
+?C: is available to get the /etc/passwd structure entries for given
+?C: user ID.
+?C:.
+?H:#$d_getpwuid HAS_GETPWUID /**/
+?H:.
+?LINT:set d_getpwuid
+: see if there is a getpwuid
+$cat >try.c <<EOC
+#include <pwd.h>
+int main(void)
+{
+ struct passwd pw;
+ pw = *getpwuid(0);
+ return pw.pw_name ? 0 : 1;
+}
+EOC
+cyn=getpwuid
+set d_getpwuid
+eval $trylink
+
diff --git a/mcon/U/d_openat.U b/mcon/U/d_openat.U
new file mode 100644
index 0000000..8565ee5
--- /dev/null
+++ b/mcon/U/d_openat.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_openat: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_openat:
+?S: This variable conditionally defines HAS_OPENAT if openat() is
+?S: available to open files with a relative path interepreted in
+?S: the context of an opened directory.
+?S:.
+?C:HAS_OPENAT:
+?C: This symbol, if defined, indicates that the openat() routine is
+?C: available to open files with a relative path interepreted in
+?C: the context of an opened directory.
+?C:.
+?H:#$d_openat HAS_OPENAT /**/
+?H:.
+?LINT:set d_openat
+: see if openat exists
+$cat >try.c <<EOC
+#include <fcntl.h> /* AT_* constants */
+int main(void)
+{
+ static int ret;
+ ret |= openat(AT_FDCWD, "path", /* flags */ 0, /* mode */ 0);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=openat
+set d_openat
+eval $trylink
+
diff --git a/mcon/U/d_pipe.U b/mcon/U/d_pipe.U
index a0cd165..19952c6 100644
--- a/mcon/U/d_pipe.U
+++ b/mcon/U/d_pipe.U
@@ -1,4 +1,4 @@
-?RCS: $Id: d_pipe.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: $Id: d_pipe.U 196 2015-11-01 14:35:37Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
@@ -21,7 +21,7 @@
?S: indicates to the C program that the pipe() routine is available
?S: to create an inter-process channel.
?S:.
-?C:HAS_PIPE :
+?C:HAS_PIPE:
?C: This symbol, if defined, indicates that the pipe routine is
?C: available to create an inter-process channel.
?C:.
diff --git a/mcon/U/d_pipe2.U b/mcon/U/d_pipe2.U
new file mode 100644
index 0000000..df03115
--- /dev/null
+++ b/mcon/U/d_pipe2.U
@@ -0,0 +1,46 @@
+?RCS:
+?RCS: Copyright (c) 2015, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_pipe2: Trylink cat i_unistd i_sysfile
+?MAKE: -pick add $@ %<
+?S:d_pipe2:
+?S: This variable conditionally defines the HAS_PIPE2 symbol, which
+?S: indicates to the C program that the pipe2() routine is available
+?S: to create an inter-process channel with some flags.
+?S:.
+?C:HAS_PIPE2:
+?C: This symbol, if defined, indicates that the pipe routine is
+?C: available to create an inter-process channel with O_CLOEXEC or
+?C: O_NONBLOCK flags.
+?C:.
+?H:#$d_pipe2 HAS_PIPE2 /**/
+?H:.
+?LINT:set d_pipe2
+: see if pipe2 exists
+$cat >try.c <<EOC
+#$i_unistd I_UNISTD
+#$i_sysfile I_SYS_FILE
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#ifdef I_SYS_FILE
+#include <sys/file.h> /* For O_* constants */
+#endif
+#include <fcntl.h> /* For O_* constants */
+int main(void)
+{
+ static int fds[2], ret;
+ ret |= pipe2(fds, O_CLOEXEC | O_NONBLOCK);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=pipe2
+set d_pipe2
+eval $trylink
+
diff --git a/mcon/U/d_proginvocname.U b/mcon/U/d_proginvocname.U
new file mode 100644
index 0000000..1ebd177
--- /dev/null
+++ b/mcon/U/d_proginvocname.U
@@ -0,0 +1,40 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_proginvocname: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_proginvocname:
+?S: This variable conditionally defines the HAS_PROGRAM_INVOCATION_NAME
+?S: symbol, which indicates to the C program that the two variables
+?S: program_invocation_name and program_invocation_short_name are set
+?S: at startup time.
+?S:.
+?C:HAS_PROGRAM_INVOCATION_NAME:
+?C: This symbol is defined when the C startup sets the two variables
+?C: program_invocation_name and program_invocation_short_name. To get
+?C: these definitions, <errno.h> must be included with __USE_GNU defined.
+?C:.
+?H:#$d_proginvocname HAS_PROGRAM_INVOCATION_NAME
+?H:.
+?LINT: set d_proginvocname
+: do we have the program_invocation_name variable?
+$cat >try.c <<EOC
+#include <stdio.h>
+#define __USE_GNU
+#include <errno.h>
+int main(void)
+{
+ printf("%s\n%s\n", program_invocation_name, program_invocation_short_name);
+ return 0;
+}
+EOC
+cyn="whether C startup sets program_invocation_name"
+set d_proginvocname
+eval $trylink
+
diff --git a/mcon/U/d_setenv.U b/mcon/U/d_setenv.U
new file mode 100644
index 0000000..9fcfd52
--- /dev/null
+++ b/mcon/U/d_setenv.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_setenv: Trylink cat i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_setenv:
+?S: This variable conditionally defines the HAS_SETENV
+?S: symbol, which indicates to the C program that setenv()
+?S: is available to change or add an environment variable.
+?S:.
+?C:HAS_SETENV:
+?C: This symbol is defined when setenv() is available to change or
+?C: add an environment variable.
+?C:.
+?H:#$d_setenv HAS_SETENV
+?H:.
+?LINT: set d_setenv
+: do we have setenv?
+$cat >try.c <<EOC
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(void)
+{
+ return setenv("foo", "bar", 1);
+}
+EOC
+cyn=setenv
+set d_setenv
+eval $trylink
+
diff --git a/mcon/U/d_setprogname.U b/mcon/U/d_setprogname.U
new file mode 100644
index 0000000..0e53fdb
--- /dev/null
+++ b/mcon/U/d_setprogname.U
@@ -0,0 +1,40 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_setprogname: Trylink cat i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_setprogname:
+?S: This variable conditionally defines the HAS_SETPROGNAME
+?S: symbol, which indicates to the C program that setprogname()
+?S: is available to set the program name.
+?S:.
+?C:HAS_SETPROGNAME:
+?C: This symbol is defined when setprogname() is there to set the
+?C: program name.
+?C:.
+?H:#$d_setprogname HAS_SETPROGNAME
+?H:.
+?LINT: set d_setprogname
+: can we use setprogname?
+$cat >try.c <<EOC
+#include <sys/types.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(void)
+{
+ setprogname("test");
+ return 0;
+}
+EOC
+cyn=setprogname
+set d_setprogname
+eval $trylink
+
diff --git a/mcon/U/d_unsetenv.U b/mcon/U/d_unsetenv.U
new file mode 100644
index 0000000..8fcd511
--- /dev/null
+++ b/mcon/U/d_unsetenv.U
@@ -0,0 +1,38 @@
+?RCS:
+?RCS: Copyright (c) 2015 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_unsetenv: Trylink cat i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_unsetenv:
+?S: This variable conditionally defines the HAS_UNSETENV
+?S: symbol, which indicates to the C program that unsetenv()
+?S: is available to delete an environment variable.
+?S:.
+?C:HAS_UNSETENV:
+?C: This symbol is defined when unsetenv() is available to delete
+?C: an environment variable.
+?C:.
+?H:#$d_unsetenv HAS_UNSETENV
+?H:.
+?LINT: set d_unsetenv
+: do we have unsetenv?
+$cat >try.c <<EOC
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(void)
+{
+ return unsetenv("foo");
+}
+EOC
+cyn=unsetenv
+set d_unsetenv
+eval $trylink
+