From 818b1dfea785e615317b6bf2e1a8e44352d9088c Mon Sep 17 00:00:00 2001 From: alfredoport Date: Sat, 9 Aug 2008 15:02:56 +0000 Subject: Do not start hyperdoc/graphics if OpenAxiom was build without X suppport. --- src/ChangeLog | 6 ++++++ src/sman/sman.c | 35 ++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1c000d43..dd89775b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2008-08-09 Alfredo Portes + Gabriel Dos Reis + + * sman/sman.c: Do not start hyperdoc/graphics + if OpenAxiom was build without X support. + 2008-08-09 Gabriel Dos Reis * input/grpthry.input.pamphlet: Fix typo. diff --git a/src/sman/sman.c b/src/sman/sman.c index 013e9c78..ed44bd36 100644 --- a/src/sman/sman.c +++ b/src/sman/sman.c @@ -158,12 +158,20 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) start_clef = 0; else if (strcmp(argv[arg], "-clef") == 0) start_clef = 1; - else if (strcmp(argv[arg], "-gr") == 0) - start_graphics = 1; + else if (strcmp(argv[arg], "-gr") == 0) { + if (X_DISPLAY_MISSING) + fprintf(stderr, "OpenAxiom was not build with Graphics support.\n"); + else + start_graphics = 1; + } else if (strcmp(argv[arg], "-nogr") == 0) start_graphics = 0; - else if (strcmp(argv[arg], "-ht") == 0) - start_ht = 1; + else if (strcmp(argv[arg], "-ht") == 0) { + if (X_DISPLAY_MISSING) + fprintf(stderr, "OpenAxiom was not build with HyperDoc support.\n"); + else + start_ht = 1; + } else if (strcmp(argv[arg], "-noht") == 0) start_ht = 0; else if (strcmp(argv[arg], "-iw") == 0) @@ -176,14 +184,13 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) start_spadclient = 0; else if (strcmp(argv[arg], "-comp") == 0) ws_path = "$AXIOM/etc/images/comp"; - else if (strcmp(argv[arg], "-nox") == 0) - { + else if (strcmp(argv[arg], "-nox") == 0) { use_X = 0; start_local_spadclient = 1; start_spadclient = 0; start_ht = 0; start_graphics = 0; - } + } else if (strcmp(argv[arg], "-clefprog") == 0) { strcpy(ClefCommandLine,argv[++arg]); ClefProgram = @@ -205,6 +212,20 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) command->core_argv = argv; command->core_argc = other; argv[++other] = NULL; + +/* If there were no X libraries + * at build-time, we proceed to + * overwrite the defaults startup + * values to not start any of the + * graphical components of + * OpenAxiom (Hyperdoc, Graphics). */ + + if (X_DISPLAY_MISSING) { + use_X = 0; + start_local_spadclient = 1; + start_ht = 0; + start_graphics = 0; + } } static int -- cgit v1.2.3