Index: configure =================================================================== --- configure.orig +++ configure @@ -36,125 +36,6 @@ case `echo "testing\c"; echo 1,2,3`,`ech *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -# 2. CHECK FOR LATEX - -echo $ECHO_N "Checking for latex ............. $ECHO_C" -whichout=`which latex 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "LATEX_COMMAND=${whichout}" >> Makefile -else - echo "NO" ; echo "ERROR: Required program latex could not be found." >&2 ; exit -fi - -# 3. CHECK FOR CONVERT - -echo $ECHO_N "Checking for ImageMagick convert............ $ECHO_C" -whichout=`which convert 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "CONVERT_COMMAND=${whichout}" >> Makefile -else - echo "NO" ; echo "ERROR: Required program convert could not be found." >&2 ; exit -fi - -# 4. CHECK FOR SED - -echo $ECHO_N "Checking for sed ............. $ECHO_C" -whichout=`which sed 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "SED_COMMAND=${whichout}" >> Makefile -else - echo "NO" ; echo "ERROR: Required program sed could not be found." >&2 ; exit -fi - -# 5. CHECK FOR GUNZIP - -echo $ECHO_N "Checking for gunzip ............. $ECHO_C" -whichout=`which gunzip 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "GUNZIP_COMMAND=-D GUNZIP_COMMAND=\"\\\"${whichout} -c\\\"\"" >> Makefile -else - echo "NO" - echo "GUNZIP_COMMAND=" >> Makefile - echo "WARNING: Gunzip could not be found. Installation will proceed, but Pyxplot will not be able to plot .gz files." >&2 -fi - -# 6. CHECK FOR WGET - -echo $ECHO_N "Checking for wget ............. $ECHO_C" -whichout=`which wget 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "WGET_COMMAND=-D WGET_COMMAND=\"\\\"${whichout} -O -\\\"\"" >> Makefile -else - echo "NO" - echo "WGET_COMMAND=" >> Makefile - echo "WARNING: wget could not be found. Installation will proceed, but Pyxplot will not be able to plot files directly from URLs." >&2 -fi - -# 7. CHECK FOR GHOSTSCRIPT - -echo $ECHO_N "Checking for ghostscript ............. $ECHO_C" -whichout=`which gs 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi -if test "$whichout" != "" ; then - echo "YES" - echo "GS_COMMAND=${whichout}" >> Makefile -else - echo "NO" ; echo "ERROR: Required program ghostscript could not be found." >&2 ; exit -fi - -# 8. FIND GHOSTVIEW - -echo $ECHO_N "Checking for ghostview ............. $ECHO_C" -whichout_gv=`which gv 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout_gv | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout_gv="" ; fi -if test "$whichout_gv" != "" ; then - echo $ECHO_N "YES (gv$ECHO_C" - echo "GV_COMMAND=${whichout_gv}" >> Makefile - if test "`gv --v 2> conf.stderr`" = "" ; then - rm -f conf.* - echo ", single hyphen options)" - echo "GV_OPT=-" >> Makefile - else - rm -f conf.* - echo ", double hyphen options)" - echo "GV_OPT=--" >> Makefile - fi -else - echo "NO" - echo "GV_COMMAND=/bin/false" >> Makefile -fi - -# 9. FIND GGV - -echo $ECHO_N "Checking for ggv ............. $ECHO_C" -whichout_ggv=`which ggv 2> conf.stderr` -rm -f conf.* -if test "`echo $whichout_ggv | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout_ggv="" ; fi -if test "$whichout_ggv" != "" ; then - echo "YES (ggv, don't forget to set \"watch file\" in the viewer preferences!)" - echo "GGV_COMMAND=${whichout_ggv}" >> Makefile -else - echo "NO" - echo "GGV_COMMAND=/bin/false" >> Makefile -fi - # 10. FIND MAKE echo $ECHO_N "Checking for GNU make ............. $ECHO_C" Index: src/children.c =================================================================== --- src/children.c.orig +++ src/children.c @@ -159,7 +159,7 @@ void pplcsp_checkForGvOutput(ppl_context ppl_strRemoveCompleteLine(PipeOutputBuffer, linebuffer); if (linebuffer[0]=='\0') continue; if (strstr(linebuffer, SIGTERM_NAME)!=NULL) continue; - if (strncmp(linebuffer, SED_COMMAND, strlen(SED_COMMAND))==0) ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, "A problem was encounter with the supplied regular expression."); + if (strncmp(linebuffer, "sed", strlen("sed"))==0) ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, "A problem was encounter with the supplied regular expression."); else ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, linebuffer); } return; @@ -504,7 +504,7 @@ void pplcsp_forkSed(ppl_context *context if (dup2(PipeCSP2MAIN[1], STDERR_FILENO) != STDERR_FILENO) ppl_fatal(&context->errcontext,__FILE__,__LINE__,"Could not redirect stderr to pipe."); close(PipeCSP2MAIN[1]); } - if (execl(SED_COMMAND, SED_COMMAND, cmd, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute sed returned error code."); // Execute sed + if (execlp("sed", "sed", cmd, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute sed returned error code."); // Execute sed ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, "Execution of helper process 'sed' failed."); // execlp call should not return exit(1); } @@ -560,7 +560,7 @@ void pplcsp_forkLaTeX(ppl_context *conte if (dup2(fd1[1], STDERR_FILENO) != STDERR_FILENO) ppl_fatal(&context->errcontext,__FILE__,__LINE__,"Could not redirect stderr to pipe."); close(fd1[1]); } - if (execl(LATEX_COMMAND, LATEX_COMMAND, "-file-line-error", filename, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute latex returned error code."); // Execute latex + if (execlp("latex", "latex", "-file-line-error", filename, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute latex returned error code."); // Execute latex ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, "Execution of helper process 'latex' failed."); // execlp call should not return exit(1); } @@ -663,7 +663,7 @@ void pplcsp_forkKpseWhich(ppl_context *c close(PipeCSP2MAIN[1]); } sprintf(CmdLineOpt, "-show-path=.%s", ftype); - if (execl(KPSE_COMMAND, KPSE_COMMAND, CmdLineOpt, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute kpsewhich returned error code."); // Execute kpsewhich + if (execlp("kpsewhich", "kpsewhich", CmdLineOpt, NULL)!=0) if (DEBUG) ppl_log(&context->errcontext,"Attempt to execute kpsewhich returned error code."); // Execute kpsewhich ppl_error(&context->errcontext,ERR_GENERIC, -1, -1, "Execution of helper process 'kpsewhich' failed."); // execlp call should not return exit(1); } Index: Makefile.skel =================================================================== --- Makefile.skel.orig +++ Makefile.skel @@ -126,7 +126,7 @@ FITSHELP_HFILES = $(FITSHELP_HEADERS ALL_HFILES = $(PPL_HFILES) $(PPLW_HFILES) $(FITSHELP_HFILES) -COMMON_SWITCHES = -D VERSION=\"$(VERSION_MAJ).$(VERSION_MIN).$(VERSION_REV)\" -D VERSION_MAJ=$(VERSION_MAJ) -D VERSION_MIN=$(VERSION_MIN) -D VERSION_REV=$(VERSION_REV) -D DATE=\"$(DATE)\" -D PATHLINK=\"$(PATHLINK)\" $(HAVE_READLINE) $(HAVE_FFTW3) $(HAVE_FITSIO) $(HAVE_KPATHSEA) -D LATEX_COMMAND=\"$(LATEX_COMMAND)\" -D KPSE_COMMAND=\"$(KPSE_COMMAND)\" -D CONVERT_COMMAND=\"$(CONVERT_COMMAND)\" -D GHOSTSCRIPT_COMMAND=\"$(GS_COMMAND)\" -D SED_COMMAND=\"$(SED_COMMAND)\" $(GUNZIP_COMMAND) $(WGET_COMMAND) -D GHOSTVIEW_COMMAND=\"$(GV_COMMAND)\" -D GHOSTVIEW_OPT=\"$(GV_OPT)\" -D GGV_COMMAND=\"$(GGV_COMMAND)\" +COMMON_SWITCHES = -D VERSION=\"$(VERSION_MAJ).$(VERSION_MIN).$(VERSION_REV)\" -D VERSION_MAJ=$(VERSION_MAJ) -D VERSION_MIN=$(VERSION_MIN) -D VERSION_REV=$(VERSION_REV) -D DATE=\"$(DATE)\" -D PATHLINK=\"$(PATHLINK)\" $(HAVE_READLINE) $(HAVE_FFTW3) $(HAVE_FITSIO) $(HAVE_KPATHSEA) NOINSTALL_SWITCHES = $(COMMON_SWITCHES) -D SRCDIR=\"$(CWD)/$(LOCAL_SRCDIR)/\" -D DOCDIR=\"$(CWD)/$(LOCAL_DOCDIR)/\" -D PPLBINARY=\"$(CWD)/$(LOCAL_BINDIR)/pyxplot\" -D FITSHELPER=\"$(CWD)/$(LOCAL_BINDIR)/pyxplot_fitshelper\" -D TIMEHELPER=\"$(CWD)/$(LOCAL_BINDIR)/pyxplot_timehelper\" INSTALL_SWITCHES = $(COMMON_SWITCHES) -D SRCDIR=\"$(SRCDIR)\" -D DOCDIR=\"$(DOCDIR)\" -D PPLBINARY=\"$(BINDIR)/pyxplot\" -D FITSHELPER=\"$(BINDIR_PRIVATE)/pyxplot_fitshelper\" -D TIMEHELPER=\"$(BINDIR_PRIVATE)/pyxplot_timehelper\" Index: src/epsMaker/canvasDraw.c =================================================================== --- src/epsMaker/canvasDraw.c.orig +++ src/epsMaker/canvasDraw.c @@ -88,7 +88,7 @@ static int filecopy(EPSComm *x, const ch char *src = GSOutputTemp; \ if ((CanInvert) && (c->set->term_current.TermInvert==SW_ONOFF_ON)) \ { \ - sprintf(c->errcontext.tempErrStr, "%s %s -negate %s", CONVERT_COMMAND, GSOutputTemp, GSOutputTemp2); \ + sprintf(c->errcontext.tempErrStr, "%s %s -negate %s", "convert", GSOutputTemp, GSOutputTemp2); \ if (system(c->errcontext.tempErrStr) != 0) /* Run convert to negate image */ \ { ppl_error(&c->errcontext, ERR_GENERIC, -1, -1, "Error encountered whilst using ImageMagick to generate negated " Y " output"); } \ src = GSOutputTemp2; \ @@ -334,8 +334,8 @@ void ppl_canvas_draw(ppl_context *c, uns else if (termtype==SW_TERMTYPE_X11M) CSPCommand = 1; else if (termtype==SW_TERMTYPE_X11P) CSPCommand = 2; } - if (c->set->term_current.viewer==SW_VIEWER_GV) sprintf(c->errcontext.tempErrStr, "%d%s %swatch %s\n", CSPCommand, GHOSTVIEW_COMMAND, GHOSTVIEW_OPT, comm.EPSFilename); - else if (c->set->term_current.viewer==SW_VIEWER_GGV) sprintf(c->errcontext.tempErrStr, "%d%s --watch %s\n", CSPCommand, GGV_COMMAND, comm.EPSFilename); + if (c->set->term_current.viewer==SW_VIEWER_GV) sprintf(c->errcontext.tempErrStr, "%d%s -watch %s\n", CSPCommand, "gv", comm.EPSFilename); + else if (c->set->term_current.viewer==SW_VIEWER_GGV) sprintf(c->errcontext.tempErrStr, "%d%s --watch %s\n", CSPCommand, "ggv", comm.EPSFilename); else sprintf(c->errcontext.tempErrStr, "%d%s %s\n", CSPCommand, c->set->term_current.ViewerCmd, comm.EPSFilename); pplcsp_sendCommand(c, c->errcontext.tempErrStr); @@ -350,14 +350,14 @@ void ppl_canvas_draw(ppl_context *c, uns } else if (termtype==SW_TERMTYPE_PDF) // PDF terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=pdfwrite -sOutputFile=%s %s", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, GSOutputTemp, comm.EPSFilename); + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=pdfwrite -sOutputFile=%s %s", + GHOSTSCRIPT_STANDARD_FLAGS, GSOutputTemp, comm.EPSFilename); BITMAP_TERMINAL_CLEANUP("ghostscript", "pdf", 0); } else if (termtype==SW_TERMTYPE_PNG) // PNG terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=%s -r%d %s -sOutputFile=%s %s", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=%s -r%d %s -sOutputFile=%s %s", + GHOSTSCRIPT_STANDARD_FLAGS, (c->set->term_current.TermTransparent==SW_ONOFF_ON)?"pngalpha":"png16m", (int)floor(c->set->term_current.dpi), (c->set->term_current.TermAntiAlias==SW_ONOFF_ON)?"-dGraphicsAlphaBits=4 -dTextAlphaBits=4":"-dGraphicsAlphaBits=0 -dTextAlphaBits=0", @@ -366,8 +366,8 @@ void ppl_canvas_draw(ppl_context *c, uns } else if (termtype==SW_TERMTYPE_JPG) // JPEG terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=jpeg -dJPEGQ=100 -r%d %s -sOutputFile=%s %s", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=jpeg -dJPEGQ=100 -r%d %s -sOutputFile=%s %s", + GHOSTSCRIPT_STANDARD_FLAGS, (int)floor(c->set->term_current.dpi), (c->set->term_current.TermAntiAlias==SW_ONOFF_ON)?"-dGraphicsAlphaBits=4 -dTextAlphaBits=4":"-dGraphicsAlphaBits=0 -dTextAlphaBits=0", GSOutputTemp, comm.EPSFilename); @@ -376,7 +376,7 @@ void ppl_canvas_draw(ppl_context *c, uns else if (termtype==SW_TERMTYPE_GIF) // GIF terminal { sprintf(c->errcontext.tempErrStr, "%s -density %d %s %s %s %s", - CONVERT_COMMAND, + "convert", (int)floor(c->set->term_current.dpi), (c->set->term_current.TermTransparent==SW_ONOFF_ON)?"-alpha activate":"-alpha deactivate", (c->set->term_current.TermAntiAlias==SW_ONOFF_ON)?"-antialias":"+antialias", @@ -385,8 +385,8 @@ void ppl_canvas_draw(ppl_context *c, uns } else if (termtype==SW_TERMTYPE_BMP) // BMP terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=bmp16m -r%d %s -sOutputFile=%s %s", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=bmp16m -r%d %s -sOutputFile=%s %s", + GHOSTSCRIPT_STANDARD_FLAGS, (int)floor(c->set->term_current.dpi), (c->set->term_current.TermAntiAlias==SW_ONOFF_ON)?"-dGraphicsAlphaBits=4 -dTextAlphaBits=4":"-dGraphicsAlphaBits=0 -dTextAlphaBits=0", GSOutputTemp, comm.EPSFilename); @@ -394,8 +394,8 @@ void ppl_canvas_draw(ppl_context *c, uns } else if (termtype==SW_TERMTYPE_TIF) // TIF terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=tiff24nc -r%d %s -sOutputFile=%s %s", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=tiff24nc -r%d %s -sOutputFile=%s %s", + GHOSTSCRIPT_STANDARD_FLAGS, (int)floor(c->set->term_current.dpi), (c->set->term_current.TermAntiAlias==SW_ONOFF_ON)?"-dGraphicsAlphaBits=4 -dTextAlphaBits=4":"-dGraphicsAlphaBits=0 -dTextAlphaBits=0", GSOutputTemp, comm.EPSFilename); @@ -403,8 +403,8 @@ void ppl_canvas_draw(ppl_context *c, uns } else if (termtype==SW_TERMTYPE_SVG) // SVG terminal { - sprintf(c->errcontext.tempErrStr, "%s %s -sDEVICE=svg -sOutputFile=%s %s > /dev/null 2> /dev/null", - GHOSTSCRIPT_COMMAND, GHOSTSCRIPT_STANDARD_FLAGS, + sprintf(c->errcontext.tempErrStr, "gs %s -sDEVICE=svg -sOutputFile=%s %s > /dev/null 2> /dev/null", + GHOSTSCRIPT_STANDARD_FLAGS, GSOutputTemp, comm.EPSFilename); BITMAP_TERMINAL_CLEANUP("ghostscript", "svg", 0) } Index: src/settings/settingsInit.c =================================================================== --- src/settings/settingsInit.c.orig +++ src/settings/settingsInit.c @@ -334,15 +334,11 @@ void pplset_makedefault(ppl_context *con pplObjStr(&tempval,0,0,TIMEHELPER); ppl_dictAppend(s->filters, "*.log", pplObjCpy(NULL,&tempval,0,1,1)); #endif - #ifdef GUNZIP_COMMAND - pplObjStr(&tempval,0,0,GUNZIP_COMMAND); + pplObjStr(&tempval,0,0,"gunzip -c"); ppl_dictAppend(s->filters, "*.gz", pplObjCpy(NULL,&tempval,0,1,1)); - #endif - #ifdef WGET_COMMAND - pplObjStr(&tempval,0,0,WGET_COMMAND); + pplObjStr(&tempval,0,0,"wget -O -"); ppl_dictAppend(s->filters, "http://*", pplObjCpy(NULL,&tempval,0,1,1)); ppl_dictAppend(s->filters, "ftp://*", pplObjCpy(NULL,&tempval,0,1,1)); - #endif // Set up empty lists of arrows and labels s->pplarrow_list = s->pplarrow_list_default = NULL; Index: src/epsMaker/eps_eps.c =================================================================== --- src/epsMaker/eps_eps.c.orig +++ src/epsMaker/eps_eps.c @@ -77,7 +77,7 @@ void eps_eps_RenderEPS(EPSComm *x) { char command[LSTR_LENGTH], tmpdata[FNAME_LENGTH]; sprintf(tmpdata, "%s%s%s", x->c->errcontext.session_default.tempdir, PATHLINK, "bbox_in"); // Temporary file for gs to output bounding box into - sprintf(command, "%s -dQUIET -dSAFER -dBATCH -dNOPAUSE -sDEVICE=bbox %s > %s 2> %s", GHOSTSCRIPT_COMMAND, filename, tmpdata, tmpdata); + sprintf(command, "gs -dQUIET -dSAFER -dBATCH -dNOPAUSE -sDEVICE=bbox %s > %s 2> %s", filename, tmpdata, tmpdata); if (system(command)) if (DEBUG) { ppl_log(&x->c->errcontext, "Ghostscript returned non-zero return value."); } inf = fopen(tmpdata, "r"); if (inf==NULL) { sprintf(x->c->errcontext.tempErrStr, "Could not open temporary file '%s'.", tmpdata); ppl_error(&x->c->errcontext, ERR_FILE, -1, -1, x->c->errcontext.tempErrStr); *(x->status) = 1; return; } Index: src/pyxplot.c =================================================================== --- src/pyxplot.c.orig +++ src/pyxplot.c @@ -110,9 +110,7 @@ int main(int argc, char **argv) // Set default terminal EnvDisplay = getenv("DISPLAY"); // Check whether the environment variable DISPLAY is set - if (strcmp(GHOSTVIEW_COMMAND, "/bin/false")!=0) context->set->term_current.viewer = context->set->term_default.viewer = SW_VIEWER_GV; - else if (strcmp(GGV_COMMAND , "/bin/false")!=0) context->set->term_current.viewer = context->set->term_default.viewer = SW_VIEWER_GGV; - else context->set->term_current.viewer = context->set->term_default.viewer = SW_VIEWER_NULL; + context->set->term_current.viewer = context->set->term_default.viewer = SW_VIEWER_GV; // Initialise settings and read configuration file; do this BEFORE processing command-line arguments which take precedence if (DEBUG) ppl_log(&context->errcontext,"Reading configuration file."); Index: src/commands/set.c =================================================================== --- src/commands/set.c.orig +++ src/commands/set.c @@ -2000,9 +2000,7 @@ void ppl_directive_set(ppl_context *c, p if (command[PARSE_set_viewer_auto_viewer].objType == PPLOBJ_STR) { int viewerOld = c->set->term_current.viewer; - if (strcmp(GHOSTVIEW_COMMAND, "/bin/false")!=0) c->set->term_current.viewer = SW_VIEWER_GV; - else if (strcmp(GGV_COMMAND , "/bin/false")!=0) c->set->term_current.viewer = SW_VIEWER_GGV; - else c->set->term_current.viewer = SW_VIEWER_NULL; + c->set->term_current.viewer = SW_VIEWER_GV; changedViewer = (viewerOld != c->set->term_current.viewer); } else