Fix our use of $em_tab_dist after it was changed to 0 for 'turned of'.
[nedit.git] / util / check_lin_tif.c
blobaa0e8d58ad7c9ec1a64c4d09bf17110d738b22ad
1 /*******************************************************************************
2 * *
3 * verifyMotif: A small test program to detect bad versions of LessTif and *
4 * Open Motif. Written on linux but should be portable. *
5 * *
6 * Copyright (C) 2003 Nathaniel Gray *
7 * *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute version of this program linked to *
12 * Motif or Open Motif. See README for details. *
13 * *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
17 * for more details. *
18 * *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
22 * *
23 * Nirvana Text Editor *
24 * July 28, 1992 *
25 * *
26 * Written by Nathaniel Gray *
27 * *
28 * Modifications by: *
29 * Scott Tringali *
30 * *
31 *******************************************************************************/
33 #include <Xm/Xm.h>
34 #include "motif.h"
35 #include <stdio.h>
36 #include <stdlib.h>
38 /* Print out a message listing the known-good versions */
40 static void showGoodVersions(void)
42 fputs("\nNEdit is known to work with Motif versions:\n", stderr);
43 fputs(GetMotifStableVersions(), stderr);
45 fputs(
46 "OpenMotif is available from:\n"
47 "\thttp://www.opengroup.org/openmotif/\n"
48 "\thttp://www.ist.co.uk/DOWNLOADS/motif_download.html\n"
49 "\nAlso, unless you need a customized NEdit you should STRONGLY\n"
50 "consider downloading a pre-built binary from http://www.nedit.org,\n"
51 "since these are the most stable versions.\n", stderr);
55 ** Main test driver. Check the stability, and allow overrides if needed.
57 int main(int argc, const char *argv[])
59 enum MotifStability stability = GetMotifStability();
61 if (stability == MotifKnownGood)
62 return EXIT_SUCCESS;
64 if (stability == MotifKnownBad)
66 fprintf(stderr,
67 "ERROR: Bad Motif Version:\n\t%s\n",
68 XmVERSION_STRING);
70 fprintf(stderr,
71 "\nThis version of Motif is known to be broken and is\n"
72 "thus unsupported by the NEdit developers. It will probably\n"
73 "cause NEdit to crash frequently. Check these pages for a more\n"
74 "detailed description of the problems with this version:\n"
75 "\thttp://www.motifdeveloper.com/tips/tip22.html\n"
76 "\thttp://www.motifdeveloper.com/tips/Motif22Review.pdf\n");
78 #ifdef BUILD_BROKEN_NEDIT
80 char buf[2];
81 fprintf(stderr,
82 "\n========================== WARNING ===========================\n"
83 "You have chosen to build NEdit with a known-bad version of Motif,\n"
84 "risking instability and probable data loss. You are very brave!\n"
85 "Please do not report bugs to the NEdit developers unless you can\n"
86 "reproduce them with a known-good NEdit binary downloaded from:\n"
87 "\thttp://www.nedit.org\n"
88 "\nHIT ENTER TO CONTINUE\n");
89 fgets(buf, 2, stdin);
90 return EXIT_SUCCESS;
92 #else
93 showGoodVersions();
95 fprintf(stderr,
96 "\nIf you really want to build a known-bad version of NEdit you\n"
97 "can override this sanity check by adding -DBUILD_BROKEN_NEDIT\n"
98 "to the CFLAGS variable in your platform's Makefile (e.g.\n"
99 "makefiles/Makefile.linux)\n");
100 #endif
103 if (stability == MotifUnknown)
105 /* This version is neither known-good nor known-bad */
106 fprintf(stderr,
107 "ERROR: Untested Motif Version:\n\t%s\n",
108 XmVERSION_STRING);
110 fprintf(stderr,
111 "You are attempting to build NEdit with a version of Motif that\n"
112 "has not been verified to work well with NEdit. This could be fine,\n"
113 "but it could also lead to crashes and instability. Historically, \n"
114 "older versions of Motif have quite often been more stable\n"
115 "than newer versions when used with NEdit, so don't assume newer\n"
116 "is better.\n");
118 #ifdef BUILD_UNTESTED_NEDIT
120 char buf[2];
121 fprintf(stderr,
122 "\n========================== WARNING ===========================\n"
123 "You have chosen to build NEdit with an untested version of Motif.\n"
124 "Please report your success or failure with this version to:\n"
125 "\tdevelop@nedit.org\n"
126 "\nHIT ENTER TO CONTINUE\n");
127 fgets(buf, 2, stdin);
128 return EXIT_SUCCESS;
130 #else
131 showGoodVersions();
133 fprintf(stderr,
134 "\nIf you really want to build an untested version of NEdit you\n"
135 "can override this sanity check by adding -DBUILD_UNTESTED_NEDIT\n"
136 "to the CFLAGS variable in your platform's Makefile (e.g.\n"
137 "makefiles/Makefile.linux)\n");
138 #endif
141 return EXIT_FAILURE;