tclodbc-2.5.1/ 0002755 0001750 0000027 00000000000 11256631165 011415 5 ustar frankie tclodbc-2.5.1/doc/ 0002755 0001750 0000027 00000000000 10607402667 012164 5 ustar frankie tclodbc-2.5.1/doc/utilref.htm 0000644 0001750 0000027 00000015661 10607402667 014357 0 ustar frankie
Tclodbc 2.1 Utility Procedure Reference
ColTypes
DumpSchema
DumpTable
FieldFormat
Justification
LoadSchema
LoadSql
LoadTable
SqlDelete
SqlInsert
SqlSelect
SqlShell
SqlTimeToTclTime
SqlUpdate
TableDef
TableDefToSql
TclTimeToSqlTime
TkTableInit
TkTableRead
Return list of column types for given columns. This list can
be used as statement argument specification.
Parameters
- db : database object
- table : table name
- columns : column names
Dumps whole database schema to a named file.
Parameters
- db : database object name
- filename : filename
Dump the contents of a named table to a file.
The filename may be given explicitly, but if not,
a default name of the form $tablename.d is used.
The .d file format is the following:
1st line contains the data column names.
from 2rd line forward, the data in tcl list format.
Parameters
- db : database object name
- table : database table name
- ?filename? : filename, optional
Formats given list of fields for output
Parameters
- fielddef : field defininition list, {coltype ?fieldlenght?}
- ?data? : field data, if empty, return a delimiter row
Returns default justification of a column, right, left or center
Parameters
- coltype : column type description, as returned by "stmt columns type precision scale displaysize"
Loads whole database schema from a named file.
Parameters
- db : database object name
- filename : filename
- verbose : puts lines before executing, useful when debugging sql
Loads sql from a file to a database.
The input file should contain one sql statement per line.
Parameters
- db : database object name
- filename : filename
Loads the contents of a named table from a file.
The filename may be given explicitly, but if not,
a default name of the form $tablename.d is used.
The file format is assumed to be of the form generated
by DumpData procedure, described above.
Parameters
- db : database object name
- table : database table name
- ?filename? : filename, optional
Create command for creating a delete statement for given table
and columns.
Parameters
- db : database object
- stmt : statement name
- table : table name
- keycols : key column names
- ?mode? : mode, default is eval
Return command for creating a insert statement for given table
and columns. Mode determines the action for the command. Useful
modes are e.g. eval, return and puts.
Parameters
- db : database object
- stmt : statement name
- table : table name
- columns : column names
- ?mode? : mode, default is eval
Return command for creating a select statement for given table
and columns. Mode determines the action for the command. Useful
modes are e.g. eval, return and puts.
Parameters
- db : database object
- stmt : statement name
- table : table name
- datacols : data column names
- keycols : key column names
- ?mode? : mode, default is eval
Very simple sql shell. Execute given statements and return data
in columnar format.
Parameters
- db : db connection object
Returns tcl time in seconds
Parameters
- sqltime : sql timestamp of the form YYYY-MM-DD ?HH:MM:SS?
Return command for creating a update statement for given table
and columns. Mode determines the action for the command. Useful
modes are e.g. eval, return and puts.
Parameters
- db : database object
- stmt : statement name
- table : table name
- datacols : data column names
- keycols : key column names
- ?mode? : mode, default is eval
Return the definition of a named database table.
The definition consist of a list {tablename coldefs indexdefs}
Parameters
- db : database object name
- table : database table name
Transforms a TableDef as returned by procedure TableDef to a list
of driver specific sql data definition statements.
Parameters
- db : database object name
- tabledef : database table name
Returns sql timestamp of the form YYYY-MM-DD HH:MM:SS
Parameters
- tcltime : tcl time as returned by [clock seconds]
Initialize tk table widget for a given result set
Parameters
- table : tktable widget name
- stmt : the name of a statement object
Display whole result set in a tk table widget. The statement object
should be executed before calling this
Parameters
- stmt : the name of a statement object
- table : tktable widget name
tclodbc-2.5.1/doc/reference.htm 0000644 0001750 0000027 00000063331 10607402667 014640 0 ustar frankie
Tclodbc v. 2.3 Reference
Contents
Installing and Loading the Package
The extension is actually a shared function library. The actual form
of such library depends of the used operating system. For example, in windows
systems these libraries have the extension .dll in their name. The tclodbc
library is thus names tclodbc.dll under windows.
The extension is installed as a tcl package. The installation is most
easily done with an included installation script, setup.tcl.
After installation the extension is loaded simply by command:
package require tclodbc
This command adds the command database to the tcl command
interpreter (or actually loads the package on demand). Command database
is used for creating database connection objects as well as for
configuring the system data sources.
Quick start for windows users
Unzip the distribution file to an arbitrary directory. With pkunzip,
switch -d is required to create subdirectories. After that, run the installation
script.
c:\temp>pkunzip -d tclodbc.zip
c:\temp>tclsh setup.tcl
Installation successful.
Creating a Database Connection
database connect id datasource ?userid? ?password?
or
database connect id connectionstring
Create a database object identified by id. The object is connected to
a ODBC data source. The first form of the command is applied to a datasource
name, with userid and password where neccessary. The second form uses a
ODBC connection string of the form "Attribute1=Value1;Attribute2=Value2".
The command returns the id, which is used to refer to the database object.
Example:
% database connect db employeebase sysadm xxxxxx
db
Example 2:
% database connect db "DRIVER=Microsoft Paradox Driver (*.db);DBQ=C:\\db"
db
This is the default command. The keyword "connect" can be
omitted. It should be used when it is possible that given id may be one
of the other command keywords.
database configure operation driver attributes
Configure ODBC datasources. A datasource may be added to the system,
reconfigured, or removed. First argument defines the operation from the
set:
- add_dsn - add datasource for current user
- config_dsn - config datasource
- remove_dsn - remove datasource
- add_sys_dsn - add system datasource, visible for all users
- config_sys_dsn - configure system datasource
- remove_sys_dsn - remove system datasource
Driver argument specifies the driver to be used and the attributes argument
a list of driver specific attribute name and value pairs. Usually at least
the data source name (DSN) parameter should be provided, the rest are driver
dependent.
This form of database command does not create a connection to the database,
even if one is added. Connection is created with some of the commands described
above.
Example:
% set driver "Microsoft Access Driver (*.mdb)"
% set attributes [list "DSN=mydsn" "DBQ=c:\mydb.mdb"
"FIL=MS Access"]
% database -configure add_dsn $driver $attributes
OK
database datasources
database drivers
Returns a list of currently configured ODBC drivers in pairs {{driver
name} {list of driver attributes}}
Database Object Interface
Database object is a dynamically allocated object, created by the database
command. The object provides the following methods. The methods are called
as commands after the database object identifier.
<any valid SQL-clause> ?argtypedefs? ?args?
Almost all necessary functionality can be provided through this simple
syntax. The given SQL-clause is executed in the DBMS, and the result, if
any, is returned in a tcl list.
If the command returns a single column result set, the returned string
is a straightforward list or an empty string, if nothing is found. If the
command returns a multiple column result set, a tcl list of lists is returned,
where a sublist represents a single row of the result. If the SQL-clause
does not return a result set (as with update, insert or delete clause),
the command returns an integer value giving the amount of rows touched.
SQL-arguments may be given after the SQL-clause, while the argument
positions are marked with '?' in the SQL- clause. This mechanism is more
useful with precompiled statements and explained with statement object
interface in detail. A simpler mechanism of argument substitution is the
natural way of using tcl variables for substituting values straight to
the SQL-clause.
Examples:
% database db employeebase sysadm xxxxxx
db
% set ids [db "select id from employees where salary < 1000"]
{222 333 444}
% set id [lindex $ids 0]
222
% db "select firstname, surname from employees, where id = $id"
{{Jonathan Clarke}}
% db "update employees set salary = 2000 where id = $id"
1
disconnect
set option value
Set command is used for setting various connection-specific attributes.
Currently supported options and their valid values are listed in following
table. Check some odbc reference for detailed description of the different
options.
Option |
Values |
autocommit |
boolean (0/1, on/off) |
concurrency |
readonly
lock
values
rowver |
maxrows |
numeric value |
timeout |
numeric value |
maxlength |
numeric value |
multisets |
boolean |
rowsetsize |
numeric value |
cursortype |
static
dynamic
forwardonly
keysetdriven |
encoding
(requires tcl 8.1) |
any valid encoding name |
noscan |
boolean (0/1, on/off) |
In tcl 8.1 strings are stored in unicode form, but ODBC API uses only
old-fashioned 8-bit character strings. Therefore it is possible to set
an encoding to a database object. This encoding is used when transforming
strings from and to the database. While encoding is a connection specific
value, it is even possible to have simultaneous connection to databases
with different encodings, and transfer data correctly from one to another.
Encoding defaults to system encoding, which is suitable in most cases.
For example: An ODBC-connection is by default in an autocommit-mode.
This means that any statement is commited at once, thus leaving no records
locked. If special transaction handling should be used, the connection
may be set in non-autocommit mode. After this the commit and rollback methods
are used for transaction handling.
Examples:
% database db artbase sysadm xxxxxx
db
% db set autocommit off
OK
% db "update article set groupid=5 where artid > 1000"
12
% db rollback
OK
% db "update article set groupid=6 where artid > 1000"
12
% db commit
OK
get option
Get command is used for querying current value of various connection-specific
attributes. Theck the table above for list of supported options.
commit
With connection in autocommit mode, method commit commits the current
transaction. See examples in autocommit section.
rollback
With connection in autocommit mode, method rollback cancels the current
transaction. See examples in autocommit section.
tables ?matchpattern?
Method tables lists all tables in the database which name matches argument.
Note, that match is determined using sql syntax, with % and _ as wildcards.
With no argument, all tables are listed. The result is a list
of kvintuples: {TABLE_QUALIFIER TABLE_OWNER TABLE_NAME TABLE_TYPE REMARKS}
columns ?tablename?
Method columns lists the columns in the database, or the columns in
the specified table, if one given. The result is a list of: {TABLE_QUALIFIER
TABLE_OWNER TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME PRECISION LENGTH
SCALE RADIX NULLABLE REMARKS}
indexes tablename
Method indexes lists the indexes of a specified table. The result is
a list of: {TABLE_QUALIFIER TABLE_OWNER TABLE_NAME NON_UNIQUE INDEX_QUALIFIER
INDEX_NAME TYPE SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY PAGES FILTER_CONDITION}
typeinfo typeid
Method typeinfo returns driver specific information of given sql type.
The information is a tuple of: {TYPE_NAME DATA_TYPE PRECISION LITERAL_PREFIX LITERAL_SUFFIX
CREATE_PARAMS NULLABLE CASE_SENSITIVE SEARCHABLE UNSIGNED_ATTRIBUTE MONEY AUTO_INCREMENT LOCAL_TYPE_NAME
MINIMUM_SCALE MAXIMUM_SCALE}
statement id <sql clause>|tables|columns|typeinfo ?argtypedefs?
Method statement creates new statement objects of one of the three types:
sql query, table query or column query, depending of the last argument:
valid sql-clause, or an identifier 'tables' or 'columns'.
Statements are similar to queries executed directly on a database object,
but when created, statement it is merely precompiled for furher use. This
is useful for efficiency reasons, should the same query be executed several
times. Precompiled statements may be used with sql argumens.
A statement is given a textual id similar to database object. Further,
the statement object is called simply by its id, following possible query
arguments. The command returns the id
Tclodbc tries automatically determine proper argument types for each
argument. Some drivers do not support this function, and therefore the
user may explicitly define the correct argument types.
The syntax of an argument type definition is the following:
?type? ?scale? ?precision?
The type cast is interpreted from the left, so that e.g. the scale and
precision may be left out, if not needed.
Currently recognised sql type names are standard types:
- CHAR
- NUMERIC
- DECIMAL
- INTEGER
- SMALLINT
- FLOAT
- REAL
- DOUBLE
- VARCHAR
and the extended types:
- DATE
- TIME
- TIMESTAMP
- LONGVARCHAR
- BINARY
- VARBINARY
- LONGVARBINARY
- BIGINT
- TINYINT
- BIT
Also datatypes standard numerical counterparts may be used instead of
the string names.
Examples:
% db statement s "select fullname from article where id=132"
s
% s
{FullName132}
% db statement s2 "select fullname from article where id1=?"
INTEGER
s2
% s2 132
{FullName132}
eval proc <sql clause> ?argtypedefs? ?args?
Method eval first executes the given sql clause, and then evaluates
the given tcl procedure for each row in the result set. The argument count
of the procedure must match the column count in the query. Only single
row is read in the memory at a time this saving memory compared to e.g:
foreach i [db "select..."] {...}
This command is particulary useful, when large tables are to be iterated
once. In this case we do not neccessarily need a separate statement object,
but also do not want to read the whole table to memory at one time.
Example:
% proc output {name value} {puts $name $value}
% db eval output "select name, value from table1"
{{ab 123}{cd 456}}
read arrayspec <sql clause> ?argtypedefs? ?args?
Method read reads data from the database to a tcl array or arrays. The
first data columnn is used as index for the array, and the rest of the
columns are stored as to the array. The basic case is a query that results
two columns, first of which is a key of a table, and the next a description
of some sort for the key value.
The array may be specified in two ways. The first way is to specify
a list of array names which are used for array names for each data column.
Thus, the count of given names must be equal to the count of returned data
columns (minus the first column containing the key). (Example 1)
The second way is to specify only a single arrayname, which is used
as two-dimensional array. The array index in this case is constructed from
the key column value and column label, separated by comma. (Example 2)
It should be noted, that it is not recommended to read large tables
to arrays for two reasons. First, if the data is subject to changes in
multi-user database, the changes do not reflect to the data already read
in the array. The other thing is memory consumption. Is the table is large,
it also consumes pretty much memory if read in at once. It is recommended
to use either database eval command, or separate statement object to do
the iteration of large amounts of data. On the other hand, this command
provides a very simple syntax for reading relatively stable name-value
parameter pairs to tcl array, from which they are easily referenced.
Example 1:
% db read {name description} "select id, name, description from
table2"
OK
% puts $name(123)
Name123
% puts $description(123)
Description123
Example 2:
% db read table2 "select id, name, description from table2"
OK
% puts $table2(123,name)
Name123
% puts $table2(123,description)
Description123
Statement Object Interface
Statement object is a dynamically allocated object, created by the statement
method of a database object command. The object provides the following
methods. The methods are called as commands after the statement object
identifier.
run ?args?
Command run executes the statement and returns the whole result set
immediately. The command may be followed with the list of sql arguments,
if the statement expects them.
Empty argument is interpreted as null value. Notice that the arguments
are given as a list of arguments. Therefore an argument given as {} is
a empty list of arguments, while {{}} is a list of one argument, which
is null. Safest way to create argument lists is through the tcl list command.
This is the default command. The keyword "run" can be omitted.
It should be used when it is possible that given argument value may be
one of the other command keywords.
Example:
% database db employeebase sysadm xxxxxx
db
% db statement readall "select * from employees"
readall
% readall
{{xx yy zz} {aa bb cc} {rr tt yy}}
% db statement read_salary "select salary from employees where id
= ?"
read_salary
% read_salary 222
2000
% db statement update_salary "update employees set salary = ? where
id = ?"
update_salary
% update_salary {3000 222}
1
execute ?args?
Method execute executes the given statement, but does not return the
result set. If the statement returns a result set, rows may be read one
by one with method fetch.
moreresults
The result of SQL queries is a list of list of rows when the database
has been configure with multisets true.
Example:
db set multisets 1
db statement ssss "XXXX"
puts [ssss execute]
set i 0
while {1} {
puts "---- RESULTS $i"
while {[set row [ssss fetch]] != {}} {
puts $row
}
if {![ssss moreresults]} {
break
}
incr i
}
fetch ?arrayName? ?columnNames?
Method fetch is used for reading one row from the result set at a time
after executing it by method execute. Sometimes, if the result set is large,
it is not convenient to load it to memory at once, but rather traverse
thru it one record at a time e.g. making neccessary output or update one
by one.
The first form without arrayName returns the row data, or an
empty string when there is nothing more to read.
Example:
% db statement emp_data "select * from employees"
emp_data
% emp_data execute
OK
% while {[set row [emp_data fetch]] != {}} {puts [lindex $row 5]}
2000
3000
4000
%
The other form reads the data to an array. Statement column labels or,
if given, defined column names are used as array indices. If the column
labels are explicitly defined, their count must match the number of actual
data columns.
This provides a convenient way for storing the data straight to named
array instead of indexing a straight list. Here the command returns a boolean
value indicating successful fetch or do data condition.
Example (same result as above, with substantially more readable code):
% db statement emp_data "select * from employees"
emp_data
% emp_data execute
OK
% while {[read_salary fetch row]} {puts $row(Salary}}
2000
3000
4000
%
rowcount
Method rowcount returns the number of rows affected by last execution
of insert, update or delete statement. Certain drivers support also
getting the count of rows in open result set after select command,
but this is not generally applicable.
columns ?attribute attribute ...?
Method columns returns a list of statement columns attributes. ODBC
supports various column attributes. The returned attributes are specified
with arguments. The default attribute, in none given, is column label.
Currently supported attributes are:
- label - column label
- name - column name in the original table, if available
- displaysize - the maximum string length of the column data
- type - standard numeric sql type
- typename - db specific type name string
- precision - the precision of the column, if applicable
- scale - the scale of the column, if applicable
- nullable - 1 if the column is nullable
- updatable - 1 if the column is updatable
- tablename - source table of the column, if available
- qualifiername - qualifier name of the table, if available
- owner - owner name of the table, if available
set option value
Set command is used for setting statement-specific attributes. Currently
supported options and their valid values are listed in following table.
Check some odbc reference for detailed description of the different options.
Option |
Values |
concurrency |
readonly
lock
values
rowver |
maxrows |
numeric value |
timeout |
numeric value |
maxlength |
numeric value |
rowsetsize |
numeric value |
cursortype |
static
dynamic
forwardonly
keysetdriven |
noscan |
boolean (0/1, on/off) |
get option
Get command is used for querying current attribute values. Theck the
table above for list of supported options.
drop
eval proc ?args?
read arrayspec ?args?
Changes from Previous Versions
v. 1.5
Autocommit on|off command is replaced with more general set and get
commands, which are used for setting all kinds of database connection object
properties. Old syntax is still supported.
Some drivers returned last non-null values in a column having a null
value. Bug was corrected.
v. 1.6
Argument type definition was moved from statement execution to statement
object creation. Now tclodbc tries to determine the argument types automatically,
if the driver supports it, but if it does not, the user has the option
of giving types explicitly. The old syntax is still supported, too.
v. 1.7
The sources completely rewritten to allow conditional compling for both
tcl 7.6 and 8.0. Under tcl 7.6 tcl-objects are implemented using reference
counted DStrings instead of Tcl_Obj's. The performance in some situations
may not be exactly the same as with tcl 8.0, but it works anyway. The command
interface has no changes since the previous version.
v. 2.0
Added couple of configuration options to database and statement set
and get commands. Added arrayName option to the statement fetch command.
Removed global private interpreter to ensure thread safety, which is nice
with thread safe tcl 8.1 interpreter.
Added read an eval command to both database and statement
objects.
Unicode support is added with tcl 8.1. Now it is possible to specify
encoding to a database connection. UTF-8 is used as string internal representation,
but any strings passed from and to an odbc connection are encoded as specified.
More details in tcl 8.1 documentation.
Distribution version now includes compiled dll's for tcl 7.6, 8.0 and
8.1, all in one zipfile. Installation to a tcl package automated with a
simple installation script.
Corrected bug related to large column handling. Now should be able to
handle properly even large variable length binary columns. There remains
still problems with some drivers.
v. 2.1
Configuration option noscan for database and statement objects. This is
particularily useful when storing tcl strings as string literals.
Added typeinfo command for database object
Added rowcount command for statement object
Some bugs are fixed, most of them relating to variable length
column handling.
Removed old syntax:
Syntax: db autocommit on/off was removed. Correct syntax for the same thing
is:
db set autocommit on/off
Also, statement object argument typecast was finally removed from
statement execution time. Correct syntax is to define statement arguments
at statement object creation time.
v. 2.2
Binary column handling changed. In earlier versions binary data was handled in hexadecimal
form if the driver supported binary-character conversion. Now binary data is handled in native
binary form. Example code of binary data handling is added to samples.
Bugfix in long column handling: handle also SQL_NO_TOTAL return value from SqlGetData().
Corrected a misspelling in option name maxlength. The earlier misspelled form
maxlenght is still supported for compatibility reasons.
v. 2.3
Return value from update/insert/delete statement changed. Earlier returned always "OK" for
successful execution. Now returns the count of rows updated/inserted/deleted. If now rows were
touched, returns 0, which normally means an error.
Bugfix in setting database options. Some options always raised an error:
unknown encoding ..."
Now works also with MS Access MEMO fields. Older version returns some carbage in memo text
data after actul value.
tclodbc-2.5.1/doc/samples.htm 0000644 0001750 0000027 00000004736 10607402667 014352 0 ustar frankie
Utilities and sample programs
While working with tclodbc I
have created numerous small utility procedures and programs for
different purposes. These programs usually are quick non-general
hacks, as scripts often tend to be. Thus most of them do not have any
value as general utilities.
However, I have had some requests
for more comprehesive examples of tclodbc programming. For this
purpose I have included in tclodbc 2.1 some utility programs as well
as some example programs that take use of them. The samples include
e.g. creating, dumping and loading of a simple MS Access database, some
date/time conversion functions and sql code generating utilities.
Also, an of example of using tkTable widget with tclodbc is also
provided.
Important note from author
tclodbc as whole is provided on an "as is" basis, without any warranties
whatsoever. This concerns the utility and sample programs as well as
the extension itself. Utility programs are especially small and
simple, and most propaby won’t work with every platform or dbms.
Therefore I am not very interested in receiving e-mail about bugs or
fixes in the utility programs. If they are of help to the users,
good, if they are not, that’s how it is. Anyway, they are naturally written in
tcl and may provide some insight for using tclodbc and also a good template
for writing your own utilities. The bug reports of the actual extension
are naturally still welcome and very much appreciated.
Sample programs
The sample programs are copied in directory samples below the tclodbc installation
directory. Most of the programs are best run in plain tclsh, except
tktable.tcl, which should be run in wish. The sample programs include
basic documentation in the form of tcl comments.
Utility procedures
Utility procedures are
included in several tcl files that are copied to tclodbc installation
directory. The procedures are sourced in namespace ::tclodbc when
running setup.tcl. So the utilities are normally called with
namespace suffix. Example:
tclodbc::SqlShell db
Because of the use of namespaces in packaging, tcl 8.0 is required
with the utilities
The utilities are documented in some level in accompanying utilref.htm
Roy Nurmi
tclodbc-2.5.1/README.cygwin 0000644 0001750 0000027 00000003502 10607402667 013574 0 ustar frankie To use cygwin for building TEA extensions, there are a couple of things
you will need to do.
USING MICROSOFT VISUAL C++:
1. Make sure you have a working Visual C++ (version 5.0 or later) compiler.
2. Download and install the free Cygnus Cywgin full tools package from
http://sources.redhat.com/cygwin/
3. Ensure your environment variable "MAKE_MODE" has the value "unix"
This will set up the "make" program to operate in a more sane manner.
4. Run vcvars32.bat. You must do this every time you wish to
perform a build of an extension. It is strongly recommended
that you modify your sytem environment so that you don't have to
run vcvars32.bat all the time. If you look in the vcvars32.bat
file you will see what system environment variables need to be
set in order to make this work.
5. If you are authoring a TEA extension, you will also want the GNU
autoconf package. This can be obtained from http://www.gnu.org
Autoconf version 2.13 or later is required.
USING CYGWIN (gcc)
1. At this time, cygwin gcc is not supported due to compatibility issues
that have not been resolved. Use mingw gcc instead.
USING MINGW32 (gcc)
1. Download and install the free Cygnus Cywgin full tools package from
http://sources.redhat.com/cygwin/
2. Download and install the mingw compiler:
The 1.1 version you can find at mingw's site will NOT work with Tcl,
you'd better use:
ftp://ftp.nanotech.wisc.edu/pub/khan/gnu-win32/mingw32/snapshots/gcc-2.95.2-1/
Files: mingw-msvcrt-20000203.zip
binutils-19990818-1-msvcrt.zip
gcc-2.95.2-1-msvcrt.zip
Extract the contents of these zip files into /usr/local/mingw and
place /usr/local/mingw/bin at the front of your PATH env var.
3. Download and install Tcl
4. To compile the sample extension:
CC=gcc ./configure
make
make install
tclodbc-2.5.1/aclocal.m4 0000644 0001750 0000027 00000001176 11010624415 013244 0 ustar frankie # generated automatically by aclocal 1.10 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_include([tclconfig/tcl.m4])
m4_include([ODBC.m4])
tclodbc-2.5.1/README 0000644 0001750 0000027 00000013353 10607402667 012302 0 ustar frankie README
This is just a repackaged version of the tclodbc package done by:
Roy Nurmi (main author)
Roy.Nurmi@iki.fi
Tom Poindexter (Unix port)
tpoindex@nyx.net
Rob Savoye (Unix port)
rob@cygnus.com
The current configure and Makefile.in were updated to the TEA 2002
specification by Jeff Hobbs.
Please see the license.txt file for more information about the licensing of
this package.
SUPPORTED
=========
Supported (tested) platforms:
- Visual C++ 6.0 on Windows NT
- So far I have not done any Unix testing...
BINARY DISTRIBUTION
===================
Windows NT
----------
For Windows NT, you will probably install the included binary
distribution. To do this, just type the following (tclsh may be
tclsh82 or something similar):
c:\temp> tclsh setup.tcl
Installation successful.
The resulting installation may be different than one done with the
Makefile. The setup.tcl file does not know about --prefix and
--exec-prefix, so it installs into the DLL into the standard Tcl package
directory.
Unix
----
There is no Unix binary distribution.
BUILDING
========
Windows NT
----------
Follow the steps from the Unix section. If you want to rebuild the package
without cygwin under Windows NT, the included tclodbc.mak can be used to
build the library. You will have to adjust the project to work properly on
your configuration.
Unix
----
Under Unix you will have to use configure to create a Makefile, which will
build and install the package. Specify the same --prefix and --exec-prefix
that you used to build Tcl. You may also have to specify --with-tcl to
point to the directory that contains the tclConfig.sh file.
>./configure --prefix=/usr/local/tcl --exec-prefix=/usr/local/tcl/bin
>make
>make install
If your ODBC include files and libraries can not be found
automatically, you may want to use the following two options:
--with-odbcinclude, directory where ODBC headers are
--with-odbclibrary, directory where ODBC libraries are
USING THE PACKAGE
=================
The extension is installed as a tcl package. After installation the
extension is loaded simply by command:
package require tclodbc
This command adds the command "database" to the tcl command
interpreter (or actually loads the package on demand). Command
"database" is used for creating database connection objects as
well as for configuring the system data sources.
####################
The original README.unix follows here:
Tclodbc on Unix
I have made a preliminary configure and Makefile for Tclodbc.
The only IODBC drivers I have were the free ones. The one I use is now
included in the PostgreSQL 6.4 release. This was developed under
RedHat Linux 5.1, using G++ (cygnus-2.91.47).
--with-tclinclude directory where tcl headers are
--with-tclconfig directory containing tcl configuration (tclConfig.sh)
--with-tkinclude directory where tk headers are
--with-tkconfig directory containing tk configuration (tkConfig.sh)
--with-odbcinclude directory where ODBc headers are
--with-odbclibrary directory where ODBC headers are
Also, configure expects to find a Tcl installation in the paths specified by
--prefix= and --exec-prefix=. You should specify the same directories as
when you configured Tcl. Chances are you won't need to specify any
configuration options. An example where the ODBC files are in a non
standard place is:
mkdir obj
cd obj
/usr/local/src/tclodbc/configure \
--with-odbcinclude=/usr/local/include/iodbc \
--with-odbclibrary=/usr/local/lib/iodbc
You may also need to tweak the Makefile to set the correct C++
compiler option flag to build a shared library. This uses the flags as
determined by Tcl to build a shared library by default. As long as you
use the same compiler to build Tcl and Tclodbc, everything should work
fine.
'make install' copies the library to your Tcl library, makes a directory for
Tclodbc with version number, and builds a pkgIndex.tcl file.
If all goes right, all you need to use it is:
$ tclsh8.0 (or cygtclsh8.0 when using cygwin)
% package require Tclodbc
2.1
% database datasources
{....
Rob Savoye
rob@cygnus.com
#################
Tclodbc on Unix
I have made a preliminary configure and Makefile for Tclodbc.
The only ODBC drivers to which I have access on Unix is Redbrick's, so I've
left the ODBC configuration fairly simple. The configure script expects:
--with-odbc-directory=DIR
--with-odbc-library=LIBSPEC
The Makefile uses the ODBC directory to prefix $ODBC_DIR/include and
$ODBC_DIR/lib to find include and libraries. You may have to tweak the
Makefile after configuration if your ODBC installation is different.
The ODBC library specification is just the library names you would use to
link, eg. '-lodbc'
Also, configure expects to find a Tcl installation in the paths specified by
--prefix= and --exec-prefix=. You should specify the same directories as
when you configured Tcl.
Example:
./configure --prefix=/home/tpoindex --with-odbc-directory=/redbrick \
--with-odbc-library=-lrbodbc
Configure uses the Autoconf macros to find your C++ compiler.
'make'
The Makefile will build a shared library for Tclodbc. You may also need to
tweak the Makefile to set the correct C++ compiler option flag to build a
shared library. See the define for TCL_SHLIB_LD.
'make install' copies the library to your Tcl library, makes a directory for
Tclodbc with version number, and builds a pkgIndex.tcl file.
If all goes right, all you need to use it is:
$ tclsh8.0
% package require Tclodbc
1.2
% database datasources
{....
My development environment is:
Dec Unix (unam -a: OSF1 xxx.xxx.com V4.0 564 alpha)
Redbrick ODBC driver for Dec (version: V5.0.12)
Dec C++ compiler (cxx -V: DEC C++ V5.3-004 on Digital UNIX (Alpha))
Tom Poindexter
tpoindex@nyx.net
tclodbc-2.5.1/samples/ 0002755 0001750 0000027 00000000000 10607402667 013063 5 ustar frankie tclodbc-2.5.1/samples/clear.bat 0000644 0001750 0000027 00000000061 10607402667 014634 0 ustar frankie del testdb.*
del *.d
del *.def
del *.sql
tclodbc-2.5.1/samples/loaddata.tcl 0000644 0001750 0000027 00000001242 10607402667 015335 0 ustar frankie ####################################################################
#
# loaddata.tcl
#
# Loads data from every table of the database from a file.
#
# Uses utility procedure LoadTable in file datautil.tcl
#
# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl
####################################################################
#
# Execution starts here
#
set tables [db tables]
foreach i $tables {
# exclude system tables
if {![string compare [lindex $i 3] TABLE]} {
# delete old data
db "DELETE FROM Table1"
# load data from file
tclodbc::LoadTable db [lindex $i 2]
}
}
tclodbc-2.5.1/samples/populate.tcl 0000644 0001750 0000027 00000005064 10607402667 015423 0 ustar frankie ####################################################################
#
# populate.tcl
#
# This procedure populates some tables in current db with arbitrary
# values.
#
# Create the db, if not yet created, and open connection.
set dir [file dirname [info script]]
source $dir/createdb.tcl
####################################################################
#
# subprocedures
#
# generate pseudorandom data for table1, unique index given as parameter
proc Table1Row IntData {
# create some hexadecimal string to use as string data
set CharData [format %X [expr {$IntData * 123456}]]
# some datedata, using utility procedure TclTimeToSqlTime in utilproc.tcl
set DateData [lindex [tclodbc::TclTimeToSqlTime \
[expr {[clock seconds] + ($IntData * 86400)}]] 0]
return [list $IntData $CharData $DateData]
}
####################################################################
#
# Delete data from all tables to avoid duplicates in indices
#
db "DELETE FROM Table1"
####################################################################
#
# Table1 using plain sql
#
puts "Generating data to tables..."
set starttime [clock clicks]
set rowcount 0
# insert 500 rows
for {set i 1} {$i <= 500} {incr i} {
# generate some data
set row [Table1Row $i]
set CharData [lindex $row 1]
set DateData [lindex $row 2]
# insert data, note odbc extended escape sequence for date value
db "INSERT INTO TABLE1 (IntData, CharData, DateData) VALUES ($i, '$CharData', \{d '$DateData'\})"
incr rowcount
}
# output statistics
set usedtime [expr {[clock clicks] - $starttime}]
puts "Table1: $rowcount rows in $usedtime clicks, [format %.2f [expr $usedtime.0 / $rowcount]] clicks per row using plain sql"
####################################################################
#
# Table1 using statement object
#
# Create a statement object.
# Note the argument type definitions after the sql clause.
db statement s1 "INSERT INTO TABLE1 (IntData, CharData, DateData) VALUES (?,?,?)" [list {INTEGER 0 10} {CHAR 20}]
set starttime [clock clicks]
set rowcount 0
# insert 500 rows more
for {} {$i <= 1000} {incr i} {
# generate some data
set row [Table1Row $i]
# execute insert statement
s1 $row
incr rowcount
}
# output statistics
set usedtime [expr {[clock clicks] - $starttime}]
puts "Table1: $rowcount rows in $usedtime clicks, [format %.2f [expr $usedtime.0 / $rowcount]] clicks per row using statement object"
# drop statement when no longer used
s1 drop
tclodbc-2.5.1/samples/dumpdata.tcl 0000644 0001750 0000027 00000001302 10607402667 015360 0 ustar frankie ####################################################################
#
# dumpdata.tcl
#
# Dump data from every table of the database to a file.
#
# Uses utility procedure DumpTable in file datautil.tcl
#
# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl
# Populate some data to tables
if {[db "select count(*) from table1"] == 0} {source $dir/populate.tcl}
####################################################################
#
# Execution starts here
#
set tables [db tables]
foreach i $tables {
# exclude system tables
if {![string compare [lindex $i 3] TABLE]} {
tclodbc::DumpTable db [lindex $i 2]
}
}
tclodbc-2.5.1/samples/createdb.tcl 0000644 0001750 0000027 00000004464 10607402667 015346 0 ustar frankie ####################################################################
#
# createdb.tcl
#
# This procedure creates a new Access database to current directory,
# sets it as user datasource named testdb,
# and populates it with some tables.
#
package require tclodbc
####################################################################
#
# set global variables
#
set driver "Microsoft Access Driver (*.mdb)"
set dbfile testdb.mdb
set dsn TESTDB
####################################################################
#
# subprocedures
#
proc create_datasource {driver dbfile dsn} {
if {![file exists $dbfile]} {
database configure config_dsn $driver \
[list "CREATE_DB=\"$dbfile\" General"]
}
database configure add_dsn $driver [list "DSN=$dsn" "DBQ=$dbfile"]
}
proc remove_datasource {driver dsn} {
database configure remove_dsn $driver "DSN=$dsn"
}
proc create_tables db {
$db "CREATE TABLE Table1 (
IntData INTEGER,
CharData CHAR (20),
DateData DATE)"
$db "CREATE UNIQUE INDEX Table1_Ix1 ON Table1 (IntData)"
$db "CREATE INDEX Table1_Ix2 ON Table1 (CharData, DateData)"
}
####################################################################
#
# Execution starts here
#
# First we try to open connection to the datasource.
# On error we try to determine what went wrong and act
# accordingly.
#
if {[catch {database db $dsn} err] == 1} {
if {![string compare [lindex $err 0] IM002]} {
# datasource not found, create new
create_datasource $driver $dbfile $dsn
database db $dsn
create_tables db
} elseif {![string compare [lindex $err 0] S1000]} {
# database file deleted, but datasource not, create new
remove_datasource $driver $dsn
create_datasource $driver $dbfile $dsn
database db $dsn
create_tables db
} else {
# other error
error [lindex $err 2]
}
}
# At this point we should have a datasource named $dsn
# in the system with some test tables created.
# For proper cleanup we should call db disconnect here to
# close connection to the datasource. However, now we leave
# the db connected, because other test programs source
# this file to open the connection, and assume that a database
# object db is available after a succesfull call.
# Commented out on purpose:
# db disconnect
tclodbc-2.5.1/samples/tktable.tcl 0000644 0001750 0000027 00000001652 10607402667 015217 0 ustar frankie ####################################################################
#
# tktable.tcl
#
# View data in a table in tktable widget.
#
# Uses utility procedures TkTableInit TkTableRead in utilproc.tcl
#
# This file should be executed in wish shell, having tktable widget
# installed
#
# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl
# Populate some data to tables
if {[db "select count(*) from table1"] == 0} {source $dir/populate.tcl}
####################################################################
#
# Execution starts here
#
package require Tktable
table .t -variable t -yscrollcommand {.scroll set} -height 10
scrollbar .scroll -command {.t yview}
pack .t .scroll -side left -fill y
wm resizable . 0 1
db statement stmt "select * from Table1 where IntData < 100"
stmt execute
tclodbc::TkTableInit .t stmt
tclodbc::TkTableRead .t stmt
tclodbc-2.5.1/samples/dumpdef.tcl 0000644 0001750 0000027 00000000730 10607402667 015211 0 ustar frankie ####################################################################
#
# dumpdef.tcl
#
# Dump data definitions from every table of the database to a file.
#
# Uses utility procedure DumpSchema in file datautil.tcl
#
# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl
####################################################################
#
# Execution starts here
#
tclodbc::DumpSchema db db.def
tclodbc-2.5.1/samples/connect.tcl 0000644 0001750 0000027 00000002736 10607402667 015226 0 ustar frankie ####################################################################
#
# connect.tcl
#
# Demonstrate connecting to an existing database using both
# dsn and connection string
#
# Create the db, if not yet created, close connection immediately.
set dir [file dirname [info script]]
source $dir/createdb.tcl
db disconnect
####################################################################
#
# subprocedures
#
proc output_db_data db {
set tables [$db tables]
puts "db:\t[lindex [lindex $tables 0] 0]"
puts -nonewline "tables:"
foreach i $tables {
puts \t[lindex $i 2]
}
}
####################################################################
#
# Connect to an Access database using a connection string.
# Uses global variables $driver and $dbfile set in createdb.tcl.
#
# Note that connection string syntax is odbc driver dependent, and
# usually documented in driver's help file or other documentation.
# However, this is the only way to connect to a local database
# using its real file name instead of datasource name.
#
database db "DRIVER=$driver;DBQ=$dbfile"
output_db_data db
db disconnect
####################################################################
#
# Connect to a database using datasource name.
# Uses global variable $dsn set in createdb.tcl.
#
# This is the preferred method of connecting to a database,
# but requires datasource name to be set.
#
database db $dsn
output_db_data db
db disconnect
tclodbc-2.5.1/samples/loaddef.tcl 0000644 0001750 0000027 00000001461 10607402667 015165 0 ustar frankie ####################################################################
#
# loaddef.tcl
#
# Loads data definitions from every table of the database from a file
# named db.def. The sql statements are stored to file named db.sql.
#
# Uses utility procedure TableDefToSql in file datautil.tcl
#
# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl
####################################################################
#
# Execution starts here
#
# delete tables, if exists
puts "dropping all tables..."
foreach i [db tables] {
# exclude system tables
if {![string compare [lindex $i 3] TABLE]} {
db "drop table [lindex $i 2]"
}
}
puts "drop completed"
puts "loading..."
tclodbc::LoadSchema db db.def yes
puts "load complete"
tclodbc-2.5.1/configure 0000755 0001750 0000027 00001262067 11010624417 013326 0 ustar frankie #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for tclodbc 2.5.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 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=:
# 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
if test "x$CONFIG_SHELL" = x; then
if (eval ":") 2>/dev/null; then
as_have_required=yes
else
as_have_required=no
fi
if test $as_have_required = yes && (eval ":
(as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test \$exitcode = 0) || { (exit 1); exit 1; }
(
as_lineno_1=\$LINENO
as_lineno_2=\$LINENO
test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
") 2> /dev/null; then
:
else
as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
case $as_dir in
/*)
for as_base in sh bash ksh sh5; do
as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
done;;
esac
done
IFS=$as_save_IFS
for as_shell in $as_candidate_shells $SHELL; do
# Try only shells that exist, to save several forks.
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ ("$as_shell") 2> /dev/null <<\_ASEOF
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
:
_ASEOF
}; then
CONFIG_SHELL=$as_shell
as_have_required=yes
if { "$as_shell" 2> /dev/null <<\_ASEOF
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
:
(as_func_return () {
(exit $1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = "$1" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test $exitcode = 0) || { (exit 1); exit 1; }
(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
_ASEOF
}; then
break
fi
fi
done
if test "x$CONFIG_SHELL" != x; then
for as_var in BASH_ENV ENV
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
export CONFIG_SHELL
exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
if test $as_have_required = no; then
echo This script requires a shell more modern than all the
echo shells that I found on your system. Please install a
echo modern shell, or manually run the script under such a
echo shell if you do have one.
{ (exit 1); exit 1; }
fi
fi
fi
(eval "as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test \$exitcode = 0") || {
echo No shell found that supports shell functions.
echo Please tell autoconf@gnu.org about your system,
echo including any error possibly output before this
echo message
}
as_lineno_1=$LINENO
as_lineno_2=$LINENO
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 $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO 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 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, 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=
SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tclodbc'
PACKAGE_TARNAME='tclodbc'
PACKAGE_VERSION='2.5'
PACKAGE_STRING='tclodbc 2.5'
PACKAGE_BUGREPORT=''
# 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='SHELL
PATH_SEPARATOR
PACKAGE_NAME
PACKAGE_TARNAME
PACKAGE_VERSION
PACKAGE_STRING
PACKAGE_BUGREPORT
exec_prefix
prefix
program_transform_name
bindir
sbindir
libexecdir
datarootdir
datadir
sysconfdir
sharedstatedir
localstatedir
includedir
oldincludedir
docdir
infodir
htmldir
dvidir
pdfdir
psdir
libdir
localedir
mandir
DEFS
ECHO_C
ECHO_N
ECHO_T
LIBS
build_alias
host_alias
target_alias
CYGPATH
EXEEXT
PKG_LIB_FILE
PKG_STUB_LIB_FILE
PKG_STUB_SOURCES
PKG_STUB_OBJECTS
PKG_TCL_SOURCES
PKG_HEADERS
PKG_INCLUDES
PKG_LIBS
PKG_CFLAGS
TCL_VERSION
TCL_BIN_DIR
TCL_SRC_DIR
TCL_LIB_FILE
TCL_LIB_FLAG
TCL_LIB_SPEC
TCL_STUB_LIB_FILE
TCL_STUB_LIB_FLAG
TCL_STUB_LIB_SPEC
TCL_LIBS
TCL_DEFS
TCL_EXTRA_CFLAGS
TCL_LD_FLAGS
TCL_SHLIB_LD_LIBS
CC
CFLAGS
LDFLAGS
CPPFLAGS
ac_ct_CC
OBJEXT
CPP
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
SET_MAKE
RANLIB
GREP
EGREP
MATH_LIBS
CXX
CXXFLAGS
ac_ct_CXX
PKG_SOURCES
PKG_OBJECTS
ODBC_INCLUDE_DIR
ODBCTYPE
ODBC_LIB
ODBC_LIB_DIR
CLEANFILES
TCL_INCLUDES
TCL_THREADS
SHARED_BUILD
AR
CELIB_DIR
LIBOBJS
DL_LIBS
CFLAGS_DEBUG
CFLAGS_OPTIMIZE
CFLAGS_WARNING
STLIB_LD
SHLIB_LD
SHLIB_LD_LIBS
SHLIB_CFLAGS
LD_LIBRARY_PATH_VAR
TCL_DBGX
CFLAGS_DEFAULT
LDFLAGS_DEFAULT
MAKE_LIB
MAKE_SHARED_LIB
MAKE_STATIC_LIB
MAKE_STUB_LIB
RANLIB_STUB
TCLSH_PROG
LTLIBOBJS'
ac_subst_files=''
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
CXX
CXXFLAGS
CCC'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
# 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_TARNAME}'
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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
eval enable_$ac_feature=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
eval with_$ac_package=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) { echo "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; }
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
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'`
{ echo "$as_me: error: missing argument to $ac_option" >&2
{ (exit 1); exit 1; }; }
fi
# Be sure to have absolute directory names.
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
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
{ echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; }
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
echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
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 .` ||
{ echo "$as_me: error: Working directory cannot be determined" >&2
{ (exit 1); exit 1; }; }
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
{ echo "$as_me: error: pwd does not report name of working directory" >&2
{ (exit 1); exit 1; }; }
# 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 -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
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 .."
{ echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
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 tclodbc 2.5 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/tclodbc]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of tclodbc 2.5:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-gxx allow use of g++ if available --disable-gxx
--enable-threads build with threads
--enable-shared build and link with shared libraries (default: on)
--enable-64bit enable 64bit support (default: off)
--enable-64bit-vis enable 64bit Sparc VIS support (default: off)
--enable-wince enable Win/CE support (where applicable)
--disable-load disallow dynamic loading and "load" command
(default: enabled)
--enable-symbols build with debugging symbols (default: off)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-tcl directory containing tcl configuration
(tclConfig.sh)
--with-odbcinclude directory where odbc headers are
--with-odbclibrary directory where odbc libraries are
--with-tclinclude directory containing the public Tcl header files
--with-celib=DIR use Windows/CE support library from DIR
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 C/C++/Objective C preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
_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" || continue
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
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
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
tclodbc configure 2.5
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 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
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 tclodbc $as_me 2.5, which was
generated by GNU Autoconf 2.61. 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=.
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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
2)
ac_configure_args1="$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
ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
done
$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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
cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
*) $as_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
cat <<\_ASBOX
## ----------------- ##
## Output variables. ##
## ----------------- ##
_ASBOX
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
## ------------------- ##
## File substitutions. ##
## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
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'; { (exit 1); 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
# 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
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
set x "$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
set x "$prefix/share/config.site" "$prefix/etc/config.site"
else
set x "$ac_default_prefix/share/config.site" \
"$ac_default_prefix/etc/config.site"
fi
shift
for ac_site_file
do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
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.
if test -f "$cache_file"; then
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ echo "$as_me:$LINENO: creating cache $cache_file" >&5
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,)
{ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
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
{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
{ echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
{ echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`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.
*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
{ { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
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
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------
# TEA extensions pass this us the version of TEA they think they
# are compatible with.
TEA_VERSION="3.5"
{ echo "$as_me:$LINENO: checking for correct TEA configuration" >&5
echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6; }
if test x"${PACKAGE_NAME}" = x ; then
{ { echo "$as_me:$LINENO: error:
The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5
echo "$as_me: error:
The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;}
{ (exit 1); exit 1; }; }
fi
if test x"3.5" = x ; then
{ { echo "$as_me:$LINENO: error:
TEA version not specified." >&5
echo "$as_me: error:
TEA version not specified." >&2;}
{ (exit 1); exit 1; }; }
elif test "3.5" != "${TEA_VERSION}" ; then
{ echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5
echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6; }
else
{ echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5
echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6; }
fi
case "`uname -s`" in
*win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CYGPATH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CYGPATH"; then
ac_cv_prog_CYGPATH="$CYGPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CYGPATH="cygpath -w"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
fi
fi
CYGPATH=$ac_cv_prog_CYGPATH
if test -n "$CYGPATH"; then
{ echo "$as_me:$LINENO: result: $CYGPATH" >&5
echo "${ECHO_T}$CYGPATH" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
EXEEXT=".exe"
TEA_PLATFORM="windows"
;;
*)
CYGPATH=echo
EXEEXT=""
TEA_PLATFORM="unix"
;;
esac
# Check if exec_prefix is set. If not use fall back to prefix.
# Note when adjusted, so that TEA_PREFIX can correct for this.
# This is needed for recursive configures, since autoconf propagates
# $prefix, but not $exec_prefix (doh!).
if test x$exec_prefix = xNONE ; then
exec_prefix_default=yes
exec_prefix=$prefix
fi
# This package name must be replaced statically for AC_SUBST to work
# Substitute STUB_LIB_FILE in case package creates a stub library too.
# We AC_SUBST these here to ensure they are subst'ed,
# in case the user doesn't call TEA_ADD_...
ac_aux_dir=
for ac_dir in tclconfig "$srcdir"/tclconfig; 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
{ { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5
echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;}
{ (exit 1); exit 1; }; }
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.
#--------------------------------------------------------------------
# Load the tclConfig.sh file
#--------------------------------------------------------------------
#
# Ok, lets find the tcl configuration
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-tcl
#
if test x"${no_tcl}" = x ; then
# we reset no_tcl in case something fails here
no_tcl=true
# Check whether --with-tcl was given.
if test "${with_tcl+set}" = set; then
withval=$with_tcl; with_tclconfig=${withval}
fi
{ echo "$as_me:$LINENO: checking for Tcl configuration" >&5
echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6; }
if test "${ac_cv_c_tclconfig+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# First check to see if --with-tcl was specified.
if test x"${with_tclconfig}" != x ; then
case ${with_tclconfig} in
*/tclConfig.sh )
if test -f ${with_tclconfig}; then
{ echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
fi ;;
esac
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
else
{ { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
# then check for a private Tcl installation
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in \
../tcl \
`ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
`ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
`ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
../../tcl \
`ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
`ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
`ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
../../../tcl \
`ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
`ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
`ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
# on Darwin, check in Framework installation locations
if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
`ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
break
fi
done
fi
# on Windows, check in common installation locations
if test "${TEA_PLATFORM}" = "windows" \
-a x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d C:/Tcl/lib 2>/dev/null` \
`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
# check in a few other private locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in \
${srcdir}/../tcl \
`ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
fi
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
{ echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
exit 0
else
no_tcl=
TCL_BIN_DIR=${ac_cv_c_tclconfig}
{ echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
fi
fi
{ echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6; }
if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
{ echo "$as_me:$LINENO: result: loading" >&5
echo "${ECHO_T}loading" >&6; }
. ${TCL_BIN_DIR}/tclConfig.sh
else
{ echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
# of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
if test -f ${TCL_BIN_DIR}/Makefile ; then
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
elif test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
# against Tcl.framework installed in an arbitary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
for i in "`cd ${TCL_BIN_DIR}; pwd`" \
"`cd ${TCL_BIN_DIR}/../..; pwd`"; do
if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
break
fi
done
fi
if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
fi
;;
esac
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------
if test "${prefix}" = "NONE"; then
prefix_default=yes
if test x"${TCL_PREFIX}" != x; then
{ echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
prefix=${TCL_PREFIX}
else
{ echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5
echo "$as_me: --prefix defaulting to /usr/local" >&6;}
prefix=/usr/local
fi
fi
if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
-o x"${exec_prefix_default}" = x"yes" ; then
if test x"${TCL_EXEC_PREFIX}" != x; then
{ echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
exec_prefix=${TCL_EXEC_PREFIX}
else
{ echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5
echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
exec_prefix=$prefix
fi
fi
#-----------------------------------------------------------------------
# Standard compiler checks.
# This sets up CC by using the CC env var, or looks for gcc otherwise.
# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
# the basic setup necessary to compile executables.
#-----------------------------------------------------------------------
# Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
# in this macro, they need to go into TEA_SETUP_COMPILER instead.
# If the user did not set CFLAGS, set it now to keep
# the AC_PROG_CC macro from adding "-g -O2".
if test "${CFLAGS+set}" != "set" ; then
CFLAGS=""
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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&5
echo "$as_me: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
echo "$as_me:$LINENO: checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out 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.
{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
#
# List of possible output files, starting from the most likely.
# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
# only as a last resort. b.out is created by i960 compilers.
ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
#
# The IRIX 6 linker writes into existing files which may not be
# executable, retaining their permissions. Remove them first so a
# subsequent execution test works.
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; 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 | *.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
{ echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6; }
if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }
fi
ac_exeext=$ac_cv_exeext
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
fi
fi
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6; }
{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; 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 | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest$ac_cv_exeext
{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; 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 ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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
{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
CFLAGS=""
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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
{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$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
{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_c89+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
#include
#include
/* 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"
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_c89=$ac_arg
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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)
{ echo "$as_me:$LINENO: result: none needed" >&5
echo "${ECHO_T}none needed" >&6; } ;;
xno)
{ echo "$as_me:$LINENO: result: unsupported" >&5
echo "${ECHO_T}unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
esac
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
{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if test "${ac_cv_prog_CPP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f 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
{ echo "$as_me:$LINENO: result: $CPP" >&5
echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
{ { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
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
# 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.
{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
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
{ echo "$as_me:$LINENO: result: $INSTALL" >&5
echo "${ECHO_T}$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'
#--------------------------------------------------------------------
# Checks to see if the make program sets the $MAKE variable.
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&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
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
SET_MAKE=
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
#--------------------------------------------------------------------
# Find ranlib
#--------------------------------------------------------------------
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
{ echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
{ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
RANLIB=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
#--------------------------------------------------------------------
# Determines the correct binary file extension (.o, .obj, .exe etc.)
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
if test "${ac_cv_path_GREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Extract the first word of "grep ggrep" to use in msg output
if test -z "$GREP"; then
set dummy grep ggrep; ac_prog_name=$2
if test "${ac_cv_path_GREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
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"
{ test -f "$ac_path_GREP" && $as_test_x "$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
echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
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
ac_count=`expr $ac_count + 1`
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
fi
GREP="$ac_cv_path_GREP"
if test -z "$GREP"; then
{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ echo "$as_me:$LINENO: checking for egrep" >&5
echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
if test "${ac_cv_path_EGREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
# Extract the first word of "egrep" to use in msg output
if test -z "$EGREP"; then
set dummy egrep; ac_prog_name=$2
if test "${ac_cv_path_EGREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
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"
{ test -f "$ac_path_EGREP" && $as_test_x "$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
echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
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
ac_count=`expr $ac_count + 1`
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
fi
EGREP="$ac_cv_path_EGREP"
if test -z "$EGREP"; then
{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
#include
#include
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF
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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_Header=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
# Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
#------------------------------------------------------------------------
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
# It makes compiling go faster. (This is only a performance feature.)
#------------------------------------------------------------------------
if test -z "$no_pipe" -a -n "$GCC"; then
{ echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6; }
OLDCC="$CC"
CC="$CC -pipe"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
CC="$OLDCC"
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
#--------------------------------------------------------------------
# Common compiler flag setup
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
if test "${ac_cv_c_bigendian+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# See if sys/param.h defines the BYTE_ORDER macro.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
# It does; now see whether it defined to BIG_ENDIAN or not.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_bigendian=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# It does not; compile a test program.
if test "$cross_compiling" = yes; then
# try to guess the endianness by grepping values into an object file
ac_cv_c_bigendian=unknown
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
int
main ()
{
_ascii (); _ebcdic ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in
yes)
cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN 1
_ACEOF
;;
no)
;;
*)
{ { echo "$as_me:$LINENO: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" >&5
echo "$as_me: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
if test "${TEA_PLATFORM}" = "unix" ; then
#--------------------------------------------------------------------
# On a few very rare systems, all of the libm.a stuff is
# already in libc.a. Set compiler flags accordingly.
# Also, Linux requires the "ieee" library for math to work
# right (and it must appear before "-lm").
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for sin" >&5
echo $ECHO_N "checking for sin... $ECHO_C" >&6; }
if test "${ac_cv_func_sin+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define sin to an innocuous variant, in case declares sin.
For example, HP-UX 11i declares gettimeofday. */
#define sin innocuous_sin
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char sin (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef sin
/* 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 sin ();
/* 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_sin || defined __stub___sin
choke me
#endif
int
main ()
{
return sin ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_func_sin=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_sin=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5
echo "${ECHO_T}$ac_cv_func_sin" >&6; }
if test $ac_cv_func_sin = yes; then
MATH_LIBS=""
else
MATH_LIBS="-lm"
fi
{ echo "$as_me:$LINENO: checking for main in -lieee" >&5
echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6; }
if test "${ac_cv_lib_ieee_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lieee $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_ieee_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_ieee_main=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5
echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6; }
if test $ac_cv_lib_ieee_main = yes; then
MATH_LIBS="-lieee $MATH_LIBS"
fi
#--------------------------------------------------------------------
# Interactive UNIX requires -linet instead of -lsocket, plus it
# needs net/errno.h to define the socket-related error codes.
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for main in -linet" >&5
echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6; }
if test "${ac_cv_lib_inet_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-linet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_inet_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_inet_main=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5
echo "${ECHO_T}$ac_cv_lib_inet_main" >&6; }
if test $ac_cv_lib_inet_main = yes; then
LIBS="$LIBS -linet"
fi
if test "${ac_cv_header_net_errno_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for net/errno.h" >&5
echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; }
if test "${ac_cv_header_net_errno_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking net/errno.h usability" >&5
echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking net/errno.h presence" >&5
echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for net/errno.h" >&5
echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; }
if test "${ac_cv_header_net_errno_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_net_errno_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; }
fi
if test $ac_cv_header_net_errno_h = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_NET_ERRNO_H 1
_ACEOF
fi
#--------------------------------------------------------------------
# Check for the existence of the -lsocket and -lnsl libraries.
# The order here is important, so that they end up in the right
# order in the command line generated by make. Here are some
# special considerations:
# 1. Use "connect" and "accept" to check for -lsocket, and
# "gethostbyname" to check for -lnsl.
# 2. Use each function name only once: can't redo a check because
# autoconf caches the results of the last check and won't redo it.
# 3. Use -lnsl and -lsocket only if they supply procedures that
# aren't already present in the normal libraries. This is because
# IRIX 5.2 has libraries, but they aren't needed and they're
# bogus: they goof up name resolution if used.
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
# To get around this problem, check for both libraries together
# if -lsocket doesn't work by itself.
#--------------------------------------------------------------------
tcl_checkBoth=0
{ echo "$as_me:$LINENO: checking for connect" >&5
echo $ECHO_N "checking for connect... $ECHO_C" >&6; }
if test "${ac_cv_func_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define connect to an innocuous variant, in case declares connect.
For example, HP-UX 11i declares gettimeofday. */
#define connect innocuous_connect
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef connect
/* 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 connect ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_connect || defined __stub___connect
choke me
#endif
int
main ()
{
return connect ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_func_connect=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_connect=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
echo "${ECHO_T}$ac_cv_func_connect" >&6; }
if test $ac_cv_func_connect = yes; then
tcl_checkSocket=0
else
tcl_checkSocket=1
fi
if test "$tcl_checkSocket" = 1; then
{ echo "$as_me:$LINENO: checking for setsockopt" >&5
echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6; }
if test "${ac_cv_func_setsockopt+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define setsockopt to an innocuous variant, in case declares setsockopt.
For example, HP-UX 11i declares gettimeofday. */
#define setsockopt innocuous_setsockopt
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char setsockopt (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef setsockopt
/* 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 setsockopt ();
/* 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_setsockopt || defined __stub___setsockopt
choke me
#endif
int
main ()
{
return setsockopt ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_func_setsockopt=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_setsockopt=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5
echo "${ECHO_T}$ac_cv_func_setsockopt" >&6; }
if test $ac_cv_func_setsockopt = yes; then
:
else
{ echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5
echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6; }
if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 setsockopt ();
int
main ()
{
return setsockopt ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_socket_setsockopt=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_socket_setsockopt=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5
echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6; }
if test $ac_cv_lib_socket_setsockopt = yes; then
LIBS="$LIBS -lsocket"
else
tcl_checkBoth=1
fi
fi
fi
if test "$tcl_checkBoth" = 1; then
tk_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
{ echo "$as_me:$LINENO: checking for accept" >&5
echo $ECHO_N "checking for accept... $ECHO_C" >&6; }
if test "${ac_cv_func_accept+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define accept to an innocuous variant, in case declares accept.
For example, HP-UX 11i declares gettimeofday. */
#define accept innocuous_accept
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef accept
/* 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 accept ();
/* 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_accept || defined __stub___accept
choke me
#endif
int
main ()
{
return accept ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_func_accept=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_accept=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5
echo "${ECHO_T}$ac_cv_func_accept" >&6; }
if test $ac_cv_func_accept = yes; then
tcl_checkNsl=0
else
LIBS=$tk_oldLibs
fi
fi
{ echo "$as_me:$LINENO: checking for gethostbyname" >&5
echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; }
if test "${ac_cv_func_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define gethostbyname to an innocuous variant, in case declares gethostbyname.
For example, HP-UX 11i declares gettimeofday. */
#define gethostbyname innocuous_gethostbyname
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef gethostbyname
/* 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 gethostbyname ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_gethostbyname || defined __stub___gethostbyname
choke me
#endif
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_func_gethostbyname=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; }
if test $ac_cv_func_gethostbyname = yes; then
:
else
{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_nsl_gethostbyname=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_nsl_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
if test $ac_cv_lib_nsl_gethostbyname = yes; then
LIBS="$LIBS -lnsl"
fi
fi
# Don't perform the eval of the libraries here because DL_LIBS
# won't be set until we call TEA_CONFIG_CFLAGS
TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
{ echo "$as_me:$LINENO: checking dirent.h" >&5
echo $ECHO_N "checking dirent.h... $ECHO_C" >&6; }
if test "${tcl_cv_dirent_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
int
main ()
{
#ifndef _POSIX_SOURCE
# ifdef __Lynx__
/*
* Generate compilation error to make the test fail: Lynx headers
* are only valid if really in the POSIX environment.
*/
missing_procedure();
# endif
#endif
DIR *d;
struct dirent *entryPtr;
char *p;
d = opendir("foobar");
entryPtr = readdir(d);
p = entryPtr->d_name;
closedir(d);
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
tcl_cv_dirent_h=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_dirent_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5
echo "${ECHO_T}$tcl_cv_dirent_h" >&6; }
if test $tcl_cv_dirent_h = no; then
cat >>confdefs.h <<\_ACEOF
#define NO_DIRENT_H 1
_ACEOF
fi
if test "${ac_cv_header_errno_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for errno.h" >&5
echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; }
if test "${ac_cv_header_errno_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
echo "${ECHO_T}$ac_cv_header_errno_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking errno.h usability" >&5
echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking errno.h presence" >&5
echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for errno.h" >&5
echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; }
if test "${ac_cv_header_errno_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_errno_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
echo "${ECHO_T}$ac_cv_header_errno_h" >&6; }
fi
if test $ac_cv_header_errno_h = yes; then
:
else
cat >>confdefs.h <<\_ACEOF
#define NO_ERRNO_H 1
_ACEOF
fi
if test "${ac_cv_header_float_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for float.h" >&5
echo $ECHO_N "checking for float.h... $ECHO_C" >&6; }
if test "${ac_cv_header_float_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
echo "${ECHO_T}$ac_cv_header_float_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking float.h usability" >&5
echo $ECHO_N "checking float.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking float.h presence" >&5
echo $ECHO_N "checking float.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for float.h" >&5
echo $ECHO_N "checking for float.h... $ECHO_C" >&6; }
if test "${ac_cv_header_float_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_float_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
echo "${ECHO_T}$ac_cv_header_float_h" >&6; }
fi
if test $ac_cv_header_float_h = yes; then
:
else
cat >>confdefs.h <<\_ACEOF
#define NO_FLOAT_H 1
_ACEOF
fi
if test "${ac_cv_header_values_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for values.h" >&5
echo $ECHO_N "checking for values.h... $ECHO_C" >&6; }
if test "${ac_cv_header_values_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
echo "${ECHO_T}$ac_cv_header_values_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking values.h usability" >&5
echo $ECHO_N "checking values.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking values.h presence" >&5
echo $ECHO_N "checking values.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for values.h" >&5
echo $ECHO_N "checking for values.h... $ECHO_C" >&6; }
if test "${ac_cv_header_values_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_values_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
echo "${ECHO_T}$ac_cv_header_values_h" >&6; }
fi
if test $ac_cv_header_values_h = yes; then
:
else
cat >>confdefs.h <<\_ACEOF
#define NO_VALUES_H 1
_ACEOF
fi
if test "${ac_cv_header_limits_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for limits.h" >&5
echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; }
if test "${ac_cv_header_limits_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
echo "${ECHO_T}$ac_cv_header_limits_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking limits.h usability" >&5
echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking limits.h presence" >&5
echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for limits.h" >&5
echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; }
if test "${ac_cv_header_limits_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_limits_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
echo "${ECHO_T}$ac_cv_header_limits_h" >&6; }
fi
if test $ac_cv_header_limits_h = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIMITS_H 1
_ACEOF
else
cat >>confdefs.h <<\_ACEOF
#define NO_LIMITS_H 1
_ACEOF
fi
if test "${ac_cv_header_stdlib_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for stdlib.h" >&5
echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; }
if test "${ac_cv_header_stdlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking stdlib.h usability" >&5
echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking stdlib.h presence" >&5
echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for stdlib.h" >&5
echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; }
if test "${ac_cv_header_stdlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_stdlib_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; }
fi
if test $ac_cv_header_stdlib_h = yes; then
tcl_ok=1
else
tcl_ok=0
fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "strtol" >/dev/null 2>&1; then
:
else
tcl_ok=0
fi
rm -f conftest*
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "strtoul" >/dev/null 2>&1; then
:
else
tcl_ok=0
fi
rm -f conftest*
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "strtod" >/dev/null 2>&1; then
:
else
tcl_ok=0
fi
rm -f conftest*
if test $tcl_ok = 0; then
cat >>confdefs.h <<\_ACEOF
#define NO_STDLIB_H 1
_ACEOF
fi
if test "${ac_cv_header_string_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for string.h" >&5
echo $ECHO_N "checking for string.h... $ECHO_C" >&6; }
if test "${ac_cv_header_string_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
echo "${ECHO_T}$ac_cv_header_string_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking string.h usability" >&5
echo $ECHO_N "checking string.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking string.h presence" >&5
echo $ECHO_N "checking string.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for string.h" >&5
echo $ECHO_N "checking for string.h... $ECHO_C" >&6; }
if test "${ac_cv_header_string_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_string_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
echo "${ECHO_T}$ac_cv_header_string_h" >&6; }
fi
if test $ac_cv_header_string_h = yes; then
tcl_ok=1
else
tcl_ok=0
fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "strstr" >/dev/null 2>&1; then
:
else
tcl_ok=0
fi
rm -f conftest*
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "strerror" >/dev/null 2>&1; then
:
else
tcl_ok=0
fi
rm -f conftest*
# See also memmove check below for a place where NO_STRING_H can be
# set and why.
if test $tcl_ok = 0; then
cat >>confdefs.h <<\_ACEOF
#define NO_STRING_H 1
_ACEOF
fi
if test "${ac_cv_header_sys_wait_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for sys/wait.h" >&5
echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; }
if test "${ac_cv_header_sys_wait_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking sys/wait.h usability" >&5
echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking sys/wait.h presence" >&5
echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for sys/wait.h" >&5
echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; }
if test "${ac_cv_header_sys_wait_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_sys_wait_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
fi
if test $ac_cv_header_sys_wait_h = yes; then
:
else
cat >>confdefs.h <<\_ACEOF
#define NO_SYS_WAIT_H 1
_ACEOF
fi
if test "${ac_cv_header_dlfcn_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
if test "${ac_cv_header_dlfcn_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
if test "${ac_cv_header_dlfcn_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_dlfcn_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
fi
if test $ac_cv_header_dlfcn_h = yes; then
:
else
cat >>confdefs.h <<\_ACEOF
#define NO_DLFCN_H 1
_ACEOF
fi
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
for ac_header in sys/param.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
# Let the user call this, because if it triggers, they will
# need a compat/strtod.c that is correct. Users can also
# use Tcl_GetDouble(FromObj) instead.
#TEA_BUGGY_STRTOD
fi
# Check whether --enable-gxx was given.
if test "${enable_gxx+set}" = set; then
enableval=$enable_gxx; ok=$enableval
else
ok=no
fi
if test "$ok" = "yes"; then
CXX=g++
else
if test "${TEA_PLATFORM}" = "windows" ; then
CXX=cl
else
CXX=${CXX-cc}
fi
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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
echo "$as_me:$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
{ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
echo "${ECHO_T}$ac_ct_CXX" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}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:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
fi
fi
fi
fi
# Provide some information about the compiler.
echo "$as_me:$LINENO: checking for C++ compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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
{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
GXX=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cxx_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cxx_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
CXXFLAGS=""
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cxx_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
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
{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$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
#--------------------------------------------------------------------
# Extra compiler checks
#--------------------------------------------------------------------
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
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
#-----------------------------------------------------------------------
# __CHANGE__
# Specify the C source files to compile in TEA_ADD_SOURCES,
# public headers that need to be installed in TEA_ADD_HEADERS,
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
# and PKG_TCL_SOURCES.
#-----------------------------------------------------------------------
vars="tclobj.cxx tclodbc.cxx database.cxx statemnt.cxx
strings.cxx encoding.cxx"
for i in $vars; do
case $i in
\$*)
# allow $-var names
PKG_SOURCES="$PKG_SOURCES $i"
PKG_OBJECTS="$PKG_OBJECTS $i"
;;
*)
# check for existence - allows for generic/win/unix VPATH
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
; then
{ { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5
echo "$as_me: error: could not find source file '$i'" >&2;}
{ (exit 1); exit 1; }; }
fi
PKG_SOURCES="$PKG_SOURCES $i"
# this assumes it is in a VPATH dir
i=`basename $i`
# handle user calling this before or after TEA_SETUP_COMPILER
if test x"${OBJEXT}" != x ; then
j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
else
j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
fi
PKG_OBJECTS="$PKG_OBJECTS $j"
;;
esac
done
vars="tclodbc.hxx tclobj.hxx"
for i in $vars; do
# check for existence, be strict because it is installed
if test ! -f "${srcdir}/$i" ; then
{ { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5
echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;}
{ (exit 1); exit 1; }; }
fi
PKG_HEADERS="$PKG_HEADERS $i"
done
vars=""
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
vars=""
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
PKG_CFLAGS="$PKG_CFLAGS "
vars=""
for i in $vars; do
# check for existence - allows for generic/win/unix VPATH
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
; then
{ { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5
echo "$as_me: error: could not find stub source file '$i'" >&2;}
{ (exit 1); exit 1; }; }
fi
PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
# this assumes it is in a VPATH dir
i=`basename $i`
# handle user calling this before or after TEA_SETUP_COMPILER
if test x"${OBJEXT}" != x ; then
j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
else
j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
fi
PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
done
vars=""
for i in $vars; do
# check for existence, be strict because it is installed
if test ! -f "${srcdir}/$i" ; then
{ { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5
echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;}
{ (exit 1); exit 1; }; }
fi
PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
done
#--------------------------------------------------------------------
# A few miscellaneous platform-specific items:
#
# Define a special symbol for Windows (BUILD_exampleA in this case) so
# that we create the export library with the dll. See sha1.h on how
# to use this.
#
# Windows creates a few extra files that need to be cleaned up.
# You can add more files to clean if your extension creates any extra
# files.
#
# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
# These will be appended to the current set of compiler flags for
# your system.
#--------------------------------------------------------------------
if test "${TEA_PLATFORM}" = "windows" ; then
vars=""
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
vars="odbc32.lib odbccp32.lib"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
else
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_odbc=true
ac_cv_c_odbch=""
ODBCTYPE=""
# Check whether --with-odbcinclude was given.
if test "${with_odbcinclude+set}" = set; then
withval=$with_odbcinclude; with_odbcinclude=${withval}
fi
if test x"${with_odbcinclude}" != x ; then
# first check to see if --with-odbcinclude was specified
list="/odbc/sql.h /ODBC/sql.h /unixodbc/sql.h /unixODBC/sql.h \
/iodbc/isql.h"
for i in $list ; do
if test -f "${with_odbcinclude}$i" ; then
ac_cv_c_odbch=`dirname ${with_odbcinclude}$i`
ac_cv_c_odbch=`(cd ${ac_cv_c_odbch}; pwd)`
break
fi
done
if test x"${ac_cv_c_odbch}" = x; then
{ { echo "$as_me:$LINENO: error: ${with_odbcinclude} directory does not contain headers" >&5
echo "$as_me: error: ${with_odbcinclude} directory does not contain headers" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
for i in $dirlist; do
if test -f "${srcdir}/$i/postodbc/isql.h" ; then
ac_cv_c_odbch=`(cd ${srcdir}/$i/postodbc/; pwd)`
ODBCTYPE=iodbc
fi
done
if test x"${ac_cv_c_odbch}" = x ; then
for i in \
/usr/local/mysql/include \
/usr/local/include/iodbc \
/usr/local/share/iodbc \
${prefix}/include/iodbc \
/usr/local/include \
/usr/include \
${prefix}/include ; do
if test -f $i/isql.h; then
ac_cv_c_odbch=`(cd $i; pwd)`
ODBCTYPE=iodbc
fi
done
fi
if test x"${ac_cv_c_odbch}" = x ; then
ccprog=`echo ${CC} | sed -e 's: .*::'`
ccpath=`which ${ccprog} | sed -e 's:/bin/.*::'`/include/iodbc
if test -f $ccpath/isql.h; then
ac_cv_c_odbch=$ccpath
ODBCTYPE=iodbc
fi
fi
if test x"${ac_cv_c_odbch}" = x ; then
if test "${ac_cv_header_isql_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for isql.h" >&5
echo $ECHO_N "checking for isql.h... $ECHO_C" >&6; }
if test "${ac_cv_header_isql_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_isql_h" >&5
echo "${ECHO_T}$ac_cv_header_isql_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking isql.h usability" >&5
echo $ECHO_N "checking isql.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking isql.h presence" >&5
echo $ECHO_N "checking isql.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: isql.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: isql.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: isql.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: isql.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: isql.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: isql.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: isql.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: isql.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: isql.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: isql.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: isql.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for isql.h" >&5
echo $ECHO_N "checking for isql.h... $ECHO_C" >&6; }
if test "${ac_cv_header_isql_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_isql_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_isql_h" >&5
echo "${ECHO_T}$ac_cv_header_isql_h" >&6; }
fi
if test $ac_cv_header_isql_h = yes; then
ac_cv_c_odbch=installed
else
ac_cv_c_odbch=""
fi
if test x"${ac_cv_c_odbch}" != x ; then
ODBCTYPE=iodbc
fi
fi
if test x"${ac_cv_c_odbch}" = x ; then
for i in \
/opt/odbc/include \
/opt/ODBC/include \
${prefix}/include/odbc \
${prefix}/include/ODBC \
/opt/unixodbc/include \
/opt/unixODBC/include \
${prefix}/include/unixodbc \
${prefix}/include/unixODBC \
/usr/local/mysql/include \
/usr/local/include \
/usr/include \
${prefix}/include ; do
if test -f "$i/sql.h"; then
ac_cv_c_odbch=`(cd $i; pwd)`
ODBCTYPE=unixODBC
fi
done
fi
if test x"${ac_cv_c_odbch}" = x ; then
if test "${ac_cv_header_sql_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for sql.h" >&5
echo $ECHO_N "checking for sql.h... $ECHO_C" >&6; }
if test "${ac_cv_header_sql_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5
echo "${ECHO_T}$ac_cv_header_sql_h" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking sql.h usability" >&5
echo $ECHO_N "checking sql.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking sql.h presence" >&5
echo $ECHO_N "checking sql.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: sql.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sql.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: sql.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: sql.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sql.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: sql.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: sql.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: sql.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sql.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: sql.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: sql.h: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for sql.h" >&5
echo $ECHO_N "checking for sql.h... $ECHO_C" >&6; }
if test "${ac_cv_header_sql_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_sql_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5
echo "${ECHO_T}$ac_cv_header_sql_h" >&6; }
fi
if test $ac_cv_header_sql_h = yes; then
ac_cv_c_odbch=installed
else
ac_cv_c_odbch=""
fi
if test x"${ac_cv_c_odbch}" != x ; then
ODBCTYPE=unixODBC
fi
fi
if test x"${ODBCTYPE}" = xunixODBC ; then
if test -f "${ac_cv_c_odbch}/odbcver.h" ; then
ODBCTYPE=intersolv
fi
fi
ODBC_INCLUDE_DIR=""
if test x"${ac_cv_c_odbch}" = x ; then
{ { echo "$as_me:$LINENO: error: Cannot find any ODBC headers" >&5
echo "$as_me: error: Cannot find any ODBC headers" >&2;}
{ (exit 1); exit 1; }; }
else
if test x"${ODBCTYPE}" = x ; then
if test -f "${ac_cv_c_odbch}/odbcver.h" ; then
ODBCTYPE=intersolv
elif test -f "${ac_cv_c_odbch}/sql.h" ; then
ODBCTYPE=unixODBC
elif test -f "${ac_cv_c_odbch}/isql.h" ; then
ODBCTYPE=iodbc
fi
fi
fi
{ echo "$as_me:$LINENO: checking for ODBC headers files" >&5
echo $ECHO_N "checking for ODBC headers files... $ECHO_C" >&6; }
if test x"${ac_cv_c_odbch}" != x ; then
no_odbc=""
if test x"${ac_cv_c_odbch}" != xinstalled ; then
{ echo "$as_me:$LINENO: result: ${ac_cv_c_odbch}" >&5
echo "${ECHO_T}${ac_cv_c_odbch}" >&6; }
ODBC_INCLUDE_DIR="-I${ac_cv_c_odbch}"
else
{ echo "$as_me:$LINENO: result: none" >&5
echo "${ECHO_T}none" >&6; }
fi
fi
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_odbc=true
ac_cv_c_odbc_libdir=""
ac_cv_c_odbc_lib=""
ODBC_LIB_NAME=""
# Check whether --with-odbclibrary was given.
if test "${with_odbclibrary+set}" = set; then
withval=$with_odbclibrary; with_odbclibrary=${withval}
fi
if test x"${with_odbclibrary}" != x ; then
if test -f ${with_odbclibrary} ; then
ac_cv_c_odbc_libdir=`echo ${with_odbclibrary} | sed -e 's:/libpsqlodbc.*::'`
ac_cv_c_odbc_libdir=`(cd ${ac_cv_c_odbc_libdir}; pwd)`
ac_cv_c_odbc_lib=`echo ${with_odbclibrary} | sed -e 's:.*/::'`
elif test -f ${with_odbclibrary}/libodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}; pwd)`
ac_cv_c_odbc_lib='-lodbc'
elif test -f ${with_odbclibrary}/libpsqlodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}; pwd)`
elif test -f ${with_odbclibrary}/iodbc/libpsqlodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}/iodbc; pwd)`
ac_cv_c_odbc_lib='-llibpsqlodbc'
else
{ { echo "$as_me:$LINENO: error: ${with_odbclibrary} directory does not contain library" >&5
echo "$as_me: error: ${with_odbclibrary} directory does not contain library" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
if test x"${ODBCTYPE}" = xiodbc ; then
liblist="libpsqlodbc libmysqlodbc librbodbc libiodbc iodbc"
libpathlist="/usr/local/lib/iodbc ${prefix}/iodbc/lib \
${prefix}/lib/iodbc /usr/local/mysql/lib /usr/local/lib /usr/lib ${prefix}/lib"
elif test x"${ODBCTYPE}" = xunixODBC ; then
liblist="libodbc"
libpathlist="/opt/unixodbc/lib /opt/unixODBC/lib /usr/include/odbc \
/usr/include/ODBC /usr/local/mysql/lib /usr/local/lib \
${prefix}/lib"
elif test x"${ODBCTYPE}" = xintersolv ; then
liblist="libodbc"
libpathlist="/opt/odbc/lib /opt/ODBC/lib /usr/include/unixodbc \
/usr/include/unixODBC /usr/local/mysql/lib /usr/local/lib \
${prefix}/lib"
else
{ { echo "$as_me:$LINENO: error: ODBC support could not be identified." >&5
echo "$as_me: error: ODBC support could not be identified." >&2;}
{ (exit 1); exit 1; }; }
fi
for libname in $liblist; do
for i in $dirlist; do
if test -f "$i/postodbc/${libname}${TCL_SHLIB_SUFFIX}" ; then
ac_cv_c_odbc_libdir=`(cd $i/postodbc/; pwd)`
break
fi
done
if test x"${ac_cv_c_odbc_libdir}" = x ; then
for i in $libpathlist; do
if test -f $i/${libname}${TCL_SHLIB_SUFFIX}; then
ac_cv_c_odbc_libdir=`(cd $i; pwd)`
break
fi
done
fi
if test x"${ac_cv_c_odbc_libdir}" = x ; then
ccprog=`echo ${CC} | sed -e 's: .*::'`
ccpath=`which ${ccprog} | sed -e 's:/bin/.*::'`/lib
if test -f $ccpath/${libname}${TCL_SHLIB_SUFFIX}; then
ac_cv_c_odbc_libdir=$ccpath
fi
fi
if test x"${ac_cv_c_odbc_libdir}" = x ; then
as_ac_Lib=`echo "ac_cv_lib_${libname}''_main" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for main in -l${libname}" >&5
echo $ECHO_N "checking for main in -l${libname}... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-l${libname} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
eval "$as_ac_Lib=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_Lib=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_LIB${libname}" | $as_tr_cpp` 1
_ACEOF
LIBS="-l${libname} $LIBS"
fi
fi
if test x"${ac_cv_c_odbc_libdir}" != x ; then
ac_cv_c_odbc_lib=${libname}
break
fi
done
ODBC_LIB_DIR=""
{ echo "$as_me:$LINENO: checking for ODBC library files" >&5
echo $ECHO_N "checking for ODBC library files... $ECHO_C" >&6; }
if test x"${ac_cv_c_odbc_libdir}" = x ; then
{ { echo "$as_me:$LINENO: error: Cannot find an ODBC library path" >&5
echo "$as_me: error: Cannot find an ODBC library path" >&2;}
{ (exit 1); exit 1; }; }
fi
if test x"${ac_cv_c_odbc_lib}" = x ; then
{ { echo "$as_me:$LINENO: error: Cannot find an ODBC library" >&5
echo "$as_me: error: Cannot find an ODBC library" >&2;}
{ (exit 1); exit 1; }; }
fi
if test x"${ac_cv_c_odbc_libdir}" != x ; then
{ echo "$as_me:$LINENO: result: ${ac_cv_c_odbc_libdir}" >&5
echo "${ECHO_T}${ac_cv_c_odbc_libdir}" >&6; }
ODBC_LIB_DIR="-L${ac_cv_c_odbc_libdir}"
fi
{ echo "$as_me:$LINENO: checking for ODBC library name" >&5
echo $ECHO_N "checking for ODBC library name... $ECHO_C" >&6; }
ODBC_LIB=-l`echo $ac_cv_c_odbc_lib | sed -e 's:^lib::'`
{ echo "$as_me:$LINENO: result: $ODBC_LIB" >&5
echo "${ECHO_T}$ODBC_LIB" >&6; }
if test x"${ODBCTYPE}" = xiodbc ; then
{ echo "$as_me:$LINENO: result: Using IODBC driver" >&5
echo "${ECHO_T}Using IODBC driver" >&6; }
cat >>confdefs.h <<\_ACEOF
#define HAVE_IODBC 1
_ACEOF
ODBC_LIB="$ODBC_LIB -liodbcinst"
fi
if test x"${ODBCTYPE}" = xunixODBC ; then
{ echo "$as_me:$LINENO: result: Using UnixODBC driver" >&5
echo "${ECHO_T}Using UnixODBC driver" >&6; }
cat >>confdefs.h <<\_ACEOF
#define HAVE_UNIXODBC 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define DONT_TD_VOID 1
_ACEOF
ODBC_LIB="${ODBC_LIB} -lodbcinst"
fi
if test x"${ODBCTYPE}" = xintersolv ; then
{ echo "$as_me:$LINENO: result: Using Intersolv driver" >&5
echo "${ECHO_T}Using Intersolv driver" >&6; }
cat >>confdefs.h <<\_ACEOF
#define HAVE_INTERSOLV 1
_ACEOF
fi
vars="${ODBC_INCLUDE_DIR}"
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
vars="${ODBC_LIB_DIR} ${ODBC_LIB}"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
fi
if test "${TEA_PLATFORM}" = "windows" ; then
cat >>confdefs.h <<\_ACEOF
#define BUILD_tclodbc 1
_ACEOF
CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
vars="user32.lib"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
if test "$GCC" != "yes" ; then
PKG_CFLAGS="$PKG_CFLAGS -GX"
fi
else
CLEANFILES="pkgIndex.tcl"
{ echo "$as_me:$LINENO: checking for main in -ldnet_stub" >&5
echo $ECHO_N "checking for main in -ldnet_stub... $ECHO_C" >&6; }
if test "${ac_cv_lib_dnet_stub_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_dnet_stub_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dnet_stub_main=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_main" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_main" >&6; }
if test $ac_cv_lib_dnet_stub_main = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBDNET_STUB 1
_ACEOF
LIBS="-ldnet_stub $LIBS"
fi
fi
#--------------------------------------------------------------------
# Choose which headers you need. Extension authors should try very
# hard to only rely on the Tcl public header files. Internal headers
# contain private data structures and are subject to change without
# notice.
# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for Tcl public headers" >&5
echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6; }
# Check whether --with-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval=$with_tclinclude; with_tclinclude=${withval}
fi
if test "${ac_cv_c_tclh+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Use the value from --with-tclinclude, if it was given
if test x"${with_tclinclude}" != x ; then
if test -f "${with_tclinclude}/tcl.h" ; then
ac_cv_c_tclh=${with_tclinclude}
else
{ { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5
echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;}
{ (exit 1); exit 1; }; }
fi
else
if test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use
# the framework's Headers directory
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
;;
esac
fi
# Look in the source dir only if Tcl is not installed,
# and in that situation, look there before installed locations.
if test -f "${TCL_BIN_DIR}/Makefile" ; then
list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
fi
# Check order: pkg --prefix location, Tcl's --prefix location,
# relative to directory of tclConfig.sh.
eval "temp_includedir=${includedir}"
list="$list \
`ls -d ${temp_includedir} 2>/dev/null` \
`ls -d ${TCL_PREFIX}/include 2>/dev/null` \
`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
list="$list /usr/local/include /usr/include"
if test x"${TCL_INCLUDE_SPEC}" != x ; then
d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
list="$list `ls -d ${d} 2>/dev/null`"
fi
fi
for i in $list ; do
if test -f "$i/tcl.h" ; then
ac_cv_c_tclh=$i
break
fi
done
fi
fi
# Print a message based on how we determined the include path
if test x"${ac_cv_c_tclh}" = x ; then
{ { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5
echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;}
{ (exit 1); exit 1; }; }
else
{ echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5
echo "${ECHO_T}${ac_cv_c_tclh}" >&6; }
fi
# Convert to a native path and substitute into the output files.
INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
#--------------------------------------------------------------------
# Check whether --enable-threads or --disable-threads was given.
#--------------------------------------------------------------------
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then
enableval=$enable_threads; tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
TCL_THREADS=1
if test "${TEA_PLATFORM}" != "windows" ; then
# We are always OK on Windows, so check what this platform wants:
# USE_THREAD_ALLOC tells us to try the special thread-based
# allocator that significantly reduces lock contention
cat >>confdefs.h <<\_ACEOF
#define USE_THREAD_ALLOC 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _REENTRANT 1
_ACEOF
if test "`uname -s`" = "SunOS" ; then
cat >>confdefs.h <<\_ACEOF
#define _POSIX_PTHREAD_SEMANTICS 1
_ACEOF
fi
cat >>confdefs.h <<\_ACEOF
#define _THREAD_SAFE 1
_ACEOF
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 pthread_mutex_init ();
int
main ()
{
return pthread_mutex_init ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_pthread_pthread_mutex_init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_pthread_pthread_mutex_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = "no"; then
# Check a little harder for __pthread_mutex_init in the same
# library, as some systems hide it there until pthread.h is
# defined. We could alternatively do an AC_TRY_COMPILE with
# pthread.h, but that will work with libpthread really doesn't
# exist, like AIX 4.2. [Bug: 4359]
{ echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5
echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 __pthread_mutex_init ();
int
main ()
{
return __pthread_mutex_init ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_pthread___pthread_mutex_init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_pthread___pthread_mutex_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
fi
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -lpthread"
else
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5
echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthreads $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 pthread_mutex_init ();
int
main ()
{
return pthread_mutex_init ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_pthreads_pthread_mutex_init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_pthreads_pthread_mutex_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -lpthreads"
else
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5
echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6; }
if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 pthread_mutex_init ();
int
main ()
{
return pthread_mutex_init ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_c_pthread_mutex_init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_c_pthread_mutex_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6; }
if test $ac_cv_lib_c_pthread_mutex_init = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = "no"; then
{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5
echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6; }
if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 pthread_mutex_init ();
int
main ()
{
return pthread_mutex_init ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_c_r_pthread_mutex_init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_c_r_pthread_mutex_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -pthread"
else
TCL_THREADS=0
{ echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5
echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;}
fi
fi
fi
fi
fi
else
TCL_THREADS=0
fi
# Do checking message here to not mess up interleaved configure output
{ echo "$as_me:$LINENO: checking for building with threads" >&5
echo $ECHO_N "checking for building with threads... $ECHO_C" >&6; }
if test "${TCL_THREADS}" = 1; then
cat >>confdefs.h <<\_ACEOF
#define TCL_THREADS 1
_ACEOF
{ echo "$as_me:$LINENO: result: yes (default)" >&5
echo "${ECHO_T}yes (default)" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
# TCL_THREADS sanity checking. See if our request for building with
# threads is the same as the way Tcl was built. If not, warn the user.
case ${TCL_DEFS} in
*THREADS=1*)
if test "${TCL_THREADS}" = "0"; then
{ echo "$as_me:$LINENO: WARNING:
Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
that IS thread-enabled. It is recommended to use --enable-threads." >&5
echo "$as_me: WARNING:
Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
that IS thread-enabled. It is recommended to use --enable-threads." >&2;}
fi
;;
*)
if test "${TCL_THREADS}" = "1"; then
{ echo "$as_me:$LINENO: WARNING:
--enable-threads requested, but building against a Tcl that is NOT
thread-enabled. This is an OK configuration that will also run in
a thread-enabled core." >&5
echo "$as_me: WARNING:
--enable-threads requested, but building against a Tcl that is NOT
thread-enabled. This is an OK configuration that will also run in
a thread-enabled core." >&2;}
fi
;;
esac
#--------------------------------------------------------------------
# The statement below defines a collection of symbols related to
# building as a shared library instead of a static library.
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking how to build libraries" >&5
echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6; }
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then
enableval=$enable_shared; tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" ; then
{ echo "$as_me:$LINENO: result: shared" >&5
echo "${ECHO_T}shared" >&6; }
SHARED_BUILD=1
else
{ echo "$as_me:$LINENO: result: static" >&5
echo "${ECHO_T}static" >&6; }
SHARED_BUILD=0
cat >>confdefs.h <<\_ACEOF
#define STATIC_BUILD 1
_ACEOF
fi
#--------------------------------------------------------------------
# This macro figures out what flags to use with the compiler/linker
# when building shared/static debug/optimized objects. This information
# can be taken from the tclConfig.sh file, but this figures it all out.
#--------------------------------------------------------------------
# Step 0.a: Enable 64 bit support?
{ echo "$as_me:$LINENO: checking if 64bit support is requested" >&5
echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6; }
# Check whether --enable-64bit was given.
if test "${enable_64bit+set}" = set; then
enableval=$enable_64bit; do64bit=$enableval
else
do64bit=no
fi
{ echo "$as_me:$LINENO: result: $do64bit" >&5
echo "${ECHO_T}$do64bit" >&6; }
# Step 0.b: Enable Solaris 64 bit VIS support?
{ echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5
echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6; }
# Check whether --enable-64bit-vis was given.
if test "${enable_64bit_vis+set}" = set; then
enableval=$enable_64bit_vis; do64bitVIS=$enableval
else
do64bitVIS=no
fi
{ echo "$as_me:$LINENO: result: $do64bitVIS" >&5
echo "${ECHO_T}$do64bitVIS" >&6; }
if test "$do64bitVIS" = "yes"; then
# Force 64bit on with VIS
do64bit=yes
fi
# Step 0.c: Cross-compiling options for Windows/CE builds?
if test "${TEA_PLATFORM}" = "windows" ; then
{ echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5
echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6; }
# Check whether --enable-wince was given.
if test "${enable_wince+set}" = set; then
enableval=$enable_wince; doWince=$enableval
else
doWince=no
fi
{ echo "$as_me:$LINENO: result: $doWince" >&5
echo "${ECHO_T}$doWince" >&6; }
fi
# Step 1: set the variable "system" to hold the name and version number
# for the system.
{ echo "$as_me:$LINENO: checking system version" >&5
echo $ECHO_N "checking system version... $ECHO_C" >&6; }
if test "${tcl_cv_sys_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "${TEA_PLATFORM}" = "windows" ; then
tcl_cv_sys_version=windows
elif test -f /usr/lib/NextStep/software_version; then
tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
{ echo "$as_me:$LINENO: WARNING: can't find uname command" >&5
echo "$as_me: WARNING: can't find uname command" >&2;}
tcl_cv_sys_version=unknown
else
# Special check for weird MP-RAS system (uname returns weird
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
tcl_cv_sys_version=MP-RAS-`awk '{print }' /etc/.relid`
fi
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
fi
fi
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5
echo "${ECHO_T}$tcl_cv_sys_version" >&6; }
system=$tcl_cv_sys_version
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_dl_dlopen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
if test $ac_cv_lib_dl_dlopen = yes; then
have_dl=yes
else
have_dl=no
fi
# Require ranlib early so we can override it in special cases below.
# Step 3: set configuration options based on system name and version.
# This is similar to Tcl's unix/tcl.m4 except that we've added a
# "windows" case.
do64bit_ok=no
LDFLAGS_ORIG="$LDFLAGS"
# When ld needs options to work in 64-bit mode, put them in
# LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
# is disabled by the user. [Bug 1016796]
LDFLAGS_ARCH=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall"
else
CFLAGS_WARNING=""
fi
TCL_NEEDS_EXP_FILE=0
TCL_BUILD_EXP_FILE=""
TCL_EXP_FILE=""
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_AR+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AR="ar"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
{ echo "$as_me:$LINENO: result: $AR" >&5
echo "${ECHO_T}$AR" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
case $system in
windows)
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
# This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
# MACHINE is IX86 for LINK, but this is used by the manifest,
# which requires x86|amd64|ia64.
MACHINE="X86"
if test "$do64bit" != "no" ; then
if test "x${MSSDK}x" = "xx" ; then
MSSDK="C:/Progra~1/Microsoft Platform SDK"
fi
MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
PATH64=""
case "$do64bit" in
amd64|x64|yes)
MACHINE="AMD64" ; # default to AMD64 64-bit build
PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
;;
ia64)
MACHINE="IA64"
PATH64="${MSSDK}/Bin/Win64"
;;
esac
if test ! -d "${PATH64}" ; then
{ echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
{ echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5
echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
do64bit="no"
else
{ echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5
echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6; }
do64bit_ok="yes"
fi
fi
if test "$doWince" != "no" ; then
if test "$do64bit" != "no" ; then
{ { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5
echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;}
{ (exit 1); exit 1; }; }
fi
if test "$GCC" = "yes" ; then
{ { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5
echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;}
{ (exit 1); exit 1; }; }
fi
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-celib
if test x"${no_celib}" = x ; then
# we reset no_celib in case something fails here
no_celib=true
# Check whether --with-celib was given.
if test "${with_celib+set}" = set; then
withval=$with_celib; with_celibconfig=${withval}
fi
{ echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5
echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6; }
if test "${ac_cv_c_celibconfig+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# First check to see if --with-celibconfig was specified.
if test x"${with_celibconfig}" != x ; then
if test -d "${with_celibconfig}/inc" ; then
ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
else
{ { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5
echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
# then check for a celib library
if test x"${ac_cv_c_celibconfig}" = x ; then
for i in \
../celib-palm-3.0 \
../celib \
../../celib-palm-3.0 \
../../celib \
`ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
${srcdir}/../celib-palm-3.0 \
${srcdir}/../celib \
`ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
; do
if test -d "$i/inc" ; then
ac_cv_c_celibconfig=`(cd $i; pwd)`
break
fi
done
fi
fi
if test x"${ac_cv_c_celibconfig}" = x ; then
{ { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5
echo "$as_me: error: Cannot find celib support library directory" >&2;}
{ (exit 1); exit 1; }; }
else
no_celib=
CELIB_DIR=${ac_cv_c_celibconfig}
CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
{ echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5
echo "${ECHO_T}found $CELIB_DIR" >&6; }
fi
fi
# Set defaults for common evc4/PPC2003 setup
# Currently Tcl requires 300+, possibly 420+ for sockets
CEVERSION=420; # could be 211 300 301 400 420 ...
TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
ARCH=ARM; # could be ARM MIPS X86EM ...
PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
if test "$doWince" != "yes"; then
# If !yes then the user specified something
# Reset ARCH to allow user to skip specifying it
ARCH=
eval `echo $doWince | awk -F, '{ \
if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
}'`
if test "x${ARCH}" = "x" ; then
ARCH=$TARGETCPU;
fi
fi
OSVERSION=WCE$CEVERSION;
if test "x${WCEROOT}" = "x" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
if test ! -d "${WCEROOT}" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
fi
fi
if test "x${SDKROOT}" = "x" ; then
SDKROOT="C:/Program Files/Windows CE Tools"
if test ! -d "${SDKROOT}" ; then
SDKROOT="C:/Windows CE Tools"
fi
fi
WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
-o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
{ { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5
echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;}
{ (exit 1); exit 1; }; }
doWince="no"
else
# We could PATH_NOSPACE these, but that's not important,
# as long as we quote them when used.
CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
fi
CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
fi
fi
if test "$GCC" != "yes" ; then
if test "${SHARED_BUILD}" = "0" ; then
runtime=-MT
else
runtime=-MD
fi
if test "$do64bit" != "no" ; then
# All this magic is necessary for the Win64 SDK RC1 - hobbs
CC="\"${PATH64}/cl.exe\""
CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
RC="\"${MSSDK}/bin/rc.exe\""
lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
# Avoid 'unresolved external symbol __security_cookie'
# errors, c.f. http://support.microsoft.com/?id=894573
vars="bufferoverflowU.lib"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
elif test "$doWince" != "no" ; then
CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
if test "${TARGETCPU}" = "X86"; then
CC="\"${CEBINROOT}/cl.exe\""
else
CC="\"${CEBINROOT}/cl${ARCH}.exe\""
fi
CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
arch=`echo ${ARCH} | awk '{print tolower($0)}'`
defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
if test "${SHARED_BUILD}" = "1" ; then
# Static CE builds require static celib as well
defs="${defs} _DLL"
fi
for i in $defs ; do
cat >>confdefs.h <<_ACEOF
#define $i 1
_ACEOF
done
cat >>confdefs.h <<_ACEOF
#define _WIN32_WCE $CEVERSION
_ACEOF
cat >>confdefs.h <<_ACEOF
#define UNDER_CE $CEVERSION
_ACEOF
CFLAGS_DEBUG="-nologo -Zi -Od"
CFLAGS_OPTIMIZE="-nologo -Ox"
lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
LINKBIN="\"${CEBINROOT}/link.exe\""
else
RC="rc"
lflags="-nologo"
LINKBIN="link"
CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
fi
fi
if test "$GCC" = "yes"; then
# mingw gcc mode
RC="windres"
CFLAGS_DEBUG="-g"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
SHLIB_LD="$CC -shared"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
else
SHLIB_LD="${LINKBIN} -dll ${lflags}"
# link -lib only works when -lib is the first arg
STLIB_LD="${LINKBIN} -lib ${lflags}"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
PATHTYPE=-w
# For information on what debugtype is most useful, see:
# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
# This essentially turns it all on.
LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
LDFLAGS_OPTIMIZE="-release"
if test "$doWince" != "no" ; then
LDFLAGS_CONSOLE="-link ${lflags}"
LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
else
LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
TCL_LIB_VERSIONS_OK=nodots
# Bogus to avoid getting this turned off
DL_OBJS="tclLoadNone.obj"
;;
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r)
# ok ...
;;
*)
CC=${CC}_r
;;
esac
{ echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5
echo "${ECHO_T}Using $CC for compiling with threads" >&6; }
fi
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
LD_LIBRARY_PATH_VAR="LIBPATH"
# Check to enable 64-bit flags for compiler/linker on AIX 4+
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
fi
fi
if test "`uname -m`" = "ia64" ; then
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# AIX-5 has dl* in libc.so
DL_LIBS=""
if test "$GCC" = "yes" ; then
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
fi
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
else
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
else
SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
fi
SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
fi
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
case " $LIBOBJS " in
*" tclLoadAix.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext"
;;
esac
DL_LIBS="-lld"
fi
# On AIX <=v4 systems, libbsd.a has to be linked in to support
# non-blocking file IO. This library has to be linked in after
# the MATH_LIBS or it breaks the pow() function. The way to
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
# This library also supplies gettimeofday.
#
# AIX does not have a timezone field in struct tm. When the AIX
# bsd library is used, the timezone global and the gettimeofday
# methods are to be avoided for timezone deduction instead, we
# deduce the timezone by comparing the localtime result on a
# known GMT value.
{ echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5
echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6; }
if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 gettimeofday ();
int
main ()
{
return gettimeofday ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_bsd_gettimeofday=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_bsd_gettimeofday=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5
echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6; }
if test $ac_cv_lib_bsd_gettimeofday = yes; then
libbsd=yes
else
libbsd=no
fi
if test $libbsd = yes; then
MATH_LIBS="$MATH_LIBS -lbsd"
cat >>confdefs.h <<\_ACEOF
#define USE_DELTA_FOR_TZ 1
_ACEOF
fi
;;
BeOS*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -nostart"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
#-----------------------------------------------------------
# Check for inet_ntoa in -lbind, for BeOS (which also needs
# -lsocket, even if the network functions are in -lnet which
# is always linked to, for compatibility.
#-----------------------------------------------------------
{ echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5
echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6; }
if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbind $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 inet_ntoa ();
int
main ()
{
return inet_ntoa ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_bind_inet_ntoa=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_bind_inet_ntoa=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6; }
if test $ac_cv_lib_bind_inet_ntoa = yes; then
LIBS="$LIBS -lbind -lsocket"
fi
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD="cc -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -export-dynamic"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
dgux*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
HP-UX-*.11.*)
# Use updated header definitions where possible
cat >>confdefs.h <<\_ACEOF
#define _XOPEN_SOURCE_EXTENDED 1
_ACEOF
# Needed by Tcl, but not most extensions
#AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
#LIBS="$LIBS -lxnet" # Use the XOPEN network library
SHLIB_SUFFIX=".sl"
{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 shl_load ();
int
main ()
{
return shl_load ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_dld_shl_load=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dld_shl_load=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
if test $ac_cv_lib_dld_shl_load = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
#CFLAGS="$CFLAGS +DAportable"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
hpux_arch=`${CC} -dumpmachine`
case $hpux_arch in
hppa64*)
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS='${LIBS}'
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
;;
esac
else
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
LDFLAGS_ARCH="+DD64"
fi
fi
;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* 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 shl_load ();
int
main ()
{
return shl_load ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_dld_shl_load=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dld_shl_load=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
if test $ac_cv_lib_dld_shl_load = yes; then
tcl_ok=yes
else
tcl_ok=no
fi
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS=""
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
;;
IRIX-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mabi=n32"
LDFLAGS="$LDFLAGS -mabi=n32"
else
case $system in
IRIX-6.3)
# Use to build 6.2 compatible binaries on 6.3.
CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
;;
*)
CFLAGS="$CFLAGS -n32"
;;
esac
LDFLAGS="$LDFLAGS -n32"
fi
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5
echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
else
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
LDFLAGS_ARCH="-64"
fi
fi
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
# when you inline the string and math operations. Turn this off to
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
# The combo of gcc + glibc has a bug related
# to inlining of functions like strtod(). The
# -fno-builtin flag should address this problem
# but it does not work. The -fno-inline flag
# is kind of overkill but it works.
# Disable inlining only when one of the
# files in compat/*.c is being linked in.
if test x"${USE_COMPAT}" != x ; then
CFLAGS="$CFLAGS -fno-inline"
fi
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD="${CC} -shared"
DL_OBJS=""
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE=-02
SHLIB_LD="${CC} -shared "
DL_OBJS="tclLoadDl.o"
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,-Bexport"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[1-2].*)
# NetBSD/SPARC needs -fPIC, -fpic will not do.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
{ echo "$as_me:$LINENO: checking for ELF" >&5
echo $ECHO_N "checking for ELF... $ECHO_C" >&6; }
if test "${tcl_cv_ld_elf+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __ELF__
yes
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then
tcl_cv_ld_elf=yes
else
tcl_cv_ld_elf=no
fi
rm -f conftest*
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5
echo "${ECHO_T}$tcl_cv_ld_elf" >&6; }
if test $tcl_cv_ld_elf = yes; then
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
else
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
fi
# Ancient FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
# OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
case `machine` in
sparc|sparc64)
SHLIB_CFLAGS="-fPIC";;
*)
SHLIB_CFLAGS="-fpic";;
esac
SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
{ echo "$as_me:$LINENO: checking for ELF" >&5
echo $ECHO_N "checking for ELF... $ECHO_C" >&6; }
if test "${tcl_cv_ld_elf+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __ELF__
yes
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then
tcl_cv_ld_elf=yes
else
tcl_cv_ld_elf=no
fi
rm -f conftest*
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5
echo "${ECHO_T}$tcl_cv_ld_elf" >&6; }
if test $tcl_cv_ld_elf = yes; then
LDFLAGS=-Wl,-export-dynamic
else
LDFLAGS=""
fi
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
FreeBSD-*)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "${TCL_THREADS}" = "1" ; then
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
case $system in
FreeBSD-3.*)
# FreeBSD-3 doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
TCL_LIB_VERSIONS_OK=nodots
;;
esac
;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
if test $do64bit = yes; then
do64bit_ok=yes
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
fi
# TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
{ echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5
echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6; }
if test "${tcl_cv_ld_single_module+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
int i;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
tcl_cv_ld_single_module=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_ld_single_module=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$hold_ldflags
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5
echo "${ECHO_T}$tcl_cv_ld_single_module" >&6; }
if test $tcl_cv_ld_single_module = yes; then
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
# Don't use -prebind when building for Mac OS X 10.4 or later only:
test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \
LDFLAGS="$LDFLAGS -prebind"
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
{ echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5
echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6; }
if test "${tcl_cv_ld_search_paths_first+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
int i;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
tcl_cv_ld_search_paths_first=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_ld_search_paths_first=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$hold_ldflags
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5
echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6; }
if test $tcl_cv_ld_search_paths_first = yes; then
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
# TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
# for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
# at present (no 64bit GUI libraries).
test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
SHLIB_LD="cc -nostdlib -r"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
CFLAGS_OPTIMIZE="" # Optimizer is buggy
cat >>confdefs.h <<\_ACEOF
#define _OE_SOCKETS 1
_ACEOF
;;
OSF1-1.0|OSF1-1.1|OSF1-1.2)
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
SHLIB_CFLAGS=""
# Hack: make package name same as library name
SHLIB_LD='ld -R -export :'
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD="ld -shared"
else
SHLIB_LD="ld -non_shared"
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD='ld -shared -expect_unresolved "*"'
else
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mieee"
else
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
LIBS=`echo $LIBS | sed s/-lpthreads//`
if test "$GCC" = "yes" ; then
LIBS="$LIBS -lpthread -lmach -lexc"
else
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
fi
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
# dlopen is in -lc on QNX
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
else
SHLIB_CFLAGS="-Kpic -belf"
LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
fi
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
SHLIB_CFLAGS="-PIC"
SHLIB_LD="ld"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
# requires an extra version number at the end of .so file names.
# So, the library has to have a name like libtcl75.so.1.0
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[0-6])
# Careful to not let 5.10+ fall into this case
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
cat >>confdefs.h <<\_ACEOF
#define _REENTRANT 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _POSIX_PTHREAD_SEMANTICS 1
_ACEOF
SHLIB_CFLAGS="-KPIC"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
;;
SunOS-5*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
cat >>confdefs.h <<\_ACEOF
#define _REENTRANT 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _POSIX_PTHREAD_SEMANTICS 1
_ACEOF
SHLIB_CFLAGS="-KPIC"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
if test "$GCC" = "yes" ; then
if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS -m64 -mcpu=v9"
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
SHLIB_CFLAGS="-fPIC"
fi
else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
CFLAGS="$CFLAGS -xarch=v9a"
LDFLAGS_ARCH="-xarch=v9a"
else
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS_ARCH="-xarch=v9"
fi
# Solaris 64 uses this as well
#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
fi
elif test "$arch" = "amd64 i386" ; then
if test "$GCC" = "yes" ; then
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS -xarch=amd64"
LDFLAGS="$LDFLAGS -xarch=amd64"
fi
else
{ echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5
echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
fi
fi
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "$do64bit_ok" = "yes" ; then
# We need to specify -static-libgcc or we need to
# add the path to the sparv9 libgcc.
# JH: static-libgcc is necessary for core Tcl, but may
# not be necessary for extensions.
SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
# for finding sparcv9 libgcc, get the regular libgcc
# path, remove so name and append 'sparcv9'
#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
fi
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
UNIX_SV* | UnixWare-5*)
SHLIB_CFLAGS="-KPIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
# that don't grok the -Bexport option. Test that it does.
{ echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5
echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6; }
if test "${tcl_cv_ld_Bexport+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bexport"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
int i;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
tcl_cv_ld_Bexport=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_ld_Bexport=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$hold_ldflags
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5
echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6; }
if test $tcl_cv_ld_Bexport = yes; then
LDFLAGS="$LDFLAGS -Wl,-Bexport"
fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
esac
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
{ echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
fi
# Step 4: disable dynamic loading if requested via a command-line switch.
# Check whether --enable-load was given.
if test "${enable_load+set}" = set; then
enableval=$enable_load; tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "no"; then
DL_OBJS=""
fi
if test "x$DL_OBJS" != "x" ; then
BUILD_DLTEST="\$(DLTEST_TARGETS)"
else
echo "Can't figure out how to do dynamic loading or shared libraries"
echo "on this system."
SHLIB_CFLAGS=""
SHLIB_LD=""
SHLIB_SUFFIX=""
DL_OBJS="tclLoadNone.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS_ORIG"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
# If we're running gcc, then change the C flags for compiling shared
# libraries to the right flags for gcc, instead of those for the
# standard manufacturer compiler.
if test "$DL_OBJS" != "tclLoadNone.o" ; then
if test "$GCC" = "yes" ; then
case $system in
AIX-*)
;;
BSD/OS*)
;;
IRIX*)
;;
NetBSD-*|FreeBSD-*)
;;
Darwin-*)
;;
SCO_SV-3.2*)
;;
windows)
;;
*)
SHLIB_CFLAGS="-fPIC"
;;
esac
fi
fi
if test "$SHARED_LIB_SUFFIX" = "" ; then
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
fi
if test "$UNSHARED_LIB_SUFFIX" = "" ; then
UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
fi
# These must be called after we do the basic CFLAGS checks and
# verify any possible 64-bit or similar switches are necessary
{ echo "$as_me:$LINENO: checking for required early compiler flags" >&5
echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6; }
tcl_flags=""
if test "${tcl_cv_flag__isoc99_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
int
main ()
{
char *p = (char *)strtoll; char *q = (char *)strtoull;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__isoc99_source=no
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _ISOC99_SOURCE 1
#include
int
main ()
{
char *p = (char *)strtoll; char *q = (char *)strtoull;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__isoc99_source=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_flag__isoc99_source=no
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
if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define _ISOC99_SOURCE 1
_ACEOF
tcl_flags="$tcl_flags _ISOC99_SOURCE"
fi
if test "${tcl_cv_flag__largefile64_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
int
main ()
{
struct stat64 buf; int i = stat64("/", &buf);
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__largefile64_source=no
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE64_SOURCE 1
#include
int
main ()
{
struct stat64 buf; int i = stat64("/", &buf);
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__largefile64_source=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_flag__largefile64_source=no
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
if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define _LARGEFILE64_SOURCE 1
_ACEOF
tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
fi
if test "${tcl_cv_flag__largefile_source64+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
int
main ()
{
char *p = (char *)open64;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__largefile_source64=no
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE_SOURCE64 1
#include
int
main ()
{
char *p = (char *)open64;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_flag__largefile_source64=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_flag__largefile_source64=no
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
if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define _LARGEFILE_SOURCE64 1
_ACEOF
tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
fi
if test "x${tcl_flags}" = "x" ; then
{ echo "$as_me:$LINENO: result: none" >&5
echo "${ECHO_T}none" >&6; }
else
{ echo "$as_me:$LINENO: result: ${tcl_flags}" >&5
echo "${ECHO_T}${tcl_flags}" >&6; }
fi
{ echo "$as_me:$LINENO: checking for 64-bit integer type" >&5
echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6; }
if test "${tcl_cv_type_64bit+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
tcl_cv_type_64bit=none
# See if the compiler knows natively about __int64
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
__int64 value = (__int64) 0;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_type_64bit=__int64
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_type_64bit="long long"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# See if we should use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
switch (0) {
case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
}
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_type_64bit=${tcl_type_64bit}
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "${tcl_cv_type_64bit}" = none ; then
cat >>confdefs.h <<\_ACEOF
#define TCL_WIDE_INT_IS_LONG 1
_ACEOF
{ echo "$as_me:$LINENO: result: using long" >&5
echo "${ECHO_T}using long" >&6; }
elif test "${tcl_cv_type_64bit}" = "__int64" \
-a "${TEA_PLATFORM}" = "windows" ; then
# We actually want to use the default tcl.h checks in this
# case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
{ echo "$as_me:$LINENO: result: using Tcl header defaults" >&5
echo "${ECHO_T}using Tcl header defaults" >&6; }
else
cat >>confdefs.h <<_ACEOF
#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
_ACEOF
{ echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5
echo "${ECHO_T}${tcl_cv_type_64bit}" >&6; }
# Now check for auxiliary declarations
{ echo "$as_me:$LINENO: checking for struct dirent64" >&5
echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6; }
if test "${tcl_cv_struct_dirent64+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
#include
int
main ()
{
struct dirent64 p;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_struct_dirent64=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_struct_dirent64=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5
echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6; }
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRUCT_DIRENT64 1
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for struct stat64" >&5
echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6; }
if test "${tcl_cv_struct_stat64+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
int
main ()
{
struct stat64 p;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_struct_stat64=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_struct_stat64=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5
echo "${ECHO_T}$tcl_cv_struct_stat64" >&6; }
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRUCT_STAT64 1
_ACEOF
fi
for ac_func in open64 lseek64
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define $ac_func to an innocuous variant, in case declares $ac_func.
For example, HP-UX 11i declares gettimeofday. */
#define $ac_func innocuous_$ac_func
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef $ac_func
/* 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 $ac_func ();
/* 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_$ac_func || defined __stub___$ac_func
choke me
#endif
int
main ()
{
return $ac_func ();
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_var'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
{ echo "$as_me:$LINENO: checking for off64_t" >&5
echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; }
if test "${tcl_cv_type_off64_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include
int
main ()
{
off64_t offset;
;
return 0;
}
_ACEOF
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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
tcl_cv_type_off64_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_type_off64_t=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
test "x${ac_cv_func_lseek64}" = "xyes" && \
test "x${ac_cv_func_open64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TYPE_OFF64_T 1
_ACEOF
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
fi
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols option.
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for build with symbols" >&5
echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6; }
# Check whether --enable-symbols was given.
if test "${enable_symbols+set}" = set; then
enableval=$enable_symbols; tcl_ok=$enableval
else
tcl_ok=no
fi
DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
else
CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
if test "$tcl_ok" = "yes"; then
{ echo "$as_me:$LINENO: result: yes (standard debugging)" >&5
echo "${ECHO_T}yes (standard debugging)" >&6; }
fi
fi
if test "${TEA_PLATFORM}" != "windows" ; then
LDFLAGS_DEFAULT="${LDFLAGS}"
fi
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
cat >>confdefs.h <<\_ACEOF
#define TCL_MEM_DEBUG 1
_ACEOF
fi
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
if test "$tcl_ok" = "all"; then
{ echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5
echo "${ECHO_T}enabled symbols mem debugging" >&6; }
else
{ echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5
echo "${ECHO_T}enabled $tcl_ok debugging" >&6; }
fi
fi
#--------------------------------------------------------------------
# Everyone should be linking against the Tcl stub library. If you
# can't for some reason, remove this definition. If you aren't using
# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
# link against the non-stubbed Tcl library.
#--------------------------------------------------------------------
cat >>confdefs.h <<\_ACEOF
#define USE_TCL_STUBS 1
_ACEOF
#--------------------------------------------------------------------
# This macro generates a line to use when building a library. It
# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
# and TEA_LOAD_TCLCONFIG macros above.
#--------------------------------------------------------------------
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
else
MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
fi
if test "${SHARED_BUILD}" = "1" ; then
MAKE_LIB="${MAKE_SHARED_LIB} "
else
MAKE_LIB="${MAKE_STATIC_LIB} "
fi
#--------------------------------------------------------------------
# Shared libraries and static libraries have different names.
# Use the double eval to make sure any variables in the suffix is
# substituted. (@@@ Might not be necessary anymore)
#--------------------------------------------------------------------
if test "${TEA_PLATFORM}" = "windows" ; then
if test "${SHARED_BUILD}" = "1" ; then
# We force the unresolved linking of symbols that are really in
# the private libraries of Tcl and Tk.
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
if test x"${TK_BIN_DIR}" != x ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
fi
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
else
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
fi
# Some packages build their own stubs libraries
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
# These aren't needed on Windows (either MSVC or gcc)
RANLIB=:
RANLIB_STUB=:
else
RANLIB_STUB="${RANLIB}"
if test "${SHARED_BUILD}" = "1" ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
if test x"${TK_BIN_DIR}" != x ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
fi
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
RANLIB=:
else
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
fi
# Some packages build their own stubs libraries
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
fi
# These are escaped so that only CFLAGS is picked up at configure time.
# The other values will be substituted at make time.
CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
if test "${SHARED_BUILD}" = "1" ; then
CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
fi
#--------------------------------------------------------------------
# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
# file during the install process. Don't run the TCLSH_PROG through
# ${CYGPATH} because it's being used directly by make.
# Require that we use a tclsh shell version 8.2 or later since earlier
# versions have bugs in the pkg_mkIndex routine.
# Add WISH as well if this is a Tk extension.
#--------------------------------------------------------------------
{ echo "$as_me:$LINENO: checking for tclsh" >&5
echo $ECHO_N "checking for tclsh... $ECHO_C" >&6; }
if test -f "${TCL_BIN_DIR}/Makefile" ; then
# tclConfig.sh is in Tcl build directory
if test "${TEA_PLATFORM}" = "windows"; then
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
else
TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
fi
else
# tclConfig.sh is in install location
if test "${TEA_PLATFORM}" = "windows"; then
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
else
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
fi
list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
`ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
`ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
for i in $list ; do
if test -f "$i/${TCLSH_PROG}" ; then
REAL_TCL_BIN_DIR="`cd "$i"; pwd`"
break
fi
done
TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}"
fi
{ echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5
echo "${ECHO_T}${TCLSH_PROG}" >&6; }
#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------
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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
*) $as_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
test "x$cache_file" != "x/dev/null" &&
{ echo "$as_me:$LINENO: updating cache $cache_file" >&5
echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
{ echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
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='
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=
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=`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.
ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $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}
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
## --------------------- ##
## 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=$LINENO
as_lineno_2=$LINENO
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 $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO 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 tclodbc $as_me 2.5, 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`
"
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
config_files="$ac_config_files"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
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
Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
tclodbc config.status 2.5
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
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='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# 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
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
CONFIG_SHELL=$SHELL
export CONFIG_SHELL
exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) { { echo "$as_me:$LINENO: 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
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
_ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
SHELL!$SHELL$ac_delim
PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
PACKAGE_NAME!$PACKAGE_NAME$ac_delim
PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
PACKAGE_STRING!$PACKAGE_STRING$ac_delim
PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
exec_prefix!$exec_prefix$ac_delim
prefix!$prefix$ac_delim
program_transform_name!$program_transform_name$ac_delim
bindir!$bindir$ac_delim
sbindir!$sbindir$ac_delim
libexecdir!$libexecdir$ac_delim
datarootdir!$datarootdir$ac_delim
datadir!$datadir$ac_delim
sysconfdir!$sysconfdir$ac_delim
sharedstatedir!$sharedstatedir$ac_delim
localstatedir!$localstatedir$ac_delim
includedir!$includedir$ac_delim
oldincludedir!$oldincludedir$ac_delim
docdir!$docdir$ac_delim
infodir!$infodir$ac_delim
htmldir!$htmldir$ac_delim
dvidir!$dvidir$ac_delim
pdfdir!$pdfdir$ac_delim
psdir!$psdir$ac_delim
libdir!$libdir$ac_delim
localedir!$localedir$ac_delim
mandir!$mandir$ac_delim
DEFS!$DEFS$ac_delim
ECHO_C!$ECHO_C$ac_delim
ECHO_N!$ECHO_N$ac_delim
ECHO_T!$ECHO_T$ac_delim
LIBS!$LIBS$ac_delim
build_alias!$build_alias$ac_delim
host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
CYGPATH!$CYGPATH$ac_delim
EXEEXT!$EXEEXT$ac_delim
PKG_LIB_FILE!$PKG_LIB_FILE$ac_delim
PKG_STUB_LIB_FILE!$PKG_STUB_LIB_FILE$ac_delim
PKG_STUB_SOURCES!$PKG_STUB_SOURCES$ac_delim
PKG_STUB_OBJECTS!$PKG_STUB_OBJECTS$ac_delim
PKG_TCL_SOURCES!$PKG_TCL_SOURCES$ac_delim
PKG_HEADERS!$PKG_HEADERS$ac_delim
PKG_INCLUDES!$PKG_INCLUDES$ac_delim
PKG_LIBS!$PKG_LIBS$ac_delim
PKG_CFLAGS!$PKG_CFLAGS$ac_delim
TCL_VERSION!$TCL_VERSION$ac_delim
TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim
TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim
TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim
TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim
TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim
TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim
TCL_LIBS!$TCL_LIBS$ac_delim
TCL_DEFS!$TCL_DEFS$ac_delim
TCL_EXTRA_CFLAGS!$TCL_EXTRA_CFLAGS$ac_delim
TCL_LD_FLAGS!$TCL_LD_FLAGS$ac_delim
TCL_SHLIB_LD_LIBS!$TCL_SHLIB_LD_LIBS$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
LDFLAGS!$LDFLAGS$ac_delim
CPPFLAGS!$CPPFLAGS$ac_delim
ac_ct_CC!$ac_ct_CC$ac_delim
OBJEXT!$OBJEXT$ac_delim
CPP!$CPP$ac_delim
INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
INSTALL_DATA!$INSTALL_DATA$ac_delim
SET_MAKE!$SET_MAKE$ac_delim
RANLIB!$RANLIB$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
MATH_LIBS!$MATH_LIBS$ac_delim
CXX!$CXX$ac_delim
CXXFLAGS!$CXXFLAGS$ac_delim
ac_ct_CXX!$ac_ct_CXX$ac_delim
PKG_SOURCES!$PKG_SOURCES$ac_delim
PKG_OBJECTS!$PKG_OBJECTS$ac_delim
ODBC_INCLUDE_DIR!$ODBC_INCLUDE_DIR$ac_delim
ODBCTYPE!$ODBCTYPE$ac_delim
ODBC_LIB!$ODBC_LIB$ac_delim
ODBC_LIB_DIR!$ODBC_LIB_DIR$ac_delim
CLEANFILES!$CLEANFILES$ac_delim
TCL_INCLUDES!$TCL_INCLUDES$ac_delim
TCL_THREADS!$TCL_THREADS$ac_delim
SHARED_BUILD!$SHARED_BUILD$ac_delim
AR!$AR$ac_delim
CELIB_DIR!$CELIB_DIR$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
DL_LIBS!$DL_LIBS$ac_delim
CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim
CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim
CFLAGS_WARNING!$CFLAGS_WARNING$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
{ (exit 1); exit 1; }; }
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
ac_eof=`expr $ac_eof + 1`
fi
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
s/^/s,@/; s/!/@,|#_!!_#|/
:n
t n
s/'"$ac_delim"'$/,g/; t
s/$/\\/; p
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
CEOF$ac_eof
_ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
STLIB_LD!$STLIB_LD$ac_delim
SHLIB_LD!$SHLIB_LD$ac_delim
SHLIB_LD_LIBS!$SHLIB_LD_LIBS$ac_delim
SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim
LD_LIBRARY_PATH_VAR!$LD_LIBRARY_PATH_VAR$ac_delim
TCL_DBGX!$TCL_DBGX$ac_delim
CFLAGS_DEFAULT!$CFLAGS_DEFAULT$ac_delim
LDFLAGS_DEFAULT!$LDFLAGS_DEFAULT$ac_delim
MAKE_LIB!$MAKE_LIB$ac_delim
MAKE_SHARED_LIB!$MAKE_SHARED_LIB$ac_delim
MAKE_STATIC_LIB!$MAKE_STATIC_LIB$ac_delim
MAKE_STUB_LIB!$MAKE_STUB_LIB$ac_delim
RANLIB_STUB!$RANLIB_STUB$ac_delim
TCLSH_PROG!$TCLSH_PROG$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
{ (exit 1); exit 1; }; }
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
ac_eof=`expr $ac_eof + 1`
fi
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
s/^/s,@/; s/!/@,|#_!!_#|/
:n
t n
s/'"$ac_delim"'$/,g/; t
s/$/\\/; p
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
:end
s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ 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[ ]*=/{
s/:*\$(srcdir):*/:/
s/:*\${srcdir}:*/:/
s/:*@srcdir@:*/:/
s/^\([^=]*=[ ]*\):*/\1/
s/:*$//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF
fi # test -n "$CONFIG_FILES"
for ac_tag in :F $CONFIG_FILES
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) { { echo "$as_me:$LINENO: 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:$LINENO: 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:$LINENO: 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:$LINENO: 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
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# 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:$LINENO: 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;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
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
sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
: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
$ac_datarootdir_hack
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.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:$LINENO: 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
;;
esac
done # for ac_tag
{ (exit 0); exit 0; }
_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
# 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 || { (exit 1); exit 1; }
fi
tclodbc-2.5.1/configure.in 0000644 0001750 0000027 00000016045 10607402667 013734 0 ustar frankie #!/bin/bash -norc
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
# RCS: @(#) $Id: configure.in,v 1.12 2006/01/26 00:47:54 hobbs Exp $
#--------------------------------------------------------------------
# configure.in for tclodbc.
#--------------------------------------------------------------------
#-----------------------------------------------------------------------
# __CHANGE__
# Set your package name and version numbers here.
#
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
# set as provided. These will also be added as -D defs in your Makefile
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------
AC_INIT([tclodbc], [2.5])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------
TEA_INIT([3.5])
AC_CONFIG_AUX_DIR(tclconfig)
#--------------------------------------------------------------------
# Load the tclConfig.sh file
#--------------------------------------------------------------------
TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG
#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------
TEA_PREFIX
#-----------------------------------------------------------------------
# Standard compiler checks.
# This sets up CC by using the CC env var, or looks for gcc otherwise.
# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
# the basic setup necessary to compile executables.
#-----------------------------------------------------------------------
TEA_SETUP_COMPILER
TCLODBC_ENABLE_GXX
#--------------------------------------------------------------------
# Extra compiler checks
#--------------------------------------------------------------------
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_RESTORE
#-----------------------------------------------------------------------
# __CHANGE__
# Specify the C source files to compile in TEA_ADD_SOURCES,
# public headers that need to be installed in TEA_ADD_HEADERS,
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
# and PKG_TCL_SOURCES.
#-----------------------------------------------------------------------
TEA_ADD_SOURCES([tclobj.cxx tclodbc.cxx database.cxx statemnt.cxx
strings.cxx encoding.cxx])
TEA_ADD_HEADERS([tclodbc.hxx tclobj.hxx])
TEA_ADD_INCLUDES([])
TEA_ADD_LIBS([])
TEA_ADD_CFLAGS([])
TEA_ADD_STUB_SOURCES([])
TEA_ADD_TCL_SOURCES([])
#--------------------------------------------------------------------
# A few miscellaneous platform-specific items:
#
# Define a special symbol for Windows (BUILD_exampleA in this case) so
# that we create the export library with the dll. See sha1.h on how
# to use this.
#
# Windows creates a few extra files that need to be cleaned up.
# You can add more files to clean if your extension creates any extra
# files.
#
# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
# These will be appended to the current set of compiler flags for
# your system.
#--------------------------------------------------------------------
TCLODBC_PATH_ODBC
if test "${TEA_PLATFORM}" = "windows" ; then
AC_DEFINE(BUILD_tclodbc)
CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
TEA_ADD_LIBS([user32.lib])
if test "$GCC" != "yes" ; then
TEA_ADD_CFLAGS([-GX])
fi
else
CLEANFILES="pkgIndex.tcl"
AC_CHECK_LIB(dnet_stub, main)
fi
AC_SUBST(CLEANFILES)
#--------------------------------------------------------------------
# Choose which headers you need. Extension authors should try very
# hard to only rely on the Tcl public header files. Internal headers
# contain private data structures and are subject to change without
# notice.
# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
#--------------------------------------------------------------------
TEA_PUBLIC_TCL_HEADERS
#--------------------------------------------------------------------
# Check whether --enable-threads or --disable-threads was given.
#--------------------------------------------------------------------
TEA_ENABLE_THREADS
#--------------------------------------------------------------------
# The statement below defines a collection of symbols related to
# building as a shared library instead of a static library.
#--------------------------------------------------------------------
TEA_ENABLE_SHARED
#--------------------------------------------------------------------
# This macro figures out what flags to use with the compiler/linker
# when building shared/static debug/optimized objects. This information
# can be taken from the tclConfig.sh file, but this figures it all out.
#--------------------------------------------------------------------
TEA_CONFIG_CFLAGS
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols option.
#--------------------------------------------------------------------
TEA_ENABLE_SYMBOLS
#--------------------------------------------------------------------
# Everyone should be linking against the Tcl stub library. If you
# can't for some reason, remove this definition. If you aren't using
# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
# link against the non-stubbed Tcl library.
#--------------------------------------------------------------------
AC_DEFINE(USE_TCL_STUBS)
#--------------------------------------------------------------------
# This macro generates a line to use when building a library. It
# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
# and TEA_LOAD_TCLCONFIG macros above.
#--------------------------------------------------------------------
TEA_MAKE_LIB
#--------------------------------------------------------------------
# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
# file during the install process. Don't run the TCLSH_PROG through
# ${CYGPATH} because it's being used directly by make.
# Require that we use a tclsh shell version 8.2 or later since earlier
# versions have bugs in the pkg_mkIndex routine.
# Add WISH as well if this is a Tk extension.
#--------------------------------------------------------------------
TEA_PROG_TCLSH
#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------
AC_OUTPUT([Makefile])
tclodbc-2.5.1/statemnt.cxx 0000644 0001750 0000027 00000076037 11011550215 013774 0 ustar frankie /**********************************************************************
- TCLODBC COPYRIGHT NOTICE -
This software is copyrighted by Roy Nurmi, contact address by email at
Roy.Nurmi@iki.fi. The following terms apply to all files associated with
the software unless explicitly disclaimed in individual files.
The author hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
***********************************************************************/
//////////////////////////////////////////////////////////////////////////
// STATEMENT OBJECT IMPLEMENTATION
//
#include "tclodbc.hxx"
TclStatement::TclStatement(TclDatabase& d)
: TclCmdObject(), stmt(SQL_NULL_HSTMT), resultBuffer(NULL),
colCount(-1), colLabels(), pDb(&d), useMultipleResultSets(false) {
RETCODE rc;
rc = SQLAllocStmt(d.DBC(), &stmt);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, d.DBC(), stmt));
} else if (rc == SQL_INVALID_HANDLE) {
THROWSTR(strInvalidHandle);
}
}
TclStatement::~TclStatement() {
FreeResultBuffer();
FreeStmt();
}
void TclStatement::FreeStmt() {
if (stmt != SQL_NULL_HSTMT)
SQLFreeStmt(stmt, SQL_DROP);
stmt = SQL_NULL_HSTMT;
pDb = NULL;
};
int TclStatement::Dispatch(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
SDWORD count;
if (!pDb) {
THROWSTR("Connection closed. Cannot execute.");
}
try {
// switch on command
int command;
if (objc < 2) {
command = RUN;
} else {
command = StrToNum (TclObj(objv[1]), statementCmds, NULL, FALSE);
}
switch (command) {
case DROP:
if (objc != 2) {
THROWSTR(strWrongArgs);
}
Tcl_DeleteCommandFromToken(interp, tclCommand);
Tcl_SetResult(interp, strOK, TCL_STATIC);
break;
case COLUMNS:
if (objc < 2) {
THROWSTR(strWrongArgs);
}
Tcl_SetObjResult (interp, Columns(objc-2, objv+2));
break;
case EXECUTE:
if (objc < 2 || objc > 4) {
THROWSTR("wrong # args, should be execute [args]");
}
Execute(interp, objc-2, objv+2);
Tcl_SetResult(interp, strOK, TCL_STATIC);
break;
case MORERESULTS: {
RETCODE rc;
bool more;
while ((rc = SQLMoreResults(stmt)) == SQL_STILL_EXECUTING) {
SqlWait(0);
}
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, pDb->DBC(), stmt));
more = false;
}
more = (rc == SQL_NO_DATA ? false : true);
FreeResultBuffer();
resultBuffer = 0;
Tcl_SetObjResult (interp, TclObj(more));
break;
}
case FETCH:
if (objc < 2 && objc > 4) {
THROWSTR(strWrongArgs);
}
{
TclObj row;
Fetch(row);
if (objc == 2) {
// ordinary fetch, just return the row
Tcl_SetObjResult (interp, row);
} else {
// fetch values to a buffer (named tcl array)
int colCount (ColumnCount());
TclObj colLabels;
TclObj label, value;
BOOL success = FALSE;
if (objc == 4) {
colLabels = TclObj(objv[3]);
if (colLabels.llenght() != colCount) {
THROWSTR("Invalid number of column labels");
}
} else {
colLabels = ColumnLabels();
}
if (!row.isNull()) {
for (int i = 0; i < colCount; ++i) {
label = colLabels.lindex(i, interp);
value = row.lindex(i, interp);
if (!Tcl_SetVar2(interp, TclObj(objv[2]),
label, value, TCL_LEAVE_ERR_MSG))
return TCL_ERROR;
}
// fetch ok, return boolean true
success = TRUE;
}
// return success flag
Tcl_SetObjResult(interp, TclObj(success));
}
}
break;
case SET:
if (objc != 4) {
THROWSTR(strWrongArgs);
}
SetOption(Tcl_GetStringFromObj(objv[2], NULL),
Tcl_GetStringFromObj(objv[3], NULL));
Tcl_SetResult(interp, strOK, TCL_STATIC);
break;
case GET:
if (objc != 3)
THROWSTR(strWrongArgs)
Tcl_SetObjResult(interp, GetOption(Tcl_GetStringFromObj(objv[2], NULL)));
break;
case EVAL:
if (objc < 3 || objc > 4)
THROWSTR("wrong # args, should be eval proc [args]")
Eval(interp, TclObj(objv[2]), objc-3, objv+3);
Tcl_SetResult(interp, strOK, TCL_STATIC);
break;
case READ:
if (objc < 3 || objc > 4)
THROWSTR("wrong # args, should be read array [args]")
Read(interp, TclObj(objv[2]), objc-3, objv+3);
Tcl_SetResult(interp, strOK, TCL_STATIC);
break;
case ROWCOUNT:
if (SQLRowCount(stmt, &count) == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
Tcl_SetObjResult(interp, TclObj(count));
break;
case RUN:
if (objc >= 2) {
--objc;
++objv;
}
// fall through
default:
Tcl_SetObjResult (interp, Value(interp, objc-1, objv+1));
break;
}
// command successful
return TCL_OK;
}
catch (TclObj obj) {
Tcl_SetObjResult (interp, obj);
return TCL_ERROR;
}
}
void TclStatement::ReserveResultBuffer() {
RETCODE rc;
UWORD i;
BOOL unbound_cols (FALSE);
// allocate space for column array
resultBuffer = (ResultBuffer*) Tcl_Alloc(ColumnCount()*sizeof(ResultBuffer));
if (!resultBuffer)
THROWSTR(strMemoryAllocationFailed)
memset (resultBuffer, 0, ColumnCount()*sizeof(ResultBuffer));
// allocate space for columns and bind them
for (i=0; i MAX_BLOB_COLUMN_LENGTH) {
// column is not bound
resultBuffer[i].strResult = NULL;
resultBuffer[i].cbValueMax = 0;
resultBuffer[i].boundColumn = FALSE;
if (!(pDb->DriverInfo() & SQL_GD_ANY_COLUMN))
unbound_cols = TRUE;
} else {
// reserve buffer
resultBuffer[i].strResult = (char*)
Tcl_Alloc((resultBuffer[i].cbValueMax+1)*sizeof(char));
if (!resultBuffer[i].strResult)
THROWSTR(strMemoryAllocationFailed)
memset (resultBuffer[i].strResult, 0, resultBuffer[i].cbValueMax*sizeof(char)+1);
// bind
if (!unbound_cols) {
while ((rc = SQLBindCol(stmt, (UWORD)(i+1), resultBuffer[i].fTargetType,
resultBuffer[i].strResult, resultBuffer[i].cbValueMax+1,
&(resultBuffer[i].cbValue))) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
resultBuffer[i].boundColumn = TRUE;
} else {
resultBuffer[i].boundColumn = FALSE;
}
}
}
}
void TclStatement::FreeResultBuffer() {
if (resultBuffer) {
for (int i=0; i 0) {
//fetch rows
TclObj row;
// remember to reset object before each fetch
while (Fetch(row.set(NULL))) {
result.appendElement(row);
}
} else {
long i;
SQLRowCount(stmt, (SQLINTEGER *) &i);
result = i;
}
return result;
} else {
TclObj sets;
// foreach results sets
RETCODE rc;
bool more = false;
do {
FreeResultBuffer();
resultBuffer = 0;
if (ColumnCount() > 0) {
TclObj result;
//fetch rows
TclObj row;
// remember to reset object before each fetch
while (Fetch(row.set(NULL))) {
result.appendElement(row);
}
// add to list of sets
sets.appendElement(result);
// look if more results are waiting
while ((rc = SQLMoreResults(stmt)) == SQL_STILL_EXECUTING) {
SqlWait(0);
}
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, pDb->DBC(), stmt));
more = false;
}
more = (rc == SQL_NO_DATA ? false : true);
} else {
long i;
SQLRowCount(stmt, (SQLINTEGER *) &i);
return i;
}
} while(more);
return sets;
}
}
TclObj TclStatement::Value(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
// first execute
Execute(interp, objc, objv);
// return result in result
return Result();
}
void TclStatement::Eval(Tcl_Interp *interp, TclObj proc, int objc, TCL_CMDARGS) {
// first execute
Execute(interp, objc, objv);
// if sql has result set, return it, otherways simply OK
if (ColumnCount() > 0) {
TclObj row;
//fetch rows, always initialize row to the procedure name
while (Fetch(row.set(proc))) {
row.eval(interp);
}
} else {
THROWSTR("Cannot evaluate, no data.")
}
}
void TclStatement::Read(Tcl_Interp *interp, TclObj arraySpec, int objc, TCL_CMDARGS) {
TclObj row, columnLabels, arrayName;
int dataColumns;
BOOL createSubIndex;
// solve the proper mode type
dataColumns = ColumnCount() - 1;
if (dataColumns == arraySpec.llenght()) {
createSubIndex = FALSE;
} else if (arraySpec.llenght() == 1) {
createSubIndex = TRUE;
columnLabels = ColumnLabels();
arrayName = arraySpec;
} else {
TclObj message ("Invalid array specification: ");
message.append(arraySpec);
THROWOBJ(message);
}
// first execute
Execute(interp, objc, objv);
//fetch rows, always clear row before fetch
while (Fetch(row.set(NULL))) {
for (int i = 0; i < dataColumns; ++i) {
TclObj index ((char*) row.lindex(0));
TclObj value (row.lindex(i+1));
if (createSubIndex) {
index.append(",");
index.append(columnLabels.lindex(i+1));
} else {
arrayName = arraySpec.lindex(i);
}
if (!Tcl_SetVar2(interp, arrayName, index, value, TCL_LEAVE_ERR_MSG))
#if TCL_MAJOR_VERSION == 8
THROWOBJ(Tcl_GetObjResult(interp))
#else
THROWSTR(interp->result)
#endif
}
}
}
TclObj TclStatement::Columns(int objc, TCL_CMDARGS) {
int i, arg;
TclObj result;
for (i = 1; i <= ColumnCount(); ++i) {
// read column data for all specified argument
TclObj element;
if (objc > 0) {
for (arg = 0; arg < objc; ++ arg) {
UWORD attr = AttrDef(Tcl_GetStringFromObj(objv[arg],NULL));
element.appendElement(ColumnInfo (i, attr));
}
} else {
// default argument, if none given
element.appendElement(ColumnInfo (i, SQL_COLUMN_LABEL));
}
result.appendElement (element);
}
return result;
}
TclObj TclStatement::ColumnInfo(int col, UWORD attr) {
char strData [256];
SDWORD wordData;
switch (attr) {
case SQL_COLUMN_LABEL:
case SQL_COLUMN_TYPE_NAME:
case SQL_COLUMN_TABLE_NAME:
case SQL_COLUMN_NAME:
case SQL_COLUMN_OWNER_NAME:
case SQL_COLUMN_QUALIFIER_NAME:
if (SQLColAttributes(stmt, col, attr,
(UCHAR*)strData, 256, NULL, NULL) == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
return TclObj(strData, pDb->Encoding());
break;
case SQL_COLUMN_DISPLAY_SIZE:
case SQL_COLUMN_TYPE:
case SQL_COLUMN_PRECISION:
case SQL_COLUMN_SCALE:
case SQL_COLUMN_NULLABLE:
case SQL_COLUMN_UPDATABLE:
if (SQLColAttributes(stmt, col, attr,
NULL, 0, NULL, &wordData) == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
return TclObj(wordData);
break;
default:
THROWSTR("Invalid column data definition")
return TclObj(); // to keep compiler happy
break;
};
}
BOOL TclStatement::Fetch(TclObj& row) {
RETCODE rc;
UWORD i;
//result buffer is reserved here, always only once per statement
if (!resultBuffer && ColumnCount() > 0)
ReserveResultBuffer();
//fetch row
rc = Fetch1();
switch (rc) {
case SQL_NO_DATA_FOUND:
return FALSE;
case SQL_ERROR:
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
case SQL_INVALID_HANDLE:
THROWSTR(strInvalidHandle)
}
for (i=0; i BUFSIZE) {
// get buffer full of data
while ((rc = SQLGetData(stmt, i+1, resultBuffer[i].fTargetType,
(char*) buffer,
BUFSIZE + (resultBuffer[i].fTargetType == SQL_C_CHAR ? 1 : 0),
&(resultBuffer[i].cbValue))) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
element.append(buffer, resultBuffer[i].cbValue == SQL_NO_TOTAL ? BUFSIZE : min(BUFSIZE,resultBuffer[i].cbValue));
}
#undef BUFSIZE
} else {
// allocate space for variable length data
element.setLength(resultBuffer[i].cbValue);
// finally, get the actual data
while ((rc = SQLGetData(stmt, i+1, resultBuffer[i].fTargetType,
(char*) element,
resultBuffer[i].cbValue + 1,
&(resultBuffer[i].cbValue))) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
// set element length again. Some drivers return originally too long value
element.setLength(resultBuffer[i].cbValue);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
}
if (EncodedType(resultBuffer[i].fSqlType))
element.Decode(pDb->Encoding());
row.appendElement(element);
}
}
// success
return TRUE;
}
void TclStatement::SetOption(char* option, char* value) {
RETCODE rc;
UWORD op;
UDWORD val = 0;
op = StrToNum (option, stmtOp);
switch (op) {
case SQL_NOSCAN:
case SQL_ASYNC_ENABLE:
val = StrToNum (value, booleanOp);
break;
case SQL_CONCURRENCY:
val = StrToNum (value, concurrencyOp);
break;
case SQL_QUERY_TIMEOUT:
case SQL_MAX_ROWS:
case SQL_MAX_LENGTH:
case SQL_ROWSET_SIZE:
val = atoi(value);
break;
case SQL_CURSOR_TYPE:
val = StrToNum (value, cursorOp);
break;
}
rc = SQLSetStmtOption(stmt, op, val);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt));
}
}
TclObj TclStatement::GetOption(char* option) {
RETCODE rc;
UWORD op;
UDWORD val;
TclObj retVal;
op = StrToNum (option, stmtOp);
rc = SQLGetStmtOption(stmt, op, &val);
if (rc == SQL_ERROR) {
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt));
}
switch (op) {
case SQL_NOSCAN:
case SQL_ASYNC_ENABLE:
return NumToStr ((short) val, booleanOp);
case SQL_CONCURRENCY:
return TclObj(NumToStr ((short) val, concurrencyOp));
case SQL_QUERY_TIMEOUT:
case SQL_MAX_ROWS:
case SQL_MAX_LENGTH:
case SQL_ROWSET_SIZE:
return TclObj(val);
break;
case SQL_CURSOR_TYPE:
return NumToStr((short) val, cursorOp);
default:
return TclObj(); // to keep compiler happy
}
}
// virtual defined function, overridden in recordset object
RETCODE TclStatement::Fetch1 (void) {
RETCODE rc;
// Allow running in async mode.
while ((rc = SQLFetch(stmt)) == SQL_STILL_EXECUTING) SqlWait(0);
return rc;
}
TclSqlStatement::TclSqlStatement(TclDatabase& db, TclObj sql, bool multiSets)
: TclStatement (db), argDefBuffer (NULL) {
RETCODE rc;
useMultipleResultSets = multiSets;
// encode TclObj to selected character set
sql.Encode(db.Encoding());
// prepare statement
while ((rc = SQLPrepare(stmt, (UCHAR*) sql.EncodedValue(), sql.EncodedLenght())) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, db.DBC(), stmt))
while ((rc = SQLNumParams(stmt, &argCount)) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
if (rc == SQL_ERROR) {
// All drivers do not support this. This is not fatal,
// we just set some upper limit here
argCount = 32;
}
// allocate space for argument definition buffer
if (argCount > 0) {
argDefBuffer = (ArgDefBuffer*) Tcl_Alloc(argCount*sizeof(ArgDefBuffer));
if (!argDefBuffer) {
THROWSTR(strMemoryAllocationFailed);
}
}
// initialize argument definitions, these can be overridden later
// by giving explicit type definitions
for (int i = 0; i < argCount; ++i) {
// default source type always char
while ((rc = SQLDescribeParam(stmt, i,
&argDefBuffer[i].fSqlType,
&argDefBuffer[i].cbColDef,
&argDefBuffer[i].ibScale,
&argDefBuffer[i].fNullable)) == SQL_STILL_EXECUTING) Tcl_Sleep(0);
if (rc == SQL_ERROR) {
// if driver does not support this, give some defaults
argDefBuffer[i].fSqlType = SQL_VARCHAR;
argDefBuffer[i].cbColDef = 0;
argDefBuffer[i].ibScale = 0;
argDefBuffer[i].fNullable = SQL_NULLABLE_UNKNOWN;
}
argDefBuffer[i].fSourceType = MapSqlType (argDefBuffer[i].fSqlType);
}
}
void TclSqlStatement::SetArgDefs(Tcl_Interp *interp, TclObj defObjList) {
int argc, subc, tmpInt;
TclObj tmpObj;
TclObj typeDefObj;
argc = defObjList.llenght(interp);
if (argc > argCount) {
THROWSTR("Too many argument definitions");
}
for (int i = 0; i < argc; ++i) {
// corresponding single type definition
typeDefObj = defObjList.lindex(i, interp);
// argument definition list length
subc = typeDefObj.llenght(interp);
// type definition parts: {type lenght scale}
switch (subc) {
case 3:
tmpInt = typeDefObj.lindex(2, interp).asInt(interp);
argDefBuffer[i].ibScale = (SWORD) tmpInt;
case 2:
tmpInt = typeDefObj.lindex(1, interp).asInt(interp);
argDefBuffer[i].cbColDef = tmpInt;
case 1:
tmpObj = typeDefObj.lindex(0, interp);
argDefBuffer[i].fSqlType = SqlType(tmpObj);
argDefBuffer[i].fSourceType = MapSqlType (argDefBuffer[i].fSqlType);
break;
default:
THROWSTR("Invalid type definition")
}
}
}
void TclSqlStatement::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
int argc, i, sqlarglen;
TclObj tmpObj, tmpObj2;
TclObj sqlArguments;
TclObj sqlArg;
switch (objc) {
case 2:
// syntax removed from tclodbc 2.1, use argument definition in
// statement creation
THROWSTR(strOldSyntax)
// set argument definitions in buffer, overriding any previously
// set or default values
SetArgDefs(interp, objv[0]);
case 1:
// bind optional sql variables
// sql argument count = count of items in the last argument
// we duplicate object here, because we want to decode each value
sqlArguments = TclObj(objv[objc-1]);
argc = sqlArguments.llenght(interp);
if (argc > argCount)
THROWSTR("Too many arguments")
for (i = 0; i < argc; ++i) {
sqlArg = sqlArguments.lindex(i, interp);
// only defined types are encoded
if (EncodedType(argDefBuffer[i].fSqlType))
sqlArg.Encode(pDb->Encoding());
sqlarglen = sqlArg.EncodedLenght();
if (sqlarglen == 0) {
argDefBuffer[i].cbValue = SQL_NULL_DATA;
} else {
argDefBuffer[i].cbValue = sqlarglen;
if (argDefBuffer[i].cbColDef == 0)
// this can't be zero, give here the best guess
argDefBuffer[i].cbColDef = sqlarglen;
}
rc = SQLBindParameter(stmt, (UWORD)(i+1), SQL_PARAM_INPUT,
argDefBuffer[i].fSourceType, argDefBuffer[i].fSqlType,
argDefBuffer[i].cbColDef, argDefBuffer[i].ibScale,
(void*) sqlArg.EncodedValue(), sqlarglen+1, &argDefBuffer[i].cbValue);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
}
case 0:
break;
default:
THROWSTR("Invalid arguments, should be stmt [argtypelist] [arglist]")
}
// execute sql, always close previous cursor if necessary
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// Allow running in async mode.
while ((rc = SQLExecute(stmt)) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
}
void TclTableQuery::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
TclObj tableName;
if (objc) {
tableName = TclObj(objv[0]);
tableName.Encode(pDb->Encoding());
}
// close previous cursor
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// read table information
while ((rc = SQLTables(stmt, NULL, 0, NULL, 0,
tableName.isNull() ? NULL : (UCHAR*) tableName.EncodedValue(),
tableName.isNull() ? 0 : tableName.EncodedLenght(),
NULL, 0)) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
void TclColumnQuery::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
TclObj tableName;
if (objc) {
tableName = TclObj(objv[0]);
tableName.Encode(pDb->Encoding());
}
// close previous cursor
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// read column information
while ((rc = SQLColumns(stmt, NULL, 0, NULL, 0,
tableName.isNull() ? NULL : (UCHAR*) tableName.EncodedValue(),
tableName.isNull() ? 0 : tableName.EncodedLenght(), NULL, 0)) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
void TclIndexQuery::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
TclObj tableName;
if (objc != 1)
THROWSTR("wrong # args, tablename is required")
tableName = TclObj(objv[0]);
tableName.Encode(pDb->Encoding());
// close previous cursor
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// read index information
while ((rc = SQLStatistics(stmt, NULL, 0, NULL, 0, (UCHAR*) tableName.EncodedValue(),
tableName.EncodedLenght(), SQL_INDEX_ALL, SQL_ENSURE)) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
void TclTypeInfoQuery::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
TclObj typeId;
if (objc != 1)
THROWSTR("wrong # args, typeid is required")
typeId = TclObj(objv[0]);
// close previous cursor
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// read type information
while ((rc = SQLGetTypeInfo(stmt, typeId.asInt())) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
void TclPrimaryKeysQuery::Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) {
RETCODE rc;
TclObj tableName;
if (objc != 1)
THROWSTR("wrong # args, tablename is required")
tableName = TclObj(objv[0]);
tableName.Encode(pDb->Encoding());
// close previous cursor
rc = SQLFreeStmt(stmt, SQL_CLOSE);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
else if (rc == SQL_INVALID_HANDLE)
THROWSTR(strInvalidHandle)
// read type information
while ((rc = SQLPrimaryKeys(stmt, (UCHAR*) strEmpty, 0, (UCHAR*) strEmpty, 0,
(UCHAR*) tableName.EncodedValue(), tableName.EncodedLenght())) == SQL_STILL_EXECUTING) SqlWait(1);
if (rc == SQL_ERROR)
THROWOBJ(SqlErr(env, SQL_NULL_HDBC, stmt))
}
void TclStatement::SqlWait (int delay) {
// Do single event.
// If there was nothing to do, sleep a bit before possibly looping again
// to avoid busy loop.
if (!Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT) && delay) {
Tcl_Sleep(delay);
}
}
tclodbc-2.5.1/config.guess 0000644 0001750 0000027 00000126260 10630251202 013720 0 ustar frankie #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2006-07-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, 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.
# Originally written by Per Bothner .
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[3456]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
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`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
tclodbc-2.5.1/encoding.cxx 0000644 0001750 0000027 00000011312 11011550215 013704 0 ustar frankie /**********************************************************************
- TCLODBC COPYRIGHT NOTICE -
This software is copyrighted by Roy Nurmi, contact address by email at
Roy.Nurmi@iki.fi. The following terms apply to all files associated with
the software unless explicitly disclaimed in individual files.
The author hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
***********************************************************************/
#include
#include
#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1
void FreeTclodbcEncodedString(Tcl_Obj *p) {
//extern Tcl_ObjType TclodbcEncodedString;
Tcl_DString* pds = (Tcl_DString*) p->internalRep.twoPtrValue.ptr2;
if (pds) {
Tcl_DStringFree(pds);
Tcl_Free((char*)pds);
}
if (p->internalRep.twoPtrValue.ptr1)
Tcl_FreeEncoding((Tcl_Encoding) p->internalRep.twoPtrValue.ptr1);
p->internalRep.twoPtrValue.ptr1 = NULL;
p->internalRep.twoPtrValue.ptr2 = NULL;
p->typePtr = NULL;
}
void DuplicateTclodbcEncodedString(Tcl_Obj *src, Tcl_Obj *dst) {
Tcl_DString* pds1;
Tcl_DString* pds2;
// copy encoding value
dst->internalRep.twoPtrValue.ptr1 = src->internalRep.twoPtrValue.ptr1;
// duplicate DString
pds1 = (Tcl_DString*) src->internalRep.twoPtrValue.ptr2;
if (pds1) {
pds2 = (Tcl_DString*) Tcl_Alloc(sizeof(Tcl_DString));
Tcl_DStringInit(pds2);
Tcl_DStringAppend(pds2, Tcl_DStringValue(pds1), Tcl_DStringLength(pds1));
dst->internalRep.twoPtrValue.ptr2 = pds2;
} else {
dst->internalRep.twoPtrValue.ptr2 = NULL;
}
}
void UpdateTclodbcEncodedString(Tcl_Obj *o) {
unsigned int len;
Tcl_Encoding e = (Tcl_Encoding) o->internalRep.twoPtrValue.ptr1;
Tcl_DString* pds = (Tcl_DString*) o->internalRep.twoPtrValue.ptr2;
// This is needed only, if external value is actually stored in ptr2.
// In any other case the representations are equal, and decoding is
// not necessary.
if (pds) {
// this encodes strings from 'normal' strings to UTF-8, which is
// the internal representation of tcl 8.0
Tcl_DString ds;
Tcl_DStringInit(&ds);
Tcl_ExternalToUtfDString (e, Tcl_DStringValue(pds), Tcl_DStringLength(pds), &ds);
len = Tcl_DStringLength(&ds);
o->bytes = Tcl_Alloc(len+1);
o->bytes[len] = '\0';
o->length = len;
memcpy (o->bytes, Tcl_DStringValue(&ds), len);
Tcl_DStringFree(&ds);
}
}
int SetTclodbcEncodedString(Tcl_Interp *interp, Tcl_Obj *p) {
if (interp)
Tcl_SetResult(interp, "Not supported", TCL_STATIC);
return TCL_ERROR;
}
Tcl_ObjType TclodbcEncodedString = {
"TclodbcEncodedString",
FreeTclodbcEncodedString,
DuplicateTclodbcEncodedString,
UpdateTclodbcEncodedString,
SetTclodbcEncodedString
};
#endif
tclodbc-2.5.1/config.sub 0000644 0001750 0000027 00000077460 10630251202 013372 0 ustar frankie #! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2006-09-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, 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.
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
tclodbc-2.5.1/tclconfig/ 0002755 0001750 0000027 00000000000 10607402667 013367 5 ustar frankie tclodbc-2.5.1/tclconfig/install-sh 0000755 0001750 0000027 00000004212 10607402667 015370 0 ustar frankie #!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# 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}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
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;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
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`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0
tclodbc-2.5.1/tclconfig/README.txt 0000644 0001750 0000027 00000001453 10607402667 015066 0 ustar frankie These files comprise the basic building blocks for a Tcl Extension
Architecture (TEA) extension. For more information on TEA see:
http://www.tcl.tk/doc/tea/
This package is part of the Tcl project at SourceForge, and latest
sources should be available there:
http://tcl.sourceforge.net/
This package is a freely available open source package. You can do
virtually anything you like with it, such as modifying it, redistributing
it, and selling it either in whole or in part.
CONTENTS
========
The following is a short description of the files you will find in
the sample extension.
README.txt This file
install-sh Program used for copying binaries and script files
to their install locations.
tcl.m4 Collection of Tcl autoconf macros. Included by a package's
aclocal.m4 to define SC_* macros.
tclodbc-2.5.1/tclconfig/tcl.m4 0000644 0001750 0000027 00000361710 11011550215 014400 0 ustar frankie # tcl.m4 --
#
# This file provides a set of autoconf macros to help TEA-enable
# a Tcl extension.
#
# Copyright (c) 1999-2000 Ajuba Solutions.
# Copyright (c) 2002-2005 ActiveState Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: tcl.m4,v 1.6 2006/01/26 00:47:54 hobbs Exp $
AC_PREREQ(2.50)
dnl TEA extensions pass this us the version of TEA they think they
dnl are compatible with (must be set in TEA_INIT below)
dnl TEA_VERSION="3.5"
# Possible values for key variables defined:
#
# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
# TEA_PLATFORM - windows unix
#
#------------------------------------------------------------------------
# TEA_PATH_TCLCONFIG --
#
# Locate the tclConfig.sh file and perform a sanity check on
# the Tcl compile flags
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --with-tcl=...
#
# Defines the following vars:
# TCL_BIN_DIR Full path to the directory containing
# the tclConfig.sh file
#------------------------------------------------------------------------
AC_DEFUN(TEA_PATH_TCLCONFIG, [
dnl Make sure we are initialized
AC_REQUIRE([TEA_INIT])
#
# Ok, lets find the tcl configuration
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-tcl
#
if test x"${no_tcl}" = x ; then
# we reset no_tcl in case something fails here
no_tcl=true
AC_ARG_WITH(tcl,
AC_HELP_STRING([--with-tcl],
[directory containing tcl configuration (tclConfig.sh)]),
with_tclconfig=${withval})
AC_MSG_CHECKING([for Tcl configuration])
AC_CACHE_VAL(ac_cv_c_tclconfig,[
# First check to see if --with-tcl was specified.
if test x"${with_tclconfig}" != x ; then
case ${with_tclconfig} in
*/tclConfig.sh )
if test -f ${with_tclconfig}; then
AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
fi ;;
esac
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
else
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
fi
fi
# then check for a private Tcl installation
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in \
../tcl \
`ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
../../tcl \
`ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
../../../tcl \
`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
# on Darwin, check in Framework installation locations
if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
`ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
break
fi
done
fi
# on Windows, check in common installation locations
if test "${TEA_PLATFORM}" = "windows" \
-a x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d C:/Tcl/lib 2>/dev/null` \
`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
# check in a few other private locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in \
${srcdir}/../tcl \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
AC_MSG_WARN([Can't find Tcl configuration definitions])
exit 0
else
no_tcl=
TCL_BIN_DIR=${ac_cv_c_tclconfig}
AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
fi
fi
])
#------------------------------------------------------------------------
# TEA_PATH_TKCONFIG --
#
# Locate the tkConfig.sh file
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --with-tk=...
#
# Defines the following vars:
# TK_BIN_DIR Full path to the directory containing
# the tkConfig.sh file
#------------------------------------------------------------------------
AC_DEFUN(TEA_PATH_TKCONFIG, [
#
# Ok, lets find the tk configuration
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-tk
#
if test x"${no_tk}" = x ; then
# we reset no_tk in case something fails here
no_tk=true
AC_ARG_WITH(tk,
AC_HELP_STRING([--with-tk],
[directory containing tk configuration (tkConfig.sh)]),
with_tkconfig=${withval})
AC_MSG_CHECKING([for Tk configuration])
AC_CACHE_VAL(ac_cv_c_tkconfig,[
# First check to see if --with-tkconfig was specified.
if test x"${with_tkconfig}" != x ; then
case ${with_tkconfig} in
*/tkConfig.sh )
if test -f ${with_tkconfig}; then
AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'`
fi ;;
esac
if test -f "${with_tkconfig}/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
else
AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
fi
fi
# then check for a private Tk library
if test x"${ac_cv_c_tkconfig}" = x ; then
for i in \
../tk \
`ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
../../tk \
`ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
../../../tk \
`ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
if test -f "$i/unix/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
# on Darwin, check in Framework installation locations
if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
`ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tk.framework/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
break
fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tkconfig}" = x ; then
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd $i; pwd)`
break
fi
done
fi
# on Windows, check in common installation locations
if test "${TEA_PLATFORM}" = "windows" \
-a x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d C:/Tcl/lib 2>/dev/null` \
`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
# check in a few other private locations
if test x"${ac_cv_c_tkconfig}" = x ; then
for i in \
${srcdir}/../tk \
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
if test -f "$i/unix/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_tkconfig}" = x ; then
TK_BIN_DIR="# no Tk configs found"
AC_MSG_WARN([Can't find Tk configuration definitions])
exit 0
else
no_tk=
TK_BIN_DIR=${ac_cv_c_tkconfig}
AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
fi
fi
])
#------------------------------------------------------------------------
# TEA_LOAD_TCLCONFIG --
#
# Load the tclConfig.sh file
#
# Arguments:
#
# Requires the following vars to be set:
# TCL_BIN_DIR
#
# Results:
#
# Subst the following vars:
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
#
#------------------------------------------------------------------------
AC_DEFUN(TEA_LOAD_TCLCONFIG, [
AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
AC_MSG_RESULT([loading])
. ${TCL_BIN_DIR}/tclConfig.sh
else
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
# of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
if test -f ${TCL_BIN_DIR}/Makefile ; then
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
elif test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
# against Tcl.framework installed in an arbitary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
for i in "`cd ${TCL_BIN_DIR}; pwd`" \
"`cd ${TCL_BIN_DIR}/../..; pwd`"; do
if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
break
fi
done
fi
if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
fi
;;
esac
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_STUB_LIB_FILE)
AC_SUBST(TCL_STUB_LIB_FLAG)
AC_SUBST(TCL_STUB_LIB_SPEC)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_DEFS)
AC_SUBST(TCL_EXTRA_CFLAGS)
AC_SUBST(TCL_LD_FLAGS)
AC_SUBST(TCL_SHLIB_LD_LIBS)
])
#------------------------------------------------------------------------
# TEA_LOAD_TKCONFIG --
#
# Load the tkConfig.sh file
#
# Arguments:
#
# Requires the following vars to be set:
# TK_BIN_DIR
#
# Results:
#
# Sets the following vars that should be in tkConfig.sh:
# TK_BIN_DIR
#------------------------------------------------------------------------
AC_DEFUN(TEA_LOAD_TKCONFIG, [
AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
AC_MSG_RESULT([loading])
. ${TK_BIN_DIR}/tkConfig.sh
else
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
fi
# eval is required to do the TK_DBGX substitution
eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
# If the TK_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TK_LIB_SPEC will be set to the value
# of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
# instead of TK_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
if test -f ${TK_BIN_DIR}/Makefile ; then
TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
elif test "`uname -s`" = "Darwin"; then
# If Tk was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
# against Tk.framework installed in an arbitary location.
case ${TK_DEFS} in
*TK_FRAMEWORK*)
if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
for i in "`cd ${TK_BIN_DIR}; pwd`" \
"`cd ${TK_BIN_DIR}/../..; pwd`"; do
if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
break
fi
done
fi
if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
fi
;;
esac
fi
# eval is required to do the TK_DBGX substitution
eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
# Ensure windowingsystem is defined
if test "${TEA_PLATFORM}" = "unix" ; then
case ${TK_DEFS} in
*MAC_OSX_TK*)
AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
TEA_WINDOWINGSYSTEM="aqua"
;;
*)
TEA_WINDOWINGSYSTEM="x11"
;;
esac
elif test "${TEA_PLATFORM}" = "windows" ; then
TEA_WINDOWINGSYSTEM="win32"
fi
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
AC_SUBST(TK_LIB_FILE)
AC_SUBST(TK_LIB_FLAG)
AC_SUBST(TK_LIB_SPEC)
AC_SUBST(TK_STUB_LIB_FILE)
AC_SUBST(TK_STUB_LIB_FLAG)
AC_SUBST(TK_STUB_LIB_SPEC)
AC_SUBST(TK_LIBS)
AC_SUBST(TK_XINCLUDES)
])
#------------------------------------------------------------------------
# TEA_ENABLE_SHARED --
#
# Allows the building of shared libraries
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --enable-shared=yes|no
#
# Defines the following vars:
# STATIC_BUILD Used for building import/export libraries
# on Windows.
#
# Sets the following vars:
# SHARED_BUILD Value of 1 or 0
#------------------------------------------------------------------------
AC_DEFUN(TEA_ENABLE_SHARED, [
AC_MSG_CHECKING([how to build libraries])
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--enable-shared],
[build and link with shared libraries (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" ; then
AC_MSG_RESULT([shared])
SHARED_BUILD=1
else
AC_MSG_RESULT([static])
SHARED_BUILD=0
AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
fi
AC_SUBST(SHARED_BUILD)
])
#------------------------------------------------------------------------
# TEA_ENABLE_THREADS --
#
# Specify if thread support should be enabled. If "yes" is specified
# as an arg (optional), threads are enabled by default, "no" means
# threads are disabled. "yes" is the default.
#
# TCL_THREADS is checked so that if you are compiling an extension
# against a threaded core, your extension must be compiled threaded
# as well.
#
# Note that it is legal to have a thread enabled extension run in a
# threaded or non-threaded Tcl core, but a non-threaded extension may
# only run in a non-threaded Tcl core.
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --enable-threads
#
# Sets the following vars:
# THREADS_LIBS Thread library(s)
#
# Defines the following vars:
# TCL_THREADS
# _REENTRANT
# _THREAD_SAFE
#
#------------------------------------------------------------------------
AC_DEFUN(TEA_ENABLE_THREADS, [
AC_ARG_ENABLE(threads,
AC_HELP_STRING([--enable-threads],
[build with threads]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
TCL_THREADS=1
if test "${TEA_PLATFORM}" != "windows" ; then
# We are always OK on Windows, so check what this platform wants:
# USE_THREAD_ALLOC tells us to try the special thread-based
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC, 1,
[Do we want to use the threaded memory allocator?])
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
if test "`uname -s`" = "SunOS" ; then
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
[Do we really want to follow the standard? Yes we do!])
fi
AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
if test "$tcl_ok" = "no"; then
# Check a little harder for __pthread_mutex_init in the same
# library, as some systems hide it there until pthread.h is
# defined. We could alternatively do an AC_TRY_COMPILE with
# pthread.h, but that will work with libpthread really doesn't
# exist, like AIX 4.2. [Bug: 4359]
AC_CHECK_LIB(pthread, __pthread_mutex_init,
tcl_ok=yes, tcl_ok=no)
fi
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -lpthread"
else
AC_CHECK_LIB(pthreads, pthread_mutex_init,
tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -lpthreads"
else
AC_CHECK_LIB(c, pthread_mutex_init,
tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = "no"; then
AC_CHECK_LIB(c_r, pthread_mutex_init,
tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = "yes"; then
# The space is needed
THREADS_LIBS=" -pthread"
else
TCL_THREADS=0
AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
fi
fi
fi
fi
fi
else
TCL_THREADS=0
fi
# Do checking message here to not mess up interleaved configure output
AC_MSG_CHECKING([for building with threads])
if test "${TCL_THREADS}" = 1; then
AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
AC_MSG_RESULT([yes (default)])
else
AC_MSG_RESULT([no])
fi
# TCL_THREADS sanity checking. See if our request for building with
# threads is the same as the way Tcl was built. If not, warn the user.
case ${TCL_DEFS} in
*THREADS=1*)
if test "${TCL_THREADS}" = "0"; then
AC_MSG_WARN([
Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
that IS thread-enabled. It is recommended to use --enable-threads.])
fi
;;
*)
if test "${TCL_THREADS}" = "1"; then
AC_MSG_WARN([
--enable-threads requested, but building against a Tcl that is NOT
thread-enabled. This is an OK configuration that will also run in
a thread-enabled core.])
fi
;;
esac
AC_SUBST(TCL_THREADS)
])
#------------------------------------------------------------------------
# TEA_ENABLE_SYMBOLS --
#
# Specify if debugging symbols should be used.
# Memory (TCL_MEM_DEBUG) debugging can also be enabled.
#
# Arguments:
# none
#
# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
# Requires the following vars to be set in the Makefile:
# CFLAGS_DEFAULT
# LDFLAGS_DEFAULT
#
# Results:
#
# Adds the following arguments to configure:
# --enable-symbols
#
# Defines the following vars:
# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
# Sets to $(CFLAGS_OPTIMIZE) if false
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
# Sets to $(LDFLAGS_OPTIMIZE) if false
# DBGX Formerly used as debug library extension;
# always blank now.
#
#------------------------------------------------------------------------
AC_DEFUN(TEA_ENABLE_SYMBOLS, [
dnl Make sure we are initialized
AC_REQUIRE([TEA_CONFIG_CFLAGS])
AC_MSG_CHECKING([for build with symbols])
AC_ARG_ENABLE(symbols,
AC_HELP_STRING([--enable-symbols],
[build with debugging symbols (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
AC_MSG_RESULT([no])
else
CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
if test "$tcl_ok" = "yes"; then
AC_MSG_RESULT([yes (standard debugging)])
fi
fi
if test "${TEA_PLATFORM}" != "windows" ; then
LDFLAGS_DEFAULT="${LDFLAGS}"
fi
AC_SUBST(TCL_DBGX)
AC_SUBST(CFLAGS_DEFAULT)
AC_SUBST(LDFLAGS_DEFAULT)
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
fi
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
if test "$tcl_ok" = "all"; then
AC_MSG_RESULT([enabled symbols mem debugging])
else
AC_MSG_RESULT([enabled $tcl_ok debugging])
fi
fi
])
#------------------------------------------------------------------------
# TEA_ENABLE_LANGINFO --
#
# Allows use of modern nl_langinfo check for better l10n.
# This is only relevant for Unix.
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --enable-langinfo=yes|no (default is yes)
#
# Defines the following vars:
# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
#
#------------------------------------------------------------------------
AC_DEFUN(TEA_ENABLE_LANGINFO, [
AC_ARG_ENABLE(langinfo,
AC_HELP_STRING([--enable-langinfo],
[use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
[langinfo_ok=$enableval], [langinfo_ok=yes])
HAVE_LANGINFO=0
if test "$langinfo_ok" = "yes"; then
AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
fi
AC_MSG_CHECKING([whether to use nl_langinfo])
if test "$langinfo_ok" = "yes"; then
AC_CACHE_VAL(tcl_cv_langinfo_h,
AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);],
[tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no]))
AC_MSG_RESULT([$tcl_cv_langinfo_h])
if test $tcl_cv_langinfo_h = yes; then
AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
fi
else
AC_MSG_RESULT([$langinfo_ok])
fi
])
#--------------------------------------------------------------------
# TEA_CONFIG_SYSTEM
#
# Determine what the system is (some things cannot be easily checked
# on a feature-driven basis, alas). This can usually be done via the
# "uname" command, but there are a few systems, like Next, where
# this doesn't work.
#
# Arguments:
# none
#
# Results:
# Defines the following var:
#
# system - System/platform/version identification code.
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_CONFIG_SYSTEM, [
AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
if test "${TEA_PLATFORM}" = "windows" ; then
tcl_cv_sys_version=windows
elif test -f /usr/lib/NextStep/software_version; then
tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_WARN([can't find uname command])
tcl_cv_sys_version=unknown
else
# Special check for weird MP-RAS system (uname returns weird
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
fi
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
fi
fi
])
system=$tcl_cv_sys_version
])
#--------------------------------------------------------------------
# TEA_CONFIG_CFLAGS
#
# Try to determine the proper flags to pass to the compiler
# for building shared libraries and other such nonsense.
#
# Arguments:
# none
#
# Results:
#
# Defines and substitutes the following vars:
#
# DL_OBJS - Name of the object file that implements dynamic
# loading for Tcl on this system.
# DL_LIBS - Library file(s) to include in tclsh and other base
# applications in order for the "load" command to work.
# LDFLAGS - Flags to pass to the compiler when linking object
# files into an executable application binary such
# as tclsh.
# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
# that tell the run-time dynamic linker where to look
# for shared libraries such as libtcl.so. Depends on
# the variable LIB_RUNTIME_DIR in the Makefile. Could
# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
# that tell the run-time dynamic linker where to look
# for shared libraries such as libtcl.so. Depends on
# the variable LIB_RUNTIME_DIR in the Makefile.
# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
# of a shared library (may request position-independent
# code, among other things).
# SHLIB_LD - Base command to use for combining object files
# into a shared library.
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
# creating shared libraries. This symbol typically
# goes at the end of the "ld" commands that build
# shared libraries. The value of the symbol is
# "${LIBS}" if all of the dependent libraries should
# be specified when creating a shared library. If
# dependent libraries should not be specified (as on
# SunOS 4.x, where they cause the link to fail, or in
# general if Tcl and Tk aren't themselves shared
# libraries), then this symbol has an empty string
# as its value.
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
# extensions. An empty string means we don't know how
# to use shared libraries on this platform.
# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
# in a static or shared library name, using the $VERSION variable
# to put the version in the right place. This is used
# by platforms that need non-standard library names.
# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
# to have a version after the .so, and ${VERSION}.a
# on AIX, since a shared library needs to have
# a .a extension whereas shared objects for loadable
# extensions have a .so extension. Defaults to
# ${VERSION}${SHLIB_SUFFIX}.
# TCL_NEEDS_EXP_FILE -
# 1 means that an export file is needed to link to a
# shared library.
# TCL_EXP_FILE - The name of the installed export / import file which
# should be used to link to the Tcl shared library.
# Empty if Tcl is unshared.
# TCL_BUILD_EXP_FILE -
# The name of the built export / import file which
# should be used to link to the Tcl shared library.
# Empty if Tcl is unshared.
# CFLAGS_DEBUG -
# Flags used when running the compiler in debug mode
# CFLAGS_OPTIMIZE -
# Flags used when running the compiler in optimize mode
# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_CONFIG_CFLAGS, [
dnl Make sure we are initialized
AC_REQUIRE([TEA_INIT])
# Step 0.a: Enable 64 bit support?
AC_MSG_CHECKING([if 64bit support is requested])
AC_ARG_ENABLE(64bit,
AC_HELP_STRING([--enable-64bit],
[enable 64bit support (default: off)]),
[do64bit=$enableval], [do64bit=no])
AC_MSG_RESULT([$do64bit])
# Step 0.b: Enable Solaris 64 bit VIS support?
AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
AC_ARG_ENABLE(64bit-vis,
AC_HELP_STRING([--enable-64bit-vis],
[enable 64bit Sparc VIS support (default: off)]),
[do64bitVIS=$enableval], [do64bitVIS=no])
AC_MSG_RESULT([$do64bitVIS])
if test "$do64bitVIS" = "yes"; then
# Force 64bit on with VIS
do64bit=yes
fi
# Step 0.c: Cross-compiling options for Windows/CE builds?
if test "${TEA_PLATFORM}" = "windows" ; then
AC_MSG_CHECKING([if Windows/CE build is requested])
AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no])
AC_MSG_RESULT([$doWince])
fi
# Step 1: set the variable "system" to hold the name and version number
# for the system.
TEA_CONFIG_SYSTEM
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Require ranlib early so we can override it in special cases below.
AC_REQUIRE([AC_PROG_RANLIB])
# Step 3: set configuration options based on system name and version.
# This is similar to Tcl's unix/tcl.m4 except that we've added a
# "windows" case.
do64bit_ok=no
LDFLAGS_ORIG="$LDFLAGS"
# When ld needs options to work in 64-bit mode, put them in
# LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
# is disabled by the user. [Bug 1016796]
LDFLAGS_ARCH=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall -Wno-implicit-int"
else
CFLAGS_WARNING=""
fi
TCL_NEEDS_EXP_FILE=0
TCL_BUILD_EXP_FILE=""
TCL_EXP_FILE=""
dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
dnl AC_CHECK_TOOL(AR, ar)
AC_CHECK_PROG(AR, ar, ar)
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
case $system in
windows)
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
# This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
# MACHINE is IX86 for LINK, but this is used by the manifest,
# which requires x86|amd64|ia64.
MACHINE="X86"
if test "$do64bit" != "no" ; then
if test "x${MSSDK}x" = "xx" ; then
MSSDK="C:/Progra~1/Microsoft Platform SDK"
fi
MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
PATH64=""
case "$do64bit" in
amd64|x64|yes)
MACHINE="AMD64" ; # default to AMD64 64-bit build
PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
;;
ia64)
MACHINE="IA64"
PATH64="${MSSDK}/Bin/Win64"
;;
esac
if test ! -d "${PATH64}" ; then
AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
AC_MSG_WARN([Ensure latest Platform SDK is installed])
do64bit="no"
else
AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
do64bit_ok="yes"
fi
fi
if test "$doWince" != "no" ; then
if test "$do64bit" != "no" ; then
AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
fi
if test "$GCC" = "yes" ; then
AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
fi
TEA_PATH_CELIB
# Set defaults for common evc4/PPC2003 setup
# Currently Tcl requires 300+, possibly 420+ for sockets
CEVERSION=420; # could be 211 300 301 400 420 ...
TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
ARCH=ARM; # could be ARM MIPS X86EM ...
PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
if test "$doWince" != "yes"; then
# If !yes then the user specified something
# Reset ARCH to allow user to skip specifying it
ARCH=
eval `echo $doWince | awk -F, '{ \
if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
}'`
if test "x${ARCH}" = "x" ; then
ARCH=$TARGETCPU;
fi
fi
OSVERSION=WCE$CEVERSION;
if test "x${WCEROOT}" = "x" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
if test ! -d "${WCEROOT}" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
fi
fi
if test "x${SDKROOT}" = "x" ; then
SDKROOT="C:/Program Files/Windows CE Tools"
if test ! -d "${SDKROOT}" ; then
SDKROOT="C:/Windows CE Tools"
fi
fi
WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
-o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
doWince="no"
else
# We could PATH_NOSPACE these, but that's not important,
# as long as we quote them when used.
CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
fi
CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
fi
fi
if test "$GCC" != "yes" ; then
if test "${SHARED_BUILD}" = "0" ; then
runtime=-MT
else
runtime=-MD
fi
if test "$do64bit" != "no" ; then
# All this magic is necessary for the Win64 SDK RC1 - hobbs
CC="\"${PATH64}/cl.exe\""
CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
RC="\"${MSSDK}/bin/rc.exe\""
lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
# Avoid 'unresolved external symbol __security_cookie'
# errors, c.f. http://support.microsoft.com/?id=894573
TEA_ADD_LIBS([bufferoverflowU.lib])
elif test "$doWince" != "no" ; then
CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
if test "${TARGETCPU}" = "X86"; then
CC="\"${CEBINROOT}/cl.exe\""
else
CC="\"${CEBINROOT}/cl${ARCH}.exe\""
fi
CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
if test "${SHARED_BUILD}" = "1" ; then
# Static CE builds require static celib as well
defs="${defs} _DLL"
fi
for i in $defs ; do
AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
done
AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
CFLAGS_DEBUG="-nologo -Zi -Od"
CFLAGS_OPTIMIZE="-nologo -Ox"
lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
LINKBIN="\"${CEBINROOT}/link.exe\""
AC_SUBST(CELIB_DIR)
else
RC="rc"
lflags="-nologo"
LINKBIN="link"
CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
fi
fi
if test "$GCC" = "yes"; then
# mingw gcc mode
RC="windres"
CFLAGS_DEBUG="-g"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
SHLIB_LD="$CC -shared"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
else
SHLIB_LD="${LINKBIN} -dll ${lflags}"
# link -lib only works when -lib is the first arg
STLIB_LD="${LINKBIN} -lib ${lflags}"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
PATHTYPE=-w
# For information on what debugtype is most useful, see:
# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
# This essentially turns it all on.
LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
LDFLAGS_OPTIMIZE="-release"
if test "$doWince" != "no" ; then
LDFLAGS_CONSOLE="-link ${lflags}"
LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
else
LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
TCL_LIB_VERSIONS_OK=nodots
# Bogus to avoid getting this turned off
DL_OBJS="tclLoadNone.obj"
;;
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r)
# ok ...
;;
*)
CC=${CC}_r
;;
esac
AC_MSG_RESULT([Using $CC for compiling with threads])
fi
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
LD_LIBRARY_PATH_VAR="LIBPATH"
# Check to enable 64-bit flags for compiler/linker on AIX 4+
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported with GCC on $system])
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
fi
fi
if test "`uname -m`" = "ia64" ; then
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# AIX-5 has dl* in libc.so
DL_LIBS=""
if test "$GCC" = "yes" ; then
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
fi
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
else
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
else
SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
fi
SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
fi
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
AC_LIBOBJ([tclLoadAix])
DL_LIBS="-lld"
fi
# On AIX <=v4 systems, libbsd.a has to be linked in to support
# non-blocking file IO. This library has to be linked in after
# the MATH_LIBS or it breaks the pow() function. The way to
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
# This library also supplies gettimeofday.
#
# AIX does not have a timezone field in struct tm. When the AIX
# bsd library is used, the timezone global and the gettimeofday
# methods are to be avoided for timezone deduction instead, we
# deduce the timezone by comparing the localtime result on a
# known GMT value.
AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
if test $libbsd = yes; then
MATH_LIBS="$MATH_LIBS -lbsd"
AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?])
fi
;;
BeOS*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -nostart"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
#-----------------------------------------------------------
# Check for inet_ntoa in -lbind, for BeOS (which also needs
# -lsocket, even if the network functions are in -lnet which
# is always linked to, for compatibility.
#-----------------------------------------------------------
AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD="cc -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -export-dynamic"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
dgux*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
HP-UX-*.11.*)
# Use updated header definitions where possible
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
# Needed by Tcl, but not most extensions
#AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
#LIBS="$LIBS -lxnet" # Use the XOPEN network library
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
#CFLAGS="$CFLAGS +DAportable"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
hpux_arch=`${CC} -dumpmachine`
case $hpux_arch in
hppa64*)
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS='${LIBS}'
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
AC_MSG_WARN([64bit mode not supported with GCC on $system])
;;
esac
else
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
LDFLAGS_ARCH="+DD64"
fi
fi
;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS=""
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
;;
IRIX-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mabi=n32"
LDFLAGS="$LDFLAGS -mabi=n32"
else
case $system in
IRIX-6.3)
# Use to build 6.2 compatible binaries on 6.3.
CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
;;
*)
CFLAGS="$CFLAGS -n32"
;;
esac
LDFLAGS="$LDFLAGS -n32"
fi
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported by gcc])
else
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
LDFLAGS_ARCH="-64"
fi
fi
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
# when you inline the string and math operations. Turn this off to
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
# The combo of gcc + glibc has a bug related
# to inlining of functions like strtod(). The
# -fno-builtin flag should address this problem
# but it does not work. The -fno-inline flag
# is kind of overkill but it works.
# Disable inlining only when one of the
# files in compat/*.c is being linked in.
if test x"${USE_COMPAT}" != x ; then
CFLAGS="$CFLAGS -fno-inline"
fi
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD="${CC} -shared"
DL_OBJS=""
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE=-02
SHLIB_LD="${CC} -shared "
DL_OBJS="tclLoadDl.o"
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,-Bexport"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[[1-2]].*)
# NetBSD/SPARC needs -fPIC, -fpic will not do.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
if test $tcl_cv_ld_elf = yes; then
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
else
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
fi
# Ancient FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
# OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
case `machine` in
sparc|sparc64)
SHLIB_CFLAGS="-fPIC";;
*)
SHLIB_CFLAGS="-fpic";;
esac
SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
if test $tcl_cv_ld_elf = yes; then
LDFLAGS=-Wl,-export-dynamic
else
LDFLAGS=""
fi
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
FreeBSD-*)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "${TCL_THREADS}" = "1" ; then
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
case $system in
FreeBSD-3.*)
# FreeBSD-3 doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
TCL_LIB_VERSIONS_OK=nodots
;;
esac
;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
if test $do64bit = yes; then
do64bit_ok=yes
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
fi
# TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
LDFLAGS=$hold_ldflags])
if test $tcl_cv_ld_single_module = yes; then
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
# Don't use -prebind when building for Mac OS X 10.4 or later only:
test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'`" -lt 4 && \
LDFLAGS="$LDFLAGS -prebind"
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
LDFLAGS=$hold_ldflags])
if test $tcl_cv_ld_search_paths_first = yes; then
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
# TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
# for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
# at present (no 64bit GUI libraries).
test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
SHLIB_LD="cc -nostdlib -r"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
CFLAGS_OPTIMIZE="" # Optimizer is buggy
AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
[Should OS/390 do the right thing with sockets?])
;;
OSF1-1.0|OSF1-1.1|OSF1-1.2)
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
SHLIB_CFLAGS=""
# Hack: make package name same as library name
SHLIB_LD='ld -R -export $@:'
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD="ld -shared"
else
SHLIB_LD="ld -non_shared"
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD='ld -shared -expect_unresolved "*"'
else
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mieee"
else
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
LIBS=`echo $LIBS | sed s/-lpthreads//`
if test "$GCC" = "yes" ; then
LIBS="$LIBS -lpthread -lmach -lexc"
else
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
fi
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
# dlopen is in -lc on QNX
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
else
SHLIB_CFLAGS="-Kpic -belf"
LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
fi
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
SHLIB_CFLAGS="-PIC"
SHLIB_LD="ld"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
# requires an extra version number at the end of .so file names.
# So, the library has to have a name like libtcl75.so.1.0
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[[0-6]])
# Careful to not let 5.10+ fall into this case
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
[Do we really want to follow the standard? Yes we do!])
SHLIB_CFLAGS="-KPIC"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
;;
SunOS-5*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
[Do we really want to follow the standard? Yes we do!])
SHLIB_CFLAGS="-KPIC"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
if test "$GCC" = "yes" ; then
if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then
AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
else
do64bit_ok=yes
CFLAGS="$CFLAGS -m64 -mcpu=v9"
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
SHLIB_CFLAGS="-fPIC"
fi
else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
CFLAGS="$CFLAGS -xarch=v9a"
LDFLAGS_ARCH="-xarch=v9a"
else
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS_ARCH="-xarch=v9"
fi
# Solaris 64 uses this as well
#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
fi
elif test "$arch" = "amd64 i386" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported with GCC on $system])
else
do64bit_ok=yes
CFLAGS="$CFLAGS -xarch=amd64"
LDFLAGS="$LDFLAGS -xarch=amd64"
fi
else
AC_MSG_WARN([64bit mode not supported for $arch])
fi
fi
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "$do64bit_ok" = "yes" ; then
# We need to specify -static-libgcc or we need to
# add the path to the sparv9 libgcc.
# JH: static-libgcc is necessary for core Tcl, but may
# not be necessary for extensions.
SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
# for finding sparcv9 libgcc, get the regular libgcc
# path, remove so name and append 'sparcv9'
#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
fi
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
UNIX_SV* | UnixWare-5*)
SHLIB_CFLAGS="-KPIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
# that don't grok the -Bexport option. Test that it does.
AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bexport"
AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
LDFLAGS=$hold_ldflags])
if test $tcl_cv_ld_Bexport = yes; then
LDFLAGS="$LDFLAGS -Wl,-Bexport"
fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
esac
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
fi
# Step 4: disable dynamic loading if requested via a command-line switch.
AC_ARG_ENABLE(load,
AC_HELP_STRING([--disable-load],
[disallow dynamic loading and "load" command (default: enabled)]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test "$tcl_ok" = "no"; then
DL_OBJS=""
fi
if test "x$DL_OBJS" != "x" ; then
BUILD_DLTEST="\$(DLTEST_TARGETS)"
else
echo "Can't figure out how to do dynamic loading or shared libraries"
echo "on this system."
SHLIB_CFLAGS=""
SHLIB_LD=""
SHLIB_SUFFIX=""
DL_OBJS="tclLoadNone.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS_ORIG"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
# If we're running gcc, then change the C flags for compiling shared
# libraries to the right flags for gcc, instead of those for the
# standard manufacturer compiler.
if test "$DL_OBJS" != "tclLoadNone.o" ; then
if test "$GCC" = "yes" ; then
case $system in
AIX-*)
;;
BSD/OS*)
;;
IRIX*)
;;
NetBSD-*|FreeBSD-*)
;;
Darwin-*)
;;
SCO_SV-3.2*)
;;
windows)
;;
*)
SHLIB_CFLAGS="-fPIC"
;;
esac
fi
fi
if test "$SHARED_LIB_SUFFIX" = "" ; then
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
fi
if test "$UNSHARED_LIB_SUFFIX" = "" ; then
UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
fi
AC_SUBST(DL_LIBS)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
AC_SUBST(STLIB_LD)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(LD_LIBRARY_PATH_VAR)
# These must be called after we do the basic CFLAGS checks and
# verify any possible 64-bit or similar switches are necessary
TEA_TCL_EARLY_FLAGS
TEA_TCL_64BIT_FLAGS
])
#--------------------------------------------------------------------
# TEA_SERIAL_PORT
#
# Determine which interface to use to talk to the serial port.
# Note that #include lines must begin in leftmost column for
# some compilers to recognize them as preprocessor directives,
# and some build environments have stdin not pointing at a
# pseudo-terminal (usually /dev/null instead.)
#
# Arguments:
# none
#
# Results:
#
# Defines only one of the following vars:
# HAVE_SYS_MODEM_H
# USE_TERMIOS
# USE_TERMIO
# USE_SGTTY
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_SERIAL_PORT, [
AC_CHECK_HEADERS(sys/modem.h)
AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
AC_TRY_RUN([
#include
int main() {
struct termios t;
if (tcgetattr(0, &t) == 0) {
cfsetospeed(&t, 0);
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
return 0;
}
return 1;
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
if test $tcl_cv_api_serial = no ; then
AC_TRY_RUN([
#include
int main() {
struct termio t;
if (ioctl(0, TCGETA, &t) == 0) {
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
return 0;
}
return 1;
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
if test $tcl_cv_api_serial = no ; then
AC_TRY_RUN([
#include
int main() {
struct sgttyb t;
if (ioctl(0, TIOCGETP, &t) == 0) {
t.sg_ospeed = 0;
t.sg_flags |= ODDP | EVENP | RAW;
return 0;
}
return 1;
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
if test $tcl_cv_api_serial = no ; then
AC_TRY_RUN([
#include
#include
int main() {
struct termios t;
if (tcgetattr(0, &t) == 0
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
cfsetospeed(&t, 0);
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
return 0;
}
return 1;
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
if test $tcl_cv_api_serial = no; then
AC_TRY_RUN([
#include
#include
int main() {
struct termio t;
if (ioctl(0, TCGETA, &t) == 0
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
return 0;
}
return 1;
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
if test $tcl_cv_api_serial = no; then
AC_TRY_RUN([
#include
#include
int main() {
struct sgttyb t;
if (ioctl(0, TIOCGETP, &t) == 0
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
t.sg_ospeed = 0;
t.sg_flags |= ODDP | EVENP | RAW;
return 0;
}
return 1;
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
fi])
case $tcl_cv_api_serial in
termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
esac
])
#--------------------------------------------------------------------
# TEA_MISSING_POSIX_HEADERS
#
# Supply substitutes for missing POSIX header files. Special
# notes:
# - stdlib.h doesn't define strtol, strtoul, or
# strtod insome versions of SunOS
# - some versions of string.h don't declare procedures such
# as strstr
#
# Arguments:
# none
#
# Results:
#
# Defines some of the following vars:
# NO_DIRENT_H
# NO_ERRNO_H
# NO_VALUES_H
# HAVE_LIMITS_H or NO_LIMITS_H
# NO_STDLIB_H
# NO_STRING_H
# NO_SYS_WAIT_H
# NO_DLFCN_H
# HAVE_SYS_PARAM_H
#
# HAVE_STRING_H ?
#
# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
# CHECK on limits.h
#--------------------------------------------------------------------
AC_DEFUN(TEA_MISSING_POSIX_HEADERS, [
AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h,
AC_TRY_LINK([#include
#include ], [
#ifndef _POSIX_SOURCE
# ifdef __Lynx__
/*
* Generate compilation error to make the test fail: Lynx headers
* are only valid if really in the POSIX environment.
*/
missing_procedure();
# endif
#endif
DIR *d;
struct dirent *entryPtr;
char *p;
d = opendir("foobar");
entryPtr = readdir(d);
p = entryPtr->d_name;
closedir(d);
], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no))
if test $tcl_cv_dirent_h = no; then
AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?])
fi
AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])])
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])])
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])])
AC_CHECK_HEADER(limits.h,
[AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])],
[AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])])
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
if test $tcl_ok = 0; then
AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?])
fi
AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
# See also memmove check below for a place where NO_STRING_H can be
# set and why.
if test $tcl_ok = 0; then
AC_DEFINE(NO_STRING_H, 1, [Do we have ?])
fi
AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])])
AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])])
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
AC_HAVE_HEADERS(sys/param.h)
])
#--------------------------------------------------------------------
# TEA_PATH_X
#
# Locate the X11 header files and the X11 library archive. Try
# the ac_path_x macro first, but if it doesn't find the X stuff
# (e.g. because there's no xmkmf program) then check through
# a list of possible directories. Under some conditions the
# autoconf macro will return an include directory that contains
# no include files, so double-check its result just to be safe.
#
# This should be called after TEA_CONFIG_CFLAGS as setting the
# LIBS line can confuse some configure macro magic.
#
# Arguments:
# none
#
# Results:
#
# Sets the following vars:
# XINCLUDES
# XLIBSW
# PKG_LIBS (appends to)
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_PATH_X, [
if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
TEA_PATH_UNIX_X
fi
])
AC_DEFUN(TEA_PATH_UNIX_X, [
AC_PATH_X
not_really_there=""
if test "$no_x" = ""; then
if test "$x_includes" = ""; then
AC_TRY_CPP([#include ], , not_really_there="yes")
else
if test ! -r $x_includes/X11/Intrinsic.h; then
not_really_there="yes"
fi
fi
fi
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
AC_MSG_CHECKING([for X11 header files])
found_xincludes="no"
AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no")
if test "$found_xincludes" = "no"; then
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
for i in $dirs ; do
if test -r $i/X11/Intrinsic.h; then
AC_MSG_RESULT([$i])
XINCLUDES=" -I$i"
found_xincludes="yes"
break
fi
done
fi
else
if test "$x_includes" != ""; then
XINCLUDES="-I$x_includes"
found_xincludes="yes"
fi
fi
if test found_xincludes = "no"; then
AC_MSG_RESULT([couldn't find any!])
fi
if test "$no_x" = yes; then
AC_MSG_CHECKING([for X11 libraries])
XLIBSW=nope
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
for i in $dirs ; do
if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
AC_MSG_RESULT([$i])
XLIBSW="-L$i -lX11"
x_libraries="$i"
break
fi
done
else
if test "$x_libraries" = ""; then
XLIBSW=-lX11
else
XLIBSW="-L$x_libraries -lX11"
fi
fi
if test "$XLIBSW" = nope ; then
AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
fi
if test "$XLIBSW" = nope ; then
AC_MSG_RESULT([could not find any! Using -lX11.])
XLIBSW=-lX11
fi
if test x"${XLIBSW}" != x ; then
PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
fi
])
#--------------------------------------------------------------------
# TEA_BLOCKING_STYLE
#
# The statements below check for systems where POSIX-style
# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
# On these systems (mostly older ones), use the old BSD-style
# FIONBIO approach instead.
#
# Arguments:
# none
#
# Results:
#
# Defines some of the following vars:
# HAVE_SYS_IOCTL_H
# HAVE_SYS_FILIO_H
# USE_FIONBIO
# O_NONBLOCK
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_BLOCKING_STYLE, [
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/filio.h)
TEA_CONFIG_SYSTEM
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
case $system in
# There used to be code here to use FIONBIO under AIX. However, it
# was reported that FIONBIO doesn't work under AIX 3.2.5. Since
# using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
# code (JO, 5/31/97).
OSF*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
AC_MSG_RESULT([FIONBIO])
;;
SunOS-4*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
AC_MSG_RESULT([FIONBIO])
;;
*)
AC_MSG_RESULT([O_NONBLOCK])
;;
esac
])
#--------------------------------------------------------------------
# TEA_TIME_HANLDER
#
# Checks how the system deals with time.h, what time structures
# are used on the system, and what fields the structures have.
#
# Arguments:
# none
#
# Results:
#
# Defines some of the following vars:
# USE_DELTA_FOR_TZ
# HAVE_TM_GMTOFF
# HAVE_TM_TZADJ
# HAVE_TIMEZONE_VAR
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_TIME_HANDLER, [
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
AC_CHECK_FUNCS(gmtime_r localtime_r)
AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj,
AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;],
tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no))
if test $tcl_cv_member_tm_tzadj = yes ; then
AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
fi
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff,
AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;],
tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no))
if test $tcl_cv_member_tm_gmtoff = yes ; then
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
fi
#
# Its important to include time.h in this check, as some systems
# (like convex) have timezone functions, etc.
#
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long,
AC_TRY_COMPILE([#include ],
[extern long timezone;
timezone += 1;
exit (0);],
tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no))
if test $tcl_cv_timezone_long = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
else
#
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time,
AC_TRY_COMPILE([#include ],
[extern time_t timezone;
timezone += 1;
exit (0);],
tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no))
if test $tcl_cv_timezone_time = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
fi
fi
])
#--------------------------------------------------------------------
# TEA_BUGGY_STRTOD
#
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
# "fixstrtod" (provided by Tcl) that corrects the error.
# Also, on Compaq's Tru64 Unix 5.0,
# strtod(" ") returns 0.0 instead of a failure to convert.
#
# Arguments:
# none
#
# Results:
#
# Might defines some of the following vars:
# strtod (=fixstrtod)
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_BUGGY_STRTOD, [
AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
if test "$tcl_strtod" = 1; then
AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
AC_TRY_RUN([
extern double strtod();
int main() {
char *infString="Inf", *nanString="NaN", *spaceString=" ";
char *term;
double value;
value = strtod(infString, &term);
if ((term != infString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(nanString, &term);
if ((term != nanString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(spaceString, &term);
if (term == (spaceString+1)) {
exit(1);
}
exit(0);
}], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
tcl_cv_strtod_buggy=buggy)])
if test "$tcl_cv_strtod_buggy" = buggy; then
AC_LIBOBJ([fixstrtod])
USE_COMPAT=1
AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
fi
fi
])
#--------------------------------------------------------------------
# TEA_TCL_LINK_LIBS
#
# Search for the libraries needed to link the Tcl shell.
# Things like the math library (-lm) and socket stuff (-lsocket vs.
# -lnsl) are dealt with here.
#
# Arguments:
# Requires the following vars to be set in the Makefile:
# DL_LIBS
# LIBS
# MATH_LIBS
#
# Results:
#
# Subst's the following var:
# TCL_LIBS
# MATH_LIBS
#
# Might append to the following vars:
# LIBS
#
# Might define the following vars:
# HAVE_NET_ERRNO_H
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_TCL_LINK_LIBS, [
#--------------------------------------------------------------------
# On a few very rare systems, all of the libm.a stuff is
# already in libc.a. Set compiler flags accordingly.
# Also, Linux requires the "ieee" library for math to work
# right (and it must appear before "-lm").
#--------------------------------------------------------------------
AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
#--------------------------------------------------------------------
# Interactive UNIX requires -linet instead of -lsocket, plus it
# needs net/errno.h to define the socket-related error codes.
#--------------------------------------------------------------------
AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
AC_CHECK_HEADER(net/errno.h, [
AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])])
#--------------------------------------------------------------------
# Check for the existence of the -lsocket and -lnsl libraries.
# The order here is important, so that they end up in the right
# order in the command line generated by make. Here are some
# special considerations:
# 1. Use "connect" and "accept" to check for -lsocket, and
# "gethostbyname" to check for -lnsl.
# 2. Use each function name only once: can't redo a check because
# autoconf caches the results of the last check and won't redo it.
# 3. Use -lnsl and -lsocket only if they supply procedures that
# aren't already present in the normal libraries. This is because
# IRIX 5.2 has libraries, but they aren't needed and they're
# bogus: they goof up name resolution if used.
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
# To get around this problem, check for both libraries together
# if -lsocket doesn't work by itself.
#--------------------------------------------------------------------
tcl_checkBoth=0
AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
if test "$tcl_checkSocket" = 1; then
AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
fi
if test "$tcl_checkBoth" = 1; then
tk_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
fi
AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
[LIBS="$LIBS -lnsl"])])
# Don't perform the eval of the libraries here because DL_LIBS
# won't be set until we call TEA_CONFIG_CFLAGS
TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
AC_SUBST(TCL_LIBS)
AC_SUBST(MATH_LIBS)
])
#--------------------------------------------------------------------
# TEA_TCL_EARLY_FLAGS
#
# Check for what flags are needed to be passed so the correct OS
# features are available.
#
# Arguments:
# None
#
# Results:
#
# Might define the following vars:
# _ISOC99_SOURCE
# _LARGEFILE64_SOURCE
# _LARGEFILE_SOURCE64
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_TCL_EARLY_FLAG,[
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
AC_TRY_COMPILE([[#define ]$1[ 1
]$2], $3,
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
tcl_flags="$tcl_flags $1"
fi
])
AC_DEFUN(TEA_TCL_EARLY_FLAGS,[
AC_MSG_CHECKING([for required early compiler flags])
tcl_flags=""
TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ],
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ],
[struct stat64 buf; int i = stat64("/", &buf);])
TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ],
[char *p = (char *)open64;])
if test "x${tcl_flags}" = "x" ; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([${tcl_flags}])
fi
])
#--------------------------------------------------------------------
# TEA_TCL_64BIT_FLAGS
#
# Check for what is defined in the way of 64-bit features.
#
# Arguments:
# None
#
# Results:
#
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
# HAVE_STRUCT_DIRENT64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_TCL_64BIT_FLAGS, [
AC_MSG_CHECKING([for 64-bit integer type])
AC_CACHE_VAL(tcl_cv_type_64bit,[
tcl_cv_type_64bit=none
# See if the compiler knows natively about __int64
AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
tcl_type_64bit=__int64, tcl_type_64bit="long long")
# See if we should use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
AC_TRY_COMPILE(,[switch (0) {
case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
}],tcl_cv_type_64bit=${tcl_type_64bit})])
if test "${tcl_cv_type_64bit}" = none ; then
AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
AC_MSG_RESULT([using long])
elif test "${tcl_cv_type_64bit}" = "__int64" \
-a "${TEA_PLATFORM}" = "windows" ; then
# We actually want to use the default tcl.h checks in this
# case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
AC_MSG_RESULT([using Tcl header defaults])
else
AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
[What type should be used to define wide integers?])
AC_MSG_RESULT([${tcl_cv_type_64bit}])
# Now check for auxiliary declarations
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
AC_TRY_COMPILE([#include
#include ],[struct dirent64 p;],
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?])
fi
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
AC_TRY_COMPILE([#include ],[struct stat64 p;
],
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?])
fi
AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
AC_CACHE_VAL(tcl_cv_type_off64_t,[
AC_TRY_COMPILE([#include ],[off64_t offset;
],
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
dnl functions lseek64 and open64 are defined.
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
test "x${ac_cv_func_lseek64}" = "xyes" && \
test "x${ac_cv_func_open64}" = "xyes" ; then
AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
])
##
## Here ends the standard Tcl configuration bits and starts the
## TEA specific functions
##
#------------------------------------------------------------------------
# TEA_INIT --
#
# Init various Tcl Extension Architecture (TEA) variables.
# This should be the first called TEA_* macro.
#
# Arguments:
# none
#
# Results:
#
# Defines and substs the following vars:
# CYGPATH
# EXEEXT
# Defines only:
# TEA_VERSION
# TEA_INITED
# TEA_PLATFORM (windows or unix)
#
# "cygpath" is used on windows to generate native path names for include
# files. These variables should only be used with the compiler and linker
# since they generate native path names.
#
# EXEEXT
# Select the executable extension based on the host type. This
# is a lightweight replacement for AC_EXEEXT that doesn't require
# a compiler.
#------------------------------------------------------------------------
AC_DEFUN(TEA_INIT, [
# TEA extensions pass this us the version of TEA they think they
# are compatible with.
TEA_VERSION="3.5"
AC_MSG_CHECKING([for correct TEA configuration])
if test x"${PACKAGE_NAME}" = x ; then
AC_MSG_ERROR([
The PACKAGE_NAME variable must be defined by your TEA configure.in])
fi
if test x"$1" = x ; then
AC_MSG_ERROR([
TEA version not specified.])
elif test "$1" != "${TEA_VERSION}" ; then
AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
else
AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
fi
case "`uname -s`" in
*win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
EXEEXT=".exe"
TEA_PLATFORM="windows"
;;
*)
CYGPATH=echo
EXEEXT=""
TEA_PLATFORM="unix"
;;
esac
# Check if exec_prefix is set. If not use fall back to prefix.
# Note when adjusted, so that TEA_PREFIX can correct for this.
# This is needed for recursive configures, since autoconf propagates
# $prefix, but not $exec_prefix (doh!).
if test x$exec_prefix = xNONE ; then
exec_prefix_default=yes
exec_prefix=$prefix
fi
AC_SUBST(EXEEXT)
AC_SUBST(CYGPATH)
# This package name must be replaced statically for AC_SUBST to work
AC_SUBST(PKG_LIB_FILE)
# Substitute STUB_LIB_FILE in case package creates a stub library too.
AC_SUBST(PKG_STUB_LIB_FILE)
# We AC_SUBST these here to ensure they are subst'ed,
# in case the user doesn't call TEA_ADD_...
AC_SUBST(PKG_STUB_SOURCES)
AC_SUBST(PKG_STUB_OBJECTS)
AC_SUBST(PKG_TCL_SOURCES)
AC_SUBST(PKG_HEADERS)
AC_SUBST(PKG_INCLUDES)
AC_SUBST(PKG_LIBS)
AC_SUBST(PKG_CFLAGS)
])
#------------------------------------------------------------------------
# TEA_ADD_SOURCES --
#
# Specify one or more source files. Users should check for
# the right platform before adding to their list.
# It is not important to specify the directory, as long as it is
# in the generic, win or unix subdirectory of $(srcdir).
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_SOURCES
# PKG_OBJECTS
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_SOURCES, [
vars="$@"
for i in $vars; do
case $i in
[\$]*)
# allow $-var names
PKG_SOURCES="$PKG_SOURCES $i"
PKG_OBJECTS="$PKG_OBJECTS $i"
;;
*)
# check for existence - allows for generic/win/unix VPATH
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
; then
AC_MSG_ERROR([could not find source file '$i'])
fi
PKG_SOURCES="$PKG_SOURCES $i"
# this assumes it is in a VPATH dir
i=`basename $i`
# handle user calling this before or after TEA_SETUP_COMPILER
if test x"${OBJEXT}" != x ; then
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
else
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
fi
PKG_OBJECTS="$PKG_OBJECTS $j"
;;
esac
done
AC_SUBST(PKG_SOURCES)
AC_SUBST(PKG_OBJECTS)
])
#------------------------------------------------------------------------
# TEA_ADD_STUB_SOURCES --
#
# Specify one or more source files. Users should check for
# the right platform before adding to their list.
# It is not important to specify the directory, as long as it is
# in the generic, win or unix subdirectory of $(srcdir).
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_STUB_SOURCES
# PKG_STUB_OBJECTS
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_STUB_SOURCES, [
vars="$@"
for i in $vars; do
# check for existence - allows for generic/win/unix VPATH
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
; then
AC_MSG_ERROR([could not find stub source file '$i'])
fi
PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
# this assumes it is in a VPATH dir
i=`basename $i`
# handle user calling this before or after TEA_SETUP_COMPILER
if test x"${OBJEXT}" != x ; then
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
else
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
fi
PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
done
AC_SUBST(PKG_STUB_SOURCES)
AC_SUBST(PKG_STUB_OBJECTS)
])
#------------------------------------------------------------------------
# TEA_ADD_TCL_SOURCES --
#
# Specify one or more Tcl source files. These should be platform
# independent runtime files.
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_TCL_SOURCES
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_TCL_SOURCES, [
vars="$@"
for i in $vars; do
# check for existence, be strict because it is installed
if test ! -f "${srcdir}/$i" ; then
AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
fi
PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
done
AC_SUBST(PKG_TCL_SOURCES)
])
#------------------------------------------------------------------------
# TEA_ADD_HEADERS --
#
# Specify one or more source headers. Users should check for
# the right platform before adding to their list.
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_HEADERS
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_HEADERS, [
vars="$@"
for i in $vars; do
# check for existence, be strict because it is installed
if test ! -f "${srcdir}/$i" ; then
AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
fi
PKG_HEADERS="$PKG_HEADERS $i"
done
AC_SUBST(PKG_HEADERS)
])
#------------------------------------------------------------------------
# TEA_ADD_INCLUDES --
#
# Specify one or more include dirs. Users should check for
# the right platform before adding to their list.
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_INCLUDES
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_INCLUDES, [
vars="$@"
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
AC_SUBST(PKG_INCLUDES)
])
#------------------------------------------------------------------------
# TEA_ADD_LIBS --
#
# Specify one or more libraries. Users should check for
# the right platform before adding to their list. For Windows,
# libraries provided in "foo.lib" format will be converted to
# "-lfoo" when using GCC (mingw).
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_LIBS
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_LIBS, [
vars="$@"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
AC_SUBST(PKG_LIBS)
])
#------------------------------------------------------------------------
# TEA_ADD_CFLAGS --
#
# Specify one or more CFLAGS. Users should check for
# the right platform before adding to their list.
#
# Arguments:
# one or more file names
#
# Results:
#
# Defines and substs the following vars:
# PKG_CFLAGS
#------------------------------------------------------------------------
AC_DEFUN(TEA_ADD_CFLAGS, [
PKG_CFLAGS="$PKG_CFLAGS $@"
AC_SUBST(PKG_CFLAGS)
])
#------------------------------------------------------------------------
# TEA_PREFIX --
#
# Handle the --prefix=... option by defaulting to what Tcl gave
#
# Arguments:
# none
#
# Results:
#
# If --prefix or --exec-prefix was not specified, $prefix and
# $exec_prefix will be set to the values given to Tcl when it was
# configured.
#------------------------------------------------------------------------
AC_DEFUN(TEA_PREFIX, [
if test "${prefix}" = "NONE"; then
prefix_default=yes
if test x"${TCL_PREFIX}" != x; then
AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
prefix=${TCL_PREFIX}
else
AC_MSG_NOTICE([--prefix defaulting to /usr/local])
prefix=/usr/local
fi
fi
if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
-o x"${exec_prefix_default}" = x"yes" ; then
if test x"${TCL_EXEC_PREFIX}" != x; then
AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
exec_prefix=${TCL_EXEC_PREFIX}
else
AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
exec_prefix=$prefix
fi
fi
])
#------------------------------------------------------------------------
# TEA_SETUP_COMPILER_CC --
#
# Do compiler checks the way we want. This is just a replacement
# for AC_PROG_CC in TEA configure.in files to make them cleaner.
#
# Arguments:
# none
#
# Results:
#
# Sets up CC var and other standard bits we need to make executables.
#------------------------------------------------------------------------
AC_DEFUN(TEA_SETUP_COMPILER_CC, [
# Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
# in this macro, they need to go into TEA_SETUP_COMPILER instead.
# If the user did not set CFLAGS, set it now to keep
# the AC_PROG_CC macro from adding "-g -O2".
if test "${CFLAGS+set}" != "set" ; then
CFLAGS=""
fi
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
#--------------------------------------------------------------------
# Checks to see if the make program sets the $MAKE variable.
#--------------------------------------------------------------------
AC_PROG_MAKE_SET
#--------------------------------------------------------------------
# Find ranlib
#--------------------------------------------------------------------
AC_PROG_RANLIB
#--------------------------------------------------------------------
# Determines the correct binary file extension (.o, .obj, .exe etc.)
#--------------------------------------------------------------------
AC_OBJEXT
AC_EXEEXT
])
#------------------------------------------------------------------------
# TEA_SETUP_COMPILER --
#
# Do compiler checks that use the compiler. This must go after
# TEA_SETUP_COMPILER_CC, which does the actual compiler check.
#
# Arguments:
# none
#
# Results:
#
# Sets up CC var and other standard bits we need to make executables.
#------------------------------------------------------------------------
AC_DEFUN(TEA_SETUP_COMPILER, [
# Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
AC_REQUIRE([TEA_SETUP_COMPILER_CC])
#------------------------------------------------------------------------
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
# It makes compiling go faster. (This is only a performance feature.)
#------------------------------------------------------------------------
if test -z "$no_pipe" -a -n "$GCC"; then
AC_MSG_CHECKING([if the compiler understands -pipe])
OLDCC="$CC"
CC="$CC -pipe"
AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC"
AC_MSG_RESULT([no]))
fi
#--------------------------------------------------------------------
# Common compiler flag setup
#--------------------------------------------------------------------
AC_C_BIGENDIAN
if test "${TEA_PLATFORM}" = "unix" ; then
TEA_TCL_LINK_LIBS
TEA_MISSING_POSIX_HEADERS
# Let the user call this, because if it triggers, they will
# need a compat/strtod.c that is correct. Users can also
# use Tcl_GetDouble(FromObj) instead.
#TEA_BUGGY_STRTOD
fi
])
#------------------------------------------------------------------------
# TEA_MAKE_LIB --
#
# Generate a line that can be used to build a shared/unshared library
# in a platform independent manner.
#
# Arguments:
# none
#
# Requires:
#
# Results:
#
# Defines the following vars:
# CFLAGS - Done late here to note disturb other AC macros
# MAKE_LIB - Command to execute to build the Tcl library;
# differs depending on whether or not Tcl is being
# compiled as a shared library.
# MAKE_SHARED_LIB Makefile rule for building a shared library
# MAKE_STATIC_LIB Makefile rule for building a static library
# MAKE_STUB_LIB Makefile rule for building a stub library
#------------------------------------------------------------------------
AC_DEFUN(TEA_MAKE_LIB, [
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
else
MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
fi
if test "${SHARED_BUILD}" = "1" ; then
MAKE_LIB="${MAKE_SHARED_LIB} "
else
MAKE_LIB="${MAKE_STATIC_LIB} "
fi
#--------------------------------------------------------------------
# Shared libraries and static libraries have different names.
# Use the double eval to make sure any variables in the suffix is
# substituted. (@@@ Might not be necessary anymore)
#--------------------------------------------------------------------
if test "${TEA_PLATFORM}" = "windows" ; then
if test "${SHARED_BUILD}" = "1" ; then
# We force the unresolved linking of symbols that are really in
# the private libraries of Tcl and Tk.
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
if test x"${TK_BIN_DIR}" != x ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
fi
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
else
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
fi
# Some packages build their own stubs libraries
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
# These aren't needed on Windows (either MSVC or gcc)
RANLIB=:
RANLIB_STUB=:
else
RANLIB_STUB="${RANLIB}"
if test "${SHARED_BUILD}" = "1" ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
if test x"${TK_BIN_DIR}" != x ; then
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
fi
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
RANLIB=:
else
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
fi
# Some packages build their own stubs libraries
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
fi
# These are escaped so that only CFLAGS is picked up at configure time.
# The other values will be substituted at make time.
CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
if test "${SHARED_BUILD}" = "1" ; then
CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
fi
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_SHARED_LIB)
AC_SUBST(MAKE_STATIC_LIB)
AC_SUBST(MAKE_STUB_LIB)
AC_SUBST(RANLIB_STUB)
])
#------------------------------------------------------------------------
# TEA_LIB_SPEC --
#
# Compute the name of an existing object library located in libdir
# from the given base name and produce the appropriate linker flags.
#
# Arguments:
# basename The base name of the library without version
# numbers, extensions, or "lib" prefixes.
# extra_dir Extra directory in which to search for the
# library. This location is used first, then
# $prefix/$exec-prefix, then some defaults.
#
# Requires:
# TEA_INIT and TEA_PREFIX must be called first.
#
# Results:
#
# Defines the following vars:
# ${basename}_LIB_NAME The computed library name.
# ${basename}_LIB_SPEC The computed linker flags.
#------------------------------------------------------------------------
AC_DEFUN(TEA_LIB_SPEC, [
AC_MSG_CHECKING([for $1 library])
# Look in exec-prefix for the library (defined by TEA_PREFIX).
tea_lib_name_dir="${exec_prefix}/lib"
# Or in a user-specified location.
if test x"$2" != x ; then
tea_extra_lib_dir=$2
else
tea_extra_lib_dir=NONE
fi
for i in \
`ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
`ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
`ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
`ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
`ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
`ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
`ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
`ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
if test -f "$i" ; then
tea_lib_name_dir=`dirname $i`
$1_LIB_NAME=`basename $i`
$1_LIB_PATH_NAME=$i
break
fi
done
if test "${TEA_PLATFORM}" = "windows"; then
$1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
else
# Strip off the leading "lib" and trailing ".a" or ".so"
tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
$1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
fi
if test "x${$1_LIB_NAME}" = x ; then
AC_MSG_ERROR([not found])
else
AC_MSG_RESULT([${$1_LIB_SPEC}])
fi
])
#------------------------------------------------------------------------
# TEA_PRIVATE_TCL_HEADERS --
#
# Locate the private Tcl include files
#
# Arguments:
#
# Requires:
# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
# already been called.
#
# Results:
#
# Substs the following vars:
# TCL_TOP_DIR_NATIVE
# TCL_GENERIC_DIR_NATIVE
# TCL_UNIX_DIR_NATIVE
# TCL_WIN_DIR_NATIVE
# TCL_BMAP_DIR_NATIVE
# TCL_TOOL_DIR_NATIVE
# TCL_PLATFORM_DIR_NATIVE
# TCL_BIN_DIR_NATIVE
# TCL_INCLUDES
#------------------------------------------------------------------------
AC_DEFUN(TEA_PRIVATE_TCL_HEADERS, [
AC_MSG_CHECKING([for Tcl private include files])
TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\"
TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\"
TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\"
if test "${TEA_PLATFORM}" = "windows"; then
TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
else
TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
fi
# We want to ensure these are substituted so as not to require
# any *_NATIVE vars be defined in the Makefile
TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
if test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use
# the framework's Headers and PrivateHeaders directories
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then
TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else
TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi
;;
esac
fi
AC_SUBST(TCL_TOP_DIR_NATIVE)
AC_SUBST(TCL_GENERIC_DIR_NATIVE)
AC_SUBST(TCL_UNIX_DIR_NATIVE)
AC_SUBST(TCL_WIN_DIR_NATIVE)
AC_SUBST(TCL_BMAP_DIR_NATIVE)
AC_SUBST(TCL_TOOL_DIR_NATIVE)
AC_SUBST(TCL_PLATFORM_DIR_NATIVE)
AC_SUBST(TCL_INCLUDES)
AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}])
])
#------------------------------------------------------------------------
# TEA_PUBLIC_TCL_HEADERS --
#
# Locate the installed public Tcl header files
#
# Arguments:
# None.
#
# Requires:
# CYGPATH must be set
#
# Results:
#
# Adds a --with-tclinclude switch to configure.
# Result is cached.
#
# Substs the following vars:
# TCL_INCLUDES
#------------------------------------------------------------------------
AC_DEFUN(TEA_PUBLIC_TCL_HEADERS, [
AC_MSG_CHECKING([for Tcl public headers])
AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
AC_CACHE_VAL(ac_cv_c_tclh, [
# Use the value from --with-tclinclude, if it was given
if test x"${with_tclinclude}" != x ; then
if test -f "${with_tclinclude}/tcl.h" ; then
ac_cv_c_tclh=${with_tclinclude}
else
AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
fi
else
if test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use
# the framework's Headers directory
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
;;
esac
fi
# Look in the source dir only if Tcl is not installed,
# and in that situation, look there before installed locations.
if test -f "${TCL_BIN_DIR}/Makefile" ; then
list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
fi
# Check order: pkg --prefix location, Tcl's --prefix location,
# relative to directory of tclConfig.sh.
eval "temp_includedir=${includedir}"
list="$list \
`ls -d ${temp_includedir} 2>/dev/null` \
`ls -d ${TCL_PREFIX}/include 2>/dev/null` \
`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
list="$list /usr/local/include /usr/include"
if test x"${TCL_INCLUDE_SPEC}" != x ; then
d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
list="$list `ls -d ${d} 2>/dev/null`"
fi
fi
for i in $list ; do
if test -f "$i/tcl.h" ; then
ac_cv_c_tclh=$i
break
fi
done
fi
])
# Print a message based on how we determined the include path
if test x"${ac_cv_c_tclh}" = x ; then
AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
else
AC_MSG_RESULT([${ac_cv_c_tclh}])
fi
# Convert to a native path and substitute into the output files.
INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
AC_SUBST(TCL_INCLUDES)
])
#------------------------------------------------------------------------
# TEA_PRIVATE_TK_HEADERS --
#
# Locate the private Tk include files
#
# Arguments:
#
# Requires:
# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
# already been called.
#
# Results:
#
# Substs the following vars:
# TK_INCLUDES
#------------------------------------------------------------------------
AC_DEFUN(TEA_PRIVATE_TK_HEADERS, [
AC_MSG_CHECKING([for Tk private include files])
TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
if test "${TEA_PLATFORM}" = "windows"; then
TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
else
TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
fi
# We want to ensure these are substituted so as not to require
# any *_NATIVE vars be defined in the Makefile
TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
-o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}"
fi
if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx"
fi
if test "`uname -s`" = "Darwin"; then
# If Tk was built as a framework, attempt to use
# the framework's Headers and PrivateHeaders directories
case ${TK_DEFS} in
*TK_FRAMEWORK*)
if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then
TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi
;;
esac
fi
AC_SUBST(TK_TOP_DIR_NATIVE)
AC_SUBST(TK_UNIX_DIR_NATIVE)
AC_SUBST(TK_WIN_DIR_NATIVE)
AC_SUBST(TK_GENERIC_DIR_NATIVE)
AC_SUBST(TK_XLIB_DIR_NATIVE)
AC_SUBST(TK_PLATFORM_DIR_NATIVE)
AC_SUBST(TK_INCLUDES)
AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}])
])
#------------------------------------------------------------------------
# TEA_PUBLIC_TK_HEADERS --
#
# Locate the installed public Tk header files
#
# Arguments:
# None.
#
# Requires:
# CYGPATH must be set
#
# Results:
#
# Adds a --with-tkinclude switch to configure.
# Result is cached.
#
# Substs the following vars:
# TK_INCLUDES
#------------------------------------------------------------------------
AC_DEFUN(TEA_PUBLIC_TK_HEADERS, [
AC_MSG_CHECKING([for Tk public headers])
AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files.], with_tkinclude=${withval})
AC_CACHE_VAL(ac_cv_c_tkh, [
# Use the value from --with-tkinclude, if it was given
if test x"${with_tkinclude}" != x ; then
if test -f "${with_tkinclude}/tk.h" ; then
ac_cv_c_tkh=${with_tkinclude}
else
AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
fi
else
if test "`uname -s`" = "Darwin"; then
# If Tk was built as a framework, attempt to use
# the framework's Headers directory.
case ${TK_DEFS} in
*TK_FRAMEWORK*)
list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
;;
esac
fi
# Look in the source dir only if Tk is not installed,
# and in that situation, look there before installed locations.
if test -f "${TK_BIN_DIR}/Makefile" ; then
list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
fi
# Check order: pkg --prefix location, Tk's --prefix location,
# relative to directory of tkConfig.sh, Tcl's --prefix location,
# relative to directory of tclConfig.sh.
eval "temp_includedir=${includedir}"
list="$list \
`ls -d ${temp_includedir} 2>/dev/null` \
`ls -d ${TK_PREFIX}/include 2>/dev/null` \
`ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
`ls -d ${TCL_PREFIX}/include 2>/dev/null` \
`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
list="$list /usr/local/include /usr/include"
fi
for i in $list ; do
if test -f "$i/tk.h" ; then
ac_cv_c_tkh=$i
break
fi
done
fi
])
# Print a message based on how we determined the include path
if test x"${ac_cv_c_tkh}" = x ; then
AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
else
AC_MSG_RESULT([${ac_cv_c_tkh}])
fi
# Convert to a native path and substitute into the output files.
INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
AC_SUBST(TK_INCLUDES)
if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
-o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
# On Windows and Aqua, we need the X compat headers
AC_MSG_CHECKING([for X11 header files])
if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
AC_SUBST(TK_XINCLUDES)
fi
AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
fi
])
#------------------------------------------------------------------------
# TEA_PROG_TCLSH
# Determine the fully qualified path name of the tclsh executable
# in the Tcl build directory or the tclsh installed in a bin
# directory. This macro will correctly determine the name
# of the tclsh executable even if tclsh has not yet been
# built in the build directory. The tclsh found is always
# associated with a tclConfig.sh file. This tclsh should be used
# only for running extension test cases. It should never be
# or generation of files (like pkgIndex.tcl) at build time.
#
# Arguments
# none
#
# Results
# Subst's the following values:
# TCLSH_PROG
#------------------------------------------------------------------------
AC_DEFUN(TEA_PROG_TCLSH, [
AC_MSG_CHECKING([for tclsh])
if test -f "${TCL_BIN_DIR}/Makefile" ; then
# tclConfig.sh is in Tcl build directory
if test "${TEA_PLATFORM}" = "windows"; then
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
else
TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
fi
else
# tclConfig.sh is in install location
if test "${TEA_PLATFORM}" = "windows"; then
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
else
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
fi
list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
`ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
`ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
for i in $list ; do
if test -f "$i/${TCLSH_PROG}" ; then
REAL_TCL_BIN_DIR="`cd "$i"; pwd`"
break
fi
done
TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}"
fi
AC_MSG_RESULT([${TCLSH_PROG}])
AC_SUBST(TCLSH_PROG)
])
#------------------------------------------------------------------------
# TEA_PROG_WISH
# Determine the fully qualified path name of the wish executable
# in the Tk build directory or the wish installed in a bin
# directory. This macro will correctly determine the name
# of the wish executable even if wish has not yet been
# built in the build directory. The wish found is always
# associated with a tkConfig.sh file. This wish should be used
# only for running extension test cases. It should never be
# or generation of files (like pkgIndex.tcl) at build time.
#
# Arguments
# none
#
# Results
# Subst's the following values:
# WISH_PROG
#------------------------------------------------------------------------
AC_DEFUN(TEA_PROG_WISH, [
AC_MSG_CHECKING([for wish])
if test -f "${TK_BIN_DIR}/Makefile" ; then
# tkConfig.sh is in Tk build directory
if test "${TEA_PLATFORM}" = "windows"; then
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
else
WISH_PROG="${TK_BIN_DIR}/wish"
fi
else
# tkConfig.sh is in install location
if test "${TEA_PLATFORM}" = "windows"; then
WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
else
WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
fi
list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
`ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
`ls -d ${TK_PREFIX}/bin 2>/dev/null`"
for i in $list ; do
if test -f "$i/${WISH_PROG}" ; then
REAL_TK_BIN_DIR="`cd "$i"; pwd`"
break
fi
done
WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}"
fi
AC_MSG_RESULT([${WISH_PROG}])
AC_SUBST(WISH_PROG)
])
#------------------------------------------------------------------------
# TEA_PATH_CONFIG --
#
# Locate the ${1}Config.sh file and perform a sanity check on
# the ${1} compile flags. These are used by packages like
# [incr Tk] that load *Config.sh files from more than Tcl and Tk.
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --with-$1=...
#
# Defines the following vars:
# $1_BIN_DIR Full path to the directory containing
# the $1Config.sh file
#------------------------------------------------------------------------
AC_DEFUN(TEA_PATH_CONFIG, [
#
# Ok, lets find the $1 configuration
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-$1
#
if test x"${no_$1}" = x ; then
# we reset no_$1 in case something fails here
no_$1=true
AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
AC_MSG_CHECKING([for $1 configuration])
AC_CACHE_VAL(ac_cv_c_$1config,[
# First check to see if --with-$1 was specified.
if test x"${with_$1config}" != x ; then
case ${with_$1config} in
*/$1Config.sh )
if test -f ${with_$1config}; then
AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
fi;;
esac
if test -f "${with_$1config}/$1Config.sh" ; then
ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
else
AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
fi
fi
# then check for a private $1 installation
if test x"${ac_cv_c_$1config}" = x ; then
for i in \
../$1 \
`ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
`ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
`ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
../../$1 \
`ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
`ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
`ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
../../../$1 \
`ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
`ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
`ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
${srcdir}/../$1 \
`ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
`ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
; do
if test -f "$i/$1Config.sh" ; then
ac_cv_c_$1config=`(cd $i; pwd)`
break
fi
if test -f "$i/unix/$1Config.sh" ; then
ac_cv_c_$1config=`(cd $i/unix; pwd)`
break
fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_$1config}" = x ; then
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
; do
if test -f "$i/$1Config.sh" ; then
ac_cv_c_$1config=`(cd $i; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_$1config}" = x ; then
$1_BIN_DIR="# no $1 configs found"
AC_MSG_WARN([Cannot find $1 configuration definitions])
exit 0
else
no_$1=
$1_BIN_DIR=${ac_cv_c_$1config}
AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
fi
fi
])
#------------------------------------------------------------------------
# TEA_LOAD_CONFIG --
#
# Load the $1Config.sh file
#
# Arguments:
#
# Requires the following vars to be set:
# $1_BIN_DIR
#
# Results:
#
# Subst the following vars:
# $1_SRC_DIR
# $1_LIB_FILE
# $1_LIB_SPEC
#
#------------------------------------------------------------------------
AC_DEFUN(TEA_LOAD_CONFIG, [
AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
AC_MSG_RESULT([loading])
. ${$1_BIN_DIR}/$1Config.sh
else
AC_MSG_RESULT([file not found])
fi
#
# If the $1_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable $1_LIB_SPEC will be set to the value
# of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
# instead of $1_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
#
if test -f ${$1_BIN_DIR}/Makefile ; then
AC_MSG_WARN([Found Makefile - using build library specs for $1])
$1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
$1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
$1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
fi
AC_SUBST($1_VERSION)
AC_SUBST($1_BIN_DIR)
AC_SUBST($1_SRC_DIR)
AC_SUBST($1_LIB_FILE)
AC_SUBST($1_LIB_SPEC)
AC_SUBST($1_STUB_LIB_FILE)
AC_SUBST($1_STUB_LIB_SPEC)
AC_SUBST($1_STUB_LIB_PATH)
])
#------------------------------------------------------------------------
# TEA_PATH_CELIB --
#
# Locate Keuchel's celib emulation layer for targeting Win/CE
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --with-celib=...
#
# Defines the following vars:
# CELIB_DIR Full path to the directory containing
# the include and platform lib files
#------------------------------------------------------------------------
AC_DEFUN(TEA_PATH_CELIB, [
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-celib
if test x"${no_celib}" = x ; then
# we reset no_celib in case something fails here
no_celib=true
AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
AC_MSG_CHECKING([for Windows/CE celib directory])
AC_CACHE_VAL(ac_cv_c_celibconfig,[
# First check to see if --with-celibconfig was specified.
if test x"${with_celibconfig}" != x ; then
if test -d "${with_celibconfig}/inc" ; then
ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
else
AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
fi
fi
# then check for a celib library
if test x"${ac_cv_c_celibconfig}" = x ; then
for i in \
../celib-palm-3.0 \
../celib \
../../celib-palm-3.0 \
../../celib \
`ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
${srcdir}/../celib-palm-3.0 \
${srcdir}/../celib \
`ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
; do
if test -d "$i/inc" ; then
ac_cv_c_celibconfig=`(cd $i; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_celibconfig}" = x ; then
AC_MSG_ERROR([Cannot find celib support library directory])
else
no_celib=
CELIB_DIR=${ac_cv_c_celibconfig}
CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
AC_MSG_RESULT([found $CELIB_DIR])
fi
fi
])
# Local Variables:
# mode: autoconf
# End:
# BASED ON TEA 1.89 2006/01/25 21:25:02
tclodbc-2.5.1/tclodbc.cxx 0000644 0001750 0000027 00000034210 11011550215 013532 0 ustar frankie /**********************************************************************
- TCLODBC COPYRIGHT NOTICE -
This software is copyrighted by Roy Nurmi, contact address by email at
Roy.Nurmi@iki.fi. The following terms apply to all files associated with
the software unless explicitly disclaimed in individual files.
The author hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
***********************************************************************/
//////////////////////////////////////////////////////////////////////////
// //
// ODBC-interface extension to tcl language by Roy Nurmi //
// Version 2.1 //
// //
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// //
// VERSION HISTORY //
// //
// 1.0 Initial version. Requires tcl 8.0 alpha 2 release //
// //
// 1.1 New version, compatible with tcl 8.0 beta 1 release //
// //
// 1.2 New version, enhanced functionality of statement columns command //
// //
// 1.3 New version, added database configure option, index queries, //
// new error object definition //
// //
// 1.4 New version, added database datasources and drivers options //
// and connecting with odbc connection string //
// //
// 1.4 patch 1 Bug corrections, enhanced portability //
// //
// 1.5 New version, added set and get commands for setting some //
// useful connection and statement options //
// //
// 1.6 New version, argument type definition moved to statement //
// creation. //
// //
// 1.7 New version, compilable also under tcl 7.6 //
// //
// 2.0 New version, cursor types & rowset_size also configurable //
// contributed by Ric Klaren (klaren@trc.nl). //
// optional array argument to statement fetch command //
// thread safety provided //
// Unicode support with tcl 8.1 //
// Emprovements in large columns support //
// //
// 2.1 New version, added database typeinfo command //
// //
// 2.2 New version, new binary column handling and some bug fixes //
// some contributions from Robert Black //
// //
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// INCLUDES
//
#include "tclodbc.hxx"
//////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
//
// ODBC environment handle management
HENV env = 0; // environment handle
int envRefCounter = 0; // enables use of one common handle
// we have to have TCL_THREADS defined,
// if we want to compile multithreaded version
#ifdef TCL_THREADS
TCL_DECLARE_MUTEX(envMutex); // ensures thread-safe allocation/freeing
#endif
//////////////////////////////////////////////////////////////////////////
// MISANCELLOUS HELPER FUNCTIONS
//
TclObj SqlErr (HENV env, HDBC dbc, HSTMT stmt) {
char SqlMessage[SQL_MAX_MESSAGE_LENGTH];
char SqlState[6];
SDWORD NativeError;
SWORD Available;
RETCODE rc;
TclObj errObj;
rc = SQLError(env, dbc, stmt,
(UCHAR*) SqlState, &NativeError, (UCHAR*) SqlMessage,
SQL_MAX_MESSAGE_LENGTH-1, &Available);
// sql error object is a triple:
// {standard error code} {native error code} {error message}
if (rc != SQL_ERROR) {
errObj.appendElement(TclObj(SqlState));
errObj.appendElement(TclObj(NativeError));
errObj.appendElement(TclObj(SqlMessage,Available));
} else {
errObj.appendElement("FATAL ERROR: Failed to receive error message");
}
return errObj;
}
short StrToNum (char *str, NumStr array[], char* errMsg, BOOLEAN allowNumeric) {
short num;
int strFirst (1);
int strLast (array[0].numeric);
int i;
int strcmpResult;
if (allowNumeric && (num = atoi(str)))
return num;
// binary search for matching string
while (strFirst <= strLast) {
i = (strFirst + strLast) / 2;
strcmpResult = strcmp(str, array[i].string);
if (strcmpResult == 0)
return array[i].numeric;
else if (strcmpResult > 0)
strFirst = i + 1;
else
strLast = i - 1;
}
/*
for (int i = 0; array[i].string; ++i) {
if (!strcmp(str, array[i].string))
return array[i].numeric;
}
}
*/
// No match found. Throw error, if error message != NULL.
if (errMsg) {
TclObj errObj (errMsg);
errObj.append(str);
THROWOBJ(errObj);
}
// Otherways just return -1
return -1;
}
TclObj NumToStr (short num, NumStr array[]) {
for (int i = 1; i <= array[0].numeric; ++i) {
if (array[i].numeric == num)
return TclObj(array[i].string);
}
TclObj errObj ("Invalid numeric value: ");
errObj.append(TclObj(num));
THROWOBJ(errObj);
return errObj; // to keep compiler happy
}
// this routine determines which sql types should be encoded and decoded
BOOL EncodedType (int i)
{
switch (i) {
case SQL_CHAR:
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
return TRUE;
default:
return FALSE;
}
}
// type mapping function sql / c
SWORD MapSqlType (SDWORD colType) {
switch (colType) {
case SQL_VARBINARY:
case SQL_LONGVARBINARY:
return SQL_C_BINARY;
default:
return SQL_C_CHAR;
}
}
//////////////////////////////////////////////////////////////////////////
// TCL COMMAND INTERFACE
//
int tcl_database (ClientData clientData, Tcl_Interp *interp, int objc,
TCL_CMDARGS)
{
TclObj name, db, uid, password;
char *p;
TclObj attributes;
TclDatabase* pDataBase = NULL;
try {
if (objc == 1) {
// return usage
Tcl_SetResult(interp, strUsage, TCL_STATIC);
return TCL_OK;
}
switch (StrToNum (TclObj(objv[1]), databaseOptions, NULL, FALSE)) {
case TclDatabase::CONFIGURE:
if (objc != 5) {
THROWSTR("wrong # args, should be configure operation driver attributes");
}
return TclDatabase::Configure(interp, objc-2, objv+2);
case TclDatabase::DATASOURCES:
// generate list of all databases
Tcl_SetObjResult (interp, TclDatabase::Datasources());
return TCL_OK;
case TclDatabase::DRIVERS:
// generate list of all drivers available
Tcl_SetObjResult (interp, TclDatabase::Drivers());
return TCL_OK;
case TclDatabase::VERSION:
// return version information
Tcl_SetResult(interp, strVersion, TCL_STATIC);
return TCL_OK;
case TclDatabase::CONNECT:
--objc;
++objv;
// fall through
default:
if (objc < 3 || objc > 5) {
THROWSTR("wrong # args, should be database name connectionstring | (db [uid] [password])");
}
name = TclObj(objv[1]);
db = TclObj(objv[2]);
// search for '=' in dbname, indicating a odbc connection
// string
for (p = (char*) db; *p != '\0' && *p != '='; ++p);
// connect using a connection string or a datasource name,
if (objc == 3 && *p == '=') {
pDataBase = new TclDatabase(db);
} else {
uid = objc > 3 ? TclObj(objv[3]) : TclObj();
password = objc > 4 ? TclObj(objv[4]) : TclObj();
pDataBase = new TclDatabase(db, uid, password);
}
if (!pDataBase) {
THROWSTR(strMemoryAllocationFailed);
}
pDataBase->tclCommand = Tcl_CreateObjCommand(interp, name,
&TclCmdObject::Dispatch, pDataBase,
TclCmdObject::Destroy);
Tcl_SetObjResult(interp, TclObj(objv[1]));
return TCL_OK;
}
}
catch( TclObj obj ) {
if (pDataBase) {
delete pDataBase;
}
Tcl_SetObjResult(interp, obj);
return TCL_ERROR;
}
}
//////////////////////////////////////////////////////////////////////////
// TCL EXTENSION CLEANUP ROUTINE
//
void Tclodbc_Kill(ClientData clientData)
{
#ifdef TCL_THREADS
// The last call to this function will clean up the ODBC environment
// handle.
Tcl_MutexLock(&envMutex);
#endif
envRefCounter -= 1;
if (envRefCounter == 0 && env) {
SQLFreeEnv(env);
env = (HENV) NULL;
}
#ifdef TCL_THREADS
Tcl_MutexUnlock(&envMutex);
#endif
}
//////////////////////////////////////////////////////////////////////////
// TCL EXTENSION INITIALIZATION ROUTINE
//
extern "C" {
_declspec(dllexport)
Tclodbc_Init(Tcl_Interp *interp)
{
#ifdef USE_TCL_STUBS
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
return TCL_ERROR;
}
#endif
#ifdef _DEBUG
// run some validation routines in debug mode
if (tclodbc_validateNumStrArrays() == TCL_ERROR) {
Tcl_SetResult(interp, "tclodbc_validateNumStrArrays() failed",
TCL_STATIC);
return TCL_ERROR;
}
if (tclodbc_validateStrToNumFunction() == TCL_ERROR) {
Tcl_SetResult(interp, "tclodbc_validateStrToNumFunction() failed",
TCL_STATIC);
return TCL_ERROR;
}
#endif
// The library IS thread-safe with global environment handle.
// An exerpt from ODBC reference:
/*
* An environment handle references global information such as valid
* connection handles and active connection handles. To request an
* environment handle, an application passes the address of an henv to
* SQLAllocEnv. The driver allocates memory for the environment
* information and stores the value of the associated handle in the
* henv. On operating systems that support multiple threads, applications
* can use the same henv on different threads and drivers must therefore
* support safe, multithreaded access to this information. The application
* passes the henv value in all subsequent calls that require an henv.
*
* There should never be more than one henv allocated at one time and the
* application should not call SQLAllocEnv when there is a current valid
* henv.
*
* To support multiple interpreters we keep reference count of
* Tclodbc_init calls. We reserve handle only once, and release it when
* the last interpreter calls Tclodbc_Kill.
*/
#ifdef TCL_THREADS
// get mutex to increment local reference counter
Tcl_MutexLock(&envMutex);
#endif
// allocate environment handle if not yet allocated
if (!env && SQLAllocEnv(&env) == SQL_ERROR) {
if (env == SQL_NULL_HENV) {
Tcl_SetResult(interp, strMemoryAllocationFailed, TCL_STATIC);
} else {
Tcl_SetObjResult(interp,
SqlErr(env, SQL_NULL_HDBC, SQL_NULL_HSTMT));
}
#ifdef TCL_THREADS
Tcl_MutexUnlock(&envMutex);
#endif
return TCL_ERROR;
}
envRefCounter += 1;
// free mutex after reference counter increment
#ifdef TCL_THREADS
Tcl_MutexUnlock(&envMutex);
#endif
// create exit handler
Tcl_CreateExitHandler(Tclodbc_Kill, (ClientData) 0);
// create commands
Tcl_CreateObjCommand(interp, "database", tcl_database, NULL,
(Tcl_CmdDeleteProc *) NULL);
// provide package information
Tcl_PkgProvide(interp, "tclodbc", PACKAGE_VERSION);
return TCL_OK ;
}
} // extern "C"
tclodbc-2.5.1/tclodbc.hxx 0000644 0001750 0000027 00000042544 11011550215 013550 0 ustar frankie /**********************************************************************
- TCLODBC COPYRIGHT NOTICE -
This software is copyrighted by Roy Nurmi, contact address by email at
Roy.Nurmi@iki.fi. The following terms apply to all files associated with
the software unless explicitly disclaimed in individual files.
The author hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
***********************************************************************/
//////////////////////////////////////////////////////////////////////////
// //
// ODBC-interface extension to tcl language by Roy Nurmi //
// Version 2.1 //
// //
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// //
// VERSION HISTORY //
// //
// 1.0 Initial version. Requires tcl 8.0 alpha 2 release //
// //
// 1.1 New version, compatible with tcl 8.0 beta 1 release //
// //
// 1.2 New version, enhanced functionality of statement columns command //
// //
// 1.3 New version, added database configure option, index queries, //
// new error object definition //
// //
// 1.4 New version, added database datasources and drivers options //
// and connecting with odbc connection string //
// //
// 1.4 patch 1 Bug corrections, enhanced portability //
// //
// 1.5 New version, added set and get commands for setting some //
// useful connection and statement options //
// //
// 1.6 New version, argument type definition moved to statement //
// creation. //
// //
// 1.7 New version, compilable also under tcl 7.6 //
// //
// 2.0 New version, cursor types & rowset_size also configurable //
// contributed by Ric Klaren (klaren@trc.nl). //
// optional array argument to statement fetch command //
// thread safety provided //
// Unicode support with tcl 8.1 //
// Emprovements in large columns support //
// //
// 2.1 New version, added database typeinfo and statement rowcount //
// //
// 2.2 New version, new binary column handling and some bug fixes //
// some contributions from Robert Black //
// //
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// STANDARD INCLUDES
//
extern "C" {
#include
#include
#include
}
#ifdef WIN32
#include
#define INCLUDE_EXTENSIONS
#else
#define _declspec(x) int
#ifdef HAVE_UNIXODBC
#define INCLUDE_EXTENSIONS // Uncomment this if odbc extensions available
#endif
#ifdef HAVE_IODBC
#define INCLUDE_EXTENSIONS // Uncomment this if odbc extensions available
#endif
#endif
#include "tclobj.hxx"
//////////////////////////////////////////////////////////////////////////
// ODBC INCLUDES
//
extern "C" {
#ifdef HAVE_IODBC // Using the free IODBC driver
/* I am not sure what version this is...
#include
#include
#include */
/* iODBC 2.12 */
#include
#include
#include
#else
#include
#include
#include
#endif
}
// We need these definitions if we're not using VC++
#ifndef _MSC_VER
typedef unsigned char BOOLEAN;
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
//////////////////////////////////////////////////////////////////////////
// DEFINES
//
#define SQL_MULTIPLE_RESULTSETS 12345
// environment handle
extern HENV env;
// Default lenght for blob buffer. If the database does not return
// the display lenght of a column, this value is used as default.
// However, if more data is available after fetch, more space
// is allocated when necessary.
#define MAX_BLOB_COLUMN_LENGTH 1024
// Maximum number of accepted sql arguments
#define MAX_SQL_ARGUMENTS 32
// A struct for storing strings with integer constants
struct NumStr
{
short numeric;
char* string;
};
#ifndef BOOL
#define BOOL int
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#define TCLODBC_OPTIONS 1000
#define TCLODBC_ENCODING 1000
// A struct for storing necessary data for retrieving sql results
struct ResultBuffer
{
SDWORD cbValue;
SDWORD cbValueMax;
SDWORD fSqlType;
BOOL boundColumn;
char* strResult;
SWORD fTargetType;
};
struct ArgDefBuffer
{
SWORD fSqlType;
UDWORD cbColDef;
SWORD ibScale;
SWORD fNullable;
SDWORD cbValue;
SWORD fSourceType;
};
//////////////////////////////////////////////////////////////////////////
// DATABASE OBJECT CLASS HEADERS
//
// Common TclCmdObject ancestor to all database objects. This defines
// common destructing and command dispatching methods.
class TclCmdObject {
public:
TclCmdObject() : tclCommand(NULL), pNext(NULL), pPrev(NULL) {};
virtual ~TclCmdObject();
// Virtual destructor for all database objects
static void Destroy(ClientData);
// Static function for destroying database objects
static int Dispatch(ClientData clientData, Tcl_Interp *interp,
int objc, TCL_CMDARGS);
// Static function for dispatching commands to objects
Tcl_Command tclCommand;
// token for tcl command in the interpreter
void AddToMyList (TclCmdObject *);
// add an object to list
void RemoveFromList ();
// add an object to list
TclCmdObject* Next () {return pNext;};
TclCmdObject* Prev () {return pPrev;};
// list navigation
private:
virtual int Dispatch(Tcl_Interp *interp, int objc, TCL_CMDARGS) = 0;
// Virtual function for class dependent implementation of
// static Dispatch().
TclCmdObject *pNext;
TclCmdObject *pPrev;
// links for linking certain objects to each other
};
// Class TclDatabase provides a general database object, with
// connecting and transaction handling methods. Dispatch interface
// is defined for handling database object commands.
class TclStatement; // forward declaration
class TclDatabase : public TclCmdObject {
public:
enum COMMANDS {STATEMENT, S, RECORDSET, DISCONNECT, TABLES,
COLUMNS, INDEXES, AUTOCOMMIT, COMMIT, ROLLBACK, SET, GET,
TYPEINFO, PRIMARYKEYS, EVAL, READ};
enum OPTIONS {CONFIGURE, DATASOURCES, DRIVERS, VERSION, CONNECT};
TclDatabase(TclObj db, TclObj uid, TclObj passwd);
// Constructor creates a database object with connection
// to a named datasource.
TclDatabase(TclObj connectionstring);
// Constructor creates a database object with a given connection
// string.
virtual ~TclDatabase();
// Virtual destructor, disconnects from the database and destroys
// the object.
void Autocommit(BOOL on);
// Autocommit sets the autocommit property on or off.
void Transact(UWORD operation);
// Transact is used for transaction handling. It is called with
// constant SQL_COMMIT or SQL_ROLLBACK.
void SetOption(Tcl_Interp *interp, char* option, char* value);
// SetOption is used for setting various connection object
// otions.
TclObj GetOption(char* option);
// GetOption is used for querying object options current values.
const Tcl_Encoding Encoding() {return encoding;};
// GetOption is used for querying object options current values.
static TclObj Datasources();
// List of all registered data source names
static TclObj Drivers();
// List of all registered drivers
static int Configure(Tcl_Interp *interp, int objc, TCL_CMDARGS);
// List of all registered drivers
HDBC DBC() {return dbc;};
// return dbc handle
UDWORD DriverInfo() {return infoExtensions;};
// return info from driver
private:
virtual int Dispatch(Tcl_Interp *interp, int objc, TCL_CMDARGS);
void AddStatement(TclStatement *);
bool useMultipleResultSets;
HDBC dbc;
Tcl_Encoding encoding;
UDWORD infoExtensions;
};
// Class TclStatement provides general statement handling methods,
// including statement handle creation and destroying, executing
// statement, and handling result set and result buffer.
class TclStatement : public TclCmdObject {
public:
enum COMMANDS {EXECUTE, MORERESULTS, FETCH, SET, GET, EVAL, RUN, READ, DROP, COLUMNS, ROWCOUNT, CURSORNAME};
virtual ~TclStatement();
// Destructor drops the statement handle and frees dynamic structures
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS) = 0;
// executes the statement with given arguments
int ColumnCount();
// returns the count of columns in current result set.
TclObj ColumnLabels();
// returns the labels of the columns
TclObj Result();
// The result set of an executed statement in a single TclObj.
TclObj Value(Tcl_Interp *interp, int objc = 0, TCL_CMDARGS = NULL);
// This first executes the statement, and then returns the result set
TclObj Columns(int objc, TCL_CMDARGS);
// returns requested information of the columns in a tcl list.
TclObj ColumnInfo(int col, UWORD attr);
// returns requested information of a columns
BOOL Fetch(TclObj&);
// Retches and returns the next row in the result set. Returns
// false if no more data
void SetOption(char* option, char* value);
// SetOption is used for setting various connection object
// otions.
TclObj GetOption(char* option);
// GetOption is used for querying object options current values.
void Eval(Tcl_Interp *interp, TclObj proc, int objc, TCL_CMDARGS);
// execute statement and eval tcl procedure for each result row
void Read(Tcl_Interp *interp, TclObj array, int objc, TCL_CMDARGS);
// execute statement and read result rows to tcl array
void FreeStmt();
// statement cleanup
void SqlWait(int delay);
// do something while waiting asynchronous sql statement finalize
protected:
TclStatement(TclDatabase& db);
// Protected constructor creates a statement connected to a given data
// source. This is called from descendents constructors.
HSTMT stmt;
TclDatabase* pDb;
virtual int Dispatch(Tcl_Interp *interp, int objc, TCL_CMDARGS);
protected:
bool useMultipleResultSets;
private:
int colCount;
TclObj colLabels;
ResultBuffer *resultBuffer;
void ReserveResultBuffer();
void FreeResultBuffer();
virtual RETCODE Fetch1 ();
};
class TclSqlStatement : public TclStatement {
public:
TclSqlStatement(TclDatabase& db, TclObj sql, bool multiSets /*, BOOL recordset = FALSE*/);
// creates a sql statement object connected to a given data
// source. Sql clause is given as argument.
void SetArgDefs (Tcl_Interp *interp, TclObj defObj);
// sets argument definitions based on tcl list object
protected:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
private:
ArgDefBuffer *argDefBuffer;
SWORD argCount;
};
class TclTableQuery : public TclStatement {
public:
TclTableQuery(TclDatabase& db) : TclStatement(db) {};
// creates a table query object connected to a given
// data source.
private:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
};
class TclColumnQuery : public TclStatement {
public:
TclColumnQuery(TclDatabase& db) : TclStatement(db) {};
// creates a column query object connected to a given
// data source.
private:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
};
class TclIndexQuery : public TclStatement {
public:
TclIndexQuery(TclDatabase& db) : TclStatement(db) {};
// creates a index query object connected to a given
// data source.
private:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
};
class TclTypeInfoQuery : public TclStatement {
public:
TclTypeInfoQuery(TclDatabase& db) : TclStatement(db) {};
// creates a typeinfo query object connected to a given
// data source.
private:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
};
class TclPrimaryKeysQuery : public TclStatement {
public:
TclPrimaryKeysQuery(TclDatabase& db) : TclStatement(db) {};
// creates a primary keys query object connected to a given
// data source.
private:
virtual void Execute(Tcl_Interp *interp, int objc, TCL_CMDARGS);
};
//////////////////////////////////////////////////////////////////////////
// COMMON STRINGS AND STRINGTABLES
//
extern char* strVersion;
extern char* strMemoryAllocationFailed;
extern char* strInvalidHandle;
extern char* strOK;
extern char* strTables;
extern char* strColumns;
extern char* strIndexes;
extern char* strPrimarykeys;
extern char* strTypeinfo;
extern char* strEval;
extern char* strRead;
extern char* strGet;
extern char* strSet;
extern char* strAutocommit;
extern char* strWrongArgs;
extern char* strUsage;
extern char* strCmdNotAvailable;
extern char* strEmpty;
extern char* strConcurrency;
extern char* strMaxrows;
extern char* strTimeout;
extern char* strMaxlenght;
extern char* strRowsetsize;
extern char* strCursortype;
extern char* strInvalidOption;
extern char* strOldSyntax;
extern NumStr sqlType [];
extern NumStr attrDef [];
extern NumStr concurrencyOp [];
extern NumStr cursorOp [];
extern NumStr connectOp [];
extern NumStr booleanOp [];
extern NumStr stmtOp [];
extern NumStr configOp [];
extern NumStr databaseOptions [];
extern NumStr databaseCmds [];
extern NumStr statementCmds [];
extern NumStr globalOptions [];
//////////////////////////////////////////////////////////////////////////
// FUNCTION DECLARATIONS
//
TclObj SqlErr (HENV env, HDBC dbc, HSTMT stmt);
short StrToNum (char *str, NumStr array[],
char* errMsg = strInvalidOption,
BOOLEAN allowNumeric = TRUE);
TclObj NumToStr (short num, NumStr array[]);
inline short SqlType (char *strType) {
return StrToNum(strType, sqlType, "Invalid sql type: ");
};
inline short AttrDef (char *strDef) {
return StrToNum(strDef, attrDef, "Invalid attribute: ");
};
inline short ConfigOp (char *strDef) {
return StrToNum(strDef, configOp);
};
BOOL EncodedType (int i);
SWORD MapSqlType (SDWORD colType);
#ifdef _DEBUG
int tclodbc_validateNumStrArrays();
int tclodbc_validateStrToNumFunction();
#endif
tclodbc-2.5.1/tclodbc.mak 0000644 0001750 0000027 00000054255 10607402667 013534 0 ustar frankie # Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
!IF "$(CFG)" == ""
CFG=tcl_odbc - Win32 Debug
!MESSAGE No configuration specified. Defaulting to tcl_odbc - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "tcl_odbc - Win32 Debug" && "$(CFG)" !=\
"tcl_odbc - Win32 Rel76" && "$(CFG)" != "tcl_odbc - Win32 Rel80" && "$(CFG)" !=\
"tcl_odbc - Win32 Rel81"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE on this makefile
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "tclodbc.mak" CFG="tcl_odbc - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "tcl_odbc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "tcl_odbc - Win32 Rel76" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "tcl_odbc - Win32 Rel80" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "tcl_odbc - Win32 Rel81" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
################################################################################
# Begin Project
# PROP Target_Last_Scanned "tcl_odbc - Win32 Rel76"
RSC=rc.exe
MTL=mktyplib.exe
CPP=cl.exe
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
OUTDIR=.\Debug
INTDIR=.\Debug
ALL : "$(OUTDIR)\tclodbc.dll" "$(OUTDIR)\tclodbc.bsc"
CLEAN :
-@erase "$(INTDIR)\database.obj"
-@erase "$(INTDIR)\database.sbr"
-@erase "$(INTDIR)\encoding.obj"
-@erase "$(INTDIR)\encoding.sbr"
-@erase "$(INTDIR)\statemnt.obj"
-@erase "$(INTDIR)\statemnt.sbr"
-@erase "$(INTDIR)\strings.obj"
-@erase "$(INTDIR)\strings.sbr"
-@erase "$(INTDIR)\tclobj.obj"
-@erase "$(INTDIR)\tclobj.sbr"
-@erase "$(INTDIR)\tclodbc.obj"
-@erase "$(INTDIR)\tclodbc.sbr"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
-@erase "$(OUTDIR)\tclodbc.bsc"
-@erase "$(OUTDIR)\tclodbc.dll"
-@erase "$(OUTDIR)\tclodbc.exp"
-@erase "$(OUTDIR)\tclodbc.ilk"
-@erase "$(OUTDIR)\tclodbc.lib"
-@erase "$(OUTDIR)\tclodbc.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "e:\tcl\inc80" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /c
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "e:\tcl\inc80" /D "WIN32" /D\
"_DEBUG" /D "_WINDOWS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/tclodbc.pch" /YX\
/Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
CPP_OBJS=.\Debug/
CPP_SBRS=.\Debug/
# ADD BASE MTL /nologo /D "_DEBUG" /win32
# ADD MTL /nologo /D "_DEBUG" /win32
MTL_PROJ=/nologo /D "_DEBUG" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
BSC32_FLAGS=/nologo /o"$(OUTDIR)/tclodbc.bsc"
BSC32_SBRS= \
"$(INTDIR)\database.sbr" \
"$(INTDIR)\encoding.sbr" \
"$(INTDIR)\statemnt.sbr" \
"$(INTDIR)\strings.sbr" \
"$(INTDIR)\tclobj.sbr" \
"$(INTDIR)\tclodbc.sbr"
"$(OUTDIR)\tclodbc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /debug /machine:I386
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /incremental:yes\
/pdb:"$(OUTDIR)/tclodbc.pdb" /debug /machine:I386 /out:"$(OUTDIR)/tclodbc.dll"\
/implib:"$(OUTDIR)/tclodbc.lib"
LINK32_OBJS= \
"$(INTDIR)\database.obj" \
"$(INTDIR)\encoding.obj" \
"$(INTDIR)\statemnt.obj" \
"$(INTDIR)\strings.obj" \
"$(INTDIR)\tclobj.obj" \
"$(INTDIR)\tclodbc.obj"
"$(OUTDIR)\tclodbc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "tcl_odbc"
# PROP BASE Intermediate_Dir "tcl_odbc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Tcl7.6"
# PROP Intermediate_Dir "Tcl7.6"
# PROP Target_Dir ""
OUTDIR=.\Tcl7.6
INTDIR=.\Tcl7.6
ALL : "$(OUTDIR)\tclodbc.dll" "$(OUTDIR)\tclodbc.bsc"
CLEAN :
-@erase "$(INTDIR)\database.obj"
-@erase "$(INTDIR)\database.sbr"
-@erase "$(INTDIR)\encoding.obj"
-@erase "$(INTDIR)\encoding.sbr"
-@erase "$(INTDIR)\statemnt.obj"
-@erase "$(INTDIR)\statemnt.sbr"
-@erase "$(INTDIR)\strings.obj"
-@erase "$(INTDIR)\strings.sbr"
-@erase "$(INTDIR)\tclobj.obj"
-@erase "$(INTDIR)\tclobj.sbr"
-@erase "$(INTDIR)\tclodbc.obj"
-@erase "$(INTDIR)\tclodbc.sbr"
-@erase "$(OUTDIR)\tclodbc.bsc"
-@erase "$(OUTDIR)\tclodbc.dll"
-@erase "$(OUTDIR)\tclodbc.exp"
-@erase "$(OUTDIR)\tclodbc.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "e:\tcl\inc76" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "e:\tcl\inc76" /D "WIN32" /D "NDEBUG" /D\
"_WINDOWS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/tclodbc.pch" /YX /Fo"$(INTDIR)/" /c
CPP_OBJS=.\Tcl7.6/
CPP_SBRS=.\Tcl7.6/
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /win32
MTL_PROJ=/nologo /D "NDEBUG" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
BSC32_FLAGS=/nologo /o"$(OUTDIR)/tclodbc.bsc"
BSC32_SBRS= \
"$(INTDIR)\database.sbr" \
"$(INTDIR)\encoding.sbr" \
"$(INTDIR)\statemnt.sbr" \
"$(INTDIR)\strings.sbr" \
"$(INTDIR)\tclobj.sbr" \
"$(INTDIR)\tclodbc.sbr"
"$(OUTDIR)\tclodbc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl76.lib /nologo /subsystem:windows /dll /machine:I386
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib tcl76.lib /nologo /subsystem:windows /dll /incremental:no\
/pdb:"$(OUTDIR)/tclodbc.pdb" /machine:I386 /out:"$(OUTDIR)/tclodbc.dll"\
/implib:"$(OUTDIR)/tclodbc.lib"
LINK32_OBJS= \
"$(INTDIR)\database.obj" \
"$(INTDIR)\encoding.obj" \
"$(INTDIR)\statemnt.obj" \
"$(INTDIR)\strings.obj" \
"$(INTDIR)\tclobj.obj" \
"$(INTDIR)\tclodbc.obj"
"$(OUTDIR)\tclodbc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "tcl_odb0"
# PROP BASE Intermediate_Dir "tcl_odb0"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Tcl8.0"
# PROP Intermediate_Dir "Tcl8.0"
# PROP Target_Dir ""
OUTDIR=.\Tcl8.0
INTDIR=.\Tcl8.0
ALL : "$(OUTDIR)\tclodbc.dll" "$(OUTDIR)\tclodbc.bsc"
CLEAN :
-@erase "$(INTDIR)\database.obj"
-@erase "$(INTDIR)\database.sbr"
-@erase "$(INTDIR)\encoding.obj"
-@erase "$(INTDIR)\encoding.sbr"
-@erase "$(INTDIR)\statemnt.obj"
-@erase "$(INTDIR)\statemnt.sbr"
-@erase "$(INTDIR)\strings.obj"
-@erase "$(INTDIR)\strings.sbr"
-@erase "$(INTDIR)\tclobj.obj"
-@erase "$(INTDIR)\tclobj.sbr"
-@erase "$(INTDIR)\tclodbc.obj"
-@erase "$(INTDIR)\tclodbc.sbr"
-@erase "$(OUTDIR)\tclodbc.bsc"
-@erase "$(OUTDIR)\tclodbc.dll"
-@erase "$(OUTDIR)\tclodbc.exp"
-@erase "$(OUTDIR)\tclodbc.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "e:\tcl\inc80" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "e:\tcl\inc80" /D "WIN32" /D "NDEBUG" /D\
"_WINDOWS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/tclodbc.pch" /YX /Fo"$(INTDIR)/" /c
CPP_OBJS=.\Tcl8.0/
CPP_SBRS=.\Tcl8.0/
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /win32
MTL_PROJ=/nologo /D "NDEBUG" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
BSC32_FLAGS=/nologo /o"$(OUTDIR)/tclodbc.bsc"
BSC32_SBRS= \
"$(INTDIR)\database.sbr" \
"$(INTDIR)\encoding.sbr" \
"$(INTDIR)\statemnt.sbr" \
"$(INTDIR)\strings.sbr" \
"$(INTDIR)\tclobj.sbr" \
"$(INTDIR)\tclodbc.sbr"
"$(OUTDIR)\tclodbc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /machine:I386
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /incremental:no\
/pdb:"$(OUTDIR)/tclodbc.pdb" /machine:I386 /out:"$(OUTDIR)/tclodbc.dll"\
/implib:"$(OUTDIR)/tclodbc.lib"
LINK32_OBJS= \
"$(INTDIR)\database.obj" \
"$(INTDIR)\encoding.obj" \
"$(INTDIR)\statemnt.obj" \
"$(INTDIR)\strings.obj" \
"$(INTDIR)\tclobj.obj" \
"$(INTDIR)\tclodbc.obj"
"$(OUTDIR)\tclodbc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "tcl_odb1"
# PROP BASE Intermediate_Dir "tcl_odb1"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Tcl8.1"
# PROP Intermediate_Dir "Tcl8.1"
# PROP Target_Dir ""
OUTDIR=.\Tcl8.1
INTDIR=.\Tcl8.1
ALL : "$(OUTDIR)\tclodbc.dll" "$(OUTDIR)\tclodbc.bsc"
CLEAN :
-@erase "$(INTDIR)\database.obj"
-@erase "$(INTDIR)\database.sbr"
-@erase "$(INTDIR)\encoding.obj"
-@erase "$(INTDIR)\encoding.sbr"
-@erase "$(INTDIR)\statemnt.obj"
-@erase "$(INTDIR)\statemnt.sbr"
-@erase "$(INTDIR)\strings.obj"
-@erase "$(INTDIR)\strings.sbr"
-@erase "$(INTDIR)\tclobj.obj"
-@erase "$(INTDIR)\tclobj.sbr"
-@erase "$(INTDIR)\tclodbc.obj"
-@erase "$(INTDIR)\tclodbc.sbr"
-@erase "$(OUTDIR)\tclodbc.bsc"
-@erase "$(OUTDIR)\tclodbc.dll"
-@erase "$(OUTDIR)\tclodbc.exp"
-@erase "$(OUTDIR)\tclodbc.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "e:\tcl\inc81" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR /YX /c
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "e:\tcl\inc81" /D "WIN32" /D "NDEBUG" /D\
"_WINDOWS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/tclodbc.pch" /YX /Fo"$(INTDIR)/" /c
CPP_OBJS=.\Tcl8.1/
CPP_SBRS=.\Tcl8.1/
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /win32
MTL_PROJ=/nologo /D "NDEBUG" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
BSC32_FLAGS=/nologo /o"$(OUTDIR)/tclodbc.bsc"
BSC32_SBRS= \
"$(INTDIR)\database.sbr" \
"$(INTDIR)\encoding.sbr" \
"$(INTDIR)\statemnt.sbr" \
"$(INTDIR)\strings.sbr" \
"$(INTDIR)\tclobj.sbr" \
"$(INTDIR)\tclodbc.sbr"
"$(OUTDIR)\tclodbc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl80vc.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tclstub81.lib /nologo /subsystem:windows /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"msvcrt.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmtd.lib" /nodefaultlib:"msvcrtd.lib"
# SUBTRACT LINK32 /nodefaultlib
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib tclstub81.lib /nologo /subsystem:windows /dll /incremental:no\
/pdb:"$(OUTDIR)/tclodbc.pdb" /machine:I386 /nodefaultlib:"libc.lib"\
/nodefaultlib:"msvcrt.lib" /nodefaultlib:"libcd.lib"\
/nodefaultlib:"libcmtd.lib" /nodefaultlib:"msvcrtd.lib"\
/out:"$(OUTDIR)/tclodbc.dll" /implib:"$(OUTDIR)/tclodbc.lib"
LINK32_OBJS= \
"$(INTDIR)\database.obj" \
"$(INTDIR)\encoding.obj" \
"$(INTDIR)\statemnt.obj" \
"$(INTDIR)\strings.obj" \
"$(INTDIR)\tclobj.obj" \
"$(INTDIR)\tclodbc.obj"
"$(OUTDIR)\tclodbc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
.cpp{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
.cxx{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
.c{$(CPP_SBRS)}.sbr:
$(CPP) $(CPP_PROJ) $<
.cpp{$(CPP_SBRS)}.sbr:
$(CPP) $(CPP_PROJ) $<
.cxx{$(CPP_SBRS)}.sbr:
$(CPP) $(CPP_PROJ) $<
################################################################################
# Begin Target
# Name "tcl_odbc - Win32 Debug"
# Name "tcl_odbc - Win32 Rel76"
# Name "tcl_odbc - Win32 Rel80"
# Name "tcl_odbc - Win32 Rel81"
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
!ENDIF
################################################################################
# Begin Source File
SOURCE=.\tclodbc.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_TCLOD=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\tclodbc.obj" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
"$(INTDIR)\tclodbc.sbr" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_TCLOD=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\tclodbc.obj" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
"$(INTDIR)\tclodbc.sbr" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_TCLOD=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\tclodbc.obj" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
"$(INTDIR)\tclodbc.sbr" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_TCLOD=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\tclodbc.obj" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
"$(INTDIR)\tclodbc.sbr" : $(SOURCE) $(DEP_CPP_TCLOD) "$(INTDIR)"
!ENDIF
# End Source File
################################################################################
# Begin Source File
SOURCE=.\tclobj.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_TCLOB=\
".\Tclobj.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\tclobj.obj" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
"$(INTDIR)\tclobj.sbr" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_TCLOB=\
".\Tclobj.hxx"\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\tclobj.obj" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
"$(INTDIR)\tclobj.sbr" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_TCLOB=\
".\Tclobj.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\tclobj.obj" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
"$(INTDIR)\tclobj.sbr" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_TCLOB=\
".\Tclobj.hxx"\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\tclobj.obj" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
"$(INTDIR)\tclobj.sbr" : $(SOURCE) $(DEP_CPP_TCLOB) "$(INTDIR)"
!ENDIF
# End Source File
################################################################################
# Begin Source File
SOURCE=.\encoding.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_ENCOD=\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\encoding.obj" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
"$(INTDIR)\encoding.sbr" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_ENCOD=\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\encoding.obj" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
"$(INTDIR)\encoding.sbr" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_ENCOD=\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\encoding.obj" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
"$(INTDIR)\encoding.sbr" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_ENCOD=\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\encoding.obj" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
"$(INTDIR)\encoding.sbr" : $(SOURCE) $(DEP_CPP_ENCOD) "$(INTDIR)"
!ENDIF
# End Source File
################################################################################
# Begin Source File
SOURCE=.\statemnt.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_STATE=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\statemnt.obj" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
"$(INTDIR)\statemnt.sbr" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_STATE=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\statemnt.obj" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
"$(INTDIR)\statemnt.sbr" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_STATE=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\statemnt.obj" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
"$(INTDIR)\statemnt.sbr" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_STATE=\
".\tclodbc.hxx"\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\statemnt.obj" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
"$(INTDIR)\statemnt.sbr" : $(SOURCE) $(DEP_CPP_STATE) "$(INTDIR)"
!ENDIF
# End Source File
################################################################################
# Begin Source File
SOURCE=.\strings.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_STRIN=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\strings.obj" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
"$(INTDIR)\strings.sbr" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_STRIN=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\strings.obj" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
"$(INTDIR)\strings.sbr" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_STRIN=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\strings.obj" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
"$(INTDIR)\strings.sbr" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_STRIN=\
".\tclodbc.hxx"\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\strings.obj" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
"$(INTDIR)\strings.sbr" : $(SOURCE) $(DEP_CPP_STRIN) "$(INTDIR)"
!ENDIF
# End Source File
################################################################################
# Begin Source File
SOURCE=.\database.cxx
!IF "$(CFG)" == "tcl_odbc - Win32 Debug"
DEP_CPP_DATAB=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\database.obj" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
"$(INTDIR)\database.sbr" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel76"
DEP_CPP_DATAB=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc76\tcl.h"\
"$(INTDIR)\database.obj" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
"$(INTDIR)\database.sbr" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel80"
DEP_CPP_DATAB=\
".\Tclobj.hxx"\
".\tclodbc.hxx"\
"e:\tcl\inc80\tcl.h"\
"$(INTDIR)\database.obj" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
"$(INTDIR)\database.sbr" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
!ELSEIF "$(CFG)" == "tcl_odbc - Win32 Rel81"
DEP_CPP_DATAB=\
".\tclodbc.hxx"\
"e:\tcl\inc81\tcl.h"\
"E:\Tcl\inc81\tclDecls.h"\
"$(INTDIR)\database.obj" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
"$(INTDIR)\database.sbr" : $(SOURCE) $(DEP_CPP_DATAB) "$(INTDIR)"
!ENDIF
# End Source File
# End Target
# End Project
################################################################################
tclodbc-2.5.1/ODBC.m4 0000644 0001750 0000027 00000024457 11011550215 012361 0 ustar frankie dnl ODBC.m4 generated automatically by aclocal 1.4a
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Copyright (c) 1999-2000 Ajuba Solutions
# Copyright (c) 2004 ActiveState
#------------------------------------------------------------------------
# TCLODBC_ENABLE_GXX --
#
# Allows the use of G++ if available. On Windows it
# defaults to cl.exe.
#
# Arguments:
# none
#
# Results:
#
# Adds the following arguments to configure:
# --enable-gxx
#
# Sets the following vars:
# CXX Command to use for the compiler
#------------------------------------------------------------------------
AC_DEFUN(TCLODBC_ENABLE_GXX, [
AC_ARG_ENABLE(gxx, [ --enable-gxx allow use of g++ if available [--disable-gxx]], [ok=$enableval], [ok=no])
if test "$ok" = "yes"; then
CXX=g++
else
if test "${TEA_PLATFORM}" = "windows" ; then
CXX=cl
else
CXX=${CXX-cc}
fi
fi
AC_PROG_CXX
])
#------------------------------------------------------------------------
# TCLODBC_PATH_ODBC --
#
# Locate the ODBC files (includes and libraries). This was
# taken from the original aclocal.m4 shipped with tclODBC
# and slightly modified.
#
# Arguments:
#
# Requires:
#
# Results:
#
# Adds ODBC include and libs to PKG info
#------------------------------------------------------------------------
dnl the alternative search directory is invoked by --with-odbcinclude
dnl and --with-odbclibrary
AC_DEFUN(TCLODBC_PATH_ODBC, [
if test "${TEA_PLATFORM}" = "windows" ; then
TEA_ADD_INCLUDES([])
TEA_ADD_LIBS([odbc32.lib odbccp32.lib])
else
TCLODBC_PATH_ODBCH
TCLODBC_PATH_ODBCLIB
TEA_ADD_INCLUDES([${ODBC_INCLUDE_DIR}])
TEA_ADD_LIBS([${ODBC_LIB_DIR} ${ODBC_LIB}])
fi
])
dnl Find the ODBC headers. This code may not work for certain
dnl intallations.
AC_DEFUN(TCLODBC_PATH_ODBCH, [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_odbc=true
ac_cv_c_odbch=""
ODBCTYPE=""
AC_ARG_WITH(odbcinclude, [ --with-odbcinclude directory where odbc headers are], with_odbcinclude=${withval})
if test x"${with_odbcinclude}" != x ; then
# first check to see if --with-odbcinclude was specified
list="/odbc/sql.h /ODBC/sql.h /unixodbc/sql.h /unixODBC/sql.h \
/iodbc/isql.h"
for i in $list ; do
if test -f "${with_odbcinclude}$i" ; then
ac_cv_c_odbch=`dirname ${with_odbcinclude}$i`
ac_cv_c_odbch=`(cd ${ac_cv_c_odbch}; pwd)`
break
fi
done
if test x"${ac_cv_c_odbch}" = x; then
AC_MSG_ERROR([${with_odbcinclude} directory does not contain headers])
fi
fi
dnl ===============================
dnl IODBC... I have not tested this a whole lot
dnl ===============================
dnl Check in the source tree
for i in $dirlist; do
if test -f "${srcdir}/$i/postodbc/isql.h" ; then
ac_cv_c_odbch=`(cd ${srcdir}/$i/postodbc/; pwd)`
ODBCTYPE=iodbc
fi
done
dnl Check a few common places in the file system
if test x"${ac_cv_c_odbch}" = x ; then
for i in \
/usr/local/mysql/include \
/usr/local/include/iodbc \
/usr/local/share/iodbc \
${prefix}/include/iodbc \
/usr/local/include \
/usr/include \
${prefix}/include ; do
if test -f $i/isql.h; then
ac_cv_c_odbch=`(cd $i; pwd)`
ODBCTYPE=iodbc
fi
done
fi
dnl check if its installed with the compiler
if test x"${ac_cv_c_odbch}" = x ; then
dnl Get the path to the compiler, strip off any args in ${CC}
ccprog=`echo ${CC} | sed -e 's: .*::'`
ccpath=`which ${ccprog} | sed -e 's:/bin/.*::'`/include/iodbc
if test -f $ccpath/isql.h; then
ac_cv_c_odbch=$ccpath
ODBCTYPE=iodbc
fi
fi
dnl see if one is installed
if test x"${ac_cv_c_odbch}" = x ; then
AC_CHECK_HEADER(isql.h, ac_cv_c_odbch=installed, ac_cv_c_odbch="")
if test x"${ac_cv_c_odbch}" != x ; then
ODBCTYPE=iodbc
fi
fi
dnl ===============================
dnl unixODBC or Intersolv... I have tested this
dnl ===============================
dnl Check for unixODBC headers
if test x"${ac_cv_c_odbch}" = x ; then
for i in \
/opt/odbc/include \
/opt/ODBC/include \
${prefix}/include/odbc \
${prefix}/include/ODBC \
/opt/unixodbc/include \
/opt/unixODBC/include \
${prefix}/include/unixodbc \
${prefix}/include/unixODBC \
/usr/local/mysql/include \
/usr/local/include \
/usr/include \
${prefix}/include ; do
if test -f "$i/sql.h"; then
ac_cv_c_odbch=`(cd $i; pwd)`
ODBCTYPE=unixODBC
fi
done
fi
dnl see if one is installed
if test x"${ac_cv_c_odbch}" = x ; then
AC_CHECK_HEADER(sql.h, ac_cv_c_odbch=installed, ac_cv_c_odbch="")
if test x"${ac_cv_c_odbch}" != x ; then
ODBCTYPE=unixODBC
fi
fi
dnl Figure out whether this is unixODBC or Intersolv
if test x"${ODBCTYPE}" = xunixODBC ; then
if test -f "${ac_cv_c_odbch}/odbcver.h" ; then
ODBCTYPE=intersolv
fi
fi
ODBC_INCLUDE_DIR=""
if test x"${ac_cv_c_odbch}" = x ; then
AC_MSG_ERROR([Cannot find any ODBC headers])
else
if test x"${ODBCTYPE}" = x ; then
if test -f "${ac_cv_c_odbch}/odbcver.h" ; then
ODBCTYPE=intersolv
elif test -f "${ac_cv_c_odbch}/sql.h" ; then
ODBCTYPE=unixODBC
elif test -f "${ac_cv_c_odbch}/isql.h" ; then
ODBCTYPE=iodbc
fi
fi
fi
AC_MSG_CHECKING([for ODBC headers files])
if test x"${ac_cv_c_odbch}" != x ; then
no_odbc=""
if test x"${ac_cv_c_odbch}" != xinstalled ; then
AC_MSG_RESULT(${ac_cv_c_odbch})
ODBC_INCLUDE_DIR="-I${ac_cv_c_odbch}"
else
AC_MSG_RESULT(none)
fi
fi
AC_SUBST(ODBC_INCLUDE_DIR)
AC_SUBST(ODBCTYPE)
])
dnl Find the ODBC library. This code may not work for certain
dnl intallations.
AC_DEFUN(TCLODBC_PATH_ODBCLIB, [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_odbc=true
ac_cv_c_odbc_libdir=""
ac_cv_c_odbc_lib=""
ODBC_LIB_NAME=""
AC_ARG_WITH(odbclibrary, [ --with-odbclibrary directory where odbc libraries are], with_odbclibrary=${withval})
dnl first check to see if --with-odbclibrary was specified
if test x"${with_odbclibrary}" != x ; then
if test -f ${with_odbclibrary} ; then
ac_cv_c_odbc_libdir=`echo ${with_odbclibrary} | sed -e 's:/libpsqlodbc.*::'`
ac_cv_c_odbc_libdir=`(cd ${ac_cv_c_odbc_libdir}; pwd)`
ac_cv_c_odbc_lib=`echo ${with_odbclibrary} | sed -e 's:.*/::'`
elif test -f ${with_odbclibrary}/libodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}; pwd)`
ac_cv_c_odbc_lib='-lodbc'
elif test -f ${with_odbclibrary}/libpsqlodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}; pwd)`
elif test -f ${with_odbclibrary}/iodbc/libpsqlodbc${TCL_SHLIB_SUFFIX} ; then
ac_cv_c_odbc_libdir=`(cd ${with_odbclibrary}/iodbc; pwd)`
ac_cv_c_odbc_lib='-llibpsqlodbc'
else
AC_MSG_ERROR([${with_odbclibrary} directory does not contain library])
fi
fi
dnl Check for multiple library names depending on the ODBC type
if test x"${ODBCTYPE}" = xiodbc ; then
liblist="libpsqlodbc libmysqlodbc librbodbc libiodbc iodbc"
libpathlist="/usr/local/lib/iodbc ${prefix}/iodbc/lib \
${prefix}/lib/iodbc /usr/local/mysql/lib /usr/local/lib /usr/lib ${prefix}/lib"
elif test x"${ODBCTYPE}" = xunixODBC ; then
liblist="libodbc"
libpathlist="/opt/unixodbc/lib /opt/unixODBC/lib /usr/include/odbc \
/usr/include/ODBC /usr/local/mysql/lib /usr/local/lib \
${prefix}/lib"
elif test x"${ODBCTYPE}" = xintersolv ; then
liblist="libodbc"
libpathlist="/opt/odbc/lib /opt/ODBC/lib /usr/include/unixodbc \
/usr/include/unixODBC /usr/local/mysql/lib /usr/local/lib \
${prefix}/lib"
else
AC_MSG_ERROR([ODBC support could not be identified.])
fi
for libname in $liblist; do
dnl Check in the build tree
for i in $dirlist; do
if test -f "$i/postodbc/${libname}${TCL_SHLIB_SUFFIX}" ; then
ac_cv_c_odbc_libdir=`(cd $i/postodbc/; pwd)`
break
fi
done
dnl Check a few common places in the file system
if test x"${ac_cv_c_odbc_libdir}" = x ; then
for i in $libpathlist; do
if test -f $i/${libname}${TCL_SHLIB_SUFFIX}; then
ac_cv_c_odbc_libdir=`(cd $i; pwd)`
break
fi
done
fi
dnl check if its installed with the compiler
if test x"${ac_cv_c_odbc_libdir}" = x ; then
dnl Get the path to the compiler, strip off any args in ${CC}
ccprog=`echo ${CC} | sed -e 's: .*::'`
ccpath=`which ${ccprog} | sed -e 's:/bin/.*::'`/lib
if test -f $ccpath/${libname}${TCL_SHLIB_SUFFIX}; then
ac_cv_c_odbc_libdir=$ccpath
fi
fi
dnl see if one is installed
if test x"${ac_cv_c_odbc_libdir}" = x ; then
AC_CHECK_LIB(${libname}, main)
fi
dnl do not keep searching for the other libraries, cause we found one
if test x"${ac_cv_c_odbc_libdir}" != x ; then
ac_cv_c_odbc_lib=${libname}
break
fi
done
ODBC_LIB_DIR=""
AC_MSG_CHECKING(for ODBC library files)
if test x"${ac_cv_c_odbc_libdir}" = x ; then
AC_MSG_ERROR([Cannot find an ODBC library path])
fi
if test x"${ac_cv_c_odbc_lib}" = x ; then
AC_MSG_ERROR([Cannot find an ODBC library])
fi
if test x"${ac_cv_c_odbc_libdir}" != x ; then
AC_MSG_RESULT(${ac_cv_c_odbc_libdir})
ODBC_LIB_DIR="-L${ac_cv_c_odbc_libdir}"
fi
AC_MSG_CHECKING(for ODBC library name)
ODBC_LIB=-l`echo $ac_cv_c_odbc_lib | sed -e 's:^lib::'`
AC_MSG_RESULT($ODBC_LIB)
if test x"${ODBCTYPE}" = xiodbc ; then
AC_MSG_RESULT(Using IODBC driver)
AC_DEFINE(HAVE_IODBC)
ODBC_LIB="$ODBC_LIB -liodbcinst"
fi
if test x"${ODBCTYPE}" = xunixODBC ; then
AC_MSG_RESULT(Using UnixODBC driver)
AC_DEFINE(HAVE_UNIXODBC)
AC_DEFINE(DONT_TD_VOID)
fi
if test x"${ODBCTYPE}" = xintersolv ; then
AC_MSG_RESULT(Using Intersolv driver)
AC_DEFINE(HAVE_INTERSOLV)
fi
AC_SUBST(ODBC_LIB)
AC_SUBST(ODBC_LIB_DIR)
])
tclodbc-2.5.1/Makefile.in 0000644 0001750 0000027 00000033220 11011550215 013441 0 ustar frankie #
# This file is a Makefile for tclodbc. If it has the name
# "Makefile.in" then it is a template for a Makefile; to generate the actual
# Makefile, run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@foo@" will get replaced in the actual
# Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.9 2005/03/25 20:49:20 hobbs Exp $
#========================================================================
# Edit the following few lines when writing a new extension
#========================================================================
#========================================================================
# Enumerate the names of the source files included in this package.
# This will be used when a dist target is added to the Makefile.
#========================================================================
PKG_SOURCES = @PKG_SOURCE@
PKG_OBJECTS = @PKG_OBJECTS@
#========================================================================
# This is a list of header files to be installed
#========================================================================
PKG_HEADERS = @PKG_HEADERS@
#========================================================================
# Add additional lines to handle any additional AC_SUBST cases that
# have been added to the configure script.
#========================================================================
PKG_TCL_SOURCES = \
$(srcdir)/tclutils/datautil.tcl \
$(srcdir)/tclutils/genutil.tcl \
$(srcdir)/tclutils/sqlutil.tcl \
$(srcdir)/tclutils/tkutil.tcl
DOC_FILES = \
$(srcdir)/doc/reference.htm \
$(srcdir)/doc/samples.htm \
$(srcdir)/doc/utilref.htm
SAMPLE_FILES = \
$(srcdir)/samples/clear.bat \
$(srcdir)/samples/connect.tcl \
$(srcdir)/samples/createdb.tcl \
$(srcdir)/samples/dumpdata.tcl \
$(srcdir)/samples/dumpdef.tcl \
$(srcdir)/samples/loaddata.tcl \
$(srcdir)/samples/loaddef.tcl \
$(srcdir)/samples/populate.tcl \
$(srcdir)/samples/tktable.tcl
MISC_FILES = $(srcdir)/license.txt
#========================================================================
# Nothing of the variables below this line need to be changed. Please
# check the TARGETS section below to make sure the make targets are
# correct.
#========================================================================
#========================================================================
# This is the parameterized name of the library that we are building.
#========================================================================
PKG_LIB_FILE = @PKG_LIB_FILE@
PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
lib_BINARIES = $(PKG_LIB_FILE)
BINARIES = $(lib_BINARIES)
SHELL = @SHELL@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
datadir = @datadir@
mandir = @mandir@
includedir = @includedir@
DESTDIR =
PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
pkgdatadir = $(datadir)/$(PKG_DIR)
pkglibdir = $(libdir)/$(PKG_DIR)
pkgincludedir = $(includedir)/$(PKG_DIR)
top_builddir = .
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
CC = @CC@
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
CFLAGS_WARNING = @CFLAGS_WARNING@
CLEANFILES = @CLEANFILES@
EXEEXT = @EXEEXT@
LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
MAKE_LIB = @MAKE_LIB@
MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
MAKE_STUB_LIB = @MAKE_STUB_LIB@
OBJEXT = @OBJEXT@
RANLIB = @RANLIB@
RANLIB_STUB = @RANLIB_STUB@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
STLIB_LD = @STLIB_LD@
TCL_DEFS = @TCL_DEFS@
TCL_BIN_DIR = @TCL_BIN_DIR@
TCL_SRC_DIR = @TCL_SRC_DIR@
# This is necessary for packages that use private Tcl headers
#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@
# Not used, but retained for reference of what libs Tcl required
TCL_LIBS = @TCL_LIBS@
#========================================================================
# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
# package without installing. The other environment variables allow us
# to test against an uninstalled Tcl. Add special env vars that you
# require for testing here (like TCLX_LIBRARY).
#========================================================================
EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
@LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
PATH="$(EXTRA_PATH):$(PATH)" \
TCLLIBPATH="$(top_builddir)"
TCLSH_PROG = @TCLSH_PROG@
TCLSH = $(TCLSH_ENV) $(TCLSH_PROG)
SHARED_BUILD = @SHARED_BUILD@
INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@
PKG_CFLAGS = @PKG_CFLAGS@
#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
DEFS = @DEFS@ $(PKG_CFLAGS)
CONFIG_CLEAN_FILES = Makefile
CPPFLAGS = @CPPFLAGS@
LIBS = @PKG_LIBS@ @LIBS@
AR = @AR@
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
#========================================================================
# Start of user-definable TARGETS section
#========================================================================
#========================================================================
# TEA TARGETS. Please note that the "libraries:" target refers to platform
# independant files, and the "binaries:" target inclues executable programs and
# platform-dependant libraries. Modify these targets so that they install
# the various pieces of your package. The make and install rules
# for the BINARIES that you specified above have already been done.
#========================================================================
all: binaries libraries doc
#========================================================================
# The binaries target builds executable programs, Windows .dll's, unix
# shared/static libraries, and any other platform-dependant files.
# The list of targets to build for "binaries:" is specified at the top
# of the Makefile, in the "BINARIES" variable.
#========================================================================
binaries: $(BINARIES) pkgIndex.tcl
libraries:
doc:
install: all install-binaries install-libraries install-doc
install-binaries: binaries install-lib-binaries install-bin-binaries
if test "x$(SHARED_BUILD)" = "x1"; then \
$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \
fi
#========================================================================
# This rule installs platform-independent files, such as header files.
#========================================================================
install-libraries: libraries
@mkdir -p $(DESTDIR)$(includedir)
@echo "Installing header files in $(DESTDIR)$(includedir)"
@list='$(PKG_HEADERS)'; for i in $$list; do \
echo "Installing $(srcdir)/$$i" ; \
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
done;
#========================================================================
# Install documentation. Unix manpages should go in the $(mandir)
# directory.
#========================================================================
install-doc: doc
#test: binaries libraries
# $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
shell: binaries libraries
@$(TCLSH) $(SCRIPT)
gdb:
$(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
depend:
#========================================================================
# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
# mentioned above. That will ensure that this target is built when you
# run "make binaries".
#
# The $(PKG_OBJECTS) objects are created and linked into the final
# library. In most cases these object files will correspond to the
# source files above.
#========================================================================
$(PKG_LIB_FILE): $(PKG_OBJECTS)
-rm -f $(PKG_LIB_FILE)
${MAKE_LIB}
$(RANLIB) $(PKG_LIB_FILE)
#$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
# -rm -f $(PKG_STUB_LIB_FILE)
# ${MAKE_STUB_LIB}
# $(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
#========================================================================
# We need to enumerate the list of .c to .o lines here.
#
# In the following lines, $(srcdir) refers to the toplevel directory
# containing your extension. If your sources are in a subdirectory,
# you will have to modify the paths to reflect this:
#
# sample.$(OBJEXT): $(srcdir)/generic/sample.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
#
# Setting the VPATH variable to a list of paths will cause the makefile
# to look into these paths when resolving .c to .obj dependencies.
# As necessary, add $(srcdir):$(srcdir)/compat:....
#========================================================================
VPATH = $(srcdir)
.cxx.@OBJEXT@: $(PKG_HEADERS)
$(COMPILE) -c `@CYGPATH@ $<` -o $@
#========================================================================
# Create the pkgIndex.tcl file.
# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but
# you may find that you need to customize the package. If so, either
# modify the -hand version, or create a pkgIndex.tcl.in file and have
# the configure script output the pkgIndex.tcl by editing configure.in.
#========================================================================
pkgIndex.tcl:
( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH)
pkgIndex.tcl-hand:
(echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
[list load [file join $$dir $(PKG_LIB_FILE)]]'\
) > pkgIndex.tcl
#========================================================================
# End of user-definable section
#========================================================================
#========================================================================
# Don't modify the file to clean here. Instead, set the "CLEANFILES"
# variable in configure.in
#========================================================================
clean:
-test -z "$(BINARIES)" || rm -f $(BINARIES)
-rm -f *.$(OBJEXT) core *.core
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
-rm -f *.tab.c
-rm -f $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log config.status
#========================================================================
# Install binary object libraries. On Windows this includes both .dll and
# .lib files. Because the .lib files are not explicitly listed anywhere,
# we need to deduce their existence from the .dll file of the same name.
# Additionally, the .dll files go into the bin directory, but the .lib
# files go into the lib directory. On Unix platforms, all library files
# go into the lib directory. In addition, this will generate the pkgIndex.tcl
# file in the install location (assuming it can find a usable tclsh8.2 shell)
#
# You should not have to modify this target.
#========================================================================
install-lib-binaries:
@mkdir -p $(DESTDIR)$(pkglibdir)
@mkdir -p $(DESTDIR)$(pkglibdir)/doc
@mkdir -p $(DESTDIR)$(pkglibdir)/samples
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
if test "x$$stub" = "xstub"; then \
echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
else \
echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
fi; \
ext=`echo $$p|sed -e "s/.*\.//"`; \
if test "x$$ext" = "xdll"; then \
lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
if test -f $$lib; then \
echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
$(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
fi; \
fi; \
fi; \
done
@echo "Installing script files in $(DESTDIR)$(pkglibdir)"
@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
if test -f $$p; then \
destp=`basename $$p`; \
echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkglibdir)/$$destp; \
fi; \
done
@echo "Installing documentation files in $(DESTDIR)$(pkglibdir)/doc"
@for i in $(DOC_FILES) ; do \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(pkglibdir)/doc ; \
done;
@echo "Installing sample files in $(DESTDIR)$(pkglibdir)/samples"
@for i in $(SAMPLE_FILES) ; do \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(pkglibdir)/samples ; \
done;
@echo "Installing misc files in $(DESTDIR)$(pkglibdir)"
@for i in $(MISC_FILES) ; do \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(pkglibdir) ; \
done;
#========================================================================
# Install binary executables (e.g. .exe files)
#
# You should not have to modify this target.
#========================================================================
install-bin-binaries:
@mkdir -p $(DESTDIR)$(bindir)
@list='$(bin_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
fi; \
done
.SUFFIXES: .c .cxx .$(OBJEXT)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
uninstall-binaries:
list='$(lib_BINARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
done
list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
p=`basename $$p`; \
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
done
list='$(bin_BINARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/$$p; \
done
.PHONY: all binaries clean depend distclean doc install libraries test
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
tclodbc-2.5.1/setup.tcl 0000644 0001750 0000027 00000004041 10607402667 013260 0 ustar frankie #
# Simple install script for tclodbc package
# (c) Roy Nurmi 1998-2001
#
proc output msg {
#use messagebox when run in wish, otherways puts msgs to stdout
if {[catch {tk_messageBox -message $msg}]} {puts $msg}
}
set tclodbc_version 2.5
set home [file dirname [info script]]
if {![info exists tcl_pkgPath]} {
# tcl_pkgPath not set, try to find lib directorey in auto_path (ok, kludge ;-)
foreach i $auto_path {
if [string match *lib $i] {
lappend tcl_pkgPath $i
break
}
}
# if lib not found, take first in auto_path
if {![info exists tcl_pkgPath]} {
lappend tcl_pkgPath [lindex $auto_path 0]
}
}
if {[file isdirectory [lindex $tcl_pkgPath 0]]} {
set pkgDir [lindex $tcl_pkgPath 0]/tclodbc$tclodbc_version
output "Installing tclodbc $tclodbc_version for Tcl $tcl_version to directory $pkgDir"
# create root directory
if {![file isdirectory $pkgDir]} {
file mkdir $pkgDir
}
# copy the right version of the dll
if {$tcl_version > "8.1"} {
set dll_version 8.1
} else {
set dll_version $tcl_version
}
file copy -force [file join $home tcl${dll_version}/tclodbc.dll] \
$pkgDir/tclodbc$tclodbc_version.dll
# copy supporting tcl files
set tclfiles [glob -nocomplain $home/tclutils/*]
foreach i $tclfiles {
file copy -force $i $pkgDir
}
# create subdirectories
if {![file isdirectory [file join $pkgDir doc]]} {
file mkdir [file join $pkgDir doc]
}
if {![file isdirectory [file join $pkgDir samples]]} {
file mkdir [file join $pkgDir samples]
}
# copy documentation
set docs [glob -nocomplain $home/doc/*]
foreach i $docs {
file copy -force $i [file join $pkgDir doc]
}
# copy samples
set samples [glob -nocomplain $home/samples/*]
foreach i $samples {
file copy -force $i [file join $pkgDir samples]
}
# copy license file
file copy -force [file join $home license.txt] $pkgDir
output "Installation successful."
} else {
output "Can't install, check proper tcl installation first."
}
exit
tclodbc-2.5.1/strings.cxx 0000644 0001750 0000027 00000027221 11011550215 013615 0 ustar frankie /**********************************************************************
- TCLODBC COPYRIGHT NOTICE -
This software is copyrighted by Roy Nurmi, contact address by email at
Roy.Nurmi@iki.fi. The following terms apply to all files associated with
the software unless explicitly disclaimed in individual files.
The author hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
***********************************************************************/
//////////////////////////////////////////////////////////////////////////
// STRINGS AND STRINGTABLES
//
#include "tclodbc.hxx"
// standard strings
char* strVersion = "tclodbc " PACKAGE_VERSION " (c) Roy Nurmi 1998, 2002";
char* strMemoryAllocationFailed = "Memory allocation failed";
char* strInvalidHandle = "Invalid handle";
char* strOK = "OK";
char* strTables = "tables";
char* strColumns = "columns";
char* strIndexes = "indexes";
char* strPrimarykeys = "primarykeys";
char* strTypeinfo = "typeinfo";
char* strEval = "eval";
char* strRead = "read";
char* strGet = "get";
char* strSet = "set";
char* strAutocommit = "autocommit";
char* strCommit = "commit";
char* strRollback = "rollback";
char* strWrongArgs = "wrong # args";
char* strUsage =
"Usage:\n"
" database [connect] id datasourcename userid password\n"
" database [connect] id connectionstring\n"
" database configure operation driver attributelist\n"
" database datasources\n"
" database drivers\n"
" database version\n";
char* strCmdNotAvailable = "command not available";
char* strEmpty = "";
char* strDisconnect = "disconnect";
char* strRun = "run";
char* strDrop = "drop";
char* strExecute = "execute";
char* strMoreResults = "moreresults";
char* strFetch = "fetch";
char* strConcurrency = "concurrency";
char* strMaxrows = "maxrows";
char* strTimeout = "timeout";
char* strMaxlenght = "maxlenght"; // stupid spelling mistake before 2.2, retained for compatibility
char* strMaxlength = "maxlength";
char* strRowsetsize = "rowsetsize";
char* strCursortype = "cursortype";
char* strNoscan = "noscan";
char* strEncoding = "encoding";
char* strStatement = "statement";
char* strRowCount = "rowcount";
char* strAsyncEnable = "async";
char* strInvalidOption = "Invalid option: ";
char* strOldSyntax = "This is old syntax which has been removed from tclodbc 2.1. Check documentation for replacement";
// IMPORTANT NOTE
// in tclodbc 2.1 the NumStr structure is optimized for
// speed with binary search. This requires that the strings
// in the struct are given in alphabetical order.
// The first row in a table gives the total count of strings
// in the struct.
NumStr sqlType [] = {
{19, NULL },
{SQL_BIGINT, "BIGINT" },
{SQL_BINARY, "BINARY" },
{SQL_BIT, "BIT" },
{SQL_CHAR, "CHAR" },
{SQL_DATE, "DATE" },
{SQL_DECIMAL, "DECIMAL" },
{SQL_DOUBLE, "DOUBLE" },
{SQL_FLOAT, "FLOAT" },
{SQL_INTEGER, "INTEGER" },
{SQL_LONGVARBINARY, "LONGVARBINARY"},
{SQL_LONGVARCHAR, "LONGVARCHAR" },
{SQL_NUMERIC, "NUMERIC" },
{SQL_REAL, "REAL" },
{SQL_SMALLINT, "SMALLINT" },
{SQL_TIME, "TIME" },
{SQL_TIMESTAMP, "TIMESTAMP" },
{SQL_TINYINT, "TINYINT" },
{SQL_VARBINARY, "VARBINARY" },
{SQL_VARCHAR, "VARCHAR" }
};
NumStr attrDef [] = {
{12, NULL },
{SQL_COLUMN_DISPLAY_SIZE, "displaysize" },
{SQL_COLUMN_LABEL, "label" },
{SQL_COLUMN_NAME, "name" },
{SQL_COLUMN_NULLABLE, "nullable" },
{SQL_COLUMN_OWNER_NAME, "owner" },
{SQL_COLUMN_PRECISION, "precision" },
{SQL_COLUMN_QUALIFIER_NAME, "qualifiername" },
{SQL_COLUMN_SCALE, "scale" },
{SQL_COLUMN_TABLE_NAME, "tablename" },
{SQL_COLUMN_TYPE, "type" },
{SQL_COLUMN_TYPE_NAME, "typename" },
{SQL_COLUMN_UPDATABLE, "updatable" },
};
NumStr stmtOp [] = {
{9, NULL },
{SQL_ASYNC_ENABLE, strAsyncEnable },
{SQL_CONCURRENCY, strConcurrency },
{SQL_CURSOR_TYPE, strCursortype },
{SQL_MAX_LENGTH, strMaxlenght }, // incorrectly spelled here, retained for compatibility
{SQL_MAX_LENGTH, strMaxlength },
{SQL_MAX_ROWS, strMaxrows },
{SQL_NOSCAN, strNoscan },
{SQL_ROWSET_SIZE, strRowsetsize },
{SQL_QUERY_TIMEOUT, strTimeout }
};
NumStr configOp [] = {
#ifdef INCLUDE_EXTENSIONS
{6, NULL },
{ODBC_ADD_DSN, "add_dsn" },
{ODBC_ADD_SYS_DSN, "add_sys_dsn" },
{ODBC_CONFIG_DSN, "config_dsn" },
{ODBC_CONFIG_SYS_DSN, "config_sys_dsn"},
{ODBC_REMOVE_DSN, "remove_dsn" },
{ODBC_REMOVE_SYS_DSN, "remove_sys_dsn"}
#else
{0, NULL }
#endif
};
NumStr connectOp [] = {
{11, NULL },
{SQL_ASYNC_ENABLE, strAsyncEnable },
{SQL_AUTOCOMMIT, strAutocommit },
{SQL_CONCURRENCY, strConcurrency },
{SQL_CURSOR_TYPE, strCursortype },
{TCLODBC_ENCODING, strEncoding },
{SQL_MAX_LENGTH, strMaxlenght }, // incorrectly spelled here, retained for compatibility
{SQL_MAX_LENGTH, strMaxlength },
{SQL_MAX_ROWS, strMaxrows },
{SQL_NOSCAN, strNoscan },
{SQL_ROWSET_SIZE, strRowsetsize },
{SQL_QUERY_TIMEOUT, strTimeout }
};
NumStr booleanOp [] = {
{8, NULL },
{0, "0" },
{1, "1" },
{0, "false" },
{0, "no" },
{0, "off" },
{1, "on" },
{1, "true" },
{1, "yes" }
};
NumStr concurrencyOp [] = {
{4, NULL },
{SQL_CONCUR_LOCK, "lock" },
{SQL_CONCUR_READ_ONLY, "readonly" },
{SQL_CONCUR_ROWVER, "rowver" },
{SQL_CONCUR_VALUES, "values" }
};
NumStr cursorOp [] = {
{4, NULL },
{SQL_CURSOR_DYNAMIC, "dynamic" },
{SQL_CURSOR_FORWARD_ONLY, "forwardonly" },
{SQL_CURSOR_KEYSET_DRIVEN, "keysetdriven" },
{SQL_CURSOR_STATIC, "static" }
};
NumStr databaseOptions [] = {
{5, NULL },
{TclDatabase::CONFIGURE, "configure" },
{TclDatabase::CONNECT, "connect" },
{TclDatabase::DATASOURCES, "datasources" },
{TclDatabase::DRIVERS, "drivers" },
{TclDatabase::VERSION, "version" }
};
NumStr databaseCmds [] = {
{15, NULL },
{TclDatabase::AUTOCOMMIT, strAutocommit },
{TclDatabase::COLUMNS, strColumns },
{TclDatabase::COMMIT, strCommit },
{TclDatabase::DISCONNECT, strDisconnect },
{TclDatabase::EVAL, strEval },
{TclDatabase::GET, strGet },
{TclDatabase::INDEXES, strIndexes },
{TclDatabase::PRIMARYKEYS, strPrimarykeys},
{TclDatabase::READ, strRead },
{TclDatabase::ROLLBACK, strRollback },
{TclDatabase::STATEMENT, "s" }, // shortcut
{TclDatabase::SET, strSet },
{TclDatabase::STATEMENT, strStatement },
{TclDatabase::TABLES, strTables },
{TclDatabase::TYPEINFO, strTypeinfo }
};
NumStr statementCmds [] = {
{11, NULL },
{TclStatement::COLUMNS, strColumns },
{TclStatement::DROP, strDrop },
{TclStatement::EVAL, strEval },
{TclStatement::EXECUTE, strExecute },
{TclStatement::FETCH, strFetch },
{TclStatement::GET, strGet },
{TclStatement::MORERESULTS, strMoreResults },
{TclStatement::READ, strRead },
{TclStatement::ROWCOUNT, strRowCount },
{TclStatement::RUN, strRun },
{TclStatement::SET, strSet }
};
#ifdef _DEBUG
typedef struct
{
NumStr *ptr_array;
int array_size;
}
NumStrArrayDescriptor;
NumStrArrayDescriptor g_NumStrArrayDescriptors[] = {
{ sqlType, sizeof( sqlType ) / sizeof(NumStr) },
{ attrDef, sizeof( attrDef ) / sizeof(NumStr) },
{ stmtOp, sizeof( stmtOp ) / sizeof(NumStr) },
{ configOp, sizeof( configOp ) / sizeof(NumStr) },
{ connectOp, sizeof( connectOp ) / sizeof(NumStr) },
{ booleanOp, sizeof( booleanOp ) / sizeof(NumStr) },
{ concurrencyOp, sizeof( concurrencyOp ) / sizeof(NumStr) },
{ cursorOp, sizeof( cursorOp ) / sizeof(NumStr) },
{ databaseOptions, sizeof( databaseOptions ) / sizeof(NumStr) },
{ databaseCmds, sizeof( databaseCmds ) / sizeof(NumStr) },
{ statementCmds, sizeof( statementCmds ) / sizeof(NumStr) }
};
const unsigned int g_cntNumStrArrays = sizeof(g_NumStrArrayDescriptors)/sizeof(NumStrArrayDescriptor);
// This function ensures that the first entry of each NumStr array indicates the correct number
// of valid entries in the array.
//
int tclodbc_validateNumStrArrays()
{
unsigned int claimed_size;
unsigned int actual_size;
unsigned int idx;
NumStr *pArray;
for (idx=0; idx