latd/0000755000000000000000000000000012254071613006671 5ustar latd/mkinstalldirs0000755000000000000000000000132507634621212011502 0ustar #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1 2003/03/15 12:54:34 patrick Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here latd/interfaces.cc0000644000000000000000000000162511053013677011331 0ustar /****************************************************************************** (c) 2002 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include "interfaces.h" LATinterfaces::LATinterfaces() { } LATinterfaces::~LATinterfaces() { } // LATinterfaces::Create() is in // a real implementation class. latd/lat.html0000644000000000000000000004744211053013677010354 0ustar DECnet for Linux - LAT
tramp DECnet for Linux

A project to provide DECnet phase IV connectivity for Linux

LAT

LAT

This is a quick guide to using LAT on Linux and *BSD systems. I am assuming that you already have the latd package installed and that the latcp command is on root's PATH. All the terminal server examples are for the (very obsolete) DECserver 200 but the syntax is similar for other models (apart from the DECserver 90L+ which has an odd menu-type system but which is fairly intuitive for its limited feature set).

In this document I refer to latd as the daemon that is running in the background accepting incoming connections and marshalling outgoing ones, latcp is the LAT control program which is the user interface to latd.

The latcp commands are based on those used in HP Tru64 Unix, so if you are familiar with that then this should all look very familiar to you. However, they are not identical to Tru64 so you should still at least skim this document or the man page for latcp.

The examples here are for latd 1.12. Not all the features are available in earlier versions.

Starting and stopping it

latcp -s starts the lat daemon.
latcp -h stops the daemon.

