OS X OpenMotif 2.2.2

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

6 posts / 0 new
Last post
OS X OpenMotif 2.2.2

Submitted by Anonymous on Mon, 05/13/2002 - 20:55.

I downloaded the Runtime and Development Darwin TGZ packages for 2.2.2.

I see the folowing problems when I try to link my application with OpenMotif
1. The linker can`t find nl_langinfo.
2. I would like to statically link Motif, but there is no libXm.a

Any help you can give me would be greatly appreciated.

Thanks,

Frank Ortega

fao@lanl.gov

Tue, 05/14/2002 - 14:21#1

Tue, 05/14/2002 - 14:21#1

damian

OS X OpenMotif 2.2.2

see previous thread. )

Thu, 05/16/2002 - 01:47#2

Thu, 05/16/2002 - 01:47#2

Anonymous

OS X OpenMotif 2.2.2

How much longer before the patches are available for download? That note was written in February. I wanted to do a simple port. At the link step, I get the following

$ /usr/bin/cc -o mgdiff -O2 -Wall -Wpointer-arith -no-cpp-precomp -Wl,-bind_at_load -L/usr/X11R6/lib mgdiff.o rundiff.o misc.o files.o spawn.o manual.o modal.o legend.o -lXm -lXt -lSM -lICE -lXmu -lXext -lX11
/usr/bin/ld warning multiple definitions of symbol _vendorShellClassRec
/usr/local/lib/libXm.dylib(VendorS.lo) definition of _vendorShellClassRec
/usr/X11R6/lib/libXt.dylib(Vendor.o) definition of _vendorShellClassRec
/usr/bin/ld warning multiple definitions of symbol _vendorShellWidgetClass
/usr/local/lib/libXm.dylib(VendorS.lo) definition of _vendorShellWidgetClass
/usr/X11R6/lib/libXt.dylib(Vendor.o) definition of _vendorShellWidgetClass
/usr/bin/ld warning multiple definitions of symbol _XauDisposeAuth
/usr/X11R6/lib/libX11.dylib(AuDispose.o) definition of _XauDisposeAuth
/usr/X11R6/lib/libXp.6.dylib(AuDispose.o) definition of _XauDisposeAuth
/usr/bin/ld warning multiple definitions of symbol _XauReadAuth
/usr/X11R6/lib/libXp.6.dylib(AuRead.o) definition of _XauReadAuth
/usr/X11R6/lib/libX11.dylib(AuRead.o) definition of _XauReadAuth

Any attempt to run results in the following

$ ./mgdiff &
Warning Widget must be a VendorShell.
Warning Fatal Error
_XmGetDefaultDisplay cannot be used prior to VendorS.Initialize, returns NULL

Motif demos don`t work either.

Any thoughts on what could be done?

Thu, 05/16/2002 - 13:56#3

Thu, 05/16/2002 - 13:56#3

damian

OS X OpenMotif 2.2.2

The quick hack workaround is to compile OM with -flat-namespace in the link line. All apps compiled against OM will also have to use that. More info is available at the Apple developer site.
(d)

Tue, 05/21/2002 - 15:51#4

Tue, 05/21/2002 - 15:51#4

Anonymous

OS X OpenMotif 2.2.2

Damian,

Okay, I was able to get my application running under Mac OS X using Lesstif, but I`d rather use Motif.
Here`s what I tried so far
I downloaded the source for OpenMotif 2.2.2 and modified Scale.c to remove the calls to nl_langinfo and just
use a "." for the decimal point. I then tried to build using autoconfig then running make. The build did not work,
there was a link error, but the make did compile and generate .o files. So, since I want a static library anyway,
I used ar and ranlib to create a libXm.a. However, when I tried to link to the library (using the -flat-namspace option),
I got the following errors
/usr/bin/ld warning multiple definitions of symbol _XauDisposeAuth
/usr/X11R6/lib/libX11.dylib(AuDispose.o) definition of _XauDisposeAuth
/usr/X11R6/lib/libXp.dylib(AuDispose.o) definition of _XauDisposeAuth
/usr/bin/ld warning multiple definitions of symbol _XauReadAuth
/usr/X11R6/lib/libX11.dylib(AuRead.o) definition of _XauReadAuth
/usr/X11R6/lib/libXp.dylib(AuRead.o) definition of _XauReadAuth
/usr/bin/ld Undefined symbols
_getpwnam_r
_getpwuid_r
_strtok_r

The warnings are no problem, but the undefined symbols are. These are re-entrant versions of getpwname, getpwuid,
and strtok routines that are not available in OS X (Darwin 5.4 with gcc2). So the question is, is there a workaround to
compiling OpenMotif that will not use the re-entrant versions of these routines? Is there a configure option that can be
set to overcome this problem?

Thanks,

Frank

Wed, 06/25/2003 - 06:43#5

Wed, 06/25/2003 - 06:43#5

Anonymous

OS X OpenMotif 2.2.2

