From e6df8b40bcec77dd84e583c2cfb0152e8666210f Mon Sep 17 00:00:00 2001 From: Manoj Srivastava Date: Tue, 12 Jan 2016 22:50:57 -0800 Subject: Imported Upstream version 3.5-36.0001 --- Configure | 45 +++++++++++++++++++++++++++++++++++---------- MANIFEST | 16 ++++++++++++++++ jmake/files/Jmake.rules | 41 +++++++++++++++++++++++++++-------------- jmake/files/Jmake.tmpl | 8 ++++++-- mcon/U/Options.U | 15 +++++++++++++-- mcon/U/d_bfd_lib.U | 5 ++++- mcon/U/d_bsearch.U | 39 +++++++++++++++++++++++++++++++++++++++ mcon/U/d_cbrt.U | 4 ++-- mcon/U/d_clearenv.U | 38 ++++++++++++++++++++++++++++++++++++++ mcon/U/d_dirent_d_namlen.U | 42 ++++++++++++++++++++++++++++++++++++++++++ mcon/U/d_dirent_d_type.U | 11 ++++++----- mcon/U/d_dirfd.U | 42 ++++++++++++++++++++++++++++++++++++++++++ mcon/U/d_fchdir.U | 40 ++++++++++++++++++++++++++++++++++++++++ mcon/U/d_fdopendir.U | 42 ++++++++++++++++++++++++++++++++++++++++++ mcon/U/d_fstatat.U | 43 +++++++++++++++++++++++++++++++++++++++++++ mcon/U/d_getprogname.U | 40 ++++++++++++++++++++++++++++++++++++++++ mcon/U/d_getpwnam.U | 38 ++++++++++++++++++++++++++++++++++++++ mcon/U/d_getpwuid.U | 38 ++++++++++++++++++++++++++++++++++++++ mcon/U/d_openat.U | 38 ++++++++++++++++++++++++++++++++++++++ mcon/U/d_pipe.U | 4 ++-- mcon/U/d_pipe2.U | 46 ++++++++++++++++++++++++++++++++++++++++++++++ mcon/U/d_proginvocname.U | 40 ++++++++++++++++++++++++++++++++++++++++ mcon/U/d_setenv.U | 38 ++++++++++++++++++++++++++++++++++++++ mcon/U/d_setprogname.U | 40 ++++++++++++++++++++++++++++++++++++++++ mcon/U/d_unsetenv.U | 38 ++++++++++++++++++++++++++++++++++++++ 25 files changed, 753 insertions(+), 38 deletions(-) create mode 100644 mcon/U/d_bsearch.U create mode 100644 mcon/U/d_clearenv.U create mode 100644 mcon/U/d_dirent_d_namlen.U create mode 100644 mcon/U/d_dirfd.U create mode 100644 mcon/U/d_fchdir.U create mode 100644 mcon/U/d_fdopendir.U create mode 100644 mcon/U/d_fstatat.U create mode 100644 mcon/U/d_getprogname.U create mode 100644 mcon/U/d_getpwnam.U create mode 100644 mcon/U/d_getpwuid.U create mode 100644 mcon/U/d_openat.U create mode 100644 mcon/U/d_pipe2.U create mode 100644 mcon/U/d_proginvocname.U create mode 100644 mcon/U/d_setenv.U create mode 100644 mcon/U/d_setprogname.U create mode 100644 mcon/U/d_unsetenv.U diff --git a/Configure b/Configure index f27fe64..40a347d 100755 --- a/Configure +++ b/Configure @@ -14,11 +14,11 @@ # Note: this Configure script was generated automatically. Rather than # working with this copy of Configure, you may wish to get metaconfig. # The dist package (which contains metaconfig) is available via SVN: -# svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist +# svn co https://svn.code.sf.net/p/dist/code/trunk/dist -# $Id: Head.U 41 2010-11-28 00:21:26Z rmanfredi $ +# $Id: Head.U 167 2013-05-08 17:58:00Z rmanfredi $ # -# Generated on Tue Feb 7 19:02:16 RST 2012 [metaconfig 3.5-123] +# Generated on Sat Nov 14 16:05:58 CET 2015 [metaconfig 3.5-197] cat >c1$$ <&2 + -V) echo "$me generated by metaconfig 3.5-197." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; @@ -787,8 +788,13 @@ case "$silent" in true) exec 1>/dev/null;; esac -: run the defines and the undefines, if any, but leave the file out there... 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... touch posthint.sh @@ -1620,6 +1626,7 @@ EOSC : determine whether symbolic links are supported echo " " $rm -f blurfl sym +$touch blurfl if $ln -s blurfl sym > /dev/null 2>&1 && $test -f sym; then echo "Symbolic links are supported." >&4 lns="$ln -s" @@ -2136,6 +2143,7 @@ esac saved_osname="$osname" saved_osvers="$osvers" +saved_libswanted="$libswanted" tmp_n="$n" tmp_c="$c" tmp_sh="$sh" @@ -2196,6 +2204,12 @@ osvers="$saved_osvers" n="$tmp_n" c="$tmp_c" +case "$libswanted" in +"$saved_libswanted") ;; +*) libs='';; +esac +libswanted="$saved_libswanted" + . ./checkcc case "$targetarch" in '') ;; @@ -3314,9 +3328,19 @@ your organization... EOM cont=x while test "$cont"; do + case "$MAILDOMAIN" in + '') + if $test -s /etc/mailname; then + maildomain=`$cat /etc/mailname` + else + maildomain="$myhostname$mydomain" + fi + ;; + *) maildomain="$MAILDOMAIN";; + esac case "$cf_email" in - '') dflt="$cf_by@$myhostname$mydomain";; - *) dflt="$cf_email";; + '') dflt="$cf_by@$maildomain";; + *) dflt="$cf_email";; esac rp='What is your e-mail address?' . ./myread @@ -3675,6 +3699,7 @@ case "$optimize" in 'none') optimize=" ";; esac + dflt='' : We will not override a previous value, but we might want to : augment a hint file @@ -3868,7 +3893,7 @@ rmlist="$rmlist pdp11" : coherency check echo " " echo "Checking your choice of C compiler and flags for coherency..." >&4 -set X $cc $optimize $ccflags $ldflags -o try try.c +set X $cc $optimize $pthread $ccflags $ldflags -o try try.c shift $cat >try.msg < -: $Id: Jmake.tmpl 156 2012-12-19 16:44:39Z rmanfredi $ +: $Id: Jmake.tmpl 183 2015-04-12 09:48:11Z rmanfredi $ /************************************************************************* * * @@ -217,6 +217,7 @@ MakeSubdirs() * in this directory. */ local_install:: +local_install-strip:: local_deinstall:: local_install.man:: local_deinstall.man:: @@ -229,6 +230,9 @@ local_deinstall.man:: local_install:: @echo "install in $(CURRENT) done." +local_install-strip:: + @echo "install (strip) in $(CURRENT) done." + local_deinstall:: @echo "deinstall in $(CURRENT) done." 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 < +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 < +#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 < +#$i_dirent I_DIRENT +#ifdef I_DIRENT +#include +#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 < +#$i_dirent I_DIRENT +#ifdef I_DIRENT +#include +#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 < +#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 < +#ifdef I_DIRENT +#include +#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 < /* AT_* constants */ +#ifdef I_SYS_STAT +#include +#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 < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#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 < +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 < +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 < /* 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 < +#endif +#ifdef I_SYS_FILE +#include /* For O_* constants */ +#endif +#include /* 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, 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 < +#define __USE_GNU +#include +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 < +#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 < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#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 < +#endif +int main(void) +{ + return unsetenv("foo"); +} +EOC +cyn=unsetenv +set d_unsetenv +eval $trylink + -- cgit v1.2.3