By default (ie if you haven't customised the startup script) latd will advertise a service which is the hostname of your system. This means that any users that have terminals connected to a terminal service will be able to connect to your system by typing the appropriate connect command to the terminal server. On a DECserver 200 this would be "CONNECT ZAPHOD" if your machine's host name is "zaphod". Of course, if the user does not have a username on the system they will not be able to get past the login prompt. When latcp starts the daemon it runs a startup script called /etc/latd.conf which is a conventional shell script. If you want to customise the way LAT works then this is the place to do it. The rest of this document explains the latcp commands that you can use to customise LAT and it is normal to put these commands in the startup script so that they take effect each time the system is rebooted.

By default latd listens on all ethernet interfaces on your system. If you want to restrict this you can specify as many interfaces as you like on the latcp command line eg: latcp -s -i eth1 -i eth2. It is not currently possible to change this in the startup script.

When you stop latd all users are instantly disconnected. They will get no warning and work will not be saved.

Service names

latd can advertise many services, not just one for the host name. So (for example) you could add a new service called LINUX on all linux machines running latd and then users can connect to LINUX and they will be attached to the server with the lowest load average.

To add such a service use the command latcp -A -a LINUX. This tells latd to advertise the new service along with the default one using the same rating.

To remove this service use the command latcp -D -a LINUX.

Services have an optional description associated with them which can show up on some terminal servers if the user issues a SHOW SERVICE command. The description is added to the service with the -i switch. eg:latcp -A -a LINUX -i "Linux login service"
Note that the description must be enclosed in quotes if it contains spaces. To change the description of an existing service use the following command:
latcp -i "Linux is wonderful" -a LINUX

Service ratings

Every advertised service has a rating associated with it. This rating is used in the terminal servers' load balancing algorithm to determine which node to connect to when more than one system advertises the same service name. By default, services advertised by latd have dynamic ratings, that is they vary according to the load on the system. The value you specify on the latcp command line is a maximum, this value is divided by the current load average plus one each time the service is advertised on the LAN.

So, if you create a service with rating of 100 using the following command:
latcp -A -a LINUX -r 100
and the load average is 1.00, then the advertised rating will be 50. If you have several machines advertising the the same service then, to achieve effective load balancing, the rating specified on the command-line should reflect the relative power of the machines offering that service.

In addition, ratings can be static. A static rating does not vary with the system load average. If you create a service with the following command:
latcp -A -a LINUX -r 100 -s
Then the rating will always be 100 regardless of how busy the system is.

Reverse LAT

The "normal" use of LAT is to allow a terminal, connected to a terminal server to log into a computer. "Reverse-LAT" goes the other way, the computer makes a connection to a port on the terminal server. This has a number of uses: the most popular are
To do this you first need to create a service on the terminal server. How to do this varies on the model of terminal server you have so consult the documentation for your device. The command for a DECserver 200 is as follows:
DEFINE SERVICE MYVAX PORT 4
This creates a service called MYVAX which is associated with port 4 on the terminal server. Note,you may also have to set the port characteristics to match those of the printer and set the access type to "Remote". Now, assuming you have connected the serial console of your VAX to port 4 of the terminal server and the server is called DS200, you can issue the following command:
latcp -A -p /dev/lat/myvax -Hds200 -Vmyvax
If you now connect a terminal emulator program (say minicom, seyon or microcom) to /dev/lat/myvax you can log in to the console of the VAX and issue commands as if the terminal was local. If it doesn't work then there are a few things to check:

In the case of a printer that is shared by several machines you may want to make it a queued connection. This means that if the printer is busy, any other machine that tries to connect to it will be forced to wait until it is ready. To do this set the port to be queued on the terminal server and specify the reverse-lat port to be queued by adding -Q to the command line as follows:
latcp -A -p /dev/lat/printer -Hds200 -Vprinter -Q

To allow users other than root to connect to reverse-LAT services you must create a group in /etc/groups called "lat" and add reverse-LAT users to that group. See your distribution's documentation for managing groups. Not that this group does not affect normal, "forward" use for LAT for those users.

To send a BREAK character to the remote node press ^@. Normally this is shifted to you actually have to press Ctrl-Shift-' on a British keyboard for example.

To use "printer" ports on a DECserver 90L+ you must make the port queued because that device does not support reverse LAT. You should also use only the node name (no service name) when creating the port. eg:
latcp -A -p /dev/lat/printer -Hds90l1 -Q

Note that queued connections are not really "reverse" LAT in the strict sense that the computer contacts the server, it sends a command to the server requesting it to make a connection back to it. The reason this is useful to know is that actual reverse LAT is not very efficient on the ethernet (tcpdump it!) so if you are bothered by excessive packets then -Q ports are better.
Also note that the -Q flag is the opposite way round from Tru64 Unix(R), sorry about that, but it seems more intuitive to me and also I didn't read the man page carefully enough.

Groups

Groups on LAT are a method of restricting the visible services to a manageable subset. They arenot a security feature, merely a method of making a large number of services more manageable.

When a service is advertised on the LAN it can have any number of groups associated with it. A group is a number from 0 to 255. By default all services are in group 0. On the terminal server you can restrict the group numbers that it will listen for services on. So, for example, a terminal server inthe sales department could have only group 10 enabled, a terminal service in the production department could have only group 20 enabled. The host machines providing these services would advertise sales service in group 10 and production services in group 20. The computer department servers would probably have all the groups enabled so that they could connect to all the services.

Because latd is both a client and a server it has two sets of group codes. One set (that manipulated by the -G and -g switches) determines the group numbers that the advertised services use. So, if we execute the following latcp commands:
latcp -G 10
latcp -A -a LINUX -i "Linux login service"

Then the service LINUX will be advertised in groups 0 and 10 (group 0 is always on by default). You could remove it from group 0 with the following command:
latcp -g 0
Set up like this, only terminal services listening for services in group 10 would see the LINUX service.

The other group set (that manipulated by the -U and -u switches) determines which services can be used by the reverse-LAT ports. So, if you issue the following commands:
latcp -u 0
latcp -U 20

Then you would only be able to connect reverse LAT ports to services that were advertised in group 20 (ie you could not connect to the LINUX service!).

Application services

The default for a service configured with the latcp -A -a command is the login application but you can define almost any sort of application you like. To give an illustration this is how the default login service looks like with defaults spelled out:
latcp -A -a LINUX -C /bin/login -u root
You can specify any command you like for -C and any valid user for -u so forcing users into a specific application straight from the terminal server, of course you may also have to do some authentication too! latd will set the following environment variables which you may find useful:
LAT_LOCAL_SERVICE
LAT_REMOTE_NODE
LAT_REMOTE_PORT

Other things you can fiddle with

Most of the operational parameters of latd can be configured with latcp. I recommend you leave these alone unless you know what you are doing though.

llogin

Starting with lat 1.02 a user program llogin is included. Like latcp this is based on the command of the same name from Tru64 Unix but with a few extras. It's purpose is to allow users to log into remote LAT services. These services must be made available to latd using the groups feature mentioned above. In its most basic form you can connect to an advertised LAT service with the command:
$ llogin trillian
This command will connect you to the/a machine that advertises the service trillian and prompt you to log in. You can also specify a particular node or port number to connect to using command-line switches (see the man page for more details). One useful feature is the ability to connect to queued services by supplying the -Q switch to the command eg:
$ llogin ds200 -Rport_6 -Q
Will connect to a queued port on a DECserver. Note that the service name, port name (and node name if supplied) will be converted to uppercase.

Unlike using reverse-LAT ports you don't need to press enter (or any other key) to activate the connection. If the service is a login service then you will see the login prompt quite soon after entering the command.


What's happening with the server?

You can show the status of the server with the latcp -d command which produces output something like this:

Node Name: TYKE LAT Protocol Version: 5.2
Node State: On LATD Version: 1.01
Node Ident: A Linux box

Service Responder : Disabled
Interfaces : eth1 eth0

Circuit Timer (msec): 80 Keepalive Timer (sec): 20
Retransmit Limit: 20
Multicast Timer (sec): 30

User Groups: 0
Service Groups: 0

Service Name Status Rating Identification
TYKE Enabled 12 D
LINUX Enabled 100 D

Port Node Service Remote Port Queued
/dev/lat/marsinta DS200 PORT_8 Yes
/dev/lat/trillian DS200 PORT_7 Yes
/dev/lat/zaphod DS200 PORT_3 Yes
/dev/lat/roosta DS200 PORT_2 Yes
/dev/lat/loginmarsha MARSHA No
/dev/lat/ddcmp DS200 PORT_6 Yes 8
The services shown are the services advertised by this machine. If you want to see a list of services that are on the network that have been seen by this machine(remember groups!) then use the command latcp -d -l which gives output like this:
BACON             Available     Welcome to VAX/VMS V5.5    
BALTI Available Compaq Tru64 UNIX V5.0A LAT SERVICE
DS200 Available
LAT_VT_GTWY Available LAT/VT Gateway
LINUX Available Linux 2.2.18
MARSHA Available VAX node MARSHA
TRISHA Available
TYKE Available Linux 2.2.18

If you really want the full lowdown on the services that latd has seen then the command latcp -d -l -v will tell you everything you wanted to know!

The startup script

The above commands show you how to configure LAT, these commands will very likely be the same every time you boot the system or restart LAT so it makes sense to have some system of executing a series of commands every time you issue the latcp -s command and so there is.

Put your commands into a file called /etc/latd.conf and it will be run every time you start LAT. The only change you should make is to replace the latcp command with the string $LATCP so that the script can find the latcp program regardless of whether it is on the PATH or not.

The reason you should use /etc/latd.conf rather than writing your own script to start LAT and then set the parameters is that latd does not actually advertise any services or accept any networkconnections until the startup script has completed. This means you can configure all the parameters and make sure that nothing happens with the defaults in place. Here is an example startup script that sets up the services shown in the above example output:

# /etc/latd.conf
# This is a sample configuration file for latd
# it is run as s shell script from latcp -s with a minimal
# environment and PATH (though latcp will be available as $LATCP)
#
# You can fiddle with all the latd parameters you like in here, the first
# service announcement will not be made until this script completes.
#
#

# Set the multicast timeout to 30 seconds
$LATCP -m 30

# Add another login service
$LATCP -A -a LINUX -r 100

# Add a queued reverse LAT service to consoles
$LATCP -A -p /dev/lat/marsinta -Vds200 -RPORT_8 -Q
$LATCP -A -p /dev/lat/trillian -Vds200 -RPORT_7 -Q
$LATCP -A -p /dev/lat/zaphod -Vds200 -RPORT_3 -Q
$LATCP -A -p /dev/lat/roosta -Vds200 -RPORT_2 -Q

# LAT to VAX
$LATCP -A -p /dev/lat/loginmarsha -Vmarsha

# DDCMP on Marsha
$LATCP -A -p /dev/lat/ddcmp -Vds200 -RPORT_6 -Q -8

exit

Managing terminal servers

latd also comes with a utility to help you manage your terminal servers, it is called moprc and it behaves in a similar manner to the "NCP CONNECT NODE" or "SET HOST/MOP" commands on VMS in that it connects you to the management port of a DEC terminal server so you can issue commands for changing ports and assigning services.

Put the names and ethernet addresses of your terminal servers in the file /etc/ethers (see ethers(5) for the format of this file) and you can connect to the servers by name:
# moprc DS200
If your machine has more than one ethernet adaptor you may need to tell moprc which card to use - it defaults to the first adaptor on the system. Note that the BPF interface supports only one interface at a time, Linux supports as many as you like..



HP and Tru64 Unix are trademarks of HP Inc and DECserver probably is too.

Go back to the DECnet for Linux Home Page latd/utils.h0000644000000000000000000000407211054257630010207 0ustar /****************************************************************************** (c) 2002 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ void add_string(unsigned char *packet, int *ptr, const unsigned char *string); void get_string(unsigned char *packet, int *ptr, unsigned char *string); int expand_issue(const char *original, int len, char *newstring, int maxlen, const char *servicename); #ifndef HAVE_OPENPTY #define INTERNAL_OPENPTY #else #ifdef HAVE_PTY_H #include #endif /* HAVE_PTY_H */ #ifdef HAVE_TERMIOS_H #include #endif /* HAVE_TERMIOS_H */ #ifdef HAVE_LIBUTIL_H #include #endif /* HAVE_LIBUTIL_H */ #ifdef HAVE_UTIL_H #include #endif /* HAVE_UTIL_H */ #endif // RedHat 5 has a broken openpty() #ifdef INTERNAL_OPENPTY int chrissie_openpty(int*,int*, char*,char*,char*); #define openpty chrissie_openpty #endif #if defined(VERBOSE_DEBUG) #include extern void chrissie_debuglog(char *,...); #endif #ifdef VERBOSE_DEBUG #define debuglog(x) chrissie_debuglog x //#include //extern void chrissie_debuglog(char *,...); #else #define debuglog(x) #endif #include class sig_blk_t { public: sig_blk_t(int sig_num) { sigset_t new_set; sigemptyset(&new_set); sigaddset(&new_set, sig_num); sigprocmask(SIG_BLOCK, &new_set, &saved_set); } virtual ~sig_blk_t() { sigprocmask(SIG_SETMASK, &saved_set, NULL); } private: sigset_t saved_set; }; latd/latcp.80000644000000000000000000001251010465571217010073 0ustar .TH LATCP 8 "September 10 2002" "LAT Server" .SH NAME latcp \- LAT Control Program .SH SYNOPSIS .B latcp [options] .br .SH DESCRIPTION .PP .B latcp is the control program for .B latd(8). .SS OPTIONS .TP .I \-s Start the LAT daemon. This is the only way to start LAT, you should not attempt to run latd directly or you may get unexpected behviour. .B latcp -s runs the file .B /etc/latd.conf as a shell script (using /bin/sh). Any customisations you need to do to the LAT system should be put in this file as latcp commands. The latcp command should be invoked using the environment variable $LATCP. An example latd.conf file is shipped with the package and shown in the man page .B latd.conf(5). .br .B latcp -s passes any extra switches onto latd itself so you can customise latd this way, however latd.conf is recommended. .TP .I \-h Halts latd. This will kill any active sessions without warning. .TP .I \-A Create a local LAT service or reverse LAT port. .br The syntax for creating a login service is: .br latcp -A -a service [-i description] [-r rating] [-s] [-C command] [-u user] .br The .B -s flag indicates that the service rating is static. Without this the service rating is regarded as a maximum and will be reduced according the the load average of the machine. .br The .B -C flag indicates a command to run when a user connects to the service - by default this is /bin/login. .br The .B -u flag specifies a user to run the above command as. By default this will be root. .br The syntax for creating a reverse LAT port is: .br latcp -A -p tty -V learned_service [-R rem_port] [-H rem_node] [-Q] [-8] .br The tty name should start /dev/lat and must not exist. The .B -Q flag indicates that connections to the service is queued. If you connect to a queued service and it is busy then your connection will be forced to wait until it is available. You must use this flag for printer services on DECserver 90L terminal servers, and in this case the service name must also be empty. NOTE that the .B -Q flag is the opposite way round to that on Tru64 Unix(r). .br The .B -8 flag tells latd not to muck about with the data. Normally latd will transmit a BREAK if a NUL character is typed, .B -8 disables this behaviour for ports with (eg) printers or modems attached. .TP .I \-D Delete a service or port. .br latcp -D -a deletes an advertised service created with latcp -A -a. .br latcp -D -p deletes a reverse LAT port created with latcp -A -p .TP .I \-i Change the description of an advertised service .br latcp -i -a .BR If the description contains spaces or shell metacharacters you should enclose it in quotes. .TP .I \-j Enables the service responder. This feature is needed for small terminal servers that do not collect their own service lists. I currently don't have a list of servers that need this feature. can anyone help?? .TP .I \-J Disables service responder. .TP .I \-Y Purges the list of known services from latd's internal tables. .TP .I \-x Change the rating of an advertised service .br latcp -x [-s] -a .br If the -s flag is present the rating is static, otherwise it is treated as the maximum value and will be decreased according to the system load average. .TP .I \-n Change the system's current node name (Note this affects latd only, not DECnet nor TCP/IP) .br latcp -n .TP .I \-r Change the retransmit limit. This is the maximum number of times latd will transmit a packet without an acknowlegement. If this number is exceeded then the connection is closed as it is assumed that the remote end has gone away. This value must be between 4 and 120 inclusive, the default is 20. .TP .I \-m Sets the multicast timer (in seconds). This timer determines how often services are advertised on the LAN. The default is 60 seconds. This value must be between 10 and 180 inclusive. .TP .I \-k Sets the keepalive timer (in seconds). This is the maximum amount of time that a connection can be inactive. When this timer expires an empty message is sent to the remote end. If it does not respond after then the connection is closed. This timer is reset every time a packet is sent out. This value must be between 10 and 180 inclusive. .TP .I \-d Displays latd configuration or the learned service table. .B -d on it's own will display the latd configuration and the services that are advertised by this node. .B -d -l will display the learned service table. Adding .B -v will show the learned service table in a verbose manner. .B -n will show the nodes (with MAC addresses) that are associated with serviceless ports (eg reverse LAT ports to DS90L+ servers). .TP .I \-? Displays help for using the command. .TP .I \-G Add groups to the services advertised. The groups can be numbers seperated by commas or a range. eg .br latcp -G 1,2,3,10-20 .br Enables groups 1 2 3 and 10 to 20 inclusive. .TP .I \-g Disable groups using syntax as above. .TP .I \-U Add to the list of groups that the server will accept when listening for services. this affects the services that are available using the "reverse LAT" feature. See -G for the syntax. .br If you are using the "responder" feature it's best make sure that this group list contains all the groups that are likely to be used on the LAN. .TP .I \-u Remove groups from the user groups list. .SS SEE ALSO .BR latd "(8), "latd.conf "(5), "moprc "(8), " llogin "(1)" latd/utils.cc0000644000000000000000000001021411054257630010340 0ustar /****************************************************************************** (c) 2000-2003 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include "utils.h" void add_string(unsigned char *packet, int *ptr, const unsigned char *string) { int len = strlen((char *)string); packet[(*ptr)++] = len; strcpy((char *)packet + *ptr, (char *)string); *ptr += len; } void get_string(unsigned char *packet, int *ptr, unsigned char *string) { int len = packet[(*ptr)++]; strncpy((char*)string, (char*)packet + *ptr, len); string[len] = '\0'; *ptr += len; } #ifdef VERBOSE_DEBUG void chrissie_debuglog(char *fmt, ...) { static time_t starttime = time(NULL); va_list ap; fprintf(stderr, "%5ld: ", time(NULL)-starttime); va_start(ap, fmt); vfprintf(stderr, fmt, ap); } #endif #ifndef HAVE_OPENPTY int chrissie_openpty(int *master, int *slave, char *a, char *b, char *d) { char ptyname[] = "/dev/ptyCP"; char c; char *line=NULL; int i; int pty=-1, t; int gotpty=0; struct stat stb; for (c='p'; c <= 'z'; c++) { line = ptyname; line[strlen("/dev/pty")] = c; line[strlen("/dev/ptyC")] = '0'; if (stat(line,&stb) < 0) break; for (i=0; i < 16; i++) { line[strlen("/dev/ptyC")]= "0123456789abcdef"[i]; if ( (pty=open(line,O_RDWR)) > 0) { gotpty = 1; break; } } if (gotpty) break; } if (!gotpty) { debuglog(("No ptys available for connection")); return -1; } line[strlen("/dev/")] = 't'; if ( (t=open(line,O_RDWR)) < 0) { debuglog(("Error connecting to physical terminal: %m")); return -1; } *master = pty; *slave = t; return 0; } #endif /* Expand \ sequences in /etc/issue.net file and add CRs to LFs */ int expand_issue(const char *original, int len, char *newstring, int maxlen, const char *servicename) { int i,j; char scratch[132]; time_t t; struct tm *tm; struct utsname un; uname(&un); j=0; for (i=0; i= maxlen) break; if (original[i] == '\n') newstring[j++] = '\r';; if (original[i] == '\\' || original[i] == '%') { i++; switch (original[i]) { case '\\': case '%': newstring[j++] = original[i]; break; case 'b': strcpy(newstring+j, "9600"); j+=4; break; case 'd': t = time(NULL); tm = localtime(&t); strftime(scratch, sizeof(scratch), "%a %b %d %Y", tm); strcpy(newstring+j, scratch); j+=strlen(scratch); break; case 's': strcpy(newstring+j, un.sysname); j+=strlen(un.sysname); break; case 'l': strcpy(newstring+j, servicename); j+=strlen(servicename); break; case 'm': strcpy(newstring+j, un.machine); j+=strlen(un.machine); break; case 'n': strcpy(newstring+j, un.nodename); j+=strlen(un.nodename); break; #ifdef __GNU_SOURCE case 'o': strcpy(newstring+j, un.domainname); j+=strlen(un.domainname); break; #endif case 'r': strcpy(newstring+j, un.release); j+=strlen(un.release); break; case 't': t = time(NULL); tm = localtime(&t); strftime(scratch, sizeof(scratch), "%H:%M:%S", tm); strcpy(newstring+j, scratch); j+=strlen(scratch); break; /* No, I am not doing number of users logged in... */ case 'v': strcpy(newstring+j, un.version); j+=strlen(un.version); break; } } else { newstring[j++] = original[i]; } } return j; } latd/server.h0000644000000000000000000002406011071437441010353 0ustar /****************************************************************************** (c) 2000-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ // Singleton server object #define MAX_INTERFACES 255 #include "interfaces.h" class LATServer { typedef enum {INACTIVE=0, LAT_SOCKET, LATCP_RENDEZVOUS, LLOGIN_RENDEZVOUS, LATCP_SOCKET, LLOGIN_SOCKET, LOCAL_PTY, DISABLED_PTY} fd_type; public: static LATServer *Instance() { if (!instance) return (instance = new LATServer()); else return instance; } void init(bool _static_rating, int _rating, char *_service, char *_greeting, char **_interfaces, int _verbosity, int _timer); void run(); void shutdown(); void add_fd(int fd, fd_type type); void remove_fd(int fd); void add_pty(LocalPort *port, int fd); void set_fd_state(int fd, bool disabled); int send_message(unsigned char *buf, int len, int interface, unsigned char *macaddr); void delete_session(int, unsigned char, int); void delete_connection(int); unsigned char *get_local_node(); int get_circuit_timer() { return circuit_timer; } int get_retransmit_limit() { return retransmit_limit; } void set_retransmit_limit(int r) { retransmit_limit=r; } int get_keepalive_timer() { return keepalive_timer; } void set_keepalive_timer(int k) { keepalive_timer=k; } void send_connect_error(int reason, LAT_Header *msg, int interface, unsigned char *macaddr); bool is_local_service(char *); int get_service_info(char *name, std::string &cmd, int &maxcon, int &curcon, uid_t &uid, gid_t &gid); gid_t get_lat_group() { return lat_group; } LATConnection **get_connection(int id) { return &connections[id]; } const unsigned char *get_user_groups() { return user_groups; } int find_connection_by_node(const char *node); void send_enq(const char *); void add_slave_node(const char *); static unsigned char greeting[255]; private: LATServer(): circuit_timer(8), multicast_timer(60), retransmit_limit(20), keepalive_timer(20), responder(false), static_rating(false), rating(12), alarm_mode(0), num_interfaces(0), multicast_incarnation(0), verbosity(0), latcp_socket(-1), llogin_socket(-1), do_shutdown(false), locked(true), next_connection(1), lat_group(0), groups_set(false), iface(0) {}; // Private constructor to force singleton static LATServer *instance; // Singleton instance // These two are defaults for new services added bool static_rating; int rating; int alarm_mode; // For slave solicit .. CC investigate unsigned char local_name[256]; // Node name int interface_num[MAX_INTERFACES]; int interface_errs[MAX_INTERFACES]; int num_interfaces; unsigned char multicast_incarnation; int verbosity; int latcp_socket; int llogin_socket; bool do_shutdown; bool locked; int next_connection; gid_t lat_group; void read_lat(int sock); double get_loadavg(); void reply_to_enq(unsigned char *inbuf, int len, int interface, unsigned char *remote_mac); void process_command_msg(unsigned char *inbuf, int len, int interface, unsigned char *remote_mac); void forward_status_messages(unsigned char *inbuf, int len); void send_service_announcement(int sig); void send_solicit_messages(int sig); int make_new_connection(unsigned char *buf, int len, int interface, LAT_Header *header, unsigned char *macaddr); int get_next_connection_number(); void add_services(unsigned char *, int, int, unsigned char *); void got_enqreply(unsigned char *, int, int, unsigned char *); void accept_latcp(int); void accept_llogin(int); void read_latcp(int); void read_llogin(int); void print_bitmap(std::ostringstream &, bool, unsigned char *bitmap); void tidy_dev_directory(); int make_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); static void alarm_signal(int sig); class fdinfo { public: fdinfo(int _fd, LocalPort *_port, fd_type _type): fd(_fd), localport(_port), type(_type) {} int get_fd(){return fd;} LocalPort *get_localport(){return localport;} fd_type get_type(){return type;} void set_disabled(bool d) { if (d) type = DISABLED_PTY; else type = LOCAL_PTY; } bool active() { return (!(type == INACTIVE || type == DISABLED_PTY)); } bool operator==(int _fd) { return (type != INACTIVE && fd == _fd); } bool operator==(const fdinfo &fdi) { return (fd == fdi.fd); } bool operator!=(const fdinfo &fdi) { return (fd != fdi.fd); } bool operator!=(int _fd) { return (type == INACTIVE || fd != _fd); } private: int fd; LocalPort *localport; fd_type type; }; class deleted_session { private: fd_type type; int connection; unsigned char local_id; int fd; public: deleted_session(fd_type t, int c, unsigned char i, int f): type(t), connection(c), local_id(i), fd(f) {} int get_conn(){return connection;} unsigned char get_id() {return local_id;} int get_fd() {return fd;} fd_type get_type(){return type;} }; // Class that defines a local (server) service class serviceinfo { public: serviceinfo(std::string n, int r, bool s, std::string i = std::string((char*)""), int mc=0, char* comm="", uid_t uid=0, gid_t gid=0): name(n), id(i), command(std::string(comm)), rating(r), max_connections(mc), cur_connections(0), static_rating(s), cmd_uid(uid), cmd_gid(gid) { if (command == std::string("")) command = std::string(LOGIN_BIN); } const std::string &get_name() {return name;} const std::string &get_id() {return id;} const std::string &get_command() {return command;} int get_max_connections() {return max_connections;} int get_cur_connections() {return cur_connections;} uid_t get_uid() {return cmd_uid;} gid_t get_gid() {return cmd_gid;} int get_rating() {return rating;} bool get_static() {return static_rating;} void set_rating(int _new_rating, bool _static) { rating = _new_rating; static_rating = _static; } void set_ident(char *_ident) { id = std::string(_ident);} void inc_connections() {cur_connections++;} void dec_connections() {cur_connections--;} bool operator==(serviceinfo &si) { return (si == name);} bool operator==(const std::string &nm) { return (nm == name);} bool operator!=(serviceinfo &si) { return (si != name);} bool operator!=(const std::string &nm) { return (nm != name);} private: std::string name; std::string id; std::string command; int rating; int max_connections; int cur_connections; bool static_rating; uid_t cmd_uid; gid_t cmd_gid; }; void process_data(fdinfo &); void delete_entry(deleted_session &); void interface_error(int, int); // Constants static const int MAX_CONNECTIONS = 255; // Collections std::list fdlist; std::list dead_session_list; std::list dead_connection_list; std::list servicelist; std::list portlist; // Slave Nodes or Dummy Nodes. Well, no-self-advertised nodes std::list slave_nodes; std::list known_slave_nodes; // Connections indexed by ID LATConnection *connections[MAX_CONNECTIONS]; // LATCP connections std::map latcp_circuits; // LATCP configurable parameters int circuit_timer; // Default 8 (=80 ms) unsigned int multicast_timer; // Default 60 (seconds) int retransmit_limit;// Default 20 int keepalive_timer; // Default 20 (seconds) bool responder; // Be a service responder (false); unsigned char groups[32]; // Bitmap of groups bool groups_set; // Have the server groups been set ? unsigned char user_groups[32]; // Bitmap of user groups..always in use LATinterfaces *iface; // LATCP Circuit callins public: void SetResponder(bool onoff) { responder = onoff;} void Shutdown(); bool add_service(char *name, char *ident, char *command, int maxcon, uid_t uid, gid_t gid, int _rating, bool _static_rating); bool set_rating(char *name, int _rating, bool _static_rating); bool set_ident(char *name, char *ident); bool remove_service(char *name); bool remove_port(char *name); void set_multicast(int newtime); void set_nodename(unsigned char *); void unlock(); bool show_characteristics(bool verbose, std::ostringstream &output); bool show_nodes(bool verbose, std::ostringstream &output); int create_local_port(unsigned char *, unsigned char *, unsigned char *, unsigned char *, bool, bool, unsigned char *); int make_llogin_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, const char *, const char *, bool); int set_servergroups(unsigned char *bitmap); int unset_servergroups(unsigned char *bitmap); int set_usergroups(unsigned char *bitmap); int unset_usergroups(unsigned char *bitmap); }; latd/reversesession.h0000644000000000000000000000221211053013677012120 0ustar /****************************************************************************** (c) 2003 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ class ReverseSession: public ServerSession { public: ReverseSession(class LATConnection &p, LAT_SessionStartCmd *cmd, std::string shellcmd, uid_t uid, gid_t gid, unsigned char remid, unsigned char localid, bool clean); virtual int new_session(unsigned char *remote_node, char *service, char *port, unsigned char c); void set_request_id(unsigned short id) {request_id = id;} protected: private: }; latd/lat_messages.h0000644000000000000000000000163311071437441011515 0ustar /****************************************************************************** (c) 2000-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ // A class to keep all the messages in. class lat_messages { public: static const char *session_disconnect_msg(int); static const char *connection_disconnect_msg(int); }; latd/reversesession.cc0000644000000000000000000000357411053013677012272 0ustar /****************************************************************************** (c) 2000-2003 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "server.h" #include "serversession.h" #include "reversesession.h" ReverseSession::ReverseSession(class LATConnection &p, LAT_SessionStartCmd *cmd, std::string shellcmd, uid_t uid, gid_t gid, unsigned char remid, unsigned char localid, bool clean): ServerSession(p, cmd, shellcmd, uid, gid, remid, localid, clean) { } int ReverseSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) { credit = c; strcpy(remote_service, service); strcpy(remote_port, port); strcpy(remote_node, (char *)_remote_node); // Start local command return create_session(_remote_node); } latd/latcp.h0000644000000000000000000000351611053013677010154 0ustar /****************************************************************************** (c) 2000-2004 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ /* Definitions of LATCP commands */ const int LATCP_STARTLAT = 1; const int LATCP_SHUTDOWN = 2; const int LATCP_SETRESPONDER = 3; const int LATCP_SETRATING = 4; const int LATCP_SETNODENAME = 5; const int LATCP_SETMULTICAST = 6; const int LATCP_ZEROCOUNTS = 7; const int LATCP_VERSION = 8; const int LATCP_ADDSERVICE = 9; const int LATCP_REMSERVICE = 10; const int LATCP_SHOWCHAR = 11; const int LATCP_SHOWSERVICE = 12; const int LATCP_ADDPORT = 14; const int LATCP_REMPORT = 15; const int LATCP_ACK = 16; const int LATCP_SETRETRANS = 17; const int LATCP_SETKEEPALIVE = 18; const int LATCP_UNLOCK = 19; const int LATCP_SETIDENT = 20; const int LATCP_PURGE = 21; const int LATCP_SETSERVERGROUPS = 22; const int LATCP_UNSETSERVERGROUPS = 23; const int LATCP_SETUSERGROUPS = 24; const int LATCP_UNSETUSERGROUPS = 25; const int LATCP_TERMINALSESSION = 26; const int LATCP_SHOWNODES = 27; const int LATCP_ERRORMSG = 99; // Fatal latd/services.h0000644000000000000000000001113211053013677010665 0ustar /****************************************************************************** (c) 2000-2004 Christine Caulfield christine.caulfield@googlemail.com (c) 2003 Dmitri Popov 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 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. ******************************************************************************/ class LATServices { public: static LATServices *Instance() { if (!instance) return (instance = new LATServices()); else return instance; } // Get the highest rated node for this service name. bool get_highest(const std::string &service, std::string &node, unsigned char *macaddr, int *interface); bool get_node(const std::string &service, const std::string &node, unsigned char *macaddr, int *interface); // Add/update a service. bool add_service(const std::string &node, const std::string &service, const std::string &ident, int rating, int interface, unsigned char *macaddr); bool remove_node(const std::string &node); bool list_services(bool verbose, std::ostringstream &output); void purge() {servicelist.clear(); } void expire_nodes(); bool list_dummy_nodes(bool verbose, std::ostringstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); private: LATServices() {}; // Private constructor to force singleton static LATServices *instance; // Singleton instance class serviceinfo { public: serviceinfo() {} serviceinfo(const std::string &node, const std::string &_ident, const unsigned char *macaddr, int rating, int interface) { ident = _ident; nodes[node] = nodeinfo(macaddr, rating, ident, interface); } void add_or_replace_node(const std::string &node, const std::string &_ident, const unsigned char *macaddr, int rating, int interface) { ident = _ident; nodes.erase(node); // Don't care if this fails nodes[node] = nodeinfo(macaddr, rating, ident, interface); } bool get_highest(std::string &node, unsigned char *macaddr, int *interface); bool get_node(const std::string &node, unsigned char *macaddr, int *interface); const std::string get_ident() { return ident; } bool is_available(); bool remove_node(const std::string &node); void list_service(std::ostringstream &output); void expire_nodes(time_t); void list_nodes(std::ostringstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); private: class nodeinfo { public: nodeinfo() {} nodeinfo(const unsigned char *_macaddr, int _rating, std::string _ident, int _interface): rating(_rating), interface(_interface), available(true), slave_reachable(5) // if it doesn't respond five times... { memcpy(macaddr, _macaddr, 6); ident = _ident; updated = time(NULL); } bool has_expired(time_t current_time) { return ( (current_time - updated) > 60); } int get_rating() { return rating; } int get_interface() { return interface; } const unsigned char *get_macaddr() { return macaddr; } bool is_available() { return available; } void set_available(bool a) { available = a; } std::string get_ident() { return ident; } int touch_respond_counter() { if (slave_reachable > 0) { slave_reachable--; } debuglog(("touch_respond_counter() %d\n", slave_reachable)); return slave_reachable; } bool check_respond_counter() { return slave_reachable > 0; } private: unsigned char macaddr[6]; int rating; int interface; bool available; std::string ident; time_t updated; // for slave nodes int slave_reachable; };// class LATServices::service::nodeinfo std::map > nodes; std::string ident; };// class LATServices::serviceinfo std::map > servicelist; }; latd/latd.80000644000000000000000000000371707635313114007720 0ustar .TH LATD 8 "MARCH 17 2003" "LAT Server" .SH NAME latd \- LAT daemon .SH SYNOPSIS .B latd [options] .br Options: .br [\-dvVht] [\-i interface] [\-g greeting] [\-s service] [\-c circuit-timer] [\-r rating] .SH DESCRIPTION .PP .B latd is a daemon that serves incoming and outgoing LAT (Local Area Transport) requests. .br The parameters for LATD are just defaults, they can all be changed using .B latcp(8). .br latd should not be started directly but should be invoked using the command .B latcp -s. Any arguments for latd can be added to the latcp -s command line and many can be set in .B /etc/latd.conf(5). .SS OPTIONS .TP .I "\-i" Set the interface to be used for LAT communication. If this is not specified then all ethernet interfaces will be used. This option can be specified multiple times to enable several interfaces. eg: .br -i eth0 -i eth2 Note, only Linux can use more than one ethernet interface at a time. *BSD versions will use the first available ethernet adaptor unless it is overridden by -i. .TP .I "\-g" Sets the greeting for this node. .TP .I "\-s" Set the default service name for this node. The default is the node name. .TP .I "\-c" Sets the circuit timer. The default is 80 (ms); .TP .I "\-r" Sets the rating for the default service. If the .B -t switch is not present this rating will be the maximum rating for the service. The load average of the machine will be used to recalculate the rating each time the servuce is announced. This allows terminal servers to do load balancing. .TP .I "\-t" Makes the rating static. It will not change as the system load changes. .TP .I "\-d" Don't fork and run the background. Use this for debugging. .TP .I "\-v" Verbose. The more of these there are the more verbose latd will be. Don't use more than one for normal operation because it will seriously impair performance. .TP .I \-h \-? Displays help for using the command. .TP .I \-V Show the version of latd. .SS SEE ALSO .BR latcp "(8), " latd.conf "(5), " llogin "(1)" latd/configure.in0000644000000000000000000001104112254065406011202 0ustar dnl Process this file with autoconf to produce a configure script. dnl Checks that we are given a good source directory. AC_INIT(latcp.cc) AM_INIT_AUTOMAKE(latd, 1.34) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET AC_SUBST(INTERFACE) AC_SUBST(LIBUTIL) dnl Checks for headers. AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h sys/socketio.h sys/filio.h \ pty.h termios.h libutil.h util.h mcheck.h netinet/ether.h net/if_ether.h) dnl Checks for struct ether_header. AC_CHECK_HEADERS(net/if_ether.h net/ethernet.h) AC_MSG_CHECKING([for struct ether_header]) AC_TRY_COMPILE([ #include #include #include #ifdef HAVE_NET_IF_ETHER_H #include #endif /* HAVE_NET_IF_ETHER_H */ #ifdef HAVE_NET_ETHERNET_H #include #endif /* HAVE_NET_ETHERNET_H */ ], [ struct ether_header the_ether_header; unsigned int ethertype; ethertype = the_ether_header.ether_type; ], , AC_MSG_ERROR([cannot find struct ether_header])) AC_MSG_RESULT(yes) dnl Checks for our network access type. latd_raw_type= AC_CHECK_HEADER(netpacket/packet.h, [latd_raw_type=linux]) if test x$latd_raw_type = x; then AC_CHECK_HEADER(net/bpf.h, [latd_raw_type=bpf]) fi case x$latd_raw_type in xbpf) AC_CHECK_HEADERS(net/if_dl.h) AC_MSG_CHECKING([for AF_LINK support]) AC_EGREP_CPP(_latd_has_af_link, [ #include #ifdef AF_LINK _latd_has_af_link #endif ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_AF_LINK) ], [ AC_MSG_RESULT(no) ]) ;; xlinux) AC_CHECK_HEADERS(features.h) ;; *) ;; esac AC_MSG_CHECKING([for raw Ethernet access method]) if test x$latd_raw_type = x; then AC_MSG_ERROR([can't find any raw Ethernet access method]) fi AC_MSG_RESULT($latd_raw_type) INTERFACE=interfaces-$latd_raw_type.o dnl Checks for sockaddr.sa_len - only needed for BPF access if test "x$latd_raw_type" = "xbpf"; then AC_MSG_CHECKING([for sockaddr.sa_len]) AC_TRY_COMPILE([ #include #include ],[ struct sockaddr sa; sa.sa_len = 5; ], AC_DEFINE(HAVE_SOCKADDR_SA_LEN)) AC_MSG_RESULT(yes) fi dnl Configure the use of openpty. AC_ARG_ENABLE(openpty, [ --disable-openpty don't use the system's openpty function [do]], , [enable_openpty=yes]) if test "x$enable_openpty" = "xyes"; then openpty_found= AC_CHECK_FUNCS(openpty, openpty_found=yes) if test "x$openpty_found" = "x"; then AC_CHECK_LIB(util, openpty, openpty_found=yes) if test "x$openpty_found" = "xyes"; then AC_DEFINE(HAVE_OPENPTY) LIBUTIL=-lutil fi fi fi dnl Configuring the login program withval= AC_ARG_WITH(login, [ --with-login program to use for logins (defaults to local "login") ]) if test "x$withval" = "x"; then if test -f /bin/login; then withval="/bin/login" elif test -f /usr/bin/login; then withval="/usr/bin/login" fi fi AC_DEFINE_UNQUOTED(LOGIN_BIN, "$withval") dnl Configure "llogin -p" locking AC_ARG_ENABLE(devlocking, [ --disable-devlocking disable llogin device locking using flock], [ ], [enable_devlocking=yes]) if test "x$enable_devlocking" = "xno"; then CXXFLAGS="${CXXFLAGS-} -DDISABLE_DEVICE_LOCKING" fi dnl Configure the latcp socket. LATCPSOCK=/var/run/latcp AC_ARG_WITH(latcp_socket, [ --with-latcp-socket=SOCK set the socket for latcp to SOCK [/var/run/latcp]], [ ], [with_latcp_socket=yes]) case x$with_latcp_socket in xyes | xno | x) ;; *) LATCPSOCK=$with_latcp_socket ;; esac AC_DEFINE_UNQUOTED(LATCP_SOCKNAME, "$LATCPSOCK") dnl Configure the llogin socket. LLOGINSOCK=/var/run/latlogin AC_ARG_WITH(llogin_socket, [ --with-llogin-socket=SOCK set the socket for llogin to SOCK [/var/run/latlogin]], [ ], [with_llogin_socket=yes]) case x$with_llogin_socket in xyes | xno | x) ;; *) LLOGINSOCK=$with_llogin_socket ;; esac AC_DEFINE_UNQUOTED(LLOGIN_SOCKNAME, "$LLOGINSOCK") dnl Disable default login service AC_ARG_ENABLE(defservice, [ --disable-defservice disable default login service], [ ], [enable_defservice=yes]) if test "x$enable_defservice" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -DENABLE_DEFAULT_SERVICE" fi dnl Configure debugging and/or warnings. AC_ARG_ENABLE(debug, [ --enable-debug compile debuggable programs], [enable_debug=yes]) if test "x$enable_debug" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -g3 -O0 -DVERBOSE_DEBUG -DNO_FORK" fi AC_ARG_ENABLE(warnings, [ --disable-warnings don't compile with warnings turned on], [ ], [enable_warnings=yes]) if test "x$enable_warnings" = "xyes" -a "x$GCC" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -W" fi dnl Writes files. AC_OUTPUT(Makefile) latd/moprc.80000644000000000000000000000341310030600707010073 0ustar .TH MOPRC 8 "November 21 2001" "MOP Remote Console" .SH NAME moprc \- MOP Remote console requestor .SH SYNOPSIS .B moprc [options] | .br .SH DESCRIPTION .PP .B moprc allows a system administrator to connect to MOP console devices (usually terminal servers) and log into them to issue commands remotely. It is the equivalent of "NCP CONNECT NODE" or "SET HOST/MOP" on VMS. .br The node maybe specified as a MAC address in Unix format (ie as 6 pairs of hex digits seperated by colons) or as a name that appears in /etc/ethers. .br You will need to be root or have privileges to use moprc. .SS OPTIONS .TP .I \-i Selects the ethernet interface to use to connect to the device. By default the value of environment variable MOPRC_INTERFACE or "eth0" is used. .TP .I \-v Shows some information about the node that is connected to .TP .I \-t Trigger the node. This normally reboots the server so use this with care! .TP .I \-p Changes the poll interval of moprc from 200 ms to ms. Changing this down will increase the risk of timeouts, increasing it will decrease the speed of the link. .TP .I \-h \-? Shows the usage message. .TP .I \-V Shows the version of moprc. .SH EXAMPLES moprc ds200 .br .br moprc -i eth1 08:00:2B:2B:AD:99 .SH ENVIRONMENT VARIABLES MOPRC_INTERFACE defines the default interface to use if not specified on the command line. If not present the interface "eth0" will be used. .SH BUGS On Darwin you cannot specify an ethernet address on the command-line, the name MUST be in /etc/ethers. .br You can script moprc but it sends one character per ethernet packet so is very slow. .br There is no locking in moprc so be careful to only run once instance at a time. .SS SEE ALSO .BR latd "(8), " latd.conf "(5), " ethers "(5), " llogin "(1)"latd/latprint.sh0000644000000000000000000000076010212603705011060 0ustar #!/bin/sh # # latprint.sh # # This is an example script for using latd as a LAT printer server. # Use the commands below substituting the bits in CAPS for your own. # # on Linux: # latcp -A -a PRINTER -C '/bin/sh /usr/local/sbin/latprint.sh' -u root # # on VMS: # mcr latcp create port lta999 # mcr latcp set port lta999/noqueue/service=PRINTER/node=LINUX # init/queue/process=latsym/on=lta999:/start LINUXLAT # trap "" 1 stty -echo cat > /tmp/latprint$$ lpr -r -oraw /tmp/latprint$$ latd/localportsession.h0000644000000000000000000000220611053013677012447 0ustar /****************************************************************************** (c) 2001-2003 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ class localportSession: public lloginSession { public: localportSession(class LATConnection &p, class LocalPort *port, unsigned char remid, unsigned char localid, char *lta, int); virtual ~localportSession(); virtual void do_read(); virtual void show_status(unsigned char *node, LAT_StatusEntry *entry); private: LocalPort *localport; int minimum_read; bool ignored_read; }; latd/INSTALL0000644000000000000000000001732607634647326007753 0ustar This file describes how to build and install less using the "configure" script. This only works on Unix systems. To install on other systems, read the README file. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. latd/server.cc0000644000000000000000000014514711053013677010524 0ustar /****************************************************************************** (c) 2001-2005 Christine Caulfield christine.caulfield@googlemail.com (c) 2003 Dmitri Popov 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #ifdef HAVE_NET_ETHERNET_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "llogincircuit.h" #include "server.h" #include "services.h" #include "lat_messages.h" #include "dn_endian.h" #if defined (__APPLE__) && !defined(_SOCKLEN_T) typedef int socklen_t; #endif // Remove any dangling symlinks in the /dev/lat directory void LATServer::tidy_dev_directory() { DIR *dir; struct dirent *de; char current_dir[PATH_MAX]; getcwd(current_dir, sizeof(current_dir)); chdir(LAT_DIRECTORY); dir = opendir(LAT_DIRECTORY); if (!dir) return; // Doesn't exist - this is OK while ( (de = readdir(dir)) ) { if (de->d_name[0] != '.') unlink(de->d_name); } closedir(dir); chdir(current_dir); } unsigned char *LATServer::get_local_node(void) { unsigned int i; if (local_name[0] == '\0') { struct utsname uts; char *trailer; uname(&uts); if (strchr(uts.nodename, '.')) *strchr(uts.nodename, '.') = '\0'; // This gets rid of the name-Computer bit on Darwin trailer = strstr(uts.nodename, "-Computer"); if (trailer) *trailer = '\0'; // LAT node names must be <= 16 characters long if (strlen(uts.nodename) > 16) uts.nodename[16] = '\0'; strcpy((char *)local_name, uts.nodename); // Make it all upper case for (i=0; ialarm_mode == 0) { Instance()->send_service_announcement(sig); } Instance()->send_solicit_messages(sig); } // Send ENQUIRY for a node - mainly needed for DS90L servers that // don't advertise. void LATServer::send_enq(const char *node) { unsigned char packet[1600]; static unsigned char id = 1; LAT_Enquiry *enqmsg = (LAT_Enquiry *)packet; int ptr = sizeof(LAT_Enquiry); enqmsg->cmd = LAT_CCMD_ENQUIRE; enqmsg->dummy = 0; enqmsg->hiver = LAT_VERSION; enqmsg->lover = LAT_VERSION; enqmsg->latver = LAT_VERSION; enqmsg->latver_eco = LAT_VERSION_ECO; enqmsg->mtu = dn_htons(1500); enqmsg->id = id++; enqmsg->retrans_timer = 75; // * 10ms - give it more time to respond add_string(packet, &ptr, (const unsigned char *)node); packet[ptr++] = 1; /* Length of group data */ packet[ptr++] = 1; /* Group mask */ add_string(packet, &ptr, local_name); packet[ptr++] = 0x00; packet[ptr++] = 0x00; packet[ptr++] = 0x00; packet[ptr++] = 0x00; /* This is the LAT multicast address */ static unsigned char addr[6] = { 0x09, 0x00, 0x2b, 0x00, 0x00, 0x0f }; debuglog(("send_enq : node: %s, local_name: %s\n", node, local_name)); for (int i=0; isend_packet(interface_num[i], addr, packet, ptr) < 0) { debuglog(("Error send packet\n")); interface_error(interface_num[i], errno); } else { interface_errs[interface_num[i]] = 0; // Clear errors } } LATServices::Instance()->touch_dummy_node_respond_counter(node); } void LATServer::add_slave_node(const char *node_name) { sig_blk_t _block(SIGALRM); for (std::list::iterator iter = slave_nodes.begin(); iter != slave_nodes.end(); iter++) { if (*iter == node_name) { // do not duplicate nodes return; } } slave_nodes.push_front(node_name); } /* Called on the multicast timer - advertise our service on the LAN */ void LATServer::send_service_announcement(int sig) { unsigned char packet[1600]; int ptr; struct utsname uinfo; char *myname; // Only send it if we have some services if (servicelist.size()) { LAT_ServiceAnnounce *announce = (LAT_ServiceAnnounce *)packet; ptr = sizeof(LAT_ServiceAnnounce); announce->cmd = LAT_CCMD_SERVICE; announce->circuit_timer = circuit_timer; announce->hiver = LAT_VERSION; announce->lover = LAT_VERSION; announce->latver = LAT_VERSION; announce->latver_eco = LAT_VERSION_ECO; announce->incarnation = --multicast_incarnation; announce->flags = 0x1f; announce->mtu = dn_htons(1500); announce->multicast_timer = multicast_timer; if (do_shutdown) { announce->node_status = 3; // Not accepting connections } else { announce->node_status = 2; // Accepting connections } // Send group codes if (groups_set) { announce->group_length = 32; memcpy(&packet[ptr], groups, 32); ptr += 32; announce->flags |= 1; } else { announce->group_length = 1; packet[ptr++] = 01; } /* Get host info */ uname(&uinfo); // Node name myname = (char*)get_local_node(); packet[ptr++] = strlen(myname); strcpy((char*)packet+ptr, myname); ptr += strlen(myname); // Greeting packet[ptr++] = strlen((char*)greeting); strcpy((char*)packet+ptr, (char*)greeting); ptr += strlen((char*)greeting); // Number of services packet[ptr++] = servicelist.size(); std::list::iterator i(servicelist.begin()); for (; i != servicelist.end(); i++) { // Service rating unsigned char real_rating; if (i->get_static()) { real_rating = i->get_rating(); } else { /* Calculate dynamic rating */ real_rating = (unsigned char)(i->get_rating() / (get_loadavg()+1.0)); debuglog(("Dynamic service rating is %d\n", real_rating)); } packet[ptr++] = real_rating; // Service name const std::string name = i->get_name(); packet[ptr++] = name.length(); strcpy((char *)packet+ptr, i->get_name().c_str()); ptr += name.length(); // Service Identification std::string id = i->get_id(); if (id.length() == 0) { // Default service identification string char stringbuf[1024]; sprintf(stringbuf, "%s %s", uinfo.sysname, uinfo.release); id = std::string(stringbuf); } packet[ptr++] = id.length(); strcpy((char *)packet+ptr, id.c_str()); ptr += id.length(); // Make sure the service table knows about all our services unsigned char dummy_macaddr[6]; memset(dummy_macaddr, 0, sizeof(dummy_macaddr)); if (!do_shutdown) LATServices::Instance()->add_service(std::string((char*)get_local_node()), name, id, real_rating, 0, dummy_macaddr); } // Not sure what node service classes are // probably somthing to do with port services and stuff. packet[ptr++] = 0x01; // Node service classes length packet[ptr++] = 0x01; // Node service classes packet[ptr++] = 0x00; packet[ptr++] = 0x00; unsigned char addr[6]; /* This is the LAT multicast address */ addr[0] = 0x09; addr[1] = 0x00; addr[2] = 0x2b; addr[3] = 0x00; addr[4] = 0x00; addr[5] = 0x0f; for (int i=0; isend_packet(interface_num[i], addr, packet, ptr) < 0) { debuglog(("sending service announcement, send error: %d\n", errno)); interface_error(interface_num[i], errno); } else interface_errs[interface_num[i]] = 0; // Clear errors } } /* Send it every minute */ signal(SIGALRM, &alarm_signal); alarm(multicast_timer); } // Send solicit messages to slave nodes void LATServer::send_solicit_messages(int sig) { static unsigned int counter = 0; static unsigned int last_list_size = 0; if (alarm_mode == 0) { counter = 0; alarm_mode = 1; debuglog(("set alarm_mode to 1\n")); if (!known_slave_nodes.empty()) { std::string known_node = known_slave_nodes.front(); known_slave_nodes.pop_front(); slave_nodes.push_back(known_node); debuglog(("known(%d) => slave(%d) : %s\n", known_slave_nodes.size(), slave_nodes.size(), known_node.c_str())); if (slave_nodes.size() == 1) { alarm_mode = 0; debuglog(("set alarm_mode to 0 - one slave\n")); send_enq(slave_nodes.front().c_str()); // alarm() is already charged by send_service_announcement() return; } } } else { if (slave_nodes.size() < last_list_size) { counter -= last_list_size - slave_nodes.size(); } } if (slave_nodes.size() > counter && !slave_nodes.empty()) { std::string node_name = slave_nodes.front(); slave_nodes.pop_front(); slave_nodes.push_back(node_name); send_enq(node_name.c_str()); alarm(1); counter++; last_list_size = slave_nodes.size(); } else { alarm_mode = 0; //well, it's not quite correct, I know... alarm(counter >= multicast_timer ? 1 : multicast_timer - counter); debuglog(("set alarm_mode to 0, timer %d\n", counter >= multicast_timer ? 1 : multicast_timer - counter)); } } // Log an error against an interface. If we get three of these // then we remove it. // If that means we have no interfaces, then closedown. void LATServer::interface_error(int ifnum, int err) { syslog(LOG_ERR, "Error on interface %s: %s\n", iface->ifname(ifnum).c_str(), strerror(err)); // Too many errors, remove it if (++interface_errs[ifnum] > 3) { int i,j; syslog(LOG_ERR, "Interface will be removed from LATD\n"); // Look for it for (i=0; i=num_interfaces) { syslog(LOG_ERR, "Don't seem to have a reference to this interface....\n"); return; } remove_if: // Shuffle the list down for (j=i; jset_lat_multicast(interface_num[i]); } // Add it/them to the sockets list if (iface->one_fd_per_interface()) { for (int i=0; iget_fd(interface_num[i]), 0, LAT_SOCKET)); } } else { fdlist.push_back(fdinfo(iface->get_fd(0), 0, LAT_SOCKET)); } // Open LATCP socket unlink(LATCP_SOCKNAME); latcp_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (latcp_socket < 0) { syslog(LOG_ERR, "Can't create latcp socket: %m"); exit(1); } struct sockaddr_un sockaddr; strcpy(sockaddr.sun_path, LATCP_SOCKNAME); sockaddr.sun_family = AF_UNIX; if (bind(latcp_socket, (struct sockaddr *)&sockaddr, sizeof(sockaddr))) { syslog(LOG_ERR, "can't bind latcp socket: %m"); exit(1); } if (listen(latcp_socket, 1) != 0) { syslog(LOG_ERR, "listen latcp: %m"); } // Make sure only root can talk to us via the latcp socket chmod(LATCP_SOCKNAME, 0600); fdlist.push_back(fdinfo(latcp_socket, 0, LATCP_RENDEZVOUS)); // Open llogin socket unlink(LLOGIN_SOCKNAME); llogin_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (llogin_socket < 0) { syslog(LOG_ERR, "Can't create llogin socket: %m"); exit(1); } strcpy(sockaddr.sun_path, LLOGIN_SOCKNAME); sockaddr.sun_family = AF_UNIX; if (bind(llogin_socket, (struct sockaddr *)&sockaddr, sizeof(sockaddr))) { syslog(LOG_ERR, "can't bind llogin socket: %m"); exit(1); } if (listen(llogin_socket, 1) != 0) { syslog(LOG_ERR, "listen llogin: %m"); } // Make sure everyone can use it chmod(LLOGIN_SOCKNAME, 0666); fdlist.push_back(fdinfo(llogin_socket, 0, LLOGIN_RENDEZVOUS)); // Don't start sending service announcements // until we get an UNLOCK message from latcp. // We rely on POSIX's select() behaviour in that we use the // time left in the timeval parameter to make sure the circuit timer // goes off at a reasonably predictable interval. #ifndef __linux__ struct timeval next_circuit_time; next_circuit_time.tv_sec = 0; next_circuit_time.tv_usec = 0; #endif struct timeval tv = {0, circuit_timer*10000}; time_t last_node_expiry = time(NULL); do_shutdown = false; do { fd_set fds; FD_ZERO(&fds); std::list::iterator i(fdlist.begin()); for (; i != fdlist.end(); i++) { if (i->active()) FD_SET(i->get_fd(), &fds); } // Only Linux seems to have this select behaviour... // for BSDs we need to work our for ourselves the delay // until the next circuit timer tick. #ifndef __linux__ struct timeval now; gettimeofday(&now, NULL); if (next_circuit_time.tv_sec == 0) { next_circuit_time = now; next_circuit_time.tv_usec += circuit_timer*10000; next_circuit_time.tv_sec += (next_circuit_time.tv_usec / 1000000); next_circuit_time.tv_usec = (next_circuit_time.tv_usec % 1000000); } tv = next_circuit_time; if (tv.tv_sec < now.tv_sec || (tv.tv_sec == now.tv_sec && tv.tv_usec <= now.tv_usec)) { tv.tv_sec = tv.tv_usec = 0; } else { tv.tv_sec -= now.tv_sec; if ((tv.tv_usec -= now.tv_usec) < 0) { tv.tv_sec--; tv.tv_usec += 1000000; } } #endif status = select(FD_SETSIZE, &fds, NULL, NULL, &tv); if (status < 0) { if (errno != EINTR) { syslog(LOG_WARNING, "Error in select: %m"); debuglog(("Error in select: %s\n", strerror(errno))); do_shutdown = true; } } else { if (status == 0) // Circuit timer { for (int i=1; icircuit_timer(); tv.tv_usec = circuit_timer*10000; // Is it time we expired some more nodes ? if (time(NULL) - last_node_expiry > 15) LATServices::Instance()->expire_nodes(); #ifndef __linux__ next_circuit_time.tv_sec = 0; #endif } else { // Unix will never scale while this is necessary std::list::iterator fdl(fdlist.begin()); for (; fdl != fdlist.end(); fdl++) { if (fdl->active() && FD_ISSET(fdl->get_fd(), &fds)) { process_data(*fdl); } } } } // Tidy deleted sessions if (!dead_session_list.empty()) { std::list::iterator dsl(dead_session_list.begin()); for (; dsl != dead_session_list.end(); dsl++) { delete_entry(*dsl); } dead_session_list.clear(); } // Tidy deleted connections if (!dead_connection_list.empty()) { std::list::iterator dcl(dead_connection_list.begin()); for (; dcl != dead_connection_list.end(); dcl++) { if (connections[*dcl]) { delete connections[*dcl]; connections[*dcl] = NULL; } } dead_connection_list.clear(); } } while (!do_shutdown); send_service_announcement(-1); // Say we are unavailable close(latcp_socket); unlink(LATCP_SOCKNAME); unlink(LLOGIN_SOCKNAME); tidy_dev_directory(); } /* LAT socket has something for us */ void LATServer::read_lat(int sock) { unsigned char buf[1600]; unsigned char macaddr[6]; int len; int i; int ifn; bool more = true; LAT_Header *header = (LAT_Header *)buf; while (more) { len = iface->recv_packet(sock, ifn, macaddr, buf, sizeof(buf), more); if (len == 0) continue; // Probably a rogue packet if (len < 0) { if (errno != EINTR && errno != EAGAIN) { syslog(LOG_ERR, "recvmsg: %m"); return; } } // Not listening yet, but we must read the message otherwise we // we will spin until latcp unlocks us. if (locked) continue; // Parse & dispatch it. switch(header->cmd) { case LAT_CCMD_SREPLY: case LAT_CCMD_SDATA: case LAT_CCMD_SESSION: { debuglog(("session cmd for connid %d\n", header->remote_connid)); LATConnection *conn = NULL; if(header->remote_connid < MAX_CONNECTIONS) { conn = connections[header->remote_connid]; } if (conn) { conn->process_session_cmd(buf, len, macaddr); } else { // Message format error send_connect_error(2, header, ifn, macaddr); } } break; case LAT_CCMD_CONNECT: { // Make a new connection // Check that the connection is really for one of our services unsigned char name[256]; int ptr = sizeof(LAT_Start); get_string(buf, &ptr, name); debuglog(("got connect for node %s\n", name)); if (strcmp((char *)name, (char *)get_local_node())) { // How the &?* did that happen? send_connect_error(2, header, ifn, macaddr); continue; } // Make a new connection. if ( ((i=make_new_connection(buf, len, ifn, header, macaddr) )) > 0) { debuglog(("Made new connection: %d\n", i)); connections[i]->send_connect_ack(); } } break; case LAT_CCMD_CONACK: { LATConnection *conn = NULL; debuglog(("Got connect ACK for %d\n", header->remote_connid)); if (header->remote_connid < MAX_CONNECTIONS) { conn = connections[header->remote_connid]; } if (conn) { conn->got_connect_ack(buf); } else { // Insufficient resources send_connect_error(7, header, ifn, macaddr); } } break; case LAT_CCMD_CONREF: case LAT_CCMD_DISCON: { debuglog(("Disconnecting connection %d: status %x(%s)\n", header->remote_connid, buf[sizeof(LAT_Header)], lat_messages::connection_disconnect_msg(buf[sizeof(LAT_Header)]) )); if (header->remote_connid < MAX_CONNECTIONS) { LATConnection *conn = connections[header->remote_connid]; if (conn) { // We don't delete clients, we just quiesce them. if (conn->isClient()) { conn->disconnect_client(); if (conn->num_clients() == 0) { delete conn; connections[header->remote_connid] = NULL; } } else { delete conn; connections[header->remote_connid] = NULL; } } } else { // Message format error send_connect_error(2, header, ifn, macaddr); } } break; case LAT_CCMD_SERVICE: // Keep a list of known services add_services(buf, len, ifn, macaddr); break; case LAT_CCMD_ENQUIRE: reply_to_enq(buf, len, ifn, macaddr); break; case LAT_CCMD_ENQREPLY: got_enqreply(buf, len, ifn, macaddr); break; case LAT_CCMD_STATUS: forward_status_messages(buf, len); break; // Request for a reverse-LAT connection. case LAT_CCMD_COMMAND: process_command_msg(buf, len, ifn, macaddr); break; } } } // Add an FD to the list of FDs to listen to void LATServer::add_fd(int fd, fd_type type) { std::list::iterator fdi; debuglog(("Add_fd: %d\n", fd)); fdi = find(fdlist.begin(), fdlist.end(), fd); if (fdi != fdlist.end()) return; // Already exists fdlist.push_back(fdinfo(fdinfo(fd, NULL, type))); } // Remove FD from the FD list void LATServer::remove_fd(int fd) { std::list::iterator fdi; debuglog(("remove_fd: %d\n", fd)); fdi = find(fdlist.begin(), fdlist.end(), fd); if (fdi == fdlist.end()) return; // Does not exist fdlist.remove(*fdi); } // Change the DISABLED state of a PTY fd void LATServer::set_fd_state(int fd, bool disabled) { std::list::iterator fdi; debuglog(("set_fd_state: %d, %d\n", fd, disabled)); fdi = find(fdlist.begin(), fdlist.end(), fd); if (fdi == fdlist.end()) return; // Does not exist fdi->set_disabled(disabled); } /* Send a LAT message to a specified MAC address */ int LATServer::send_message(unsigned char *buf, int len, int interface, unsigned char *macaddr) { if (len < 46) len = 46; // Minimum packet length if (len%2) len++; // Must be an even number #ifdef PACKET_LOSS static int c=0; if ((++c % PACKET_LOSS) == 0) { debuglog(("NOT SENDING THIS MESSAGE!\n")); return 0; } #endif if (interface == 0) // Send to all { for (int i=0; isend_packet(interface_num[i], macaddr, buf, len) < 0) { interface_error(interface_num[i], errno); } else interface_errs[interface_num[i]] = 0; // Clear errors } } else { if (iface->send_packet(interface, macaddr, buf, len) < 0) { interface_error(interface, errno); return -1; } interface_errs[interface] = 0; // Clear errors } return 0; } /* Get the system load average */ double LATServer::get_loadavg(void) { double avg[3]; if (getloadavg(avg, 3) > 0) { return avg[0]; } else { return 0; } } // Forward status messages to their recipient connection objects. void LATServer::forward_status_messages(unsigned char *inbuf, int len) { int ptr = sizeof(LAT_Status); unsigned char node[256]; get_string(inbuf, &ptr, node); // Forward all the StatusEntry messages while (ptr <= len) { if (ptr%2) ptr++; // Word aligned LAT_StatusEntry *entry = (LAT_StatusEntry *)&inbuf[ptr]; if (entry->length == 0) break; ptr += sizeof(LAT_StatusEntry); get_string(inbuf, &ptr, node); // Service name ptr += inbuf[ptr]+1; // Past port name ptr += inbuf[ptr]+1; // Past service description if (entry->request_id < MAX_CONNECTIONS && connections[entry->request_id]) connections[entry->request_id]->got_status(node, entry); } } /* Reply to an ENQUIRE message with our MAC address & service name */ void LATServer::reply_to_enq(unsigned char *inbuf, int len, int interface, unsigned char *remote_mac) { int inptr, outptr, i; unsigned char outbuf[1600]; unsigned char req_service[1600]; LAT_Header *outhead = (LAT_Header *)outbuf; LAT_Header *inhead = (LAT_Header *)inbuf; inptr = sizeof(LAT_Header)+4; /* This is the service being enquired about */ get_string(inbuf, &inptr, req_service); debuglog(("got ENQ for %s\n", req_service)); // Ignore empty requests:: TODO: is this right?? - maybe we issue // a response with all our services in it. if (strlen((char*)req_service) == 0) return; unsigned char reply_macaddr[6]; unsigned char *reply_node; // See if it is for us if we're not doing responder work. if (!responder) { std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), (char *)req_service); if (sii == servicelist.end()) return; // Not ours } std::string node; if (LATServices::Instance()->get_highest(std::string((char *)req_service), node, reply_macaddr, &interface)) { reply_node = (unsigned char *)node.c_str(); } else { return; // nevver 'eard of 'im. } debuglog(("Sending ENQ reply for %s\n", req_service)); inptr += 2; outptr = sizeof(LAT_Header); outbuf[outptr++] = 0x93; outbuf[outptr++] = 0x07; outbuf[outptr++] = 0x00; outbuf[outptr++] = 0x00; /* The service's MAC address */ outbuf[outptr++] = 0x06; outbuf[outptr++] = 0x00; for (i=0; i<5; i++) outbuf[outptr++] = reply_macaddr[i]; /* Don't know what this is */ outbuf[outptr++] = 0x14; outbuf[outptr++] = 0x00; add_string(outbuf, &outptr, reply_node); outbuf[outptr++] = 0x01; outbuf[outptr++] = 0x01; add_string(outbuf, &outptr, req_service); outhead->cmd = LAT_CCMD_ENQREPLY; outhead->num_slots = 0; outhead->remote_connid = inhead->remote_connid; outhead->local_connid = inhead->local_connid; outhead->sequence_number = inhead->sequence_number; outhead->ack_number = inhead->ack_number; send_message(outbuf, outptr, interface, remote_mac); } void LATServer::shutdown() { do_shutdown = true; } void LATServer::init(bool _static_rating, int _rating, char *_service, char *_greeting, char **_interfaces, int _verbosity, int _timer) { // Server is locked until latcp has finished locked = true; /* Initialise the platform-specific interface code */ iface = LATinterfaces::Create(); if (iface->Start(LATinterfaces::ProtoLAT) == -1) { syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); exit(1); } #ifdef ENABLE_DEFAULT_SERVICE // Add the default session servicelist.push_back(serviceinfo(_service, _rating, _static_rating)); #endif strcpy((char *)greeting, _greeting); verbosity = _verbosity; // Convert all the interface names to numbers and check they are usable if (_interfaces[0]) { int i=0; while (_interfaces[i]) { interface_num[num_interfaces] = iface->find_interface(_interfaces[i]); if (interface_num[num_interfaces] == -1) { syslog(LOG_ERR, "Can't use interface %s: ignored\n", _interfaces[i]); } else { interface_errs[num_interfaces] = 0; // Clear errors num_interfaces++; } i++; } if (num_interfaces == 0) { syslog(LOG_ERR, "No usable interfaces, latd exiting.\n"); exit(9); } } else { iface->get_all_interfaces(interface_num, num_interfaces); } // Remove any old /dev/lat symlinks tidy_dev_directory(); // Save these two for any newly added services rating = _rating; static_rating = _static_rating; next_connection = 1; multicast_incarnation = 0; circuit_timer = _timer/10; local_name[0] = '\0'; // Use default node name memset(connections, 0, sizeof(connections)); // Enable user group 0 memset(user_groups, 0, 32); user_groups[0] = 1; // Look in /etc/group for a group called "lat" struct group *gr = getgrnam("lat"); if (gr) lat_group = gr->gr_gid; else lat_group = 0; } // Create a new connection object for this remote node. int LATServer::make_new_connection(unsigned char *buf, int len, int interface, LAT_Header *header, unsigned char *macaddr) { int i; i = get_next_connection_number(); if (i >= 0) { next_connection = i+1; connections[i] = new LATConnection(i, buf, len, interface, header->sequence_number, header->ack_number, macaddr); } else { // Number of virtual circuits exceeded send_connect_error(9, header, interface, macaddr); return -1; } return i; } void LATServer::delete_session(int conn, unsigned char id, int fd) { // Add this to the list and delete them later deleted_session s(LOCAL_PTY, conn, id, fd); dead_session_list.push_back(s); } void LATServer::delete_connection(int conn) { // Add this to the list and delete them later debuglog(("connection %d pending deletion\n", conn)); dead_connection_list.push_back(conn); } // Got a reply from a DS90L - add it to the services list in a dummy service void LATServer::got_enqreply(unsigned char *buf, int len, int interface, unsigned char *macaddr) { int off = 14; unsigned char node_addr[6]; char node_description[256]; char node_name[256]; memset(node_addr, 0x00, sizeof(node_addr)); if (0 == memcmp(node_addr, buf + off, sizeof(node_addr))) { return; } memset(node_addr, 0xFF, sizeof(node_addr)); if (0 == memcmp(node_addr, buf + off, sizeof(node_addr))) { return; } // Node MAC address memcpy(node_addr, buf + off, sizeof(node_addr)); // Skip destination node name off = 22; off += buf[off] + 1; // Skip node groups off += buf[off] + 1; get_string(buf, &off, (unsigned char*)node_name); get_string(buf, &off, (unsigned char*)node_description); #if defined(debuglog) if (memcmp(node_addr, macaddr, sizeof(node_addr))) { debuglog(("got_enqreply : macaddr is different : %02hhX-%02hhX-%02hhX-%02hhX-%02hhX-%02hhX\n", macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5])); } #endif // Add it to the dummy service. debuglog(("got_enqreply : node: '%s' : %02hhX-%02hhX-%02hhX-%02hhX-%02hhX-%02hhX\n", node_name, node_addr[0], node_addr[1], node_addr[2], node_addr[3], node_addr[4], node_addr[5])); LATServices::Instance()->add_service(std::string(node_name), std::string(""), // Dummy service name std::string(node_description), 0, interface, node_addr); { sig_blk_t _block(SIGALRM); std::list::iterator sl_iter; sl_iter = find(slave_nodes.begin(), slave_nodes.end(), node_name); if (sl_iter != slave_nodes.end()) { debuglog(("got_enqreply : to remove from slave(%d), node: '%s'\n", slave_nodes.size(), sl_iter->c_str())); slave_nodes.erase(sl_iter); } sl_iter = find(known_slave_nodes.begin(), known_slave_nodes.end(), node_name); if (sl_iter == known_slave_nodes.end()) { known_slave_nodes.push_back(node_name); debuglog(("got_enqreply : added to known(%d), node: '%s'\n", known_slave_nodes.size(), node_name)); } } } // Got a COMMAND message from a remote node. it probably wants // to set up a reverse-LAT session to us. void LATServer::process_command_msg(unsigned char *buf, int len, int interface, unsigned char *macaddr) { LAT_Command *msg = (LAT_Command *)buf; int ptr = sizeof(LAT_Command); unsigned char remnode[256]; unsigned char remport[256]; unsigned char service[256]; unsigned char portname[256]; // TODO: Check the params in the LAT_Command message... debuglog(("REVLAT cmd: %d, opcode:%d request_id: %d\n", msg->cmd, msg->opcode, msg->request_id)); ptr += buf[ptr]+1; // Skip past groups for now. ptr += buf[ptr]+1; // Skip past groups for now. // Get the remote node name. get_string(buf, &ptr, remnode); get_string(buf, &ptr, remport); ptr += buf[ptr]+1; // Skip past greeting... get_string(buf, &ptr, service); get_string(buf, &ptr, portname); debuglog(("Got request for reverse-LAT connection to %s/%s from %s/%s\n", service, portname, remnode, remport)); // Make a new connection // We can reuse connections here... int connid = find_connection_by_node((char *)remnode); if (connid == -1) { connid = get_next_connection_number(); connections[connid] = new LATConnection(connid, (char *)service, (char *)remport, (char *)portname, (char *)remnode, false, true); } // Make a reverse-session and connect it. LAT_SessionStartCmd startcmd; memset(&startcmd, 0, sizeof(startcmd)); startcmd.dataslotsize = 255; if (connections[connid]->create_reverse_session((const char *)service, (const char *)&startcmd, dn_ntohs(msg->request_id), interface, macaddr) == -1) { // If we created this connection just for the new session // then get rid of it. if (connections[connid]->num_clients() == 0) delete_connection(connid); } } // Add services received from a service announcement multicast void LATServer::add_services(unsigned char *buf, int len, int interface, unsigned char *macaddr) { LAT_ServiceAnnounce *announce = (LAT_ServiceAnnounce *)buf; int ptr = sizeof(LAT_ServiceAnnounce); unsigned char service_groups[32]; unsigned char nodename[256]; unsigned char greeting[255]; unsigned char service[255]; unsigned char ident[255]; // Set the groups to all zeros initially memset(service_groups, 0, sizeof(service_groups)); // Make sure someone isn't pulling our leg. if (announce->group_length > 32) announce->group_length = 32; // Get group numbers memcpy(service_groups, buf+ptr, announce->group_length); // Compare with our user groups mask (which is always either completely // empty or the full 32 bytes) int i; bool gotone = false; for (i=0; igroup_length; i++) { if (user_groups[i] & service_groups[i]) { gotone = true; break; } } if (!gotone) { debuglog(("remote node not in our user groups list\n")); return; } ptr += announce->group_length; get_string(buf, &ptr, nodename); get_string(buf, &ptr, greeting); int num_services = buf[ptr++]; debuglog(("service announcement: status = %d\n", announce->node_status)); // Get all the services & register them for (int i=1; i<=num_services; i++) { int rating = buf[ptr++]; get_string(buf, &ptr, service); get_string(buf, &ptr, ident); if ( (announce->node_status & 1) == 0) { LATServices::Instance()->add_service(std::string((char*)nodename), std::string((char*)service), std::string((char*)ident), rating, interface, macaddr); } else { LATServices::Instance()->remove_node(std::string((char*)nodename)); } } } // Wait for data available on a client PTY void LATServer::add_pty(LocalPort *port, int fd) { fdlist.push_back(fdinfo(fd, port, LOCAL_PTY)); } // Got a new connection from latcp void LATServer::accept_latcp(int fd) { struct sockaddr_un socka; socklen_t sl = sizeof(socka); int latcp_client_fd = accept(fd, (struct sockaddr *)&socka, &sl); if (latcp_client_fd >= 0) { debuglog(("Got LATCP connection\n")); latcp_circuits[latcp_client_fd] = new LATCPCircuit(latcp_client_fd); fdlist.push_back(fdinfo(latcp_client_fd, 0, LATCP_SOCKET)); } else syslog(LOG_WARNING, "accept on latcp failed: %m"); } // Got a new connection from llogin void LATServer::accept_llogin(int fd) { struct sockaddr_un socka; socklen_t sl = sizeof(socka); int llogin_client_fd = accept(fd, (struct sockaddr *)&socka, &sl); if (llogin_client_fd >= 0) { debuglog(("Got llogin connection\n")); latcp_circuits[llogin_client_fd] = new LLOGINCircuit(llogin_client_fd); fdlist.push_back(fdinfo(llogin_client_fd, 0, LLOGIN_SOCKET)); } else syslog(LOG_WARNING, "accept on llogin failed: %m"); } // Read a request from LATCP void LATServer::read_latcp(int fd) { debuglog(("Got command on latcp socket: %d\n", fd)); if (!latcp_circuits[fd]->do_command()) { // Mark the FD for removal deleted_session s(LATCP_SOCKET, 0, 0, fd); dead_session_list.push_back(s); } } // Read a request from LLOGIN void LATServer::read_llogin(int fd) { debuglog(("Got command on llogin socket: %d\n", fd)); if (!latcp_circuits[fd]->do_command()) { // Mark the FD for removal deleted_session s(LLOGIN_SOCKET, 0, 0, fd); dead_session_list.push_back(s); } } void LATServer::delete_entry(deleted_session &dsl) { switch (dsl.get_type()) { case INACTIVE: break; // do nothing; case LAT_SOCKET: case LATCP_RENDEZVOUS: case LLOGIN_RENDEZVOUS: // These never get deleted break; case LATCP_SOCKET: case LLOGIN_SOCKET: remove_fd(dsl.get_fd()); close(dsl.get_fd()); delete latcp_circuits[dsl.get_fd()]; latcp_circuits.erase(dsl.get_fd()); break; case LOCAL_PTY: case DISABLED_PTY: remove_fd(dsl.get_fd()); if (connections[dsl.get_conn()]) connections[dsl.get_conn()]->remove_session(dsl.get_id()); break; default: debuglog(("Unknown socket type: %d\n", dsl.get_type())); break; } } void LATServer::process_data(fdinfo &fdi) { switch (fdi.get_type()) { case INACTIVE: case DISABLED_PTY: break; // do nothing; case LOCAL_PTY: fdi.get_localport()->do_read(); break; case LAT_SOCKET: read_lat(fdi.get_fd()); break; case LATCP_RENDEZVOUS: accept_latcp(fdi.get_fd()); break; case LLOGIN_RENDEZVOUS: accept_llogin(fdi.get_fd()); break; case LATCP_SOCKET: read_latcp(fdi.get_fd()); break; case LLOGIN_SOCKET: read_llogin(fdi.get_fd()); break; } } // Send a circuit disconnect with error code void LATServer::send_connect_error(int reason, LAT_Header *msg, int interface, unsigned char *macaddr) { unsigned char buf[1600]; LAT_Header *header = (LAT_Header *)buf; int ptr=sizeof(LAT_Header); memset(buf, 0, sizeof(buf)); header->cmd = LAT_CCMD_DISCON; header->num_slots = 0; header->local_connid = 0; // Servers expect this to be clear header->remote_connid = msg->local_connid; header->sequence_number = msg->sequence_number; header->ack_number = msg->ack_number; buf[ptr++] = reason; send_message(buf, ptr, interface, macaddr); } // Shutdown by latcp void LATServer::Shutdown() { // Shutdown all the connections first for (int i=1; i::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii != servicelist.end()) return true; return false; } // Return the command info for a service int LATServer::get_service_info(char *name, std::string &cmd, int &maxcon, int &curcon, uid_t &uid, gid_t &gid) { // Look for it. std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii != servicelist.end()) { cmd = sii->get_command(); maxcon = sii->get_max_connections(); curcon = sii->get_cur_connections(); uid = sii->get_uid(); gid = sii->get_gid(); return 0; } return -1; } // Add a new service from latcp bool LATServer::add_service(char *name, char *ident, char *command, int max_conn, uid_t uid, gid_t gid, int _rating, bool _static_rating) { // Look for it. std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii != servicelist.end()) return false; // Already exists // if rating is 0 then use the node default. if (!_rating) _rating = rating; servicelist.push_back(serviceinfo(name, _rating, _static_rating, ident, max_conn, command, uid, gid)); // Resend the announcement message. send_service_announcement(-1); return true; } // Change the rating of a service bool LATServer::set_rating(char *name, int _rating, bool _static_rating) { // Look for it. std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii == servicelist.end()) return false; // Not found it sii->set_rating(_rating, _static_rating); // Resend the announcement message. send_service_announcement(-1); return true; } // Change the ident of a service bool LATServer::set_ident(char *name, char *ident) { // Look for it. std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii == servicelist.end()) return false; // Not found it debuglog(("Setting ident for %s to '%s'\n", name, ident)); sii->set_ident(ident); // Resend the announcement message. send_service_announcement(-1); return true; } // Remove reverse-LAT port via latcp bool LATServer::remove_port(char *name) { debuglog(("remove port %s\n", name)); // Search for it. std::list::iterator p(portlist.begin()); for (; p != portlist.end(); p++) { if (strcmp(p->get_devname().c_str(), name) == 0) { p->close_and_delete(); portlist.erase(p); return true; } } return false; } // Remove service via latcp bool LATServer::remove_service(char *name) { // Only add the service if it does not already exist. std::list::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); if (sii == servicelist.end()) return false; // Does not exist servicelist.erase(sii); // This is overkill but it gets rid of the service in the known // services table. LATServices::Instance()->remove_node(std::string((char*)get_local_node())); // Resend the announcement message -- this will re-add our node // services back into the known services list. send_service_announcement(-1); return true; } // Change the multicast timer void LATServer::set_multicast(int newtime) { if (newtime) { multicast_timer = newtime; alarm(newtime); } } // Change the node name void LATServer::set_nodename(unsigned char *name) { debuglog(("New node name is %s\n", name)); // Remove all existing node services LATServices::Instance()->remove_node(std::string((char*)get_local_node())); // Set the new name strcpy((char *)local_name, (char *)name); // Resend the announcement message -- this will re-add our node // services back into the known services list. send_service_announcement(-1); } // Start sending service announcements void LATServer::unlock() { sig_blk_t _block(SIGALRM); locked = false; alarm_signal(SIGALRM); } // Generic make_connection code for llogin & port sessions. int LATServer::make_connection(int fd, const char *service, const char *rnode, const char *port, const char *localport, const char *password, bool queued) { unsigned char macaddr[6]; std::string servicenode; int this_int; char node[255]; // Take a local copy of the node so we can overwrite it. strcpy(node, rnode); // If no node was specified then use the highest rated one if (node[0] == '\0') { debuglog(("make_connection : no node, use highest\n")); if (!LATServices::Instance()->get_highest(std::string((char*)service), servicenode, macaddr, &this_int)) { debuglog(("Can't find service %s\n", service)); return -2; // Never eard of it! } strcpy((char *)node, servicenode.c_str()); } else { debuglog(("make_connection : node : %s\n", node)); // Try to find the node if (!LATServices::Instance()->get_node(std::string((char*)service), std::string((char*)node), macaddr, &this_int)) { debuglog(("Can't find node %s in service\n", node, service)); return -2; } } // Look for a connection that's already in use for this node, unless we // are queued in which case we need to allocate a new connection for // initiating the connection and receiving status requests on. int connid = -1; if (!queued) connid = find_connection_by_node(node); if (connid == -1) { // None: create a new one connid = get_next_connection_number(); connections[connid] = new LATConnection(connid, (char *)service, (char *)port, (char *)localport, (char *)node, queued, false); } return connid; } int LATServer::make_llogin_connection(int fd, const char *service, const char *rnode, const char *port, const char *localport, const char *password, bool queued) { int ret; int connid; connid = make_connection(fd, service, rnode, port, localport, password, queued); if (connid < 0) return connid; debuglog(("lloginSession for %s has connid %d\n", service, connid)); ret = connections[connid]->create_llogin_session(fd, service, port, localport, password); // Remove LLOGIN socket from the list as it's now been // added as a PTY (honest!) deleted_session s(LLOGIN_SOCKET, 0, 0, fd); dead_session_list.push_back(s); return ret; } // Called when activity is detected on a LocalPort - we connect it // to the service. int LATServer::make_port_connection(int fd, LocalPort *lport, const char *service, const char *rnode, const char *port, const char *localport, const char *password, bool queued) { int ret; int connid; debuglog(("LATServer::make_port_connection : fd %d, lport '0x%X', service '%s', rnode '%s', port '%s', localport '%s', pwd '%s'\n", fd, lport, service, rnode, port, localport, password)); connid = make_connection(fd, service, rnode, port, localport, password, queued); if (connid < 0) return connid; debuglog(("localport for %s has connid %d\n", service, connid)); ret = connections[connid]->create_localport_session(fd, lport, service, port, localport, password); return ret; } // Called from latcp to create a /dev/lat/ port // Here we simply add it to a lookaside list and wait // for it to be activated by a user. int LATServer::create_local_port(unsigned char *service, unsigned char *portname, unsigned char *devname, unsigned char *remnode, bool queued, bool clean, unsigned char *password) { debuglog(("Server::create_local_port: %s\n", devname)); // Don't create it if it already exists. std::list::iterator i(portlist.begin()); for (; i != portlist.end(); i++) { if (strcmp(i->get_devname().c_str(), (char *)devname) == 0) { return 1; // already in use } } portlist.push_back(LocalPort(service, portname, devname, remnode, queued, clean, password)); // Find the actual port in the list and start it up, this is because // the STL containers hold actual objects rather then pointers std::list::iterator p(portlist.begin()); for (; p != portlist.end(); p++) { if (strcmp(p->get_devname().c_str(), (char *)devname) == 0) { p->init_port(); break; } } return 0; } // Make this as much like VMS LATCP SHOW NODE as possible. bool LATServer::show_characteristics(bool verbose, std::ostringstream &output) { output <ifname(interface_num[i]) << " "; } output << std::endl << std::endl; output << "Circuit Timer (msec): " << std::setw(6) << circuit_timer*10 << " Keepalive Timer (sec): " << std::setw(6) << keepalive_timer << std::endl; output << "Retransmit Limit: " << std::setw(6) << retransmit_limit << std::endl; output << "Multicast Timer (sec):" << std::setw(6) << multicast_timer << std::endl; output << std::endl; // Show groups output << "User Groups: "; print_bitmap(output, true, user_groups); output << "Service Groups: "; print_bitmap(output, groups_set, groups); output << std::endl; // Show services we are accepting for. output << "Service Name Status Rating Identification" << std::endl; std::list::iterator i(servicelist.begin()); for (; i != servicelist.end(); i++) { output.width(15); output.setf(std::ios::left, std::ios::adjustfield); output << i->get_name().c_str(); output.setf(std::ios::right, std::ios::adjustfield); output << "Enabled" << std::setw(6) << i->get_rating() << (i->get_static()?" ":" D ") << i->get_id() << std::endl; } output << std::endl << "Port Service Node Remote Port Queued" << std::endl; // Show allocated ports std::list::iterator p(portlist.begin()); for (; p != portlist.end(); p++) { p->show_info(verbose, output); } // NUL-terminate it. output << std::endl << std::ends; return true; } bool LATServer::show_nodes(bool verbose, std::ostringstream &output) { return LATServices::Instance()->list_dummy_nodes(verbose, output); } // Return a number for a new connection int LATServer::get_next_connection_number() { int i; for (i=next_connection; i < MAX_CONNECTIONS; i++) { if (!connections[i]) { next_connection = i+1; return i; } } // Didn't find a slot here - try from the start for (i=1; i < next_connection; i++) { if (!connections[i]) { next_connection = i+1; return i; } } return -1; } int LATServer::set_servergroups(unsigned char *bitmap) { // Assume all unset if this is the first mention of groups if (!groups_set) { memset(groups, 0, 32); user_groups[0] = 1; // But enable group 0 } groups_set = true; for (int i=0; i<32; i++) { groups[i] |= bitmap[i]; } return true; } int LATServer::unset_servergroups(unsigned char *bitmap) { // Assume all set if this is the first mention of groups if (!groups_set) { memset(groups, 0xFF, 32); } groups_set = true; for (int i=0; i<32; i++) { groups[i] &= ~bitmap[i]; } return true; } int LATServer::set_usergroups(unsigned char *bitmap) { for (int i=0; i<32; i++) { user_groups[i] |= bitmap[i]; } return true; } int LATServer::unset_usergroups(unsigned char *bitmap) { for (int i=0; i<32; i++) { user_groups[i] &= ~bitmap[i]; } return true; } // Look for a connection for this node name, if not found then // return -1 int LATServer::find_connection_by_node(const char *node) { debuglog(("Looking for connection to node %s\n", node)); for (int i=1; inode_is(node) && connections[i]->num_clients() < LATConnection::MAX_SESSIONS-1) { debuglog(("Reusing connection for node %s\n", node)); return i; } } return -1; } // Print a groups bitmap // TODO: print x-y format like we accept in latcp. void LATServer::print_bitmap(std::ostringstream &output, bool isset, unsigned char *bitmap) { if (!isset) { output << "0" << std::endl; return; } bool printed = false; for (int i=0; i<32; i++) // Show bytes { unsigned char thebyte = bitmap[i]; for (int j=0; j<8; j++) // Bits in the byte { if (thebyte&1) { if (printed) output << ","; printed = true; output << i*8+j; } thebyte = thebyte>>1; } } output << std::endl; } LATServer *LATServer::instance = NULL; unsigned char LATServer::greeting[255] = {'\0'}; latd/configure0000755000000000000000000055235212254065422010615 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="latcp.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP LIBUTIL INTERFACE CPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_openpty with_login enable_devlocking with_latcp_socket with_llogin_socket enable_defservice enable_debug enable_warnings ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --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 _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-openpty don't use the system's openpty function do --disable-devlocking disable llogin device locking using flock --disable-defservice disable default login service --enable-debug compile debuggable programs --disable-warnings don't compile with warnings turned on Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-login program to use for logins (defaults to local "login") --with-latcp-socket=SOCK set the socket for latcp to SOCK /var/run/latcp --with-llogin-socket=SOCK set the socket for llogin to SOCK /var/run/latlogin Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=latd VERSION=1.34 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/ioctl.h sys/sockio.h sys/socketio.h sys/filio.h \ pty.h termios.h libutil.h util.h mcheck.h netinet/ether.h net/if_ether.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in net/if_ether.h net/ethernet.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ether_header" >&5 $as_echo_n "checking for struct ether_header... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #ifdef HAVE_NET_IF_ETHER_H #include #endif /* HAVE_NET_IF_ETHER_H */ #ifdef HAVE_NET_ETHERNET_H #include #endif /* HAVE_NET_ETHERNET_H */ int main () { struct ether_header the_ether_header; unsigned int ethertype; ethertype = the_ether_header.ether_type; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else as_fn_error $? "cannot find struct ether_header" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } latd_raw_type= ac_fn_c_check_header_mongrel "$LINENO" "netpacket/packet.h" "ac_cv_header_netpacket_packet_h" "$ac_includes_default" if test "x$ac_cv_header_netpacket_packet_h" = xyes; then : latd_raw_type=linux fi if test x$latd_raw_type = x; then ac_fn_c_check_header_mongrel "$LINENO" "net/bpf.h" "ac_cv_header_net_bpf_h" "$ac_includes_default" if test "x$ac_cv_header_net_bpf_h" = xyes; then : latd_raw_type=bpf fi fi case x$latd_raw_type in xbpf) for ac_header in net/if_dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_IF_DL_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_LINK support" >&5 $as_echo_n "checking for AF_LINK support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef AF_LINK _latd_has_af_link #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "_latd_has_af_link" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_AF_LINK 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* ;; xlinux) for ac_header in features.h do : ac_fn_c_check_header_mongrel "$LINENO" "features.h" "ac_cv_header_features_h" "$ac_includes_default" if test "x$ac_cv_header_features_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FEATURES_H 1 _ACEOF fi done ;; *) ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for raw Ethernet access method" >&5 $as_echo_n "checking for raw Ethernet access method... " >&6; } if test x$latd_raw_type = x; then as_fn_error $? "can't find any raw Ethernet access method" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $latd_raw_type" >&5 $as_echo "$latd_raw_type" >&6; } INTERFACE=interfaces-$latd_raw_type.o if test "x$latd_raw_type" = "xbpf"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr.sa_len" >&5 $as_echo_n "checking for sockaddr.sa_len... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sockaddr sa; sa.sa_len = 5; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-openpty was given. if test "${enable_openpty+set}" = set; then : enableval=$enable_openpty; else enable_openpty=yes fi if test "x$enable_openpty" = "xyes"; then openpty_found= for ac_func in openpty do : ac_fn_c_check_func "$LINENO" "openpty" "ac_cv_func_openpty" if test "x$ac_cv_func_openpty" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENPTY 1 _ACEOF openpty_found=yes fi done if test "x$openpty_found" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5 $as_echo_n "checking for openpty in -lutil... " >&6; } if ${ac_cv_lib_util_openpty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char openpty (); int main () { return openpty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_util_openpty=yes else ac_cv_lib_util_openpty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5 $as_echo "$ac_cv_lib_util_openpty" >&6; } if test "x$ac_cv_lib_util_openpty" = xyes; then : openpty_found=yes fi if test "x$openpty_found" = "xyes"; then $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h LIBUTIL=-lutil fi fi fi withval= # Check whether --with-login was given. if test "${with_login+set}" = set; then : withval=$with_login; fi if test "x$withval" = "x"; then if test -f /bin/login; then withval="/bin/login" elif test -f /usr/bin/login; then withval="/usr/bin/login" fi fi cat >>confdefs.h <<_ACEOF #define LOGIN_BIN "$withval" _ACEOF # Check whether --enable-devlocking was given. if test "${enable_devlocking+set}" = set; then : enableval=$enable_devlocking; else enable_devlocking=yes fi if test "x$enable_devlocking" = "xno"; then CXXFLAGS="${CXXFLAGS-} -DDISABLE_DEVICE_LOCKING" fi LATCPSOCK=/var/run/latcp # Check whether --with-latcp_socket was given. if test "${with_latcp_socket+set}" = set; then : withval=$with_latcp_socket; else with_latcp_socket=yes fi case x$with_latcp_socket in xyes | xno | x) ;; *) LATCPSOCK=$with_latcp_socket ;; esac cat >>confdefs.h <<_ACEOF #define LATCP_SOCKNAME "$LATCPSOCK" _ACEOF LLOGINSOCK=/var/run/latlogin # Check whether --with-llogin_socket was given. if test "${with_llogin_socket+set}" = set; then : withval=$with_llogin_socket; else with_llogin_socket=yes fi case x$with_llogin_socket in xyes | xno | x) ;; *) LLOGINSOCK=$with_llogin_socket ;; esac cat >>confdefs.h <<_ACEOF #define LLOGIN_SOCKNAME "$LLOGINSOCK" _ACEOF # Check whether --enable-defservice was given. if test "${enable_defservice+set}" = set; then : enableval=$enable_defservice; else enable_defservice=yes fi if test "x$enable_defservice" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -DENABLE_DEFAULT_SERVICE" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=yes fi if test "x$enable_debug" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -g3 -O0 -DVERBOSE_DEBUG -DNO_FORK" fi # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; else enable_warnings=yes fi if test "x$enable_warnings" = "xyes" -a "x$GCC" = "xyes"; then CXXFLAGS="${CXXFLAGS-} -W" fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi latd/interfaces-linux.cc0000644000000000000000000002126211071437441012464 0ustar /****************************************************************************** (c) 2002-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* for the glibc version number */ #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ >= 3 #include #include /* the L2 protocols */ #include #include #else #include #include #include #include #include /* The L2 protocols */ #endif #include #include #include #include #include #include #include #include #include "utils.h" #include "interfaces.h" #include "interfaces-linux.h" int LATinterfaces::ProtoLAT = ETH_P_LAT; int LATinterfaces::ProtoMOP = ETH_P_DNA_RC; int LinuxInterfaces::Start(int proto) { protocol = proto; // Open raw socket on specified protocol fd = socket(PF_PACKET, SOCK_DGRAM, htons(protocol)); if (fd < 0) { syslog(LOG_ERR, "Can't create protocol socket: %m\n"); return -1; } return 0; } // Return a list of valid interface numbers and the count void LinuxInterfaces::get_all_interfaces(int *ifs, int &num) { struct ifreq ifr; int iindex = 1; int sock = socket(PF_PACKET, SOCK_RAW, 0); num = 0; for (iindex = 1; iindex < 256; iindex++) { ifr.ifr_ifindex = iindex; if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { // Only use ethernet interfaces ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) { debuglog(("interface %d: %d\n", num, iindex)); ifs[num++] = iindex; } } } close(sock); } // Print the name of an interface std::string LinuxInterfaces::ifname(int ifn) { struct ifreq ifr; int sock = socket(PF_PACKET, SOCK_RAW, 0); ifr.ifr_ifindex = ifn; if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { close(sock); return std::string((char *)ifr.ifr_name); } // Didn't find it close(sock); return std::string(""); } // Bind a socket to an interface int LinuxInterfaces::bind_socket(int interface) { struct sockaddr_ll sock_info; sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(protocol); sock_info.sll_ifindex = interface; if (bind(fd, (struct sockaddr *)&sock_info, sizeof(sock_info))) { perror("can't bind socket to i/f %m\n"); return -1; } return 0; } // Find an interface number by name, or // use the first one if name is NULL. int LinuxInterfaces::find_interface(char *name) { struct ifreq ifr; int iindex = 1; int sock = socket(PF_PACKET, SOCK_RAW, 0); // Default "1st" interface if (!name) name = (char *)"eth0"; ifr.ifr_ifindex = iindex; for (iindex = 1; iindex < 256; iindex++) { ifr.ifr_ifindex = iindex; if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { if (strcmp(ifr.ifr_name, name) == 0) { // Also check it's ethernet while we are here ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { syslog(LOG_ERR, "Device %s is not ethernet\n", name); return -1; } close(sock); return iindex; } } } // Didn't find it close(sock); return -1; } // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. bool LinuxInterfaces::one_fd_per_interface() { return false; } // Return the FD for this interface (will only be called once for // select if above returns false) int LinuxInterfaces::get_fd(int ifn) { return fd; } // Send a packet to a given macaddr int LinuxInterfaces::send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len) { struct sockaddr_ll sock_info; /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(protocol); sock_info.sll_ifindex = ifn; sock_info.sll_hatype = 0;//ARPHRD_ETHER; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; memcpy(sock_info.sll_addr, macaddr, 6); return sendto(fd, data, len, 0, (struct sockaddr *)&sock_info, sizeof(sock_info)); } // Receive a packet from a given interface int LinuxInterfaces::recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen, bool &more) { struct msghdr msg; struct iovec iov; struct sockaddr_ll sock_info; int len; /* Linux only returns 1 packet at a time */ more = false; memset(&msg, 0, sizeof(msg)); msg.msg_name = &sock_info; msg.msg_namelen = sizeof(sock_info); msg.msg_iovlen = 1; msg.msg_iov = &iov; iov.iov_len = maxlen; iov.iov_base = data; len = recvmsg(sockfd, &msg, 0); ifn = sock_info.sll_ifindex; memcpy(macaddr, sock_info.sll_addr, 6); // Ignore packets captured in promiscuous mode. if (sock_info.sll_pkttype == PACKET_OTHERHOST) { debuglog(("Got a rogue packet .. interface probably in promiscuous mode\n")); return 0; } return len; } // Open a connection on an interface // Only necessary for LAT sockets. int LinuxInterfaces::set_lat_multicast(int ifn) { // Add Multicast membership for LAT on socket struct packet_mreq pack_info; /* Fill in socket options */ pack_info.mr_type = PACKET_MR_MULTICAST; pack_info.mr_alen = 6; pack_info.mr_ifindex = ifn; /* This is the LAT multicast address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x00; pack_info.mr_address[4] = 0x00; pack_info.mr_address[5] = 0x0f; if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &pack_info, sizeof(pack_info))) { syslog(LOG_ERR, "can't add lat socket multicast : %m\n"); return -1; } /* This is the LAT solicit address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x02; pack_info.mr_address[4] = 0x01; pack_info.mr_address[5] = 0x04; if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &pack_info, sizeof(pack_info))) { syslog(LOG_ERR, "can't add lat socket multicast : %m\n"); return -1; } return 0; } // Close an interface. int LinuxInterfaces::remove_lat_multicast(int ifn) { // Add Multicast membership for LAT on socket struct packet_mreq pack_info; /* Fill in socket options */ pack_info.mr_type = PACKET_MR_MULTICAST; pack_info.mr_alen = 6; pack_info.mr_ifindex = ifn; /* This is the LAT multicast address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x00; pack_info.mr_address[4] = 0x00; pack_info.mr_address[5] = 0x0f; if (setsockopt(fd, SOL_PACKET, PACKET_DROP_MEMBERSHIP, &pack_info, sizeof(pack_info))) { syslog(LOG_ERR, "can't remove socket multicast : %m\n"); return -1; } /* This is the LAT solicit address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x02; pack_info.mr_address[4] = 0x01; pack_info.mr_address[5] = 0x04; if (setsockopt(fd, SOL_PACKET, PACKET_DROP_MEMBERSHIP, &pack_info, sizeof(pack_info))) { syslog(LOG_ERR, "can't remove socket multicast : %m\n"); return -1; } return 0; } // Here's where we know how to instantiate the class. LATinterfaces *LATinterfaces::Create() { return new LinuxInterfaces(); } latd/compile0000777000000000000000000000000012254065422015776 2/usr/share/automake-1.14/compileustar latd/Makefile.am0000644000000000000000000000270412254065406010733 0ustar ## Makefile.am for LAT server AUTOMAKE_OPTIONS = 1.4 foreign DPKG_EXPORT_BUILDFLAGS = 1 AM_CXXFLAGS = -fno-rtti -fno-exceptions -Wno-unused INCLUDES = -DLATD_CONF=\"$(sysconfdir)/latd.conf\" -DSBINDIR=\"$(sbindir)\" -DBINDIR=\"$(bindir)\" sbin_PROGRAMS = latd latcp moprc bin_PROGRAMS = llogin sysconf_DATA = latd.conf.sample man_MANS = latd.8 latcp.8 llogin.1 moprc.8 latd.conf.5 latd_SOURCES = main.cc \ circuit.h circuit.cc \ clientsession.h clientsession.cc \ connection.h connection.cc \ interfaces.h interfaces.cc \ lat_messages.h lat_messages.cc \ latcpcircuit.h latcpcircuit.cc \ llogincircuit.h llogincircuit.cc \ lloginsession.h lloginsession.cc \ localportsession.h localportsession.cc \ queuedsession.h queuedsession.cc \ localport.h localport.cc \ server.h server.cc \ serversession.h serversession.cc \ services.h services.cc \ session.h session.cc \ reversesession.h reversesession.cc \ utils.h utils.cc \ dn_endian.h lat.h latcp_SOURCES = latcp.h latcp.cc utils.h utils.cc \ dn_endian.h lat.h llogin_SOURCES = llogin.cc utils.cc moprc_SOURCES = moprc.h moprc.cc interfaces.cc utils.cc EXTRA_DIST = $(man_MANS) WARRANTY latd.conf.sample lat.html \ interfaces-linux.cc interfaces-linux.h \ interfaces-bpf.cc interfaces-bpf.h \ mkrpm.sh rpm.spec startlat.sh latprint.sh latd_DEPENDENCIES = @INTERFACE@ latd_LDADD = $(latd_DEPENDENCIES) @LIBUTIL@ moprc_DEPENDENCIES = @INTERFACE@ moprc_LDADD = $(moprc_DEPENDENCIES) llogin_LDADD = latd/install-sh0000755000000000000000000001273607634653323010720 0ustar #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 latd/clientsession.cc0000644000000000000000000000722611071437441012072 0ustar /****************************************************************************** (c) 2001-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "server.h" #include "clientsession.h" #include "lat_messages.h" ClientSession::ClientSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *ttyname, bool clean): LATSession(p, remid, localid, clean), slave_fd_open(false) { debuglog(("new client session: localid %d, remote id %d\n", localid, remid)); if (ttyname) strcpy(ltaname, ttyname); } // This should never be called now as it is overridden // by all self-respecting superclasses. int ClientSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) { assert(!"Should never get here!!"); return 0; } int ClientSession::connect_parent() { debuglog(("connecting parent for %s\n", ltaname)); return parent.connect(this); } // Disconnect the local PTY void ClientSession::restart_pty() { assert(!"ClientSession::restart_pty()\n"); } // Remote end disconnects or EOF on local PTY void ClientSession::disconnect_session(int reason) { debuglog(("ClientSession::disconnect_session()\n")); // If the reason was some sort of error then send it to // the PTY if (reason > 1) { const char *msg = lat_messages::session_disconnect_msg(reason); write(master_fd, msg, strlen(msg)); write(master_fd, "\n", 1); } LATServer::Instance()->set_fd_state(master_fd, true); connected = false; restart_pty(); return; } ClientSession::~ClientSession() { if (slave_fd_open) close (slave_fd); if (master_fd > -1) { close (master_fd); LATServer::Instance()->remove_fd(master_fd); } } void ClientSession::do_read() { debuglog(("ClientSession::do_read(), connected: %d\n", connected)); if (!connected) { if (!connect_parent()) { state = STARTING; // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); close(slave_fd); slave_fd_open = false; } else { // Service does not exist or we haven't heard of it yet. restart_pty(); } } if (connected) { read_pty(); } } // Called from the slave connection - return the master fd so it can // can do I/O on it. int ClientSession::get_port_fd() { return master_fd; } // Normal client sessions don't provide feedback on status (though maybe we // should check for other status types.... void ClientSession::show_status(unsigned char *node, LAT_StatusEntry *entry) { return; } // Called when a PortSession connects to us void ClientSession::start_port() { return; } latd/localport.h0000644000000000000000000000277511053013677011056 0ustar /****************************************************************************** (c) 2001 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ class LocalPort { public: LocalPort(unsigned char *service, unsigned char *portname, unsigned char *devname, unsigned char *remnode, bool queued, bool clean, unsigned char *password); LocalPort(const LocalPort &p); ~LocalPort(); void do_read(); void disconnect_session(int reason); void restart_pty(); int get_port_fd(); void show_info(bool verbose, std::ostringstream &output); void close_and_delete(); const std::string &get_devname() { return devname; }; void init_port(); private: bool connect_session(); std::string service; std::string portname; std::string devname; std::string remnode; std::string password; bool queued; bool clean; bool slave_fd_open; bool connected; char ptyname[255]; int master_fd; int slave_fd; }; latd/WARRANTY0000644000000000000000000000233007102536531010062 0ustar 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. latd/services.cc0000644000000000000000000002631511053013677011034 0ustar /****************************************************************************** (c) 2000-2004 Christine Caulfield christine.caulfield@googlemail.com (c) 2003 Dmitri Popov 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "services.h" #include "dn_endian.h" // Add or replace a node in the service table bool LATServices::add_service(const std::string &node, const std::string &service, const std::string &ident, int rating, int interface, unsigned char *macaddr) { debuglog(("Got service. Node: %s, service %s, rating: %d\n", node.c_str(), service.c_str(), rating)); std::map >::iterator test = servicelist.find(service); if (test == servicelist.end()) { servicelist[service] = serviceinfo(node, ident, macaddr, rating, interface); } else { servicelist[test->first].add_or_replace_node(node, ident, macaddr, rating, interface); } return true; } // Return the highest rated node providing a named service bool LATServices::get_highest(const std::string &service, std::string &node, unsigned char *macaddr, int *interface) { std::map >::iterator test = servicelist.find(service); if (test != servicelist.end()) { return servicelist[test->first].get_highest(node, macaddr, interface); } return false; // Not found } // Return the highest rated node providing this service bool LATServices::serviceinfo::get_highest(std::string &node, unsigned char *macaddr, int *interface) { int highest_rating=0; std::string highest_node; const unsigned char *highest_macaddr = NULL; std::map >::iterator i; for (i=nodes.begin(); i != nodes.end(); i++) { if (nodes[i->first].is_available() && nodes[i->first].get_rating() > highest_rating) { highest_rating = nodes[i->first].get_rating(); highest_node = i->first; // Just note the pointer highest_macaddr = nodes[i->first].get_macaddr(); *interface = nodes[i->first].get_interface(); } } if (highest_macaddr) { // OK copy it now. memcpy(macaddr, highest_macaddr, 6); node = highest_node; return true; } else { return false; } } // Return the node macaddress if the node provides this service bool LATServices::get_node(const std::string &service, const std::string &node, unsigned char *macaddr, int *interface) { std::map >::iterator test = servicelist.find(service); std::map >::iterator c = servicelist.begin(); int i =0; for(;c != servicelist.end();c++) { i++; debuglog(("LATServices::get_node : service %2d '%s' \n", i, c->first.c_str())); } if (test != servicelist.end()) { // std::map >::iterator c = test; // int i =0; // for(;c != servicelist.end();c++) { i++; }; debuglog(("LATServices::get_node : service found '%s', number: %d \n", service.c_str(), i)); return servicelist[test->first].get_node(node, macaddr, interface); } debuglog(("LATServices::get_node : no service '%s' \n", service.c_str())); return false; // Not found } // Return the node's macaddress bool LATServices::serviceinfo::get_node(const std::string &node, unsigned char *macaddr, int *interface) { std::map >::iterator test = nodes.find(node); std::map >::iterator c = nodes.begin(); int i =0; for(;c != nodes.end();c++) { i++; debuglog(("LATServices::serinfo::get_node :node %2d '%s' \n", i, c->first.c_str())); } debuglog(("LATServices::serinfo::get_node looking for '%s' \n", node.c_str())); if (test != nodes.end()) { memcpy(macaddr, nodes[node].get_macaddr(), 6); *interface = nodes[node].get_interface(); return true; } else { debuglog(("LATServices::serviceinfo::get_node : no node '%s' \n", node.c_str())); return false; } } // Remove node from all services... // Actually just mark as unavailable in all services bool LATServices::remove_node(const std::string &node) { bool removed = false; std::map >::iterator s(servicelist.begin()); for (; s != servicelist.end(); s++) { if (servicelist[s->first].remove_node(node)) removed=true; } return removed; } bool LATServices::serviceinfo::remove_node(const std::string &node) { std::map >::iterator test = nodes.find(node); if (test != nodes.end()) { nodes[test->first].set_available(false); } return false; } // Return true if the service is available. // This is the case if one node offering that service is available bool LATServices::serviceinfo::is_available() { bool avail = true; std::map >::iterator n(nodes.begin()); for (; n != nodes.end(); n++) { if (!nodes[n->first].is_available()) avail=false; } return avail; } void LATServices::serviceinfo::expire_nodes(time_t current_time) { std::map >::iterator n(nodes.begin()); for (; n != nodes.end(); n++) { if (nodes[n->first].has_expired(current_time)) nodes[n->first].set_available(false); } } void LATServices::expire_nodes() { std::map >::iterator s(servicelist.begin()); time_t current_time = time(NULL); for (; s != servicelist.end(); s++) { // Skip dummy service if (s->first != "") { servicelist[s->first].expire_nodes(current_time); } } } // Verbose listing of nodes in this service void LATServices::serviceinfo::list_service(std::ostringstream &output) { std::map >::iterator n(nodes.begin()); output << "Node Name Status Rating Identification" << std::endl; for (; n != nodes.end(); n++) { output.width(17); output.setf(std::ios::left, std::ios::adjustfield); output << n->first.c_str() << (nodes[n->first].is_available()?"Reachable ":"Unreachable") << " "; output.width(4); output.setf(std::ios::right, std::ios::adjustfield); output << nodes[n->first].get_rating() << " " << nodes[n->first].get_ident() << std::endl; } } void LATServices::serviceinfo::list_nodes(std::ostringstream &output) { std::map >::iterator n(nodes.begin()); const unsigned char *addr = NULL; output << "Node Name Status Address Identification" << std::endl; for (; n != nodes.end(); n++) { addr = n->second.get_macaddr(); output.width(17); output.setf(std::ios::left, std::ios::adjustfield); output << n->first.c_str() << (n->second.check_respond_counter()?"Reachable ":"Unreachable") << " "; output.setf(std::ios::hex, std::ios::basefield); output << setiosflags(std::ios::right | std::ios::uppercase) << std::setfill('0') << std::setw(2) << (int)addr[0] << '-' << std::setw(2) << (int)addr[1] << '-' << std::setw(2) << (int)addr[2] << '-' << std::setw(2) << (int)addr[3] << '-' << std::setw(2) << (int)addr[4] << '-' << std::setw(2) << (int)addr[5] << resetiosflags(std::ios::right | std::ios::uppercase) << std::setfill(' '); output.setf(std::ios::right, std::ios::adjustfield); output << " " << n->second.get_ident() << std::endl; } } bool LATServices::list_dummy_nodes(bool verbose, std::ostringstream &output) { std::map >::iterator dummies = servicelist.find(""); if ( dummies == servicelist.end()) { output << "No dummy nodes available." << std::endl; return true; } output << std::endl; output << "Service Name: " << "Slave nodes" << std::endl; output << "Service Status: " << (servicelist[dummies->first].is_available()?"Available ":"Unavailable") << " " << std::endl; output << "Service Ident: " << servicelist[dummies->first].get_ident() << std::endl << std::endl; dummies->second.list_nodes(output); output << "--------------------------------------------------------------------------------" << std::endl; return true; } bool LATServices::touch_dummy_node_respond_counter(const std::string &str_name) { std::map >::iterator dummies = servicelist.find(""); if ( dummies == servicelist.end()) { return false; // no node } return dummies->second.touch_dummy_node_respond_counter(str_name); } bool LATServices::serviceinfo::touch_dummy_node_respond_counter(const std::string &str_name) { std::map >::iterator n = nodes.find(str_name); if (n == nodes.end()) { return false; // no node } debuglog(("touch_respond() : node: %s ", n->first.c_str())); n->second.touch_respond_counter(); return true; } // List all known services bool LATServices::list_services(bool verbose, std::ostringstream &output) { std::map >::iterator s(servicelist.begin()); for (; s != servicelist.end(); s++) { // Skip dummy service if (s->first != "") { if (verbose) { output << std::endl; output << "Service Name: " << s->first << std::endl; output << "Service Status: " << (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << std::endl; output << "Service Ident: " << servicelist[s->first].get_ident() << std::endl << std::endl; servicelist[s->first].list_service(output); output << "--------------------------------------------------------------------------------" << std::endl; } else { output.width(28); output.setf(std::ios::left, std::ios::adjustfield); output << s->first.c_str() << (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << servicelist[s->first].get_ident() << std::endl; } } } output << std::ends; // Trailing NUL for latcp's benefit. return true; } LATServices *LATServices::instance = NULL; latd/lloginsession.cc0000644000000000000000000001270111071437441012072 0ustar /****************************************************************************** (c) 2001-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "server.h" #include "clientsession.h" #include "lloginsession.h" #include "lat_messages.h" #include "dn_endian.h" lloginSession::lloginSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *lta, int fd): ClientSession(p, remid, localid, lta, clean), have_been_queued(false) { master_fd = dup(fd); // This is the socket FD - we dup it because the original // will be closed when it "changes" from a LLOGIN_FD to a PTY debuglog(("new llogin session: localid %d, remote id %d\n", localid, remid)); remote_node[0] = '\0'; } int lloginSession::new_session(unsigned char *_remote_node, char *service, char *port, char *password, unsigned char c) { credit = c; strcpy(remote_service, service); strcpy(remote_port, port); strcpy(remote_pass, password); debuglog(("lloginSession::new_session\n")); // Make it non-blocking so we can poll it fcntl(master_fd, F_SETFL, fcntl(master_fd, F_GETFL, 0) | O_NONBLOCK); // Auto-connect if (!connect_parent()) { state = STARTING; // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); } else { // Service does not exist or we haven't heard of it yet. disconnect_sock(); return -1; } return 0; } void lloginSession::connect() { debuglog(("connecting llogin session to '%s'\n", remote_service)); state = RUNNING; // OK, now send a Start message to the remote end. unsigned char buf[1600]; memset(buf, 0, sizeof(buf)); LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size buf[ptr++] = 0xfe; // Max Data slot size add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name buf[ptr++] = 0x01; // Param type 1 buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char*)ltaname); // Add password if present. if (remote_pass[0] != '\0') { buf[ptr++] = 0x07; // Param type 7 (Service password) add_string(buf, &ptr, (unsigned char*)remote_pass); } // If the user wanted a particular port number then add it // into the message if (remote_port[0] != '\0') { debuglog(("Adding port %s\n", remote_port)); buf[ptr++] = 0x04; // Param type 4 (Remote port name) add_string(buf, &ptr, (unsigned char *)remote_port); buf[ptr++] = 0x00; // NUL terminated (??) } // Send message... reply->header.cmd = LAT_CCMD_SESSION; reply->header.num_slots = 1; reply->slot.remote_session = local_session; reply->slot.local_session = remote_session; reply->slot.length = ptr - sizeof(LAT_SessionData); reply->slot.cmd = 0x9f; parent.send_message(buf, ptr, LATConnection::DATA); } // Disconnect the local socket void lloginSession::disconnect_sock() { LATServer::Instance()->set_fd_state(master_fd, false); LATServer::Instance()->delete_session(parent.get_connection_id(), local_session, master_fd); } // Remote end disconnects or EOF on local PTY void lloginSession::disconnect_session(int reason) { debuglog(("lloginSession::disconnect_session()\n")); // If the reason was some sort of error then send it to // the user. if (reason > 1) { const char *msg = lat_messages::session_disconnect_msg(reason); write(master_fd, msg, strlen(msg)); write(master_fd, "\n", 1); } connected = false; disconnect_sock(); return; } lloginSession::~lloginSession() { close (master_fd); LATServer::Instance()->remove_fd(master_fd); } void lloginSession::do_read() { read_pty(); } void lloginSession::show_status(unsigned char *node, LAT_StatusEntry *entry) { char buffer[1024]; int len; if (entry->max_que_pos != 0) { len = snprintf(buffer, sizeof(buffer), "LAT: You are queued for %s, position %d\n", node, dn_ntohs(entry->max_que_pos)); write(master_fd, buffer, len); have_been_queued = true; } } // Called when a PortSession connects to us void lloginSession::start_port() { if (have_been_queued) write(master_fd, "LAT: Connected\n", 15); } latd/config.status.lineno0000755000000000000000000006501711306705451012703 0ustar #! /bin/sh # Generated by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=${CONFIG_SHELL-/bin/sh} ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=157 as_lineno_2=158 test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with 162 # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using 164; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing 166, and appends # trailing '-' during substitution so that 167 is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " # Files that config.status was made for. config_files=" Makefile" config_commands=" depfiles" ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." ac_cs_version="\ config.status configured by ./configure, generated by GNU Autoconf 2.61, with options \"'--prefix=/usr' '--sysconfdir=/etc' 'CFLAGS=-g -O2' 'LDFLAGS=' 'CPPFLAGS=' 'CXXFLAGS=-g -O2'\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='/home/christine/dev/latd' srcdir='.' INSTALL='/usr/bin/install -c' MKDIR_P='/bin/mkdir -p' # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi if $ac_cs_recheck; then echo "running CONFIG_SHELL=/bin/sh /bin/sh ./configure " '--prefix=/usr' '--sysconfdir=/etc' 'CFLAGS=-g -O2' 'LDFLAGS=' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' $ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=/bin/sh export CONFIG_SHELL exec /bin/sh "./configure" '--prefix=/usr' '--sysconfdir=/etc' 'CFLAGS=-g -O2' 'LDFLAGS=' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' $ac_configure_extra_args --no-create --no-recursion fi exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 # # INIT-COMMANDS # AMDEP_TRUE="" ac_aux_dir="." # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:426: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then cat >"$tmp/subs-1.sed" <<\CEOF /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end s,@SHELL@,|#_!!_#|/bin/sh,g s,@PATH_SEPARATOR@,|#_!!_#|:,g s,@PACKAGE_NAME@,|#_!!_#|,g s,@PACKAGE_TARNAME@,|#_!!_#|,g s,@PACKAGE_VERSION@,|#_!!_#|,g s,@PACKAGE_STRING@,|#_!!_#|,g s,@PACKAGE_BUGREPORT@,|#_!!_#|,g s,@exec_prefix@,|#_!!_#|${prefix},g s,@prefix@,|#_!!_#|/usr,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,@datarootdir@,|#_!!_#|${prefix}/share,g s,@datadir@,|#_!!_#|${datarootdir},g s,@sysconfdir@,|#_!!_#|/etc,g s,@sharedstatedir@,|#_!!_#|${prefix}/com,g s,@localstatedir@,|#_!!_#|${prefix}/var,g s,@includedir@,|#_!!_#|${prefix}/include,g s,@oldincludedir@,|#_!!_#|/usr/include,g s,@docdir@,|#_!!_#|${datarootdir}/doc/${PACKAGE},g s,@infodir@,|#_!!_#|${datarootdir}/info,g s,@htmldir@,|#_!!_#|${docdir},g s,@dvidir@,|#_!!_#|${docdir},g s,@pdfdir@,|#_!!_#|${docdir},g s,@psdir@,|#_!!_#|${docdir},g s,@libdir@,|#_!!_#|${exec_prefix}/lib,g s,@localedir@,|#_!!_#|${datarootdir}/locale,g s,@mandir@,|#_!!_#|${datarootdir}/man,g s,@DEFS@,|#_!!_#|-DPACKAGE_NAME=\\"\\" -DPACKAGE_TARNAME=\\"\\" -DPACKAGE_VERSION=\\"\\" -DPACKAGE_STRING=\\"\\" -DPACKAGE_BUGREPORT=\\"\\" -DPACKAGE=\\"latd\\" -DVERSION=\\"1.28\\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_PTY_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_MCHECK_H=1 -DHAVE_NETINET_ETHER_H=1 -DHAVE_NET_ETHERNET_H=1 -DHAVE_FEATURES_H=1 -DHAVE_OPENPTY=1 -DLOGIN_BIN=\\"/bin/login\\" -DHAVE_LOCKDEV_H=1 -DLATCP_SOCKNAME=\\"/var/run/latcp\\" -DLLOGIN_SOCKNAME=\\"/var/run/latlogin\\",g s,@ECHO_C@,|#_!!_#|,g s,@ECHO_N@,|#_!!_#|-n,g s,@ECHO_T@,|#_!!_#|,g s,@LIBS@,|#_!!_#|,g s,@build_alias@,|#_!!_#|,g s,@host_alias@,|#_!!_#|,g s,@target_alias@,|#_!!_#|,g s,@INSTALL_PROGRAM@,|#_!!_#|${INSTALL},g s,@INSTALL_SCRIPT@,|#_!!_#|${INSTALL},g s,@INSTALL_DATA@,|#_!!_#|${INSTALL} -m 644,g s,@am__isrc@,|#_!!_#|,g s,@CYGPATH_W@,|#_!!_#|echo,g s,@PACKAGE@,|#_!!_#|latd,g s,@VERSION@,|#_!!_#|1.28,g s,@ACLOCAL@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run aclocal-1.10,g s,@AUTOCONF@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run autoconf,g s,@AUTOMAKE@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run automake-1.10,g s,@AUTOHEADER@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run autoheader,g s,@MAKEINFO@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run makeinfo,g s,@install_sh@,|#_!!_#|$(SHELL) /home/christine/dev/latd/install-sh,g s,@STRIP@,|#_!!_#|,g s,@INSTALL_STRIP_PROGRAM@,|#_!!_#|$(install_sh) -c -s,g s,@mkdir_p@,|#_!!_#|/bin/mkdir -p,g s,@AWK@,|#_!!_#|mawk,g s,@SET_MAKE@,|#_!!_#|,g s,@am__leading_dot@,|#_!!_#|.,g s,@AMTAR@,|#_!!_#|${SHELL} /home/christine/dev/latd/missing --run tar,g s,@am__tar@,|#_!!_#|${AMTAR} chof - "$$tardir",g s,@am__untar@,|#_!!_#|${AMTAR} xf -,g s,@CC@,|#_!!_#|gcc,g s,@CFLAGS@,|#_!!_#|-g -O2,g s,@LDFLAGS@,|#_!!_#|,g s,@CPPFLAGS@,|#_!!_#|,g s,@ac_ct_CC@,|#_!!_#|gcc,g s,@EXEEXT@,|#_!!_#|,g s,@OBJEXT@,|#_!!_#|o,g s,@DEPDIR@,|#_!!_#|.deps,g s,@am__include@,|#_!!_#|include,g s,@am__quote@,|#_!!_#|,g s,@AMDEP_TRUE@,|#_!!_#|,g s,@AMDEP_FALSE@,|#_!!_#|#,g s,@AMDEPBACKSLASH@,|#_!!_#|\\,g s,@CCDEPMODE@,|#_!!_#|depmode=gcc3,g s,@am__fastdepCC_TRUE@,|#_!!_#|,g s,@am__fastdepCC_FALSE@,|#_!!_#|#,g s,@CXX@,|#_!!_#|g++,g s,@CXXFLAGS@,|#_!!_#|-g -O2 -DENABLE_DEFAULT_SERVICE -W,g s,@ac_ct_CXX@,|#_!!_#|g++,g s,@CXXDEPMODE@,|#_!!_#|depmode=gcc3,g s,@am__fastdepCXX_TRUE@,|#_!!_#|,g s,@am__fastdepCXX_FALSE@,|#_!!_#|#,g s,@CPP@,|#_!!_#|gcc -E,g s,@INTERFACE@,|#_!!_#|interfaces-linux.o,g s,@LIBLOCKDEV@,|#_!!_#|-llockdev,g s,@LIBUTIL@,|#_!!_#|-lutil,g s,@GREP@,|#_!!_#|/bin/grep,g s,@EGREP@,|#_!!_#|/bin/grep -E,g s,@LIBOBJS@,|#_!!_#|,g s,@LTLIBOBJS@,|#_!!_#|,g :end s/|#_!!_#|//g CEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:583: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:613: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:627: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:698: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:767: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ac_datarootdir_hack=' s&@datadir@&${datarootdir}&g s&@docdir@&${datarootdir}/doc/${PACKAGE}&g s&@infodir@&${datarootdir}/info&g s&@localedir@&${datarootdir}/locale&g s&@mandir@&${datarootdir}/man&g s&\${datarootdir}&${prefix}/share&g' ;; esac sed "/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// } :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:805: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :C) { echo "$as_me:818: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:941: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } latd/mkrpm.sh0000644000000000000000000000247411306705356010367 0ustar #!/bin/sh # # Make an RPM # echo "%_topdir `pwd`" > .rpmmacros echo "`rpm --showrc|grep \^macrofiles`:`pwd`/.rpmmacros" >.rpmrc rm -rf rpmbuild BUILD RPMS config.cache ./configure --prefix=/usr --sysconfdir=/etc # Get the package and version from the configure script eval `grep "^ PACKAGE=" configure` eval `grep "^ VERSION=" configure` ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/` export PACKAGE VERSION ARCH make clean make make DESTDIR=`pwd`/rpmbuild install strip rpmbuild/usr/sbin/* rpmbuild/usr/bin/* install -d rpmbuild/usr/doc install -d rpmbuild/etc install -d rpmbuild/usr/doc/${PACKAGE}-${VERSION} install latd.conf.sample rpmbuild/etc/latd.conf.sample install -Dm 0700 startlat.sh rpmbuild/etc/rc.d/init.d/lat install -d rpmbuild/etc/rc.d/rc3.d ln -sf ../init.d/lat rpmbuild/etc/rc.d/rc3.d/S79lat ln -sf ../init.d/lat rpmbuild/etc/rc.d/rc3.d/K79lat sed -e"s/%%PACKAGENAME%%/${PACKAGE}/g" \ -e"s/%%VERSION%%/${VERSION}/g" \ -e"s@%%PREFIX%%@/usr@g" \ < rpm.spec >${PACKAGE}.spec install README NEWS lat.html ~/rpmbuild/BUILD mkdir -p RPMS rpmbuild -bb --target ${ARCH} --buildroot `pwd`/rpmbuild --rcfile .rpmrc -v \ ${PACKAGE}.spec rm -f ${PACKAGE}.spec .rpmrc .rpmmacros latd/serversession.cc0000644000000000000000000001646611053013677012131 0ustar /****************************************************************************** (c) 2000-2007 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "server.h" #include "serversession.h" ServerSession::ServerSession(class LATConnection &p, LAT_SessionStartCmd *cmd, std::string shellcmd, uid_t uid, gid_t gid, unsigned char remid, unsigned char localid, bool clean): LATSession(p, remid, localid, clean), command(shellcmd), cmd_uid(uid), cmd_gid(gid) { max_read_size = cmd->dataslotsize; debuglog(("new server session: localid %d, remote id %d, data slot size: %d\n", localid, remid, max_read_size)); } int ServerSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) { credit = c; strcpy(remote_service, service); strcpy(remote_port, port); strcpy(remote_node, (char *)_remote_node); int status = create_session(_remote_node); if (status == 0) { status = send_login_response(); if (credit) send_issue(); } return status; } // Send the login response packet. int ServerSession::send_login_response() { unsigned char buf[1600]; unsigned char slotbuf[256]; LAT_SessionReply *reply = (LAT_SessionReply *)buf; int ptr = 0; int slotptr = 0; // ACK reply->header.cmd = LAT_CCMD_SREPLY; reply->header.num_slots = 0; reply->slot.length = 0; reply->slot.cmd = 0x0; reply->slot.local_session = 0; reply->slot.remote_session = 0; parent.send_message(buf,sizeof(LAT_Header), LATConnection::REPLY); slotbuf[slotptr++] = 0x01; // Service Class slotbuf[slotptr++] = 0x01; // Min Attention slot size slotbuf[slotptr++] = max_read_size; slotbuf[slotptr++] = 0x00; // Dest service length/name slotbuf[slotptr++] = 0x00; // Source service length/name slotbuf[slotptr++] = 0x01; // Param type 1 slotbuf[slotptr++] = 0x02; // Param Length 2 slotbuf[slotptr++] = 0x00; // Value 0 (woz 1024: 04 00) slotbuf[slotptr++] = 0x00; // slotbuf[slotptr++] = 0x04; // Param type 4 (PTY name) add_string(slotbuf, &slotptr, (unsigned char *)ptyname); slotbuf[slotptr++] = 0x00; // NUL terminated (??) add_slot(buf, ptr, 0x9f, slotbuf, slotptr); slotptr = 0; // Send a data_b slot if (credit) { slotbuf[slotptr++] = 0x26; // Flags slotbuf[slotptr++] = 0x13; // Stop output char XOFF slotbuf[slotptr++] = 0x11; // Start output char XON slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON // data_b slots count against credit // Hmm, this credit-starves queued connections // add_slot(buf, ptr, 0xaf, slotbuf, slotptr); // credit--; } slotptr = 0; // Stuff the client full of credits add_slot(buf, ptr, 0x0f, slotbuf, 0); add_slot(buf, ptr, 0x0f, slotbuf, 0); parent.queue_message(buf, ptr); return 0; } int ServerSession::create_session(unsigned char *remote_node) { int slave_fd; debuglog(("create session: local: %d, remote: %d\n", local_session, remote_session)); if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ strcpy(ptyname, ttyname(slave_fd)); state = STARTING; switch (fork()) { case 0: // Child { int fd = slave_fd; setsid(); // Set terminal characteristics struct termios tio; tcgetattr(slave_fd, &tio); tio.c_oflag |= ONLCR; tcsetattr(slave_fd, TCSANOW, &tio); ioctl(fd, TIOCSCTTY, (char *)NULL); close(master_fd); if (fd != 0) dup2(fd, 0); if (fd != 1) dup2(fd, 1); if (fd != 2) dup2(fd, 2); if (fd > 2) close (fd); close_all_fds(); // Become the requested user. struct passwd *user_pwd = getpwuid(cmd_uid); if (user_pwd) initgroups(user_pwd->pw_name, cmd_gid); setgid(cmd_gid); setuid(cmd_uid); // Get the command to run // and do it. execute_command(command.c_str()); // Argh! It returned. syslog(LOG_ERR, "Error in starting %s: %m", command.c_str()); // Exit now so that the parent will get EOF on the channel exit(-1); } case -1: // Failed syslog(LOG_ERR, "Error forking %s: %m", command.c_str()); perror("fork"); close(master_fd); close(slave_fd); return -1; default: // Parent close(slave_fd); fcntl(master_fd, F_SETFL, fcntl(master_fd, F_GETFL, 0) | O_NONBLOCK); connected = true; sleep(0); // Give login a chance to start break; } return 0; } /* Hopefully this will work for BSDs as well as Linux */ #ifdef RLIMIT_NOFILE # define LAT_RLIMIT_FILES RLIMIT_NOFILE #else # ifdef RLIMIT_OFILE # define LAT_RLIMIT_FILES RLIMIT_OFILE # endif #endif void ServerSession::close_all_fds() { struct rlimit rl; if (getrlimit(LAT_RLIMIT_FILES, &rl) == -1) rl.rlim_cur = 256; if (rl.rlim_cur == RLIM_INFINITY) rl.rlim_cur = 256; for (unsigned int i=3; i, 1996. # 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, 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 latd/localport.cc0000644000000000000000000001524011071437441011202 0ustar /****************************************************************************** (c) 2001-2008 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "utils.h" #include "session.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "localport.h" #include "server.h" #include "lat_messages.h" LocalPort::LocalPort(unsigned char *_service, unsigned char *_portname, unsigned char *_devname, unsigned char *_remnode, bool _queued, bool _clean, unsigned char *_password): service((char*)_service), portname((char*)_portname), devname((char*)_devname), remnode((char*)_remnode), password((char*)_password), queued(_queued), clean(_clean), slave_fd_open(false), connected(false) { debuglog(("New local port %s\n", devname.c_str())); } LocalPort::LocalPort(const LocalPort &p) { service = p.service; portname = p.portname; devname = p.devname; remnode = p.remnode; password = p.password; queued = p.queued; clean = p.clean; slave_fd_open = p.slave_fd_open; connected = p.connected; strcpy(ptyname, p.ptyname); } void LocalPort::init_port() { // A quick word of explanation here. // We keep the slave fd open after openpty because otherwise // the master would go away too (EOF). When the user connects to // the port we then close the slave fd so that we get EOF when she // disconnects. got that? if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) return; debuglog(("openpty: master_fd=%d, slave_fd=%d\n", master_fd, slave_fd)); // For ports with no service name (ie on DS90L servers) // send a request for the service if we are queued so that // by the time the user comes to use this port, we know about it. if (service == "") { debuglog(("Dummy service NODE: %s\n", remnode.c_str())); LATServer::Instance()->add_slave_node(remnode.c_str()); // CC ??? wot's this ?? LATServer::Instance()->send_enq(remnode.c_str()); } if (service == "") LATServer::Instance()->send_enq(remnode.c_str()); // Set terminal characteristics struct termios tio; tcgetattr(master_fd, &tio); tio.c_iflag |= IGNBRK|BRKINT; tio.c_oflag &= ~ONLCR; #ifdef OCRNL tio.c_oflag &= ~OCRNL; #endif tio.c_iflag &= ~INLCR; tio.c_iflag &= ~ICRNL; tcsetattr(master_fd, TCSANOW, &tio); strcpy(ptyname, ttyname(slave_fd)); slave_fd_open = true; // Check for /dev/lat & create it if necessary struct stat st; if (stat(LAT_DIRECTORY, &st) == -1) { mkdir(LAT_DIRECTORY, 0755); } unlink(devname.c_str()); symlink(ptyname, devname.c_str()); // Make it non-blocking so we can poll it fcntl(master_fd, F_SETFL, fcntl(master_fd, F_GETFL, 0) | O_NONBLOCK); #ifdef HAVE_OPENPTY // Set it owned by "lat" if it exists. We only do this for // /dev/pts PTYs. gid_t lat_group = LATServer::Instance()->get_lat_group(); if (lat_group) { chown(ptyname, 0, lat_group); chmod(ptyname, 0660); } #endif debuglog(("made symlink %s to %s\n", devname.c_str(), ptyname)); LATServer::Instance()->add_pty(this, master_fd); connected = false; return; } LocalPort::~LocalPort() { } void LocalPort::close_and_delete() { if (slave_fd_open) { close (slave_fd); slave_fd = -1; slave_fd_open = false; } close (master_fd); LATServer::Instance()->remove_fd(master_fd); master_fd = -1; unlink(devname.c_str()); } // Disconnect the local PTY void LocalPort::restart_pty() { debuglog(("LocalPort::restart_pty()\n")); connected = false; // Close it all down so the local side gets EOF unlink(devname.c_str()); if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); // Now open it all up again ready for a new connection init_port(); } // Remote end disconnects or EOF on local PTY void LocalPort::disconnect_session(int reason) { debuglog(("LocalPort::disconnect_session()\n")); // If the reason was some sort of error then send it to // the PTY if (reason >= 1) { const char *msg = lat_messages::session_disconnect_msg(reason); write(master_fd, msg, strlen(msg)); write(master_fd, "\n", 1); } LATServer::Instance()->set_fd_state(master_fd, true); connected = false; restart_pty(); return; } // Connect up the session bool LocalPort::connect_session() { debuglog(("localport::connect_session: master-fd = %d\n", master_fd)); return LATServer::Instance()->make_port_connection(master_fd, this, service.c_str(), remnode.c_str(), portname.c_str(), devname.c_str(), password.c_str(), queued); } void LocalPort::do_read() { debuglog(("LocalPort::do_read(), connected: %d\n", connected)); if (!connected) { if (!connect_session()) { debuglog(("LocalPort:: do_read disabling pty reads\n")); // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); close(slave_fd); slave_fd_open = false; connected = true; } else { // Service does not exist or we haven't heard of it yet. restart_pty(); } } else { debuglog(("do_read() called for LocalPort on connected socket\n")); // So stop it! LATServer::Instance()->set_fd_state(master_fd, true); } } // Show info for latcp void LocalPort::show_info(bool verbose, std::ostringstream &output) { output.setf(std::ios::left, std::ios::adjustfield); output.width(23); output << devname.c_str() << " "; output.width(15); output << service.c_str() << " "; output.width(15); output << remnode.c_str() << " "; output.width(15); output << portname.c_str() << " " << (queued?"Yes":"No ") << (clean?" 8":" ") << std::endl; } latd/circuit.cc0000644000000000000000000000267411053013677010655 0ustar /****************************************************************************** (c) 2001-2003 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "latcp.h" #include "utils.h" #include "services.h" #include "session.h" #include "localport.h" #include "connection.h" #include "circuit.h" #include "latcpcircuit.h" #include "server.h" bool Circuit::send_reply(int cmd, const char *buf, int len) { char outhead[3]; if (len == -1) len=strlen(buf)+1; outhead[0] = cmd; outhead[1] = len/256; outhead[2] = len%256; if (write(fd, outhead, 3) != 3) return false; if (write(fd, buf, len) != len) return false; return true; } latd/llogin.cc0000644000000000000000000002727512254065406010504 0ustar /****************************************************************************** (c) 2001-2013 Christine Caulfield christine.caulfield@googlemail.com 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 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. ******************************************************************************/ // LAT login Program (llogin) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lat.h" #include "latcp.h" #include "utils.h" #include "dn_endian.h" static int latcp_socket; static void make_upper(char *str); static int read_reply(int fd, int &cmd, unsigned char *&cmdbuf, int &len); static bool send_msg(int fd, int cmd, char *buf, int len); static bool open_socket(bool); static int terminal(int latfd, int, int, int, int, char *); static int do_use_port(char *service, int quit_char, int crlf, int bsdel, int lfvt, int nolock, char *logfile); static int usage(char *cmd) { printf ("Usage: llogin [