Subject: Compiling fvwm 2.2.4 on Ultrix system

From: Robert-Olivier Cayot <[email-masked]>
Date: Fri, 15 Sep 2000 09:07:57 +0100

Hi,

1 - Since Ultrix doesn't have strdup I made the following patch.

2 - /bin/sh doesn't have 'unset' command, then I must replace it by ksh in 
configure script. But i don't know how patch configure.in to do that.

Bob.

--==_Exmh_-906383310
Content-Type: text/plain ; name="patch-strdup-2.2.4"; charset=us-ascii
Content-Description: patch-strdup-2.2.4
Content-Disposition: attachment; filename="patch-strdup-2.2.4"

--- configure.in.orig	Fri Sep 15 08:14:03 2000
+++ configure.in	Fri Sep 15 08:17:41 2000
@@ -150,7 +150,7 @@
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
 AC_CHECK_FUNCS(gettimeofday mkfifo putenv select setvbuf socket waitpid)
-AC_CHECK_FUNCS(strdup strstr strtol memmove memcpy strchr sysconf uname div)
+AC_CHECK_FUNCS(strstr strtol memmove memcpy strchr sysconf uname div)
 AC_CHECK_FUNCS(sigaction siginterrupt)
 
 pds_CHECK_TYPE(sig_atomic_t, int, [#include <signal.h>])
@@ -167,7 +167,7 @@
 fi
 
 dnl Check for standard functions that we have replacements for.
-AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strerror usleep atexit)
+AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strdup strerror usleep atexit)
 AC_SUBST(LIBOBJS)
 
 dnl If we do not have atexit(), then check for on_exit()
--- libs/strdup.c.orig	Fri Sep 15 08:35:44 2000
+++ libs/strdup.c	Fri Sep 15 08:35:44 2000
@@ -0,0 +1,20 @@
+/* ultrix doesn't have strdup */
+
+#include <stdlib.h>
+#include <string.h>
+
+char *strdup(const char *s) {
+  char   *d;
+  size_t l;
+
+  if (s == NULL)
+    return NULL;
+
+  l = strlen (s) + 1;
+
+  if ((d = (char *)malloc (l)) == NULL)
+    return NULL;
+
+  memcpy (d, s, l);
+  return d;
+}

--==_Exmh_-906383310
Content-Type: application/x-gzip ; name="ChangeLog-2.2.4.gz"
Content-Description: ChangeLog-2.2.4.gz
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ChangeLog-2.2.4.gz"

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 15 Sep 2000 14:46:04 +0200

> 1 - Since Ultrix doesn't have strdup I made the following patch.

I have applied this patch.

> configure script. But i don't know how patch configure.in to do that.

Duh.  Every /bin/sh should have unset.  That ist something the
autoconf developers should know.

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: "Paul D. Smith" <[email-masked]>
Date: Fri, 15 Sep 2000 15:01:36 -0400

%% Dominik Vogt <[email-masked]> writes:

  >> 2 - /bin/sh doesn't have 'unset' command,

  dv> Duh.  Every /bin/sh should have unset.  That ist something the
  dv> autoconf developers should know.

Not so; early versions of sh didn't have unset.  It was added later.

The autoconf developers _do_ know, that's why you don't see unset used
in any autoconf-generated code.

However, there are a bunch of unset's in the configure.in script, and
that's where this problem is coming from.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 15 Sep 2000 23:56:18 +0200

> that's where this problem is coming from.

Okay, so what do we do about that?  I found this comment in
configure.in:

  dnl Using 'unset' is said to be unportable, but setting to null is
  dnl not enough to avoid using the cached value!

  unset ac_cv_header_X11_xpm_h
  ...

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Fri, 15 Sep 2000 18:55:24 -0400

>   unset ac_cv_header_X11_xpm_h

Warning, this is untested.  How about something like:

UNSET=unset
x=`unset x 2>&1`
case $x in
  *not*found*)
    UNSET=true
  ;;
esac

$UNSET ac_cv_header_X11_xpm_h

If the logic requires the variable to be set to null, a leading and
trailing $UNSET might do the trick.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 16 Sep 2000 02:50:25 +0200

> trailing $UNSET might do the trick.

This may only fix syntax errors, but the logic will not remain the same.
Ok, I will do this tomorrow together with other configure.in things.

UNSET=true
if unset UNSET 2>/dev/null; then UNSET=unset; fi

So, on some old systems rerunning configure will use the cached values...

Regards,
Mikhael.