Blob Blame History Raw
From 999dae915c9c84da77a65ee3f73ef9c03501ee8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu@fedoraproject.org>
Date: Wed, 17 Feb 2016 15:15:11 +0100
Subject: [PATCH 1/9] dx-rpm

---
 bin/Makefile.am                         |  2 +-
 bin/dx.in                               | 34 ++++++++++++++++-----------------
 bin/mdf2c.in                            |  2 +-
 bin/url_handler.sh                      |  4 ++--
 configure.ac                            | 18 ++++++++++-------
 doc/Makefile.am                         |  2 +-
 fonts/Makefile.am                       |  2 +-
 help/Makefile.am                        |  6 +++---
 html/Makefile.am                        |  2 +-
 html/images/Makefile.am                 |  2 +-
 html/pages/Makefile.am                  |  2 +-
 include/Makefile.am                     |  2 +-
 include/dx/Makefile.am                  |  2 +-
 lib/Makefile.am                         |  2 +-
 man/Makefile.am                         |  2 +-
 man/manl/Makefile.am                    |  2 +-
 src/exec/Makefile.am                    |  2 +-
 src/exec/dxexec/Makefile.am             |  2 +-
 src/exec/dxmods/Makefile.am             |  5 ++++-
 src/exec/dxmods/local.mk.in             | 18 ++++++++---------
 src/exec/libdx/Makefile.am              |  2 +-
 src/exec/libdx/memory.c                 |  1 -
 src/misc/Makefile.am                    |  4 ++--
 src/uipp/dxl/Makefile.am                |  2 +-
 src/uipp/dxui/Makefile.am               |  2 +-
 src/uipp/java/Makefile.am               |  6 +++---
 src/uipp/java/server/Makefile.am        |  6 +++---
 src/uipp/java/server/macros/Makefile.am |  2 +-
 src/uipp/mb/Makefile.am                 |  2 +-
 src/uipp/prompter/Makefile.am           |  2 +-
 src/uipp/startup/Makefile.am            |  2 +-
 src/uipp/tutor/Makefile.am              |  2 +-
 src/uipp/ui/Makefile.am                 |  2 +-
 33 files changed, 77 insertions(+), 71 deletions(-)

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 2665806..07112d8 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-dxbindir = $(prefix)/dx/bin
+dxbindir = $(libdir)/dx/bin
 bindir = $(prefix)/bin
 
 EXTRA_SCRIPTS = mdf2c dx
