static void init_deprecated () { #ifndef OS_WIN32 // Check for Macaulay 2 if (get_env ("M2HOME") == "") if (exists_in_path ("M2")) { string where= concretize (resolve_in_path ("M2")); string s = var_eval_system ("grep 'M2HOME=' " * where); string dir = s (search_forwards ("=", s) + 1, N(s)); if (dir != "") set_env ("M2HOME", dir); } #endif }
static bool use_converts (url image) { #if defined(__MINGW__) || defined(__MINGW32__) (void) image; return false; #else // NOTE: determine whether we should use image magick. // Indeed, EPSCrop unfortunately does not correctly handle // non trivial offsets of bounding boxes static bool has_image_magick= exists_in_path ("convert"); int bx1, by1, bx2, by2; ps_bounding_box (image, bx1, by1, bx2, by2); return has_image_magick && (bx1 != 0 || by1 != 0); #endif }
bool gs_check (url doc) { if (!exists (gs_executable ()) && !exists_in_path (gs_executable ())) return true; array<string> cmd; cmd << gs_executable (); cmd << string ("-dNOPAUSE"); cmd << string ("-dBATCH"); cmd << string ("-dDEBUG"); cmd << string ("-sDEVICE=nullpage"); cmd << concretize (doc); array<int> out; out << 1; out << 2; //cout << "cmd= " << cmd << LF; array<string> ret= evaluate_system (cmd, array<int> (), array<string> (), out); //cout << "ret= " << ret << LF; if (ret [0] != "0" || ret[2] != "") { //convert_error << ret[1] << LF; convert_error << "for file " << doc << LF; convert_error << ret[2] << LF; return false; } return true; }
bool bibtex_present () { return exists_in_path (bibtex_command); }