I`ve recently downloaded, compiled, and installed OpenMotif 2.2.2
on Mac OS X 10.2.6, Darwin Kernel Version 6.6, with XDarwin.
Maybe others have done this too, but I don`t see it posted here,
and it wasn`t quite painless, so I thought I`d share.

I downloaded the source and binaries for OS X, but none of the
binaries would run. Most of them complained about non-Widget
objects where a Widget was expected. When I tried to recompile,
it failed with a shell syntax (quoting) error in libtool. There
were also references to non-existent files.

I learned some things on my own, and others by reading the
porting tips at

http//fink.sourceforge.net/doc/porting/preparing.php

To make a long story short, here are diffs for a few top-level
configuration files -- aclocal.m4, ltmain.sh, and configure.in
(sorry about the line-wrapping here)

* * *

% diff -u aclocal.m4.dist aclocal.m4
--- aclocal.m4.dist Mon May 19 211513 2003
+++ aclocal.m4 Wed Jun 25 142502 2003
@@ -1769,11 +1769,18 @@
;;

darwin* | rhapsody*)
- allow_undefined_flag=`-undefined suppress`
+ allow_undefined_flag=`-flat_namespace -undefined suppress -bind_at_load`
# FIXME Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo`s removal of escapes.
- archive_cmds=`$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)`
+ # archive_cmds=`$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)`
+ # PATCH The "$(test -n "$verstring" ...)" above fails if "$verstring"
+ # contains whitespace. The quotes themselves are quoted, and
+ # test sees too many arguments. The following suggested fix is
+ # from http//fink.sourceforge.net/doc/porting/preparing.php . The
+ # file ltmain.sh must also have a complementary patch to define
+ # $tmp_verstring . 2003/06/20 T.W.H.
+ archive_cmds=`$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $tmp_verstring`
# We need to add `_` to the symbols in $export_symbols first
#archive_expsym_cmds="$archive_cmds"` && strip -s $export_symbols`
hardcode_direct=yes

* * *

% diff -u ltmain.sh.dist ltmain.sh
--- ltmain.sh.dist Fri Jun 20 230120 2003
+++ ltmain.sh Fri Jun 20 232740 2003
@@ -2894,6 +2894,17 @@
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds="$archive_expsym_cmds"
else
+ # Patch The following lines defining tmp_verstring complement a
+ # patch in aclocal.m4 and configure, to work around a bug in testing
+ # $verstring there. This patch is suggested by
+ # http//fink.sourceforge.net/doc/porting/preparing.php
+ # 2003/06/20 T.W.H.
+ if test "x$verstring" = "x0.0"; then
+ tmp_verstring=
+ else
+ tmp_verstring="$verstring"
+ fi
+ # End Patch
eval cmds="$archive_cmds"
fi
save_ifs="$IFS"; IFS=`~`

* * *

% diff -u configure.in.dist configure.in
--- configure.in.dist Mon May 19 233245 2003
+++ configure.in Mon May 19 233322 2003
@@ -268,9 +268,6 @@
demos/lib/Exm/wml/Makefile
demos/programs/Makefile
demos/programs/Exm/Makefile
-demos/programs/Exm/app_in_c/Makefile
-demos/programs/Exm/app_in_uil/Makefile
-demos/programs/Exm/simple_app/Makefile
demos/programs/airport/Makefile
demos/programs/animate/Makefile
demos/programs/drag_and_drop/Makefile

* * *

I also changed the Makefiles for all of the clients, tools, and
demos. I couldn`t find a way to propagate this from the
top-level configure scripts, so I finally resorted to changing
the Makefiles for all of the executables, one-by-one. The diff
for mwm is typical of the others

* * *

% diff -u clients/mwm/Makefile.am.dist clients/mwm/Makefile.am
--- clients/mwm/Makefile.am.dist Mon Jun 23 223025 2003
+++ clients/mwm/Makefile.am Mon Jun 23 223250 2003
@@ -7,6 +7,7 @@
rc_DATA = system.mwmrc

bin_PROGRAMS = mwm
+LDFLAGS = -force_flat_namespace -bind_at_load
mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la

INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART

* * *

% diff -u clients/mwm/Makefile.in.dist clients/mwm/Makefile.in
--- clients/mwm/Makefile.in.dist Mon Jun 23 223424 2003
+++ clients/mwm/Makefile.in Mon Jun 23 223706 2003
@@ -98,6 +98,7 @@
rc_DATA = system.mwmrc

bin_PROGRAMS = mwm
+LDFLAGS = -force_flat_namespace -bind_at_load
mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la

INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART
@@ -171,7 +172,6 @@

DEFS = @DEFS@ -I. -I$(srcdir) -I../../include
CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@

* * *

After applying the diffs above, OpenMotif 2.2.2 configures,
compiles, installs, and executes successfully on OS X 10.2.6

% autoconf
% ./configure
% make
% sudo make install