diff --git a/bin/dx.in b/bin/dx.in
index d3c69f7..29c3f6e 100644
--- a/bin/dx.in
+++ b/bin/dx.in
@@ -60,14 +60,7 @@ exit 1
 #
 longhelp() {
 
-if test -f "$dxroot/man/catl/dx.l" ; then
-    more "$dxroot/man/catl/dx.l"
-else
-    echo "cannot find $dxroot/man/catl/dx.l"
-    echo "set the DXROOT environment variable to the root of the"
-    echo "dx installation tree and try again."
-fi
-exit 1
+man dx
 
 cat << EOFlonghelp
 command line parameters:
@@ -286,7 +279,7 @@ fi
 
 
 if [ -z "$DXROOT" ]; then
-  prefix=@prefix@
+  prefix=@datadir@
   DXROOT=$prefix/dx
 fi
 export DXROOT
@@ -298,6 +291,13 @@ if [ -z "$DXDATA" ]; then
   fi
 fi
 
+if [ -z "$DXFONTS" ]; then
+  DXFONTS=$DXROOT/fonts
+  if [ -d "$DXFONTS" ]; then
+    export DXFONTS
+  fi
+fi
+
 # if DXMACROS not set, default it to the usual unless dir doesn't exist
 if [ -z "$DXMACROS" ]; then
   DXMACROS=$DXROOT/samples/macros
@@ -507,7 +507,7 @@ export DXARCH
 
 # default to running locally, from @prefix@/dx  
 exhost=$thishost
-dxroot=@prefix@/dx
+dxroot=@datadir@/dx
 startup=1   # run the startup window by default
 
 
@@ -1469,8 +1469,8 @@ done
 
 # Now set some needed results 
 
-dxexroot=$dxroot
-dxuiroot=$dxroot
+dxexroot=@libdir@/dx
+dxuiroot=@libdir@/dx
 dxexecdef="$dxexroot/bin_${exarch}/dxexec"
 if test -z "$dxexec" ; then
    dxexec=$dxexecdef
@@ -1600,7 +1600,7 @@ fi
 #
 if test $tutor -eq 1 ; then
   
-  cmd="$DXROOT/bin_${uiarch}/tutor"
+  cmd="$DXEXECROOT/bin_${uiarch}/tutor"
   if test $seecomline -eq 1 ; then
     set
     echo "$echoparms exec $cmd $xparms"
@@ -1619,7 +1619,7 @@ if test $prompter -eq 1 ; then
     prompterflags="$prompterflags -file \"$FileName\""
   fi
 
-  cmd="$DXROOT/bin_${uiarch}/prompter"
+  cmd="$DXEXECROOT/bin_${uiarch}/prompter"
   if test $seecomline -eq 1 ; then
     set
     echo "$echoparms exec $cmd $prompterflags $xparms"
@@ -1635,7 +1635,7 @@ fi
 if test $startup -eq 1 ; then
 
   
-  cmd="$DXROOT/bin_${uiarch}/startupui"
+  cmd="$DXEXECROOT/bin_${uiarch}/startupui"
   if test $seecomline -eq 1 ; then
     set
     echo "$echoparms exec $cmd $xparms $*"
@@ -1649,7 +1649,7 @@ fi
 #
 if test $builder -eq 1 ; then
 
-  cmd="$DXROOT/bin_${uiarch}/builder"
+  cmd="$DXEXECROOT/bin_${uiarch}/builder"
   if test $seecomline -eq 1 ; then
     set
     echo "exec $cmd $xparms $motifcmd $motifbind $FileName"
@@ -1674,7 +1674,7 @@ if test $encoder -eq 1 ; then
   EncodedBase="${Base}-e"
 
   echo "Creating encoded version of $FileName in ${EncodedBase}.net "
-  cmd1="$DXROOT/bin_${uiarch}/dxencode" 
+  cmd1="$DXEXECROOT/bin_${uiarch}/dxencode" 
   if test -f $CfgName ; then
     echo "Copying $CfgName to ${EncodedBase}.cfg"
     cmd2="cp $CfgName ${EncodedBase}.cfg"
diff --git a/bin/mdf2c.in b/bin/mdf2c.in
index d067a76..5a03397 100644
--- a/bin/mdf2c.in
+++ b/bin/mdf2c.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Configure is looking for the following line
-prefix=@prefix@
+prefix=@datadir@
 DFLTROOT=$prefix/dx
 root=${DXROOT=${DXEXECROOT=$DFLTROOT}}
 
diff --git a/bin/url_handler.sh b/bin/url_handler.sh
index 3487db3..e71a99a 100755
--- a/bin/url_handler.sh
+++ b/bin/url_handler.sh
@@ -39,8 +39,8 @@ case $method in
 		if [ $use_xbrowser = n ]; then
 			lynx "$url" 
 		else
-			netscape -remote "openURL($url)" 2> /dev/null || \
-			(netscape "$url" &)
+			firefox -remote "openURL($url)" 2> /dev/null || \
+			(firefox "$url" &)
                 fi
 		;;
 esac
diff --git a/configure.ac b/configure.ac
index 15ff3ff..abaa1b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -218,6 +218,7 @@ AC_DEFINE_UNQUOTED(BSH, "$bsh_path", [Path to the system's Bourne shell.])
 dnl End of command line options configuration
 
 dnl Start DX configuration
+AC_PROG_CXX
 AC_LANG([C++])
 AC_CHECK_HEADERS(stdlib.h)
 AC_LANG([C])
@@ -677,7 +678,7 @@ if test "$ARCH" = "intelnt" ; then
     fi
 dnl -- check for unix
 else
-    AC_CHECK_LIB(df,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ -lz -ljpeg ])
+    AC_CHECK_LIB(df,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ -lz -ljpeg -L$libdir/hdf ])
     AC_MSG_CHECKING(if HDF package is complete)
     if test $passed -gt 0
     then
@@ -686,7 +687,7 @@ else
 	AC_MSG_RESULT(no -- some components failed test)
         have_hdf='no (failed tests)'
     else
-	LIB_HDF='-ldf'
+	LIB_HDF="-ldf -L$libdir/hdf"
 	LIBS="$LIB_HDF $LIBS"
 	FMT_LIBS="$FMT_LIBS libdf.a"
 	AC_DEFINE(HAVE_LIBDF, 1, [Define to 1 if you have the HDF libraries])
@@ -801,6 +802,9 @@ then
 
     failed=0;
     passed=0;
+    CFLAGS="$CFLAGS -I/usr/include/ImageMagick"
+    CXXFLAGS="$CXXFLAGS -I/usr/include/ImageMagick"
+    CPPFLAGS="$CPPFLAGS -I/usr/include/ImageMagick"
     AC_CHECK_HEADER([magick/api.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
 if test "$ARCH" = "intelnt" ; then
     AC_CHECK_LIB(CORE_RL_magick_,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
@@ -835,8 +839,8 @@ dnl routine. This allows us to simplify the configuration of all the
 dnl format configuration libraries.
 
  if test "$HAVE_MC" = "yes" ; then
-    LIB_MAGICK="`Magick-config --ldflags` `Magick-config --libs`"
-    AC_CHECK_LIB( Magick,GetImageInfo, passed=`expr $passed + 1`, failed=`expr $failed + 1`, [ $LIB_MAGICK ])
+    LIB_MAGICK="`MagickCore-config --ldflags` `MagickCore-config --libs`"
+    AC_CHECK_LIB(MagickCore,GetImageInfo, passed=`expr $passed + 1`, failed=`expr $failed + 1`, [ $LIB_MAGICK ])
     AC_MSG_CHECKING(if ImageMagick package is complete)
     if test $passed -gt 0
     then
@@ -846,8 +850,8 @@ dnl format configuration libraries.
         have_magick='no (failed tests)'
     else
 dnl	CFLAGS="`Magick-config --cflags` $CFLAGS"
-	CPPFLAGS="`Magick-config --cppflags` $CPPFLAGS"
-	LIB_MAGICK="$LIBS `Magick-config --ldflags` `Magick-config --libs`"
+	CPPFLAGS="`MagickCore-config --cppflags` $CPPFLAGS"
+	LIB_MAGICK="$LIBS `MagickCore-config --ldflags` `MagickCore-config --libs`"
 dnl UNIQUIFY will remove duplicate library tokens leaving the last instance.
 	AC_UTILS_UNIQUIFY($LIB_MAGICK, LIBS)
 	FMT_LIBS="$FMT_LIBS libMagick.a"
@@ -1011,7 +1015,7 @@ DX_CHECK_HEADERS( \
   Xm/ScrolledWP.h Xm/SelectioB.h Xm/SeparatoG.h Xm/SeparatoGP.h Xm/Separator.h \
   Xm/Text.h Xm/TextF.h Xm/ToggleB.h Xm/ToggleBG.h Xm/Xm.h Xm/XmP.h Xm/XmStrDefs.h \
   gl.h gl/device.h gl/gl.h invent.h iop/afb.h iop/mov.h iop/pfs.h license.h \
-  linux/kernel.h linux/sys.h math.h mingw32/dir.h mon.h net/if_arp.h net/route.h \
+  linux/kernel.h math.h mingw32/dir.h mon.h net/if_arp.h net/route.h \
   os2.h setjmp.h starbase.c.h stddef.h stdio.h synch.h sys/access.h \
   sys/ipc.h sys/m88kbcs.h sys/mman.h sys/mode.h sys/pstat.h sys/resource.h \
   sys/svs.h sys/sysconfig.h sys/syslimits.h sys/sysmacros.h ulocks.h x11/xlibxtra.h \
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 09838e8..31f3fe8 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-docdir = $(prefix)/dx/doc
+docdir = $(datadir)/dx/doc
 
 doc_DATA = \
 	README README_SMP README_alphax README_aviion README_hp700 \
diff --git a/fonts/Makefile.am b/fonts/Makefile.am
index 9055aa4..128cad4 100644
--- a/fonts/Makefile.am
+++ b/fonts/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-fontdir = $(prefix)/dx/fonts
+fontdir = $(datadir)/dx/fonts
 
 font_DATA = \
 	README area.dx cyril_d.dx \
diff --git a/help/Makefile.am b/help/Makefile.am
index 7feff54..3aae993 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-helpdir = $(prefix)/dx/help
+helpdir = $(datadir)/dx/help
 
 EXTRA_DIST = $(helpfiles1) $(helpfiles2) $(helpfiles3) $(helpfiles4) $(helpfiles5)  \
 	$(helpfiles6) $(helpfiles7) $(helpfiles8) $(helpfiles9) $(helpfiles10)  \
@@ -257,7 +257,7 @@ install-data-hook:
 		 $(LN_S) hlpalhtl svsmstrh ; \
 		 $(LN_S) hlpalhtl ugidx ; \
 		 $(LN_S) hlpalhtl usrefidx ; \
-		 $(LN_S) HelpDir GarHelpDir ; \
+		 $(LN_S) HelpDir GARHelpDir ; \
 		 $(LN_S) HelpDir MBHelpDir ; \
 		 echo "cd $(DESTDIR)$(helpdir)" ; \
 		 echo "$(LN_S) hlpalhtl mbidx" ; \
@@ -265,6 +265,6 @@ install-data-hook:
 		 echo "$(LN_S) hlpalhtl svsmstrh" ; \
 		 echo "$(LN_S) hlpalhtl ugidx" ; \
 		 echo "$(LN_S) hlpalhtl usrefidx" ; \
-		 echo "$(LN_S) HelpDir GarHelpDir" ; \
+		 echo "$(LN_S) HelpDir GARHelpDir" ; \
 		 echo "$(LN_S) HelpDir MBHelpDir" ) \
 	'
diff --git a/html/Makefile.am b/html/Makefile.am
index 7e9b3e8..a2352e9 100644
--- a/html/Makefile.am
+++ b/html/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-htmldir = $(prefix)/dx/html
+htmldir = $(datadir)/dx/html
 
 SUBDIRS = pages images
 
diff --git a/html/images/Makefile.am b/html/images/Makefile.am
index c34245f..9ad03e5 100644
--- a/html/images/Makefile.am
+++ b/html/images/Makefile.am
@@ -1,5 +1,5 @@
 
-imagesdir = $(prefix)/dx/html/images
+imagesdir = $(datadir)/dx/html/images
 
 images1 = \
 	3dcurs.gif adctlpt.gif arch.gif autoax.gif autoexp.gif		\
diff --git a/html/pages/Makefile.am b/html/pages/Makefile.am
index 4487d39..49b2bd3 100644
--- a/html/pages/Makefile.am
+++ b/html/pages/Makefile.am
@@ -1,4 +1,4 @@
-pagesdir = $(prefix)/dx/html/pages
+pagesdir = $(datadir)/dx/html/pages
 
 pages1 = \
 	insgu002.htm insgu003.htm insgu004.htm insgu005.htm insgu006.htm \
diff --git a/include/Makefile.am b/include/Makefile.am
index ec87339..04771c3 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,4 +1,4 @@
-dxincdir = $(prefix)/dx/include
+dxincdir = $(prefix)/include
 SUBDIRS = dx
 dxinc_HEADERS = dxl.h dxstereo.h
 nodist_dxinc_HEADERS = dxconfig.h
diff --git a/include/dx/Makefile.am b/include/dx/Makefile.am
index 45ebd6a..fc93323 100644
--- a/include/dx/Makefile.am
+++ b/include/dx/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-dxincdir = $(prefix)/dx/include/dx
+dxincdir = $(prefix)/include/dx
  
 dxinc_HEADERS = \
 	UserInteractors.h advanced.h arch.h array.h arrayhandles.h \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index fba0cd7..e34c871 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,4 +1,4 @@
-libsdir = $(prefix)/dx/lib
+libsdir = $(datadir)/dx/lib
 
 libs_DATA = colors.txt dxexec.def dxexec.exp dxexec.imp dxexec.ifs \
 	dxfSaveCurrentImage.net dxrc mdf2c.awk messages outboard.c
diff --git a/man/Makefile.am b/man/Makefile.am
index 3ec572e..08d8a83 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,4 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = manl catl
+SUBDIRS = manl
 
diff --git a/man/manl/Makefile.am b/man/manl/Makefile.am
index b73bdb0..30cadc3 100644
--- a/man/manl/Makefile.am
+++ b/man/manl/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-mandir = $(prefix)/dx/man
+mandir = $(datadir)/man
 
 man_MANS = dx.l
 EXTRA_DIST = $(man_MANS)
diff --git a/src/exec/Makefile.am b/src/exec/Makefile.am
index 26812d9..438a6fd 100644
--- a/src/exec/Makefile.am
+++ b/src/exec/Makefile.am
@@ -1,6 +1,6 @@
 SUBDIRS = libdx dxmods hwrender dpexec dxexec
 
-dxlibdir = $(prefix)/dx/lib_@ARCH@
+dxlibdir = $(libdir)
 
 MAJOR_VERSION=@MAJOR_VERSION@
 MINOR_VERSION=@MINOR_VERSION@
diff --git a/src/exec/dxexec/Makefile.am b/src/exec/dxexec/Makefile.am
index 17b7c4b..9bc4260 100644
--- a/src/exec/dxexec/Makefile.am
+++ b/src/exec/dxexec/Makefile.am
@@ -9,7 +9,7 @@ noinst_LTLIBRARIES = libDXEXEC.la
 libDXEXEC_la_SOURCES = main.c
 libDXEXEC_la_CFLAGS = $(AM_CFLAGS)
 
-bindir = $(prefix)/dx/bin_@ARCH@
+bindir = $(libdir)/dx/bin_@ARCH@
 bin_PROGRAMS = dxexec
 
 dxexec_LDADD = ../dpexec/libDPEXEC.la ../dxmods/libDXMODS.la ../dxmods/user.lo \
diff --git a/src/exec/dxmods/Makefile.am b/src/exec/dxmods/Makefile.am
index bafde53..4296a2c 100644
--- a/src/exec/dxmods/Makefile.am
+++ b/src/exec/dxmods/Makefile.am
@@ -1,8 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = -I${top_srcdir}/include -I${srcdir}/../dpexec -I$(BUILDBASE)/include -D@ARCH@
+INCLUDES+= -I/usr/include/netcdf
 
-dxmdfdir = $(prefix)/dx/lib
+dxmdfdir = $(datadir)/dx/lib
 noinst_LTLIBRARIES = libDXMODS.la libusercm.la libuser.la libDXMODSN.la
 SUFFIXES = .c .y .c .s .h .o 
 
@@ -13,6 +14,8 @@ DISTCLEANFILES = dx.mdf dxcm.mdf user.c usercm.c tmp.c
 
 dxmdf_DATA = dx.mdf
 
+user.c: dx.mdf
+
 _complex.o: _compparse.h
 
 HEADERS1 = \
diff --git a/src/exec/dxmods/local.mk.in b/src/exec/dxmods/local.mk.in
index 82da029..aa7b1a5 100644
--- a/src/exec/dxmods/local.mk.in
+++ b/src/exec/dxmods/local.mk.in
@@ -14,23 +14,23 @@ user.c:  dx.mdf
 
 dxcm.mdf:  ${srcdir}/dxmdf.src
 	-rm -f dxcm.mdf
-	cp ${srcdir}/dxmdf.src tmp.c
-	$(CPP) $(INCLUDES) $(MDF) $(DEFS) tmp.c > dxcm.mdf
-	-rm -f tmp.c
+	cp ${srcdir}/dxmdf.src dxcm.tmp.c
+	$(CPP) $(INCLUDES) $(MDF) $(DEFS) dxcm.tmp.c > dxcm.mdf
+	-rm -f dxcm.tmp.c
 
 dx.mdf:  ${srcdir}/dxmdf.src
 	echo MYINC: $(MYINC)
 	-rm -f dx.mdf
-	cp ${srcdir}/dxmdf.src tmp.c
-	$(CPP) $(INCLUDES) $(MYINC) $(MDF) $(DEFS) -DCPLUSPLUS_UI -DEXECUTIVE_MODS tmp.c > dx.mdf
+	cp ${srcdir}/dxmdf.src dx.tmp.c
+	$(CPP) $(INCLUDES) $(MYINC) $(MDF) $(DEFS) -DCPLUSPLUS_UI -DEXECUTIVE_MODS dx.tmp.c > dx.mdf
 	@echo '/^ *$$/{' > stripl.sed
 	@echo 'N' >> stripl.sed
 	@echo '/^ *\\n *$$/D' >> stripl.sed
 	@echo '}' >> stripl.sed
-	cat dx.mdf |sed '/^#/d' > tmp.mdf
-	cat tmp.mdf |sed -f stripl.sed > dx.mdf
-	@rm -f stripl.sed tmp.mdf
-	-rm -f tmp.c
+	cat dx.mdf |sed '/^#/d' > dx.tmp.mdf
+	cat dx.tmp.mdf |sed -f stripl.sed > dx.mdf
+	@rm -f stripl.sed dx.tmp.mdf
+	-rm -f dx.tmp.c
 
 .y.h:
 	$(YACC) $(YFLAGS) -d ${srcdir}/$*.y
diff --git a/src/exec/libdx/Makefile.am b/src/exec/libdx/Makefile.am
index 354fb78..c38551d 100644
--- a/src/exec/libdx/Makefile.am
+++ b/src/exec/libdx/Makefile.am
@@ -7,7 +7,7 @@ MICRO_VERSION=@MICRO_VERSION@
 #INCLUDES = -I../../../include  -D@ARCH@
 INCLUDES = -I${top_srcdir}/include  -D@ARCH@
 
-dxlibdir = $(prefix)/dx/lib_@ARCH@
+dxlibdir = $(libdir)
 
 noinst_LTLIBRARIES = libLIBDX.la libcallm.la libmem.la
 #dxlib_LIBRARIES = libDXlite.a 
diff --git a/src/exec/libdx/memory.c b/src/exec/libdx/memory.c
index caa3281..918ad58 100644
--- a/src/exec/libdx/memory.c
+++ b/src/exec/libdx/memory.c
@@ -66,7 +66,6 @@
 
 #if linux
 #include <linux/kernel.h>
-#include <linux/sys.h>
 #include <sys/sysinfo.h>
 #endif
 
diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am
index 5955165..6c12dac 100644
--- a/src/misc/Makefile.am
+++ b/src/misc/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = -I${top_srcdir}/include -D@ARCH@
 
 dxbindir = $(prefix)/bin
 noinst_PROGRAMS = dxlocal
-archmakdir = $(prefix)/dx/lib_$(ARCH)
+archmakdir = $(libdir)
 archmak_DATA = arch.mak
 
 dxlocal_SOURCES = dx.c utils.c
@@ -15,5 +15,5 @@ install-exec-local:
 	if test ! -z "@INSTALL_BIN_PROGRAM@" ; then		         \
 		$(mkinstalldirs) $(prefix)/bin ;                	         \
 		$(INSTALL) dxlocal@EXEEXT@ 				         \
-		$(prefix)/dx/bin_$(ARCH)/@INSTALL_BIN_PROGRAM@@EXEEXT@ ; \
+		$(libdir)/dx/bin_$(ARCH)/@INSTALL_BIN_PROGRAM@@EXEEXT@ ; \
 	fi
diff --git a/src/uipp/dxl/Makefile.am b/src/uipp/dxl/Makefile.am
index a8cf233..5dc1d35 100644
--- a/src/uipp/dxl/Makefile.am
+++ b/src/uipp/dxl/Makefile.am
@@ -7,7 +7,7 @@ MICRO_VERSION=@MICRO_VERSION@
 
 INCLUDES = -I${top_srcdir}/include  -D@ARCH@
 
-dxlibdir = $(prefix)/dx/lib_@ARCH@
+dxlibdir = $(libdir)
 
 noinst_HEADERS = \
 	dxlP.h \
diff --git a/src/uipp/dxui/Makefile.am b/src/uipp/dxui/Makefile.am
index 5247cb0..d4f3936 100644
--- a/src/uipp/dxui/Makefile.am
+++ b/src/uipp/dxui/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES = -I${srcdir}/../base -I${top_srcdir}/include -I${srcdir}/../dxuilib -D@ARCH@
 
-dxbindir = $(prefix)/dx/bin_@ARCH@
+dxbindir = $(libdir)/dx/bin_@ARCH@
 dxbin_PROGRAMS = dxui
 
 
diff --git a/src/uipp/java/Makefile.am b/src/uipp/java/Makefile.am
index d4627d4..a6d039f 100644
--- a/src/uipp/java/Makefile.am
+++ b/src/uipp/java/Makefile.am
@@ -27,12 +27,12 @@
 ## libtool and the -shrext flag to make this much more 
 ## portable.
 
-javadxdir = $(prefix)/dx/java/htmlpages
+javadxdir = $(libdir)/dx/java/htmlpages
 javadx_DATA = dx.jar 
-javasrvdir = $(prefix)/dx/java/server/class
+javasrvdir = $(libdir)/dx/java/server/class
 javasrv_DATA = server.jar 
 EXTRA_DIST = $(DX_SRCS) DXServer.java makeall.java makewrl.java exports.awk README
-javalibdir = $(prefix)/dx/java/server/lib_@ARCH@
+javalibdir = $(libdir)/dx/java/server/lib_@ARCH@
 
 javalib_DATA = @ANYDX@
 SUBDIRS = server dx layout
diff --git a/src/uipp/java/server/Makefile.am b/src/uipp/java/server/Makefile.am
index 24d5d67..6389206 100644
--- a/src/uipp/java/server/Makefile.am
+++ b/src/uipp/java/server/Makefile.am
@@ -1,6 +1,6 @@
-srvbindir = $(prefix)/dx/java/server/bin
-srvoutputdir = $(prefix)/dx/java/output
-userhtmldir = $(prefix)/dx/java/user
+srvbindir = $(libdir)/dx/java/server/bin
+srvoutputdir = $(libdir)/dx/java/output
+userhtmldir = $(libdir)/dx/java/user
 # the server script (in srvbindir) will actually cd and run from the class subdir so that java will find the classes
 # the server will expect to find a file dxserver.paths there to tell the exec where to find .net files
 srvrundir = $(srvbindir)/../class
diff --git a/src/uipp/java/server/macros/Makefile.am b/src/uipp/java/server/macros/Makefile.am
index ac6f36e..829c18a 100644
--- a/src/uipp/java/server/macros/Makefile.am
+++ b/src/uipp/java/server/macros/Makefile.am
@@ -1,6 +1,6 @@
 ##  Process this file with automake to produce Makefile.in
 
-serverdatadir = $(prefix)/dx/java/server/dxmacros
+serverdatadir = $(libdir)/dx/java/server/dxmacros
 
 serverdata_DATA = $(MACRO_FILES)
 
diff --git a/src/uipp/mb/Makefile.am b/src/uipp/mb/Makefile.am
index d15de19..074908d 100644
--- a/src/uipp/mb/Makefile.am
+++ b/src/uipp/mb/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES = -I${top_srcdir}/include -I${srcdir}/../base -I${srcdir}/../widgets -D@ARCH@
 
-dxbindir = $(prefix)/dx/bin_@ARCH@
+dxbindir = $(libdir)/dx/bin_@ARCH@
 
 dxbin_PROGRAMS = builder
 
diff --git a/src/uipp/prompter/Makefile.am b/src/uipp/prompter/Makefile.am
index aabbd69..b5aad8e 100644
--- a/src/uipp/prompter/Makefile.am
+++ b/src/uipp/prompter/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES =  -I${srcdir}/../base -I${top_srcdir}/include -D@ARCH@
 
-dxbindir = $(prefix)/dx/bin_@ARCH@
+dxbindir = $(libdir)/dx/bin_@ARCH@
 
 dxbin_PROGRAMS = prompter
 
diff --git a/src/uipp/startup/Makefile.am b/src/uipp/startup/Makefile.am
index b7c3a6a..e830dbd 100644
--- a/src/uipp/startup/Makefile.am
+++ b/src/uipp/startup/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES =  -I${top_srcdir}/include -I${srcdir}/../base -D@ARCH@
 
-dxbindir = $(prefix)/dx/bin_@ARCH@
+dxbindir = $(libdir)/dx/bin_@ARCH@
 
 dxbin_PROGRAMS = startupui
 
diff --git a/src/uipp/tutor/Makefile.am b/src/uipp/tutor/Makefile.am
index 814de81..610462c 100644
--- a/src/uipp/tutor/Makefile.am
+++ b/src/uipp/tutor/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES = -I${top_srcdir}/include -I${srcdir}/../base -D@ARCH@
 
-dxbindir = $(prefix)/dx/bin_@ARCH@
+dxbindir = $(libdir)/dx/bin_@ARCH@
 
 dxbin_PROGRAMS = tutor
 
diff --git a/src/uipp/ui/Makefile.am b/src/uipp/ui/Makefile.am
index 7a8c0c1..2bf25e5 100644
--- a/src/uipp/ui/Makefile.am
+++ b/src/uipp/ui/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-uidatadir = $(prefix)/dx/ui
+uidatadir = $(datadir)/dx/ui
 
 DATA1 = \
 	icon50.dat icon50.xpm logo.dat logo.xpm ui.mdf Basic2D.cfg Basic2D.net \
-- 
2.9.3