diff options
author | Remco Treffkorn <remco@rvt.com> | 1999-07-17 23:03:47 +0000 |
---|---|---|
committer | Remco Treffkorn <remco@rvt.com> | 1999-07-17 23:03:47 +0000 |
commit | f632377e259aa6656057e238e73051121e2d2478 (patch) | |
tree | 564da23d7331d6cb90ecea5c37ab1550080d71a4 | |
parent | 6ac8d7649f528969ce98a8067bcf6aaa749b8b10 (diff) | |
download | gpsd-f632377e259aa6656057e238e73051121e2d2478.tar.gz |
*** empty log message ***
-rw-r--r-- | Makefile.in | 9 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | README.EarthMate | 5 | ||||
-rw-r--r-- | Tachometer.c | 741 | ||||
-rw-r--r-- | Tachometer.h | 56 | ||||
-rw-r--r-- | TachometerP.h | 61 | ||||
-rw-r--r-- | XGpsSpeed | 17 | ||||
-rwxr-xr-x | configure | 3356 | ||||
-rw-r--r-- | configure.in | 26 | ||||
-rw-r--r-- | em.c | 326 | ||||
-rw-r--r-- | gpsd.c | 27 | ||||
-rw-r--r-- | gpsd.lsm | 6 | ||||
-rw-r--r-- | nmea.h | 25 | ||||
-rw-r--r-- | tm.c | 2 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | xgpsspeed.c | 196 | ||||
-rw-r--r-- | xgpsspeed.h | 10 | ||||
-rw-r--r-- | xgpsspeed.icon | 33 |
18 files changed, 1504 insertions, 3400 deletions
diff --git a/Makefile.in b/Makefile.in index 75d0f59d..38b3e8f3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,6 +75,9 @@ LIBGEN = @LIBGEN@ # X toolkit library. (-lXt) LIBXT = @XT_LIBS@ +# Xaw library. (-lXaw) +LIBXAW = @XAW_LIBS@ + # X library. (-lSM -lICE -lX11 -lnsl -lsocket) LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@ @@ -108,9 +111,10 @@ LIB_OBJECTS = netlib.o nmea_parse.o serial.o tm.o em.o $(MOTIF_OBJECTS) PROGRAMS=gpsd ## Motif dependent programs and object files -@MISSING_MOTIF@MOTIF_PROGRAMS=gps +@MISSING_MOTIF@MOTIF_PROGRAMS=gps xgpsspeed @MISSING_MOTIF@MOTIF_OBJECTS = display.o +XGPSOBJS=xgpsspeed.o Tachometer.o all: $(PROGRAMS) $(MOTIF_PROGRAMS) @@ -120,6 +124,9 @@ gpsd: gpsd.o libgpsd.a gps: gps.o libgpsd.a $(LINK.c) -o $@ gps.o -L. -lgpsd $(ALL_X_LIBS) $(LIBS) +xgpsspeed: $(XGPSOBJS) + $(LINK.c) -o $@ $(XGPSOBJS) -L. -lgpsd $(LIBXAW) $(ALL_X_LIBS) $(LIBS) + libgpsd.a: $(LIB_OBJECTS) ar -r libgpsd.a $(LIB_OBJECTS) ranlib libgpsd.a @@ -55,9 +55,13 @@ He also changed the configuration method from Imake to GNU autoconf. This made it easy to port the code to YOUR particular platform. +Derrick J Brashear <shadow@dementia.org> added code for the +EarthMate DeLame. He also added "incredibly gross code to output +NMEA sentences" (his own words :-) + Be advised: any bugs in this code are mine, and mine only ;-) -This is as it stands today, March 4 1999. +This is as it stands today, July 17 1999. remco@emc.rvt.com diff --git a/README.EarthMate b/README.EarthMate new file mode 100644 index 00000000..6d87fa63 --- /dev/null +++ b/README.EarthMate @@ -0,0 +1,5 @@ + +You have to set the serial port speed to 9600 baud. +This is done with the "-s 9600" option. +Nothing will work, if you forget this. + diff --git a/Tachometer.c b/Tachometer.c new file mode 100644 index 00000000..9c952892 --- /dev/null +++ b/Tachometer.c @@ -0,0 +1,741 @@ +/* + * Tachometer Widget Implementation + * + * Author: Kazuhiko Shutoh, 1989. + * Revised by Shinji Sumimoto, 1989/9 (xtachos) + * + * Permission to use, copy, modify and distribute without charge this software, + * documentation, images, etc. is granted, provided that this comment and the + * author's name is retained. The author assumes no responsibility for lost + * sleep as a consequence of use of this software. + * + * Send any comments, bug reports, etc. to shutoh@isl.yamaha.JUNET + * + * + * Modifications : ilham@mit.edu (July 10 '90) + */ + + +#define XtStrlen(s) ((s) ? strlen(s) : 0) + +#include <X11/IntrinsicP.h> +#include <X11/StringDefs.h> +#include <TachometerP.h> +#include <math.h> + +/**************************************************************** + * + * Full class record constant + * + ****************************************************************/ + +/* Private Data */ + +#define PI 3.1415927 + +typedef struct { + unsigned char digit[7]; + } DigitRec; + +typedef struct { + int nofline; + XPoint point_list[5]; + } StringRec; + +/* Number's character database - like as "LED" */ + +DigitRec num_segment[] = { + {1,1,1,1,1,1,0}, + {0,1,1,0,0,0,0}, + {1,1,0,1,1,0,1}, + {1,1,1,1,0,0,1}, + {0,1,1,0,0,1,1}, + {1,0,1,1,0,1,1}, + {1,0,1,1,1,1,1}, + {1,1,1,0,0,0,0}, + {1,1,1,1,1,1,1}, + {1,1,1,1,0,1,1}}; + +XSegment offset[] = { + {-10,-10, 10,-10}, + { 10,-10, 10, 0}, + { 10, 0, 10, 10}, + { 10, 10,-10, 10}, + {-10, 10,-10, 0}, + {-10, 0,-10,-10}, + {-10, 0, 10, 0}}; + + +/* " X 10 %" character database */ + +StringRec char_data[] = { + { 2, /* "X" */ + {{-17, -5}, + {-7, 5}}}, + { 2, + {{-7, -5}, + {-17, 5}}}, + { 2, /* "1" */ + {{-2, -5}, + {-2, 5}}}, + { 5, /* "0" */ + {{2, -5}, + {12, -5}, + {12, 5}, + {2, 5}, + {2, -5}}}}; +#if 0 +{{{{ {2, -5}}}, + { 5, /* "%" */ + {{17, -5}, + {20, -5}, + {20, -2}, + {17, -2}, + {17, -5}}}, + { 2, + {{27, -5}, + {17, 5}}}, + {5, + {{24, 2}, + {27, 2}, + {27, 5}, + {24, 5}, + {24, 2}}}}; +#endif + + + +#define offst(field) XtOffset(TachometerWidget, field) +static XtResource resources[] = { + {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + offst(tachometer.scale), XtRString, "XtDefaultForeground"}, + {XtNtachometerCircleColor, XtCBorderColor, XtRPixel, sizeof(Pixel), + offst(tachometer.circle), XtRString, "XtDefaultForeground"}, + {XtNtachometerNeedleColor, XtCBorderColor, XtRPixel, sizeof(Pixel), + offst(tachometer.needle), XtRString, "XtDefaultForeground"}, + {XtNtachometerNeedleSpeed, XtCtachometerNeedleSpeed, XtRInt, + sizeof(int), offst(tachometer.speed), XtRImmediate, (caddr_t) 1}, + {XtNvalue, XtCValue, XtRInt, sizeof(int), + offst(tachometer.value), XtRImmediate, (caddr_t) 0}, + {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension), + offst(core.height), XtRImmediate, (caddr_t) 100}, + {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension), + offst(core.width), XtRImmediate, (caddr_t) 100}, + {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), + offst(core.border_width), XtRImmediate, (caddr_t) 0}, + {XtNinternalBorderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), + offst(tachometer.internal_border), XtRImmediate, (caddr_t) 0}, +}; + +static void Initialize(); +static void Realize(); +static void Resize(); +static void Redisplay(); +static Boolean SetValues(); +static void Destroy(); + +TachometerClassRec tachometerClassRec = { + { +/* core_class fields */ +#define superclass (&simpleClassRec) + /* superclass */ (WidgetClass) superclass, + /* class_name */ "Tachometer", + /* widget_size */ sizeof(TachometerRec), + /* class_initialize */ NULL, + /* class_part_initialize */ NULL, + /* class_inited */ FALSE, + /* initialize */ Initialize, + /* initialize_hook */ NULL, + /* realize */ Realize, + /* actions */ NULL, + /* num_actions */ 0, + /* resources */ resources, + /* num_resources */ XtNumber(resources), + /* xrm_class */ NULLQUARK, + /* compress_motion */ TRUE, + /* compress_exposure */ TRUE, + /* compress_enterleave */ TRUE, + /* visible_interest */ FALSE, + /* destroy */ Destroy, + /* resize */ Resize, + /* expose */ Redisplay, + /* set_values */ SetValues, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, + /* accept_focus */ NULL, + /* version */ XtVersion, + /* callback_private */ NULL, + /* tm_table */ NULL, + /* query_geometry */ NULL, + /* display_accelerator */ XtInheritDisplayAccelerator, + /* extension */ NULL + }, +/* Simple class fields initialization */ + { + /* change_sensitive */ XtInheritChangeSensitive + } + +}; +WidgetClass tachometerWidgetClass = (WidgetClass)&tachometerClassRec; +/**************************************************************** + * + * Private Procedures + * + ****************************************************************/ + + +static void DrawTachometer(); +static void FastFillCircle(); +static void GetneedleGC(); +static void GetscaleGC(); +static void GetcSingleircleGC(); +static void GetbackgroundGC(); +static void DrawGauge(); +static void DrawNeedle(); +static void DrawNumbers(); +static void DrawSingleNumber(); +static void DrawLabelString(); +static void MoveNeedle(); + + + +static void DrawTachometer(w) +TachometerWidget w; +{ + Cardinal center_x, center_y; + Cardinal radius_x, radius_y; + + center_x = w->core.width / 2; + center_y = w->core.height / 2; + + radius_x = center_x - w->tachometer.internal_border; + radius_y = center_y - w->tachometer.internal_border; + + if ((center_x == 0) || (center_y == 0) || + (radius_x <= 0) || (radius_y <= 0)) + /* Can't draw anything -- no room */ + return; + + /* Draw meter shape */ + + /* Big circle */ + + FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.circle_GC, + center_x, center_y, radius_x, radius_y); + + /* Inner circle same color as the background */ + + FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.background_GC, + center_x, center_y, (Cardinal) (radius_x * 0.95), + (Cardinal) (radius_y * 0.95)); + + /* Small circle */ + + FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.circle_GC, + center_x, center_y, (Cardinal) (radius_x * 0.1), + (Cardinal) (radius_y * 0.1)); + + /* Draw the details */ + + DrawGauge(w); + DrawNeedle(w, w->tachometer.value); +} + + + +static void FastFillCircle(d, w, gc, center_x, center_y, radius_x, radius_y) +Display *d; +Drawable w; +GC gc; +Cardinal center_x; +Cardinal center_y; +Cardinal radius_x; +Cardinal radius_y; +{ + XPoint points[360]; + Cardinal angle; + + for (angle = 0; angle < 360; angle++) { + points[angle].x = (short) (sin((double) angle * PI / 180.0) * + (double) radius_x + (double) center_x); + points[angle].y = (short) (cos((double) angle * PI / 180.0) * + (double) radius_y + (double) center_y); + } + + XFillPolygon(d, w, gc, points, 360, Complex, + CoordModeOrigin); + +} + + + + +static void DrawGauge(w) +TachometerWidget w; +{ + XPoint points[4]; + double step; + Cardinal in_gauge_x, in_gauge_y; + Cardinal out_gauge_x, out_gauge_y; + Cardinal number_x, number_y; + Cardinal center_x, center_y; + Cardinal radius_x, radius_y; + GC gc; + double jump = 1.0; + + center_x = w->core.width / 2; + center_y = w->core.height / 2; + + radius_x = center_x - w->tachometer.internal_border; + radius_y = center_y - w->tachometer.internal_border; + + if ((center_x == 0) || (center_y == 0) || (radius_x <= 0) || + (radius_y <= 0)) + /* Can't draw anything */ + return; + + gc = w->tachometer.scale_GC; + + for (step = 330.0; step >= 30.0; step -= jump) { + if ((Cardinal) (step) % 30 == 0) { + points[0].x = sin((step + 1.0) * PI / 180.0) * radius_x * 0.75 + + center_x; + points[0].y = cos((step + 1.0) * PI / 180.0) * radius_y * 0.75 + + center_y; + points[1].x = sin((step - 1.0) * PI / 180.0) * radius_x * 0.75 + + center_x; + points[1].y = cos((step - 1.0) * PI / 180.0) * radius_y * 0.75 + + center_y; + points[2].x = sin((step - 1.0) * PI / 180.0) * radius_x * 0.85 + + center_x; + points[2].y = cos((step - 1.0) * PI / 180.0) * radius_y * 0.85 + + center_y; + points[3].x = sin((step + 1.0) * PI / 180.0) * radius_x * 0.85 + + center_x; + points[3].y = cos((step + 1.0) * PI / 180.0) * radius_y * 0.85 + + center_y; + + XFillPolygon(XtDisplay(w), XtWindow(w), gc, points, 4, + Complex, CoordModeOrigin); + + number_x = sin((step + 1.0) * PI / 180.0) * radius_x * 0.65 + + center_x; + number_y = cos((step + 1.0) * PI / 180.0) * radius_y * 0.65 + + center_y; + + if ((int)((330.0 - step) / 30.0) == 1) + jump = 3.0; + + DrawNumbers(w, (unsigned char) ((330.0 - step) / 30.0), + number_x, number_y); + + } else { + in_gauge_x = sin(step * PI / 180.0) * radius_x * 0.8 + center_x; + in_gauge_y = cos(step * PI / 180.0) * radius_y * 0.8 + center_y; + out_gauge_x = sin(step * PI / 180.0) * radius_x * 0.85 + + center_x; + out_gauge_y = cos(step * PI / 180.0) * radius_y * 0.85 + + center_y; + + XDrawLine(XtDisplay(w), XtWindow(w), gc, in_gauge_x, + in_gauge_y, out_gauge_x, out_gauge_y); + } + } + + DrawLabelString(w); +} + +static void DrawNeedle(w, load) +TachometerWidget w; +int load; +{ + XPoint points[6]; + double cur_theta1, cur_theta2, cur_theta3; + double cur_theta4, cur_theta5; + Cardinal center_x, center_y; + Cardinal radius_x, radius_y; + GC gc; + + center_x = w->core.width / 2; + center_y = w->core.height / 2; + + radius_x = center_x - w->tachometer.internal_border; + radius_y = center_y - w->tachometer.internal_border; + + if ((center_x == 0) || (center_y == 0) || (radius_x <= 0) || + (radius_y <= 0)) + /* can't draw anything */ + return; + + gc = w->tachometer.needle_GC; + + cur_theta1 = (double) (330 - (load * 3)) * PI / 180.0; + cur_theta2 = (double) (330 - (load * 3) + 1) * PI / 180.0; + cur_theta3 = (double) (330 - (load * 3) - 1) * PI / 180.0; + cur_theta4 = (330.0 - ((double) load * 3.0) + 7.0) * PI / 180.0; + cur_theta5 = (330.0 - ((double) load * 3.0) - 7.0) * PI / 180.0; + + points[0].x = sin(cur_theta1) * radius_x * 0.75 + center_x; + points[0].y = cos(cur_theta1) * radius_y * 0.75 + center_y; + points[1].x = sin(cur_theta2) * radius_x * 0.7 + center_x; + points[1].y = cos(cur_theta2) * radius_y * 0.7 + center_y; + points[2].x = sin(cur_theta4) * radius_x * 0.1 + center_x; + points[2].y = cos(cur_theta4) * radius_y * 0.1 + center_y; + points[3].x = sin(cur_theta5) * radius_x * 0.1 + center_x; + points[3].y = cos(cur_theta5) * radius_y * 0.1 + center_y; + points[4].x = sin(cur_theta3) * radius_x * 0.7 + center_x; + points[4].y = cos(cur_theta3) * radius_y * 0.7 + center_y; + points[5].x = points[0].x; + points[5].y = points[0].y; + + XDrawLines(XtDisplay(w), XtWindow(w), gc, points, 6, CoordModeOrigin); +} + + +static void DrawNumbers(w, which, x, y) +TachometerWidget w; +unsigned char which; +Cardinal x, y; +{ + /* Draw Numbers */ + + if (which == 10) { + DrawSingleNumber(w, 1, (Cardinal) ((double) x * 0.9), y); + DrawSingleNumber(w, 0, x, y); + } else + DrawSingleNumber(w, which, x, y); +} + + + +static void DrawSingleNumber(w, which, x, y) +TachometerWidget w; +Cardinal x, y; +{ + + XSegment segments[7]; + Cardinal nsegments; + unsigned char count; + Cardinal width, height; + GC gc; + + width = (w->core.width / 2) - w->tachometer.internal_border; + height = (w->core.height / 2) - w->tachometer.internal_border; + + if ((width <= 0) || (height <= 0)) + return; + + gc = w->tachometer.scale_GC; + + for (count = 0, nsegments = 0; count < 7; count++) { + if (num_segment[which].digit[count] == 1) { + segments[nsegments].x1 = (short) + (x + ((double) offset[count].x1 * + ((double) width / 200.0))); + segments[nsegments].y1 = (short) + (y + ((double) offset[count].y1 * + ((double) height / 200.0))); + segments[nsegments].x2 = (short) + (x + ((double) offset[count].x2 * + ((double) width / 200.0))); + segments[nsegments].y2 = (short) + (y + ((double) offset[count].y2 * + ((double) height / 200.0))); + nsegments++; + } + } + + XDrawSegments(XtDisplay(w), XtWindow(w), gc, segments, nsegments); + +} + + + +static void DrawLabelString(w) +TachometerWidget w; +{ + XPoint points[5]; + Cardinal ry; + unsigned char char_count; + unsigned char data_count; + Cardinal center_x, center_y; + Cardinal radius_x, radius_y; + GC gc; + + gc = w->tachometer.scale_GC; + + center_x = w->core.width / 2; + center_y = w->core.height / 2; + radius_x = center_x - w->tachometer.internal_border; + radius_y = center_y - w->tachometer.internal_border; + + if (! (center_x && center_y && (radius_x > 0) && (radius_y > 0))) + return; + + ry = (double) radius_y * 0.35 + center_y; + + for (char_count = 0; char_count < 4; char_count++) { + for (data_count = 0; data_count < char_data[char_count].nofline + ; data_count++) { + points[data_count].x = (double) + (char_data[char_count].point_list[data_count].x) * + (double) radius_x * 0.01 + center_x; + points[data_count].y = (double) + (char_data[char_count].point_list[data_count].y) * + (double) radius_y * 0.01 + ry; + } + XDrawLines(XtDisplay(w), XtWindow(w), gc, points, + char_data[char_count].nofline, CoordModeOrigin); + } +} + + + +static void MoveNeedle(w, new) +TachometerWidget w; +int new; +{ + int step; + int old, loop; + + old = w->tachometer.value; + if (new > 100) + new = 100; + + if (old == new) + return; + else if (old < new) + step = (w->tachometer.speed ? w->tachometer.speed : new - old); + else + step = (w->tachometer.speed ? - w->tachometer.speed : new - old); + + if (old < new) { + for (loop = old; loop < new; loop += step) + DrawNeedle(w, loop); + for (loop = old + step; loop <= new; loop += step) + DrawNeedle(w, loop); + } + else { + for (loop = old; loop > new; loop += step) + DrawNeedle(w, loop); + for (loop = old + step; loop >= new; loop += step) + DrawNeedle(w, loop); + } + + if (loop != new + step) /* The final needle wasn't printed */ + DrawNeedle(w, new); + + w->tachometer.value = new; +} + +static void GetneedleGC(ta) +TachometerWidget ta; +{ + XGCValues values; + + values.background = ta->core.background_pixel; + values.foreground = ta->tachometer.needle ^ ta->core.background_pixel; + values.function = GXxor; + + ta->tachometer.needle_GC = XtGetGC( + (Widget)ta, + (unsigned) GCFunction | GCBackground | GCForeground, + &values); +} + +static void GetscaleGC(ta) +TachometerWidget ta; +{ + XGCValues values; + + values.foreground = ta->tachometer.scale; + values.background = ta->core.background_pixel; + + ta->tachometer.scale_GC = XtGetGC( + (Widget)ta, + (unsigned) GCForeground | GCBackground, + &values); +} + +static void GetcircleGC(ta) +TachometerWidget ta; +{ + XGCValues values; + + values.foreground = ta->tachometer.circle; + values.background = ta->core.background_pixel; + + ta->tachometer.circle_GC = XtGetGC( + (Widget)ta, + (unsigned) GCForeground | GCBackground, + &values); +} + + +static void GetbackgroundGC(ta) +TachometerWidget ta; +{ + XGCValues values; + + values.foreground = ta->core.background_pixel; + values.background = ta->core.background_pixel; + + ta->tachometer.background_GC = XtGetGC( + (Widget)ta, + (unsigned) GCForeground | GCBackground, + &values); +} + +/* ARGSUSED */ +static void Initialize(request, new) + Widget request, new; +{ + TachometerWidget ta = (TachometerWidget) new; + + GetneedleGC(ta); + GetcircleGC(ta); + GetscaleGC(ta); + GetbackgroundGC(ta); + ta->tachometer.width = ta->tachometer.height = 0; +} /* Initialize */ + + +static void Realize(w, valueMask, attributes) + register Widget w; + Mask *valueMask; + XSetWindowAttributes *attributes; +{ + *valueMask |= CWBitGravity; + attributes->bit_gravity = NorthWestGravity; + (*superclass->core_class.realize) (w, valueMask, attributes); + +} /* Realize */ + + + +/* + * Repaint the widget window + */ + +/* ARGSUSED */ +static void Redisplay(w, event, region) + Widget w; + XEvent *event; + Region region; +{ + TachometerWidget ta = (TachometerWidget) w; + + if (event->xexpose.count == 0) + DrawTachometer(ta); +} + +static void Resize(w) + Widget w; +{ + TachometerWidget ta = (TachometerWidget) w; + + if ((ta->core.width == ta->tachometer.width) && + (ta->core.height == ta->tachometer.height)) + /* What resize? We don't see a resize! */ + return; + + XClearWindow(XtDisplay(w), XtWindow(w)); + + if ((ta->core.width <= ta->tachometer.width) && + (ta->core.height <= ta->tachometer.height)) + /* Only redraw here if no expose events are going to be */ + /* generated, i.e. if the window has not grown horizontally */ + /* or vertically. */ + DrawTachometer(ta); + + ta->tachometer.width = ta->core.width; + ta->tachometer.height = ta->core.height; +} + +/* + * Set specified arguments into widget + */ + +/* ARGSUSED */ +static Boolean SetValues(current, request, new) + Widget current, request, new; +{ + Boolean back; + Boolean changed = False; + + TachometerWidget curta = (TachometerWidget) current; + TachometerWidget newta = (TachometerWidget) new; + + back = (curta->core.background_pixel != newta->core.background_pixel); + + if (back || (curta->tachometer.needle != newta->tachometer.needle)) { + XtReleaseGC(new, newta->tachometer.needle_GC); + GetneedleGC(newta); + changed = True; + } + if (back || (curta->tachometer.scale != newta->tachometer.scale)) { + XtReleaseGC(new, newta->tachometer.scale_GC); + GetscaleGC(newta); + changed = True; + } + if (back || (curta->tachometer.circle != newta->tachometer.circle)) { + XtReleaseGC(new, newta->tachometer.circle_GC); + GetcircleGC(newta); + changed = True; + } + if (back) { + XtReleaseGC(new, newta->tachometer.background_GC); + GetbackgroundGC(newta); + changed = True; + } + + if (curta->tachometer.value != newta->tachometer.value) { + MoveNeedle(newta, newta->tachometer.value); + changed = True; + } + + return(changed); +} + +static void Destroy(w) + Widget w; +{ + TachometerWidget ta = (TachometerWidget) w; + + XtReleaseGC( w, ta->tachometer.needle_GC ); + XtReleaseGC( w, ta->tachometer.circle_GC ); + XtReleaseGC( w, ta->tachometer.scale_GC ); + XtReleaseGC( w, ta->tachometer.background_GC ); +} + + + +/*************************************************************** + * + * Exported Procedures + * + ***************************************************************/ + +int TachometerGetValue(w) +Widget w; +{ + TachometerWidget ta = (TachometerWidget) w; + + return(ta->tachometer.value); +} + + +int TachometerSetValue(w, i) +Widget w; +int i; +{ + int old; + TachometerWidget ta = (TachometerWidget) w; + + old = ta->tachometer.value; + + MoveNeedle(ta, i); + + return(old); +} diff --git a/Tachometer.h b/Tachometer.h new file mode 100644 index 00000000..7437cb0e --- /dev/null +++ b/Tachometer.h @@ -0,0 +1,56 @@ +#ifndef _Tachometer_h +#define _Tachometer_h + +/*********************************************************************** + * + * Tachometer Widget + * + * + ***********************************************************************/ + +#include <X11/Xaw/Simple.h> + +/* Resources: + + Name Class RepType Default Value + ---- ----- ------- ------------- + background Background Pixel XtDefaultBackground + border BorderColor Pixel XtDefaultForeground + circleColor BorderColor Pixel XtDefaultForeground + borderWidth BorderWidth Dimension 0 + cursor Cursor Cursor None + destroyCallback Callback XtCallbackList NULL + foreground Foreground Pixel XtDefaultForeground + height Height Dimension 100 + insensitiveBorder Insensitive Pixmap Gray + internalBorderWidth BorderWidth Dimension 0 + mappedWhenManaged MappedWhenManaged Boolean True + needleColor BorderColor Pixel XtDefaultForeground + needleSpeed NeedleSpeed int 1 + sensitive Sensitive Boolean True + width Width Dimension 100 + value Value int 0 + x Position Position 0 + y Position Position 0 + +*/ + +#define XtNinternalBorderWidth "internalBorderWidth" +#define XtNtachometerNeedleSpeed "needleSpeed" +#define XtNtachometerCircleColor "circleColor" +#define XtNtachometerNeedleColor "needleColor" + +#define XtCtachometerNeedleSpeed "NeedleSpeed" + +extern int TachometerGetValue(/* Widget */); +extern int TachometerSetValue(/* Widget, int */); + +/* Class record constants */ + +extern WidgetClass tachometerWidgetClass; + +typedef struct _TachometerClassRec *TachometerWidgetClass; +typedef struct _TachometerRec *TachometerWidget; + + +#endif /* _Tachometer_h */ diff --git a/TachometerP.h b/TachometerP.h new file mode 100644 index 00000000..50a4a62a --- /dev/null +++ b/TachometerP.h @@ -0,0 +1,61 @@ +#ifndef _TachometerP_h +#define _TachometerP_h + +/*********************************************************************** + * + * Tachometer Widget Private Data + * + ***********************************************************************/ + +#include <Tachometer.h> +#include <X11/Xaw/SimpleP.h> + +/* New fields for the Tachometer widget class record */ + +typedef struct {int foo;} TachometerClassPart; + +/* Full class record declaration */ +typedef struct _TachometerClassRec { + CoreClassPart core_class; + SimpleClassPart simple_class; + TachometerClassPart label_class; +} TachometerClassRec; + +extern TachometerClassRec tachometerClassRec; + +/* New fields for the Tachometer widget record */ +typedef struct { + /* resources */ + Pixel needle; + Pixel scale; + Pixel circle; + int value; + int speed; + + /* private state */ + GC needle_GC; + GC scale_GC; + GC circle_GC; + GC background_GC; + /* We need to store the width and height separately, because when */ + /* we get a resize request, we need to know if the window has */ + /* gotten bigger. */ + Dimension width; + Dimension height; + Dimension internal_border; +} TachometerPart; + + +/**************************************************************** + * + * Full instance record declaration + * + ****************************************************************/ + +typedef struct _TachometerRec { + CorePart core; + SimplePart simple; + TachometerPart tachometer; +} TachometerRec; + +#endif /* _TachometerP_h */ diff --git a/XGpsSpeed b/XGpsSpeed new file mode 100644 index 00000000..eccb4746 --- /dev/null +++ b/XGpsSpeed @@ -0,0 +1,17 @@ +*name*width: 100 +*name*left: ChainLeft +*name*right: ChainRight +*name*BorderWidth: 0 +*name*font: -*-charter-medium-r-*-*-*-100-* +*title*width: 100 +*title*left: ChainLeft +*title*right: ChainRight +*title*BorderWidth: 0 +*title*font: -*-charter-medium-r-*-*-*-100-* +*meter*left: ChainLeft +*meter*right: ChainRight +*meter*BorderWidth: 0 +*meter*horizDistance: 2 +*meter*width: 120 +*meter*height: 120 +*needleColor: salmon1 diff --git a/configure b/configure deleted file mode 100755 index b3dee220..00000000 --- a/configure +++ /dev/null @@ -1,3356 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with-x use the X Window System" -ac_help="$ac_help - --without-motif do not use Motif widgets" -ac_help="$ac_help - --with-motif-includes=DIR Motif include files are in DIR" -ac_help="$ac_help - --with-motif-libraries=DIR Motif libraries are in DIR" -ac_help="$ac_help - --without-athena do not use Athena widgets" -ac_help="$ac_help - --with-athena-includes=DIR Athena include files are in DIR" -ac_help="$ac_help - --with-athena-libraries=DIR Athena libraries are in DIR" -ac_help="$ac_help - --without-xpm do not use the Xpm library" -ac_help="$ac_help - --with-xpm-includes=DIR Xpm include files are in DIR" -ac_help="$ac_help - --with-xpm-libraries=DIR Xpm libraries are in DIR" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=gpsd.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:547: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:576: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - ac_prog_rejected=no - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:624: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext <<EOF -#line 634 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:658: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:663: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:687: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:715: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - - - - -echo $ac_n "checking whether the C compiler (${CC}) compiles and links a simple C program""... $ac_c" 1>&6 -echo "configure:739: checking whether the C compiler (${CC}) compiles and links a simple C program" >&5 -if eval "test \"`echo '$''{'ice_cv_prog_cc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext <<EOF -#line 753 "configure" -#include "confdefs.h" -#include <stdio.h> -int main() { -printf("hello, world!"); -; return 0; } -EOF -if { (eval echo configure:760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - ice_cv_prog_cc=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ice_cv_prog_cc=no -fi -rm -f conftest* - - -fi - -echo "$ac_t""$ice_cv_prog_cc" 1>&6 -if test "$ice_cv_prog_cc" = no; then -{ echo "configure: error: You must set the environment variable CC to a working - C compiler. Also check the CFLAGS settings. - See the file 'config.log' for further diagnostics." 1>&2; exit 1; } -fi - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:782: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 797 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 814 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - - -for ac_hdr in termio.h sys/param.h termios.h sys/termios.h sys/select.h strings.h path.h sys/filio.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:847: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 852 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - - -echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:886: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 894 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBNSL="-lnsl" -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:927: checking for socket in -lsocket" >&5 -ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <<EOF -#line 935 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); - -int main() { -socket() -; return 0; } -EOF -if { (eval echo configure:946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBSOCKET="-lsocket" -else - echo "$ac_t""no" 1>&6 -fi - - - - -echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:970: checking for sin in -lm" >&5 -ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lm $LIBS" -cat > conftest.$ac_ext <<EOF -#line 978 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin(); - -int main() { -sin() -; return 0; } -EOF -if { (eval echo configure:989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBM="-lm" -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking for open in -lc""... $ac_c" 1>&6 -echo "configure:1011: checking for open in -lc" >&5 -ac_lib_var=`echo c'_'open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lc $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1019 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char open(); - -int main() { -open() -; return 0; } -EOF -if { (eval echo configure:1030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBC="-lc" -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6 -echo "configure:1052: checking for regcmp in -lgen" >&5 -ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lgen $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1060 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char regcmp(); - -int main() { -regcmp() -; return 0; } -EOF -if { (eval echo configure:1071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBGEN="-lgen" -else - echo "$ac_t""no" 1>&6 -fi - - -if test "$with_x" = no; then -echo "configure: warning: Some of this software requires the X window system to compile and run. - Please do not use the configure option '--without-x'." 1>&2 -fi -if test "$with_motif" = no; then -echo "configure: warning: Some of this software requires Motif to compile and run. - Please do not use the configure option '--without-motif'." 1>&2 -fi -if test "$with_x" != no; then -ice_save_LIBS="$LIBS" -ice_save_CFLAGS="$CFLAGS" -ice_save_CPPFLAGS="$CPPFLAGS" -ice_save_LDFLAGS="$LDFLAGS" -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1110: checking for X" >&5 - -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" - : -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; - esac - case "$ac_im_usrlibdir" in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; - esac - fi - cd .. - rm -fr conftestdir -fi - -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h - - # First, try using that file with no special directory specified. -cat > conftest.$ac_ext <<EOF -#line 1172 "configure" -#include "confdefs.h" -#include <$x_direct_test_include> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - # We can compile using X headers with no special include directory. -ac_x_includes= -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - # Look for the header file in a standard set of common directories. -# Check X11 before X11Rn because it is often a symlink to the current release. - for ac_dir in \ - /usr/X11/include \ - /usr/X11R6/include \ - /usr/X11R5/include \ - /usr/X11R4/include \ - \ - /usr/include/X11 \ - /usr/include/X11R6 \ - /usr/include/X11R5 \ - /usr/include/X11R4 \ - \ - /usr/local/X11/include \ - /usr/local/X11R6/include \ - /usr/local/X11R5/include \ - /usr/local/X11R4/include \ - \ - /usr/local/include/X11 \ - /usr/local/include/X11R6 \ - /usr/local/include/X11R5 \ - /usr/local/include/X11R4 \ - \ - /usr/X386/include \ - /usr/x386/include \ - /usr/XFree86/include/X11 \ - \ - /usr/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ - /usr/openwin/include \ - /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break - fi - done -fi -rm -f conftest* -fi # $ac_x_includes = NO - -if test "$ac_x_libraries" = NO; then - # Check for the libraries. - - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc - - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS="$LIBS" - LIBS="-l$x_direct_test_library $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1246 "configure" -#include "confdefs.h" - -int main() { -${x_direct_test_function}() -; return 0; } -EOF -if { (eval echo configure:1253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - LIBS="$ac_save_LIBS" -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ -do - for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f conftest* -fi # $ac_x_libraries = NO - -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi -fi - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - cat >> confdefs.h <<\EOF -#define X_DISPLAY_MISSING 1 -EOF - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - case "`(uname -sr) 2>/dev/null`" in - "SunOS 5"*) - echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1359: checking whether -R must be followed by a space" >&5 - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" - cat > conftest.$ac_ext <<EOF -#line 1362 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:1369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - ac_R_nospace=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_nospace=no -fi -rm -f conftest* - if test $ac_R_nospace = yes; then - echo "$ac_t""no" 1>&6 - X_LIBS="$X_LIBS -R$x_libraries" - else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat > conftest.$ac_ext <<EOF -#line 1385 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:1392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - ac_R_space=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_space=no -fi -rm -f conftest* - if test $ac_R_space = yes; then - echo "$ac_t""yes" 1>&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$ac_t""neither works" 1>&6 - fi - fi - LIBS="$ac_xsave_LIBS" - esac - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu says - # the Alpha needs dnet_stub (dnet does not exist). - echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:1424: checking for dnet_ntoa in -ldnet" >&5 -ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1432 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dnet_ntoa(); - -int main() { -dnet_ntoa() -; return 0; } -EOF -if { (eval echo configure:1443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:1465: checking for dnet_ntoa in -ldnet_stub" >&5 -ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet_stub $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1473 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dnet_ntoa(); - -int main() { -dnet_ntoa() -; return 0; } -EOF -if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to dickey@clark.net. - echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1513: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1518 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_gethostbyname = no; then - echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1562: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1570 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says simon@lia.di.epfl.ch: it contains - # gethostby* variants that don't use the nameserver (or something). - # -lsocket must be given before -lnsl if both are needed. - # We assume that if connect needs -lnsl, so does gethostbyname. - echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1611: checking for connect" >&5 -if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1616 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_connect = no; then - echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1660: checking for connect in -lsocket" >&5 -ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1668 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { -connect() -; return 0; } -EOF -if { (eval echo configure:1679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. - echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:1703: checking for remove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1708 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) -choke me -#else -remove(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_remove=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_remove=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_remove = no; then - echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:1752: checking for remove in -lposix" >&5 -ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lposix $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1760 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { -remove() -; return 0; } -EOF -if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:1795: checking for shmat" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1800 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) -choke me -#else -shmat(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_shmat=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shmat=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_shmat = no; then - echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:1844: checking for shmat in -lipc" >&5 -ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lipc $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1852 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { -shmat() -; return 0; } -EOF -if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -else - echo "$ac_t""no" 1>&6 -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS="$LDFLAGS" - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. - echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:1896: checking for IceConnectionNumber in -lICE" >&5 -ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lICE $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1904 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char IceConnectionNumber(); - -int main() { -IceConnectionNumber() -; return 0; } -EOF -if { (eval echo configure:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -else - echo "$ac_t""no" 1>&6 -fi - - LDFLAGS="$ac_save_LDFLAGS" - -fi - - - -motif_includes= -motif_libraries= -# Check whether --with-motif or --without-motif was given. -if test "${with_motif+set}" = set; then - withval="$with_motif" - : -fi - -if test "$with_motif" = "no" -then -motif_includes=no -motif_libraries=no -fi -# Check whether --with-motif-includes or --without-motif-includes was given. -if test "${with_motif_includes+set}" = set; then - withval="$with_motif_includes" - motif_includes="$withval" -fi - -# Check whether --with-motif-libraries or --without-motif-libraries was given. -if test "${with_motif_libraries+set}" = set; then - withval="$with_motif_libraries" - motif_libraries="$withval" -fi - -echo $ac_n "checking for Motif""... $ac_c" 1>&6 -echo "configure:1967: checking for Motif" >&5 -# -# -# Search the include files. -# -if test "$motif_includes" = ""; then -if eval "test \"`echo '$''{'ice_cv_motif_includes'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_motif_save_LIBS="$LIBS" -ice_motif_save_CFLAGS="$CFLAGS" -ice_motif_save_CPPFLAGS="$CPPFLAGS" -ice_motif_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -cat > conftest.$ac_ext <<EOF -#line 1988 "configure" -#include "confdefs.h" -#include <Xm/Xm.h> -int main() { -int a; -; return 0; } -EOF -if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - -# Xm/Xm.h is in the standard search path. -ice_cv_motif_includes= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# Xm/Xm.h is not in the standard search path. -# Locate it and put its directory in `motif_includes' -# -# /usr/include/Motif* are used on HP-UX (Motif). -# /usr/include/X11* are used on HP-UX (X and Athena). -# /usr/dt is used on Solaris (Motif). -# /usr/openwin is used on Solaris (X and Athena). -# Other directories are just guesses. -for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ - /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \ - /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \ - /usr/dt/include /usr/openwin/include \ - /usr/dt/*/include /opt/*/include /usr/include/Motif* \ - "${prefix}"/*/include /usr/*/include /usr/local/*/include \ - "${prefix}"/include/* /usr/include/* /usr/local/include/*; do -if test -f "$dir/Xm/Xm.h"; then -ice_cv_motif_includes="$dir" -break -fi -done -if test "$ice_cv_motif_includes" = ""; then -ice_cv_motif_includes=no -fi - -fi -rm -f conftest* -# -LIBS="$ice_motif_save_LIBS" -CFLAGS="$ice_motif_save_CFLAGS" -CPPFLAGS="$ice_motif_save_CPPFLAGS" -LDFLAGS="$ice_motif_save_LDFLAGS" - -fi - -motif_includes="$ice_cv_motif_includes" -fi -# -# -# Now for the libraries. -# -if test "$motif_libraries" = ""; then -if eval "test \"`echo '$''{'ice_cv_motif_libraries'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_motif_save_LIBS="$LIBS" -ice_motif_save_CFLAGS="$CFLAGS" -ice_motif_save_CPPFLAGS="$CPPFLAGS" -ice_motif_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -# We use XtToolkitInitialize() here since it takes no arguments -# and thus also works with a C++ compiler. -cat > conftest.$ac_ext <<EOF -#line 2064 "configure" -#include "confdefs.h" - -#include <X11/Intrinsic.h> -#include <Xm/Xm.h> - -int main() { -XtToolkitInitialize(); -; return 0; } -EOF -if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - -# libXm.a is in the standard search path. -ice_cv_motif_libraries= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# libXm.a is not in the standard search path. -# Locate it and put its directory in `motif_libraries' -# -# /usr/lib/Motif* are used on HP-UX (Motif). -# /usr/lib/X11* are used on HP-UX (X and Athena). -# /usr/dt is used on Solaris (Motif). -# /usr/lesstif is used on Linux (Lesstif). -# /usr/openwin is used on Solaris (X and Athena). -# Other directories are just guesses. -for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ - /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \ - /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \ - /usr/dt/lib /usr/openwin/lib \ - /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \ - /usr/lesstif*/lib /usr/lib/Lesstif* \ - "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ - "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do -if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then -ice_cv_motif_libraries="$dir" -break -fi -done -if test "$ice_cv_motif_libraries" = ""; then -ice_cv_motif_libraries=no -fi - -fi -rm -f conftest* -# -LIBS="$ice_motif_save_LIBS" -CFLAGS="$ice_motif_save_CFLAGS" -CPPFLAGS="$ice_motif_save_CPPFLAGS" -LDFLAGS="$ice_motif_save_LDFLAGS" - -fi - -# -motif_libraries="$ice_cv_motif_libraries" -fi -# Add Motif definitions to X flags -# -if test "$motif_includes" != "" && test "$motif_includes" != "$x_includes" && test "$motif_includes" != "no" -then -X_CFLAGS="-I$motif_includes $X_CFLAGS" -fi -if test "$motif_libraries" != "" && test "$motif_libraries" != "$x_libraries" && test "$motif_libraries" != "no" -then -case "$X_LIBS" in - *-R\ *) X_LIBS="-L$motif_libraries -R $motif_libraries $X_LIBS";; - *-R*) X_LIBS="-L$motif_libraries -R$motif_libraries $X_LIBS";; - *) X_LIBS="-L$motif_libraries $X_LIBS";; -esac -fi -# -# -motif_libraries_result="$motif_libraries" -motif_includes_result="$motif_includes" -test "$motif_libraries_result" = "" && - motif_libraries_result="in default path" -test "$motif_includes_result" = "" && - motif_includes_result="in default path" -test "$motif_libraries_result" = "no" && - motif_libraries_result="(none)" -test "$motif_includes_result" = "no" && - motif_includes_result="(none)" -echo "$ac_t""libraries $motif_libraries_result, headers $motif_includes_result" 1>&6 - - - -athena_includes= -athena_libraries= -# Check whether --with-athena or --without-athena was given. -if test "${with_athena+set}" = set; then - withval="$with_athena" - : -fi - -if test "$with_athena" = "no" -then -athena_includes=no -athena_libraries=no -fi -# Check whether --with-athena-includes or --without-athena-includes was given. -if test "${with_athena_includes+set}" = set; then - withval="$with_athena_includes" - athena_includes="$withval" -fi - -# Check whether --with-athena-libraries or --without-athena-libraries was given. -if test "${with_athena_libraries+set}" = set; then - withval="$with_athena_libraries" - athena_libraries="$withval" -fi - -echo $ac_n "checking for Athena""... $ac_c" 1>&6 -echo "configure:2180: checking for Athena" >&5 -# -# -# Search the include files. -# -if test "$athena_includes" = ""; then -if eval "test \"`echo '$''{'ice_cv_athena_includes'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_athena_save_LIBS="$LIBS" -ice_athena_save_CFLAGS="$CFLAGS" -ice_athena_save_CPPFLAGS="$CPPFLAGS" -ice_athena_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXaw -lXmu -lXext -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -cat > conftest.$ac_ext <<EOF -#line 2201 "configure" -#include "confdefs.h" - -#include <X11/Intrinsic.h> -#include <X11/Xaw/Text.h> - -int main() { -int a; -; return 0; } -EOF -if { (eval echo configure:2211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - -# X11/Xaw/Text.h is in the standard search path. -ice_cv_athena_includes= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# X11/Xaw/Text.h is not in the standard search path. -# Locate it and put its directory in `athena_includes' -# -# /usr/include/Motif* are used on HP-UX (Motif). -# /usr/include/X11* are used on HP-UX (X and Athena). -# /usr/dt is used on Solaris (Motif). -# /usr/openwin is used on Solaris (X and Athena). -# Other directories are just guesses. -for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ - /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \ - /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \ - /usr/dt/include /usr/openwin/include \ - /usr/dt/*/include /opt/*/include /usr/include/Motif* \ - "${prefix}"/*/include /usr/*/include /usr/local/*/include \ - "${prefix}"/include/* /usr/include/* /usr/local/include/*; do -if test -f "$dir/X11/Xaw/Text.h"; then -ice_cv_athena_includes="$dir" -break -fi -done - -fi -rm -f conftest* -# -LIBS="$ice_athena_save_LIBS" -CFLAGS="$ice_athena_save_CFLAGS" -CPPFLAGS="$ice_athena_save_CPPFLAGS" -LDFLAGS="$ice_athena_save_LDFLAGS" - -fi - -athena_includes="$ice_cv_athena_includes" -fi -# -# -# Now for the libraries. -# -if test "$athena_libraries" = ""; then -if eval "test \"`echo '$''{'ice_cv_athena_libraries'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_athena_save_LIBS="$LIBS" -ice_athena_save_CFLAGS="$CFLAGS" -ice_athena_save_CPPFLAGS="$CPPFLAGS" -ice_athena_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXaw -lXmu -lXext -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -# We use XtToolkitInitialize() here since it takes no arguments -# and thus also works with a C++ compiler. -cat > conftest.$ac_ext <<EOF -#line 2277 "configure" -#include "confdefs.h" - -#include <X11/Intrinsic.h> -#include <X11/Xaw/Text.h> - -int main() { -XtToolkitInitialize(); -; return 0; } -EOF -if { (eval echo configure:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - -# libXaw.a is in the standard search path. -ice_cv_athena_libraries= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# libXaw.a is not in the standard search path. -# Locate it and put its directory in `athena_libraries' -# -# -# /usr/lib/Motif* are used on HP-UX (Motif). -# /usr/lib/X11* are used on HP-UX (X and Athena). -# /usr/dt is used on Solaris (Motif). -# /usr/openwin is used on Solaris (X and Athena). -# Other directories are just guesses. -for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ - /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \ - /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \ - /usr/dt/lib /usr/openwin/lib \ - /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \ - "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ - "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do -if test -d "$dir" && test "`ls $dir/libXaw.* 2> /dev/null`" != ""; then -ice_cv_athena_libraries="$dir" -break -fi -done - -fi -rm -f conftest* -# -LIBS="$ice_athena_save_LIBS" -CFLAGS="$ice_athena_save_CFLAGS" -CPPFLAGS="$ice_athena_save_CPPFLAGS" -LDFLAGS="$ice_athena_save_LDFLAGS" - -fi - -# -athena_libraries="$ice_cv_athena_libraries" -fi -# Add Athena definitions to X flags -# -if test "$athena_includes" != "" && test "$athena_includes" != "$x_includes" && test "$athena_includes" != "no" -then -X_CFLAGS="-I$athena_includes $X_CFLAGS" -fi -if test "$athena_libraries" != "" && test "$athena_libraries" != "$x_libraries" && test "$athena_libraries" != "no" -then -case "$X_LIBS" in - *-R\ *) X_LIBS="-L$athena_libraries -R $athena_libraries $X_LIBS";; - *-R*) X_LIBS="-L$athena_libraries -R$athena_libraries $X_LIBS";; - *) X_LIBS="-L$athena_libraries $X_LIBS";; -esac -fi -# -# -athena_libraries_result="$athena_libraries" -athena_includes_result="$athena_includes" -test "$athena_libraries_result" = "" && - athena_libraries_result="in default path" -test "$athena_includes_result" = "" && - athena_includes_result="in default path" -test "$athena_libraries_result" = "no" && - athena_libraries_result="(none)" -test "$athena_includes_result" = "no" && - athena_includes_result="(none)" -echo "$ac_t""libraries $athena_libraries_result, headers $athena_includes_result" 1>&6 - - - -xpm_includes= -xpm_libraries= -# Check whether --with-xpm or --without-xpm was given. -if test "${with_xpm+set}" = set; then - withval="$with_xpm" - : -fi - -if test "$with_xpm" = "no" -then -xpm_includes=no -xpm_libraries=no -fi -# Check whether --with-xpm-includes or --without-xpm-includes was given. -if test "${with_xpm_includes+set}" = set; then - withval="$with_xpm_includes" - xpm_includes="$withval" -fi - -# Check whether --with-xpm-libraries or --without-xpm-libraries was given. -if test "${with_xpm_libraries+set}" = set; then - withval="$with_xpm_libraries" - xpm_libraries="$withval" -fi - -echo $ac_n "checking for Xpm""... $ac_c" 1>&6 -echo "configure:2389: checking for Xpm" >&5 -# -# -# Search the include files. Note that XPM can come in <X11/xpm.h> (as -# in X11R6) or in <xpm.h> if installed locally. -# -if test "$xpm_includes" = ""; then -if eval "test \"`echo '$''{'ice_cv_xpm_includes'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_xpm_save_LIBS="$LIBS" -ice_xpm_save_CFLAGS="$CFLAGS" -ice_xpm_save_CPPFLAGS="$CPPFLAGS" -ice_xpm_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXpm -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -cat > conftest.$ac_ext <<EOF -#line 2411 "configure" -#include "confdefs.h" - -#include <X11/xpm.h> - -int main() { -int a; -; return 0; } -EOF -if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - -# X11/xpm.h is in the standard search path. -ice_cv_xpm_includes= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# X11/xpm.h is not in the standard search path. -# Locate it and put its directory in `xpm_includes' -# -# /usr/include/Motif* are used on HP-UX (Motif). -# /usr/include/X11* are used on HP-UX (X and Xaw). -# /usr/dt is used on Solaris (Motif). -# /usr/openwin is used on Solaris (X and Xaw). -# Other directories are just guesses. -for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ - /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \ - /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \ - /usr/dt/include /usr/openwin/include \ - /usr/dt/*/include /opt/*/include /usr/include/Motif* \ - "${prefix}"/*/include /usr/*/include /usr/local/*/include \ - "${prefix}"/include/* /usr/include/* /usr/local/include/*; do -if test -f "$dir/X11/xpm.h" || test -f "$dir/xpm.h"; then -ice_cv_xpm_includes="$dir" -break -fi -done - -fi -rm -f conftest* -# -LIBS="$ice_xpm_save_LIBS" -CFLAGS="$ice_xpm_save_CFLAGS" -CPPFLAGS="$ice_xpm_save_CPPFLAGS" -LDFLAGS="$ice_xpm_save_LDFLAGS" - -fi - -xpm_includes="$ice_cv_xpm_includes" -fi -# -# -# Now for the libraries. -# -if test "$xpm_libraries" = ""; then -if eval "test \"`echo '$''{'ice_cv_xpm_libraries'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -ice_xpm_save_LIBS="$LIBS" -ice_xpm_save_CFLAGS="$CFLAGS" -ice_xpm_save_CPPFLAGS="$CPPFLAGS" -ice_xpm_save_LDFLAGS="$LDFLAGS" -# -LIBS="$X_PRE_LIBS -lXpm -lXt -lX11 $X_EXTRA_LIBS $LIBS" -CFLAGS="$X_CFLAGS $CFLAGS" -CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" -# -# -# We use XtToolkitInitialize() here since it takes no arguments -# and thus also works with a C++ compiler. -cat > conftest.$ac_ext <<EOF -#line 2487 "configure" -#include "confdefs.h" - -#include <X11/Intrinsic.h> -#include <X11/xpm.h> - -int main() { -XtToolkitInitialize(); -; return 0; } -EOF -if { (eval echo configure:2497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - -# libxpm.a is in the standard search path. -ice_cv_xpm_libraries= - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -# libXpm.a is not in the standard search path. -# Locate it and put its directory in `xpm_libraries' -# -# -# /usr/lib/Motif* are used on HP-UX (Motif). -# /usr/lib/X11* are used on HP-UX (X and Xpm). -# /usr/dt is used on Solaris (Motif). -# /usr/openwin is used on Solaris (X and Xpm). -# Other directories are just guesses. -for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ - /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \ - /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \ - /usr/dt/lib /usr/openwin/lib \ - /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \ - "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ - "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do -if test -d "$dir" && test "`ls $dir/libXpm.* 2> /dev/null`" != ""; then -ice_cv_xpm_libraries="$dir" -break -fi -done - -fi -rm -f conftest* -# -LIBS="$ice_xpm_save_LIBS" -CFLAGS="$ice_xpm_save_CFLAGS" -CPPFLAGS="$ice_xpm_save_CPPFLAGS" -LDFLAGS="$ice_xpm_save_LDFLAGS" - -fi - -# -xpm_libraries="$ice_cv_xpm_libraries" -fi -# -# Add Xpm definitions to X flags -# -if test "$xpm_includes" != "" && test "$xpm_includes" != "$x_includes" && test "$xpm_includes" != "no" -then -X_CFLAGS="-I$xpm_includes $X_CFLAGS" -fi -if test "$xpm_libraries" != "" && test "$xpm_libraries" != "$x_libraries" && test "$xpm_libraries" != "no" -then -case "$X_LIBS" in - *-R\ *) X_LIBS="-L$xpm_libraries -R $xpm_libraries $X_LIBS";; - *-R*) X_LIBS="-L$xpm_libraries -R$xpm_libraries $X_LIBS";; - *) X_LIBS="-L$xpm_libraries $X_LIBS";; -esac -fi -# -# -xpm_libraries_result="$xpm_libraries" -xpm_includes_result="$xpm_includes" -test "$xpm_libraries_result" = "" && - xpm_libraries_result="in default path" -test "$xpm_includes_result" = "" && - xpm_includes_result="in default path" -test "$xpm_libraries_result" = "no" && - xpm_libraries_result="(none)" -test "$xpm_includes_result" = "no" && - xpm_includes_result="(none)" -echo "$ac_t""libraries $xpm_libraries_result, headers $xpm_includes_result" 1>&6 - -case "$CXX" in - *CC) X_LIBS="`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`" -esac -LIBS="$LIBS $X_EXTRA_LIBS" -CFLAGS="$CFLAGS $X_CFLAGS" -CPPFLAGS="$CPPFLAGS $X_CFLAGS" -LDFLAGS="$LDFLAGS $X_LIBS" -X11_LIBS="" -echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:2581: checking for XOpenDisplay in -lX11" >&5 -ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lX11 ${X_PRE_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2589 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XOpenDisplay(); - -int main() { -XOpenDisplay() -; return 0; } -EOF -if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X11_LIBS="-lX11" -else - echo "$ac_t""no" 1>&6 -fi - -if test "$X11_LIBS" = ""; then -echo "configure: warning: The X11 library '-lX11' could not be found. - Please use the configure options '--x-includes=DIR' - and '--x-libraries=DIR' to specify the X location. - See the file 'config.log' for further diagnostics." 1>&2 -fi - - - -echo $ac_n "checking for _Xlcmbcurmax in -lXintl""... $ac_c" 1>&6 -echo "configure:2630: checking for _Xlcmbcurmax in -lXintl" >&5 -ac_lib_var=`echo Xintl'_'_Xlcmbcurmax | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXintl ${X_PRE_LIBS} ${X11_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2638 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _Xlcmbcurmax(); - -int main() { -_Xlcmbcurmax() -; return 0; } -EOF -if { (eval echo configure:2649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X11_LIBS="${X11_LIBS} -lXintl" -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for shmap in -lipc""... $ac_c" 1>&6 -echo "configure:2670: checking for shmap in -lipc" >&5 -ac_lib_var=`echo ipc'_'shmap | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lipc ${X_PRE_LIBS} ${X11_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2678 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmap(); - -int main() { -shmap() -; return 0; } -EOF -if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X11_LIBS="${X11_LIBS} -lipc" -else - echo "$ac_t""no" 1>&6 -fi - -XT_LIBS="" -echo $ac_n "checking for XtToolkitInitialize in -lXt""... $ac_c" 1>&6 -echo "configure:2711: checking for XtToolkitInitialize in -lXt" >&5 -ac_lib_var=`echo Xt'_'XtToolkitInitialize | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXt ${X_PRE_LIBS} ${X11_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2719 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XtToolkitInitialize(); - -int main() { -XtToolkitInitialize() -; return 0; } -EOF -if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - XT_LIBS="-lXt" -else - echo "$ac_t""no" 1>&6 -fi - -if test "$XT_LIBS" = ""; then -echo "configure: warning: The X toolkit library '-lXt' could not be found. - Please use the configure options '--x-includes=DIR' - and '--x-libraries=DIR' to specify the X location. - See the file 'config.log' for further diagnostics." 1>&2 -fi - -XEXT_LIBS="" -echo $ac_n "checking for XShapeQueryVersion in -lXext""... $ac_c" 1>&6 -echo "configure:2759: checking for XShapeQueryVersion in -lXext" >&5 -ac_lib_var=`echo Xext'_'XShapeQueryVersion | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXext ${X_PRE_LIBS} ${X11_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2767 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XShapeQueryVersion(); - -int main() { -XShapeQueryVersion() -; return 0; } -EOF -if { (eval echo configure:2778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - XEXT_LIBS="-lXext" -else - echo "$ac_t""no" 1>&6 -fi - - -XPM_LIBS="" -echo $ac_n "checking for XpmCreatePixmapFromXpmImage in -lXpm""... $ac_c" 1>&6 -echo "configure:2801: checking for XpmCreatePixmapFromXpmImage in -lXpm" >&5 -ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromXpmImage | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXpm ${X_PRE_LIBS} ${X11_LIBS} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2809 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XpmCreatePixmapFromXpmImage(); - -int main() { -XpmCreatePixmapFromXpmImage() -; return 0; } -EOF -if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - XPM_LIBS="-lXpm" - cat >> confdefs.h <<\EOF -#define HAVE_XPM 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -if test "$XPM_LIBS" != ""; then -for ac_hdr in X11/xpm.h xpm.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2849: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2854 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -fi - -XM_LIBS="" -XP_LIBS="" -if test "$motif_includes" != "no" && test "$motif_libraries" != "no" -then -echo $ac_n "checking for XpSelectInput in -lXp""... $ac_c" 1>&6 -echo "configure:2892: checking for XpSelectInput in -lXp" >&5 -ac_lib_var=`echo Xp'_'XpSelectInput | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXp ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2900 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XpSelectInput(); - -int main() { -XpSelectInput() -; return 0; } -EOF -if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - XP_LIBS="-lXp" - cat >> confdefs.h <<\EOF -#define HAVE_XP 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for XmCreateOptionMenu in -lXm""... $ac_c" 1>&6 -echo "configure:2936: checking for XmCreateOptionMenu in -lXm" >&5 -ac_lib_var=`echo Xm'_'XmCreateOptionMenu | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXm ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN} $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2944 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XmCreateOptionMenu(); - -int main() { -XmCreateOptionMenu() -; return 0; } -EOF -if { (eval echo configure:2955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - XM_LIBS="-lXm" - cat >> confdefs.h <<\EOF -#define HAVE_MOTIF 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -fi -if test "$XM_LIBS" = ""; then -echo "configure: warning: The Motif library '-lXm' could not be found. - Please use the configure options '--with-motif-includes=DIR' - and '--with-motif-libraries=DIR' to specify the Xm location. - See the file 'config.log' for further diagnostics." 1>&2 -MISSING_MOTIF="# " - -fi - - -LIBS="$ice_save_LIBS" -CFLAGS="$ice_save_CFLAGS" -CPPFLAGS="$ice_save_CPPFLAGS" -LDFLAGS="$ice_save_LDFLAGS" -fi - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir - -trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@CPP@%$CPP%g -s%@LIBNSL@%$LIBNSL%g -s%@LIBSOCKET@%$LIBSOCKET%g -s%@LIBM@%$LIBM%g -s%@LIBC@%$LIBC%g -s%@LIBGEN@%$LIBGEN%g -s%@X_CFLAGS@%$X_CFLAGS%g -s%@X_PRE_LIBS@%$X_PRE_LIBS%g -s%@X_LIBS@%$X_LIBS%g -s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g -s%@X11_LIBS@%$X11_LIBS%g -s%@XT_LIBS@%$XT_LIBS%g -s%@XEXT_LIBS@%$XEXT_LIBS%g -s%@XPM_LIBS@%$XPM_LIBS%g -s%@MISSING_MOTIF@%$MISSING_MOTIF%g -s%@XP_LIBS@%$XP_LIBS%g -s%@XM_LIBS@%$XM_LIBS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <<EOF - CONFIG_HEADERS="config.h" -EOF -cat >> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <<EOF - -EOF -cat >> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/configure.in b/configure.in index 8ec8aade..6e4eaded 100644 --- a/configure.in +++ b/configure.in @@ -128,6 +128,32 @@ AC_MSG_WARN([The X toolkit library '-lXt' could not be found. fi AC_SUBST(XT_LIBS) dnl + + + + + +dnl +dnl Check for Xaw libraries +dnl +XAW_LIBS="" +AC_CHECK_LIB(Xaw, XawInitializeWidgetSet, XAW_LIBS="-lXaw",, + ${X_PRE_LIBS} ${X11_LIBS}) +if test "$XAW_LIBS" = ""; then +dnl Not having Xaw is fatal. Let the user fix this. +AC_MSG_WARN([The Xaw library '-lXaw' could not be found. + Please use the configure options '--x-includes=DIR' + and '--x-libraries=DIR' to specify the X location. + See the file 'config.log' for further diagnostics.]) +fi +AC_SUBST(XAW_LIBS) +dnl + + + + + + dnl dnl Check for X extension libraries dnl @@ -4,19 +4,32 @@ #include <math.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/socket.h> +#include <sys/time.h> #include <fcntl.h> #include <netinet/in.h> +#include <syslog.h> + #include "gpsd.h" #include "nmea.h" +#define BUFSIZE 4096 + +extern int debug; #define PI 3.14159265358979323846 +extern char *latitude, *longitude; +extern char latd, lond; enum { - EM_HUNT_FF, EM_HUNT_81, EM_HUNT_ID, EM_HUNT_WC, EM_HUNT_FLAGS, EM_HUNT_CS, EM_HUNT_DATA + EM_HUNT_FF, EM_HUNT_81, EM_HUNT_ID, EM_HUNT_WC, + EM_HUNT_FLAGS, EM_HUNT_CS, EM_HUNT_DATA }; #define O(x) (x-6) +static unsigned short sn = 0; +static int eminit; + struct header { unsigned short sync; unsigned short id; @@ -25,73 +38,167 @@ struct header { unsigned short csum; }; +static void analyze(struct header *, unsigned short *, fd_set *, fd_set *); + unsigned short em_checksum(unsigned short *w, int n) { unsigned short csum = 0; - while (n--) csum += *(w++); + while (n--) + csum += *(w++); csum = -csum; return csum; } -#ifdef TONMEA -em_tonmea() +/* em_spew - Takes a message type, an array of data words, and a length + for the array, and prepends a 5 word header (including checksum). + The data words are expected to be checksummed */ + +static void em_spew(int type, void *dat, int dlen) { struct header h; - unsigned short data[5]; - static sn; - if (sn > 32767) - sn = 0; + h.flags = 0; h.sync = 0x81ff; - h.id = 1331; - h.ndata = 3; - h.flags = 0; - h.csum = em_checksum(&h, 4); + h.id = type; + h.ndata = dlen - 1; + h.csum = em_checksum((unsigned short *) &h, 4); + + write(gNMEAdata.fdout, &h, sizeof(h)); + write(gNMEAdata.fdout, dat, sizeof(unsigned short) * dlen); +} + +static long putlong(char *dm, int sign) +{ + double tmpl; + long rad; + + tmpl = fabs(atof(dm)); + + rad = (floor(tmpl/100) + (fmod(tmpl, 100.0)/60)) * 100000000*PI/180; + + if (sign) + rad = -rad; + + return rad; +} + +static void em_init() +{ + unsigned short data[22]; + time_t t; + struct tm *tm; + + eminit = 0; + + t = time(NULL); + tm = gmtime(&t); + + if (sn++ > 32767) + sn = 0; + + memset(data, 0, sizeof(data)); data[0] = sn; // sequence number - data[1] = 0; // reserved - data[2] = 1; // nmea protocol - data[3] = em_checksum(data, 3); - write(gNMEAdata.fdout, &h, sizeof(h)); - write(gNMEAdata.fdout, data, sizeof(unsigned short) * 5); + data[1] = (1 << 2) | (1 << 3); + data[2] = data[3] = data[4] = 0; + data[5] = tm->tm_mday; + data[6] = tm->tm_mon + 1; + data[7] = tm->tm_year + 1900; + data[8] = tm->tm_hour; + data[9] = tm->tm_min; + data[10] = tm->tm_sec; + *(long *) (data + 11) = putlong(latitude, (latd == 'S') ? 1 : 0); + *(long *) (data + 13) = putlong(longitude, (lond == 'W') ? 1 : 0); + data[15] = data[16] = 0; + data[17] = data[18] = data[19] = data[20] = 0; + data[21] = em_checksum(data, 21); + + em_spew(1200, &data, 22); } -#endif +void do_eminit() +{ + /* Make sure these are zero before 1002 handler called */ + gNMEAdata.pdop = gNMEAdata.hdop = gNMEAdata.vdop = 0; + eminit = 1; +} static long getlong(void *p) { return *(long *) p; } -static void handle1000(unsigned short *p) + +static unsigned long getulong(void *p) { + return *(unsigned long *) p; +} + +static double degtodm(double a) +{ + double d, m, t; + + d = floor(a); + m = modf(a, &t); + t = d * 100 + m * 60; + return t; +} + +static void handle1000(unsigned short *p) +{ #if 0 fprintf(stderr, "date: %d %d %d %d:%d:%d\n", p[O(19)], p[O(20)], p[O(21)], p[O(22)], p[O(23)], p[O(24)]); fprintf(stderr, " solution invalid:\n"); fprintf(stderr, " altitude: %d\n", (p[O(10)] & 1) ? 1 : 0); - fprintf(stderr, " not enought satellites: %d\n", (p[O(10)] & 4) ? 1 : 0); + fprintf(stderr, " no diff gps: %d\n", (p[O(10)] & 2) ? 1 : 0); + fprintf(stderr, " not enough satellites: %d\n", (p[O(10)] & 4) ? 1 : 0); fprintf(stderr, " exceed max EHPE: %d\n", (p[O(10)] & 8) ? 1 : 0); fprintf(stderr, " exceed max EVPE: %d\n", (p[O(10)] & 16) ? 1 : 0); + fprintf(stderr, " solution type:\n"); + fprintf(stderr, " propagated: %d\n", (p[O(11)] & 1) ? 1 : 0); + fprintf(stderr, " altitude: %d\n", (p[O(11)] & 2) ? 1 : 0); + fprintf(stderr, " differential: %d\n", (p[O(11)] & 4) ? 1 : 0); fprintf(stderr, "Number of measurements in solution: %d\n", p[O(12)]); fprintf(stderr, "Lat: %f\n", 180.0 / (PI / ((double) getlong(p + O(27)) / 100000000))); fprintf(stderr, "Lon: %f\n", 180.0 / (PI / ((double) getlong(p + O(29)) / 100000000))); fprintf(stderr, "Alt: %f\n", (double) getlong(p + O(31)) / 100.0); - fprintf(stderr, "Map datum: %d\n\n", p[O(39)]); + fprintf(stderr, "Speed: %f\n", (double) getlong(p + O(34)) / 100.0) * 1.94387; + fprintf(stderr, "Map datum: %d\n", p[O(39)]); + fprintf(stderr, "Magnetic variation: %f\n", p[O(37)] * 180 / (PI * 10000)); + fprintf(stderr, "Course: %f\n", (p[O(36)] * 180 / (PI * 1000))); + fprintf(stderr, "Separation: %f\n", (p[O(33)] / 100)); #endif - sprintf(gNMEAdata.utc, "%02d/%02d/%d %02d:%02d:%02d", p[O(19)], p[O(20)], p[O(21)], p[O(22)], p[O(23)], p[O(24)]); + gNMEAdata.mag_var = p[O(37)] * 180 / (PI * 10000); // degrees + + gNMEAdata.course = p[O(36)] * 180 / (PI * 1000); // degrees + + gNMEAdata.satellites = p[O(12)]; + + gNMEAdata.hours = p[O(22)]; + + gNMEAdata.minutes = p[O(23)]; + + gNMEAdata.seconds = p[O(24)]; + + gNMEAdata.year = p[O(21)]; + + gNMEAdata.month = p[O(20)]; + + gNMEAdata.day = p[O(19)]; + gNMEAdata.latitude = 180.0 / (PI / ((double) getlong(p + O(27)) / 100000000)); gNMEAdata.longitude = 180.0 / (PI / ((double) getlong(p + O(29)) / 100000000)); - gNMEAdata.speed = ((double) getlong(p + O(34)) / 100000000) * (1609.344 / 3600); + gNMEAdata.speed = ((double) getulong(p + O(34)) / 100.0) * 1.94387; gNMEAdata.altitude = (double) getlong(p + O(31)) / 100.0; gNMEAdata.status = (p[O(10)] & 0x1c) ? 0 : 1; @@ -101,25 +208,184 @@ static void handle1000(unsigned short *p) } else { gNMEAdata.mode = 1; } + + gNMEAdata.separation = p[O(33)] / 100; // meters + } static void handle1002(unsigned short *p) { + int i, j, k; + + gNMEAdata.ZCHseen = 1; + for (j = 0; j < 12; j++) { + gNMEAdata.used[j] = 0; + } + for (i = 0; i < 12; i++) { + gNMEAdata.Zs[i] = p[O(16 + (3 * i))]; + gNMEAdata.Zv[i] = (p[O(15 + (3 * i))] & 0xf); +#if 0 + fprintf(stderr, "Sat%02d:", i); + fprintf(stderr, " used:%d", (p[O(15 + (3 * i))] & 1) ? 1 : 0); + fprintf(stderr, " eph:%d", (p[O(15 + (3 * i))] & 2) ? 1 : 0); + fprintf(stderr, " val:%d", (p[O(15 + (3 * i))] & 4) ? 1 : 0); + fprintf(stderr, " dgps:%d", (p[O(15 + (3 * i))] & 8) ? 1 : 0); + fprintf(stderr, " PRN:%d", p[O(16 + (3 * i))]); + fprintf(stderr, " C/No:%d\n", p[O(17 + (3 * i))]); +#endif + for (j = 0; j < 12; j++) { + if (gNMEAdata.PRN[j] != p[O(16 + (3 * i))]) + continue; + gNMEAdata.used[j] = (p[O(15 + (3 * i))] & 1); + gNMEAdata.ss[j] = p[O(17 + (3 * i))]; + break; + } + } } -void analyze(struct header *h, unsigned short *p) +static void handle1003(unsigned short *p) { + int i, j, k; + char *bufp, *bufp2; + + gNMEAdata.pdop = p[O(10)]; + gNMEAdata.hdop = p[O(11)]; + gNMEAdata.vdop = p[O(12)]; + gNMEAdata.in_view = p[O(14)]; + + for (j = 0; j < 12; j++) { + if (j < gNMEAdata.in_view) { + gNMEAdata.PRN[j] = p[O(15 + (3 * j))]; + gNMEAdata.azimuth[j] = p[O(16 + (3 * j))] * 180 / (PI * 10000); + gNMEAdata.elevation[j] = p[O(17 + (3 * j))] * 180 / (PI * 10000); +#if 0 + fprintf(stderr, "Sat%02d:", i); + fprintf(stderr, " PRN:%d", p[O(15 + (3 * i))]); + fprintf(stderr, " az:%d", p[O(16 + (3 * i))]); + fprintf(stderr, " el:%d", p[O(17 + (3 * i))]); + fprintf(stderr, "\n"); +#endif + } else { + gNMEAdata.PRN[j] = 0; + gNMEAdata.azimuth[j] = 0.0; + gNMEAdata.elevation[j] = 0.0; + } + } +} + +static void analyze(struct header *h, unsigned short *p, fd_set * afds, fd_set * nmea_fds) +{ + unsigned char buf[BUFSIZE]; + char *bufp; + char *bufp2; + int i = 0, j = 0, k = 0, nmea = 0; + int fd, nfds; + if (p[h->ndata] == em_checksum(p, h->ndata)) { + if (debug > 5) + fprintf(stderr, "id %d\n", h->id); switch (h->id) { case 1000: handle1000(p); + bufp = buf; + if (gNMEAdata.mode > 1) { + sprintf(bufp, + "$GPGGA,%02d%02d%02d,%lf,%c,%lf,%c,%d,%02d,%.2f,%.1f,%c,%f,%c,%s,%s*", + gNMEAdata.hours, gNMEAdata.minutes, gNMEAdata.seconds, + degtodm(fabs(gNMEAdata.latitude)), + ((gNMEAdata.latitude > 0) ? 'N' : 'S'), + degtodm(fabs(gNMEAdata.longitude)), + ((gNMEAdata.longitude > 0) ? 'E' : 'W'), + gNMEAdata.mode, gNMEAdata.satellites, gNMEAdata.hdop, + gNMEAdata.altitude, 'M', gNMEAdata.separation, 'M', "", ""); + add_checksum(bufp + 1); + bufp = bufp + strlen(bufp); + } + sprintf(bufp, + "$GPRMC,%02d%02d%02d,%c,%lf,%c,%lf,%c,%f,%f,%02d%02d%02d,%02f,%c*", + gNMEAdata.hours, gNMEAdata.minutes, gNMEAdata.seconds, + gNMEAdata.status ? 'A' : 'V', degtodm(fabs(gNMEAdata.latitude)), + ((gNMEAdata.latitude > 0) ? 'N' : 'S'), + degtodm(fabs(gNMEAdata.longitude)), + ((gNMEAdata.longitude > 0) ? 'E' : 'W'), gNMEAdata.speed, + gNMEAdata.course, gNMEAdata.day, gNMEAdata.month, + (gNMEAdata.year - 1900), gNMEAdata.mag_var, + (gNMEAdata.mag_var > 0) ? 'E' : 'W'); + add_checksum(bufp + 1); + nmea = 1000; break; - case 1002: handle1002(p); + bufp2 = bufp = buf; + sprintf(bufp, "$GPGSA,%c,%d,", 'A', gNMEAdata.mode); + j = 0; + for (i = 0; i < 12; i++) { + if (gNMEAdata.used[i]) { + bufp = bufp + strlen(bufp); + sprintf(bufp, "%02d,", gNMEAdata.PRN[i]); + j++; + } + } + for (i = j; i < 12; i++) { + bufp = bufp + strlen(bufp); + sprintf(bufp, ","); + } + bufp = bufp + strlen(bufp); + sprintf(bufp, "%.2f,%.2f,%.2f*", gNMEAdata.pdop, gNMEAdata.hdop, + gNMEAdata.vdop); + add_checksum(bufp2 + 1); + bufp2 = bufp = bufp + strlen(bufp); + sprintf(bufp, "$PRWIZCH"); + bufp = bufp + strlen(bufp); + for (i = 0; i < 12; i++) { + sprintf(bufp, ",%02d,%X", gNMEAdata.Zs[i], gNMEAdata.Zv[i]); + bufp = bufp + strlen(bufp); + } + sprintf(bufp, "*"); + bufp = bufp + strlen(bufp); + add_checksum(bufp2 + 1); + nmea = 1002; + break; + case 1003: + handle1003(p); + bufp2 = bufp = buf; + j = (gNMEAdata.in_view / 4) + (((gNMEAdata.in_view % 4) > 0) ? 1 : 0); + while (i < 12) { + if (i % 4 == 0) + sprintf(bufp, "$GPGSV,%d,%d,%02d", j, (i / 4) + 1, gNMEAdata.in_view); + bufp += strlen(bufp); + if (i <= gNMEAdata.in_view && gNMEAdata.elevation[i]) + sprintf(bufp, ",%02d,%02d,%03d,%02d", gNMEAdata.PRN[i], + gNMEAdata.elevation[i], gNMEAdata.azimuth[i], gNMEAdata.ss[i]); + else + sprintf(bufp, ",%02d,00,000,%02d,", gNMEAdata.PRN[i], + gNMEAdata.ss[i]); + bufp += strlen(bufp); + if (i % 4 == 3) { + sprintf(bufp, "*"); + add_checksum(bufp2 + 1); + bufp += strlen(bufp); + bufp2 = bufp; + } + i++; + } + nmea = 1003; break; } } + if (nmea > 0) { + nfds = getdtablesize(); + if (debug > 4) + fprintf(stderr, "%s", buf); + for (fd = 0; fd < nfds; fd++) + if (FD_ISSET(fd, nmea_fds)) + if (write(fd, buf, strlen(buf)) < 0) { + FD_CLR(fd, afds); + FD_CLR(fd, nmea_fds); + } + } + if (eminit) + em_init(); } @@ -133,7 +399,7 @@ static int putword(unsigned short *p, unsigned char c, unsigned int n) } -static void em_eat(unsigned char c) +static void em_eat(unsigned char c, fd_set * afds, fd_set * nmea_fds) { static int state = EM_HUNT_FF; static struct header h; @@ -187,22 +453,20 @@ static void em_eat(unsigned char c) if (!(byte = putword(data + words, c, byte))) words++; if (words == h.ndata + 1) { - analyze(&h, data); + analyze(&h, data, afds, nmea_fds); free(data); state = EM_HUNT_FF; } break; - } - } -int handle_EMinput(int input) +int handle_EMinput(int input, fd_set * afds, fd_set * nmea_fds) { unsigned char c; if (read(input, &c, 1) != 1) return 1; - em_eat(c); + em_eat(c, afds, nmea_fds); return 0; } @@ -1,4 +1,3 @@ - #include "config.h" #include <unistd.h> #include <stdlib.h> @@ -63,8 +62,10 @@ int nfds; int verbose = 1; int bincount; +int reopen = 0; + static int handle_input(int input, fd_set * afds, fd_set * nmea_fds); -extern int handle_EMinput(int input); +extern int handle_EMinput(int input, fd_set * afds, fd_set * nmea_fds); static int handle_request(int fd, fd_set * fds); static void onsig(int sig) @@ -74,6 +75,11 @@ static void onsig(int sig) exit(10 + sig); } +static void sigusr1(int sig) +{ + reopen = 1; +} + int daemonize() { int fd; @@ -218,6 +224,7 @@ int main(int argc, char *argv[]) daemonize(); /* Handle some signals */ + signal(SIGUSR1, sigusr1); signal(SIGINT, onsig); signal(SIGHUP, onsig); signal(SIGTERM, onsig); @@ -259,12 +266,22 @@ int main(int argc, char *argv[]) FD_SET(ssock, &afds); } if (input >= 0 && FD_ISSET(input, &rfds)) { - if (device_type == DEVICE_EARTHMATEb) - handle_EMinput(input); + if (device_type == DEVICE_EARTHMATEb) + handle_EMinput(input, &afds, &nmea_fds); else handle_input(input, &afds, &nmea_fds); } need_gps = 0; + if (reopen) { + FD_CLR(input, &afds); + reopen = 0; + serial_close(); + if ((input = serial_open()) < 0) + errexit("serial open: "); + FD_SET(input, &afds); + gNMEAdata.fdin = input; + gNMEAdata.fdout = input; + } for (fd = 0; fd < nfds; fd++) { if (fd != msock && fd != input && FD_ISSET(fd, &rfds)) { if (input == -1) { @@ -397,7 +414,7 @@ static int handle_input(int input, fd_set * afds, fd_set * nmea_fds) if (buf[offset] == '\n' || buf[offset] == '\r') { buf[offset] = '\0'; if (strlen(buf)) { - handle_message(buf); + handle_message(buf); strcat(buf, "\r\n"); for (fd = 0; fd < nfds; fd++) { if (FD_ISSET(fd, nmea_fds)) { @@ -1,13 +1,13 @@ Begin3 Title: gpsd -Version: 0.94 -Entered-date: 19990124 +Version: 0.99 +Entered-date: 19990717 Description: Combines gpsd and gpsclient. A sample client for gpsd, and a gps debuging tool. Connects to gps via serial port or socket connection. A user land daemon for nmea capable gps receivers. Client/server, multiple clients, chaining, filtering. -Keywords: gps, daemon, gis, maping, tripmate +Keywords: gps, daemon, gis, maping, tripmate, earthmate, garmin Author: remco@rvt.com (Remco Treffkorn) Maintained-by: remco@rvt.com (Remco Treffkorn) Primary-site: ftp://ftp.ugraf.com/pub/gpsd @@ -15,6 +15,7 @@ struct OUTDATA { double latitude; // Latitude and longitude in format "d.ddddd" double longitude; + double altitude; // Altitude in meters double speed; // Speed over ground, knots @@ -43,12 +44,35 @@ struct OUTDATA { int ss[12]; // signal strength + int used[12]; // used in solution + int ZCHseen; // flag int Zs[12]; // for the rockwell PRWIZCH int Zv[12]; // value + int year; + + int month; + + int day; + + int hours; + + int minutes; + + int seconds; + + double separation; + + double mag_var; + + double course; + + int seen[12]; + + int valid[12]; // signal valid }; #define C_LATLON 1 @@ -64,5 +88,4 @@ extern void processPRWIZCH(char *sentence); extern void processGPGSA(char *sentence); extern void add_checksum(char *sentence); extern short checksum(char *sentence); - extern struct OUTDATA gNMEAdata; @@ -89,7 +89,7 @@ void process_exception(char *sentence) write(gNMEAdata.fdout, "EARTHA\r\n", 8); device_type = DEVICE_EARTHMATEb; syslog(LOG_NOTICE, "Found an EarthMate (id)."); - /*FIXME: should init the darn thing*/ + do_eminit(); } else if (debug > 1) { fprintf(stderr, "Unknown exception: \"%s\"", sentence); @@ -1,6 +1,6 @@ #ifndef _VERSION_H #define _VERSION_H -#define VERSION "0.96" +#define VERSION "0.99" #endif diff --git a/xgpsspeed.c b/xgpsspeed.c new file mode 100644 index 00000000..8164d1a9 --- /dev/null +++ b/xgpsspeed.c @@ -0,0 +1,196 @@ +/* GPS speedometer as a wrapper around an Athena widget Tachometer + * - Derrick J Brashear <shadow@dementia.org> + * Tachometer widget from Kerberometer (xklife) + */ +#include "config.h" +#include "xgpsspeed.h" +#include "xgpsspeed.icon" +#include "nmea.h" +#include <sys/socket.h> +#include <sys/ioctl.h> +#define BUFSIZE 4096 +#define DEFAULTPORT "5678" +char latd, lond; +double latitude, longitude; +int device_type; +int debug = 0; + +#if defined(ultrix) || defined(SOLARIS) +extern double rint(); +#endif + +Widget toplevel, base; +Widget tacho, label, title; + +static XrmOptionDescRec options[] = { +{"-rv", "*reverseVideo", XrmoptionNoArg, "TRUE"}, +{"-nc", "*needleColor", XrmoptionSepArg, NULL}, +{"-needlecolor","*needleColor", XrmoptionSepArg, NULL}, +}; + +/* + * Definition of the Application resources structure. + */ + +typedef struct _XGpsResources { +} XGpsResources; + +XGpsResources resources; + +#define Offset(field) (XtOffset(XGpsResources *, field)) + +static XtResource my_resources[] = { +}; + +String fallback_resources[] = +{ +}; + +static void open_input(XtAppContext app); + +#undef Offset + +int errexit(char *s) +{ + perror(s); + //serial_close(); + exit(1); +} + +int +main(int argc, char **argv) +{ + Arg args[10]; + XtAppContext app; + Cardinal i; + char *cp; + int ret; + + + toplevel = XtVaAppInitialize(&app, "XGpsSpeed", options, XtNumber(options), + &argc, argv, fallback_resources, NULL); + + XtGetApplicationResources( toplevel, (caddr_t) &resources, + my_resources, XtNumber(my_resources), + NULL, (Cardinal) 0); + + /**** Shell Widget ****/ + i = 0; + XtSetArg(args[0], XtNiconPixmap, + XCreateBitmapFromData(XtDisplay(toplevel), + XtScreen(toplevel)->root, xgps_bits, + xgps_width, xgps_height)); i++; + XtSetValues(toplevel, args, i); + + /**** Form widget ****/ + base = XtCreateManagedWidget("pane", panedWidgetClass, toplevel, NULL, 0); + + /**** Label widget (Title) ****/ + i = 0; + XtSetArg(args[i], XtNlabel, "GPS Speedometer"); i++; + label = XtCreateManagedWidget("title", labelWidgetClass, + base, args, i); + + /**** Label widget ****/ + i = 0; + XtSetArg(args[i], XtNlabel, "Miles per Hour"); i++; + label = XtCreateManagedWidget("name", labelWidgetClass, + base, args, i); + + /**** Tachometer widget ****/ + tacho = XtCreateManagedWidget("meter", + tachometerWidgetClass, + base, NULL, 0); + + XtRealizeWidget(toplevel); + open_input(app); + + XtAppMainLoop(app); +} + + + +Usage() +{ + fprintf(stderr, + "xgpsspeed <Toolkit Options> [-rv] [-nc needlecolor]\n"); + exit(-1); +} + + +#if 0 +#if defined(i386) || defined(__hpux) +#define rint (int) +#endif +#endif + +void update_display() +{ + int new = rint(gNMEAdata.speed * 6076.12 / 5280); + // fprintf(stderr, "gNMEAspeed %f scaled %f %d\n", gNMEAdata.speed, rint(gNMEAdata.speed * 5208/6706.12), (int)rint(gNMEAdata.speed * 5208/6706.12)); + if (new > 100) + new = 100; + + TachometerSetValue(tacho, new); +} + +static void handle_input(XtPointer client_data, int *source, XtInputId * id) +{ + double speed; + static unsigned char buf[BUFSIZE]; /* that is more than a sentence */ + static int offset = 0; + int count; + + ioctl(*source, FIONREAD, &count); // this is BAD! Why can't I make the + // socket non blocking for read? + + while (offset < BUFSIZE && count--) { + if (read(*source, buf + offset, 1) != 1) + return; + + if (buf[offset] == '\n') { + if (buf[offset - 1] == '\r') + buf[offset - 1] = '\0'; + handle_message(buf); + update_display(); + offset = 0; + return; + } + offset++; + } +} + +int my_serial_open() +{ + char *temp; + char *p; + char *port = DEFAULTPORT; + char *device_name="gps.mayko.com"; + int one = 1; + int ttyfd; + + temp = malloc(strlen(device_name) + 1); + strcpy(temp, device_name); + + //temp now holds the HOSTNAME portion and port the port number. + ttyfd = connectTCP(temp, port); + free(temp); + port = 0; + + setsockopt(ttyfd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one)); + + if (write(ttyfd, "r\n", 2) != 2) + errexit("Can't write to socket"); + return ttyfd; +} + +static void open_input(XtAppContext app) +{ + int input = 0; + XtInputId input_id; + + input = my_serial_open(); + + input_id = XtAppAddInput(app, input, (XtPointer) XtInputReadMask, + handle_input, NULL); +} diff --git a/xgpsspeed.h b/xgpsspeed.h new file mode 100644 index 00000000..e4311833 --- /dev/null +++ b/xgpsspeed.h @@ -0,0 +1,10 @@ +#include <stdio.h> +#include <math.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Shell.h> +#include <X11/Xaw/Box.h> +#include <X11/Xaw/Label.h> +#include <X11/Xaw/Command.h> +#include <X11/Xaw/Paned.h> +#include <Tachometer.h> diff --git a/xgpsspeed.icon b/xgpsspeed.icon new file mode 100644 index 00000000..2b4e3e6c --- /dev/null +++ b/xgpsspeed.icon @@ -0,0 +1,33 @@ +#define xgps_width 50 +#define xgps_height 50 +static unsigned char xgps_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0x01, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc2, 0x0f, 0x00, 0x00, 0x00, + 0xc0, 0x03, 0x02, 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x02, 0x78, 0x00, + 0x00, 0x00, 0xb8, 0x00, 0x02, 0xf0, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, + 0xc8, 0x01, 0x00, 0x00, 0x06, 0x01, 0x00, 0x04, 0x03, 0x00, 0x00, 0x07, + 0x02, 0x00, 0x02, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x80, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0xff, 0x0c, 0x00, + 0x00, 0x80, 0xf9, 0x03, 0x6f, 0x10, 0x00, 0x00, 0x40, 0xb0, 0x03, 0x6f, + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x03, 0x67, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x03, 0x37, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x37, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x03, 0x37, 0x00, 0x00, 0x02, 0x00, 0x60, 0x03, 0x37, 0x00, + 0x00, 0x07, 0x00, 0x60, 0x03, 0xf7, 0x03, 0x80, 0x0d, 0x00, 0x7e, 0x03, + 0x37, 0x00, 0x00, 0x3f, 0x00, 0x60, 0x03, 0x37, 0x00, 0x00, 0xf2, 0x00, + 0x60, 0x03, 0x37, 0x00, 0x00, 0xc0, 0x03, 0x60, 0x03, 0x37, 0x00, 0x00, + 0x00, 0x07, 0x60, 0x03, 0x67, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x03, 0x6f, + 0x00, 0x00, 0x00, 0x30, 0xb0, 0x03, 0x6f, 0x0c, 0x00, 0x00, 0x80, 0xb1, + 0x03, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfe, 0x03, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x80, 0x01, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x83, 0x00, 0x00, 0x08, 0x06, 0x00, + 0x00, 0x47, 0x00, 0x00, 0x10, 0x07, 0x00, 0x00, 0x26, 0x00, 0x00, 0x20, + 0x03, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, + 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, + 0xc0, 0x03, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00}; |