diff -Nurd -x'*~' xfig.3.2.5b.orig/Imakefile xfig.3.2.5b/Imakefile --- xfig.3.2.5b.orig/Imakefile 2009-03-30 11:53:05.000000000 -0400 +++ xfig.3.2.5b/Imakefile 2012-09-23 15:08:52.000000000 -0400 @@ -30,9 +30,9 @@ XCOMM Also, you may have to uncomment and redefine MKDIRHIER because "make" looks XCOMM for it relative to the BINDIR variable. XCOMM -XCOMM BINDIR = /usr/bin -XCOMM MKDIRHIER = /bin/sh /usr/bin/X11/mkdirhier -p -MKDIRHIER = mkdirhier +BINDIR = $(PREFIX)/bin +MKDIRHIER = /bin/sh @FINKPREFIX@/lib/xmkmf/bin/mkdirhier +XCOMM MKDIRHIER = mkdirhier XCOMM Uncomment and change XAPPLOADDIR to the directory where you want the XCOMM app-defaults resource files to go. You will have to use the environment @@ -45,7 +45,7 @@ XCOMM different tree than the "correct" tree that your X system expects. The usual XCOMM purpose of DESTDIR is to test an install process by installing in a benign area. -XCOMM XAPPLOADDIR = /home/user/xfig +XAPPLOADDIR = $(PREFIX)/etc/app-defaults XCOMM Comment out the following definition for XAW3D if you don't to want to use XCOMM the 3d Athena Widget Set @@ -60,7 +60,7 @@ XCOMM some new features, including "Tips", which replace xfig's "help balloons" XCOMM NOTE: This is the default for many X systems now. -XCOMM #define XAW3D1_5E +#define XAW3D1_5E #ifdef XAW3D1_5E DUSEXAW3D = -DXAW3D -DXAW3D1_5E @@ -75,8 +75,8 @@ XCOMM Redefine the following if your PNG library, zlib library and/or include file XCOMM are in different places -PNGLIBDIR = $(USRLIBDIR) -PNGINC = -I/usr/local/include +PNGLIBDIR = $(PREFIX)/lib +PNGINC = -I$(PREFIX)/include ZLIBDIR = $(USRLIBDIR) XCOMM If don't want JPEG support, comment out the #define USEJPEG line @@ -95,13 +95,13 @@ #define USEINSTALLEDJPEG #ifdef USEJPEG - #ifdef USEINSTALLEDJPEG - JPEGLIBDIR = /usr/local/lib - JPEGINC = -I/usr/include/X11 - #else +#ifdef USEINSTALLEDJPEG + JPEGLIBDIR = $(PREFIX)/lib + JPEGINC = -I$(PREFIX)/include +#else JPEGLIBDIR = ../jpeg JPEGINC = -I$(JPEGLIBDIR) - #endif /* USEINSTALLEDJPEG */ +#endif /* USEINSTALLEDJPEG */ #endif /* USEJPEG */ XCOMM Uncomment the #define for USEXPM if you want to use the XPM @@ -119,8 +119,8 @@ #define USEXPM_ICON #ifdef USEXPM -XPMLIBDIR = /usr/local/lib -XPMINC = -I/usr/local/include/X11 +XPMLIBDIR = /usr/X11R6/lib +XPMINC = -I/usr/X11R6/include/X11 #endif XCOMM Uncomment the following definiton if you want to use the small icons @@ -166,14 +166,14 @@ XCOMM use (and change) the following if you want the multi-key data base file XCOMM somewhere other than the standard X11 library directory XCOMM be sure to comment out the second copy of XFIGLIBDIR if you use this one -XCOMM XFIGLIBDIR = $(LIBDIR) +XFIGLIBDIR = $(PREFIX)/share/xfig XCOMM use this if you want the multi-key data base file in the standard X11 tree -XFIGLIBDIR = $(LIBDIR)/xfig +XCOMM XFIGLIBDIR = $(LIBDIR)/xfig XCOMM XFIGDOCDIR tells where the html and pdf documentation should go -XCOMM XFIGDOCDIR = $(DOCDIR)/xfig -XFIGDOCDIR = /usr/local/xfig/doc +XFIGDOCDIR = $(PREFIX)/share/doc/xfig +XCOMM XFIGDOCDIR = /usr/local/xfig/doc XCOMM MANDIR tells where the standard man pages should go (no need to change it XCOMM if you want the man pages installed in the standard place on your system @@ -221,7 +221,7 @@ XCOMM If you want a compiler other than "cc", define it here -XCOMM CC = /opt/SUNWspro/bin/cc +CC = cc XCOMM Shorten unnecessary dependencies: XCOMM #define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWCLIENTLIBS) $(XLIB) @@ -278,7 +278,7 @@ DUSESMALLICONS = -DUSE_SMALL_ICONS #endif /* USESMALLICONS */ -PNGLIBS = -L$(PNGLIBDIR) -lpng -L$(ZLIBDIR) -lz +PNGLIBS = -L$(PNGLIBDIR) @FINKPREFIX@/lib/libpng.dylib -L$(ZLIBDIR) -lz #ifdef USEJPEG DUSEJPEG = -DUSE_JPEG @@ -353,7 +353,7 @@ SRCS = $(XFIGSRC) OBJS = $(XFIGOBJ) -EXTRA_INCLUDES = $(JPEGINC) $(PNGINC) $(XPMINC) -I. +EXTRA_INCLUDES = -I. $(JPEGINC) $(PNGINC) -I$(PREFIX)/include/freetype2 $(XPMINC) DEPLIBS = XawClientDepLibs LOCAL_LIBRARIES = $(JPEGLIB) diff -Nurd -x'*~' xfig.3.2.5b.orig/f_util.c xfig.3.2.5b/f_util.c --- xfig.3.2.5b.orig/f_util.c 2009-03-30 11:52:18.000000000 -0400 +++ xfig.3.2.5b/f_util.c 2012-09-23 14:05:58.000000000 -0400 @@ -781,7 +781,7 @@ else strcpy(dirname, "."); if (access(dirname, W_OK) == 0) { /* OK - the directory is writable */ - sprintf(unc, "gunzip -q %s", name); + sprintf(unc, "gunzip -q -- %s", name); if (system(unc) != 0) file_msg("Couldn't uncompress the file: \"%s\"", unc); strcpy(name, plainname); @@ -792,7 +792,7 @@ sprintf(tmpfile, "%s%s", TMPDIR, c); else sprintf(tmpfile, "%s/%s", TMPDIR, plainname); - sprintf(unc, "gunzip -q -c %s > %s", name, tmpfile); + sprintf(unc, "gunzip -q -c -- %s > %s", name, tmpfile); if (system(unc) != 0) file_msg("Couldn't uncompress the file: \"%s\"", unc); file_msg ("Uncompressing file %s in %s because it is in a read-only directory", diff -Nurd -x'*~' xfig.3.2.5b.orig/fig.h xfig.3.2.5b/fig.h --- xfig.3.2.5b.orig/fig.h 2008-05-27 13:39:00.000000000 -0400 +++ xfig.3.2.5b/fig.h 2012-09-23 14:16:50.000000000 -0400 @@ -374,6 +374,9 @@ extern long random(); extern void srandom(unsigned int); +#elif defined(__DARWIN__) +#include + #elif !defined(__osf__) && !defined(__CYGWIN__) && !defined(linux) && !defined(__FreeBSD__) && !defined(__GLIBC__) extern void srandom(int); diff -Nurd -x'*~' xfig.3.2.5b.orig/main.c xfig.3.2.5b/main.c --- xfig.3.2.5b.orig/main.c 2009-03-30 11:52:18.000000000 -0400 +++ xfig.3.2.5b/main.c 2012-09-23 13:54:25.000000000 -0400 @@ -629,7 +629,7 @@ int setup_visual (int *argc_p, char **argv, Arg *args); void get_pointer_mapping (void); -void main(int argc, char **argv) +int main(int argc, char **argv) { Widget children[NCHILDREN]; XEvent event; diff -Nurd -x'*~' xfig.3.2.5b.orig/w_export.c xfig.3.2.5b/w_export.c --- xfig.3.2.5b.orig/w_export.c 2007-09-19 15:32:30.000000000 -0400 +++ xfig.3.2.5b/w_export.c 2012-09-23 16:38:06.000000000 -0400 @@ -1016,7 +1016,7 @@ /* set global state */ print_hpgl_pcl_switch = state; - return; + return 0; } static XtCallbackProc @@ -1038,7 +1038,7 @@ /* set global state */ hpgl_specified_font = state; - return; + return 0; } void create_export_panel(Widget w) diff -Nurd -x'*~' xfig.3.2.5b.orig/w_keyboard.c xfig.3.2.5b/w_keyboard.c --- xfig.3.2.5b.orig/w_keyboard.c 2008-05-20 15:38:18.000000000 -0400 +++ xfig.3.2.5b/w_keyboard.c 2012-09-23 14:43:32.000000000 -0400 @@ -41,7 +41,7 @@ #define REG_NOERROR REG_OKAY #endif -#if defined(__FreeBSD__) && !defined(REG_NOERROR) +#if !defined(REG_NOERROR) #define REG_NOERROR 0 #endif diff -Nurd -x'*~' xfig.3.2.5b.orig/w_print.c xfig.3.2.5b/w_print.c --- xfig.3.2.5b.orig/w_print.c 2009-04-20 12:26:14.000000000 -0400 +++ xfig.3.2.5b/w_print.c 2012-09-23 16:38:06.000000000 -0400 @@ -1185,7 +1185,7 @@ /* which button */ which = (int) XawToggleGetCurrent(w); if (which == 0) /* no buttons on, in transition so return now */ - return; + return 0; if (which == 2) /* "blank" button, invert state */ state = !state; @@ -1193,7 +1193,7 @@ print_all_layers = state; update_figure_size(); - return; + return 0; } /* when user toggles between printing all or only active layers */ @@ -1216,6 +1216,7 @@ /* set global */ bound_active_layers = state; update_figure_size(); + return 0; } diff -Nurd -x'*~' xfig.3.2.5b.orig/w_util.c xfig.3.2.5b/w_util.c --- xfig.3.2.5b.orig/w_util.c 2009-03-30 11:52:38.000000000 -0400 +++ xfig.3.2.5b/w_util.c 2012-09-23 16:38:06.000000000 -0400 @@ -710,7 +710,7 @@ /* keep track of which one the user is pressing */ cur_spin = widget; - return; + return 0; } static XtEventHandler @@ -718,7 +718,7 @@ { XtRemoveTimeOut(auto_spinid); - return; + return 0; } static XtTimerCallbackProc @@ -729,7 +729,7 @@ /* call the proper spinup/down routine */ XtCallCallbacks(cur_spin, XtNcallback, 0); - return; + return 0; } /***************************/ @@ -1412,7 +1412,7 @@ } SetValues(w); - return; + return 0; } /* assemble main window title bar with xfig title and (base) file name */