changeset 2548:b50cc31aa0cd

[project @ 1996-11-20 06:43:26 by jwe]
author jwe
date Wed, 20 Nov 1996 06:46:07 +0000
parents 3e63aae0ccd5
children 6551a8230ded
files ChangeLog acconfig.h aclocal.m4 configure.in libcruft/ChangeLog src/ChangeLog src/getgrent.cc
diffstat 7 files changed, 43 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Nov 20 00:33:03 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* aclocal.m4 (OCTAVE_STRUCT_GR_PASSWD): New macro.
+	* configure.in: Use it.
+	* acconfig.h (HAVE_GR_PASSWD): Add undef.
+
 Tue Nov 19 23:10:01 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* Makeconf.in (INCFLAGS): Add libcruft/misc directory.
--- a/acconfig.h
+++ b/acconfig.h
@@ -33,6 +33,9 @@
 /* Define if your gnuplot has mutliplot. */
 #undef GNUPLOT_HAS_MULTIPLOT
 
+/* Define if your system's struct group has a gr_passwd field. */
+#undef HAVE_GR_PASSWD
+
 /* Define if you have isinf(). */
 #undef HAVE_ISINF
 
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -16,8 +16,9 @@
 dnl 
 dnl You should have received a copy of the GNU General Public License
 dnl along with Octave; see the file COPYING.  If not, write to the Free
-dnl Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
+dnl Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA. 
+dnl
 dnl See what libraries are used by the C++ compiler.  Need this for
 dnl dynamic linking.
 dnl
@@ -101,7 +102,7 @@
 AC_MSG_RESULT([$octave_cv_cxxlibs])
 CXXLIBS="$octave_cv_cxxlibs"
 AC_SUBST(CXXLIBS)])
-
+dnl
 dnl See what libraries are used by the Fortran compiler.
 dnl
 dnl Write a minimal program and compile it with -v.  I don't know what
@@ -242,7 +243,7 @@
 octave_cv_flibs="$flibs_result"])
 FLIBS="$octave_cv_flibs"
 AC_MSG_RESULT([$FLIBS])])
-
+dnl
 dnl See if the Fortran compiler uses uppercase external names.
 dnl
 dnl OCTAVE_F77_UPPERCASE_NAMES()
@@ -264,7 +265,7 @@
 if test "$octave_cv_f77_uppercase_names" = yes; then
   AC_DEFINE(F77_UPPERCASE_NAMES, 1)
 fi])
-
+dnl
 dnl See if the Fortran compiler appends underscores to external names.
 dnl
 dnl OCTAVE_F77_APPEND_UNDERSCORE()
@@ -293,7 +294,7 @@
 if test "$octave_cv_f77_append_underscore" = yes; then
   AC_DEFINE(F77_APPEND_UNDERSCORE, 1)
 fi])
-
+dnl
 dnl See if the Fortran compiler is compatible with f2c.
 dnl
 dnl Write a minimal program, compile it, and see if it works as
@@ -355,7 +356,19 @@
 fi])
 rm -f ftest* ctest* core
 AC_MSG_RESULT([$octave_cv_f2c_f77_compat])])
-
+dnl
+dnl See if struct group has a gr_passwd field.
+dnl
+AC_DEFUN(OCTAVE_STRUCT_GR_PASSWD,
+[AC_CACHE_CHECK([for gr_passwd in struct group], octave_cv_struct_gr_passwd,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <grp.h>], [struct group s; s.gr_passwd;],
+octave_cv_struct_gr_passwd=yes, octave_cv_struct_gr_passwd=no)])
+if test $octave_cv_struct_gr_passwd = yes; then
+  AC_DEFINE(HAVE_GR_PASSWD)
+fi
+])
+dnl
 dnl The following test is from Karl Berry's Kpathseach library.  I'm
 dnl including it here in case we someday want to make the use of
 dnl kpathsea optional.
--- a/configure.in
+++ b/configure.in
@@ -21,7 +21,7 @@
 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ### 02111-1307, USA. 
 
-AC_REVISION($Revision: 1.234 $)
+AC_REVISION($Revision: 1.235 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -811,6 +811,8 @@
 AC_STRUCT_TIMEZONE
 AC_FUNC_CLOSEDIR_VOID
 
+OCTAVE_STRUCT_GR_PASSWD
+
 TERMLIBS=""
 for termlib in termcap terminfo ncurses curses termlib; do
   AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"])
--- a/libcruft/ChangeLog
+++ b/libcruft/ChangeLog
@@ -1,5 +1,7 @@
 Tue Nov 19 23:04:24 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* misc/Makefile.in: Add variables for installing things.
+
 	* Makerules.in (install, uninstall): Make these double colon rules.
 
 	* f77-fcn.c, f77-fcn.h: New files, from liboctave.
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+Wed Nov 20 00:35:57 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* getgrent.cc (mk_gr_map): Only set the passwd field if
+	HAVE_GR_PASSWD is defined.
+
 Tue Nov 19 12:01:13 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* sysdep.cc (OS2_init): New function.
--- a/src/getgrent.cc
+++ b/src/getgrent.cc
@@ -55,7 +55,11 @@
       Octave_map m;
 
       m ["name"] = gr->gr_name;
+#if defined (HAVE_GR_PASSWD)
       m ["passwd"] = gr->gr_passwd;
+#else
+      m ["passwd"] = "";
+#endif
       m ["gid"] = STATIC_CAST (double, gr->gr_gid);
 
       if (gr->gr_mem)