--- make/ivcommondefs.orig	2005-08-31 14:34:30.000000000 -0500
+++ make/ivcommondefs	2005-08-31 14:37:40.000000000 -0500
@@ -98,26 +98,27 @@
 
 CC  = /usr/bin/gcc
 C++ = /usr/bin/g++
-LD  = /usr/bin/libtool
+LD  = /usr/bin/g++
 
 ARFLAGS = vrs
 INSTALL = /usr/bin/install
 
-LCXXDEFS += $(MATHDEFS)
-LCDEFS += $(MATHDEFS)
+# Don't use MATHDEFS with gcc 3.3+
+#LCXXDEFS += $(MATHDEFS)
+#LCDEFS += $(MATHDEFS)
 
-DARWINOPTS = -dynamic -fno-common
+DARWINOPTS = -dynamic -fPIC -fno-common
 LCXXOPTS += $(DARWINOPTS)
 LCOPTS += $(DARWINOPTS)
 
 X11DIR = /usr/X11R6
-X11INCDIR = $(X11DIR)/include
-X11LIBDIR = $(X11DIR)/lib
+X11INCDIR = $(X11DIR)/include -I__PREFIX__/include
+X11LIBDIR = $(X11DIR)/lib -L__PREFIX__/lib
 
 LCXXINCS += -I$(X11INCDIR)
 LCINCS += -I$(X11INCDIR) -I$(X11INCDIR)/freetype2
 
-LDDSOOPTS += -dynamic -all_load -L$(X11LIBDIR)
-LDOPTS += -multiply_defined suppress -L$(X11LIBDIR)
+LDDSOOPTS += -dynamiclib -all_load -L$(X11LIBDIR)
+LDOPTS += -bind_at_load -multiply_defined suppress -L$(X11LIBDIR)
 CXXDSOOPTS += -bundle -flat_namespace -undefined suppress -L$(X11LIBDIR)
 
@@ -133,7 +134,7 @@
 
 OPTIMIZER = -O -DNDEBUG
 ifneq (, $(findstring debug, $(LIBTYPE)))
-OPTIMIZER = -g
+OPTIMIZER = -g -DDEBUG
 endif
 
 
@@ -183,7 +184,7 @@
 # Inventor install directories.
 #
 
-IVPREFIX = /usr
+IVPREFIX = __PREFIX__
 LCXXOPTS += -DIVPREFIX=\"$(IVPREFIX)\"
 LCOPTS += -DIVPREFIX=\"$(IVPREFIX)\"
 
@@ -192,11 +193,11 @@
 IVDLIBDIR = $(IVLIBDIR)/InventorDebug
 IVHDRTOP = $(IVROOT)/$(IVPREFIX)/include/Inventor
 IVHDRDIR = $(IVHDRTOP)/$(HDRSUBDIR)
-IVMAN1DIR = $(IVROOT)/$(IVPREFIX)/man/man1
-IVMAN3DIR = $(IVROOT)/$(IVPREFIX)/man/man3
-IVHELPDIR = $(IVROOT)/$(IVPREFIX)/share/help
-IVDATADIR = $(IVROOT)/$(IVPREFIX)/share/data/models
-IVDEMODIR = $(IVROOT)/$(IVPREFIX)/demos
+IVMAN1DIR = $(IVROOT)/$(IVPREFIX)/share/man/man1
+IVMAN3DIR = $(IVROOT)/$(IVPREFIX)/share/man/man3
+IVHELPDIR = $(IVROOT)/$(IVPREFIX)/share/inventor/help
+IVDATADIR = $(IVROOT)/$(IVPREFIX)/share/inventor/data/models
+IVDEMODIR = $(IVROOT)/$(IVPREFIX)/share/inventor/demos
 IVDEMOBINDIR = $(IVDEMODIR)/Inventor
 IVDEMODATADIR = $(IVDEMODIR)/data/Inventor
 
