diff options
-rw-r--r-- | CHANGELOG | 5 | ||||
-rw-r--r-- | COPYING | 339 | ||||
-rw-r--r-- | Gps | 6 | ||||
-rw-r--r-- | INSTALL | 56 | ||||
-rw-r--r-- | Makefile | 129 | ||||
-rw-r--r-- | Makefile.in | 128 | ||||
-rw-r--r-- | README | 64 | ||||
-rw-r--r-- | TODO | 0 | ||||
-rw-r--r-- | aclocal.m4 | 1912 | ||||
-rw-r--r-- | config.cache | 64 | ||||
-rw-r--r-- | config.log | 191 | ||||
-rwxr-xr-x | config.status | 168 | ||||
-rwxr-xr-x | configure | 3819 | ||||
-rw-r--r-- | configure.in | 255 | ||||
-rw-r--r-- | display.c | 196 | ||||
-rw-r--r-- | gps.c | 496 | ||||
-rw-r--r-- | gpsd.c | 368 | ||||
-rw-r--r-- | gpsd.lsm | 18 | ||||
-rw-r--r-- | netlib.c | 120 | ||||
-rw-r--r-- | nmea.h | 67 | ||||
-rw-r--r-- | nmea_parse.c | 234 | ||||
-rw-r--r-- | serial.c | 108 | ||||
-rw-r--r-- | tm.c | 102 |
23 files changed, 8845 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 00000000..08e953ad --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,5 @@ +970421 released version 0.7 ... +970425 version 0.8, some bug fixes. New MODE member, STATUS member changed. +970513 some cleanups in the ini code. version 0.9 ... +980127 combined gpsd + gpsclient. No more init files, command line only. +980127 using GNU autoconf now. version 0.93 ... diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..a43ea212 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. @@ -0,0 +1,6 @@ +*gps_data.time.label.labelString: Time +*gps_data.latitude.label.labelString: Lat. +*gps_data.longitude.label.labelString: Lon. +*gps_data.altitude.label.labelString: Alt. +*gps_data.fix_status.label.labelString: Stat +*gps_data.quit.label.labelString: Quit diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..6cbe4e73 --- /dev/null +++ b/INSTALL @@ -0,0 +1,56 @@ + +The following is from Brook:================================================== + +Run ./configure (or sh configure if the script does not have execute +permission). + +Check the Makefile. + +run make: libgpsd.a, gpsd, and gps are built. + +Copy gpsd and gps wherever you want them to live. + +Copy the app-defaults file Gps to your home directory or to the +system-wide X app-defaults directory. + +Command line options: + -D integer [ set debug level ] + -L longitude [ set longitude ] + -S integer [ set port for daemon ] + -h [ help message ] + -l latitude [ set latitude ] + -p string [ set gps device name ] + -s baud_rate [ set baud rate on gps device ] + +Gps device names may be either device files (e.g., /dev/gps) or ports +served by gpsd (e.g., localhost:5678). The deamon port option +determines which port the daemon will monitor for connections from +either clients or cascaded daemons. Note that the baud rate is only +important when connected directly to the gps device through a serial +port. The latitude/longitude (which must be strings ending in E/W or +N/S, respectively) options are only required if the gps device must be +initialized with a position. + +Good luck ;) +============================================================================== + + +Let me add: + +The "right" thing to do is, to start gpsd on a serial port that has the gps +connected to it. + +Then start gps and have it connect to gpsd via a socket. Give it a device +name like "localhost:5678", which means: connect to the host localhost using +port 5678. + +You can also telnet to this port for testing. When doing that, type an 'R' +followed by <cr>. This should display the RAW nmea sentences the deamon +receives from the gps. + +You can (but please don't) connect gps (the program) directly to a serial +port and a gps (the device). + +Now I am geting confused :) + + Remco diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3f44c50e --- /dev/null +++ b/Makefile @@ -0,0 +1,129 @@ +# Generated automatically from Makefile.in by configure. +# Makefile.in +# $Modified: Thu Jan 22 11:55:32 1998 by brook $ + + +## The C compiler + +# What we use to compile C files. +# CC = cc +CC = gcc + +# The flags we use to compile C files. +CDEBUGFLAGS = -g +CFLAGS = -g -O2 $(CDEBUGFLAGS) + + +## The C preprocessor. + +# What we use for preprocessing. (gcc -E -traditional-cpp) +CPP = gcc -E -traditional-cpp + +# Flags passed to the C preprocessor. () +CPPFLAGS = + +# Definitions to be passed to the C preprocessor. (-DHAVE_CONFIG_H) +DEFS = -DHAVE_TERMIO_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_ATHENA=1 -DHAVE_X11_XAW_FORM_H=1 -DHAVE_X11_XAW_PANNER_H=1 -DHAVE_X11_XAW_PORTHOLE_H=1 -DHAVE_X11_XMU_EDITRES_H=1 -DHAVE_XPM=1 -DHAVE_X11_XPM_H=1 -DHAVE_XP=1 -DHAVE_MOTIF=1 + + +## The Linker. + +# Flags passed to the linker. (-g -O) +LDFLAGS = + +# Use this for building statically linked executables with GCC. +# LDFLAGS = -static + + +## Local libraries + +# Math library (-lm) +LIBM = -lm +# C library (-lc) +LIBC = -lc + +# All libraries shown above +LIBS = $(LIBM) $(LIBC) + + +## X Libraries + +# Special flags for linking with X. (-L/usr/X11R5/lib) +X_LDFLAGS = -L/usr/X11R6/lib + +# Motif library. (-lXm) +LIBXM = -lXm + +# Use this alternative for building `semistatic' executables +# where Motif libraries are statically linked in. +# LIBXM = -Wl,-Bstatic -lXm -Wl,-Bdynamic + +# Athena libraries. (-lXaw -lXmu) +LIBXAW = -lXaw -lXmu + +# X extension library; needed for Athena and Motif >= 2.0. (-lXext) +LIBXEXT = -lXext + +# Xpm library; needed for DDD and sometimes for Motif >= 2.0. (-lXpm) +LIBXPM = -lXpm + +# Xp library; sometimes needed for Motif >= 2.1. (-lXp) +LIBXP = -lXp + +# gen library; sometimes needed for Motif >= 2.0. (-lgen) +LIBGEN = + +# X toolkit library. (-lXt) +LIBXT = -lXt + +# X library. (-lSM -lICE -lX11 -lnsl -lsocket) +LIBX11 = -lSM -lICE -lX11 + +# All libraries shown above +ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXP) $(LIBXPM) $(LIBXAW) $(LIBXEXT) \ +$(LIBXT) $(LIBX11) $(LIBGEN) + + +## C compile commands. +COMPILE.c = $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c +LINK.c = $(CC) $(LDFLAGS) +COMPILE_AND_LINK.c = \ + $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS) + +## Where to look for X include files. (-I/usr/X11R5/include) +X_INCLUDE = -I/usr/X11R6/include + +## Where to look for include files. +INCLUDE = -I. $(X_INCLUDE) + +## Implicit rules. +.SUFFIXES: .c +.c.o: + $(COMPILE.c) $(INCLUDE) -o $@ $< + + +## Libraries and object files +LIB_OBJECTS = netlib.o nmea_parse.o serial.o tm.o $(MOTIF_OBJECTS) + +## Programs +PROGRAMS=gpsd + +## Motif dependent programs and object files +MOTIF_PROGRAMS=gps +MOTIF_OBJECTS = display.o + + +all: $(PROGRAMS) $(MOTIF_PROGRAMS) + +gpsd: gpsd.o libgpsd.a + $(LINK.c) -o $@ gpsd.o -L. -lgpsd $(LIBS) + +gps: gps.o libgpsd.a + $(LINK.c) -o $@ gps.o -L. -lgpsd $(ALL_X_LIBS) $(LIBS) + +libgpsd.a: $(LIB_OBJECTS) + ar -r libgpsd.a $(LIB_OBJECTS) + ranlib libgpsd.a + +clean: + rm -f *.o *.a gpsd gps *~ diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..f89adb8b --- /dev/null +++ b/Makefile.in @@ -0,0 +1,128 @@ +# Makefile.in +# $Modified: Thu Jan 22 11:55:32 1998 by brook $ + + +## The C compiler + +# What we use to compile C files. +# CC = cc +CC = @CC@ + +# The flags we use to compile C files. +CDEBUGFLAGS = -g +CFLAGS = @CFLAGS@ $(CDEBUGFLAGS) + + +## The C preprocessor. + +# What we use for preprocessing. (gcc -E -traditional-cpp) +CPP = @CPP_TRADITIONAL@ + +# Flags passed to the C preprocessor. () +CPPFLAGS = @CPPFLAGS@ + +# Definitions to be passed to the C preprocessor. (-DHAVE_CONFIG_H) +DEFS = @DEFS@ + + +## The Linker. + +# Flags passed to the linker. (-g -O) +LDFLAGS = @LDFLAGS@ + +# Use this for building statically linked executables with GCC. +# LDFLAGS = -static @LDFLAGS@ + + +## Local libraries + +# Math library (-lm) +LIBM = @LIBM@ +# C library (-lc) +LIBC = @LIBC@ + +# All libraries shown above +LIBS = $(LIBM) $(LIBC) + + +## X Libraries + +# Special flags for linking with X. (-L/usr/X11R5/lib) +X_LDFLAGS = @X_LIBS@ + +# Motif library. (-lXm) +LIBXM = @XM_LIBS@ + +# Use this alternative for building `semistatic' executables +# where Motif libraries are statically linked in. +# LIBXM = -Wl,-Bstatic @XM_LIBS@ -Wl,-Bdynamic + +# Athena libraries. (-lXaw -lXmu) +LIBXAW = @XAW_LIBS@ + +# X extension library; needed for Athena and Motif >= 2.0. (-lXext) +LIBXEXT = @XEXT_LIBS@ + +# Xpm library; needed for DDD and sometimes for Motif >= 2.0. (-lXpm) +LIBXPM = @XPM_LIBS@ + +# Xp library; sometimes needed for Motif >= 2.1. (-lXp) +LIBXP = @XP_LIBS@ + +# gen library; sometimes needed for Motif >= 2.0. (-lgen) +LIBGEN = @LIBGEN@ + +# X toolkit library. (-lXt) +LIBXT = @XT_LIBS@ + +# X library. (-lSM -lICE -lX11 -lnsl -lsocket) +LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@ + +# All libraries shown above +ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXP) $(LIBXPM) $(LIBXAW) $(LIBXEXT) \ +$(LIBXT) $(LIBX11) $(LIBGEN) + + +## C compile commands. +COMPILE.c = $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c +LINK.c = $(CC) $(LDFLAGS) +COMPILE_AND_LINK.c = \ + $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS) + +## Where to look for X include files. (-I/usr/X11R5/include) +X_INCLUDE = @X_CFLAGS@ + +## Where to look for include files. +INCLUDE = -I. $(X_INCLUDE) + +## Implicit rules. +.SUFFIXES: .c +.c.o: + $(COMPILE.c) $(INCLUDE) -o $@ $< + + +## Libraries and object files +LIB_OBJECTS = netlib.o nmea_parse.o serial.o tm.o $(MOTIF_OBJECTS) + +## Programs +PROGRAMS=gpsd + +## Motif dependent programs and object files +@MISSING_MOTIF@MOTIF_PROGRAMS=gps +@MISSING_MOTIF@MOTIF_OBJECTS = display.o + + +all: $(PROGRAMS) $(MOTIF_PROGRAMS) + +gpsd: gpsd.o libgpsd.a + $(LINK.c) -o $@ gpsd.o -L. -lgpsd $(LIBS) + +gps: gps.o libgpsd.a + $(LINK.c) -o $@ gps.o -L. -lgpsd $(ALL_X_LIBS) $(LIBS) + +libgpsd.a: $(LIB_OBJECTS) + ar -r libgpsd.a $(LIB_OBJECTS) + ranlib libgpsd.a + +clean: + rm -f *.o *.a gpsd gps *~ @@ -0,0 +1,64 @@ + + + +COPYRIGHT +========= + +This software (gpsd) is Copyrighted 1997 by Remco Treffkorn, +I am releasing it under the terms and conditions of the + + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 + +or later. A copy off which is included in the file COPYING. + + + + +GENERAL +======= + +This is the second public release of "gpsd". + +Gpsd is a user land daemon acting as a liason between a gps or +Loran-C receiver and clients. The reiceiver is expected to generate +position information as NMEA0138 sentences, although that can be changed. + +Gpsd listens on port 5678 for clients requesting position, time, +velocity or altitude information. + +Gpsd can take information from the gps and translate it into +something easier to understand for clients. + +The client does not have to run on the same computer ;-) +I have a boat connected to the internet (Ricochet modem) runing +gpsd, the maping program runs here at home (no, I will not give +you the boats IP address :-) + + +There is a sample client released separately. The package is called +"gpsclient". It simply connects to a gpsd and displays satellites +in their current position in the sky. + +Gpsd is tested with DeLormes TripMate und Garmin 38 units. + + +CREDITS +======= + +Nmea_parse.c is modeled after code seen in gpstrans-0.31b by +Carsten Tschach. + +Thanks to Bob Lorenzini <hwm@netcom.com> for his testing and feedback. + +Thanks goes to Brook Milligan <brook@trillium.NMSU.Edu> for his +efforts to combine gpsd and gpsclient into one package. +He also changed the configuration method from Imake to GNU +autoconf. This made it easy to port the code to YOUR particular +platform. + +Be advised: any bugs in this code are mine, and mine only ;-) + + +This is as it stands today, January 27 1998. + +remco@emc.rvt.com diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..f9721f6b --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1912 @@ +dnl $Id: aclocal.m4,v 1.1 1998/08/18 20:43:57 remco Exp $ -*- m4 -*- +dnl ICE and DDD autoconf macros +dnl +dnl Copyright (C) 1995-1997 Technische Universitaet Braunschweig, Germany. +dnl Written by Andreas Zeller <zeller@ips.cs.tu-bs.de>. +dnl +dnl This file is part of the ICE Library. +dnl +dnl The ICE Library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. +dnl +dnl The ICE Library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +dnl See the GNU Library General Public License for more details. +dnl +dnl You should have received a copy of the GNU Library General Public +dnl License along with the ICE Library -- see the file COPYING.LIB. +dnl If not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl +dnl ICE is the incremental configuration environment. +dnl For details, see the ICE World-Wide-Web page, +dnl `http://www.cs.tu-bs.de/softech/ice/', +dnl or send a mail to the ICE developers at `ice@ips.cs.tu-bs.de'. +dnl +dnl DDD is the data display debugger. +dnl For details, see the DDD World-Wide-Web page, +dnl `http://www.cs.tu-bs.de/softech/ddd/', +dnl or send a mail to the DDD developers <ddd@ips.cs.tu-bs.de>. +dnl +dnl +dnl ICE_PROG_CC and ICE_PROG_CXX +dnl ---------------------------- +dnl +dnl Extended compiler checks. Check not only for a compiler, +dnl but also determine whether it compiles a simple "hello, world" +dnl program. +dnl +AC_DEFUN(ICE_PROG_CC, +[ +AC_REQUIRE([AC_ISC_POSIX]) +AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING(whether the C compiler (${CC}) compiles and links a simple C program) +AC_CACHE_VAL(ice_cv_prog_cc, +[ +AC_LANG_SAVE +AC_LANG_C +AC_TRY_LINK([#include <stdio.h>], [printf("hello, world!");], +ice_cv_prog_cc=yes, +ice_cv_prog_cc=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_prog_cc) +if test "$ice_cv_prog_cc" = no; then +AC_MSG_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.) +fi +])dnl +dnl +AC_DEFUN(ICE_PROG_CXX, +[ +AC_REQUIRE([AC_PROG_CXX]) +dnl +if test "$CXX" = gcc; then +dnl +dnl Using gcc as C++ compiler requires linkage with -lstdc++ or -lg++ +dnl +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_LIBS="$LIBS" +AC_CHECK_LIB(m, sin, LIBS="-lm $LIBS") +AC_CHECK_LIB(stdc++, cout, LIBS="-lstdc++ $LIBS") +case "$LIBS" in +*-lstdc++*) +dnl -lstdc++ found - proceed +;; +*) +dnl -lstdc++ not found - try -lg++ instead +AC_CHECK_LIB(g++, cout, LIBS="-lg++ $LIBS") +;; +esac +AC_LANG_RESTORE +fi +dnl +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) compiles a simple program) +AC_CACHE_VAL(ice_cv_prog_cxx, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_LINK([#include <iostream.h>], [cout << "hello, world!";], +ice_cv_prog_cxx=yes, +ice_cv_prog_cxx=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_prog_cxx) +if test "$ice_cv_prog_cxx" = no; then +AC_MSG_ERROR(You must set the environment variable CXX to a working + C++ compiler. Also check the CXXFLAGS settings. + See the file 'config.log' for further diagnostics.) +fi +ice_need_cxxlibs=no +case "$LIBS" in + *-lstdc++*) + case "$CXXLIBS" in + *-lstdc++*) + ;; + *) + ice_need_cxxlibs=yes + ;; + esac + ;; + *-lg++*) + case "$CXXLIBS" in + *-lg++*) + ;; + *) + ice_need_cxxlibs=yes + ;; + esac + ;; +esac +if test "$ice_need_cxxlibs" = yes +then +dnl These libraries are required for all C++ programs. +CXXLIBS="$CXXLIBS $LIBS" +fi +AC_SUBST(CXXLIBS)dnl +LIBS="$ice_save_LIBS" +])dnl +dnl +dnl +dnl ICE_EXTERNAL_TEMPLATES +dnl ---------------------- +dnl +dnl If the C++ compiler accepts the `-fexternal-templates' flag, +dnl set output variable `EXTERNAL_TEMPLATES' to `-fexternal-templates', +dnl empty otherwise. +dnl +AC_DEFUN(ICE_EXTERNAL_TEMPLATES, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) accepts -fexternal-templates) +AC_CACHE_VAL(ice_cv_external_templates, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_cxxflags="$CXXFLAGS" +CXXFLAGS=-fexternal-templates +AC_TRY_COMPILE(,[int a;], +ice_cv_external_templates=yes, ice_cv_external_templates=no) +CXXFLAGS="$ice_save_cxxflags" +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_external_templates) +if test "$ice_cv_external_templates" = yes; then +EXTERNAL_TEMPLATES=-fexternal-templates +fi +AC_SUBST(EXTERNAL_TEMPLATES) +])dnl +dnl +dnl +dnl +dnl ICE_NO_IMPLICIT_TEMPLATES +dnl ------------------------- +dnl +dnl If the C++ compiler accepts the `-fno-implicit-templates' flag, +dnl set output variable `NO_IMPLICIT_TEMPLATES' to `-fno-implicit-templates', +dnl empty otherwise. +dnl +AC_DEFUN(ICE_NO_IMPLICIT_TEMPLATES, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) accepts -fno-implicit-templates) +AC_CACHE_VAL(ice_cv_no_implicit_templates, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_cxxflags="$CXXFLAGS" +CXXFLAGS=-fno-implicit-templates +AC_TRY_COMPILE(,[int a;], +ice_cv_no_implicit_templates=yes, ice_cv_no_implicit_templates=no) +CXXFLAGS="$ice_save_cxxflags" +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_no_implicit_templates) +if test "$ice_cv_no_implicit_templates" = yes; then +NO_IMPLICIT_TEMPLATES=-fno-implicit-templates +fi +AC_SUBST(NO_IMPLICIT_TEMPLATES) +])dnl +dnl +dnl +dnl ICE_ELIDE_CONSTRUCTORS +dnl ---------------------- +dnl +dnl If the C++ compiler accepts the `-felide-constructors' flag, +dnl set output variable `ELIDE_CONSTRUCTORS' to `-felide-constructors', +dnl empty otherwise. +dnl +AC_DEFUN(ICE_ELIDE_CONSTRUCTORS, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) accepts -felide-constructors) +AC_CACHE_VAL(ice_cv_elide_constructors, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_cxxflags="$CXXFLAGS" +CXXFLAGS=-felide-constructors +AC_TRY_COMPILE(,[int a;], +ice_cv_elide_constructors=yes, ice_cv_elide_constructors=no) +CXXFLAGS="$ice_save_cxxflags" +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_elide_constructors) +if test "$ice_cv_elide_constructors" = yes; then +ELIDE_CONSTRUCTORS=-felide-constructors +fi +AC_SUBST(ELIDE_CONSTRUCTORS) +])dnl +dnl +dnl ICE_CONSERVE_SPACE +dnl ------------------ +dnl +dnl If the C++ compiler accepts the `-fconserve-space' flag, +dnl set output variable `CONSERVE_SPACE' to `-fconserve-space', +dnl empty otherwise. +dnl +AC_DEFUN(ICE_CONSERVE_SPACE, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) accepts -fconserve-space) +AC_CACHE_VAL(ice_cv_conserve_space, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_cxxflags="$CXXFLAGS" +CXXFLAGS=-fconserve-space +AC_TRY_COMPILE(,[int a;], +ice_cv_conserve_space=yes, ice_cv_conserve_space=no) +CXXFLAGS="$ice_save_cxxflags" +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_conserve_space) +if test "$ice_cv_conserve_space" = yes; then +CONSERVE_SPACE=-fconserve-space +fi +AC_SUBST(CONSERVE_SPACE) +])dnl +dnl +dnl +dnl +dnl ICE_EFFECTIVE_CXX +dnl ----------------- +dnl +dnl If the C++ compiler accepts the `-Weffc++' flag, +dnl set output variable `EFFECTIVE_CXX' to `-Weffc++', +dnl empty otherwise. +dnl +AC_DEFUN(ICE_EFFECTIVE_CXX, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) accepts -Weffc++) +AC_CACHE_VAL(ice_cv_effective_cxx, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_save_cxxflags="$CXXFLAGS" +CXXFLAGS=-Weffc++ +AC_TRY_COMPILE(,[int a;], +ice_cv_effective_cxx=yes, ice_cv_effective_cxx=no) +CXXFLAGS="$ice_save_cxxflags" +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_effective_cxx) +if test "$ice_cv_effective_cxx" = yes; then +EFFECTIVE_CXX=-Weffc++ +fi +AC_SUBST(EFFECTIVE_CXX) +])dnl +dnl +dnl +dnl +dnl +dnl ICE_CXX_PROBLEMATIC_VERSION +dnl --------------------------- +dnl +dnl If this is GNU C++ earlier than 2.5, issue a warning. +dnl +AC_DEFUN(ICE_CXX_PROBLEMATIC_VERSION, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(if this is a problematic ${CXX} version) +AC_CACHE_VAL(ice_cv_cxx_problematic_version, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_CPP([ +#ifdef __GNUC__ +#if __GNUC__ < 2 +#error ICE works best with GCC version 2.5 or higher +#endif /* __GNUC__ < 2 */ +#ifdef __GNUC_MINOR__ +#if __GNUC__ == 2 && __GNUC_MINOR__ < 5 +#error ICE works best with GCC version 2.5 or higher +#endif /* __GNUC_MINOR__ < 5 */ +#endif /* defined(__GNUC_MINOR__) */ +#endif /* defined(__GNUC__) */ +], +ice_cv_cxx_problematic_version=no, ice_cv_cxx_problematic_version=yes) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_cxx_problematic_version) +if test "$ice_cv_cxx_problematic_version" = yes; then +AC_MSG_WARN(*** This package works best with ${CXX} version 2.5 or higher ***) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CXX_BOOL +dnl ------------ +dnl +dnl If the C++ compiler accepts the `bool' keyword, define `HAVE_BOOL'. +dnl +AC_DEFUN(ICE_CXX_BOOL, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports bool types) +AC_CACHE_VAL(ice_cv_have_bool, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(,[bool b = true;], +ice_cv_have_bool=yes, +ice_cv_have_bool=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_bool) +if test "$ice_cv_have_bool" = yes; then +AC_DEFINE(HAVE_BOOL) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CXX_NAMED_RETURN_VALUES +dnl --------------------------- +dnl +dnl If the C++ compiler supports named return values, +dnl define `HAVE_NAMED_RETURN_VALUES'. +dnl +AC_DEFUN(ICE_CXX_NAMED_RETURN_VALUES, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports named return values) +AC_CACHE_VAL(ice_cv_have_named_return_values, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([ +struct X { + int f(); +}; + +int X::f() return i; +{ + i = 42; +} +], [/* empty */], +ice_cv_have_named_return_values=yes, +ice_cv_have_named_return_values=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_named_return_values) +if test "$ice_cv_have_named_return_values" = yes; then +AC_DEFINE(HAVE_NAMED_RETURN_VALUES) +fi +])dnl +dnl +dnl +dnl ICE_CXX_EXPLICIT_TEMPLATE_INSTANTIATION +dnl --------------------------------------- +dnl +dnl If the C++ compiler supports explicit template instantiation, +dnl define `HAVE_EXPLICIT_TEMPLATE_INSTANTIATION'. +dnl +AC_DEFUN(ICE_CXX_EXPLICIT_TEMPLATE_INSTANTIATION, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports explicit template instantiation) +AC_CACHE_VAL(ice_cv_have_explicit_template_instantiation, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([ +template <class T> class Pointer { public: T *value; }; +template class Pointer<char>; +], [/* empty */], +ice_cv_have_explicit_template_instantiation=yes, +ice_cv_have_explicit_template_instantiation=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_explicit_template_instantiation) +if test "$ice_cv_have_explicit_template_instantiation" = yes; then +AC_DEFINE(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION) +fi +])dnl +dnl +dnl +dnl ICE_CXX_PRETTY_FUNCTION +dnl ----------------------- +dnl +dnl If the C++ compiler supports the __PRETTY_FUNCTION__ macro, +dnl define `HAVE_PRETTY_FUNCTION'. +dnl +AC_DEFUN(ICE_CXX_PRETTY_FUNCTION, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports __PRETTY_FUNCTION__) +AC_CACHE_VAL(ice_cv_have_pretty_function, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +# Testing compilation alone does not suffice -- +# some GCC versions have trouble in linking. +AC_TRY_LINK([#include <stdio.h>], +[puts(__PRETTY_FUNCTION__);], +ice_cv_have_pretty_function=yes, +ice_cv_have_pretty_function=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_pretty_function) +if test "$ice_cv_have_pretty_function" = yes; then +AC_DEFINE(HAVE_PRETTY_FUNCTION) +fi +])dnl +dnl +dnl +dnl ICE_CXX_ARRAY_OPERATOR_NEW +dnl -------------------------- +dnl +dnl If the C++ compiler supports overloading operator new[], +dnl define `HAVE_ARRAY_OPERATOR_NEW'. +dnl +AC_DEFUN(ICE_CXX_ARRAY_OPERATOR_NEW, +[ +AC_REQUIRE([AC_PROG_CXX]) +changequote(,)dnl +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports overloaded new[]) +changequote([,])dnl +AC_CACHE_VAL(ice_cv_have_array_operator_new, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([#include <sys/types.h> +void *operator new[](size_t nbytes);], +/* empty */, +ice_cv_have_array_operator_new=yes, +ice_cv_have_array_operator_new=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_array_operator_new) +if test "$ice_cv_have_array_operator_new" = yes; then +AC_DEFINE(HAVE_ARRAY_OPERATOR_NEW) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CXX_PLACEMENT_NEW +dnl --------------------- +dnl +dnl If the C++ compiler supports placement new, +dnl define `HAVE_PLACEMENT_NEW'. +dnl +AC_DEFUN(ICE_CXX_PLACEMENT_NEW, +[ +AC_REQUIRE([AC_PROG_CXX]) +changequote(,)dnl +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports placement new) +changequote([,])dnl +AC_CACHE_VAL(ice_cv_have_placement_new, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([#include <new.h>], +[int *pi = new (operator new (sizeof(int))) int;], +ice_cv_have_placement_new=yes, +ice_cv_have_placement_new=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_placement_new) +if test "$ice_cv_have_placement_new" = yes; then +AC_DEFINE(HAVE_PLACEMENT_NEW) +fi +])dnl +dnl +dnl +dnl ICE_CXX_LIFETIME_OF_TEMPORARIES +dnl ------------------------------- +dnl +dnl If the C++ compiler realizes ANSI C++ working paper conformant +dnl lifetime of temporaries, define `HAVE_ANSI_LIFETIME_OF_TEMPORARIES'. +dnl +AC_DEFUN(ICE_CXX_LIFETIME_OF_TEMPORARIES, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports ANSI lifetime of temporaries) +AC_CACHE_VAL(ice_cv_have_ansi_lifetime_of_temporaries, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_RUN( +[ +// This program returns 0 if compiled with ANSI C++ compliant +// lifetime of temporaries; 1, otherwise. +static int destructor_called = 0; +struct X { + int dummy; + X(int) {} + X(const X&) {} + ~X() { destructor_called = 1; } +}; +int f(const X&) { return destructor_called; } +X g(const X& x) { return x; } +X h() { return 1; } +int main() { return f(g(h())); } +], +ice_cv_have_ansi_lifetime_of_temporaries=yes, +ice_cv_have_ansi_lifetime_of_temporaries=no, +[ +if test "$GXX" = yes; then +# Cross-compiling with GNU C++: Guess on the version number +AC_TRY_CPP([ +/* Check for GCC versions lower than 2.6 */ +#ifdef __GNUC__ +#if __GNUC__ < 2 +#error +#endif +#if !defined(__GNUC_MINOR__) +#error +#endif +#if __GNUC_MINOR__ < 6 +#error +#endif +#endif +], +ice_cv_have_ansi_lifetime_of_temporaries=yes, +ice_cv_have_ansi_lifetime_of_temporaries=no) +else +# Cross-compiling and not GNU C++: Play it safe. +ice_cv_have_ansi_lifetime_of_temporaries=no +fi +]) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_ansi_lifetime_of_temporaries) +if test "$ice_cv_have_ansi_lifetime_of_temporaries" = yes; then +AC_DEFINE(HAVE_ANSI_LIFETIME_OF_TEMPORARIES) +fi +])dnl +dnl +dnl +dnl ICE_CXX_LONG_LONG +dnl ----------------- +dnl +dnl If the C++ compiler supports `long long' types, define `HAVE_LONG_LONG'. +dnl +AC_DEFUN(ICE_CXX_LONG_LONG, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports long long types) +AC_CACHE_VAL(ice_cv_have_long_long, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(,[long long a;], +ice_cv_have_long_long=yes, +ice_cv_have_long_long=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_long_long) +if test "$ice_cv_have_long_long" = yes; then +AC_DEFINE(HAVE_LONG_LONG) +fi +])dnl +dnl +dnl +dnl ICE_CXX_EXCEPTIONS +dnl ------------------ +dnl +dnl If the C++ compiler handles exceptions, define `HAVE_EXCEPTIONS'. +dnl +AC_DEFUN(ICE_CXX_EXCEPTIONS, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports exception handling) +AC_CACHE_VAL(ice_cv_have_exceptions, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(,[try { throw 1; } catch(...) { }], +ice_cv_have_exceptions=yes, +ice_cv_have_exceptions=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_exceptions) +if test "$ice_cv_have_exceptions" = yes; then +AC_DEFINE(HAVE_EXCEPTIONS) +fi +])dnl +dnl +dnl ICE_CXX_TYPEINFO +dnl ---------------- +dnl +dnl If the C++ compiler supports run-time type info, define `HAVE_TYPEINFO'. +dnl +AC_DEFUN(ICE_CXX_TYPEINFO, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING(whether the C++ compiler (${CXX}) supports run-time type info) +AC_CACHE_VAL(ice_cv_have_typeinfo, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([#include <typeinfo>], +[int x; const char *s = typeid(x).name();], +ice_cv_have_typeinfo=yes, +ice_cv_have_typeinfo=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_have_typeinfo) +if test "$ice_cv_have_typeinfo" = yes; then +AC_DEFINE(HAVE_TYPEINFO) +fi +])dnl +dnl +dnl +dnl ICE_PROG_CPP_TRADITIONAL +dnl ------------------------ +dnl +dnl Set output variable `CPP_TRADITIONAL' to a command that runs a +dnl "traditional" C preprocessor (that is, pre-ANSI-C). +dnl Try each one of `$CPP', `$CC -E', `/lib/cpp' either without flags +dnl or with `-traditional-cpp' or with `-traditional'. +dnl +AC_DEFUN(ICE_PROG_CPP_TRADITIONAL, +[ +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING(for a traditional C preprocessor) +AC_CACHE_VAL(ice_cv_traditional_cpp, +[ +cat > conftest.c << EOF +#if 1 +"this is an unterminated string +#endif +EOF +ice_cv_traditional_cpp= +ice_save_cpp="$CPP" +ice_save_cppflags="$CPPFLAGS" +for ice_cpp in "$CPP" "$CC -E" "/lib/cpp"; do +for ice_cppflags in '' ' -traditional-cpp' ' -traditional'; do +CPP="$ice_cpp" +CPPFLAGS="$ice_cppflags" +AC_TRY_CPP([ +#if 1 +"this is an unterminated string +#endif +], ice_cv_traditional_cpp="${CPP}${CPPFLAGS}") +if test "$ice_cv_traditional_cpp" != ""; then +break 2 +fi +done +done +CPP="$ice_save_cpp" +CPPFLAGS="$ice_save_cppflags" +]) +AC_MSG_RESULT($ice_cv_traditional_cpp) +CPP_TRADITIONAL="$ice_cv_traditional_cpp" +AC_SUBST(CPP_TRADITIONAL) +])dnl +dnl +dnl +dnl ICE_CHECK_PATH_MAX +dnl ------------------ +dnl +dnl Define `HAVE_PATH_MAX' if PATH_MAX is defined in <limits.h> +dnl +AC_DEFUN(ICE_CHECK_PATH_MAX, +[ +AC_MSG_CHECKING(for PATH_MAX definition in limits.h) +AC_CACHE_VAL(ice_cv_have_path_max, +[ +AC_TRY_COMPILE([#include <limits.h>], [int n = PATH_MAX;], +ice_cv_have_path_max=yes, +ice_cv_have_path_max=no) +]) +AC_MSG_RESULT($ice_cv_have_path_max) +if test "$ice_cv_have_path_max" = yes; then +AC_DEFINE(HAVE_PATH_MAX) +fi +])dnl +dnl +dnl +dnl ICE_CHECK_POSIX_PATH_MAX +dnl ------------------------ +dnl +dnl Define `HAVE_POSIX_PATH_MAX' if _POSIX_PATH_MAX is defined in <limits.h> +dnl +AC_DEFUN(ICE_CHECK_POSIX_PATH_MAX, +[ +AC_MSG_CHECKING(for _POSIX_PATH_MAX definition in limits.h) +AC_CACHE_VAL(ice_cv_have_posix_path_max, +[ +AC_TRY_COMPILE([#include <limits.h>], [int n = _POSIX_PATH_MAX], +ice_cv_have_posix_path_max=yes, +ice_cv_have_posix_path_max=no) +]) +AC_MSG_RESULT($ice_cv_have_posix_path_max) +if test "$ice_cv_have_posix_path_max" = yes; then +AC_DEFINE(HAVE_POSIX_PATH_MAX) +fi +])dnl +dnl +dnl +dnl ICE_CHECK_MAXPATHLEN +dnl -------------------- +dnl +dnl Define `HAVE_MAXPATHLEN' if MAXPATHLEN is defined in <limits.h> +dnl +AC_DEFUN(ICE_CHECK_MAXPATHLEN, +[ +AC_MSG_CHECKING(for MAXPATHLEN definition in sys/param.h) +AC_CACHE_VAL(ice_cv_have_maxpathlen, +[ +AC_TRY_COMPILE([#include <sys/param.h>], [int n = MAXPATHLEN;], +ice_cv_have_maxpathlen=yes, +ice_cv_have_maxpathlen=no) +]) +AC_MSG_RESULT($ice_cv_have_maxpathlen) +if test "$ice_cv_have_maxpathlen" = yes; then +AC_DEFINE(HAVE_MAXPATHLEN) +fi +])dnl +dnl +dnl +dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...) +dnl ----------------------------------------- +dnl +dnl If FUNCTION is available, define `HAVE_FUNCTION'. If it is declared +dnl in one of the headers named in the whitespace-separated list +dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals). +dnl +AC_DEFUN(ICE_CHECK_DECL, +[ +changequote(,)dnl +ice_tr=`echo $1 | tr '[a-z]' '[A-Z]'` +changequote([,])dnl +ice_have_tr=HAVE_$ice_tr +ice_have_decl_tr=${ice_have_tr}_DECL +ice_have_$1=no +AC_CHECK_FUNCS($1, ice_have_$1=yes) +if test "${ice_have_$1}" = yes; then +AC_MSG_CHECKING(for $1 declaration in $2) +AC_CACHE_VAL(ice_cv_have_$1_decl, +[ +ice_cv_have_$1_decl=no +changequote(,)dnl +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z_0-9_])' +changequote([,])dnl +for header in $2; do +# Check for ordinary declaration +AC_EGREP_HEADER([${ice_re_word}$1 *\(], $header, + ice_cv_have_$1_decl=yes) +if test "$ice_cv_have_$1_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +AC_EGREP_HEADER([${ice_re_word}$1 *$ice_re_params\(\(], $header, + ice_cv_have_$1_decl=yes) +if test "$ice_cv_have_$1_decl" = yes; then + break +fi +done +]) +AC_MSG_RESULT($ice_cv_have_$1_decl) +if test "$ice_cv_have_$1_decl" = yes; then +AC_DEFINE_UNQUOTED(${ice_have_decl_tr}) +fi +fi +])dnl +dnl +dnl +dnl ICE_CHECK_LESSTIF +dnl ----------------- +dnl +dnl Define `HAVE_LESSTIF' if the Motif library is actually a LessTif library +dnl +AC_DEFUN(ICE_CHECK_LESSTIF, +[ +AC_MSG_CHECKING(whether the Motif library is actually a LessTif library) +AC_CACHE_VAL(ice_cv_have_lesstif, +AC_EGREP_CPP(yes, +[#include <Xm/Xm.h> +#ifdef LesstifVersion +yes +#endif +], ice_cv_have_lesstif=yes, ice_cv_have_lesstif=no)) +AC_MSG_RESULT($ice_cv_have_lesstif) +if test "$ice_cv_have_lesstif" = yes; then +AC_DEFINE(HAVE_LESSTIF) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CHECK_PTRACE_DUMPCORE +dnl ------------------------- +dnl +dnl Set `HAVE_PTRACE_DUMPCORE' if PTRACE_DUMPCORE is defined in <sys/ptrace.h>. +dnl +AC_DEFUN(ICE_CHECK_PTRACE_DUMPCORE, +[ +AC_MSG_CHECKING(for PTRACE_DUMPCORE definition in <sys/ptrace.h>) +AC_CACHE_VAL(ice_cv_have_ptrace_dumpcore, +[ +AC_TRY_COMPILE([#include <sys/ptrace.h>], [int request = PTRACE_DUMPCORE;], +ice_cv_have_ptrace_dumpcore=yes, +ice_cv_have_ptrace_dumpcore=no) +]) +AC_MSG_RESULT($ice_cv_have_ptrace_dumpcore) +if test "$ice_cv_have_ptrace_dumpcore" = yes; then +AC_DEFINE(HAVE_PTRACE_DUMPCORE) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CHECK_CORE_MAGIC +dnl -------------------- +dnl +dnl Set `HAVE_CORE_MAGIC' if CORE_MAGIC is defined in <sys/core.h>. +dnl +AC_DEFUN(ICE_CHECK_CORE_MAGIC, +[ +AC_MSG_CHECKING(for CORE_MAGIC definition in <sys/core.h>) +AC_CACHE_VAL(ice_cv_have_core_magic, +AC_EGREP_CPP(yes, +[#include <sys/core.h> +#ifdef CORE_MAGIC +yes +#endif +], ice_cv_have_core_magic=yes, ice_cv_have_core_magic=no)) +AC_MSG_RESULT($ice_cv_have_core_magic) +if test "$ice_cv_have_core_magic" = yes; then +AC_DEFINE(HAVE_CORE_MAGIC) +fi +])dnl +dnl +dnl +dnl +dnl ICE_CXX_INCLUDE_DIR +dnl ------------------- +dnl +dnl Set output variable CXX_INCLUDE_DIR to the name of a directory +dnl where the C++ compiler looks for C++ include files. +dnl +AC_DEFUN(ICE_CXX_INCLUDE_DIR, +[ +AC_MSG_CHECKING(for directory to install c++ include files) +AC_CACHE_VAL(ice_cv_cxx_include_dir, +[ +cat > conftest.cc << EOF +#include <iostream.h> +EOF +changequote(,)dnl +$CXXCPP $DEFS conftest.cc > conftest.ii 2>&5 +if test $? != 0; then +AC_MSG_ERROR(${CXXCPP} could not find iostream.h) +else +ice_file=`grep '^# 1' conftest.ii | grep iostream.h | \ + head -1 | sed 's/^.*"\(.*\)".*$/\1/'` +ice_cv_cxx_include_dir=`echo $ice_file | sed 's%/[^/][^/]*$%%'` +fi +if test "$ice_cv_cxx_include_dir" = ""; then +ice_cv_cxx_include_dir="$prefix/include" +for pfx in "$prefix" "$exec_prefix"; do +for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \ + "$pfx/include" /usr/include; do +if test -d "$dir"; then +ice_cv_cxx_include_dir="$dir" +break +fi +done +done +fi +changequote([,])dnl +rm -f conftest.cc conftest.ii +]) +CXX_INCLUDE_DIR=$ice_cv_cxx_include_dir +AC_MSG_RESULT(${CXX_INCLUDE_DIR}) +AC_SUBST(CXX_INCLUDE_DIR) +])dnl +dnl +dnl +dnl ICE_CXX_LIB_DIR +dnl --------------- +dnl +dnl Set output variable CXX_LIB_DIR to the name of a directory +dnl where the C++ compiler looks for C++ libraries. +dnl +AC_DEFUN(ICE_CXX_LIB_DIR, +[ +AC_MSG_CHECKING(for directory to install c++ libraries) +AC_CACHE_VAL(ice_cv_cxx_lib_dir, +[ +changequote(,)dnl +ice_cv_cxx_lib_dir=`$CXX $DEFS -print-libgcc-file-name 2>&5 | \ + sed 's%/[^/][^/]*$%%'` +changequote([,])dnl +if test "$ice_cv_cxx_lib_dir" = ""; then +for p in $exec_prefix /usr/local /usr; do +if test -d "$p/lib"; then +ice_cv_cxx_lib_dir="$p/lib" +break +fi +done +fi +]) +CXX_LIB_DIR=$ice_cv_cxx_lib_dir +AC_MSG_RESULT(${CXX_LIB_DIR}) +AC_SUBST(CXX_LIB_DIR) +])dnl +dnl +dnl +dnl ICE_CXX_OPTIONS +dnl --------------- +dnl +dnl Setup C++ compile options. Specific to DDD and ICE. +dnl +AC_DEFUN(ICE_CXX_OPTIONS, +[ +if test "$GXX" = yes; then + ICE_EFFECTIVE_CXX + CXXOPT="-DNDEBUG" + CXXDEBUG= + # As of GCC 2.8.0, -Wall no longer implies -W + CXXWARNINGS="-W -Wall" + CXXSTATIC_BINDING="-Bstatic" + CXXDYNAMIC_BINDING="-Bdynamic" + CXXSTUFF= + for flag in $CXXFLAGS; do + case $flag in + -O) CXXOPT="$CXXOPT -O2";; + -O2) CXXOPT="$CXXOPT -O2";; + -O*) CXXOPT="$CXXOPT $flag";; + -g*) CXXDEBUG="$flag";; + -W*) CXXWARNINGS="$CXXWARNINGS $flag";; + *) CXXSTUFF="$CXXSTUFF $flag";; + esac + done +else + CXXOPT="-DNDEBUG" + CXXDEBUG= + CXXWARNINGS= + CXXSTATIC_BINDING="-static" + CXXDYNAMIC_BINDING= + CXXSTUFF= + for flag in $CXXFLAGS; do + case $flag in + -O*) CXXOPT="$CXXOPT $flag";; + -g*) CXXDEBUG="$flag";; + -W*) CXXWARNINGS="$CXXWARNINGS $flag";; + *) CXXSTUFF="$CXXSTUFF $flag";; + esac + done +fi +AC_MSG_CHECKING(for C++ compiler (${CXX}) warning options) +AC_MSG_RESULT(${CXXWARNINGS}) +AC_MSG_CHECKING(for C++ compiler (${CXX}) optimizing options) +AC_MSG_RESULT(${CXXOPT}) +AC_MSG_CHECKING(for C++ compiler (${CXX}) extra libraries) +AC_MSG_RESULT(${CXXLIBS}) +AC_MSG_CHECKING(for C++ compiler (${CXX}) static binding options) +AC_MSG_RESULT(${CXXSTATIC_BINDING}) +AC_MSG_CHECKING(for C++ compiler (${CXX}) dynamic binding options) +AC_MSG_RESULT(${CXXDYNAMIC_BINDING}) +AC_SUBST(CXXWARNINGS)dnl +AC_SUBST(CXXDEBUG)dnl +AC_SUBST(CXXOPT)dnl +AC_SUBST(CXXLIBS)dnl +AC_SUBST(CXXSTATIC_BINDING)dnl +AC_SUBST(CXXDYNAMIC_BINDING)dnl +dnl +if test "$GXX" = yes; then +ICE_EXTERNAL_TEMPLATES +dnl ICE_NO_IMPLICIT_TEMPLATES +ICE_ELIDE_CONSTRUCTORS +ICE_CONSERVE_SPACE +fi +CXXSTUFF="$CXXSTUFF $EXTERNAL_TEMPLATES $ELIDE_CONSTRUCTORS $CONSERVE_SPACE" +AC_SUBST(CXXSTUFF)dnl +])dnl +dnl +dnl +dnl +dnl ICE_PROG_EMACS +dnl -------------- +dnl +dnl Look for emacs; put its name in output variable `EMACS'. +dnl +dnl +AC_DEFUN(ICE_PROG_EMACS, +[ +AC_CHECK_PROGS(EMACS, emacs temacs xemacs lemacs) +])dnl +dnl +dnl +dnl ICE_PATH_INFO +dnl -------------- +dnl +dnl Look for info path; put it in output variable `infodir'. +dnl +AC_DEFUN(ICE_PATH_INFO, +[ +AC_MSG_CHECKING(for info directory) +AC_CACHE_VAL(ice_cv_infodir, +[ +AC_REQUIRE([AC_PREFIX_PROGRAM]) +AC_REQUIRE([ICE_PROG_EMACS]) +ice_cv_infodir=$prefix/info +if test "$EMACS" != ""; then +cat > conftest.el << EOF + +(defun print-list (l) + (if (not (null l)) + (list + (princ (car l) t) + (princ " +" t) + (print-list (cdr l))))) + +(defun print-info-dirs () + (cond + ((boundp 'Info-directory-list) + (print-list Info-directory-list)) + ((boundp 'Info-default-directory-list) + (print-list Info-default-directory-list)) + ((boundp 'Info-directory) + (print-list (list Info-directory))) +)) +EOF +ice_info_dirs=`$EMACS -batch -l conftest.el -f print-info-dirs 2>&5` +rm -f conftest.el +for ice_info_dir in $ice_info_dirs; do + ice_info_dir=`echo $ice_info_dir | sed 's,/*$,,'` + if test -f "$ice_info_dir/dir"; then + ice_cv_infodir="$ice_info_dir" + break + fi +done +fi +]) +infodir=$ice_cv_infodir +AC_MSG_RESULT($infodir) +AC_SUBST(infodir) +])dnl +dnl +dnl +dnl ICE_TYPE_SIGNAL +dnl --------------- +dnl +dnl ICE_TYPE_SIGNAL: like AC_TYPE_SIGNAL, but use C++ for checks. +dnl +AC_DEFUN(ICE_TYPE_SIGNAL, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING([return type of signal handlers]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CACHE_VAL(ice_cv_type_signal, +[ +AC_TRY_COMPILE( +[ +#include <sys/types.h> +#include <signal.h> +void handler(int sg);], +[signal(1, handler);], ice_cv_type_signal=void, ice_cv_type_signal=int)])dnl +AC_LANG_RESTORE +AC_MSG_RESULT($ice_cv_type_signal) +AC_DEFINE_UNQUOTED(RETSIGTYPE, $ice_cv_type_signal) +])dnl +dnl +dnl +dnl +dnl ICE_TYPE_SIGNALPROC +dnl ------------------- +dnl +dnl ICE_TYPE_SIGNALPROC: check params of signal handler. Use as: +dnl +dnl #include "config.h" +dnl +dnl typedef void (*SignalProc)(SIGHANDLERARGS); +dnl +dnl +AC_DEFUN(ICE_TYPE_SIG_HANDLER_ARGS, +[ +AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_MSG_CHECKING([parameter type of signal handlers]) +AC_CACHE_VAL(ice_cv_type_sig_handler_args, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ice_cv_type_sig_handler_args="" +# Try "..." +if test "$ice_cv_type_sig_handler_args" = ""; then +AC_TRY_COMPILE( +[ +#include <sys/types.h> +#include <signal.h> +RETSIGTYPE handler(...);], +[signal(1, handler);], +ice_cv_type_sig_handler_args="...") +fi +# Try "int" +if test "$ice_cv_type_sig_handler_args" = ""; then +AC_TRY_COMPILE( +[ +#include <sys/types.h> +#include <signal.h> +RETSIGTYPE handler(int);], +[signal(1, handler);], +ice_cv_type_sig_handler_args="int") +fi +# Try "int, ..." +if test "$ice_cv_type_sig_handler_args" = ""; then +AC_TRY_COMPILE( +[ +#include <sys/types.h> +#include <signal.h> +RETSIGTYPE handler(int ...);], +[signal(1, handler);], +ice_cv_type_sig_handler_args="int ...") +fi +AC_LANG_RESTORE +] +)dnl +AC_MSG_RESULT($ice_cv_type_sig_handler_args) +if test "$ice_cv_type_sig_handler_args" = ""; then +AC_MSG_WARN([Please #define SIGHANDLERARGS in config.h]) +fi +AC_DEFINE_UNQUOTED(SIGHANDLERARGS, $ice_cv_type_sig_handler_args) +])dnl +dnl +dnl +dnl +dnl ICE_CHECK_FROZEN_OSTRSTREAM +dnl --------------------------- +dnl +dnl If the C++ library has a ostrstream::frozen() function, +dnl define HAVE_FROZEN_OSTRSTREAM. +dnl +AC_DEFUN(ICE_CHECK_FROZEN_OSTRSTREAM, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING([for ostrstream::frozen()]) +AC_CACHE_VAL(ice_cv_frozen_ostrstream, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([#include <strstream.h>], +[ostrstream os; int frozen = os.frozen();], +ice_cv_frozen_ostrstream=yes, ice_cv_frozen_ostrstream=no) +AC_LANG_RESTORE +]) +AC_MSG_RESULT($ice_cv_frozen_ostrstream) +if test "$ice_cv_frozen_ostrstream" = yes; then +AC_DEFINE(HAVE_FROZEN_OSTRSTREAM) +fi +])dnl +dnl +dnl +dnl ICE_TYPE_REGEX_T +dnl ---------------- +dnl +dnl ICE_TYPE_REGEX_T: find members of POSIX.2 `regex_t' type +dnl - HAVE_REGEX_T_RE_NSUB: `regex_t' has a `re_nsub' member +dnl - HAVE_REGEX_T_N_SUBEXPS: `regex_t' has a `n_subexps' member +dnl +AC_DEFUN(ICE_TYPE_REGEX_T, +[ +AC_REQUIRE([AC_PROG_CXX]) +AC_CHECK_HEADERS(regex.h rx.h rxposix.h) +ICE_CHECK_DECL(regcomp, regex.h rx.h rxposix.h) +ICE_CHECK_DECL(regexec, regex.h rx.h rxposix.h) +ice_save_cppflags="$CPPFLAGS" +CPPFLAGS="-I$srcdir/.. $CPPFLAGS" +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_MSG_CHECKING([re_nsub member of POSIX.2 regex_t type]) +AC_CACHE_VAL(ice_cv_have_regex_t_re_nsub, +[ +AC_TRY_COMPILE( +[ +extern "C" { +#include <sys/types.h> + +// Avoid conflicts with C regex() function +#define regex c_regex + +// Don't include old libg++ <regex.h> contents +#define __REGEXP_LIBRARY + +#ifndef __STDC__ +#define __STDC__ 1 // Reguired for KCC when using GNU includes +#endif + +// Some old versions of libg++ contain a <regex.h> file. Avoid this. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include <regex.h> // POSIX.2 interface +#endif + +// Try hard-wired path to get native <regex.h>. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include </usr/include/regex.h> // POSIX.2 interface +#endif + +// Some more GNU headers. +#if !defined(REG_EXTENDED) && defined(HAVE_RX_H) +#include <rx.h> // Header from GNU rx 0.07 +#endif + +#if !defined(REG_EXTENDED) && defined(HAVE_RXPOSIX_H) +#include <rxposix.h> // Header from GNU rx 1.0 and later +#endif +} +], +[regex_t rx; int a = rx.re_nsub;], +ice_cv_have_regex_t_re_nsub=yes, ice_cv_have_regex_t_re_nsub=no)])dnl +AC_MSG_RESULT($ice_cv_have_regex_t_re_nsub) +if test "$ice_cv_have_regex_t_re_nsub" = yes; then +AC_DEFINE(HAVE_REGEX_T_RE_NSUB) +fi +dnl +dnl +AC_MSG_CHECKING([n_subexps member of GNU RX 1.0 regex_t type]) +AC_CACHE_VAL(ice_cv_have_regex_t_n_subexps, +[ +AC_TRY_COMPILE( +[ +extern "C" { +#include <sys/types.h> + +// Avoid conflicts with C regex() function +#define regex c_regex + +// Don't include old libg++ <regex.h> contents +#define __REGEXP_LIBRARY + +#ifndef __STDC__ +#define __STDC__ 1 // Reguired for KCC when using GNU includes +#endif + +// Some old versions of libg++ contain a <regex.h> file. Avoid this. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include <regex.h> // POSIX.2 interface +#endif + +// Try hard-wired path to get native <regex.h>. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include </usr/include/regex.h> // POSIX.2 interface +#endif + +// Some more GNU headers. +#if !defined(REG_EXTENDED) && defined(HAVE_RX_H) +#include <rx.h> // Header from GNU rx 0.07 +#endif + +#if !defined(REG_EXTENDED) && defined(HAVE_RXPOSIX_H) +#include <rxposix.h> // Header from GNU rx 1.0 and later +#endif +} +], +[regex_t rx; int a = rx.n_subexps;], +ice_cv_have_regex_t_n_subexps=yes, ice_cv_have_regex_t_n_subexps=no)])dnl +AC_MSG_RESULT($ice_cv_have_regex_t_n_subexps) +if test "$ice_cv_have_regex_t_n_subexps" = yes; then +AC_DEFINE(HAVE_REGEX_T_N_SUBEXPS) +fi +dnl +dnl +AC_LANG_RESTORE +CPPFLAGS="$ice_save_cppflags" +])dnl +dnl +dnl +dnl +dnl ICE_REGCOMP_BROKEN +dnl ------------------ +dnl +dnl #define REGCOMP_BROKEN if regcomp() always returns -1. +dnl This happens on Solaris 2.4. +dnl +AC_DEFUN(ICE_REGCOMP_BROKEN, +[ +AC_REQUIRE([ICE_TYPE_REGEX_T]) +if test "$ice_have_regcomp" = yes && test "$ice_have_regexec" = yes; then +AC_REQUIRE([AC_PROG_CXX]) +AC_MSG_CHECKING([whether regcomp() is broken]) +ice_save_cppflags="$CPPFLAGS" +CPPFLAGS="-I$srcdir/.. $CPPFLAGS" +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CACHE_VAL(ice_cv_regcomp_broken, +[ +AC_TRY_RUN( +[ +extern "C" { +#include <sys/types.h> + +// Avoid conflicts with C regex() function +#define regex c_regex + +// Don't include old libg++ <regex.h> contents +#define __REGEXP_LIBRARY + +#ifndef __STDC__ +#define __STDC__ 1 // Reguired for KCC when using GNU includes +#endif + +// Some old versions of libg++ contain a <regex.h> file. Avoid this. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include <regex.h> // POSIX.2 interface +#endif + +// Try hard-wired path to get native <regex.h>. +#if !defined(REG_EXTENDED) && defined(HAVE_REGEX_H) +#include </usr/include/regex.h> // POSIX.2 interface +#endif + +// Some more GNU headers. +#if !defined(REG_EXTENDED) && defined(HAVE_RX_H) +#include <rx.h> // Header from GNU rx 0.07 +#endif + +#if !defined(REG_EXTENDED) && defined(HAVE_RXPOSIX_H) +#include <rxposix.h> // Header from GNU rx 1.0 and later +#endif +} + +int main() +{ + char rxdouble[] = + "-?(([0-9]+\\\\.[0-9]*)|([0-9]+)|(\\\\.[0-9]+))" + "([eE][---+]?[0-9]+)?"; + regex_t compiled; + int errcode = regcomp(&compiled, rxdouble, REG_EXTENDED); + if (errcode) + return 1; + + char somedouble[] = "3.141529e+0"; + return regexec(&compiled, somedouble, 0, (void *)0, 0); +} +], ice_cv_regcomp_broken=no, ice_cv_regcomp_broken=yes, +ice_cv_regcomp_broken=yes)])dnl +AC_MSG_RESULT($ice_cv_regcomp_broken) +if test "$ice_cv_regcomp_broken" = yes; then +AC_DEFINE(REGCOMP_BROKEN) +fi +dnl +dnl +AC_LANG_RESTORE +CPPFLAGS="$ice_save_cppflags" +] +fi)dnl +dnl +dnl +dnl ICE_FIND_MOTIF +dnl -------------- +dnl +dnl Find Motif libraries and headers +dnl Put Motif include directory in motif_includes, +dnl put Motif library directory in motif_libraries, +dnl and add appropriate flags to X_CFLAGS and X_LIBS. +dnl +dnl +AC_DEFUN(ICE_FIND_MOTIF, +[ +AC_REQUIRE([AC_PATH_XTRA]) +motif_includes= +motif_libraries= +AC_ARG_WITH(motif, +[ --without-motif do not use Motif widgets]) +dnl Treat --without-motif like +dnl --without-motif-includes --without-motif-libraries. +if test "$with_motif" = "no" +then +motif_includes=no +motif_libraries=no +fi +AC_ARG_WITH(motif-includes, +[ --with-motif-includes=DIR Motif include files are in DIR], +motif_includes="$withval") +AC_ARG_WITH(motif-libraries, +[ --with-motif-libraries=DIR Motif libraries are in DIR], +motif_libraries="$withval") +AC_MSG_CHECKING(for Motif) +# +# +# Search the include files. +# +if test "$motif_includes" = ""; then +AC_CACHE_VAL(ice_cv_motif_includes, +[ +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" +# +AC_TRY_COMPILE([#include <Xm/Xm.h>],[int a;], +[ +# Xm/Xm.h is in the standard search path. +ice_cv_motif_includes= +], +[ +# 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 +]) +# +LIBS="$ice_motif_save_LIBS" +CFLAGS="$ice_motif_save_CFLAGS" +CPPFLAGS="$ice_motif_save_CPPFLAGS" +LDFLAGS="$ice_motif_save_LDFLAGS" +]) +motif_includes="$ice_cv_motif_includes" +fi +# +# +# Now for the libraries. +# +if test "$motif_libraries" = ""; then +AC_CACHE_VAL(ice_cv_motif_libraries, +[ +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. +AC_TRY_LINK([ +#include <X11/Intrinsic.h> +#include <Xm/Xm.h> +],[XtToolkitInitialize();], +[ +# libXm.a is in the standard search path. +ice_cv_motif_libraries= +], +[ +# 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 +]) +# +LIBS="$ice_motif_save_LIBS" +CFLAGS="$ice_motif_save_CFLAGS" +CPPFLAGS="$ice_motif_save_CPPFLAGS" +LDFLAGS="$ice_motif_save_LDFLAGS" +]) +# +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)" +AC_MSG_RESULT( + [libraries $motif_libraries_result, headers $motif_includes_result]) +])dnl +dnl +dnl +dnl ICE_FIND_ATHENA +dnl --------------- +dnl +dnl Find Athena libraries and headers. +dnl Put Athena include directory in athena_includes, +dnl put Athena library directory in athena_libraries, +dnl and add appropriate flags to X_CFLAGS and X_LIBS. +dnl +dnl +AC_DEFUN(ICE_FIND_ATHENA, +[ +AC_REQUIRE([AC_PATH_XTRA]) +athena_includes= +athena_libraries= +AC_ARG_WITH(athena, +[ --without-athena do not use Athena widgets]) +dnl Treat --without-athena like +dnl --without-athena-includes --without-athena-libraries. +if test "$with_athena" = "no" +then +athena_includes=no +athena_libraries=no +fi +AC_ARG_WITH(athena-includes, +[ --with-athena-includes=DIR Athena include files are in DIR], +athena_includes="$withval") +AC_ARG_WITH(athena-libraries, +[ --with-athena-libraries=DIR Athena libraries are in DIR], +athena_libraries="$withval") +AC_MSG_CHECKING(for Athena) +# +# +# Search the include files. +# +if test "$athena_includes" = ""; then +AC_CACHE_VAL(ice_cv_athena_includes, +[ +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" +# +AC_TRY_COMPILE([ +#include <X11/Intrinsic.h> +#include <X11/Xaw/Text.h> +],[int a;], +[ +# X11/Xaw/Text.h is in the standard search path. +ice_cv_athena_includes= +], +[ +# 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 +]) +# +LIBS="$ice_athena_save_LIBS" +CFLAGS="$ice_athena_save_CFLAGS" +CPPFLAGS="$ice_athena_save_CPPFLAGS" +LDFLAGS="$ice_athena_save_LDFLAGS" +]) +athena_includes="$ice_cv_athena_includes" +fi +# +# +# Now for the libraries. +# +if test "$athena_libraries" = ""; then +AC_CACHE_VAL(ice_cv_athena_libraries, +[ +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. +AC_TRY_LINK([ +#include <X11/Intrinsic.h> +#include <X11/Xaw/Text.h> +],[XtToolkitInitialize();], +[ +# libXaw.a is in the standard search path. +ice_cv_athena_libraries= +], +[ +# 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 +]) +# +LIBS="$ice_athena_save_LIBS" +CFLAGS="$ice_athena_save_CFLAGS" +CPPFLAGS="$ice_athena_save_CPPFLAGS" +LDFLAGS="$ice_athena_save_LDFLAGS" +]) +# +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)" +AC_MSG_RESULT( + [libraries $athena_libraries_result, headers $athena_includes_result]) +])dnl +dnl +dnl +dnl ICE_FIND_XPM +dnl --------------- +dnl +dnl Find Xpm libraries and headers. +dnl Put Xpm include directory in xpm_includes, +dnl put Xpm library directory in xpm_libraries, +dnl and add appropriate flags to X_CFLAGS and X_LIBS. +dnl +dnl +AC_DEFUN(ICE_FIND_XPM, +[ +AC_REQUIRE([AC_PATH_XTRA]) +xpm_includes= +xpm_libraries= +AC_ARG_WITH(xpm, +[ --without-xpm do not use the Xpm library]) +dnl Treat --without-xpm like +dnl --without-xpm-includes --without-xpm-libraries. +if test "$with_xpm" = "no" +then +xpm_includes=no +xpm_libraries=no +fi +AC_ARG_WITH(xpm-includes, +[ --with-xpm-includes=DIR Xpm include files are in DIR], +xpm_includes="$withval") +AC_ARG_WITH(xpm-libraries, +[ --with-xpm-libraries=DIR Xpm libraries are in DIR], +xpm_libraries="$withval") +AC_MSG_CHECKING(for Xpm) +# +# +# 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 +AC_CACHE_VAL(ice_cv_xpm_includes, +[ +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" +# +AC_TRY_COMPILE([ +#include <X11/xpm.h> +],[int a;], +[ +# X11/xpm.h is in the standard search path. +ice_cv_xpm_includes= +], +[ +# 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 +]) +# +LIBS="$ice_xpm_save_LIBS" +CFLAGS="$ice_xpm_save_CFLAGS" +CPPFLAGS="$ice_xpm_save_CPPFLAGS" +LDFLAGS="$ice_xpm_save_LDFLAGS" +]) +xpm_includes="$ice_cv_xpm_includes" +fi +# +# +# Now for the libraries. +# +if test "$xpm_libraries" = ""; then +AC_CACHE_VAL(ice_cv_xpm_libraries, +[ +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. +AC_TRY_LINK([ +#include <X11/Intrinsic.h> +#include <X11/xpm.h> +],[XtToolkitInitialize();], +[ +# libxpm.a is in the standard search path. +ice_cv_xpm_libraries= +], +[ +# 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 +]) +# +LIBS="$ice_xpm_save_LIBS" +CFLAGS="$ice_xpm_save_CFLAGS" +CPPFLAGS="$ice_xpm_save_CPPFLAGS" +LDFLAGS="$ice_xpm_save_LDFLAGS" +]) +# +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)" +AC_MSG_RESULT( + [libraries $xpm_libraries_result, headers $xpm_includes_result]) +])dnl diff --git a/config.cache b/config.cache new file mode 100644 index 00000000..e5039936 --- /dev/null +++ b/config.cache @@ -0,0 +1,64 @@ +# 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. +# +ac_cv_func_connect=${ac_cv_func_connect='yes'} +ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname='yes'} +ac_cv_func_remove=${ac_cv_func_remove='yes'} +ac_cv_func_shmat=${ac_cv_func_shmat='yes'} +ac_cv_have_x=${ac_cv_have_x='have_x=yes ac_x_includes=/usr/X11R6/include ac_x_libraries=/usr/X11R6/lib'} +ac_cv_header_X11_Xaw_Form_h=${ac_cv_header_X11_Xaw_Form_h='yes'} +ac_cv_header_X11_Xaw_Panner_h=${ac_cv_header_X11_Xaw_Panner_h='yes'} +ac_cv_header_X11_Xaw_Porthole_h=${ac_cv_header_X11_Xaw_Porthole_h='yes'} +ac_cv_header_X11_Xmu_Editres_h=${ac_cv_header_X11_Xmu_Editres_h='yes'} +ac_cv_header_X11_xpm_h=${ac_cv_header_X11_xpm_h='yes'} +ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h='yes'} +ac_cv_header_termio_h=${ac_cv_header_termio_h='yes'} +ac_cv_header_xpm_h=${ac_cv_header_xpm_h='no'} +ac_cv_lib_ICE_IceConnectionNumber=${ac_cv_lib_ICE_IceConnectionNumber='yes'} +ac_cv_lib_X11_XOpenDisplay=${ac_cv_lib_X11_XOpenDisplay='yes'} +ac_cv_lib_Xaw_XawTextSetInsertionPoint=${ac_cv_lib_Xaw_XawTextSetInsertionPoint='yes'} +ac_cv_lib_Xext_XShapeQueryVersion=${ac_cv_lib_Xext_XShapeQueryVersion='yes'} +ac_cv_lib_Xintl__Xlcmbcurmax=${ac_cv_lib_Xintl__Xlcmbcurmax='no'} +ac_cv_lib_Xm_XmCreateOptionMenu=${ac_cv_lib_Xm_XmCreateOptionMenu='yes'} +ac_cv_lib_Xmu_XmuCvtStringToOrientation=${ac_cv_lib_Xmu_XmuCvtStringToOrientation='yes'} +ac_cv_lib_Xp_XpSelectInput=${ac_cv_lib_Xp_XpSelectInput='yes'} +ac_cv_lib_Xpm_XpmCreatePixmapFromXpmImage=${ac_cv_lib_Xpm_XpmCreatePixmapFromXpmImage='yes'} +ac_cv_lib_Xt_XtToolkitInitialize=${ac_cv_lib_Xt_XtToolkitInitialize='yes'} +ac_cv_lib_c_open=${ac_cv_lib_c_open='yes'} +ac_cv_lib_dnet_dnet_ntoa=${ac_cv_lib_dnet_dnet_ntoa='no'} +ac_cv_lib_dnet_stub_dnet_ntoa=${ac_cv_lib_dnet_stub_dnet_ntoa='no'} +ac_cv_lib_gen_regcmp=${ac_cv_lib_gen_regcmp='no'} +ac_cv_lib_ipc_shmap=${ac_cv_lib_ipc_shmap='no'} +ac_cv_lib_m_sin=${ac_cv_lib_m_sin='yes'} +ac_cv_prog_CC=${ac_cv_prog_CC='gcc'} +ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'} +ac_cv_prog_CXX=${ac_cv_prog_CXX='c++'} +ac_cv_prog_CXXCPP=${ac_cv_prog_CXXCPP='c++ -E'} +ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross='no'} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g='yes'} +ac_cv_prog_cc_works=${ac_cv_prog_cc_works='yes'} +ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross='no'} +ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g='yes'} +ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works='yes'} +ac_cv_prog_gcc=${ac_cv_prog_gcc='yes'} +ac_cv_prog_gxx=${ac_cv_prog_gxx='yes'} +ice_cv_athena_includes=${ice_cv_athena_includes=''} +ice_cv_athena_libraries=${ice_cv_athena_libraries=''} +ice_cv_motif_includes=${ice_cv_motif_includes=''} +ice_cv_motif_libraries=${ice_cv_motif_libraries='/usr/X11R6/lib'} +ice_cv_prog_cc=${ice_cv_prog_cc='yes'} +ice_cv_prog_cxx=${ice_cv_prog_cxx='yes'} +ice_cv_traditional_cpp=${ice_cv_traditional_cpp='gcc -E -traditional-cpp'} +ice_cv_xpm_includes=${ice_cv_xpm_includes=''} +ice_cv_xpm_libraries=${ice_cv_xpm_libraries=''} diff --git a/config.log b/config.log new file mode 100644 index 00000000..473a4c2d --- /dev/null +++ b/config.log @@ -0,0 +1,191 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +configure:546: checking for gcc +configure:623: checking whether the C compiler (gcc ) works +configure:637: gcc -o conftest conftest.c 1>&5 +configure:657: checking whether the C compiler (gcc ) is a cross-compiler +configure:662: checking whether we are using GNU C +configure:671: gcc -E conftest.c +configure:686: checking whether gcc accepts -g +configure:714: checking for POSIXized ISC +configure:738: checking whether the C compiler (gcc) compiles and links a simple C program +configure:759: gcc -o conftest -g -O2 conftest.c 1>&5 +configure:785: checking for c++ +configure:816: checking whether the C++ compiler (c++ ) works +configure:830: c++ -o conftest conftest.C 1>&5 +configure:856: checking whether the C++ compiler (c++ ) is a cross-compiler +configure:861: checking whether we are using GNU C++ +configure:870: c++ -E conftest.C +configure:885: checking whether c++ accepts -g +configure:1068: checking whether the C++ compiler (c++) compiles a simple program +configure:1089: c++ -o conftest -g -O2 conftest.C 1>&5 +configure:1143: checking how to run the C preprocessor +configure:1164: gcc -E conftest.c >/dev/null 2>conftest.out +configure:1204: checking how to run the C++ preprocessor +configure:1222: c++ -E conftest.C >/dev/null 2>conftest.out +configure:1250: checking for a traditional C preprocessor +configure:1277: gcc -E conftest.c >/dev/null 2>conftest.out +configure:1271: unterminated string or character constant +configure:1271: possible real start of unterminated constant +configure:1270: unterminated `#if' conditional +configure: failed program was: +#line 1268 "configure" +#include "confdefs.h" + +#if 1 +"this is an unterminated string +#endif + +configure:1277: gcc -E -traditional-cpp conftest.c >/dev/null 2>conftest.out +configure:1307: checking for termio.h +configure:1317: gcc -E conftest.c >/dev/null 2>conftest.out +configure:1307: checking for sys/param.h +configure:1317: gcc -E conftest.c >/dev/null 2>conftest.out +configure:1345: checking for sin in -lm +configure:1364: gcc -o conftest -g -O2 conftest.c -lm 1>&5 +configure:1357: warning: conflicting types for built-in function `sin' +configure:1386: checking for open in -lc +configure:1405: gcc -o conftest -g -O2 conftest.c -lc 1>&5 +configure:1427: checking for regcmp in -lgen +configure:1446: gcc -o conftest -g -O2 conftest.c -lgen 1>&5 +/usr/bin/ld: cannot open -lgen: No such file or directory +collect2: ld returned 1 exit status +configure: failed program was: +#line 1435 "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; } +configure:1485: checking for X +configure:1799: checking for dnet_ntoa in -ldnet +configure:1818: gcc -o conftest -g -O2 conftest.c -ldnet 1>&5 +/usr/bin/ld: cannot open -ldnet: No such file or directory +collect2: ld returned 1 exit status +configure: failed program was: +#line 1807 "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; } +configure:1840: checking for dnet_ntoa in -ldnet_stub +configure:1859: gcc -o conftest -g -O2 conftest.c -ldnet_stub 1>&5 +/usr/bin/ld: cannot open -ldnet_stub: No such file or directory +collect2: ld returned 1 exit status +configure: failed program was: +#line 1848 "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; } +configure:1888: checking for gethostbyname +configure:1916: gcc -o conftest -g -O2 conftest.c 1>&5 +configure:1986: checking for connect +configure:2014: gcc -o conftest -g -O2 conftest.c 1>&5 +configure:2078: checking for remove +configure:2106: gcc -o conftest -g -O2 conftest.c 1>&5 +configure:2170: checking for shmat +configure:2198: gcc -o conftest -g -O2 conftest.c 1>&5 +configure:2271: checking for IceConnectionNumber in -lICE +configure:2290: gcc -o conftest -g -O2 -L/usr/X11R6/lib conftest.c -lICE 1>&5 +configure:2342: checking for Motif +configure:2370: gcc -c -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include conftest.c 1>&5 +configure:2449: gcc -o conftest -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lSM -lICE -lXm -lXt -lX11 1>&5 +/usr/X11R6/lib/libXm.so: undefined reference to `XShapeCombineRectangles' +/usr/X11R6/lib/libXm.so: undefined reference to `XShapeCombineMask' +/usr/X11R6/lib/libXm.so: undefined reference to `XShapeQueryExtension' +collect2: ld returned 1 exit status +configure: failed program was: +#line 2439 "configure" +#include "confdefs.h" + +#include <X11/Intrinsic.h> +#include <Xm/Xm.h> + +int main() { +XtToolkitInitialize(); +; return 0; } +configure:2555: checking for Athena +configure:2586: gcc -c -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include conftest.c 1>&5 +configure:2662: gcc -o conftest -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lSM -lICE -lXaw -lXmu -lXext -lXt -lX11 1>&5 +configure:2764: checking for Xpm +configure:2795: gcc -c -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include conftest.c 1>&5 +configure:2872: gcc -o conftest -I/usr/X11R6/include -g -O2 -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lSM -lICE -lXpm -lXt -lX11 1>&5 +configure:2956: checking for XOpenDisplay in -lX11 +configure:2975: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lX11 -lSM -lICE 1>&5 +configure:3005: checking for _Xlcmbcurmax in -lXintl +configure:3024: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXintl -lSM -lICE -lX11 1>&5 +/usr/bin/ld: cannot open -lXintl: No such file or directory +collect2: ld returned 1 exit status +configure: failed program was: +#line 3013 "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; } +configure:3045: checking for shmap in -lipc +configure:3064: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lipc -lSM -lICE -lX11 1>&5 +/usr/bin/ld: cannot open -lipc: No such file or directory +collect2: ld returned 1 exit status +configure: failed program was: +#line 3053 "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; } +configure:3086: checking for XtToolkitInitialize in -lXt +configure:3105: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXt -lSM -lICE -lX11 1>&5 +configure:3134: checking for XShapeQueryVersion in -lXext +configure:3153: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXext -lSM -lICE -lX11 1>&5 +configure:3178: checking for XmuCvtStringToOrientation in -lXmu +configure:3197: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXmu -lSM -lICE -lXt -lXext -lX11 1>&5 +configure:3218: checking for XawTextSetInsertionPoint in -lXaw +configure:3237: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXaw -lSM -lICE -lXmu -lXt -lXext -lX11 1>&5 +configure:3276: checking for X11/Xaw/Form.h +configure:3286: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3276: checking for X11/Xaw/Panner.h +configure:3286: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3276: checking for X11/Xaw/Porthole.h +configure:3286: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3316: checking for X11/Xmu/Editres.h +configure:3326: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3356: checking for XpmCreatePixmapFromXpmImage in -lXpm +configure:3375: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXpm -lSM -lICE -lX11 1>&5 +configure:3404: checking for X11/xpm.h +configure:3414: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3404: checking for xpm.h +configure:3414: gcc -E -I/usr/X11R6/include conftest.c >/dev/null 2>conftest.out +configure:3410: xpm.h: No such file or directory +configure: failed program was: +#line 3409 "configure" +#include "confdefs.h" +#include <xpm.h> +configure:3447: checking for XpSelectInput in -lXp +configure:3466: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXp -lSM -lICE -lXpm -lXext -lXt -lXext -lX11 1>&5 +configure:3491: checking for XmCreateOptionMenu in -lXm +configure:3510: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/X11R6/include -L/usr/X11R6/lib conftest.c -lXm -lSM -lICE -lXp -lXpm -lXext -lXt -lXext -lX11 1>&5 diff --git a/config.status b/config.status new file mode 100755 index 00000000..9ebe0b71 --- /dev/null +++ b/config.status @@ -0,0 +1,168 @@ +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host emc.rvt.com: +# +# ./configure +# +# 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} ./configure --no-create --no-recursion" + exec ${CONFIG_SHELL-/bin/sh} ./configure --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=. + +trap 'rm -fr Makefile conftest*; exit 1' 1 2 15 + +# 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 +/^[ ]*VPATH[ ]*=[^:]*$/d + +s%@CFLAGS@%-g -O2%g +s%@CPPFLAGS@%%g +s%@CXXFLAGS@%-g -O2%g +s%@DEFS@% -DHAVE_TERMIO_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_ATHENA=1 -DHAVE_X11_XAW_FORM_H=1 -DHAVE_X11_XAW_PANNER_H=1 -DHAVE_X11_XAW_PORTHOLE_H=1 -DHAVE_X11_XMU_EDITRES_H=1 -DHAVE_XPM=1 -DHAVE_X11_XPM_H=1 -DHAVE_XP=1 -DHAVE_MOTIF=1 %g +s%@LDFLAGS@%%g +s%@LIBS@%%g +s%@exec_prefix@%${prefix}%g +s%@prefix@%/usr/local%g +s%@program_transform_name@%s,x,x,%g +s%@bindir@%${exec_prefix}/bin%g +s%@sbindir@%${exec_prefix}/sbin%g +s%@libexecdir@%${exec_prefix}/libexec%g +s%@datadir@%${prefix}/share%g +s%@sysconfdir@%${prefix}/etc%g +s%@sharedstatedir@%${prefix}/com%g +s%@localstatedir@%${prefix}/var%g +s%@libdir@%${exec_prefix}/lib%g +s%@includedir@%${prefix}/include%g +s%@oldincludedir@%/usr/include%g +s%@infodir@%${prefix}/info%g +s%@mandir@%${prefix}/man%g +s%@CC@%gcc%g +s%@CXX@%c++%g +s%@CXXLIBS@%%g +s%@CPP@%gcc -E%g +s%@CXXCPP@%c++ -E%g +s%@CPP_TRADITIONAL@%gcc -E -traditional-cpp%g +s%@LIBM@%-lm%g +s%@LIBC@%-lc%g +s%@LIBGEN@%%g +s%@X_CFLAGS@% -I/usr/X11R6/include%g +s%@X_PRE_LIBS@% -lSM -lICE%g +s%@X_LIBS@% -L/usr/X11R6/lib%g +s%@X_EXTRA_LIBS@%%g +s%@X11_LIBS@%-lX11%g +s%@XT_LIBS@%-lXt%g +s%@XEXT_LIBS@%-lXext%g +s%@XAW_LIBS@%-lXaw -lXmu %g +s%@XPM_LIBS@%-lXpm%g +s%@MISSING_MOTIF@%%g +s%@XP_LIBS@%-lXp%g +s%@XM_LIBS@%-lXm%g + +CEOF + +# 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 + +CONFIG_FILES=${CONFIG_FILES-"Makefile"} +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* + + + +exit 0 diff --git a/configure b/configure new file mode 100755 index 00000000..258b10a7 --- /dev/null +++ b/configure @@ -0,0 +1,3819 @@ +#! /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:546: 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:575: 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:623: 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 633 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +if { (eval echo configure:637: \"$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:657: 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:662: 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:671: \"$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:686: 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:714: 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:738: 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 752 "configure" +#include "confdefs.h" +#include <stdio.h> +int main() { +printf("hello, world!"); +; return 0; } +EOF +if { (eval echo configure:759: \"$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 + +for ac_prog in $CCC c++ g++ gcc CC cxx cc++ +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:785: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:816: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext <<EOF +#line 826 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cxx_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_cxx_cross=no + else + ac_cv_prog_cxx_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_works=no +fi +rm -fr conftest* +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 + +echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 +if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:856: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 +cross_compiling=$ac_cv_prog_cxx_cross + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:861: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:885: checking whether ${CXX-g++} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" + elif test $ac_cv_prog_cxx_g = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-O2" + fi +else + GXX= + test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" +fi + + + +if test "$CXX" = gcc; then + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +ice_save_LIBS="$LIBS" +echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 +echo "configure:925: 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 933 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* 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:947: \"$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 + LIBS="-lm $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for cout in -lstdc++""... $ac_c" 1>&6 +echo "configure:968: checking for cout in -lstdc++" >&5 +ac_lib_var=`echo stdc++'_'cout | 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="-lstdc++ $LIBS" +cat > conftest.$ac_ext <<EOF +#line 976 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cout(); + +int main() { +cout() +; return 0; } +EOF +if { (eval echo configure:990: \"$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 + LIBS="-lstdc++ $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +case "$LIBS" in +*-lstdc++*) +;; +*) +echo $ac_n "checking for cout in -lg++""... $ac_c" 1>&6 +echo "configure:1015: checking for cout in -lg++" >&5 +ac_lib_var=`echo g++'_'cout | 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="-lg++ $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1023 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cout(); + +int main() { +cout() +; return 0; } +EOF +if { (eval echo configure:1037: \"$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 + LIBS="-lg++ $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +;; +esac +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 + +fi +echo $ac_n "checking whether the C++ compiler (${CXX}) compiles a simple program""... $ac_c" 1>&6 +echo "configure:1068: checking whether the C++ compiler (${CXX}) compiles a simple program" >&5 +if eval "test \"`echo '$''{'ice_cv_prog_cxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext <<EOF +#line 1082 "configure" +#include "confdefs.h" +#include <iostream.h> +int main() { +cout << "hello, world!"; +; return 0; } +EOF +if { (eval echo configure:1089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + ice_cv_prog_cxx=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ice_cv_prog_cxx=no +fi +rm -f conftest* +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 + + +fi + +echo "$ac_t""$ice_cv_prog_cxx" 1>&6 +if test "$ice_cv_prog_cxx" = no; then +{ echo "configure: error: You must set the environment variable CXX to a working + C++ compiler. Also check the CXXFLAGS settings. + See the file 'config.log' for further diagnostics." 1>&2; exit 1; } +fi +ice_need_cxxlibs=no +case "$LIBS" in + *-lstdc++*) + case "$CXXLIBS" in + *-lstdc++*) + ;; + *) + ice_need_cxxlibs=yes + ;; + esac + ;; + *-lg++*) + case "$CXXLIBS" in + *-lg++*) + ;; + *) + ice_need_cxxlibs=yes + ;; + esac + ;; +esac +if test "$ice_need_cxxlibs" = yes +then +CXXLIBS="$CXXLIBS $LIBS" +fi +LIBS="$ice_save_LIBS" + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1143: 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 1158 "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:1164: \"$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 1175 "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:1181: \"$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 + +echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 +echo "configure:1204: checking how to run the C++ preprocessor" >&5 +if test -z "$CXXCPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXCPP="${CXX-g++} -E" + cat > conftest.$ac_ext <<EOF +#line 1217 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1222: \"$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* + CXXCPP=/lib/cpp +fi +rm -f conftest* + ac_cv_prog_CXXCPP="$CXXCPP" +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 +fi +fi +CXXCPP="$ac_cv_prog_CXXCPP" +echo "$ac_t""$CXXCPP" 1>&6 + + + + +echo $ac_n "checking for a traditional C preprocessor""... $ac_c" 1>&6 +echo "configure:1250: checking for a traditional C preprocessor" >&5 +if eval "test \"`echo '$''{'ice_cv_traditional_cpp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.c << EOF +#if 1 +"this is an unterminated string +#endif +EOF +ice_cv_traditional_cpp= +ice_save_cpp="$CPP" +ice_save_cppflags="$CPPFLAGS" +for ice_cpp in "$CPP" "$CC -E" "/lib/cpp"; do +for ice_cppflags in '' ' -traditional-cpp' ' -traditional'; do +CPP="$ice_cpp" +CPPFLAGS="$ice_cppflags" +cat > conftest.$ac_ext <<EOF +#line 1268 "configure" +#include "confdefs.h" + +#if 1 +"this is an unterminated string +#endif + +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + ice_cv_traditional_cpp="${CPP}${CPPFLAGS}" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test "$ice_cv_traditional_cpp" != ""; then +break 2 +fi +done +done +CPP="$ice_save_cpp" +CPPFLAGS="$ice_save_cppflags" + +fi + +echo "$ac_t""$ice_cv_traditional_cpp" 1>&6 +CPP_TRADITIONAL="$ice_cv_traditional_cpp" + + + +for ac_hdr in termio.h sys/param.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1307: 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 1312 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1317: \"$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 sin in -lm""... $ac_c" 1>&6 +echo "configure:1345: 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 1353 "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:1364: \"$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:1386: 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 1394 "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:1405: \"$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:1427: 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 1435 "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:1446: \"$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:1485: 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 1547 "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:1552: \"$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 1621 "configure" +#include "confdefs.h" + +int main() { +${x_direct_test_function}() +; return 0; } +EOF +if { (eval echo configure:1628: \"$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:1734: 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 1737 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1744: \"$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 1760 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1767: \"$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:1799: 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 1807 "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:1818: \"$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:1840: 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 1848 "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:1859: \"$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:1888: 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 1893 "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:1916: \"$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:1937: 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 1945 "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:1956: \"$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:1986: 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 1991 "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:2014: \"$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:2035: 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 2043 "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:2054: \"$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:2078: 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 2083 "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:2106: \"$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:2127: 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 2135 "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:2146: \"$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:2170: 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 2175 "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:2198: \"$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:2219: 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 2227 "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:2238: \"$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:2271: 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 2279 "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:2290: \"$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:2342: 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 2363 "configure" +#include "confdefs.h" +#include <Xm/Xm.h> +int main() { +int a; +; return 0; } +EOF +if { (eval echo configure:2370: \"$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 2439 "configure" +#include "confdefs.h" + +#include <X11/Intrinsic.h> +#include <Xm/Xm.h> + +int main() { +XtToolkitInitialize(); +; return 0; } +EOF +if { (eval echo configure:2449: \"$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:2555: 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 2576 "configure" +#include "confdefs.h" + +#include <X11/Intrinsic.h> +#include <X11/Xaw/Text.h> + +int main() { +int a; +; return 0; } +EOF +if { (eval echo configure:2586: \"$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 2652 "configure" +#include "confdefs.h" + +#include <X11/Intrinsic.h> +#include <X11/Xaw/Text.h> + +int main() { +XtToolkitInitialize(); +; return 0; } +EOF +if { (eval echo configure:2662: \"$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:2764: 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 2786 "configure" +#include "confdefs.h" + +#include <X11/xpm.h> + +int main() { +int a; +; return 0; } +EOF +if { (eval echo configure:2795: \"$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 2862 "configure" +#include "confdefs.h" + +#include <X11/Intrinsic.h> +#include <X11/xpm.h> + +int main() { +XtToolkitInitialize(); +; return 0; } +EOF +if { (eval echo configure:2872: \"$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:2956: 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 2964 "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:2975: \"$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:3005: 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 3013 "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:3024: \"$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:3045: 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 3053 "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:3064: \"$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:3086: 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 3094 "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:3105: \"$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:3134: 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 3142 "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:3153: \"$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 + + +XAW_LIBS="" +if test "$athena_includes" != "no" && test "$athena_libraries" != "no" +then +echo $ac_n "checking for XmuCvtStringToOrientation in -lXmu""... $ac_c" 1>&6 +echo "configure:3178: checking for XmuCvtStringToOrientation in -lXmu" >&5 +ac_lib_var=`echo Xmu'_'XmuCvtStringToOrientation | 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="-lXmu ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3186 "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 XmuCvtStringToOrientation(); + +int main() { +XmuCvtStringToOrientation() +; return 0; } +EOF +if { (eval echo configure:3197: \"$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 + XAW_LIBS="-lXmu ${XAW_LIBS}" +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for XawTextSetInsertionPoint in -lXaw""... $ac_c" 1>&6 +echo "configure:3218: checking for XawTextSetInsertionPoint in -lXaw" >&5 +ac_lib_var=`echo Xaw'_'XawTextSetInsertionPoint | 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="-lXaw ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3226 "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 XawTextSetInsertionPoint(); + +int main() { +XawTextSetInsertionPoint() +; return 0; } +EOF +if { (eval echo configure:3237: \"$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 + XAW_LIBS="-lXaw ${XAW_LIBS}" + cat >> confdefs.h <<\EOF +#define HAVE_ATHENA 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$XAW_LIBS" = ""; then +echo "configure: warning: The Athena widgets library '-lXaw' could not be found. + If you have the athena library, please use the + configure options '--with-athena-includes=DIR' and + '--with-athena-libraries=DIR' to specify the Xaw location. + If you do not have the athena library, use the configure + option '--without-athena' to suppress this message. + See the file 'config.log' for further diagnostics." 1>&2 +fi +fi +if test "$XAW_LIBS" != ""; then +for ac_hdr in X11/Xaw/Form.h X11/Xaw/Panner.h X11/Xaw/Porthole.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3276: 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 3281 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3286: \"$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 + +for ac_hdr in X11/Xmu/Editres.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3316: 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 3321 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3326: \"$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 + +XPM_LIBS="" +echo $ac_n "checking for XpmCreatePixmapFromXpmImage in -lXpm""... $ac_c" 1>&6 +echo "configure:3356: 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 3364 "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:3375: \"$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:3404: 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 3409 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3414: \"$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:3447: 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 3455 "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:3466: \"$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:3491: 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 3499 "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:3510: \"$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 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# 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" | 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%@CXX@%$CXX%g +s%@CXXLIBS@%$CXXLIBS%g +s%@CPP@%$CPP%g +s%@CXXCPP@%$CXXCPP%g +s%@CPP_TRADITIONAL@%$CPP_TRADITIONAL%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%@XAW_LIBS@%$XAW_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* + +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 new file mode 100644 index 00000000..9e0b4b6e --- /dev/null +++ b/configure.in @@ -0,0 +1,255 @@ +dnl configure.in +dnl $Modified: Thu Jan 22 12:53:31 1998 by brook $ +dnl +dnl This file is in part inspired by and derived from the DDD Library. +dnl +dnl +dnl Process this file with autoconf to produce a configure script. +dnl $Id: configure.in,v 1.1 1998/08/18 20:43:57 remco Exp $ +dnl +dnl Copyright (C) 1995-1997 Technische Universitaet Braunschweig, Germany. +dnl Written by Andreas Zeller <zeller@ips.cs.tu-bs.de>. +dnl +dnl This file is part of the DDD Library. +dnl +dnl The DDD Library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. +dnl +dnl The DDD Library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +dnl See the GNU Library General Public License for more details. +dnl +dnl You should have received a copy of the GNU Library General Public +dnl License along with the DDD Library -- see the file COPYING.LIB. +dnl If not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl +dnl DDD is the data display debugger. +dnl For details, see the DDD World-Wide-Web page, +dnl `http://www.cs.tu-bs.de/softech/ddd/', +dnl or send a mail to the DDD developers <ddd@ips.cs.tu-bs.de>. +dnl +dnl +dnl +dnl +dnl +AC_INIT(gpsd.c) + +dnl Find and check C/C++ compilers +dnl +ICE_PROG_CC +ICE_PROG_CXX +dnl +dnl +dnl Find and check C/C++ preprocessors +dnl +AC_PROG_CPP +AC_PROG_CXXCPP + +dnl +dnl +dnl Check for compiler characteristics +dnl +ICE_PROG_CPP_TRADITIONAL + +AC_CHECK_HEADERS(termio.h sys/param.h) + +dnl +dnl Locate Libraries +dnl +AC_CHECK_LIB(m, sin, LIBM="-lm") +AC_SUBST(LIBM) +dnl +AC_CHECK_LIB(c, open, LIBC="-lc") +AC_SUBST(LIBC) +dnl +AC_CHECK_LIB(gen, regcmp, LIBGEN="-lgen") +AC_SUBST(LIBGEN) +dnl +dnl +dnl +dnl +dnl Check for X stuff +dnl +dnl +dnl Check X options +dnl +if test "$with_x" = no; then +AC_MSG_WARN([Some of this software requires the X window system to compile and run. + Please do not use the configure option '--without-x'.]) +fi +if test "$with_motif" = no; then +AC_MSG_WARN([Some of this software requires Motif to compile and run. + Please do not use the configure option '--without-motif'.]) +fi +dnl +dnl +dnl Check for X libraries +dnl +if test "$with_x" != no; then +ice_save_LIBS="$LIBS" +ice_save_CFLAGS="$CFLAGS" +ice_save_CPPFLAGS="$CPPFLAGS" +ice_save_LDFLAGS="$LDFLAGS" +dnl +AC_PATH_XTRA +ICE_FIND_MOTIF +ICE_FIND_ATHENA +ICE_FIND_XPM +dnl +dnl Autoconf bug fix: Sun CC 3.0 requires `-R lib', g++ requires `-Rlib'. +changequote(,)dnl +case "$CXX" in + *CC) X_LIBS="`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`" +esac +changequote([,])dnl +dnl +dnl +dnl +LIBS="$LIBS $X_EXTRA_LIBS" +CFLAGS="$CFLAGS $X_CFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +LDFLAGS="$LDFLAGS $X_LIBS" +dnl +dnl Check for X library +dnl +X11_LIBS="" +AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS}) +if test "$X11_LIBS" = ""; then +dnl Not having X may be fatal. Let the user fix this. +AC_MSG_WARN([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.]) +fi +AC_SUBST(X_LIBS) +AC_SUBST(X11_LIBS) +AC_SUBST(X_PRE_LIBS) +dnl +dnl +dnl Check for -lXintl library. Lutz Kittler <kittler@sse-erfurt.de> says +dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'. +dnl Guenther Roehrich <guenther@studbox.uni-stuttgart.de> says that +dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'. +dnl +AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",, + ${X_PRE_LIBS} ${X11_LIBS}) +dnl +dnl +dnl Check for -lipc library. SCO unix is said to want that. +dnl +AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",, + ${X_PRE_LIBS} ${X11_LIBS}) +dnl +dnl +dnl Check for X toolkit libraries +dnl +XT_LIBS="" +AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",, + ${X_PRE_LIBS} ${X11_LIBS}) +if test "$XT_LIBS" = ""; then +dnl Not having Xt is fatal. Let the user fix this. +AC_MSG_WARN([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.]) +fi +AC_SUBST(XT_LIBS) +dnl +dnl +dnl Check for X extension libraries +dnl +dnl +XEXT_LIBS="" +AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",, + ${X_PRE_LIBS} ${X11_LIBS}) +AC_SUBST(XEXT_LIBS) +dnl +dnl +dnl +dnl Check for Athena widget libraries +dnl +dnl +XAW_LIBS="" +if test "$athena_includes" != "no" && test "$athena_libraries" != "no" +then +AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation, + XAW_LIBS="-lXmu ${XAW_LIBS}",, + ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS}) +AC_CHECK_LIB(Xaw, XawTextSetInsertionPoint, + XAW_LIBS="-lXaw ${XAW_LIBS}" + AC_DEFINE(HAVE_ATHENA),, + ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS}) +if test "$XAW_LIBS" = ""; then +dnl A warning suffices here -- DDD also works without Athena. +AC_MSG_WARN([The Athena widgets library '-lXaw' could not be found. + If you have the athena library, please use the + configure options '--with-athena-includes=DIR' and + '--with-athena-libraries=DIR' to specify the Xaw location. + If you do not have the athena library, use the configure + option '--without-athena' to suppress this message. + See the file 'config.log' for further diagnostics.]) +fi +fi +if test "$XAW_LIBS" != ""; then +AC_CHECK_HEADERS(X11/Xaw/Form.h X11/Xaw/Panner.h X11/Xaw/Porthole.h) +AC_CHECK_HEADERS(X11/Xmu/Editres.h) +fi +AC_SUBST(XAW_LIBS) +dnl +dnl +dnl Check for Xpm library and headers +dnl +XPM_LIBS="" +AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage, + XPM_LIBS="-lXpm" + AC_DEFINE(HAVE_XPM),,${X_PRE_LIBS} ${X11_LIBS}) +if test "$XPM_LIBS" != ""; then +AC_CHECK_HEADERS(X11/xpm.h xpm.h) +fi +AC_SUBST(XPM_LIBS) +dnl +dnl +dnl Check for Motif widget libraries +dnl +dnl +XM_LIBS="" +XP_LIBS="" +if test "$motif_includes" != "no" && test "$motif_libraries" != "no" +then +dnl Motif 2.1 wants `-lXp' (X11R6.3 print server) +AC_CHECK_LIB(Xp, XpSelectInput, + XP_LIBS="-lXp" + AC_DEFINE(HAVE_XP),, + ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN}) +dnl +AC_CHECK_LIB(Xm, XmCreateOptionMenu, + XM_LIBS="-lXm" + AC_DEFINE(HAVE_MOTIF),, + ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN}) +fi +if test "$XM_LIBS" = ""; then +dnl Without Motif, we won't get far. Let the user fix this. +AC_MSG_WARN([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.]) +MISSING_MOTIF="# " +AC_SUBST(MISSING_MOTIF) +fi +AC_SUBST(XP_LIBS) +AC_SUBST(XM_LIBS) +dnl +dnl +dnl +dnl +LIBS="$ice_save_LIBS" +CFLAGS="$ice_save_CFLAGS" +CPPFLAGS="$ice_save_CPPFLAGS" +LDFLAGS="$ice_save_LDFLAGS" +fi + +AC_OUTPUT(Makefile) diff --git a/display.c b/display.c new file mode 100644 index 00000000..aa35004c --- /dev/null +++ b/display.c @@ -0,0 +1,196 @@ + +/* include files */ +#include <stdio.h> + +#include <Xm/Xm.h> +#include <Xm/ScrolledW.h> +#include <Xm/ScrollBar.h> +#include <Xm/PushB.h> +#include <Xm/ToggleB.h> +#include <Xm/ArrowB.h> +#include <Xm/CascadeB.h> +#include <Xm/Separator.h> +#include <Xm/DrawnB.h> +#include <Xm/Scale.h> +#include <Xm/Frame.h> +#include <Xm/Form.h> +#include <Xm/RowColumn.h> +#include <Xm/Label.h> +#include <Xm/TextF.h> +#include <Xm/Text.h> +#include <Xm/List.h> +#include <Xm/DrawingA.h> +#include <Xm/MenuShell.h> +#include <X11/Shell.h> +#include <math.h> + +#include "nmea.h" + + +#define XCENTER (double)(width/2) +#define YCENTER (double)(height/2) +#define SCALE (double)(diameter/2) +#define DEG2RAD (3.1415926535897931160E0/180.0) +#define RM 20 + +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) + +Widget draww; +GC drawGC; +Dimension width, height; +int diameter; +Pixmap pixmap; + +set_color(String color) +{ + Display *dpy = XtDisplay(draww); + Colormap cmap = DefaultColormapOfScreen(XtScreen(draww)); + XColor col, unused; + + if (!XAllocNamedColor(dpy, cmap, color, &col, &unused)) { + char buf[32]; + + sprintf(buf, "Can't alloc %s", color); + XtWarning(buf); + return; + } + XSetForeground(dpy, drawGC, col.pixel); +} + +register_canvas(Widget w, GC gc) +{ + draww = w; + drawGC = gc; + + XtVaGetValues(w, XmNwidth, &width, XmNheight, &height, NULL); + pixmap = XCreatePixmap(XtDisplay(w), + RootWindowOfScreen(XtScreen(w)), width, height, + DefaultDepthOfScreen(XtScreen(w))); + set_color("White"); + XFillRectangle(XtDisplay(draww), pixmap, drawGC, 0, 0, width, height); + diameter = min(width, height) - RM; +} + +//#define PCORRECT + +static void pol2cart(double azimuth, double elevation, double *xout, double *yout) +{ + double sinelev; + + azimuth *= DEG2RAD; + elevation = 90.0 - elevation; + +#ifdef PCORRECT + elevation *= DEG2RAD; + sinelev = sin(elevation) * SCALE; +#else + sinelev = (elevation / 90.0) * SCALE; +#endif + *xout = XCENTER + sin(azimuth) * sinelev; + *yout = YCENTER - cos(azimuth) * sinelev; +} + + +void draw_arc(int x, int y, int diam) +{ + XDrawArc(XtDisplay(draww), pixmap, drawGC, + x - diam / 2, y - diam / 2, // x,y + diam, diam, // width, height + 0, 360 * 64 // angle1, angle2 + ); +} + + +int get_status(int satellite) +{ + int i; + int s; + + if (gNMEAdata.ZCHseen) { + for (i = 0; i < 12; i++) + if (satellite == gNMEAdata.Zs[i]) + return gNMEAdata.Zv[i]; + return 0; + } else { + for (i = 0; i < 12; i++) + if (satellite == gNMEAdata.PRN[i]) { + s = gNMEAdata.ss[i] / 6; + return s > 7 ? 7 : s; + } + return 0; + } +} + + +draw_graphics() +{ + int i; + double x, y; + char buf[20]; + + if (gNMEAdata.cmask & (C_SAT | C_ZCH)) { + + i = min(width, height); + + set_color("White"); + XFillRectangle(XtDisplay(draww), pixmap, drawGC, 0, 0, width, height); + + // draw something in the center + set_color("Grey"); + draw_arc(width / 2, height / 2, 6); + + // draw the 45 degree circle +#ifdef PCORRECT + draw_arc(width / 2, height / 2, ((i - RM) * 7) / 10); // sin(45) ~ 0.7 +#else + draw_arc(width / 2, height / 2, (i - RM) / 2); +#endif + + set_color("Black"); + draw_arc(width / 2, height / 2, i - RM); + + // Now draw the satellites... + for (i = 0; i < gNMEAdata.in_view; i++) { + pol2cart(gNMEAdata.azimuth[i], gNMEAdata.elevation[i], &x, &y); + + switch (get_status(gNMEAdata.PRN[i]) & 7) { + case 0: + case 1: + set_color("Grey"); + break; + case 2: + case 3: + set_color("Yellow"); + break; + case 4: + case 5: + case 6: + set_color("Red"); + break; + case 7: + set_color("Green"); + break; + } + XFillArc(XtDisplay(draww), pixmap, drawGC, + (int) x - 5, (int) y - 5, // x,y + 11, 11, // width, height + 0, 360 * 64 // angle1, angle2 + ); + sprintf(buf, "%02d", gNMEAdata.PRN[i]); + set_color("Blue"); + XDrawString(XtDisplay(draww), pixmap, drawGC, + (int) x + 0, (int) y + 17, buf, 2); + } + XCopyArea(XtDisplay(draww), pixmap, XtWindow(draww), drawGC, + 0, 0, width, height, 0, 0); + } +} + +redraw(Widget w, XtPointer client_data, XmDrawingAreaCallbackStruct * cbs) +{ + XCopyArea(XtDisplay(draww), pixmap, XtWindow(draww), drawGC, + cbs->event->xexpose.x, cbs->event->xexpose.y, + cbs->event->xexpose.width, cbs->event->xexpose.height, + cbs->event->xexpose.x, cbs->event->xexpose.y); +} @@ -0,0 +1,496 @@ + +/************************************************** +* File: gps.c - application source file +* +* This file is generated by the program lxb. +* +**************************************************/ + +/* include files */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <Xm/Xm.h> +#include <Xm/MwmUtil.h> +#include <Xm/ScrolledW.h> +#include <Xm/ScrollBar.h> +#include <Xm/PushB.h> +#include <Xm/ToggleB.h> +#include <Xm/ArrowB.h> +#include <Xm/CascadeB.h> +#include <Xm/Separator.h> +#include <Xm/DrawnB.h> +#include <Xm/Scale.h> +#include <Xm/Frame.h> +#include <Xm/Form.h> +#include <Xm/RowColumn.h> +#include <Xm/Label.h> +#include <Xm/TextF.h> +#include <Xm/Text.h> +#include <Xm/List.h> +#include <Xm/DrawingA.h> +#include <Xm/MenuShell.h> +#include <Xm/Protocols.h> +#include <X11/Shell.h> +#include <sys/ioctl.h> +#include <sys/termios.h> + +#include "nmea.h" + +extern void _XEditResCheckMessages(); + +/* global variables */ +Widget lxbApp; +Widget form_6; +Widget list_7; +Widget list_8; +Widget drawingArea_8; +Widget rowColumn_10; +Widget rowColumn_11; +Widget rowColumn_12; +Widget rowColumn_13; +Widget rowColumn_14; +Widget rowColumn_15; +Widget rowColumn_16; +Widget pushButton_11; +Widget text_1, text_2, text_3, text_4, text_5; +Widget label_1, label_2, label_3, label_4, label_5; +Widget status; + + /* command line options */ +int debug = 0; +int device_speed = B4800; +char *device_name = 0; +char *latitude = 0; +char *longitude = 0; +char latd = 'N'; +char lond = 'W'; + /* command line option defaults */ +char *default_device_name = "localhost:5678"; +char *default_latitude = "3600.000"; +char *default_longitude = "12300.000"; + + +GC gc; +static Atom delw; + +#define BUFSIZE 4096 + +extern void redraw(); + +void quit_cb() +{ + serial_close(); + exit(0); +} + + +/************************************************** +* Function: get_pixel +**************************************************/ +Pixel +get_pixel(Widget w, char *resource_value) +{ + Colormap colormap; + Boolean status; + XColor exact, color; + + colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(XtDisplay(w))); + + status = XAllocNamedColor(XtDisplay(w), colormap, resource_value, &color, &exact); + + if (status == 0) { + fprintf(stderr, "Unknown color: %s", resource_value); + color.pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(XtDisplay(w))); + }; + + return (color.pixel); +} + +/************************************************** +* Function: build_gui +**************************************************/ +static void build_gui(Widget lxbApp) +{ + int n; + Arg args[100]; + XGCValues gcv; + + n = 0; + XtSetArg(args[n], XmNrubberPositioning, False); + n++; + XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); + n++; + + form_6 = XtCreateManagedWidget("gps_data", xmFormWidgetClass, lxbApp, args, n); + + XtSetArg(args[0], XmNbackground, get_pixel(lxbApp, "snow")); + XtSetArg(args[1], XmNleftOffset, 10); + XtSetArg(args[2], XmNtopOffset, 10); + XtSetArg(args[3], XmNbottomAttachment, XmATTACH_NONE); + XtSetArg(args[4], XmNleftAttachment, XmATTACH_FORM); + XtSetArg(args[5], XmNtopAttachment, XmATTACH_FORM); + XtSetArg(args[6], XmNheight, 204); + XtSetArg(args[7], XmNwidth, 100); + XtSetArg(args[8], XmNlistSizePolicy, XmCONSTANT); + XtSetArg(args[9], XmNhighlightThickness, 0); + XtSetArg(args[10], XmNlistSpacing, 4); + list_7 = XtCreateManagedWidget("list_7", xmListWidgetClass, form_6, args, 11); + + XtSetArg(args[0], XmNbackground, get_pixel(lxbApp, "snow")); + XtSetArg(args[1], XmNleftOffset, 10); + XtSetArg(args[2], XmNtopOffset, 10); + XtSetArg(args[3], XmNbottomAttachment, XmATTACH_NONE); + XtSetArg(args[4], XmNleftAttachment, XmATTACH_WIDGET); + XtSetArg(args[5], XmNtopAttachment, XmATTACH_FORM); + XtSetArg(args[6], XmNheight, 204); + XtSetArg(args[7], XmNwidth, 80); + XtSetArg(args[8], XmNlistSizePolicy, XmCONSTANT); + XtSetArg(args[9], XmNhighlightThickness, 0); + XtSetArg(args[10], XmNlistSpacing, 4); + XtSetArg(args[11], XmNleftWidget, list_7); + list_8 = XtCreateManagedWidget("list_8", xmListWidgetClass, form_6, args, 12); + + XtSetArg(args[0], XmNbottomAttachment, XmATTACH_NONE); + XtSetArg(args[1], XmNleftOffset, 10); + XtSetArg(args[2], XmNrightOffset, 10); + XtSetArg(args[3], XmNbackground, get_pixel(lxbApp, "snow")); + XtSetArg(args[4], XmNy, 10); + XtSetArg(args[5], XmNx, 80); + XtSetArg(args[6], XmNrightAttachment, XmATTACH_NONE); + XtSetArg(args[7], XmNleftWidget, list_8); + XtSetArg(args[8], XmNtopOffset, 10); + XtSetArg(args[9], XmNleftAttachment, XmATTACH_WIDGET); + XtSetArg(args[10], XmNtopAttachment, XmATTACH_FORM); + XtSetArg(args[11], XmNresizePolicy, XmRESIZE_NONE); + XtSetArg(args[12], XmNheight, 402); + XtSetArg(args[13], XmNwidth, 402); + drawingArea_8 = XtCreateManagedWidget("drawingArea_8", + xmDrawingAreaWidgetClass, form_6, args, 14); + gcv.foreground = BlackPixelOfScreen(XtScreen(drawingArea_8)); + gc = XCreateGC(XtDisplay(drawingArea_8), + RootWindowOfScreen(XtScreen(drawingArea_8)), GCForeground, &gcv); + + register_canvas(drawingArea_8, gc); + XtAddCallback(drawingArea_8, XmNexposeCallback, redraw, NULL); + + XtSetArg(args[0], XmNtopOffset, 10); + XtSetArg(args[1], XmNbottomOffset, 10); + XtSetArg(args[2], XmNrightOffset, 10); + XtSetArg(args[3], XmNleftOffset, 10); + XtSetArg(args[4], XmNorientation, XmVERTICAL); + XtSetArg(args[5], XmNrightAttachment, XmATTACH_WIDGET); + XtSetArg(args[6], XmNrightWidget, drawingArea_8); + XtSetArg(args[7], XmNbottomAttachment, XmATTACH_NONE); //tf + + XtSetArg(args[8], XmNy, 352); + XtSetArg(args[9], XmNx, 0); + XtSetArg(args[10], XmNleftAttachment, XmATTACH_FORM); + XtSetArg(args[11], XmNtopAttachment, XmATTACH_WIDGET); + XtSetArg(args[12], XmNtopWidget, list_7); + XtSetArg(args[13], XmNheight, 30); + rowColumn_10 = XtCreateManagedWidget("rowColumn_10", xmRowColumnWidgetClass, form_6, args, 14); + + XtSetArg(args[0], XmNorientation, XmHORIZONTAL); + XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM); + XtSetArg(args[2], XmNrightAttachment, XmATTACH_NONE); + XtSetArg(args[3], XmNtopAttachment, XmATTACH_WIDGET); + XtSetArg(args[4], XmNbottomAttachment, XmATTACH_NONE); + XtSetArg(args[5], XmNrightWidget, drawingArea_8); + XtSetArg(args[6], XmNtopWidget, rowColumn_10); + rowColumn_11 = XtCreateManagedWidget("time", xmRowColumnWidgetClass, form_6, args, 7); + + XtSetArg(args[6], XmNtopWidget, rowColumn_11); + rowColumn_12 = XtCreateManagedWidget("latitude", xmRowColumnWidgetClass, form_6, args, 7); + + XtSetArg(args[6], XmNtopWidget, rowColumn_12); + rowColumn_13 = XtCreateManagedWidget("longitude", xmRowColumnWidgetClass, form_6, args, 7); + + XtSetArg(args[6], XmNtopWidget, rowColumn_13); + rowColumn_14 = XtCreateManagedWidget("altitude", xmRowColumnWidgetClass, form_6, args, 7); + + XtSetArg(args[6], XmNtopWidget, rowColumn_14); + rowColumn_15 = XtCreateManagedWidget("fix_status", xmRowColumnWidgetClass, form_6, args, 7); + + XtSetArg(args[6], XmNtopWidget, rowColumn_15); + rowColumn_16 = XtCreateManagedWidget("quit", xmRowColumnWidgetClass, form_6, args, 7); + + + n = 0; + label_1 = XtCreateManagedWidget("label", xmLabelWidgetClass, rowColumn_11, args, n); + label_2 = XtCreateManagedWidget("label", xmLabelWidgetClass, rowColumn_12, args, n); + label_3 = XtCreateManagedWidget("label", xmLabelWidgetClass, rowColumn_13, args, n); + label_4 = XtCreateManagedWidget("label", xmLabelWidgetClass, rowColumn_14, args, n); + label_5 = XtCreateManagedWidget("label", xmLabelWidgetClass, rowColumn_15, args, n); + + n = 0; + XtSetArg(args[n], XmNcursorPositionVisible, False); + n++; + XtSetArg(args[n], XmNeditable, False); + n++; + XtSetArg(args[n], XmNmarginHeight, 2); + n++; + XtSetArg(args[n], XmNhighlightThickness, 0); + n++; + XtSetArg(args[n], XmNshadowThickness, 1); + n++; + text_1 = XtCreateManagedWidget("text_1", xmTextFieldWidgetClass, + rowColumn_11, args, n); + text_2 = XtCreateManagedWidget("text_2", xmTextFieldWidgetClass, + rowColumn_12, args, n); + text_3 = XtCreateManagedWidget("text_3", xmTextFieldWidgetClass, + rowColumn_13, args, n); + text_4 = XtCreateManagedWidget("text_4", xmTextFieldWidgetClass, + rowColumn_14, args, n); + text_5 = XtCreateManagedWidget("text_5", xmTextFieldWidgetClass, + rowColumn_15, args, n); + + + pushButton_11 = XtCreateManagedWidget("label", + xmPushButtonWidgetClass, rowColumn_16, args, 0); + XtAddCallback(pushButton_11, XmNactivateCallback, quit_cb, NULL); + + status = XtVaCreateManagedWidget("status", xmTextFieldWidgetClass, form_6, + XmNcursorPositionVisible, False, + XmNeditable, False, + XmNmarginHeight, 1, + XmNhighlightThickness, 0, + XmNshadowThickness, 1, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_FORM, + NULL); + +} + +/************************************************** +* Function: handle_input +**************************************************/ +static void handle_input(XtPointer client_data, int *source, XtInputId * id) +{ + static 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(buf); + offset = 0; + return; + } + offset++; + } +} + +/************************************************** +* Function: update_display +**************************************************/ +update_display(char *message) +{ + int i; + XmString string[12]; + char s[128]; + + XmTextFieldSetString(status, message); + + // This is for the satellite status display + if (gNMEAdata.cmask & C_SAT) { + for (i = 0; i < 12; i++) { + if (i < gNMEAdata.in_view) { + sprintf(s, "%2d %02d %03d %02d", gNMEAdata.PRN[i], + gNMEAdata.elevation[i], + gNMEAdata.azimuth[i], gNMEAdata.ss[i]); + } else + sprintf(s, " "); + string[i] = XmStringCreateSimple(s); + } + XmListReplaceItemsPos(list_7, string, 12, 1); + for (i = 0; i < 12; i++) + XmStringFree(string[i]); + } + if (gNMEAdata.cmask & C_ZCH) { + for (i = 0; i < 12; i++) { + sprintf(s, "%2d %02x", gNMEAdata.Zs[i], gNMEAdata.Zv[i]); + string[i] = XmStringCreateSimple(s); + } + XmListReplaceItemsPos(list_8, string, 12, 1); + for (i = 0; i < 12; i++) + XmStringFree(string[i]); + } + // here now the value fields + + XmTextFieldSetString(text_1, gNMEAdata.utc); + sprintf(s, "%lf", gNMEAdata.latitude); + XmTextFieldSetString(text_2, s); + sprintf(s, "%lf", gNMEAdata.longitude); + XmTextFieldSetString(text_3, s); + sprintf(s, "%lf", gNMEAdata.altitude); + XmTextFieldSetString(text_4, s); + + switch (gNMEAdata.mode) { + case 2: + sprintf(s, "2D FIX"); + break; + case 3: + sprintf(s, "3D FIX"); + break; + default: + sprintf(s, "NO FIX"); + break; + } + XmTextFieldSetString(text_5, s); + + draw_graphics(); + gNMEAdata.cmask = 0; +} + +/************************************************** +* Function: open_input +**************************************************/ +static open_input(XtAppContext app) +{ + int input = 0; + XtInputId input_id; + + input = serial_open(); + + gNMEAdata.fdin = input; + gNMEAdata.fdout = input; + + input_id = XtAppAddInput(app, input, (XtPointer) XtInputReadMask, + handle_input, NULL); +} + +/************************************************** +* Function: init_list +**************************************************/ +init_list() +{ + int i; + XmString string; + + for (i = 1; i < 13; i++) { + string = XmStringCreateSimple(" "); + XmListAddItem(list_7, string, i); + XmListAddItem(list_8, string, i); + XmStringFree(string); + } +} + +/************************************************** +* Function: main +**************************************************/ +int main(int argc, char *argv[]) +{ + XtAppContext app; + Arg args[100]; + int n; + extern char *optarg; + int option; + double baud; + + while ((option = getopt(argc, argv, "D:hp:s:")) != -1) { + switch (option) { + case 'D': + debug = (int) strtol(optarg, 0, 0); + break; + case 'p': + if (device_name) + free(device_name); + device_name = malloc(strlen(optarg) + 1); + strcpy(device_name, optarg); + break; + case 's': + baud = strtod(optarg, 0); + if (baud < 200) + baud *= 1000; + if (baud < 2400) + device_speed = B1200; + else if (baud < 4800) + device_speed = B2400; + else if (baud < 9600) + device_speed = B4800; + else if (baud < 19200) + device_speed = B9600; + else if (baud < 38400) + device_speed = B19200; + else + device_speed = B38400; + break; + case 'h': + case '?': + default: + fputs("usage: gps [options] \n\ + options include: \n\ + -D integer [ set debug level ] \n\ + -h [ help message ] \n\ + -p string [ set gps device name ] \n\ + -s baud_rate [ set baud rate on gps device ] \n\ +", stderr); + exit(1); + } + } + if (!device_name) + device_name = default_device_name; + if (!latitude) + latitude = default_latitude; + if (!longitude) + longitude = default_longitude; + + if (debug > 0) { + fprintf(stderr, "command line options:\n"); + fprintf(stderr, " debug level: %d\n", debug); + fprintf(stderr, " gps device name: %s\n", device_name); + fprintf(stderr, " gps device speed: %d\n", device_speed); + } + lxbApp = XtVaAppInitialize(&app, "Gps", NULL, 0, &argc, argv, NULL, NULL); + + n = 0; + XtSetArg(args[n], XmNgeometry, "620x434"); + n++; + XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); + n++; + XtSetArg(args[n], XmNallowShellResize, False); + n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING); + n++; + XtSetArg(args[n], XmNmwmFunctions, + MWM_FUNC_RESIZE | MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE); + n++; + XtSetValues(lxbApp, args, n); + + XtAddEventHandler(lxbApp, (EventMask) 0, True, _XEditResCheckMessages, NULL); + + build_gui(lxbApp); + + XtRealizeWidget(lxbApp); + + + delw = XmInternAtom(XtDisplay(lxbApp), "WM_DELETE_WINDOW", False); + XmAddWMProtocolCallback(lxbApp, delw, + (XtCallbackProc) quit_cb, (XtPointer) NULL); + + open_input(app); + + init_list(); + + XtAppMainLoop(app); +} + + +int errexit(char *s) +{ + perror(s); + serial_close(); + exit(1); +} @@ -0,0 +1,368 @@ + +#include <unistd.h> +#include <stdlib.h> +#include <syslog.h> +#include <signal.h> +#include <errno.h> +#include <fcntl.h> +#include <paths.h> +#include <string.h> +#include <sys/termios.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/time.h> +#include <netinet/in.h> +#include <stdio.h> +#include "nmea.h" + +#define QLEN 5 +#define BUFSIZE 4096 + +int debug = 0; +int device_speed = B4800; +char *device_name = 0; +char *latitude = 0; +char *longitude = 0; +char latd = 'N'; +char lond = 'W'; + /* command line option defaults */ +char *default_device_name = "/dev/gps"; +char *default_latitude = "3600.000"; +char *default_longitude = "12300.000"; + +int nfds; +int verbose = 1; + +static void onsig(int sig) +{ + serial_close(); + syslog(LOG_NOTICE, "Received signal %d. Exiting...", sig); + exit(10 + sig); +} + +int daemonize() +{ + int fd; + + switch (fork()) { + case -1: + return -1; + case 0: + break; + default: + _exit(0); + } + + if (setsid() == -1) + return -1; + chdir("/"); + fd = open(_PATH_DEVNULL, O_RDWR, 0); + if (fd != -1) { + dup2(fd, STDIN_FILENO); + dup2(fd, STDOUT_FILENO); + dup2(fd, STDERR_FILENO); + if (fd > 2) + close(fd); + } + return 0; +} + +int main(int argc, char *argv[]) +{ + char *default_service = "5678"; + char *service = 0; + struct sockaddr_in fsin; + int msock; + fd_set rfds; + fd_set afds; + fd_set nmea_fds; + int alen; + int fd, input; + int need_gps; + extern char *optarg; + int option; + double baud; + + while ((option = getopt(argc, argv, "D:L:S:hl:p:s:")) != -1) { + switch (option) { + case 'D': + debug = (int) strtol(optarg, 0, 0); + break; + case 'L': + if (optarg[strlen(optarg) - 1] == 'W' || optarg[strlen(optarg) - 1] == 'w' + || optarg[strlen(optarg) - 1] == 'E' || optarg[strlen(optarg) - 1] == 'e') { + lond = toupper(optarg[strlen(optarg) - 1]); + longitude = optarg; + longitude[strlen(optarg) - 1] = '\0'; + } else + fprintf(stderr, "skipping invalid longitude (-L) option; %s must end in W or E\n", optarg); + break; + case 'S': + service = optarg; + break; + case 'l': + if (optarg[strlen(optarg) - 1] == 'N' || optarg[strlen(optarg) - 1] == 'n' + || optarg[strlen(optarg) - 1] == 'S' || optarg[strlen(optarg) - 1] == 's') { + latd = toupper(optarg[strlen(optarg) - 1]); + latitude = optarg; + latitude[strlen(optarg) - 1] = '\0'; + } else + fprintf(stderr, "skipping invalid latitude (-l) option; %s must end in N or S\n", optarg); + break; + case 'p': + device_name = optarg; + break; + case 's': + baud = strtod(optarg, 0); + if (baud < 200) + baud *= 1000; + if (baud < 2400) + device_speed = B1200; + else if (baud < 4800) + device_speed = B2400; + else if (baud < 9600) + device_speed = B4800; + else if (baud < 19200) + device_speed = B9600; + else if (baud < 38400) + device_speed = B19200; + else + device_speed = B38400; + break; + case 'h': + case '?': + default: + fputs("usage: gpsd [options] \n\ + options include: \n\ + -D integer [ set debug level ] \n\ + -L longitude [ set longitude ] \n\ + -S integer [ set port for daemon ] \n\ + -h [ help message ] \n\ + -l latitude [ set latitude ] \n\ + -p string [ set gps device name ] \n\ + -s baud_rate [ set baud rate on gps device ] \n\ +", stderr); + exit(1); + } + } + if (!device_name) + device_name = default_device_name; + if (!latitude) + latitude = default_latitude; + if (!longitude) + longitude = default_longitude; + if (!service) + service = default_service; + if (debug > 0) { + fprintf(stderr, "command line options:\n"); + fprintf(stderr, " debug level: %d\n", debug); + fprintf(stderr, " gps device name: %s\n", device_name); + fprintf(stderr, " gps device speed: %d\n", device_speed); + fprintf(stderr, " gpsd port: %s\n", service); + fprintf(stderr, " latitude: %s%c\n", latitude, latd); + fprintf(stderr, " longitude: %s%c\n", longitude, lond); + } + if (debug < 2) + daemonize(); + + /* Handle some signals */ + signal(SIGINT, onsig); + signal(SIGHUP, onsig); + signal(SIGTERM, onsig); + + openlog("gpsd", LOG_PID, LOG_USER); + syslog(LOG_NOTICE, "Gpsd started (Version 0.93)"); + syslog(LOG_NOTICE, "Gpsd listening on port %s", service); + + msock = passiveTCP(service, QLEN); + + nfds = getdtablesize(); + + FD_ZERO(&afds); + FD_ZERO(&nmea_fds); + FD_SET(msock, &afds); + + input = -1; + + while (1) { + bcopy((char *) &afds, (char *) &rfds, sizeof(rfds)); + + if (select(nfds, &rfds, (fd_set *) 0, (fd_set *) 0, + (struct timeval *) 0) < 0) { + if (errno == EINTR) + continue; + errexit("select"); + } + if (FD_ISSET(msock, &rfds)) { + int ssock; + + alen = sizeof(fsin); + ssock = accept(msock, (struct sockaddr *) &fsin, + &alen); + + if (ssock < 0) + errexit("accept"); + + FD_SET(ssock, &afds); + } + if (input >= 0 && FD_ISSET(input, &rfds)) { + handle_input(input, &afds, &nmea_fds); + } + need_gps = 0; + for (fd = 0; fd < nfds; fd++) { + if (fd != msock && fd != input && FD_ISSET(fd, &rfds)) { + if (input == -1) { + if ((input = serial_open()) < 0) + errexit("serial open: "); + syslog(LOG_NOTICE, "Opened gps"); + FD_SET(input, &afds); + gNMEAdata.fdin = input; + gNMEAdata.fdout = input; + } + if (handle_request(fd, &nmea_fds) == 0) { + (void) close(fd); + FD_CLR(fd, &afds); + FD_CLR(fd, &nmea_fds); + } + } + if (fd != msock && fd != input && FD_ISSET(fd, &afds)) { + need_gps++; + } + } + + if (!need_gps && input != -1) { + FD_CLR(input, &afds); + input = -1; + gNMEAdata.fdin = input; + gNMEAdata.fdout = input; + serial_close(); + syslog(LOG_NOTICE, "Closed gps"); + gNMEAdata.mode = 1; + gNMEAdata.status = 0; + } + } +} + + +int handle_request(int fd, fd_set * fds) +{ + char buf[BUFSIZE]; + char reply[BUFSIZE]; + char *p; + int cc; + + cc = read(fd, buf, sizeof(buf) - 1); + if (cc < 0) + return 0; + + buf[cc] = '\0'; + + sprintf(reply, "GPSD"); + p = buf; + while (*p) { + switch (*p) { + case 'P': + case 'p': + sprintf(reply + strlen(reply), + ",P=%lf %lf", + gNMEAdata.latitude, + gNMEAdata.longitude); + break; + case 'D': + case 'd': + sprintf(reply + strlen(reply), + ",D=%s", + gNMEAdata.utc); + break; + case 'A': + case 'a': + sprintf(reply + strlen(reply), + ",A=%lf", + gNMEAdata.altitude); + break; + case 'V': + case 'v': + sprintf(reply + strlen(reply), + ",V=%lf", + gNMEAdata.speed); + break; + case 'R': + case 'r': + if (FD_ISSET(fd, fds)) { + FD_CLR(fd, fds); + sprintf(reply + strlen(reply), + ",R=0"); + } else { + FD_SET(fd, fds); + sprintf(reply + strlen(reply), + ",R=1"); + } + break; + case 'S': + case 's': + sprintf(reply + strlen(reply), + ",S=%d", + gNMEAdata.status); + break; + case 'M': + case 'm': + sprintf(reply + strlen(reply), + ",M=%d", + gNMEAdata.mode); + break; + case '\r': + case '\n': + *p = '\0'; /* ignore the rest */ + break; + + } + p++; + } + strcat(reply, "\r\n"); + + if (cc && write(fd, reply, strlen(reply) + 1) < 0) + return 0; + + return cc; +} + +int handle_input(int input, fd_set * afds, fd_set * nmea_fds) +{ + static char buf[BUFSIZE]; /* that is more then a sentence */ + static int offset = 0; + int fd; + + while (offset < BUFSIZE) { + if (read(input, buf + offset, 1) != 1) + return 1; + if (buf[offset] == '\n' || buf[offset] == '\r') { + buf[offset] = '\0'; + if (strlen(buf)) { + handle_message(buf); + strcat(buf, "\r\n"); + for (fd = 0; fd < nfds; fd++) { + if (FD_ISSET(fd, nmea_fds)) { + if (write(fd, buf, strlen(buf)) < 0) { + syslog(LOG_NOTICE, "Raw write: %s", sys_errlist[errno]); + FD_CLR(fd, afds); + FD_CLR(fd, nmea_fds); + } + } + } + } + offset = 0; + return 1; + } + offset++; + buf[offset] = '\0'; + } + offset = 0; /* discard input ! */ + return 1; +} + +int errexit(char *s) +{ + syslog(LOG_ERR, "%s: %s\n", s, strerror(errno)); + serial_close(); + exit(2); +} diff --git a/gpsd.lsm b/gpsd.lsm new file mode 100644 index 00000000..02538e37 --- /dev/null +++ b/gpsd.lsm @@ -0,0 +1,18 @@ +Begin3 +Title: gpsd +Version: 0.93 +Entered-date: 980127 +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 +Author: remco@rvt.com (Remco Treffkorn) +Maintained-by: remco@rvt.com (Remco Treffkorn) +Primary-site: ftp://ftp.ugraf.com/pub/gpsd +Alternate-site: ftp://sunsite.unc.edu:/pub/Linux/system/daemons +Original-site: +Platforms: Linux / Unix +Copying-policy: GPL +End diff --git a/netlib.c b/netlib.c new file mode 100644 index 00000000..d585060d --- /dev/null +++ b/netlib.c @@ -0,0 +1,120 @@ + +#include <string.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/time.h> +#include <netinet/in.h> +#include <varargs.h> +#include <netdb.h> +#include <stdio.h> + +#if defined (HAVE_SYS_PARAM_H) +#include <sys/param.h> +#endif + +static char mbuf[128]; + +int passivesock(char *service, char *protocol, int qlen) +{ + struct servent *pse; + struct protoent *ppe; + struct sockaddr_in sin; + int s, type; + + bzero((char *) &sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + + if (pse = getservbyname(service, protocol)) + sin.sin_port = htons(ntohs((u_short) pse->s_port)); + else if ((sin.sin_port = htons((u_short) atoi(service))) == 0) { + sprintf(mbuf, "Can't get \"%s\" service entry.\n", service); + errexit(mbuf); + } + if ((ppe = getprotobyname(protocol)) == 0) { + sprintf(mbuf, "Can't get \"%s\" protocol entry.\n", protocol); + errexit(mbuf); + } + if (strcmp(protocol, "udp") == 0) + type = SOCK_DGRAM; + else + type = SOCK_STREAM; + + s = socket(PF_INET, type, ppe->p_proto); + if (s < 0) + errexit("Can't create socket:"); + + if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) { + sprintf(mbuf, "Can't bind to port %s", service); + errexit(mbuf); + } + if (type == SOCK_STREAM && listen(s, qlen) < 0) { + sprintf(mbuf, "Can't listen on %s port:", service); + errexit(mbuf); + } + return s; +} + +int passiveUDP(char *service, int qlen) +{ + return passivesock(service, "udp", qlen); +} + +int passiveTCP(char *service, int qlen) +{ + return passivesock(service, "tcp", qlen); +} + + +int connectsock(char *host, char *service, char *protocol) +{ + struct hostent *phe; + struct servent *pse; + struct protoent *ppe; + struct sockaddr_in sin; + int s, type; + + bzero((char *) &sin, sizeof(sin)); + sin.sin_family = AF_INET; + + if (pse = getservbyname(service, protocol)) + sin.sin_port = htons(ntohs((u_short) pse->s_port)); + else if ((sin.sin_port = htons((u_short) atoi(service))) == 0) { + sprintf(mbuf, "Can't get \"%s\" service entry.\n", service); + errexit(mbuf); + } + if (phe = gethostbyname(host)) + bcopy(phe->h_addr, (char *) &sin.sin_addr, phe->h_length); + else if ((sin.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) { + sprintf(mbuf, "Can't get host entry: \"%s\".\n", host); + errexit(mbuf); + } + if ((ppe = getprotobyname(protocol)) == 0) { + sprintf(mbuf, "Can't get \"%s\" protocol entry.\n", protocol); + errexit(mbuf); + } + if (strcmp(protocol, "udp") == 0) + type = SOCK_DGRAM; + else + type = SOCK_STREAM; + + s = socket(PF_INET, type, ppe->p_proto); + if (s < 0) + errexit("Can't create socket:"); + + if (connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) { + sprintf(mbuf, "Can't connect to %s.%s", host, service); + errexit(mbuf); + } + return s; +} + +int connectUDP(char *host, char *service) +{ + return connectsock(host, service, "udp"); +} + +int connectTCP(char *host, char *service) +{ + return connectsock(host, service, "tcp"); +} @@ -0,0 +1,67 @@ + +#define GPGGA "GPGGA" +#define GPGSA "GPGSA" +#define GPGSV "GPGSV" +#define GPRMC "GPRMC" +#define PRWIZCH "PRWIZCH" + +struct OUTDATA { + int fdin; + int fdout; + + long cmask; + char utc[20]; // UTC date / time in format "mm/dd/yy hh:mm:ss" + + double latitude; // Latitude and longitude in format "d.ddddd" + + double longitude; + double altitude; // Altitude in meters + + double speed; // Speed over ground, knots + + double track; // Track made good, degress True + + int satellites; // Number of satellites used in solution + + int status; // 0 = no fix, 1 = fix, 2 = dgps fix + + int mode; // 1 = no fix, 2 = 2D, 3 = 3D + + double pdop; // Position dilution of precision + + double hdop; // Horizontal dilution of precision + + double vdop; // Vertical dilution of precision + + int in_view; // # of satellites in view + + int PRN[12]; // PRN of satellite + + int elevation[12]; // elevation of satellite + + int azimuth[12]; // azimuth + + int ss[12]; // signal strength + + int ZCHseen; // flag + + int Zs[12]; // for the rockwell PRWIZCH + + int Zv[12]; // value + +}; + +#define C_LATLON 1 +#define C_SAT 2 +#define C_ZCH 4 + +/* prototypes */ +void doNMEA(short refNum); +void processGPRMC(char *sentence); +void processGPGGA(char *sentence); +void processGPGSV(char *sentence); +void processGPGSA(char *sentence); +short checksum(char *sentence); + + +extern struct OUTDATA gNMEAdata; diff --git a/nmea_parse.c b/nmea_parse.c new file mode 100644 index 00000000..9fd1c0e0 --- /dev/null +++ b/nmea_parse.c @@ -0,0 +1,234 @@ +#include <stdio.h> +#include <math.h> +#include "nmea.h" + +extern struct OUTDATA gNMEAdata; +static void do_lat_lon(char *sentence, int begin); +static char *field(char *sentence, short n); + +static void update_field_i(char *sentence, int fld, int *dest, int mask); +static void update_field_f(char *sentence, int fld, double *dest, int mask); +/* ----------------------------------------------------------------------- */ + +/* + The time field in the GPRMC sentence is in the format hhmmss; + the date field is in the format ddmmyy. The output will + be in the format: + + mm/dd/yyyy hh:mm:ss + 01234567890123456789 + */ + +void processGPRMC(char *sentence) +{ + char s[20], d[10]; + + sscanf(field(sentence, 9), "%s", d); // Date: ddmmyy + + strncpy(s, d + 2, 2); // copy month + + strncpy(s + 3, d, 2); // copy date + + strncpy(s + 6, "19", 2); // 20th century + + strncpy(s + 8, d + 4, 2); // copy year + + sscanf(field(sentence, 1), "%s", d); // Time: hhmmss + + strncpy(s + 11, d, 2); // copy hours + + strncpy(s + 14, d + 2, 2); // copy minutes + + strncpy(s + 17, d + 4, 2); // copy seconds + + s[2] = s[5] = '/'; // add the '/'s, ':'s, ' ' and string terminator + + s[10] = ' '; + s[13] = s[16] = ':'; + s[19] = '\0'; + + strcpy(gNMEAdata.utc, s); + + if (strcmp(field(sentence, 2), "A") == 0) + gNMEAdata.status = 1; + else + gNMEAdata.status = 0; + + sscanf(field(sentence, 7), "%lf", &gNMEAdata.speed); + sscanf(field(sentence, 8), "%lf", &gNMEAdata.track); + + do_lat_lon(sentence, 3); + +} + +/* ----------------------------------------------------------------------- */ + +void processGPGGA(char *sentence) +{ + double lat, lon, d, m; + char str[20]; + + do_lat_lon(sentence, 2); + sscanf(field(sentence, 6), "%d", &gNMEAdata.status); + sscanf(field(sentence, 7), "%d", &gNMEAdata.satellites); + sscanf(field(sentence, 9), "%lf", &gNMEAdata.altitude); +} + +/* ----------------------------------------------------------------------- */ + +void processGPGSA(char *sentence) +{ + + sscanf(field(sentence, 2), "%d", &gNMEAdata.mode); + sscanf(field(sentence, 15), "%lf", &gNMEAdata.pdop); + sscanf(field(sentence, 16), "%lf", &gNMEAdata.hdop); + sscanf(field(sentence, 17), "%lf", &gNMEAdata.vdop); +} + +/* ----------------------------------------------------------------------- */ + +void processGPGSV(char *sentence) +{ + int n, m, f = 4; + + + sscanf(field(sentence, 2), "%d", &n); + update_field_i(sentence, 3, &gNMEAdata.in_view, C_SAT); + + n = (n - 1) * 4; + m = n + 4; + + while (n < gNMEAdata.in_view && n < m) { + update_field_i(sentence, f++, &gNMEAdata.PRN[n], C_SAT); + update_field_i(sentence, f++, &gNMEAdata.elevation[n], C_SAT); + update_field_i(sentence, f++, &gNMEAdata.azimuth[n], C_SAT); + if (*(field(sentence, f))) + update_field_i(sentence, f, &gNMEAdata.ss[n], C_SAT); + f++; + n++; + } +} + +/* ----------------------------------------------------------------------- */ + +void processPRWIZCH(char *sentence) +{ + int i; + + for (i = 0; i < 12; i++) { + update_field_i(sentence, 2 * i + 1, &gNMEAdata.Zs[i], C_ZCH); + update_field_i(sentence, 2 * i + 2, &gNMEAdata.Zv[i], C_ZCH); + } + gNMEAdata.ZCHseen = 1; +} + +/* ----------------------------------------------------------------------- */ + +static void do_lat_lon(char *sentence, int begin) +{ + double lat, lon, d, m; + char str[20], *p; + + + if (*(p = field(sentence, begin + 0)) != '\0') { + strncpy(str, p, 20); + sscanf(p, "%lf", &lat); + m = 100.0 * modf(lat / 100.0, &d); + lat = d + m / 60.0; + p = field(sentence, begin + 1); + if (*p == 'S') + lat = -lat; + if (gNMEAdata.latitude != lat) { + gNMEAdata.latitude = lat; + gNMEAdata.cmask |= C_LATLON; + } + } + if (*(p = field(sentence, begin + 2)) != '\0') { + strncpy(str, p, 20); + sscanf(p, "%lf", &lon); + m = 100.0 * modf(lon / 100.0, &d); + lon = d + m / 60.0; + + p = field(sentence, begin + 3); + if (*p == 'W') + lon = -lon; + if (gNMEAdata.longitude != lon) { + gNMEAdata.longitude = lon; + gNMEAdata.cmask |= C_LATLON; + } + } +} + + +static void update_field_i(char *sentence, int fld, int *dest, int mask) +{ + int tmp; + + sscanf(field(sentence, fld), "%d", &tmp); + + if (tmp != *dest) { + *dest = tmp; + gNMEAdata.cmask |= mask; + } +} + + +static void update_field_f(char *sentence, int fld, double *dest, int mask) +{ + double tmp; + + scanf(field(sentence, fld), "%lf", &tmp); + + if (tmp != *dest) { + *dest = tmp; + gNMEAdata.cmask |= mask; + } +} +/* ----------------------------------------------------------------------- */ + +short checksum(char *sentence) +{ + unsigned char sum = '\0'; + char c, *p = sentence, csum[3]; + + while ((c = *p++) != '*') + sum ^= c; + + sprintf(csum, "%02X", sum); + return (strncmp(csum, p, 2) == 0); +} + +add_checksum(char *sentence) +{ + unsigned char sum = '\0'; + char c, *p = sentence, csum[3]; + + while ((c = *p++) != '*') + sum ^= c; + + sprintf(p, "%02X\r\n", sum); +} + +/* ----------------------------------------------------------------------- */ + +/* field() returns a string containing the nth comma delimited + field from sentence string + */ + +static char * + field(char *sentence, short n) +{ + static char result[100]; + char *p = sentence; + short m = n; + + while (n-- > 0) + while (*p++ != ','); + strcpy(result, p); + p = result; + while (*p && *p != ',' && *p != '*' && *p != '\r') + p++; + + *p = '\0'; + return result; +} diff --git a/serial.c b/serial.c new file mode 100644 index 00000000..bb66dc4b --- /dev/null +++ b/serial.c @@ -0,0 +1,108 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <fcntl.h> +#include <sys/termios.h> + +#if defined (HAVE_TERMIO_H) +#include <termio.h> +#define USE_TERMIO 1 +#define TIOCGETA TCGETA +#define TIOCSETAF TCSETAF + +#ifndef ONLCR +#define ONLCR ONLRET +#endif + +#define termios termio +#define tcflag_t ushort +#endif + +#define DEFAULTPORT "5678" + +extern int debug; +extern char *device_name; +extern int device_speed; + + +/* define global variables */ +static int ttyfd = -1; +static struct termios ttyset; + +int serial_open() +{ + char *temp; + char *p; + int err; + + temp = malloc(strlen(device_name) + 1); + strcpy(temp, device_name); + + if (p = strchr(temp, ':')) { + char *port = DEFAULTPORT; + int one = 1; + + if (*(p + 1)) + port = p + 1; + *p = '\0'; + + //temp now holds the HOSTNAME portion and port the port number. + if (debug > 5) + fprintf(stderr, "Host: %s Port: %s\n", temp, port); + 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"); + } else { + ttyfd = open(temp, O_RDWR | O_NONBLOCK); + free(temp); + + if (ttyfd < 0) + return (-1); + + if (isatty(ttyfd)) { + + if (ioctl(ttyfd, TIOCGETA, &ttyset) < 0) + return (-1); + +#if defined (USE_TERMIO) + ttyset.c_cflag = CBAUD & device_speed; + ttyset.c_cflag = CBAUD & B4800; +#else + ttyset.c_ispeed = device_speed; + ttyset.c_ospeed = device_speed; +#endif + ttyset.c_cflag &= ~PARENB; + ttyset.c_cflag |= (CSIZE & CS8) | CREAD | CLOCAL; + ttyset.c_iflag = ttyset.c_oflag = ttyset.c_lflag = (tcflag_t) 0; + ttyset.c_oflag = (ONLCR); + if (ioctl(ttyfd, TIOCSETAF, &ttyset) < 0) + return (-1); + } + } + return ttyfd; +} + +void serial_close() +{ + if (ttyfd != -1) { + if (isatty(ttyfd)) { +#if defined (USE_TERMIO) + ttyset.c_cflag = CBAUD & B0; +#else + ttyset.c_ispeed = B0; + ttyset.c_ospeed = B0; +#endif + ioctl(ttyfd, TIOCSETAF, &ttyset); + } + close(ttyfd); + ttyfd = -1; + } +} @@ -0,0 +1,102 @@ +#include <stdio.h> +#include <time.h> +#include <fcntl.h> +#include "nmea.h" + + +struct OUTDATA gNMEAdata; + +extern char *latitude; +extern char *longitude; + +extern int debug; +extern char latd; +extern char lond; + +process_message(char *sentence) +{ + if (checksum(sentence)) { + if (strncmp(GPRMC, sentence, 5) == 0) { + processGPRMC(sentence); + } else if (strncmp(GPGGA, sentence, 5) == 0) { + processGPGGA(sentence); + } else if (strncmp(GPGSA, sentence, 5) == 0) { + processGPGSA(sentence); + } else if (strncmp(GPGSV, sentence, 5) == 0) { + processGPGSV(sentence); + } else if (strncmp(PRWIZCH, sentence, 7) == 0) { + processPRWIZCH(sentence); + } else { + if (debug > 1) { + fprintf(stderr, "Unknown sentence: \"%s\"\n", + sentence); + } + } + } +} + +send_init() +{ + char buf[82]; + time_t t; + struct tm *tm; + char lat[11], lon[11], latd[2], lond[2]; + + t = time(NULL); + tm = gmtime(&t); + + sprintf(buf, + "$PRWIINIT,V,,,%s,%c,%s,%c,100.0,0.0,M,0.0,T,%02d%02d%02d,%02d%02d%02d*", + latitude, latd, longitude, lond, + tm->tm_hour, tm->tm_min, tm->tm_sec, + tm->tm_mday, tm->tm_mon + 1, tm->tm_year); + add_checksum(buf + 1); /* add c-sum + cr/lf */ + write(gNMEAdata.fdout, buf, strlen(buf)); + if (debug > 1) { + fprintf(stderr, "Sending: %s", buf); + } +} + +do_init() +{ + static count = 0; + + count++; + + if (count == 2) { + count = 0; + send_init(); + } +} + +process_exception(char *sentence) +{ + if (strncmp("ASTRAL", sentence, 6) == 0 && isatty(gNMEAdata.fdout)) { + write(gNMEAdata.fdout, "$IIGPQ,ASTRAL*73\r\n", 18); + do_init(); + } else if (debug > 1) { + fprintf(stderr, "Unknown exception: \"%s\"", + sentence); + } +} + +handle_message(char *sentence) +{ + if (debug > 5) + fprintf(stderr, "%s\n", sentence); + if (*sentence == '$') + process_message(sentence + 1); + else + process_exception(sentence); + + if (debug > 2) { + fprintf(stderr, + "Lat: %lf Lon: %lf Alt: %lf Sat: %d Mod: %d Time: %s\n", + gNMEAdata.latitude, + gNMEAdata.longitude, + gNMEAdata.altitude, + gNMEAdata.satellites, + gNMEAdata.mode, + gNMEAdata.utc); + } +} |