aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/embryo
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/embryo
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/embryo')
-rw-r--r--libraries/embryo/ABOUT-NLS0
-rw-r--r--libraries/embryo/AUTHORS2
-rw-r--r--libraries/embryo/COPYING47
-rw-r--r--libraries/embryo/ChangeLog16
-rw-r--r--libraries/embryo/INSTALL236
-rw-r--r--libraries/embryo/Makefile.am44
-rw-r--r--libraries/embryo/Makefile.in846
-rw-r--r--libraries/embryo/NEWS13
-rw-r--r--libraries/embryo/README91
-rw-r--r--libraries/embryo/aclocal.m41181
-rwxr-xr-xlibraries/embryo/autogen.sh38
-rwxr-xr-xlibraries/embryo/compile143
-rwxr-xr-xlibraries/embryo/config.guess1533
-rw-r--r--libraries/embryo/config.h.in148
-rwxr-xr-xlibraries/embryo/config.sub1693
-rwxr-xr-xlibraries/embryo/configure15821
-rw-r--r--libraries/embryo/configure.ac215
-rwxr-xr-xlibraries/embryo/depcomp630
-rw-r--r--libraries/embryo/doc/Doxyfile139
-rw-r--r--libraries/embryo/doc/Doxyfile.in139
-rw-r--r--libraries/embryo/doc/Makefile.am33
-rw-r--r--libraries/embryo/doc/Makefile.in416
-rw-r--r--libraries/embryo/doc/e.css436
-rw-r--r--libraries/embryo/doc/embryo.dox.in0
-rw-r--r--libraries/embryo/doc/foot.html19
-rw-r--r--libraries/embryo/doc/head.html66
-rw-r--r--libraries/embryo/doc/img/e.pngbin0 -> 3825 bytes
-rw-r--r--libraries/embryo/doc/img/e_big.pngbin0 -> 30052 bytes
-rw-r--r--libraries/embryo/doc/img/edoxy.css966
-rw-r--r--libraries/embryo/doc/img/foot_bg.pngbin0 -> 173 bytes
-rw-r--r--libraries/embryo/doc/img/head_bg.pngbin0 -> 214 bytes
-rw-r--r--libraries/embryo/doc/img/hilite.pngbin0 -> 6127 bytes
-rw-r--r--libraries/embryo/doc/img/menu_bg.pngbin0 -> 192 bytes
-rw-r--r--libraries/embryo/doc/img/menu_bg_current.pngbin0 -> 1200 bytes
-rw-r--r--libraries/embryo/doc/img/menu_bg_hover.pngbin0 -> 3278 bytes
-rw-r--r--libraries/embryo/doc/img/menu_bg_last.pngbin0 -> 637 bytes
-rw-r--r--libraries/embryo/doc/img/menu_bg_unsel.pngbin0 -> 1596 bytes
-rw-r--r--libraries/embryo/embryo.pc.in15
-rw-r--r--libraries/embryo/embryo.spec77
-rw-r--r--libraries/embryo/embryo.spec.in77
-rw-r--r--libraries/embryo/include/Makefile.am7
-rw-r--r--libraries/embryo/include/Makefile.in439
-rw-r--r--libraries/embryo/include/default.inc213
-rwxr-xr-xlibraries/embryo/install-sh520
-rwxr-xr-xlibraries/embryo/ltmain.sh8413
-rw-r--r--libraries/embryo/m4/ac_attribute.m447
-rw-r--r--libraries/embryo/m4/efl_binary.m444
-rw-r--r--libraries/embryo/m4/efl_doxygen.m497
-rw-r--r--libraries/embryo/m4/efl_fnmatch.m431
-rw-r--r--libraries/embryo/m4/efl_path_max.m436
-rw-r--r--libraries/embryo/m4/libtool.m47377
-rw-r--r--libraries/embryo/m4/ltoptions.m4368
-rw-r--r--libraries/embryo/m4/ltsugar.m4123
-rw-r--r--libraries/embryo/m4/ltversion.m423
-rw-r--r--libraries/embryo/m4/lt~obsolete.m492
-rwxr-xr-xlibraries/embryo/missing376
-rw-r--r--libraries/embryo/sha1-for-source.txt1
-rw-r--r--libraries/embryo/src/Makefile.am3
-rw-r--r--libraries/embryo/src/Makefile.in589
-rw-r--r--libraries/embryo/src/bin/Makefile.am40
-rw-r--r--libraries/embryo/src/bin/Makefile.in787
-rw-r--r--libraries/embryo/src/bin/embryo_cc_amx.h226
-rw-r--r--libraries/embryo/src/bin/embryo_cc_prefix.c61
-rw-r--r--libraries/embryo/src/bin/embryo_cc_prefix.h6
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc.h667
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc1.c4079
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc2.c2779
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc3.c2438
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc4.c1308
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc5.c154
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc5.scp317
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc6.c1077
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc7.c688
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sc7.scp1473
-rw-r--r--libraries/embryo/src/bin/embryo_cc_scexpand.c53
-rw-r--r--libraries/embryo/src/bin/embryo_cc_sclist.c293
-rw-r--r--libraries/embryo/src/bin/embryo_cc_scvars.c88
-rw-r--r--libraries/embryo/src/lib/Embryo.h901
-rw-r--r--libraries/embryo/src/lib/Makefile.am35
-rw-r--r--libraries/embryo/src/lib/Makefile.in682
-rw-r--r--libraries/embryo/src/lib/embryo_amx.c1991
-rw-r--r--libraries/embryo/src/lib/embryo_args.c128
-rw-r--r--libraries/embryo/src/lib/embryo_float.c331
-rw-r--r--libraries/embryo/src/lib/embryo_main.c36
-rw-r--r--libraries/embryo/src/lib/embryo_private.h298
-rw-r--r--libraries/embryo/src/lib/embryo_rand.c36
-rw-r--r--libraries/embryo/src/lib/embryo_str.c485
-rw-r--r--libraries/embryo/src/lib/embryo_time.c93
88 files changed, 65429 insertions, 0 deletions
diff --git a/libraries/embryo/ABOUT-NLS b/libraries/embryo/ABOUT-NLS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libraries/embryo/ABOUT-NLS
diff --git a/libraries/embryo/AUTHORS b/libraries/embryo/AUTHORS
new file mode 100644
index 0000000..7bf31c1
--- /dev/null
+++ b/libraries/embryo/AUTHORS
@@ -0,0 +1,2 @@
1The Rasterman (Carsten Haitzler) <raster@rasterman.com>
2
diff --git a/libraries/embryo/COPYING b/libraries/embryo/COPYING
new file mode 100644
index 0000000..26d6208
--- /dev/null
+++ b/libraries/embryo/COPYING
@@ -0,0 +1,47 @@
1Copyright notice for Embryo:
2
3Copyright (C) 2004-2011 Carsten Haitzler and various contributors (see AUTHORS)
4
5All rights reserved.
6
7Redistribution and use in source and binary forms, with or without
8modification, are permitted provided that the following conditions are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
25EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27Large parts of this source come under the following license from the
28original Small (renamed to Pawn afterwards, but was named Small when
29Embryo split off). See the source files that are clearly marked as below:
30
31Copyright (c) ITB CompuPhase, 1997-2003
32
33This software is provided "as-is", without any express or implied warranty.
34In no event will the authors be held liable for any damages arising from
35the use of this software.
36
37Permission is granted to anyone to use this software for any purpose,
38including commercial applications, and to alter it and redistribute it
39freely, subject to the following restrictions:
40
41 1. The origin of this software must not be misrepresented; you must not
42 claim that you wrote the original software. If you use this software in
43 a product, an acknowledgment in the product documentation would be
44 appreciated but is not required.
45 2. Altered source versions must be plainly marked as such, and must not be
46 misrepresented as being the original software.
47 3. This notice may not be removed or altered from any source distribution.
diff --git a/libraries/embryo/ChangeLog b/libraries/embryo/ChangeLog
new file mode 100644
index 0000000..4a46661
--- /dev/null
+++ b/libraries/embryo/ChangeLog
@@ -0,0 +1,16 @@
12011-01-29 Carsten Haitzler (The Rasterman)
2
3 1.0.0 release
4
52011-05-12 Carsten Haitzler (The Rasterman)
6
7 * Make embryo_cc use eina and eina_prefix to determine include location
8
92011-07-16 Vincent Torri
10
11 * delete temporary files on Windows
12
132011-10-05 Vincent Torri
14
15 * use fseek() instead of rewind() as the latter does not exist on
16 Windows CE and fix compilation with Evil.
diff --git a/libraries/embryo/INSTALL b/libraries/embryo/INSTALL
new file mode 100644
index 0000000..23e5f25
--- /dev/null
+++ b/libraries/embryo/INSTALL
@@ -0,0 +1,236 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
5Software Foundation, Inc.
6
7This file is free documentation; the Free Software Foundation gives
8unlimited permission to copy, distribute and modify it.
9
10Basic Installation
11==================
12
13These are generic installation instructions.
14
15 The `configure' shell script attempts to guess correct values for
16various system-dependent variables used during compilation. It uses
17those values to create a `Makefile' in each directory of the package.
18It may also create one or more `.h' files containing system-dependent
19definitions. Finally, it creates a shell script `config.status' that
20you can run in the future to recreate the current configuration, and a
21file `config.log' containing compiler output (useful mainly for
22debugging `configure').
23
24 It can also use an optional file (typically called `config.cache'
25and enabled with `--cache-file=config.cache' or simply `-C') that saves
26the results of its tests to speed up reconfiguring. (Caching is
27disabled by default to prevent problems with accidental use of stale
28cache files.)
29
30 If you need to do unusual things to compile the package, please try
31to figure out how `configure' could check whether to do them, and mail
32diffs or instructions to the address given in the `README' so they can
33be considered for the next release. If you are using the cache, and at
34some point `config.cache' contains results you don't want to keep, you
35may remove or edit it.
36
37 The file `configure.ac' (or `configure.in') is used to create
38`configure' by a program called `autoconf'. You only need
39`configure.ac' if you want to change it or regenerate `configure' using
40a newer version of `autoconf'.
41
42The simplest way to compile this package is:
43
44 1. `cd' to the directory containing the package's source code and type
45 `./configure' to configure the package for your system. If you're
46 using `csh' on an old version of System V, you might need to type
47 `sh ./configure' instead to prevent `csh' from trying to execute
48 `configure' itself.
49
50 Running `configure' takes awhile. While running, it prints some
51 messages telling which features it is checking for.
52
53 2. Type `make' to compile the package.
54
55 3. Optionally, type `make check' to run any self-tests that come with
56 the package.
57
58 4. Type `make install' to install the programs and any data files and
59 documentation.
60
61 5. You can remove the program binaries and object files from the
62 source code directory by typing `make clean'. To also remove the
63 files that `configure' created (so you can compile the package for
64 a different kind of computer), type `make distclean'. There is
65 also a `make maintainer-clean' target, but that is intended mainly
66 for the package's developers. If you use it, you may have to get
67 all sorts of other programs in order to regenerate files that came
68 with the distribution.
69
70Compilers and Options
71=====================
72
73Some systems require unusual options for compilation or linking that the
74`configure' script does not know about. Run `./configure --help' for
75details on some of the pertinent environment variables.
76
77 You can give `configure' initial values for configuration parameters
78by setting variables in the command line or in the environment. Here
79is an example:
80
81 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
82
83 *Note Defining Variables::, for more details.
84
85Compiling For Multiple Architectures
86====================================
87
88You can compile the package for more than one kind of computer at the
89same time, by placing the object files for each architecture in their
90own directory. To do this, you must use a version of `make' that
91supports the `VPATH' variable, such as GNU `make'. `cd' to the
92directory where you want the object files and executables to go and run
93the `configure' script. `configure' automatically checks for the
94source code in the directory that `configure' is in and in `..'.
95
96 If you have to use a `make' that does not support the `VPATH'
97variable, you have to compile the package for one architecture at a
98time in the source code directory. After you have installed the
99package for one architecture, use `make distclean' before reconfiguring
100for another architecture.
101
102Installation Names
103==================
104
105By default, `make install' installs the package's commands under
106`/usr/local/bin', include files under `/usr/local/include', etc. You
107can specify an installation prefix other than `/usr/local' by giving
108`configure' the option `--prefix=PREFIX'.
109
110 You can specify separate installation prefixes for
111architecture-specific files and architecture-independent files. If you
112pass the option `--exec-prefix=PREFIX' to `configure', the package uses
113PREFIX as the prefix for installing programs and libraries.
114Documentation and other data files still use the regular prefix.
115
116 In addition, if you use an unusual directory layout you can give
117options like `--bindir=DIR' to specify different values for particular
118kinds of files. Run `configure --help' for a list of the directories
119you can set and what kinds of files go in them.
120
121 If the package supports it, you can cause programs to be installed
122with an extra prefix or suffix on their names by giving `configure' the
123option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
124
125Optional Features
126=================
127
128Some packages pay attention to `--enable-FEATURE' options to
129`configure', where FEATURE indicates an optional part of the package.
130They may also pay attention to `--with-PACKAGE' options, where PACKAGE
131is something like `gnu-as' or `x' (for the X Window System). The
132`README' should mention any `--enable-' and `--with-' options that the
133package recognizes.
134
135 For packages that use the X Window System, `configure' can usually
136find the X include and library files automatically, but if it doesn't,
137you can use the `configure' options `--x-includes=DIR' and
138`--x-libraries=DIR' to specify their locations.
139
140Specifying the System Type
141==========================
142
143There may be some features `configure' cannot figure out automatically,
144but needs to determine by the type of machine the package will run on.
145Usually, assuming the package is built to be run on the _same_
146architectures, `configure' can figure that out, but if it prints a
147message saying it cannot guess the machine type, give it the
148`--build=TYPE' option. TYPE can either be a short name for the system
149type, such as `sun4', or a canonical name which has the form:
150
151 CPU-COMPANY-SYSTEM
152
153where SYSTEM can have one of these forms:
154
155 OS KERNEL-OS
156
157 See the file `config.sub' for the possible values of each field. If
158`config.sub' isn't included in this package, then this package doesn't
159need to know the machine type.
160
161 If you are _building_ compiler tools for cross-compiling, you should
162use the option `--target=TYPE' to select the type of system they will
163produce code for.
164
165 If you want to _use_ a cross compiler, that generates code for a
166platform different from the build platform, you should specify the
167"host" platform (i.e., that on which the generated programs will
168eventually be run) with `--host=TYPE'.
169
170Sharing Defaults
171================
172
173If you want to set default values for `configure' scripts to share, you
174can create a site shell script called `config.site' that gives default
175values for variables like `CC', `cache_file', and `prefix'.
176`configure' looks for `PREFIX/share/config.site' if it exists, then
177`PREFIX/etc/config.site' if it exists. Or, you can set the
178`CONFIG_SITE' environment variable to the location of the site script.
179A warning: not all `configure' scripts look for a site script.
180
181Defining Variables
182==================
183
184Variables not defined in a site shell script can be set in the
185environment passed to `configure'. However, some packages may run
186configure again during the build, and the customized values of these
187variables may be lost. In order to avoid this problem, you should set
188them in the `configure' command line, using `VAR=value'. For example:
189
190 ./configure CC=/usr/local2/bin/gcc
191
192causes the specified `gcc' to be used as the C compiler (unless it is
193overridden in the site shell script). Here is a another example:
194
195 /bin/bash ./configure CONFIG_SHELL=/bin/bash
196
197Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
198configuration-related scripts to be executed by `/bin/bash'.
199
200`configure' Invocation
201======================
202
203`configure' recognizes the following options to control how it operates.
204
205`--help'
206`-h'
207 Print a summary of the options to `configure', and exit.
208
209`--version'
210`-V'
211 Print the version of Autoconf used to generate the `configure'
212 script, and exit.
213
214`--cache-file=FILE'
215 Enable the cache: use and save the results of the tests in FILE,
216 traditionally `config.cache'. FILE defaults to `/dev/null' to
217 disable caching.
218
219`--config-cache'
220`-C'
221 Alias for `--cache-file=config.cache'.
222
223`--quiet'
224`--silent'
225`-q'
226 Do not print messages saying which checks are being made. To
227 suppress all normal output, redirect it to `/dev/null' (any error
228 messages will still be shown).
229
230`--srcdir=DIR'
231 Look for the package's source code in directory DIR. Usually
232 `configure' can determine that directory automatically.
233
234`configure' also accepts some other, not widely useful, options. Run
235`configure --help' for more details.
236
diff --git a/libraries/embryo/Makefile.am b/libraries/embryo/Makefile.am
new file mode 100644
index 0000000..5c70db3
--- /dev/null
+++ b/libraries/embryo/Makefile.am
@@ -0,0 +1,44 @@
1ACLOCAL_AMFLAGS = -I m4
2
3SUBDIRS = src include doc
4
5MAINTAINERCLEANFILES = \
6Makefile.in \
7aclocal.m4 \
8compile \
9config.guess \
10config.h.in \
11config.h.in~ \
12config.sub \
13configure \
14depcomp \
15install-sh \
16ltmain.sh \
17missing \
18$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
19$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
20$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
21m4/libtool.m4 \
22m4/lt~obsolete.m4 \
23m4/ltoptions.m4 \
24m4/ltsugar.m4 \
25m4/ltversion.m4
26
27EXTRA_DIST = \
28AUTHORS \
29COPYING \
30autogen.sh \
31embryo.pc.in \
32embryo.spec.in \
33embryo.spec
34
35pkgconfigdir = $(libdir)/pkgconfig
36pkgconfig_DATA = embryo.pc
37
38.PHONY: doc
39
40# Documentation
41
42doc:
43 @echo "entering doc/"
44 make -C doc doc
diff --git a/libraries/embryo/Makefile.in b/libraries/embryo/Makefile.in
new file mode 100644
index 0000000..dfa4287
--- /dev/null
+++ b/libraries/embryo/Makefile.in
@@ -0,0 +1,846 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = .
38DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
39 $(srcdir)/Makefile.in $(srcdir)/config.h.in \
40 $(srcdir)/embryo.pc.in $(srcdir)/embryo.spec.in \
41 $(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING ChangeLog \
42 INSTALL NEWS compile config.guess config.sub depcomp \
43 install-sh ltmain.sh missing
44ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
45am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
46 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
47 $(top_srcdir)/m4/efl_fnmatch.m4 \
48 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
49 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
50 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
55 configure.lineno config.status.lineno
56mkinstalldirs = $(install_sh) -d
57CONFIG_HEADER = config.h
58CONFIG_CLEAN_FILES = embryo.pc embryo.spec
59CONFIG_CLEAN_VPATH_FILES =
60AM_V_GEN = $(am__v_GEN_$(V))
61am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
62am__v_GEN_0 = @echo " GEN " $@;
63AM_V_at = $(am__v_at_$(V))
64am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
65am__v_at_0 = @
66SOURCES =
67DIST_SOURCES =
68RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
69 html-recursive info-recursive install-data-recursive \
70 install-dvi-recursive install-exec-recursive \
71 install-html-recursive install-info-recursive \
72 install-pdf-recursive install-ps-recursive install-recursive \
73 installcheck-recursive installdirs-recursive pdf-recursive \
74 ps-recursive uninstall-recursive
75am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
76am__vpath_adj = case $$p in \
77 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
78 *) f=$$p;; \
79 esac;
80am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
81am__install_max = 40
82am__nobase_strip_setup = \
83 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
84am__nobase_strip = \
85 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
86am__nobase_list = $(am__nobase_strip_setup); \
87 for p in $$list; do echo "$$p $$p"; done | \
88 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
89 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
90 if (++n[$$2] == $(am__install_max)) \
91 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
92 END { for (dir in files) print dir, files[dir] }'
93am__base_list = \
94 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
95 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
96am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
97DATA = $(pkgconfig_DATA)
98RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
99 distclean-recursive maintainer-clean-recursive
100AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
101 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
102 distdir dist dist-all distcheck
103ETAGS = etags
104CTAGS = ctags
105DIST_SUBDIRS = $(SUBDIRS)
106DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
107distdir = $(PACKAGE)-$(VERSION)
108top_distdir = $(distdir)
109am__remove_distdir = \
110 { test ! -d "$(distdir)" \
111 || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
112 && rm -fr "$(distdir)"; }; }
113am__relativize = \
114 dir0=`pwd`; \
115 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
116 sed_rest='s,^[^/]*/*,,'; \
117 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
118 sed_butlast='s,/*[^/]*$$,,'; \
119 while test -n "$$dir1"; do \
120 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
121 if test "$$first" != "."; then \
122 if test "$$first" = ".."; then \
123 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
124 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
125 else \
126 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
127 if test "$$first2" = "$$first"; then \
128 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
129 else \
130 dir2="../$$dir2"; \
131 fi; \
132 dir0="$$dir0"/"$$first"; \
133 fi; \
134 fi; \
135 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
136 done; \
137 reldir="$$dir2"
138DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
139GZIP_ENV = --best
140distuninstallcheck_listfiles = find . -type f -print
141distcleancheck_listfiles = find . -type f -print
142ACLOCAL = @ACLOCAL@
143ALLOCA = @ALLOCA@
144AMTAR = @AMTAR@
145AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
146AR = @AR@
147AS = @AS@
148AUTOCONF = @AUTOCONF@
149AUTOHEADER = @AUTOHEADER@
150AUTOMAKE = @AUTOMAKE@
151AWK = @AWK@
152CC = @CC@
153CCDEPMODE = @CCDEPMODE@
154CFLAGS = @CFLAGS@
155CPP = @CPP@
156CPPFLAGS = @CPPFLAGS@
157CYGPATH_W = @CYGPATH_W@
158DEFS = @DEFS@
159DEPDIR = @DEPDIR@
160DLLTOOL = @DLLTOOL@
161DSYMUTIL = @DSYMUTIL@
162DUMPBIN = @DUMPBIN@
163ECHO_C = @ECHO_C@
164ECHO_N = @ECHO_N@
165ECHO_T = @ECHO_T@
166EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
167EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
168EGREP = @EGREP@
169EINA_CFLAGS = @EINA_CFLAGS@
170EINA_LIBS = @EINA_LIBS@
171EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
172EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
173EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
174EVIL_CFLAGS = @EVIL_CFLAGS@
175EVIL_LIBS = @EVIL_LIBS@
176EXEEXT = @EXEEXT@
177FGREP = @FGREP@
178GREP = @GREP@
179INSTALL = @INSTALL@
180INSTALL_DATA = @INSTALL_DATA@
181INSTALL_PROGRAM = @INSTALL_PROGRAM@
182INSTALL_SCRIPT = @INSTALL_SCRIPT@
183INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
184LD = @LD@
185LDFLAGS = @LDFLAGS@
186LIBOBJS = @LIBOBJS@
187LIBS = @LIBS@
188LIBTOOL = @LIBTOOL@
189LIPO = @LIPO@
190LN_S = @LN_S@
191LTLIBOBJS = @LTLIBOBJS@
192MAKEINFO = @MAKEINFO@
193MKDIR_P = @MKDIR_P@
194NM = @NM@
195NMEDIT = @NMEDIT@
196OBJDUMP = @OBJDUMP@
197OBJEXT = @OBJEXT@
198OTOOL = @OTOOL@
199OTOOL64 = @OTOOL64@
200PACKAGE = @PACKAGE@
201PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
202PACKAGE_NAME = @PACKAGE_NAME@
203PACKAGE_STRING = @PACKAGE_STRING@
204PACKAGE_TARNAME = @PACKAGE_TARNAME@
205PACKAGE_URL = @PACKAGE_URL@
206PACKAGE_VERSION = @PACKAGE_VERSION@
207PATH_SEPARATOR = @PATH_SEPARATOR@
208PKG_CONFIG = @PKG_CONFIG@
209PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
210PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
211RANLIB = @RANLIB@
212SED = @SED@
213SET_MAKE = @SET_MAKE@
214SHELL = @SHELL@
215STRIP = @STRIP@
216VERSION = @VERSION@
217VMAJ = @VMAJ@
218abs_builddir = @abs_builddir@
219abs_srcdir = @abs_srcdir@
220abs_top_builddir = @abs_top_builddir@
221abs_top_srcdir = @abs_top_srcdir@
222ac_ct_CC = @ac_ct_CC@
223ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
224am__include = @am__include@
225am__leading_dot = @am__leading_dot@
226am__quote = @am__quote@
227am__tar = @am__tar@
228am__untar = @am__untar@
229bindir = @bindir@
230build = @build@
231build_alias = @build_alias@
232build_cpu = @build_cpu@
233build_os = @build_os@
234build_vendor = @build_vendor@
235builddir = @builddir@
236datadir = @datadir@
237datarootdir = @datarootdir@
238docdir = @docdir@
239dvidir = @dvidir@
240efl_doxygen = @efl_doxygen@
241efl_have_doxygen = @efl_have_doxygen@
242embryoincludedir = @embryoincludedir@
243exec_prefix = @exec_prefix@
244host = @host@
245host_alias = @host_alias@
246host_cpu = @host_cpu@
247host_os = @host_os@
248host_vendor = @host_vendor@
249htmldir = @htmldir@
250includedir = @includedir@
251infodir = @infodir@
252install_sh = @install_sh@
253libdir = @libdir@
254libexecdir = @libexecdir@
255localedir = @localedir@
256localstatedir = @localstatedir@
257lt_ECHO = @lt_ECHO@
258lt_enable_auto_import = @lt_enable_auto_import@
259mandir = @mandir@
260mkdir_p = @mkdir_p@
261oldincludedir = @oldincludedir@
262pdfdir = @pdfdir@
263pkgconfig_requires_private = @pkgconfig_requires_private@
264prefix = @prefix@
265program_transform_name = @program_transform_name@
266psdir = @psdir@
267release_info = @release_info@
268requirement_embryo = @requirement_embryo@
269sbindir = @sbindir@
270sharedstatedir = @sharedstatedir@
271srcdir = @srcdir@
272sysconfdir = @sysconfdir@
273target_alias = @target_alias@
274top_build_prefix = @top_build_prefix@
275top_builddir = @top_builddir@
276top_srcdir = @top_srcdir@
277version_info = @version_info@
278ACLOCAL_AMFLAGS = -I m4
279SUBDIRS = src include doc
280MAINTAINERCLEANFILES = \
281Makefile.in \
282aclocal.m4 \
283compile \
284config.guess \
285config.h.in \
286config.h.in~ \
287config.sub \
288configure \
289depcomp \
290install-sh \
291ltmain.sh \
292missing \
293$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
294$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
295$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
296m4/libtool.m4 \
297m4/lt~obsolete.m4 \
298m4/ltoptions.m4 \
299m4/ltsugar.m4 \
300m4/ltversion.m4
301
302EXTRA_DIST = \
303AUTHORS \
304COPYING \
305autogen.sh \
306embryo.pc.in \
307embryo.spec.in \
308embryo.spec
309
310pkgconfigdir = $(libdir)/pkgconfig
311pkgconfig_DATA = embryo.pc
312all: config.h
313 $(MAKE) $(AM_MAKEFLAGS) all-recursive
314
315.SUFFIXES:
316am--refresh:
317 @:
318$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
319 @for dep in $?; do \
320 case '$(am__configure_deps)' in \
321 *$$dep*) \
322 echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
323 $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
324 && exit 0; \
325 exit 1;; \
326 esac; \
327 done; \
328 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
329 $(am__cd) $(top_srcdir) && \
330 $(AUTOMAKE) --gnu Makefile
331.PRECIOUS: Makefile
332Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
333 @case '$?' in \
334 *config.status*) \
335 echo ' $(SHELL) ./config.status'; \
336 $(SHELL) ./config.status;; \
337 *) \
338 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
339 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
340 esac;
341
342$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
343 $(SHELL) ./config.status --recheck
344
345$(top_srcdir)/configure: $(am__configure_deps)
346 $(am__cd) $(srcdir) && $(AUTOCONF)
347$(ACLOCAL_M4): $(am__aclocal_m4_deps)
348 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
349$(am__aclocal_m4_deps):
350
351config.h: stamp-h1
352 @if test ! -f $@; then \
353 rm -f stamp-h1; \
354 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
355 else :; fi
356
357stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
358 @rm -f stamp-h1
359 cd $(top_builddir) && $(SHELL) ./config.status config.h
360$(srcdir)/config.h.in: $(am__configure_deps)
361 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
362 rm -f stamp-h1
363 touch $@
364
365distclean-hdr:
366 -rm -f config.h stamp-h1
367embryo.pc: $(top_builddir)/config.status $(srcdir)/embryo.pc.in
368 cd $(top_builddir) && $(SHELL) ./config.status $@
369embryo.spec: $(top_builddir)/config.status $(srcdir)/embryo.spec.in
370 cd $(top_builddir) && $(SHELL) ./config.status $@
371
372mostlyclean-libtool:
373 -rm -f *.lo
374
375clean-libtool:
376 -rm -rf .libs _libs
377
378distclean-libtool:
379 -rm -f libtool config.lt
380install-pkgconfigDATA: $(pkgconfig_DATA)
381 @$(NORMAL_INSTALL)
382 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
383 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
384 for p in $$list; do \
385 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
386 echo "$$d$$p"; \
387 done | $(am__base_list) | \
388 while read files; do \
389 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
390 $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
391 done
392
393uninstall-pkgconfigDATA:
394 @$(NORMAL_UNINSTALL)
395 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
396 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
397 test -n "$$files" || exit 0; \
398 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
399 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
400
401# This directory's subdirectories are mostly independent; you can cd
402# into them and run `make' without going through this Makefile.
403# To change the values of `make' variables: instead of editing Makefiles,
404# (1) if the variable is set in `config.status', edit `config.status'
405# (which will cause the Makefiles to be regenerated when you run `make');
406# (2) otherwise, pass the desired values on the `make' command line.
407$(RECURSIVE_TARGETS):
408 @fail= failcom='exit 1'; \
409 for f in x $$MAKEFLAGS; do \
410 case $$f in \
411 *=* | --[!k]*);; \
412 *k*) failcom='fail=yes';; \
413 esac; \
414 done; \
415 dot_seen=no; \
416 target=`echo $@ | sed s/-recursive//`; \
417 list='$(SUBDIRS)'; for subdir in $$list; do \
418 echo "Making $$target in $$subdir"; \
419 if test "$$subdir" = "."; then \
420 dot_seen=yes; \
421 local_target="$$target-am"; \
422 else \
423 local_target="$$target"; \
424 fi; \
425 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
426 || eval $$failcom; \
427 done; \
428 if test "$$dot_seen" = "no"; then \
429 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
430 fi; test -z "$$fail"
431
432$(RECURSIVE_CLEAN_TARGETS):
433 @fail= failcom='exit 1'; \
434 for f in x $$MAKEFLAGS; do \
435 case $$f in \
436 *=* | --[!k]*);; \
437 *k*) failcom='fail=yes';; \
438 esac; \
439 done; \
440 dot_seen=no; \
441 case "$@" in \
442 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
443 *) list='$(SUBDIRS)' ;; \
444 esac; \
445 rev=''; for subdir in $$list; do \
446 if test "$$subdir" = "."; then :; else \
447 rev="$$subdir $$rev"; \
448 fi; \
449 done; \
450 rev="$$rev ."; \
451 target=`echo $@ | sed s/-recursive//`; \
452 for subdir in $$rev; do \
453 echo "Making $$target in $$subdir"; \
454 if test "$$subdir" = "."; then \
455 local_target="$$target-am"; \
456 else \
457 local_target="$$target"; \
458 fi; \
459 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
460 || eval $$failcom; \
461 done && test -z "$$fail"
462tags-recursive:
463 list='$(SUBDIRS)'; for subdir in $$list; do \
464 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
465 done
466ctags-recursive:
467 list='$(SUBDIRS)'; for subdir in $$list; do \
468 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
469 done
470
471ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
472 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
473 unique=`for i in $$list; do \
474 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
475 done | \
476 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
477 END { if (nonempty) { for (i in files) print i; }; }'`; \
478 mkid -fID $$unique
479tags: TAGS
480
481TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
482 $(TAGS_FILES) $(LISP)
483 set x; \
484 here=`pwd`; \
485 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
486 include_option=--etags-include; \
487 empty_fix=.; \
488 else \
489 include_option=--include; \
490 empty_fix=; \
491 fi; \
492 list='$(SUBDIRS)'; for subdir in $$list; do \
493 if test "$$subdir" = .; then :; else \
494 test ! -f $$subdir/TAGS || \
495 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
496 fi; \
497 done; \
498 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
499 unique=`for i in $$list; do \
500 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
501 done | \
502 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
503 END { if (nonempty) { for (i in files) print i; }; }'`; \
504 shift; \
505 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
506 test -n "$$unique" || unique=$$empty_fix; \
507 if test $$# -gt 0; then \
508 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
509 "$$@" $$unique; \
510 else \
511 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
512 $$unique; \
513 fi; \
514 fi
515ctags: CTAGS
516CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
517 $(TAGS_FILES) $(LISP)
518 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
519 unique=`for i in $$list; do \
520 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
521 done | \
522 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
523 END { if (nonempty) { for (i in files) print i; }; }'`; \
524 test -z "$(CTAGS_ARGS)$$unique" \
525 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
526 $$unique
527
528GTAGS:
529 here=`$(am__cd) $(top_builddir) && pwd` \
530 && $(am__cd) $(top_srcdir) \
531 && gtags -i $(GTAGS_ARGS) "$$here"
532
533distclean-tags:
534 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
535
536distdir: $(DISTFILES)
537 $(am__remove_distdir)
538 test -d "$(distdir)" || mkdir "$(distdir)"
539 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
540 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
541 list='$(DISTFILES)'; \
542 dist_files=`for file in $$list; do echo $$file; done | \
543 sed -e "s|^$$srcdirstrip/||;t" \
544 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
545 case $$dist_files in \
546 */*) $(MKDIR_P) `echo "$$dist_files" | \
547 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
548 sort -u` ;; \
549 esac; \
550 for file in $$dist_files; do \
551 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
552 if test -d $$d/$$file; then \
553 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
554 if test -d "$(distdir)/$$file"; then \
555 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
556 fi; \
557 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
558 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
559 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
560 fi; \
561 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
562 else \
563 test -f "$(distdir)/$$file" \
564 || cp -p $$d/$$file "$(distdir)/$$file" \
565 || exit 1; \
566 fi; \
567 done
568 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
569 if test "$$subdir" = .; then :; else \
570 test -d "$(distdir)/$$subdir" \
571 || $(MKDIR_P) "$(distdir)/$$subdir" \
572 || exit 1; \
573 fi; \
574 done
575 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
576 if test "$$subdir" = .; then :; else \
577 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
578 $(am__relativize); \
579 new_distdir=$$reldir; \
580 dir1=$$subdir; dir2="$(top_distdir)"; \
581 $(am__relativize); \
582 new_top_distdir=$$reldir; \
583 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
584 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
585 ($(am__cd) $$subdir && \
586 $(MAKE) $(AM_MAKEFLAGS) \
587 top_distdir="$$new_top_distdir" \
588 distdir="$$new_distdir" \
589 am__remove_distdir=: \
590 am__skip_length_check=: \
591 am__skip_mode_fix=: \
592 distdir) \
593 || exit 1; \
594 fi; \
595 done
596 -test -n "$(am__skip_mode_fix)" \
597 || find "$(distdir)" -type d ! -perm -755 \
598 -exec chmod u+rwx,go+rx {} \; -o \
599 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
600 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
601 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
602 || chmod -R a+r "$(distdir)"
603dist-gzip: distdir
604 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
605 $(am__remove_distdir)
606dist-bzip2: distdir
607 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
608 $(am__remove_distdir)
609
610dist-lzma: distdir
611 tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
612 $(am__remove_distdir)
613
614dist-xz: distdir
615 tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
616 $(am__remove_distdir)
617
618dist-tarZ: distdir
619 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
620 $(am__remove_distdir)
621
622dist-shar: distdir
623 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
624 $(am__remove_distdir)
625
626dist-zip: distdir
627 -rm -f $(distdir).zip
628 zip -rq $(distdir).zip $(distdir)
629 $(am__remove_distdir)
630
631dist dist-all: distdir
632 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
633 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
634 $(am__remove_distdir)
635
636# This target untars the dist file and tries a VPATH configuration. Then
637# it guarantees that the distribution is self-contained by making another
638# tarfile.
639distcheck: dist
640 case '$(DIST_ARCHIVES)' in \
641 *.tar.gz*) \
642 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
643 *.tar.bz2*) \
644 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
645 *.tar.lzma*) \
646 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
647 *.tar.xz*) \
648 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
649 *.tar.Z*) \
650 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
651 *.shar.gz*) \
652 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
653 *.zip*) \
654 unzip $(distdir).zip ;;\
655 esac
656 chmod -R a-w $(distdir); chmod a+w $(distdir)
657 mkdir $(distdir)/_build
658 mkdir $(distdir)/_inst
659 chmod a-w $(distdir)
660 test -d $(distdir)/_build || exit 0; \
661 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
662 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
663 && am__cwd=`pwd` \
664 && $(am__cd) $(distdir)/_build \
665 && ../configure --srcdir=.. --prefix="$$dc_install_base" \
666 $(DISTCHECK_CONFIGURE_FLAGS) \
667 && $(MAKE) $(AM_MAKEFLAGS) \
668 && $(MAKE) $(AM_MAKEFLAGS) dvi \
669 && $(MAKE) $(AM_MAKEFLAGS) check \
670 && $(MAKE) $(AM_MAKEFLAGS) install \
671 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
672 && $(MAKE) $(AM_MAKEFLAGS) uninstall \
673 && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
674 distuninstallcheck \
675 && chmod -R a-w "$$dc_install_base" \
676 && ({ \
677 (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
678 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
679 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
680 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
681 distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
682 } || { rm -rf "$$dc_destdir"; exit 1; }) \
683 && rm -rf "$$dc_destdir" \
684 && $(MAKE) $(AM_MAKEFLAGS) dist \
685 && rm -rf $(DIST_ARCHIVES) \
686 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
687 && cd "$$am__cwd" \
688 || exit 1
689 $(am__remove_distdir)
690 @(echo "$(distdir) archives ready for distribution: "; \
691 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
692 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
693distuninstallcheck:
694 @$(am__cd) '$(distuninstallcheck_dir)' \
695 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
696 || { echo "ERROR: files left after uninstall:" ; \
697 if test -n "$(DESTDIR)"; then \
698 echo " (check DESTDIR support)"; \
699 fi ; \
700 $(distuninstallcheck_listfiles) ; \
701 exit 1; } >&2
702distcleancheck: distclean
703 @if test '$(srcdir)' = . ; then \
704 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
705 exit 1 ; \
706 fi
707 @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
708 || { echo "ERROR: files left in build directory after distclean:" ; \
709 $(distcleancheck_listfiles) ; \
710 exit 1; } >&2
711check-am: all-am
712check: check-recursive
713all-am: Makefile $(DATA) config.h
714installdirs: installdirs-recursive
715installdirs-am:
716 for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
717 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
718 done
719install: install-recursive
720install-exec: install-exec-recursive
721install-data: install-data-recursive
722uninstall: uninstall-recursive
723
724install-am: all-am
725 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
726
727installcheck: installcheck-recursive
728install-strip:
729 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
730 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
731 `test -z '$(STRIP)' || \
732 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
733mostlyclean-generic:
734
735clean-generic:
736
737distclean-generic:
738 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
739 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
740
741maintainer-clean-generic:
742 @echo "This command is intended for maintainers to use"
743 @echo "it deletes files that may require special tools to rebuild."
744 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
745clean: clean-recursive
746
747clean-am: clean-generic clean-libtool mostlyclean-am
748
749distclean: distclean-recursive
750 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
751 -rm -f Makefile
752distclean-am: clean-am distclean-generic distclean-hdr \
753 distclean-libtool distclean-tags
754
755dvi: dvi-recursive
756
757dvi-am:
758
759html: html-recursive
760
761html-am:
762
763info: info-recursive
764
765info-am:
766
767install-data-am: install-pkgconfigDATA
768
769install-dvi: install-dvi-recursive
770
771install-dvi-am:
772
773install-exec-am:
774
775install-html: install-html-recursive
776
777install-html-am:
778
779install-info: install-info-recursive
780
781install-info-am:
782
783install-man:
784
785install-pdf: install-pdf-recursive
786
787install-pdf-am:
788
789install-ps: install-ps-recursive
790
791install-ps-am:
792
793installcheck-am:
794
795maintainer-clean: maintainer-clean-recursive
796 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
797 -rm -rf $(top_srcdir)/autom4te.cache
798 -rm -f Makefile
799maintainer-clean-am: distclean-am maintainer-clean-generic
800
801mostlyclean: mostlyclean-recursive
802
803mostlyclean-am: mostlyclean-generic mostlyclean-libtool
804
805pdf: pdf-recursive
806
807pdf-am:
808
809ps: ps-recursive
810
811ps-am:
812
813uninstall-am: uninstall-pkgconfigDATA
814
815.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
816 ctags-recursive install-am install-strip tags-recursive
817
818.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
819 all all-am am--refresh check check-am clean clean-generic \
820 clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
821 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
822 distcheck distclean distclean-generic distclean-hdr \
823 distclean-libtool distclean-tags distcleancheck distdir \
824 distuninstallcheck dvi dvi-am html html-am info info-am \
825 install install-am install-data install-data-am install-dvi \
826 install-dvi-am install-exec install-exec-am install-html \
827 install-html-am install-info install-info-am install-man \
828 install-pdf install-pdf-am install-pkgconfigDATA install-ps \
829 install-ps-am install-strip installcheck installcheck-am \
830 installdirs installdirs-am maintainer-clean \
831 maintainer-clean-generic mostlyclean mostlyclean-generic \
832 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
833 uninstall uninstall-am uninstall-pkgconfigDATA
834
835
836.PHONY: doc
837
838# Documentation
839
840doc:
841 @echo "entering doc/"
842 make -C doc doc
843
844# Tell versions [3.59,3.63) of GNU make to not export all variables.
845# Otherwise a system limit (for SysV at least) may be exceeded.
846.NOEXPORT:
diff --git a/libraries/embryo/NEWS b/libraries/embryo/NEWS
new file mode 100644
index 0000000..8cc49e0
--- /dev/null
+++ b/libraries/embryo/NEWS
@@ -0,0 +1,13 @@
1Embryo 1.1.0
2
3Changes since Embryo 1.0.0:
4---------------------------
5
6Fixes:
7
8 * on windows use fseek instead of rewind as rewind doesn't exist on wince
9 * delete tmp files on windows
10
11Improvements:
12
13 * make embryo_cc use eina_prefix to determine installation location
diff --git a/libraries/embryo/README b/libraries/embryo/README
new file mode 100644
index 0000000..36cfe09
--- /dev/null
+++ b/libraries/embryo/README
@@ -0,0 +1,91 @@
1Embryo
2
3******************************************************************************
4
5 FOR ANY ISSUES PLEASE EMAIL:
6 enlightenment-devel@lists.sourceforge.net
7
8******************************************************************************
9
10Requirements:
11-------------
12
13Must:
14 eina
15 libc
16 libm
17
18WARNING: gcc compatibility!!!
19There seems to be some bug (or disagreement) between embryo and gcc 3.2.x
20where IEEE floating point format encoding does not "agree" with embryo's own
21hand-made tests. embryo_cc may not work if you compile using gcc 3.2.x. gcc
223.3.x is known to work fine. we are not 100% sure whose fault this is yet, so
23we won't be jumping up and down, but be warned - gcc 3.2.x does not agree
24with embryo.
25
26To view the API docs, run ./gendoc and view doc/html/index.html.
27
28OK a lot of people ask this. What is Embryo?
29
30Embryo is primarily a shared library that gives you an API to load and control
31interpreted programs compiled into an abstract machine bytecode that it
32understands. This abstract (or virtual) machine is similar to a real machine
33with a CPU, but it is emulated in software. The architecture is simple and is
34the same as the abstract machine (AMX) in the
35<a href=http://www.compuphase.com/pawn>PAWN</a> language (formerly called
36SMALL) as it is based on exactly the same code. Embryo has modified the code
37for the AMX extensively and has made it smaller and more portable. It is VERY
38small. The total size of the virtual machine code AND header files is less
39than 2500 lines of code. It includes the floating point library support by
40default as well. This makes it one of the smallest interpreters around, and
41thus makes is very efficient to use in code.
42
43Embryo also uses the PAWN compiler from the same code base. This code has
44barely been touched and so suffers from lots of portability issues. It has
45been partially fixed and now works on both big and little endian but the code
46still need to be gone over and really cleaned up . It does work, but it's only
47just working. It has been called embryo_cc and compiled a subset of PAWN
48binary outputs. It does not support packed strings, variable alignment, or
49debugging output. It does not support many features of the full PAWN
50compiler because the Embryo AMX does not support these either. You will find
51the Embryo codebase to work much better on Linux (and BSD and MacOS X) and
52other UNIX operating systems as it has been developed and tested on them. IT
53is known to work on:
54 gcc Linux (x86-32)
55 gcc Linux (PPC)
56 gcc MacOS X (PPC)
57
58And will likely work on more combinations. IT currently has problems on 64bit
59SPARC CPUs. Other 64bit systems are untested. It is the aim to fix the code
60so it works on all commonly used architectures (32, 64bit, big and little
61endian, alignment forgiving/unforgiving). So far 64bit support is the major
62issue.
63
64For more documentation please see the Language guide here:
65
66<a href=http://www.compuphase.com/pawn>Pawn Language Booklet</a>
67
68This documents the PAWN language and is 100% relevant for Embryo and the
69syntax of files it can compile (.sma files).
70
71Any help is appreciated in helping clean and port this code, so feel free to
72send patches to the Enlightenment development lists.
73
74The main aim of Embryo is to provide an easy to use library for running
75compiled PAWN programs and giving them access to the calling program and
76any API it exports to the PAWN script. PAWN programs/scripts are completely
77sand-boxed. They cannot access any system or function calls other than the
78ones provided by the calling application to the Embryo API. This means a
79PAWN script cannot open or write to, delete or load files. It is fairly
80harmless and this also keeps Embryo small.
81
82This is a work in progress, so please be patient if things don't work for you
83- and patches and help in fixing it is very much appreciated.
84
85------------------------------------------------------------------------------
86COMPILING AND INSTALLING:
87
88 ./configure
89 make
90(as root unless you are installing in your users directories):
91 make install
diff --git a/libraries/embryo/aclocal.m4 b/libraries/embryo/aclocal.m4
new file mode 100644
index 0000000..8eedd0f
--- /dev/null
+++ b/libraries/embryo/aclocal.m4
@@ -0,0 +1,1181 @@
1# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
17[m4_warning([this file was generated for autoconf 2.67.
18You have another version of autoconf. It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
23# serial 1 (pkg-config-0.24)
24#
25# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26#
27# This program is free software; you can redistribute it and/or modify
28# it under the terms of the GNU General Public License as published by
29# the Free Software Foundation; either version 2 of the License, or
30# (at your option) any later version.
31#
32# This program is distributed in the hope that it will be useful, but
33# WITHOUT ANY WARRANTY; without even the implied warranty of
34# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35# General Public License for more details.
36#
37# You should have received a copy of the GNU General Public License
38# along with this program; if not, write to the Free Software
39# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40#
41# As a special exception to the GNU General Public License, if you
42# distribute this file as part of a program that contains a
43# configuration script generated by Autoconf, you may include it under
44# the same distribution terms that you use for the rest of that program.
45
46# PKG_PROG_PKG_CONFIG([MIN-VERSION])
47# ----------------------------------
48AC_DEFUN([PKG_PROG_PKG_CONFIG],
49[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
51AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
52AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
53AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
54
55if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
56 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
57fi
58if test -n "$PKG_CONFIG"; then
59 _pkg_min_version=m4_default([$1], [0.9.0])
60 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
61 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
62 AC_MSG_RESULT([yes])
63 else
64 AC_MSG_RESULT([no])
65 PKG_CONFIG=""
66 fi
67fi[]dnl
68])# PKG_PROG_PKG_CONFIG
69
70# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
71#
72# Check to see whether a particular set of modules exists. Similar
73# to PKG_CHECK_MODULES(), but does not set variables or print errors.
74#
75# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
76# only at the first occurence in configure.ac, so if the first place
77# it's called might be skipped (such as if it is within an "if", you
78# have to call PKG_CHECK_EXISTS manually
79# --------------------------------------------------------------
80AC_DEFUN([PKG_CHECK_EXISTS],
81[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
82if test -n "$PKG_CONFIG" && \
83 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
84 m4_default([$2], [:])
85m4_ifvaln([$3], [else
86 $3])dnl
87fi])
88
89# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
90# ---------------------------------------------
91m4_define([_PKG_CONFIG],
92[if test -n "$$1"; then
93 pkg_cv_[]$1="$$1"
94 elif test -n "$PKG_CONFIG"; then
95 PKG_CHECK_EXISTS([$3],
96 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
97 [pkg_failed=yes])
98 else
99 pkg_failed=untried
100fi[]dnl
101])# _PKG_CONFIG
102
103# _PKG_SHORT_ERRORS_SUPPORTED
104# -----------------------------
105AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108 _pkg_short_errors_supported=yes
109else
110 _pkg_short_errors_supported=no
111fi[]dnl
112])# _PKG_SHORT_ERRORS_SUPPORTED
113
114
115# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116# [ACTION-IF-NOT-FOUND])
117#
118#
119# Note that if there is a possibility the first call to
120# PKG_CHECK_MODULES might not happen, you should be sure to include an
121# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122#
123#
124# --------------------------------------------------------------
125AC_DEFUN([PKG_CHECK_MODULES],
126[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
129
130pkg_failed=no
131AC_MSG_CHECKING([for $1])
132
133_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134_PKG_CONFIG([$1][_LIBS], [libs], [$2])
135
136m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137and $1[]_LIBS to avoid the need to call pkg-config.
138See the pkg-config man page for more details.])
139
140if test $pkg_failed = yes; then
141 AC_MSG_RESULT([no])
142 _PKG_SHORT_ERRORS_SUPPORTED
143 if test $_pkg_short_errors_supported = yes; then
144 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
145 else
146 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
147 fi
148 # Put the nasty error message in config.log where it belongs
149 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150
151 m4_default([$4], [AC_MSG_ERROR(
152[Package requirements ($2) were not met:
153
154$$1_PKG_ERRORS
155
156Consider adjusting the PKG_CONFIG_PATH environment variable if you
157installed software in a non-standard prefix.
158
159_PKG_TEXT])[]dnl
160 ])
161elif test $pkg_failed = untried; then
162 AC_MSG_RESULT([no])
163 m4_default([$4], [AC_MSG_FAILURE(
164[The pkg-config script could not be found or is too old. Make sure it
165is in your PATH or set the PKG_CONFIG environment variable to the full
166path to pkg-config.
167
168_PKG_TEXT
169
170To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
171 ])
172else
173 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175 AC_MSG_RESULT([yes])
176 $3
177fi[]dnl
178])# PKG_CHECK_MODULES
179
180# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
181#
182# This file is free software; the Free Software Foundation
183# gives unlimited permission to copy and/or distribute it,
184# with or without modifications, as long as this notice is preserved.
185
186# AM_AUTOMAKE_VERSION(VERSION)
187# ----------------------------
188# Automake X.Y traces this macro to ensure aclocal.m4 has been
189# generated from the m4 files accompanying Automake X.Y.
190# (This private macro should not be called outside this file.)
191AC_DEFUN([AM_AUTOMAKE_VERSION],
192[am__api_version='1.11'
193dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
194dnl require some minimum version. Point them to the right macro.
195m4_if([$1], [1.11.1], [],
196 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
197])
198
199# _AM_AUTOCONF_VERSION(VERSION)
200# -----------------------------
201# aclocal traces this macro to find the Autoconf version.
202# This is a private macro too. Using m4_define simplifies
203# the logic in aclocal, which can simply ignore this definition.
204m4_define([_AM_AUTOCONF_VERSION], [])
205
206# AM_SET_CURRENT_AUTOMAKE_VERSION
207# -------------------------------
208# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
209# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
210AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
211[AM_AUTOMAKE_VERSION([1.11.1])dnl
212m4_ifndef([AC_AUTOCONF_VERSION],
213 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
214_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
215
216# AM_AUX_DIR_EXPAND -*- Autoconf -*-
217
218# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
219#
220# This file is free software; the Free Software Foundation
221# gives unlimited permission to copy and/or distribute it,
222# with or without modifications, as long as this notice is preserved.
223
224# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
225# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
226# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
227#
228# Of course, Automake must honor this variable whenever it calls a
229# tool from the auxiliary directory. The problem is that $srcdir (and
230# therefore $ac_aux_dir as well) can be either absolute or relative,
231# depending on how configure is run. This is pretty annoying, since
232# it makes $ac_aux_dir quite unusable in subdirectories: in the top
233# source directory, any form will work fine, but in subdirectories a
234# relative path needs to be adjusted first.
235#
236# $ac_aux_dir/missing
237# fails when called from a subdirectory if $ac_aux_dir is relative
238# $top_srcdir/$ac_aux_dir/missing
239# fails if $ac_aux_dir is absolute,
240# fails when called from a subdirectory in a VPATH build with
241# a relative $ac_aux_dir
242#
243# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
244# are both prefixed by $srcdir. In an in-source build this is usually
245# harmless because $srcdir is `.', but things will broke when you
246# start a VPATH build or use an absolute $srcdir.
247#
248# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
249# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
250# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
251# and then we would define $MISSING as
252# MISSING="\${SHELL} $am_aux_dir/missing"
253# This will work as long as MISSING is not called from configure, because
254# unfortunately $(top_srcdir) has no meaning in configure.
255# However there are other variables, like CC, which are often used in
256# configure, and could therefore not use this "fixed" $ac_aux_dir.
257#
258# Another solution, used here, is to always expand $ac_aux_dir to an
259# absolute PATH. The drawback is that using absolute paths prevent a
260# configured tree to be moved without reconfiguration.
261
262AC_DEFUN([AM_AUX_DIR_EXPAND],
263[dnl Rely on autoconf to set up CDPATH properly.
264AC_PREREQ([2.50])dnl
265# expand $ac_aux_dir to an absolute path
266am_aux_dir=`cd $ac_aux_dir && pwd`
267])
268
269# AM_CONDITIONAL -*- Autoconf -*-
270
271# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
272# Free Software Foundation, Inc.
273#
274# This file is free software; the Free Software Foundation
275# gives unlimited permission to copy and/or distribute it,
276# with or without modifications, as long as this notice is preserved.
277
278# serial 9
279
280# AM_CONDITIONAL(NAME, SHELL-CONDITION)
281# -------------------------------------
282# Define a conditional.
283AC_DEFUN([AM_CONDITIONAL],
284[AC_PREREQ(2.52)dnl
285 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
286 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
287AC_SUBST([$1_TRUE])dnl
288AC_SUBST([$1_FALSE])dnl
289_AM_SUBST_NOTMAKE([$1_TRUE])dnl
290_AM_SUBST_NOTMAKE([$1_FALSE])dnl
291m4_define([_AM_COND_VALUE_$1], [$2])dnl
292if $2; then
293 $1_TRUE=
294 $1_FALSE='#'
295else
296 $1_TRUE='#'
297 $1_FALSE=
298fi
299AC_CONFIG_COMMANDS_PRE(
300[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
301 AC_MSG_ERROR([[conditional "$1" was never defined.
302Usually this means the macro was only invoked conditionally.]])
303fi])])
304
305# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
306# Free Software Foundation, Inc.
307#
308# This file is free software; the Free Software Foundation
309# gives unlimited permission to copy and/or distribute it,
310# with or without modifications, as long as this notice is preserved.
311
312# serial 10
313
314# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
315# written in clear, in which case automake, when reading aclocal.m4,
316# will think it sees a *use*, and therefore will trigger all it's
317# C support machinery. Also note that it means that autoscan, seeing
318# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
319
320
321# _AM_DEPENDENCIES(NAME)
322# ----------------------
323# See how the compiler implements dependency checking.
324# NAME is "CC", "CXX", "GCJ", or "OBJC".
325# We try a few techniques and use that to set a single cache variable.
326#
327# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
328# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
329# dependency, and given that the user is not expected to run this macro,
330# just rely on AC_PROG_CC.
331AC_DEFUN([_AM_DEPENDENCIES],
332[AC_REQUIRE([AM_SET_DEPDIR])dnl
333AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
334AC_REQUIRE([AM_MAKE_INCLUDE])dnl
335AC_REQUIRE([AM_DEP_TRACK])dnl
336
337ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
338 [$1], CXX, [depcc="$CXX" am_compiler_list=],
339 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
340 [$1], UPC, [depcc="$UPC" am_compiler_list=],
341 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
342 [depcc="$$1" am_compiler_list=])
343
344AC_CACHE_CHECK([dependency style of $depcc],
345 [am_cv_$1_dependencies_compiler_type],
346[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
347 # We make a subdir and do the tests there. Otherwise we can end up
348 # making bogus files that we don't know about and never remove. For
349 # instance it was reported that on HP-UX the gcc test will end up
350 # making a dummy file named `D' -- because `-MD' means `put the output
351 # in D'.
352 mkdir conftest.dir
353 # Copy depcomp to subdir because otherwise we won't find it if we're
354 # using a relative directory.
355 cp "$am_depcomp" conftest.dir
356 cd conftest.dir
357 # We will build objects and dependencies in a subdirectory because
358 # it helps to detect inapplicable dependency modes. For instance
359 # both Tru64's cc and ICC support -MD to output dependencies as a
360 # side effect of compilation, but ICC will put the dependencies in
361 # the current directory while Tru64 will put them in the object
362 # directory.
363 mkdir sub
364
365 am_cv_$1_dependencies_compiler_type=none
366 if test "$am_compiler_list" = ""; then
367 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
368 fi
369 am__universal=false
370 m4_case([$1], [CC],
371 [case " $depcc " in #(
372 *\ -arch\ *\ -arch\ *) am__universal=true ;;
373 esac],
374 [CXX],
375 [case " $depcc " in #(
376 *\ -arch\ *\ -arch\ *) am__universal=true ;;
377 esac])
378
379 for depmode in $am_compiler_list; do
380 # Setup a source with many dependencies, because some compilers
381 # like to wrap large dependency lists on column 80 (with \), and
382 # we should not choose a depcomp mode which is confused by this.
383 #
384 # We need to recreate these files for each test, as the compiler may
385 # overwrite some of them when testing with obscure command lines.
386 # This happens at least with the AIX C compiler.
387 : > sub/conftest.c
388 for i in 1 2 3 4 5 6; do
389 echo '#include "conftst'$i'.h"' >> sub/conftest.c
390 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
391 # Solaris 8's {/usr,}/bin/sh.
392 touch sub/conftst$i.h
393 done
394 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
395
396 # We check with `-c' and `-o' for the sake of the "dashmstdout"
397 # mode. It turns out that the SunPro C++ compiler does not properly
398 # handle `-M -o', and we need to detect this. Also, some Intel
399 # versions had trouble with output in subdirs
400 am__obj=sub/conftest.${OBJEXT-o}
401 am__minus_obj="-o $am__obj"
402 case $depmode in
403 gcc)
404 # This depmode causes a compiler race in universal mode.
405 test "$am__universal" = false || continue
406 ;;
407 nosideeffect)
408 # after this tag, mechanisms are not by side-effect, so they'll
409 # only be used when explicitly requested
410 if test "x$enable_dependency_tracking" = xyes; then
411 continue
412 else
413 break
414 fi
415 ;;
416 msvisualcpp | msvcmsys)
417 # This compiler won't grok `-c -o', but also, the minuso test has
418 # not run yet. These depmodes are late enough in the game, and
419 # so weak that their functioning should not be impacted.
420 am__obj=conftest.${OBJEXT-o}
421 am__minus_obj=
422 ;;
423 none) break ;;
424 esac
425 if depmode=$depmode \
426 source=sub/conftest.c object=$am__obj \
427 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
428 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
429 >/dev/null 2>conftest.err &&
430 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
431 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
432 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
433 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
434 # icc doesn't choke on unknown options, it will just issue warnings
435 # or remarks (even with -Werror). So we grep stderr for any message
436 # that says an option was ignored or not supported.
437 # When given -MP, icc 7.0 and 7.1 complain thusly:
438 # icc: Command line warning: ignoring option '-M'; no argument required
439 # The diagnosis changed in icc 8.0:
440 # icc: Command line remark: option '-MP' not supported
441 if (grep 'ignoring option' conftest.err ||
442 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
443 am_cv_$1_dependencies_compiler_type=$depmode
444 break
445 fi
446 fi
447 done
448
449 cd ..
450 rm -rf conftest.dir
451else
452 am_cv_$1_dependencies_compiler_type=none
453fi
454])
455AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
456AM_CONDITIONAL([am__fastdep$1], [
457 test "x$enable_dependency_tracking" != xno \
458 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
459])
460
461
462# AM_SET_DEPDIR
463# -------------
464# Choose a directory name for dependency files.
465# This macro is AC_REQUIREd in _AM_DEPENDENCIES
466AC_DEFUN([AM_SET_DEPDIR],
467[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
468AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
469])
470
471
472# AM_DEP_TRACK
473# ------------
474AC_DEFUN([AM_DEP_TRACK],
475[AC_ARG_ENABLE(dependency-tracking,
476[ --disable-dependency-tracking speeds up one-time build
477 --enable-dependency-tracking do not reject slow dependency extractors])
478if test "x$enable_dependency_tracking" != xno; then
479 am_depcomp="$ac_aux_dir/depcomp"
480 AMDEPBACKSLASH='\'
481fi
482AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
483AC_SUBST([AMDEPBACKSLASH])dnl
484_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
485])
486
487# Generate code to set up dependency tracking. -*- Autoconf -*-
488
489# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
490# Free Software Foundation, Inc.
491#
492# This file is free software; the Free Software Foundation
493# gives unlimited permission to copy and/or distribute it,
494# with or without modifications, as long as this notice is preserved.
495
496#serial 5
497
498# _AM_OUTPUT_DEPENDENCY_COMMANDS
499# ------------------------------
500AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
501[{
502 # Autoconf 2.62 quotes --file arguments for eval, but not when files
503 # are listed without --file. Let's play safe and only enable the eval
504 # if we detect the quoting.
505 case $CONFIG_FILES in
506 *\'*) eval set x "$CONFIG_FILES" ;;
507 *) set x $CONFIG_FILES ;;
508 esac
509 shift
510 for mf
511 do
512 # Strip MF so we end up with the name of the file.
513 mf=`echo "$mf" | sed -e 's/:.*$//'`
514 # Check whether this is an Automake generated Makefile or not.
515 # We used to match only the files named `Makefile.in', but
516 # some people rename them; so instead we look at the file content.
517 # Grep'ing the first line is not enough: some people post-process
518 # each Makefile.in and add a new line on top of each file to say so.
519 # Grep'ing the whole file is not good either: AIX grep has a line
520 # limit of 2048, but all sed's we know have understand at least 4000.
521 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
522 dirpart=`AS_DIRNAME("$mf")`
523 else
524 continue
525 fi
526 # Extract the definition of DEPDIR, am__include, and am__quote
527 # from the Makefile without running `make'.
528 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
529 test -z "$DEPDIR" && continue
530 am__include=`sed -n 's/^am__include = //p' < "$mf"`
531 test -z "am__include" && continue
532 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
533 # When using ansi2knr, U may be empty or an underscore; expand it
534 U=`sed -n 's/^U = //p' < "$mf"`
535 # Find all dependency output files, they are included files with
536 # $(DEPDIR) in their names. We invoke sed twice because it is the
537 # simplest approach to changing $(DEPDIR) to its actual value in the
538 # expansion.
539 for file in `sed -n "
540 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
541 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
542 # Make sure the directory exists.
543 test -f "$dirpart/$file" && continue
544 fdir=`AS_DIRNAME(["$file"])`
545 AS_MKDIR_P([$dirpart/$fdir])
546 # echo "creating $dirpart/$file"
547 echo '# dummy' > "$dirpart/$file"
548 done
549 done
550}
551])# _AM_OUTPUT_DEPENDENCY_COMMANDS
552
553
554# AM_OUTPUT_DEPENDENCY_COMMANDS
555# -----------------------------
556# This macro should only be invoked once -- use via AC_REQUIRE.
557#
558# This code is only required when automatic dependency tracking
559# is enabled. FIXME. This creates each `.P' file that we will
560# need in order to bootstrap the dependency handling code.
561AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
562[AC_CONFIG_COMMANDS([depfiles],
563 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
564 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
565])
566
567# Do all the work for Automake. -*- Autoconf -*-
568
569# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
570# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
571#
572# This file is free software; the Free Software Foundation
573# gives unlimited permission to copy and/or distribute it,
574# with or without modifications, as long as this notice is preserved.
575
576# serial 16
577
578# This macro actually does too much. Some checks are only needed if
579# your package does certain things. But this isn't really a big deal.
580
581# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
582# AM_INIT_AUTOMAKE([OPTIONS])
583# -----------------------------------------------
584# The call with PACKAGE and VERSION arguments is the old style
585# call (pre autoconf-2.50), which is being phased out. PACKAGE
586# and VERSION should now be passed to AC_INIT and removed from
587# the call to AM_INIT_AUTOMAKE.
588# We support both call styles for the transition. After
589# the next Automake release, Autoconf can make the AC_INIT
590# arguments mandatory, and then we can depend on a new Autoconf
591# release and drop the old call support.
592AC_DEFUN([AM_INIT_AUTOMAKE],
593[AC_PREREQ([2.62])dnl
594dnl Autoconf wants to disallow AM_ names. We explicitly allow
595dnl the ones we care about.
596m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
597AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
598AC_REQUIRE([AC_PROG_INSTALL])dnl
599if test "`cd $srcdir && pwd`" != "`pwd`"; then
600 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
601 # is not polluted with repeated "-I."
602 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
603 # test to see if srcdir already configured
604 if test -f $srcdir/config.status; then
605 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
606 fi
607fi
608
609# test whether we have cygpath
610if test -z "$CYGPATH_W"; then
611 if (cygpath --version) >/dev/null 2>/dev/null; then
612 CYGPATH_W='cygpath -w'
613 else
614 CYGPATH_W=echo
615 fi
616fi
617AC_SUBST([CYGPATH_W])
618
619# Define the identity of the package.
620dnl Distinguish between old-style and new-style calls.
621m4_ifval([$2],
622[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
623 AC_SUBST([PACKAGE], [$1])dnl
624 AC_SUBST([VERSION], [$2])],
625[_AM_SET_OPTIONS([$1])dnl
626dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
627m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
628 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
629 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
630 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
631
632_AM_IF_OPTION([no-define],,
633[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
634 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
635
636# Some tools Automake needs.
637AC_REQUIRE([AM_SANITY_CHECK])dnl
638AC_REQUIRE([AC_ARG_PROGRAM])dnl
639AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
640AM_MISSING_PROG(AUTOCONF, autoconf)
641AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
642AM_MISSING_PROG(AUTOHEADER, autoheader)
643AM_MISSING_PROG(MAKEINFO, makeinfo)
644AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
645AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
646AC_REQUIRE([AM_PROG_MKDIR_P])dnl
647# We need awk for the "check" target. The system "awk" is bad on
648# some platforms.
649AC_REQUIRE([AC_PROG_AWK])dnl
650AC_REQUIRE([AC_PROG_MAKE_SET])dnl
651AC_REQUIRE([AM_SET_LEADING_DOT])dnl
652_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
653 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
654 [_AM_PROG_TAR([v7])])])
655_AM_IF_OPTION([no-dependencies],,
656[AC_PROVIDE_IFELSE([AC_PROG_CC],
657 [_AM_DEPENDENCIES(CC)],
658 [define([AC_PROG_CC],
659 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
660AC_PROVIDE_IFELSE([AC_PROG_CXX],
661 [_AM_DEPENDENCIES(CXX)],
662 [define([AC_PROG_CXX],
663 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
664AC_PROVIDE_IFELSE([AC_PROG_OBJC],
665 [_AM_DEPENDENCIES(OBJC)],
666 [define([AC_PROG_OBJC],
667 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
668])
669_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
670dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
671dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
672dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
673AC_CONFIG_COMMANDS_PRE(dnl
674[m4_provide_if([_AM_COMPILER_EXEEXT],
675 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
676])
677
678dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
679dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
680dnl mangled by Autoconf and run in a shell conditional statement.
681m4_define([_AC_COMPILER_EXEEXT],
682m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
683
684
685# When config.status generates a header, we must update the stamp-h file.
686# This file resides in the same directory as the config header
687# that is generated. The stamp files are numbered to have different names.
688
689# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
690# loop where config.status creates the headers, so we can generate
691# our stamp files there.
692AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
693[# Compute $1's index in $config_headers.
694_am_arg=$1
695_am_stamp_count=1
696for _am_header in $config_headers :; do
697 case $_am_header in
698 $_am_arg | $_am_arg:* )
699 break ;;
700 * )
701 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
702 esac
703done
704echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
705
706# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
707#
708# This file is free software; the Free Software Foundation
709# gives unlimited permission to copy and/or distribute it,
710# with or without modifications, as long as this notice is preserved.
711
712# AM_PROG_INSTALL_SH
713# ------------------
714# Define $install_sh.
715AC_DEFUN([AM_PROG_INSTALL_SH],
716[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
717if test x"${install_sh}" != xset; then
718 case $am_aux_dir in
719 *\ * | *\ *)
720 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
721 *)
722 install_sh="\${SHELL} $am_aux_dir/install-sh"
723 esac
724fi
725AC_SUBST(install_sh)])
726
727# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
728#
729# This file is free software; the Free Software Foundation
730# gives unlimited permission to copy and/or distribute it,
731# with or without modifications, as long as this notice is preserved.
732
733# serial 2
734
735# Check whether the underlying file-system supports filenames
736# with a leading dot. For instance MS-DOS doesn't.
737AC_DEFUN([AM_SET_LEADING_DOT],
738[rm -rf .tst 2>/dev/null
739mkdir .tst 2>/dev/null
740if test -d .tst; then
741 am__leading_dot=.
742else
743 am__leading_dot=_
744fi
745rmdir .tst 2>/dev/null
746AC_SUBST([am__leading_dot])])
747
748# Check to see how 'make' treats includes. -*- Autoconf -*-
749
750# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
751#
752# This file is free software; the Free Software Foundation
753# gives unlimited permission to copy and/or distribute it,
754# with or without modifications, as long as this notice is preserved.
755
756# serial 4
757
758# AM_MAKE_INCLUDE()
759# -----------------
760# Check to see how make treats includes.
761AC_DEFUN([AM_MAKE_INCLUDE],
762[am_make=${MAKE-make}
763cat > confinc << 'END'
764am__doit:
765 @echo this is the am__doit target
766.PHONY: am__doit
767END
768# If we don't find an include directive, just comment out the code.
769AC_MSG_CHECKING([for style of include used by $am_make])
770am__include="#"
771am__quote=
772_am_result=none
773# First try GNU make style include.
774echo "include confinc" > confmf
775# Ignore all kinds of additional output from `make'.
776case `$am_make -s -f confmf 2> /dev/null` in #(
777*the\ am__doit\ target*)
778 am__include=include
779 am__quote=
780 _am_result=GNU
781 ;;
782esac
783# Now try BSD make style include.
784if test "$am__include" = "#"; then
785 echo '.include "confinc"' > confmf
786 case `$am_make -s -f confmf 2> /dev/null` in #(
787 *the\ am__doit\ target*)
788 am__include=.include
789 am__quote="\""
790 _am_result=BSD
791 ;;
792 esac
793fi
794AC_SUBST([am__include])
795AC_SUBST([am__quote])
796AC_MSG_RESULT([$_am_result])
797rm -f confinc confmf
798])
799
800# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
801# Free Software Foundation, Inc.
802#
803# This file is free software; the Free Software Foundation
804# gives unlimited permission to copy and/or distribute it,
805# with or without modifications, as long as this notice is preserved.
806
807# serial 6
808
809# AM_PROG_CC_C_O
810# --------------
811# Like AC_PROG_CC_C_O, but changed for automake.
812AC_DEFUN([AM_PROG_CC_C_O],
813[AC_REQUIRE([AC_PROG_CC_C_O])dnl
814AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
815AC_REQUIRE_AUX_FILE([compile])dnl
816# FIXME: we rely on the cache variable name because
817# there is no other way.
818set dummy $CC
819am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
820eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
821if test "$am_t" != yes; then
822 # Losing compiler, so override with the script.
823 # FIXME: It is wrong to rewrite CC.
824 # But if we don't then we get into trouble of one sort or another.
825 # A longer-term fix would be to have automake use am__CC in this case,
826 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
827 CC="$am_aux_dir/compile $CC"
828fi
829dnl Make sure AC_PROG_CC is never called again, or it will override our
830dnl setting of CC.
831m4_define([AC_PROG_CC],
832 [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
833])
834
835# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
836
837# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
838# Free Software Foundation, Inc.
839#
840# This file is free software; the Free Software Foundation
841# gives unlimited permission to copy and/or distribute it,
842# with or without modifications, as long as this notice is preserved.
843
844# serial 6
845
846# AM_MISSING_PROG(NAME, PROGRAM)
847# ------------------------------
848AC_DEFUN([AM_MISSING_PROG],
849[AC_REQUIRE([AM_MISSING_HAS_RUN])
850$1=${$1-"${am_missing_run}$2"}
851AC_SUBST($1)])
852
853
854# AM_MISSING_HAS_RUN
855# ------------------
856# Define MISSING if not defined so far and test if it supports --run.
857# If it does, set am_missing_run to use it, otherwise, to nothing.
858AC_DEFUN([AM_MISSING_HAS_RUN],
859[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
860AC_REQUIRE_AUX_FILE([missing])dnl
861if test x"${MISSING+set}" != xset; then
862 case $am_aux_dir in
863 *\ * | *\ *)
864 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
865 *)
866 MISSING="\${SHELL} $am_aux_dir/missing" ;;
867 esac
868fi
869# Use eval to expand $SHELL
870if eval "$MISSING --run true"; then
871 am_missing_run="$MISSING --run "
872else
873 am_missing_run=
874 AC_MSG_WARN([`missing' script is too old or missing])
875fi
876])
877
878# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
879#
880# This file is free software; the Free Software Foundation
881# gives unlimited permission to copy and/or distribute it,
882# with or without modifications, as long as this notice is preserved.
883
884# AM_PROG_MKDIR_P
885# ---------------
886# Check for `mkdir -p'.
887AC_DEFUN([AM_PROG_MKDIR_P],
888[AC_PREREQ([2.60])dnl
889AC_REQUIRE([AC_PROG_MKDIR_P])dnl
890dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
891dnl while keeping a definition of mkdir_p for backward compatibility.
892dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
893dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
894dnl Makefile.ins that do not define MKDIR_P, so we do our own
895dnl adjustment using top_builddir (which is defined more often than
896dnl MKDIR_P).
897AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
898case $mkdir_p in
899 [[\\/$]]* | ?:[[\\/]]*) ;;
900 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
901esac
902])
903
904# Helper functions for option handling. -*- Autoconf -*-
905
906# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
907#
908# This file is free software; the Free Software Foundation
909# gives unlimited permission to copy and/or distribute it,
910# with or without modifications, as long as this notice is preserved.
911
912# serial 4
913
914# _AM_MANGLE_OPTION(NAME)
915# -----------------------
916AC_DEFUN([_AM_MANGLE_OPTION],
917[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
918
919# _AM_SET_OPTION(NAME)
920# ------------------------------
921# Set option NAME. Presently that only means defining a flag for this option.
922AC_DEFUN([_AM_SET_OPTION],
923[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
924
925# _AM_SET_OPTIONS(OPTIONS)
926# ----------------------------------
927# OPTIONS is a space-separated list of Automake options.
928AC_DEFUN([_AM_SET_OPTIONS],
929[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
930
931# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
932# -------------------------------------------
933# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
934AC_DEFUN([_AM_IF_OPTION],
935[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
936
937# Check to make sure that the build environment is sane. -*- Autoconf -*-
938
939# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
940# Free Software Foundation, Inc.
941#
942# This file is free software; the Free Software Foundation
943# gives unlimited permission to copy and/or distribute it,
944# with or without modifications, as long as this notice is preserved.
945
946# serial 5
947
948# AM_SANITY_CHECK
949# ---------------
950AC_DEFUN([AM_SANITY_CHECK],
951[AC_MSG_CHECKING([whether build environment is sane])
952# Just in case
953sleep 1
954echo timestamp > conftest.file
955# Reject unsafe characters in $srcdir or the absolute working directory
956# name. Accept space and tab only in the latter.
957am_lf='
958'
959case `pwd` in
960 *[[\\\"\#\$\&\'\`$am_lf]]*)
961 AC_MSG_ERROR([unsafe absolute working directory name]);;
962esac
963case $srcdir in
964 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
965 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
966esac
967
968# Do `set' in a subshell so we don't clobber the current shell's
969# arguments. Must try -L first in case configure is actually a
970# symlink; some systems play weird games with the mod time of symlinks
971# (eg FreeBSD returns the mod time of the symlink's containing
972# directory).
973if (
974 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
975 if test "$[*]" = "X"; then
976 # -L didn't work.
977 set X `ls -t "$srcdir/configure" conftest.file`
978 fi
979 rm -f conftest.file
980 if test "$[*]" != "X $srcdir/configure conftest.file" \
981 && test "$[*]" != "X conftest.file $srcdir/configure"; then
982
983 # If neither matched, then we have a broken ls. This can happen
984 # if, for instance, CONFIG_SHELL is bash and it inherits a
985 # broken ls alias from the environment. This has actually
986 # happened. Such a system could not be considered "sane".
987 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
988alias in your environment])
989 fi
990
991 test "$[2]" = conftest.file
992 )
993then
994 # Ok.
995 :
996else
997 AC_MSG_ERROR([newly created file is older than distributed files!
998Check your system clock])
999fi
1000AC_MSG_RESULT(yes)])
1001
1002# Copyright (C) 2009 Free Software Foundation, Inc.
1003#
1004# This file is free software; the Free Software Foundation
1005# gives unlimited permission to copy and/or distribute it,
1006# with or without modifications, as long as this notice is preserved.
1007
1008# serial 1
1009
1010# AM_SILENT_RULES([DEFAULT])
1011# --------------------------
1012# Enable less verbose build rules; with the default set to DEFAULT
1013# (`yes' being less verbose, `no' or empty being verbose).
1014AC_DEFUN([AM_SILENT_RULES],
1015[AC_ARG_ENABLE([silent-rules],
1016[ --enable-silent-rules less verbose build output (undo: `make V=1')
1017 --disable-silent-rules verbose build output (undo: `make V=0')])
1018case $enable_silent_rules in
1019yes) AM_DEFAULT_VERBOSITY=0;;
1020no) AM_DEFAULT_VERBOSITY=1;;
1021*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1022esac
1023AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1024AM_BACKSLASH='\'
1025AC_SUBST([AM_BACKSLASH])dnl
1026_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1027])
1028
1029# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1030#
1031# This file is free software; the Free Software Foundation
1032# gives unlimited permission to copy and/or distribute it,
1033# with or without modifications, as long as this notice is preserved.
1034
1035# AM_PROG_INSTALL_STRIP
1036# ---------------------
1037# One issue with vendor `install' (even GNU) is that you can't
1038# specify the program used to strip binaries. This is especially
1039# annoying in cross-compiling environments, where the build's strip
1040# is unlikely to handle the host's binaries.
1041# Fortunately install-sh will honor a STRIPPROG variable, so we
1042# always use install-sh in `make install-strip', and initialize
1043# STRIPPROG with the value of the STRIP variable (set by the user).
1044AC_DEFUN([AM_PROG_INSTALL_STRIP],
1045[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1046# Installed binaries are usually stripped using `strip' when the user
1047# run `make install-strip'. However `strip' might not be the right
1048# tool to use in cross-compilation environments, therefore Automake
1049# will honor the `STRIP' environment variable to overrule this program.
1050dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1051if test "$cross_compiling" != no; then
1052 AC_CHECK_TOOL([STRIP], [strip], :)
1053fi
1054INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1055AC_SUBST([INSTALL_STRIP_PROGRAM])])
1056
1057# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
1058#
1059# This file is free software; the Free Software Foundation
1060# gives unlimited permission to copy and/or distribute it,
1061# with or without modifications, as long as this notice is preserved.
1062
1063# serial 2
1064
1065# _AM_SUBST_NOTMAKE(VARIABLE)
1066# ---------------------------
1067# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1068# This macro is traced by Automake.
1069AC_DEFUN([_AM_SUBST_NOTMAKE])
1070
1071# AM_SUBST_NOTMAKE(VARIABLE)
1072# ---------------------------
1073# Public sister of _AM_SUBST_NOTMAKE.
1074AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1075
1076# Check how to create a tarball. -*- Autoconf -*-
1077
1078# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
1079#
1080# This file is free software; the Free Software Foundation
1081# gives unlimited permission to copy and/or distribute it,
1082# with or without modifications, as long as this notice is preserved.
1083
1084# serial 2
1085
1086# _AM_PROG_TAR(FORMAT)
1087# --------------------
1088# Check how to create a tarball in format FORMAT.
1089# FORMAT should be one of `v7', `ustar', or `pax'.
1090#
1091# Substitute a variable $(am__tar) that is a command
1092# writing to stdout a FORMAT-tarball containing the directory
1093# $tardir.
1094# tardir=directory && $(am__tar) > result.tar
1095#
1096# Substitute a variable $(am__untar) that extract such
1097# a tarball read from stdin.
1098# $(am__untar) < result.tar
1099AC_DEFUN([_AM_PROG_TAR],
1100[# Always define AMTAR for backward compatibility.
1101AM_MISSING_PROG([AMTAR], [tar])
1102m4_if([$1], [v7],
1103 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1104 [m4_case([$1], [ustar],, [pax],,
1105 [m4_fatal([Unknown tar format])])
1106AC_MSG_CHECKING([how to create a $1 tar archive])
1107# Loop over all known methods to create a tar archive until one works.
1108_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1109_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1110# Do not fold the above two line into one, because Tru64 sh and
1111# Solaris sh will not grok spaces in the rhs of `-'.
1112for _am_tool in $_am_tools
1113do
1114 case $_am_tool in
1115 gnutar)
1116 for _am_tar in tar gnutar gtar;
1117 do
1118 AM_RUN_LOG([$_am_tar --version]) && break
1119 done
1120 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1121 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1122 am__untar="$_am_tar -xf -"
1123 ;;
1124 plaintar)
1125 # Must skip GNU tar: if it does not support --format= it doesn't create
1126 # ustar tarball either.
1127 (tar --version) >/dev/null 2>&1 && continue
1128 am__tar='tar chf - "$$tardir"'
1129 am__tar_='tar chf - "$tardir"'
1130 am__untar='tar xf -'
1131 ;;
1132 pax)
1133 am__tar='pax -L -x $1 -w "$$tardir"'
1134 am__tar_='pax -L -x $1 -w "$tardir"'
1135 am__untar='pax -r'
1136 ;;
1137 cpio)
1138 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1139 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1140 am__untar='cpio -i -H $1 -d'
1141 ;;
1142 none)
1143 am__tar=false
1144 am__tar_=false
1145 am__untar=false
1146 ;;
1147 esac
1148
1149 # If the value was cached, stop now. We just wanted to have am__tar
1150 # and am__untar set.
1151 test -n "${am_cv_prog_tar_$1}" && break
1152
1153 # tar/untar a dummy directory, and stop if the command works
1154 rm -rf conftest.dir
1155 mkdir conftest.dir
1156 echo GrepMe > conftest.dir/file
1157 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1158 rm -rf conftest.dir
1159 if test -s conftest.tar; then
1160 AM_RUN_LOG([$am__untar <conftest.tar])
1161 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1162 fi
1163done
1164rm -rf conftest.dir
1165
1166AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1167AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1168AC_SUBST([am__tar])
1169AC_SUBST([am__untar])
1170]) # _AM_PROG_TAR
1171
1172m4_include([m4/ac_attribute.m4])
1173m4_include([m4/efl_binary.m4])
1174m4_include([m4/efl_doxygen.m4])
1175m4_include([m4/efl_fnmatch.m4])
1176m4_include([m4/efl_path_max.m4])
1177m4_include([m4/libtool.m4])
1178m4_include([m4/ltoptions.m4])
1179m4_include([m4/ltsugar.m4])
1180m4_include([m4/ltversion.m4])
1181m4_include([m4/lt~obsolete.m4])
diff --git a/libraries/embryo/autogen.sh b/libraries/embryo/autogen.sh
new file mode 100755
index 0000000..72e1033
--- /dev/null
+++ b/libraries/embryo/autogen.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3rm -rf autom4te.cache
4rm -f aclocal.m4 ltmain.sh
5
6touch ABOUT-NLS
7
8echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
9echo "Running autoheader..." ; autoheader || exit 1
10echo "Running autoconf..." ; autoconf || exit 1
11echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
12echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
13
14W=0
15
16rm -f config.cache-env.tmp
17echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp
18echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp
19echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp
20echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp
21echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp
22
23cmp config.cache-env.tmp config.cache-env >> /dev/null
24if [ $? -ne 0 ]; then
25 W=1;
26fi
27
28if [ $W -ne 0 ]; then
29 echo "Cleaning configure cache...";
30 rm -f config.cache config.cache-env
31 mv config.cache-env.tmp config.cache-env
32else
33 rm -f config.cache-env.tmp
34fi
35
36if [ -z "$NOCONFIGURE" ]; then
37 ./configure -C "$@"
38fi
diff --git a/libraries/embryo/compile b/libraries/embryo/compile
new file mode 100755
index 0000000..c0096a7
--- /dev/null
+++ b/libraries/embryo/compile
@@ -0,0 +1,143 @@
1#! /bin/sh
2# Wrapper for compilers which do not understand `-c -o'.
3
4scriptversion=2009-10-06.20; # UTC
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
7# Foundation, Inc.
8# Written by Tom Tromey <tromey@cygnus.com>.
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28# This file is maintained in Automake, please report
29# bugs to <bug-automake@gnu.org> or send patches to
30# <automake-patches@gnu.org>.
31
32case $1 in
33 '')
34 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
35 exit 1;
36 ;;
37 -h | --h*)
38 cat <<\EOF
39Usage: compile [--help] [--version] PROGRAM [ARGS]
40
41Wrapper for compilers which do not understand `-c -o'.
42Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
43arguments, and rename the output as expected.
44
45If you are trying to build a whole package this is not the
46right script to run: please start by reading the file `INSTALL'.
47
48Report bugs to <bug-automake@gnu.org>.
49EOF
50 exit $?
51 ;;
52 -v | --v*)
53 echo "compile $scriptversion"
54 exit $?
55 ;;
56esac
57
58ofile=
59cfile=
60eat=
61
62for arg
63do
64 if test -n "$eat"; then
65 eat=
66 else
67 case $1 in
68 -o)
69 # configure might choose to run compile as `compile cc -o foo foo.c'.
70 # So we strip `-o arg' only if arg is an object.
71 eat=1
72 case $2 in
73 *.o | *.obj)
74 ofile=$2
75 ;;
76 *)
77 set x "$@" -o "$2"
78 shift
79 ;;
80 esac
81 ;;
82 *.c)
83 cfile=$1
84 set x "$@" "$1"
85 shift
86 ;;
87 *)
88 set x "$@" "$1"
89 shift
90 ;;
91 esac
92 fi
93 shift
94done
95
96if test -z "$ofile" || test -z "$cfile"; then
97 # If no `-o' option was seen then we might have been invoked from a
98 # pattern rule where we don't need one. That is ok -- this is a
99 # normal compilation that the losing compiler can handle. If no
100 # `.c' file was seen then we are probably linking. That is also
101 # ok.
102 exec "$@"
103fi
104
105# Name of file we expect compiler to create.
106cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
107
108# Create the lock directory.
109# Note: use `[/\\:.-]' here to ensure that we don't use the same name
110# that we are using for the .o file. Also, base the name on the expected
111# object file name, since that is what matters with a parallel build.
112lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
113while true; do
114 if mkdir "$lockdir" >/dev/null 2>&1; then
115 break
116 fi
117 sleep 1
118done
119# FIXME: race condition here if user kills between mkdir and trap.
120trap "rmdir '$lockdir'; exit 1" 1 2 15
121
122# Run the compile.
123"$@"
124ret=$?
125
126if test -f "$cofile"; then
127 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
128elif test -f "${cofile}bj"; then
129 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
130fi
131
132rmdir "$lockdir"
133exit $ret
134
135# Local Variables:
136# mode: shell-script
137# sh-indentation: 2
138# eval: (add-hook 'write-file-hooks 'time-stamp)
139# time-stamp-start: "scriptversion="
140# time-stamp-format: "%:y-%02m-%02d.%02H"
141# time-stamp-time-zone: "UTC"
142# time-stamp-end: "; # UTC"
143# End:
diff --git a/libraries/embryo/config.guess b/libraries/embryo/config.guess
new file mode 100755
index 0000000..e3a2116
--- /dev/null
+++ b/libraries/embryo/config.guess
@@ -0,0 +1,1533 @@
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5# Free Software Foundation, Inc.
6
7timestamp='2009-06-10'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22# 02110-1301, USA.
23#
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29
30# Originally written by Per Bothner <per@bothner.com>.
31# Please send patches to <config-patches@gnu.org>. Submit a context
32# diff and a properly formatted ChangeLog entry.
33#
34# This script attempts to guess a canonical system name similar to
35# config.sub. If it succeeds, it prints the system name on stdout, and
36# exits with 0. Otherwise, it exits with 1.
37#
38# The plan is that this can be called by configure scripts if you
39# don't specify an explicit build system type.
40
41me=`echo "$0" | sed -e 's,.*/,,'`
42
43usage="\
44Usage: $0 [OPTION]
45
46Output the configuration name of the system \`$me' is run on.
47
48Operation modes:
49 -h, --help print this help, then exit
50 -t, --time-stamp print date of last modification, then exit
51 -v, --version print version number, then exit
52
53Report bugs and patches to <config-patches@gnu.org>."
54
55version="\
56GNU config.guess ($timestamp)
57
58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
61
62This is free software; see the source for copying conditions. There is NO
63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
64
65help="
66Try \`$me --help' for more information."
67
68# Parse command line
69while test $# -gt 0 ; do
70 case $1 in
71 --time-stamp | --time* | -t )
72 echo "$timestamp" ; exit ;;
73 --version | -v )
74 echo "$version" ; exit ;;
75 --help | --h* | -h )
76 echo "$usage"; exit ;;
77 -- ) # Stop option processing
78 shift; break ;;
79 - ) # Use stdin as input.
80 break ;;
81 -* )
82 echo "$me: invalid option $1$help" >&2
83 exit 1 ;;
84 * )
85 break ;;
86 esac
87done
88
89if test $# != 0; then
90 echo "$me: too many arguments$help" >&2
91 exit 1
92fi
93
94trap 'exit 1' 1 2 15
95
96# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97# compiler to aid in system detection is discouraged as it requires
98# temporary files to be created and, as you can see below, it is a
99# headache to deal with in a portable fashion.
100
101# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102# use `HOST_CC' if defined, but it is deprecated.
103
104# Portable tmp directory creation inspired by the Autoconf team.
105
106set_cc_for_build='
107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109: ${TMPDIR=/tmp} ;
110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114dummy=$tmp/dummy ;
115tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116case $CC_FOR_BUILD,$HOST_CC,$CC in
117 ,,) echo "int x;" > $dummy.c ;
118 for c in cc gcc c89 c99 ; do
119 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120 CC_FOR_BUILD="$c"; break ;
121 fi ;
122 done ;
123 if test x"$CC_FOR_BUILD" = x ; then
124 CC_FOR_BUILD=no_compiler_found ;
125 fi
126 ;;
127 ,,*) CC_FOR_BUILD=$CC ;;
128 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
129esac ; set_cc_for_build= ;'
130
131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
132# (ghazi@noc.rutgers.edu 1994-08-24)
133if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
134 PATH=$PATH:/.attbin ; export PATH
135fi
136
137UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
138UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
142# Note: order is significant - the case branches are not exclusive.
143
144case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145 *:NetBSD:*:*)
146 # NetBSD (nbsd) targets should (where applicable) match one or
147 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
148 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
149 # switched to ELF, *-*-netbsd* would select the old
150 # object file format. This provides both forward
151 # compatibility and a consistent mechanism for selecting the
152 # object file format.
153 #
154 # Note: NetBSD doesn't particularly care about the vendor
155 # portion of the name. We always set it to "unknown".
156 sysctl="sysctl -n hw.machine_arch"
157 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159 case "${UNAME_MACHINE_ARCH}" in
160 armeb) machine=armeb-unknown ;;
161 arm*) machine=arm-unknown ;;
162 sh3el) machine=shl-unknown ;;
163 sh3eb) machine=sh-unknown ;;
164 sh5el) machine=sh5le-unknown ;;
165 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166 esac
167 # The Operating System including object format, if it has switched
168 # to ELF recently, or will in the future.
169 case "${UNAME_MACHINE_ARCH}" in
170 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171 eval $set_cc_for_build
172 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173 | grep -q __ELF__
174 then
175 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176 # Return netbsd for either. FIX?
177 os=netbsd
178 else
179 os=netbsdelf
180 fi
181 ;;
182 *)
183 os=netbsd
184 ;;
185 esac
186 # The OS release
187 # Debian GNU/NetBSD machines have a different userland, and
188 # thus, need a distinct triplet. However, they do not need
189 # kernel version information, so it can be replaced with a
190 # suitable tag, in the style of linux-gnu.
191 case "${UNAME_VERSION}" in
192 Debian*)
193 release='-gnu'
194 ;;
195 *)
196 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197 ;;
198 esac
199 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200 # contains redundant information, the shorter form:
201 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202 echo "${machine}-${os}${release}"
203 exit ;;
204 *:OpenBSD:*:*)
205 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207 exit ;;
208 *:ekkoBSD:*:*)
209 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210 exit ;;
211 *:SolidBSD:*:*)
212 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213 exit ;;
214 macppc:MirBSD:*:*)
215 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216 exit ;;
217 *:MirBSD:*:*)
218 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219 exit ;;
220 alpha:OSF1:*:*)
221 case $UNAME_RELEASE in
222 *4.0)
223 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224 ;;
225 *5.*)
226 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227 ;;
228 esac
229 # According to Compaq, /usr/sbin/psrinfo has been available on
230 # OSF/1 and Tru64 systems produced since 1995. I hope that
231 # covers most systems running today. This code pipes the CPU
232 # types through head -n 1, so we only detect the type of CPU 0.
233 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234 case "$ALPHA_CPU_TYPE" in
235 "EV4 (21064)")
236 UNAME_MACHINE="alpha" ;;
237 "EV4.5 (21064)")
238 UNAME_MACHINE="alpha" ;;
239 "LCA4 (21066/21068)")
240 UNAME_MACHINE="alpha" ;;
241 "EV5 (21164)")
242 UNAME_MACHINE="alphaev5" ;;
243 "EV5.6 (21164A)")
244 UNAME_MACHINE="alphaev56" ;;
245 "EV5.6 (21164PC)")
246 UNAME_MACHINE="alphapca56" ;;
247 "EV5.7 (21164PC)")
248 UNAME_MACHINE="alphapca57" ;;
249 "EV6 (21264)")
250 UNAME_MACHINE="alphaev6" ;;
251 "EV6.7 (21264A)")
252 UNAME_MACHINE="alphaev67" ;;
253 "EV6.8CB (21264C)")
254 UNAME_MACHINE="alphaev68" ;;
255 "EV6.8AL (21264B)")
256 UNAME_MACHINE="alphaev68" ;;
257 "EV6.8CX (21264D)")
258 UNAME_MACHINE="alphaev68" ;;
259 "EV6.9A (21264/EV69A)")
260 UNAME_MACHINE="alphaev69" ;;
261 "EV7 (21364)")
262 UNAME_MACHINE="alphaev7" ;;
263 "EV7.9 (21364A)")
264 UNAME_MACHINE="alphaev79" ;;
265 esac
266 # A Pn.n version is a patched version.
267 # A Vn.n version is a released version.
268 # A Tn.n version is a released field test version.
269 # A Xn.n version is an unreleased experimental baselevel.
270 # 1.2 uses "1.2" for uname -r.
271 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272 exit ;;
273 Alpha\ *:Windows_NT*:*)
274 # How do we know it's Interix rather than the generic POSIX subsystem?
275 # Should we change UNAME_MACHINE based on the output of uname instead
276 # of the specific Alpha model?
277 echo alpha-pc-interix
278 exit ;;
279 21064:Windows_NT:50:3)
280 echo alpha-dec-winnt3.5
281 exit ;;
282 Amiga*:UNIX_System_V:4.0:*)
283 echo m68k-unknown-sysv4
284 exit ;;
285 *:[Aa]miga[Oo][Ss]:*:*)
286 echo ${UNAME_MACHINE}-unknown-amigaos
287 exit ;;
288 *:[Mm]orph[Oo][Ss]:*:*)
289 echo ${UNAME_MACHINE}-unknown-morphos
290 exit ;;
291 *:OS/390:*:*)
292 echo i370-ibm-openedition
293 exit ;;
294 *:z/VM:*:*)
295 echo s390-ibm-zvmoe
296 exit ;;
297 *:OS400:*:*)
298 echo powerpc-ibm-os400
299 exit ;;
300 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301 echo arm-acorn-riscix${UNAME_RELEASE}
302 exit ;;
303 arm:riscos:*:*|arm:RISCOS:*:*)
304 echo arm-unknown-riscos
305 exit ;;
306 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307 echo hppa1.1-hitachi-hiuxmpp
308 exit ;;
309 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
310 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
311 if test "`(/bin/universe) 2>/dev/null`" = att ; then
312 echo pyramid-pyramid-sysv3
313 else
314 echo pyramid-pyramid-bsd
315 fi
316 exit ;;
317 NILE*:*:*:dcosx)
318 echo pyramid-pyramid-svr4
319 exit ;;
320 DRS?6000:unix:4.0:6*)
321 echo sparc-icl-nx6
322 exit ;;
323 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324 case `/usr/bin/uname -p` in
325 sparc) echo sparc-icl-nx7; exit ;;
326 esac ;;
327 s390x:SunOS:*:*)
328 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329 exit ;;
330 sun4H:SunOS:5.*:*)
331 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332 exit ;;
333 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
334 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335 exit ;;
336 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
337 eval $set_cc_for_build
338 SUN_ARCH="i386"
339 # If there is a compiler, see if it is configured for 64-bit objects.
340 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
341 # This test works for both compilers.
342 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
343 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
344 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
345 grep IS_64BIT_ARCH >/dev/null
346 then
347 SUN_ARCH="x86_64"
348 fi
349 fi
350 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
351 exit ;;
352 sun4*:SunOS:6*:*)
353 # According to config.sub, this is the proper way to canonicalize
354 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
355 # it's likely to be more like Solaris than SunOS4.
356 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
357 exit ;;
358 sun4*:SunOS:*:*)
359 case "`/usr/bin/arch -k`" in
360 Series*|S4*)
361 UNAME_RELEASE=`uname -v`
362 ;;
363 esac
364 # Japanese Language versions have a version number like `4.1.3-JL'.
365 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
366 exit ;;
367 sun3*:SunOS:*:*)
368 echo m68k-sun-sunos${UNAME_RELEASE}
369 exit ;;
370 sun*:*:4.2BSD:*)
371 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
372 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
373 case "`/bin/arch`" in
374 sun3)
375 echo m68k-sun-sunos${UNAME_RELEASE}
376 ;;
377 sun4)
378 echo sparc-sun-sunos${UNAME_RELEASE}
379 ;;
380 esac
381 exit ;;
382 aushp:SunOS:*:*)
383 echo sparc-auspex-sunos${UNAME_RELEASE}
384 exit ;;
385 # The situation for MiNT is a little confusing. The machine name
386 # can be virtually everything (everything which is not
387 # "atarist" or "atariste" at least should have a processor
388 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
389 # to the lowercase version "mint" (or "freemint"). Finally
390 # the system name "TOS" denotes a system which is actually not
391 # MiNT. But MiNT is downward compatible to TOS, so this should
392 # be no problem.
393 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
394 echo m68k-atari-mint${UNAME_RELEASE}
395 exit ;;
396 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
397 echo m68k-atari-mint${UNAME_RELEASE}
398 exit ;;
399 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
400 echo m68k-atari-mint${UNAME_RELEASE}
401 exit ;;
402 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
403 echo m68k-milan-mint${UNAME_RELEASE}
404 exit ;;
405 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
406 echo m68k-hades-mint${UNAME_RELEASE}
407 exit ;;
408 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
409 echo m68k-unknown-mint${UNAME_RELEASE}
410 exit ;;
411 m68k:machten:*:*)
412 echo m68k-apple-machten${UNAME_RELEASE}
413 exit ;;
414 powerpc:machten:*:*)
415 echo powerpc-apple-machten${UNAME_RELEASE}
416 exit ;;
417 RISC*:Mach:*:*)
418 echo mips-dec-mach_bsd4.3
419 exit ;;
420 RISC*:ULTRIX:*:*)
421 echo mips-dec-ultrix${UNAME_RELEASE}
422 exit ;;
423 VAX*:ULTRIX*:*:*)
424 echo vax-dec-ultrix${UNAME_RELEASE}
425 exit ;;
426 2020:CLIX:*:* | 2430:CLIX:*:*)
427 echo clipper-intergraph-clix${UNAME_RELEASE}
428 exit ;;
429 mips:*:*:UMIPS | mips:*:*:RISCos)
430 eval $set_cc_for_build
431 sed 's/^ //' << EOF >$dummy.c
432#ifdef __cplusplus
433#include <stdio.h> /* for printf() prototype */
434 int main (int argc, char *argv[]) {
435#else
436 int main (argc, argv) int argc; char *argv[]; {
437#endif
438 #if defined (host_mips) && defined (MIPSEB)
439 #if defined (SYSTYPE_SYSV)
440 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
441 #endif
442 #if defined (SYSTYPE_SVR4)
443 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
444 #endif
445 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
446 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
447 #endif
448 #endif
449 exit (-1);
450 }
451EOF
452 $CC_FOR_BUILD -o $dummy $dummy.c &&
453 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
454 SYSTEM_NAME=`$dummy $dummyarg` &&
455 { echo "$SYSTEM_NAME"; exit; }
456 echo mips-mips-riscos${UNAME_RELEASE}
457 exit ;;
458 Motorola:PowerMAX_OS:*:*)
459 echo powerpc-motorola-powermax
460 exit ;;
461 Motorola:*:4.3:PL8-*)
462 echo powerpc-harris-powermax
463 exit ;;
464 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
465 echo powerpc-harris-powermax
466 exit ;;
467 Night_Hawk:Power_UNIX:*:*)
468 echo powerpc-harris-powerunix
469 exit ;;
470 m88k:CX/UX:7*:*)
471 echo m88k-harris-cxux7
472 exit ;;
473 m88k:*:4*:R4*)
474 echo m88k-motorola-sysv4
475 exit ;;
476 m88k:*:3*:R3*)
477 echo m88k-motorola-sysv3
478 exit ;;
479 AViiON:dgux:*:*)
480 # DG/UX returns AViiON for all architectures
481 UNAME_PROCESSOR=`/usr/bin/uname -p`
482 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
483 then
484 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
485 [ ${TARGET_BINARY_INTERFACE}x = x ]
486 then
487 echo m88k-dg-dgux${UNAME_RELEASE}
488 else
489 echo m88k-dg-dguxbcs${UNAME_RELEASE}
490 fi
491 else
492 echo i586-dg-dgux${UNAME_RELEASE}
493 fi
494 exit ;;
495 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
496 echo m88k-dolphin-sysv3
497 exit ;;
498 M88*:*:R3*:*)
499 # Delta 88k system running SVR3
500 echo m88k-motorola-sysv3
501 exit ;;
502 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
503 echo m88k-tektronix-sysv3
504 exit ;;
505 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
506 echo m68k-tektronix-bsd
507 exit ;;
508 *:IRIX*:*:*)
509 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
510 exit ;;
511 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
512 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
513 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
514 i*86:AIX:*:*)
515 echo i386-ibm-aix
516 exit ;;
517 ia64:AIX:*:*)
518 if [ -x /usr/bin/oslevel ] ; then
519 IBM_REV=`/usr/bin/oslevel`
520 else
521 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
522 fi
523 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
524 exit ;;
525 *:AIX:2:3)
526 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
527 eval $set_cc_for_build
528 sed 's/^ //' << EOF >$dummy.c
529 #include <sys/systemcfg.h>
530
531 main()
532 {
533 if (!__power_pc())
534 exit(1);
535 puts("powerpc-ibm-aix3.2.5");
536 exit(0);
537 }
538EOF
539 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
540 then
541 echo "$SYSTEM_NAME"
542 else
543 echo rs6000-ibm-aix3.2.5
544 fi
545 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
546 echo rs6000-ibm-aix3.2.4
547 else
548 echo rs6000-ibm-aix3.2
549 fi
550 exit ;;
551 *:AIX:*:[456])
552 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
553 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
554 IBM_ARCH=rs6000
555 else
556 IBM_ARCH=powerpc
557 fi
558 if [ -x /usr/bin/oslevel ] ; then
559 IBM_REV=`/usr/bin/oslevel`
560 else
561 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
562 fi
563 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
564 exit ;;
565 *:AIX:*:*)
566 echo rs6000-ibm-aix
567 exit ;;
568 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
569 echo romp-ibm-bsd4.4
570 exit ;;
571 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
572 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
573 exit ;; # report: romp-ibm BSD 4.3
574 *:BOSX:*:*)
575 echo rs6000-bull-bosx
576 exit ;;
577 DPX/2?00:B.O.S.:*:*)
578 echo m68k-bull-sysv3
579 exit ;;
580 9000/[34]??:4.3bsd:1.*:*)
581 echo m68k-hp-bsd
582 exit ;;
583 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
584 echo m68k-hp-bsd4.4
585 exit ;;
586 9000/[34678]??:HP-UX:*:*)
587 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
588 case "${UNAME_MACHINE}" in
589 9000/31? ) HP_ARCH=m68000 ;;
590 9000/[34]?? ) HP_ARCH=m68k ;;
591 9000/[678][0-9][0-9])
592 if [ -x /usr/bin/getconf ]; then
593 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
594 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
595 case "${sc_cpu_version}" in
596 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
597 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
598 532) # CPU_PA_RISC2_0
599 case "${sc_kernel_bits}" in
600 32) HP_ARCH="hppa2.0n" ;;
601 64) HP_ARCH="hppa2.0w" ;;
602 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
603 esac ;;
604 esac
605 fi
606 if [ "${HP_ARCH}" = "" ]; then
607 eval $set_cc_for_build
608 sed 's/^ //' << EOF >$dummy.c
609
610 #define _HPUX_SOURCE
611 #include <stdlib.h>
612 #include <unistd.h>
613
614 int main ()
615 {
616 #if defined(_SC_KERNEL_BITS)
617 long bits = sysconf(_SC_KERNEL_BITS);
618 #endif
619 long cpu = sysconf (_SC_CPU_VERSION);
620
621 switch (cpu)
622 {
623 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
624 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
625 case CPU_PA_RISC2_0:
626 #if defined(_SC_KERNEL_BITS)
627 switch (bits)
628 {
629 case 64: puts ("hppa2.0w"); break;
630 case 32: puts ("hppa2.0n"); break;
631 default: puts ("hppa2.0"); break;
632 } break;
633 #else /* !defined(_SC_KERNEL_BITS) */
634 puts ("hppa2.0"); break;
635 #endif
636 default: puts ("hppa1.0"); break;
637 }
638 exit (0);
639 }
640EOF
641 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
642 test -z "$HP_ARCH" && HP_ARCH=hppa
643 fi ;;
644 esac
645 if [ ${HP_ARCH} = "hppa2.0w" ]
646 then
647 eval $set_cc_for_build
648
649 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
650 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
651 # generating 64-bit code. GNU and HP use different nomenclature:
652 #
653 # $ CC_FOR_BUILD=cc ./config.guess
654 # => hppa2.0w-hp-hpux11.23
655 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
656 # => hppa64-hp-hpux11.23
657
658 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
659 grep -q __LP64__
660 then
661 HP_ARCH="hppa2.0w"
662 else
663 HP_ARCH="hppa64"
664 fi
665 fi
666 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
667 exit ;;
668 ia64:HP-UX:*:*)
669 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
670 echo ia64-hp-hpux${HPUX_REV}
671 exit ;;
672 3050*:HI-UX:*:*)
673 eval $set_cc_for_build
674 sed 's/^ //' << EOF >$dummy.c
675 #include <unistd.h>
676 int
677 main ()
678 {
679 long cpu = sysconf (_SC_CPU_VERSION);
680 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
681 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
682 results, however. */
683 if (CPU_IS_PA_RISC (cpu))
684 {
685 switch (cpu)
686 {
687 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
688 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
689 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
690 default: puts ("hppa-hitachi-hiuxwe2"); break;
691 }
692 }
693 else if (CPU_IS_HP_MC68K (cpu))
694 puts ("m68k-hitachi-hiuxwe2");
695 else puts ("unknown-hitachi-hiuxwe2");
696 exit (0);
697 }
698EOF
699 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
700 { echo "$SYSTEM_NAME"; exit; }
701 echo unknown-hitachi-hiuxwe2
702 exit ;;
703 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
704 echo hppa1.1-hp-bsd
705 exit ;;
706 9000/8??:4.3bsd:*:*)
707 echo hppa1.0-hp-bsd
708 exit ;;
709 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
710 echo hppa1.0-hp-mpeix
711 exit ;;
712 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
713 echo hppa1.1-hp-osf
714 exit ;;
715 hp8??:OSF1:*:*)
716 echo hppa1.0-hp-osf
717 exit ;;
718 i*86:OSF1:*:*)
719 if [ -x /usr/sbin/sysversion ] ; then
720 echo ${UNAME_MACHINE}-unknown-osf1mk
721 else
722 echo ${UNAME_MACHINE}-unknown-osf1
723 fi
724 exit ;;
725 parisc*:Lites*:*:*)
726 echo hppa1.1-hp-lites
727 exit ;;
728 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
729 echo c1-convex-bsd
730 exit ;;
731 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
732 if getsysinfo -f scalar_acc
733 then echo c32-convex-bsd
734 else echo c2-convex-bsd
735 fi
736 exit ;;
737 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
738 echo c34-convex-bsd
739 exit ;;
740 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
741 echo c38-convex-bsd
742 exit ;;
743 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
744 echo c4-convex-bsd
745 exit ;;
746 CRAY*Y-MP:*:*:*)
747 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
748 exit ;;
749 CRAY*[A-Z]90:*:*:*)
750 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
751 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
752 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
753 -e 's/\.[^.]*$/.X/'
754 exit ;;
755 CRAY*TS:*:*:*)
756 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
757 exit ;;
758 CRAY*T3E:*:*:*)
759 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
760 exit ;;
761 CRAY*SV1:*:*:*)
762 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763 exit ;;
764 *:UNICOS/mp:*:*)
765 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766 exit ;;
767 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
768 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
769 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
770 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
771 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
772 exit ;;
773 5000:UNIX_System_V:4.*:*)
774 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
775 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
776 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
777 exit ;;
778 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
779 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
780 exit ;;
781 sparc*:BSD/OS:*:*)
782 echo sparc-unknown-bsdi${UNAME_RELEASE}
783 exit ;;
784 *:BSD/OS:*:*)
785 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
786 exit ;;
787 *:FreeBSD:*:*)
788 case ${UNAME_MACHINE} in
789 pc98)
790 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
791 amd64)
792 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
793 *)
794 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795 esac
796 exit ;;
797 i*:CYGWIN*:*)
798 echo ${UNAME_MACHINE}-pc-cygwin
799 exit ;;
800 *:MINGW*:*)
801 echo ${UNAME_MACHINE}-pc-mingw32
802 exit ;;
803 i*:windows32*:*)
804 # uname -m includes "-pc" on this system.
805 echo ${UNAME_MACHINE}-mingw32
806 exit ;;
807 i*:PW*:*)
808 echo ${UNAME_MACHINE}-pc-pw32
809 exit ;;
810 *:Interix*:[3456]*)
811 case ${UNAME_MACHINE} in
812 x86)
813 echo i586-pc-interix${UNAME_RELEASE}
814 exit ;;
815 EM64T | authenticamd | genuineintel)
816 echo x86_64-unknown-interix${UNAME_RELEASE}
817 exit ;;
818 IA64)
819 echo ia64-unknown-interix${UNAME_RELEASE}
820 exit ;;
821 esac ;;
822 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
823 echo i${UNAME_MACHINE}-pc-mks
824 exit ;;
825 8664:Windows_NT:*)
826 echo x86_64-pc-mks
827 exit ;;
828 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
829 # How do we know it's Interix rather than the generic POSIX subsystem?
830 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
831 # UNAME_MACHINE based on the output of uname instead of i386?
832 echo i586-pc-interix
833 exit ;;
834 i*:UWIN*:*)
835 echo ${UNAME_MACHINE}-pc-uwin
836 exit ;;
837 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
838 echo x86_64-unknown-cygwin
839 exit ;;
840 p*:CYGWIN*:*)
841 echo powerpcle-unknown-cygwin
842 exit ;;
843 prep*:SunOS:5.*:*)
844 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
845 exit ;;
846 *:GNU:*:*)
847 # the GNU system
848 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
849 exit ;;
850 *:GNU/*:*:*)
851 # other systems with GNU libc and userland
852 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
853 exit ;;
854 i*86:Minix:*:*)
855 echo ${UNAME_MACHINE}-pc-minix
856 exit ;;
857 arm*:Linux:*:*)
858 eval $set_cc_for_build
859 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
860 | grep -q __ARM_EABI__
861 then
862 echo ${UNAME_MACHINE}-unknown-linux-gnu
863 else
864 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
865 fi
866 exit ;;
867 avr32*:Linux:*:*)
868 echo ${UNAME_MACHINE}-unknown-linux-gnu
869 exit ;;
870 cris:Linux:*:*)
871 echo cris-axis-linux-gnu
872 exit ;;
873 crisv32:Linux:*:*)
874 echo crisv32-axis-linux-gnu
875 exit ;;
876 frv:Linux:*:*)
877 echo frv-unknown-linux-gnu
878 exit ;;
879 ia64:Linux:*:*)
880 echo ${UNAME_MACHINE}-unknown-linux-gnu
881 exit ;;
882 m32r*:Linux:*:*)
883 echo ${UNAME_MACHINE}-unknown-linux-gnu
884 exit ;;
885 m68*:Linux:*:*)
886 echo ${UNAME_MACHINE}-unknown-linux-gnu
887 exit ;;
888 mips:Linux:*:* | mips64:Linux:*:*)
889 eval $set_cc_for_build
890 sed 's/^ //' << EOF >$dummy.c
891 #undef CPU
892 #undef ${UNAME_MACHINE}
893 #undef ${UNAME_MACHINE}el
894 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
895 CPU=${UNAME_MACHINE}el
896 #else
897 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
898 CPU=${UNAME_MACHINE}
899 #else
900 CPU=
901 #endif
902 #endif
903EOF
904 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
905 /^CPU/{
906 s: ::g
907 p
908 }'`"
909 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
910 ;;
911 or32:Linux:*:*)
912 echo or32-unknown-linux-gnu
913 exit ;;
914 ppc:Linux:*:*)
915 echo powerpc-unknown-linux-gnu
916 exit ;;
917 ppc64:Linux:*:*)
918 echo powerpc64-unknown-linux-gnu
919 exit ;;
920 alpha:Linux:*:*)
921 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
922 EV5) UNAME_MACHINE=alphaev5 ;;
923 EV56) UNAME_MACHINE=alphaev56 ;;
924 PCA56) UNAME_MACHINE=alphapca56 ;;
925 PCA57) UNAME_MACHINE=alphapca56 ;;
926 EV6) UNAME_MACHINE=alphaev6 ;;
927 EV67) UNAME_MACHINE=alphaev67 ;;
928 EV68*) UNAME_MACHINE=alphaev68 ;;
929 esac
930 objdump --private-headers /bin/sh | grep -q ld.so.1
931 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
932 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
933 exit ;;
934 padre:Linux:*:*)
935 echo sparc-unknown-linux-gnu
936 exit ;;
937 parisc:Linux:*:* | hppa:Linux:*:*)
938 # Look for CPU level
939 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
940 PA7*) echo hppa1.1-unknown-linux-gnu ;;
941 PA8*) echo hppa2.0-unknown-linux-gnu ;;
942 *) echo hppa-unknown-linux-gnu ;;
943 esac
944 exit ;;
945 parisc64:Linux:*:* | hppa64:Linux:*:*)
946 echo hppa64-unknown-linux-gnu
947 exit ;;
948 s390:Linux:*:* | s390x:Linux:*:*)
949 echo ${UNAME_MACHINE}-ibm-linux
950 exit ;;
951 sh64*:Linux:*:*)
952 echo ${UNAME_MACHINE}-unknown-linux-gnu
953 exit ;;
954 sh*:Linux:*:*)
955 echo ${UNAME_MACHINE}-unknown-linux-gnu
956 exit ;;
957 sparc:Linux:*:* | sparc64:Linux:*:*)
958 echo ${UNAME_MACHINE}-unknown-linux-gnu
959 exit ;;
960 vax:Linux:*:*)
961 echo ${UNAME_MACHINE}-dec-linux-gnu
962 exit ;;
963 x86_64:Linux:*:*)
964 echo x86_64-unknown-linux-gnu
965 exit ;;
966 xtensa*:Linux:*:*)
967 echo ${UNAME_MACHINE}-unknown-linux-gnu
968 exit ;;
969 i*86:Linux:*:*)
970 # The BFD linker knows what the default object file format is, so
971 # first see if it will tell us. cd to the root directory to prevent
972 # problems with other programs or directories called `ld' in the path.
973 # Set LC_ALL=C to ensure ld outputs messages in English.
974 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
975 | sed -ne '/supported targets:/!d
976 s/[ ][ ]*/ /g
977 s/.*supported targets: *//
978 s/ .*//
979 p'`
980 case "$ld_supported_targets" in
981 elf32-i386)
982 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
983 ;;
984 esac
985 # Determine whether the default compiler is a.out or elf
986 eval $set_cc_for_build
987 sed 's/^ //' << EOF >$dummy.c
988 #include <features.h>
989 #ifdef __ELF__
990 # ifdef __GLIBC__
991 # if __GLIBC__ >= 2
992 LIBC=gnu
993 # else
994 LIBC=gnulibc1
995 # endif
996 # else
997 LIBC=gnulibc1
998 # endif
999 #else
1000 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1001 LIBC=gnu
1002 #else
1003 LIBC=gnuaout
1004 #endif
1005 #endif
1006 #ifdef __dietlibc__
1007 LIBC=dietlibc
1008 #endif
1009EOF
1010 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1011 /^LIBC/{
1012 s: ::g
1013 p
1014 }'`"
1015 test x"${LIBC}" != x && {
1016 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1017 exit
1018 }
1019 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1020 ;;
1021 i*86:DYNIX/ptx:4*:*)
1022 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1023 # earlier versions are messed up and put the nodename in both
1024 # sysname and nodename.
1025 echo i386-sequent-sysv4
1026 exit ;;
1027 i*86:UNIX_SV:4.2MP:2.*)
1028 # Unixware is an offshoot of SVR4, but it has its own version
1029 # number series starting with 2...
1030 # I am not positive that other SVR4 systems won't match this,
1031 # I just have to hope. -- rms.
1032 # Use sysv4.2uw... so that sysv4* matches it.
1033 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1034 exit ;;
1035 i*86:OS/2:*:*)
1036 # If we were able to find `uname', then EMX Unix compatibility
1037 # is probably installed.
1038 echo ${UNAME_MACHINE}-pc-os2-emx
1039 exit ;;
1040 i*86:XTS-300:*:STOP)
1041 echo ${UNAME_MACHINE}-unknown-stop
1042 exit ;;
1043 i*86:atheos:*:*)
1044 echo ${UNAME_MACHINE}-unknown-atheos
1045 exit ;;
1046 i*86:syllable:*:*)
1047 echo ${UNAME_MACHINE}-pc-syllable
1048 exit ;;
1049 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1050 echo i386-unknown-lynxos${UNAME_RELEASE}
1051 exit ;;
1052 i*86:*DOS:*:*)
1053 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1054 exit ;;
1055 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1056 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1057 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1058 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1059 else
1060 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1061 fi
1062 exit ;;
1063 i*86:*:5:[678]*)
1064 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1065 case `/bin/uname -X | grep "^Machine"` in
1066 *486*) UNAME_MACHINE=i486 ;;
1067 *Pentium) UNAME_MACHINE=i586 ;;
1068 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1069 esac
1070 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1071 exit ;;
1072 i*86:*:3.2:*)
1073 if test -f /usr/options/cb.name; then
1074 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1075 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1076 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1077 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1078 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1079 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1080 && UNAME_MACHINE=i586
1081 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1082 && UNAME_MACHINE=i686
1083 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1084 && UNAME_MACHINE=i686
1085 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1086 else
1087 echo ${UNAME_MACHINE}-pc-sysv32
1088 fi
1089 exit ;;
1090 pc:*:*:*)
1091 # Left here for compatibility:
1092 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1093 # the processor, so we play safe by assuming i586.
1094 # Note: whatever this is, it MUST be the same as what config.sub
1095 # prints for the "djgpp" host, or else GDB configury will decide that
1096 # this is a cross-build.
1097 echo i586-pc-msdosdjgpp
1098 exit ;;
1099 Intel:Mach:3*:*)
1100 echo i386-pc-mach3
1101 exit ;;
1102 paragon:*:*:*)
1103 echo i860-intel-osf1
1104 exit ;;
1105 i860:*:4.*:*) # i860-SVR4
1106 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1107 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1108 else # Add other i860-SVR4 vendors below as they are discovered.
1109 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1110 fi
1111 exit ;;
1112 mini*:CTIX:SYS*5:*)
1113 # "miniframe"
1114 echo m68010-convergent-sysv
1115 exit ;;
1116 mc68k:UNIX:SYSTEM5:3.51m)
1117 echo m68k-convergent-sysv
1118 exit ;;
1119 M680?0:D-NIX:5.3:*)
1120 echo m68k-diab-dnix
1121 exit ;;
1122 M68*:*:R3V[5678]*:*)
1123 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1124 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)
1125 OS_REL=''
1126 test -r /etc/.relid \
1127 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1128 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1129 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1130 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1131 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1132 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1133 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1134 && { echo i486-ncr-sysv4; exit; } ;;
1135 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1136 OS_REL='.3'
1137 test -r /etc/.relid \
1138 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1139 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1140 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1141 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1142 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1143 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1144 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1145 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1146 echo m68k-unknown-lynxos${UNAME_RELEASE}
1147 exit ;;
1148 mc68030:UNIX_System_V:4.*:*)
1149 echo m68k-atari-sysv4
1150 exit ;;
1151 TSUNAMI:LynxOS:2.*:*)
1152 echo sparc-unknown-lynxos${UNAME_RELEASE}
1153 exit ;;
1154 rs6000:LynxOS:2.*:*)
1155 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1156 exit ;;
1157 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1158 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1159 exit ;;
1160 SM[BE]S:UNIX_SV:*:*)
1161 echo mips-dde-sysv${UNAME_RELEASE}
1162 exit ;;
1163 RM*:ReliantUNIX-*:*:*)
1164 echo mips-sni-sysv4
1165 exit ;;
1166 RM*:SINIX-*:*:*)
1167 echo mips-sni-sysv4
1168 exit ;;
1169 *:SINIX-*:*:*)
1170 if uname -p 2>/dev/null >/dev/null ; then
1171 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1172 echo ${UNAME_MACHINE}-sni-sysv4
1173 else
1174 echo ns32k-sni-sysv
1175 fi
1176 exit ;;
1177 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1178 # says <Richard.M.Bartel@ccMail.Census.GOV>
1179 echo i586-unisys-sysv4
1180 exit ;;
1181 *:UNIX_System_V:4*:FTX*)
1182 # From Gerald Hewes <hewes@openmarket.com>.
1183 # How about differentiating between stratus architectures? -djm
1184 echo hppa1.1-stratus-sysv4
1185 exit ;;
1186 *:*:*:FTX*)
1187 # From seanf@swdc.stratus.com.
1188 echo i860-stratus-sysv4
1189 exit ;;
1190 i*86:VOS:*:*)
1191 # From Paul.Green@stratus.com.
1192 echo ${UNAME_MACHINE}-stratus-vos
1193 exit ;;
1194 *:VOS:*:*)
1195 # From Paul.Green@stratus.com.
1196 echo hppa1.1-stratus-vos
1197 exit ;;
1198 mc68*:A/UX:*:*)
1199 echo m68k-apple-aux${UNAME_RELEASE}
1200 exit ;;
1201 news*:NEWS-OS:6*:*)
1202 echo mips-sony-newsos6
1203 exit ;;
1204 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1205 if [ -d /usr/nec ]; then
1206 echo mips-nec-sysv${UNAME_RELEASE}
1207 else
1208 echo mips-unknown-sysv${UNAME_RELEASE}
1209 fi
1210 exit ;;
1211 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1212 echo powerpc-be-beos
1213 exit ;;
1214 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1215 echo powerpc-apple-beos
1216 exit ;;
1217 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1218 echo i586-pc-beos
1219 exit ;;
1220 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1221 echo i586-pc-haiku
1222 exit ;;
1223 SX-4:SUPER-UX:*:*)
1224 echo sx4-nec-superux${UNAME_RELEASE}
1225 exit ;;
1226 SX-5:SUPER-UX:*:*)
1227 echo sx5-nec-superux${UNAME_RELEASE}
1228 exit ;;
1229 SX-6:SUPER-UX:*:*)
1230 echo sx6-nec-superux${UNAME_RELEASE}
1231 exit ;;
1232 SX-7:SUPER-UX:*:*)
1233 echo sx7-nec-superux${UNAME_RELEASE}
1234 exit ;;
1235 SX-8:SUPER-UX:*:*)
1236 echo sx8-nec-superux${UNAME_RELEASE}
1237 exit ;;
1238 SX-8R:SUPER-UX:*:*)
1239 echo sx8r-nec-superux${UNAME_RELEASE}
1240 exit ;;
1241 Power*:Rhapsody:*:*)
1242 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1243 exit ;;
1244 *:Rhapsody:*:*)
1245 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1246 exit ;;
1247 *:Darwin:*:*)
1248 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1249 case $UNAME_PROCESSOR in
1250 unknown) UNAME_PROCESSOR=powerpc ;;
1251 esac
1252 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1253 exit ;;
1254 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1255 UNAME_PROCESSOR=`uname -p`
1256 if test "$UNAME_PROCESSOR" = "x86"; then
1257 UNAME_PROCESSOR=i386
1258 UNAME_MACHINE=pc
1259 fi
1260 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1261 exit ;;
1262 *:QNX:*:4*)
1263 echo i386-pc-qnx
1264 exit ;;
1265 NSE-?:NONSTOP_KERNEL:*:*)
1266 echo nse-tandem-nsk${UNAME_RELEASE}
1267 exit ;;
1268 NSR-?:NONSTOP_KERNEL:*:*)
1269 echo nsr-tandem-nsk${UNAME_RELEASE}
1270 exit ;;
1271 *:NonStop-UX:*:*)
1272 echo mips-compaq-nonstopux
1273 exit ;;
1274 BS2000:POSIX*:*:*)
1275 echo bs2000-siemens-sysv
1276 exit ;;
1277 DS/*:UNIX_System_V:*:*)
1278 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1279 exit ;;
1280 *:Plan9:*:*)
1281 # "uname -m" is not consistent, so use $cputype instead. 386
1282 # is converted to i386 for consistency with other x86
1283 # operating systems.
1284 if test "$cputype" = "386"; then
1285 UNAME_MACHINE=i386
1286 else
1287 UNAME_MACHINE="$cputype"
1288 fi
1289 echo ${UNAME_MACHINE}-unknown-plan9
1290 exit ;;
1291 *:TOPS-10:*:*)
1292 echo pdp10-unknown-tops10
1293 exit ;;
1294 *:TENEX:*:*)
1295 echo pdp10-unknown-tenex
1296 exit ;;
1297 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1298 echo pdp10-dec-tops20
1299 exit ;;
1300 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1301 echo pdp10-xkl-tops20
1302 exit ;;
1303 *:TOPS-20:*:*)
1304 echo pdp10-unknown-tops20
1305 exit ;;
1306 *:ITS:*:*)
1307 echo pdp10-unknown-its
1308 exit ;;
1309 SEI:*:*:SEIUX)
1310 echo mips-sei-seiux${UNAME_RELEASE}
1311 exit ;;
1312 *:DragonFly:*:*)
1313 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1314 exit ;;
1315 *:*VMS:*:*)
1316 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1317 case "${UNAME_MACHINE}" in
1318 A*) echo alpha-dec-vms ; exit ;;
1319 I*) echo ia64-dec-vms ; exit ;;
1320 V*) echo vax-dec-vms ; exit ;;
1321 esac ;;
1322 *:XENIX:*:SysV)
1323 echo i386-pc-xenix
1324 exit ;;
1325 i*86:skyos:*:*)
1326 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1327 exit ;;
1328 i*86:rdos:*:*)
1329 echo ${UNAME_MACHINE}-pc-rdos
1330 exit ;;
1331 i*86:AROS:*:*)
1332 echo ${UNAME_MACHINE}-pc-aros
1333 exit ;;
1334esac
1335
1336#echo '(No uname command or uname output not recognized.)' 1>&2
1337#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1338
1339eval $set_cc_for_build
1340cat >$dummy.c <<EOF
1341#ifdef _SEQUENT_
1342# include <sys/types.h>
1343# include <sys/utsname.h>
1344#endif
1345main ()
1346{
1347#if defined (sony)
1348#if defined (MIPSEB)
1349 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1350 I don't know.... */
1351 printf ("mips-sony-bsd\n"); exit (0);
1352#else
1353#include <sys/param.h>
1354 printf ("m68k-sony-newsos%s\n",
1355#ifdef NEWSOS4
1356 "4"
1357#else
1358 ""
1359#endif
1360 ); exit (0);
1361#endif
1362#endif
1363
1364#if defined (__arm) && defined (__acorn) && defined (__unix)
1365 printf ("arm-acorn-riscix\n"); exit (0);
1366#endif
1367
1368#if defined (hp300) && !defined (hpux)
1369 printf ("m68k-hp-bsd\n"); exit (0);
1370#endif
1371
1372#if defined (NeXT)
1373#if !defined (__ARCHITECTURE__)
1374#define __ARCHITECTURE__ "m68k"
1375#endif
1376 int version;
1377 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1378 if (version < 4)
1379 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1380 else
1381 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1382 exit (0);
1383#endif
1384
1385#if defined (MULTIMAX) || defined (n16)
1386#if defined (UMAXV)
1387 printf ("ns32k-encore-sysv\n"); exit (0);
1388#else
1389#if defined (CMU)
1390 printf ("ns32k-encore-mach\n"); exit (0);
1391#else
1392 printf ("ns32k-encore-bsd\n"); exit (0);
1393#endif
1394#endif
1395#endif
1396
1397#if defined (__386BSD__)
1398 printf ("i386-pc-bsd\n"); exit (0);
1399#endif
1400
1401#if defined (sequent)
1402#if defined (i386)
1403 printf ("i386-sequent-dynix\n"); exit (0);
1404#endif
1405#if defined (ns32000)
1406 printf ("ns32k-sequent-dynix\n"); exit (0);
1407#endif
1408#endif
1409
1410#if defined (_SEQUENT_)
1411 struct utsname un;
1412
1413 uname(&un);
1414
1415 if (strncmp(un.version, "V2", 2) == 0) {
1416 printf ("i386-sequent-ptx2\n"); exit (0);
1417 }
1418 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1419 printf ("i386-sequent-ptx1\n"); exit (0);
1420 }
1421 printf ("i386-sequent-ptx\n"); exit (0);
1422
1423#endif
1424
1425#if defined (vax)
1426# if !defined (ultrix)
1427# include <sys/param.h>
1428# if defined (BSD)
1429# if BSD == 43
1430 printf ("vax-dec-bsd4.3\n"); exit (0);
1431# else
1432# if BSD == 199006
1433 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1434# else
1435 printf ("vax-dec-bsd\n"); exit (0);
1436# endif
1437# endif
1438# else
1439 printf ("vax-dec-bsd\n"); exit (0);
1440# endif
1441# else
1442 printf ("vax-dec-ultrix\n"); exit (0);
1443# endif
1444#endif
1445
1446#if defined (alliant) && defined (i860)
1447 printf ("i860-alliant-bsd\n"); exit (0);
1448#endif
1449
1450 exit (1);
1451}
1452EOF
1453
1454$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1455 { echo "$SYSTEM_NAME"; exit; }
1456
1457# Apollos put the system type in the environment.
1458
1459test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1460
1461# Convex versions that predate uname can use getsysinfo(1)
1462
1463if [ -x /usr/convex/getsysinfo ]
1464then
1465 case `getsysinfo -f cpu_type` in
1466 c1*)
1467 echo c1-convex-bsd
1468 exit ;;
1469 c2*)
1470 if getsysinfo -f scalar_acc
1471 then echo c32-convex-bsd
1472 else echo c2-convex-bsd
1473 fi
1474 exit ;;
1475 c34*)
1476 echo c34-convex-bsd
1477 exit ;;
1478 c38*)
1479 echo c38-convex-bsd
1480 exit ;;
1481 c4*)
1482 echo c4-convex-bsd
1483 exit ;;
1484 esac
1485fi
1486
1487cat >&2 <<EOF
1488$0: unable to guess system type
1489
1490This script, last modified $timestamp, has failed to recognize
1491the operating system you are using. It is advised that you
1492download the most up to date version of the config scripts from
1493
1494 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1495and
1496 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1497
1498If the version you run ($0) is already up to date, please
1499send the following data and any information you think might be
1500pertinent to <config-patches@gnu.org> in order to provide the needed
1501information to handle your system.
1502
1503config.guess timestamp = $timestamp
1504
1505uname -m = `(uname -m) 2>/dev/null || echo unknown`
1506uname -r = `(uname -r) 2>/dev/null || echo unknown`
1507uname -s = `(uname -s) 2>/dev/null || echo unknown`
1508uname -v = `(uname -v) 2>/dev/null || echo unknown`
1509
1510/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1511/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1512
1513hostinfo = `(hostinfo) 2>/dev/null`
1514/bin/universe = `(/bin/universe) 2>/dev/null`
1515/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1516/bin/arch = `(/bin/arch) 2>/dev/null`
1517/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1518/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1519
1520UNAME_MACHINE = ${UNAME_MACHINE}
1521UNAME_RELEASE = ${UNAME_RELEASE}
1522UNAME_SYSTEM = ${UNAME_SYSTEM}
1523UNAME_VERSION = ${UNAME_VERSION}
1524EOF
1525
1526exit 1
1527
1528# Local variables:
1529# eval: (add-hook 'write-file-hooks 'time-stamp)
1530# time-stamp-start: "timestamp='"
1531# time-stamp-format: "%:y-%02m-%02d"
1532# time-stamp-end: "'"
1533# End:
diff --git a/libraries/embryo/config.h.in b/libraries/embryo/config.h.in
new file mode 100644
index 0000000..331fd3f
--- /dev/null
+++ b/libraries/embryo/config.h.in
@@ -0,0 +1,148 @@
1/* config.h.in. Generated from configure.ac by autoheader. */
2
3
4#ifndef EFL_CONFIG_H__
5#define EFL_CONFIG_H__
6
7
8/* Define if building universal (internal helper macro) */
9#undef AC_APPLE_UNIVERSAL_BUILD
10
11/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
12 systems. This function is required for `alloca.c' support on those systems.
13 */
14#undef CRAY_STACKSEG_END
15
16/* Define to 1 if using `alloca.c'. */
17#undef C_ALLOCA
18
19/* Define to 1 if you have `alloca', as a function or macro. */
20#undef HAVE_ALLOCA
21
22/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
23 */
24#undef HAVE_ALLOCA_H
25
26/* Define to 1 if you have the <dlfcn.h> header file. */
27#undef HAVE_DLFCN_H
28
29/* Set to 1 if Evil library is installed */
30#undef HAVE_EVIL
31
32/* Define to 1 if you have the `gettimeofday' function. */
33#undef HAVE_GETTIMEOFDAY
34
35/* Define to 1 if you have the <inttypes.h> header file. */
36#undef HAVE_INTTYPES_H
37
38/* Define to 1 if you have the <memory.h> header file. */
39#undef HAVE_MEMORY_H
40
41/* Define to 1 if you have the <stdint.h> header file. */
42#undef HAVE_STDINT_H
43
44/* Define to 1 if you have the <stdlib.h> header file. */
45#undef HAVE_STDLIB_H
46
47/* Define to 1 if you have the <strings.h> header file. */
48#undef HAVE_STRINGS_H
49
50/* Define to 1 if you have the <string.h> header file. */
51#undef HAVE_STRING_H
52
53/* Define to 1 if you have the <sys/stat.h> header file. */
54#undef HAVE_SYS_STAT_H
55
56/* Define to 1 if you have the <sys/types.h> header file. */
57#undef HAVE_SYS_TYPES_H
58
59/* Define to 1 if you have the <unistd.h> header file. */
60#undef HAVE_UNISTD_H
61
62/* Define to 1 if your compiler has __attribute__ */
63#undef HAVE___ATTRIBUTE__
64
65/* Define to the sub-directory in which libtool stores uninstalled libraries.
66 */
67#undef LT_OBJDIR
68
69/* Define to 1 if your C compiler doesn't accept -c and -o together. */
70#undef NO_MINUS_C_MINUS_O
71
72/* Name of package */
73#undef PACKAGE
74
75/* Define to the address where bug reports for this package should be sent. */
76#undef PACKAGE_BUGREPORT
77
78/* Define to the full name of this package. */
79#undef PACKAGE_NAME
80
81/* Define to the full name and version of this package. */
82#undef PACKAGE_STRING
83
84/* Define to the one symbol short name of this package. */
85#undef PACKAGE_TARNAME
86
87/* Define to the home page for this package. */
88#undef PACKAGE_URL
89
90/* Define to the version of this package. */
91#undef PACKAGE_VERSION
92
93/* default value since PATH_MAX is not defined */
94#undef PATH_MAX
95
96/* If using the C implementation of alloca, define if you know the
97 direction of stack growth for your system; otherwise it will be
98 automatically deduced at runtime.
99 STACK_DIRECTION > 0 => grows toward higher addresses
100 STACK_DIRECTION < 0 => grows toward lower addresses
101 STACK_DIRECTION = 0 => direction of growth unknown */
102#undef STACK_DIRECTION
103
104/* Define to 1 if you have the ANSI C header files. */
105#undef STDC_HEADERS
106
107/* Version number of package */
108#undef VERSION
109
110/* Major version */
111#undef VMAJ
112
113/* Micro version */
114#undef VMIC
115
116/* Minor version */
117#undef VMIN
118
119/* Revison */
120#undef VREV
121
122/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
123 significant byte first (like Motorola and SPARC, unlike Intel). */
124#if defined AC_APPLE_UNIVERSAL_BUILD
125# if defined __BIG_ENDIAN__
126# define WORDS_BIGENDIAN 1
127# endif
128#else
129# ifndef WORDS_BIGENDIAN
130# undef WORDS_BIGENDIAN
131# endif
132#endif
133
134/* Macro declaring a function argument to be unused */
135#undef __UNUSED__
136
137/* Define to empty if `const' does not conform to ANSI C. */
138#undef const
139
140/* Define to `__inline__' or `__inline' if that's what the C compiler
141 calls it, or to nothing if 'inline' is not supported under any name. */
142#ifndef __cplusplus
143#undef inline
144#endif
145
146
147#endif /* EFL_CONFIG_H__ */
148
diff --git a/libraries/embryo/config.sub b/libraries/embryo/config.sub
new file mode 100755
index 0000000..eb0389a
--- /dev/null
+++ b/libraries/embryo/config.sub
@@ -0,0 +1,1693 @@
1#! /bin/sh
2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5# Free Software Foundation, Inc.
6
7timestamp='2009-06-11'
8
9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software
11# can handle that machine. It does not imply ALL GNU software can.
12#
13# This file is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26# 02110-1301, USA.
27#
28# As a special exception to the GNU General Public License, if you
29# distribute this file as part of a program that contains a
30# configuration script generated by Autoconf, you may include it under
31# the same distribution terms that you use for the rest of that program.
32
33
34# Please send patches to <config-patches@gnu.org>. Submit a context
35# diff and a properly formatted ChangeLog entry.
36#
37# Configuration subroutine to validate and canonicalize a configuration type.
38# Supply the specified configuration type as an argument.
39# If it is invalid, we print an error message on stderr and exit with code 1.
40# Otherwise, we print the canonical config type on stdout and succeed.
41
42# This file is supposed to be the same for all GNU packages
43# and recognize all the CPU types, system types and aliases
44# that are meaningful with *any* GNU software.
45# Each package is responsible for reporting which valid configurations
46# it does not support. The user should be able to distinguish
47# a failure to support a valid configuration from a meaningless
48# configuration.
49
50# The goal of this file is to map all the various variations of a given
51# machine specification into a single specification in the form:
52# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53# or in some cases, the newer four-part form:
54# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55# It is wrong to echo any other type of specification.
56
57me=`echo "$0" | sed -e 's,.*/,,'`
58
59usage="\
60Usage: $0 [OPTION] CPU-MFR-OPSYS
61 $0 [OPTION] ALIAS
62
63Canonicalize a configuration name.
64
65Operation modes:
66 -h, --help print this help, then exit
67 -t, --time-stamp print date of last modification, then exit
68 -v, --version print version number, then exit
69
70Report bugs and patches to <config-patches@gnu.org>."
71
72version="\
73GNU config.sub ($timestamp)
74
75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77
78This is free software; see the source for copying conditions. There is NO
79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80
81help="
82Try \`$me --help' for more information."
83
84# Parse command line
85while test $# -gt 0 ; do
86 case $1 in
87 --time-stamp | --time* | -t )
88 echo "$timestamp" ; exit ;;
89 --version | -v )
90 echo "$version" ; exit ;;
91 --help | --h* | -h )
92 echo "$usage"; exit ;;
93 -- ) # Stop option processing
94 shift; break ;;
95 - ) # Use stdin as input.
96 break ;;
97 -* )
98 echo "$me: invalid option $1$help"
99 exit 1 ;;
100
101 *local*)
102 # First pass through any local machine types.
103 echo $1
104 exit ;;
105
106 * )
107 break ;;
108 esac
109done
110
111case $# in
112 0) echo "$me: missing argument$help" >&2
113 exit 1;;
114 1) ;;
115 *) echo "$me: too many arguments$help" >&2
116 exit 1;;
117esac
118
119# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120# Here we must recognize all the valid KERNEL-OS combinations.
121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122case $maybe_os in
123 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125 kopensolaris*-gnu* | \
126 storm-chaos* | os2-emx* | rtmk-nova*)
127 os=-$maybe_os
128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
129 ;;
130 *)
131 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132 if [ $basic_machine != $1 ]
133 then os=`echo $1 | sed 's/.*-/-/'`
134 else os=; fi
135 ;;
136esac
137
138### Let's recognize common machines as not being operating systems so
139### that things like config.sub decstation-3100 work. We also
140### recognize some manufacturers as not being operating systems, so we
141### can provide default operating systems below.
142case $os in
143 -sun*os*)
144 # Prevent following clause from handling this invalid input.
145 ;;
146 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
152 -apple | -axis | -knuth | -cray)
153 os=
154 basic_machine=$1
155 ;;
156 -bluegene*)
157 os=-cnk
158 ;;
159 -sim | -cisco | -oki | -wec | -winbond)
160 os=
161 basic_machine=$1
162 ;;
163 -scout)
164 ;;
165 -wrs)
166 os=-vxworks
167 basic_machine=$1
168 ;;
169 -chorusos*)
170 os=-chorusos
171 basic_machine=$1
172 ;;
173 -chorusrdb)
174 os=-chorusrdb
175 basic_machine=$1
176 ;;
177 -hiux*)
178 os=-hiuxwe2
179 ;;
180 -sco6)
181 os=-sco5v6
182 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183 ;;
184 -sco5)
185 os=-sco3.2v5
186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187 ;;
188 -sco4)
189 os=-sco3.2v4
190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191 ;;
192 -sco3.2.[4-9]*)
193 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195 ;;
196 -sco3.2v[4-9]*)
197 # Don't forget version if it is 3.2v4 or newer.
198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199 ;;
200 -sco5v6*)
201 # Don't forget version if it is 3.2v4 or newer.
202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203 ;;
204 -sco*)
205 os=-sco3.2v2
206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 ;;
208 -udk*)
209 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210 ;;
211 -isc)
212 os=-isc2.2
213 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214 ;;
215 -clix*)
216 basic_machine=clipper-intergraph
217 ;;
218 -isc*)
219 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
220 ;;
221 -lynx*)
222 os=-lynxos
223 ;;
224 -ptx*)
225 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
226 ;;
227 -windowsnt*)
228 os=`echo $os | sed -e 's/windowsnt/winnt/'`
229 ;;
230 -psos*)
231 os=-psos
232 ;;
233 -mint | -mint[0-9]*)
234 basic_machine=m68k-atari
235 os=-mint
236 ;;
237esac
238
239# Decode aliases for certain CPU-COMPANY combinations.
240case $basic_machine in
241 # Recognize the basic CPU types without company name.
242 # Some are omitted here because they have special meanings below.
243 1750a | 580 \
244 | a29k \
245 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
246 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
247 | am33_2.0 \
248 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
249 | bfin \
250 | c4x | clipper \
251 | d10v | d30v | dlx | dsp16xx \
252 | fido | fr30 | frv \
253 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
254 | i370 | i860 | i960 | ia64 \
255 | ip2k | iq2000 \
256 | lm32 \
257 | m32c | m32r | m32rle | m68000 | m68k | m88k \
258 | maxq | mb | microblaze | mcore | mep | metag \
259 | mips | mipsbe | mipseb | mipsel | mipsle \
260 | mips16 \
261 | mips64 | mips64el \
262 | mips64octeon | mips64octeonel \
263 | mips64orion | mips64orionel \
264 | mips64r5900 | mips64r5900el \
265 | mips64vr | mips64vrel \
266 | mips64vr4100 | mips64vr4100el \
267 | mips64vr4300 | mips64vr4300el \
268 | mips64vr5000 | mips64vr5000el \
269 | mips64vr5900 | mips64vr5900el \
270 | mipsisa32 | mipsisa32el \
271 | mipsisa32r2 | mipsisa32r2el \
272 | mipsisa64 | mipsisa64el \
273 | mipsisa64r2 | mipsisa64r2el \
274 | mipsisa64sb1 | mipsisa64sb1el \
275 | mipsisa64sr71k | mipsisa64sr71kel \
276 | mipstx39 | mipstx39el \
277 | mn10200 | mn10300 \
278 | moxie \
279 | mt \
280 | msp430 \
281 | nios | nios2 \
282 | ns16k | ns32k \
283 | or32 \
284 | pdp10 | pdp11 | pj | pjl \
285 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
286 | pyramid \
287 | score \
288 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
289 | sh64 | sh64le \
290 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
291 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
292 | spu | strongarm \
293 | tahoe | thumb | tic4x | tic80 | tron \
294 | v850 | v850e \
295 | we32k \
296 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
297 | z8k | z80)
298 basic_machine=$basic_machine-unknown
299 ;;
300 m6811 | m68hc11 | m6812 | m68hc12)
301 # Motorola 68HC11/12.
302 basic_machine=$basic_machine-unknown
303 os=-none
304 ;;
305 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
306 ;;
307 ms1)
308 basic_machine=mt-unknown
309 ;;
310
311 # We use `pc' rather than `unknown'
312 # because (1) that's what they normally are, and
313 # (2) the word "unknown" tends to confuse beginning users.
314 i*86 | x86_64)
315 basic_machine=$basic_machine-pc
316 ;;
317 # Object if more than one company name word.
318 *-*-*)
319 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
320 exit 1
321 ;;
322 # Recognize the basic CPU types with company name.
323 580-* \
324 | a29k-* \
325 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
326 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
327 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
328 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
329 | avr-* | avr32-* \
330 | bfin-* | bs2000-* \
331 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
332 | clipper-* | craynv-* | cydra-* \
333 | d10v-* | d30v-* | dlx-* \
334 | elxsi-* \
335 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
336 | h8300-* | h8500-* \
337 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
338 | i*86-* | i860-* | i960-* | ia64-* \
339 | ip2k-* | iq2000-* \
340 | lm32-* \
341 | m32c-* | m32r-* | m32rle-* \
342 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
343 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
344 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
345 | mips16-* \
346 | mips64-* | mips64el-* \
347 | mips64octeon-* | mips64octeonel-* \
348 | mips64orion-* | mips64orionel-* \
349 | mips64r5900-* | mips64r5900el-* \
350 | mips64vr-* | mips64vrel-* \
351 | mips64vr4100-* | mips64vr4100el-* \
352 | mips64vr4300-* | mips64vr4300el-* \
353 | mips64vr5000-* | mips64vr5000el-* \
354 | mips64vr5900-* | mips64vr5900el-* \
355 | mipsisa32-* | mipsisa32el-* \
356 | mipsisa32r2-* | mipsisa32r2el-* \
357 | mipsisa64-* | mipsisa64el-* \
358 | mipsisa64r2-* | mipsisa64r2el-* \
359 | mipsisa64sb1-* | mipsisa64sb1el-* \
360 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
361 | mipstx39-* | mipstx39el-* \
362 | mmix-* \
363 | mt-* \
364 | msp430-* \
365 | nios-* | nios2-* \
366 | none-* | np1-* | ns16k-* | ns32k-* \
367 | orion-* \
368 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
369 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
370 | pyramid-* \
371 | romp-* | rs6000-* \
372 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
373 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
374 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
375 | sparclite-* \
376 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
377 | tahoe-* | thumb-* \
378 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
379 | tron-* \
380 | v850-* | v850e-* | vax-* \
381 | we32k-* \
382 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
383 | xstormy16-* | xtensa*-* \
384 | ymp-* \
385 | z8k-* | z80-*)
386 ;;
387 # Recognize the basic CPU types without company name, with glob match.
388 xtensa*)
389 basic_machine=$basic_machine-unknown
390 ;;
391 # Recognize the various machine names and aliases which stand
392 # for a CPU type and a company and sometimes even an OS.
393 386bsd)
394 basic_machine=i386-unknown
395 os=-bsd
396 ;;
397 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
398 basic_machine=m68000-att
399 ;;
400 3b*)
401 basic_machine=we32k-att
402 ;;
403 a29khif)
404 basic_machine=a29k-amd
405 os=-udi
406 ;;
407 abacus)
408 basic_machine=abacus-unknown
409 ;;
410 adobe68k)
411 basic_machine=m68010-adobe
412 os=-scout
413 ;;
414 alliant | fx80)
415 basic_machine=fx80-alliant
416 ;;
417 altos | altos3068)
418 basic_machine=m68k-altos
419 ;;
420 am29k)
421 basic_machine=a29k-none
422 os=-bsd
423 ;;
424 amd64)
425 basic_machine=x86_64-pc
426 ;;
427 amd64-*)
428 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
429 ;;
430 amdahl)
431 basic_machine=580-amdahl
432 os=-sysv
433 ;;
434 amiga | amiga-*)
435 basic_machine=m68k-unknown
436 ;;
437 amigaos | amigados)
438 basic_machine=m68k-unknown
439 os=-amigaos
440 ;;
441 amigaunix | amix)
442 basic_machine=m68k-unknown
443 os=-sysv4
444 ;;
445 apollo68)
446 basic_machine=m68k-apollo
447 os=-sysv
448 ;;
449 apollo68bsd)
450 basic_machine=m68k-apollo
451 os=-bsd
452 ;;
453 aros)
454 basic_machine=i386-pc
455 os=-aros
456 ;;
457 aux)
458 basic_machine=m68k-apple
459 os=-aux
460 ;;
461 balance)
462 basic_machine=ns32k-sequent
463 os=-dynix
464 ;;
465 blackfin)
466 basic_machine=bfin-unknown
467 os=-linux
468 ;;
469 blackfin-*)
470 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
471 os=-linux
472 ;;
473 bluegene*)
474 basic_machine=powerpc-ibm
475 os=-cnk
476 ;;
477 c90)
478 basic_machine=c90-cray
479 os=-unicos
480 ;;
481 cegcc)
482 basic_machine=arm-unknown
483 os=-cegcc
484 ;;
485 convex-c1)
486 basic_machine=c1-convex
487 os=-bsd
488 ;;
489 convex-c2)
490 basic_machine=c2-convex
491 os=-bsd
492 ;;
493 convex-c32)
494 basic_machine=c32-convex
495 os=-bsd
496 ;;
497 convex-c34)
498 basic_machine=c34-convex
499 os=-bsd
500 ;;
501 convex-c38)
502 basic_machine=c38-convex
503 os=-bsd
504 ;;
505 cray | j90)
506 basic_machine=j90-cray
507 os=-unicos
508 ;;
509 craynv)
510 basic_machine=craynv-cray
511 os=-unicosmp
512 ;;
513 cr16)
514 basic_machine=cr16-unknown
515 os=-elf
516 ;;
517 crds | unos)
518 basic_machine=m68k-crds
519 ;;
520 crisv32 | crisv32-* | etraxfs*)
521 basic_machine=crisv32-axis
522 ;;
523 cris | cris-* | etrax*)
524 basic_machine=cris-axis
525 ;;
526 crx)
527 basic_machine=crx-unknown
528 os=-elf
529 ;;
530 da30 | da30-*)
531 basic_machine=m68k-da30
532 ;;
533 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
534 basic_machine=mips-dec
535 ;;
536 decsystem10* | dec10*)
537 basic_machine=pdp10-dec
538 os=-tops10
539 ;;
540 decsystem20* | dec20*)
541 basic_machine=pdp10-dec
542 os=-tops20
543 ;;
544 delta | 3300 | motorola-3300 | motorola-delta \
545 | 3300-motorola | delta-motorola)
546 basic_machine=m68k-motorola
547 ;;
548 delta88)
549 basic_machine=m88k-motorola
550 os=-sysv3
551 ;;
552 dicos)
553 basic_machine=i686-pc
554 os=-dicos
555 ;;
556 djgpp)
557 basic_machine=i586-pc
558 os=-msdosdjgpp
559 ;;
560 dpx20 | dpx20-*)
561 basic_machine=rs6000-bull
562 os=-bosx
563 ;;
564 dpx2* | dpx2*-bull)
565 basic_machine=m68k-bull
566 os=-sysv3
567 ;;
568 ebmon29k)
569 basic_machine=a29k-amd
570 os=-ebmon
571 ;;
572 elxsi)
573 basic_machine=elxsi-elxsi
574 os=-bsd
575 ;;
576 encore | umax | mmax)
577 basic_machine=ns32k-encore
578 ;;
579 es1800 | OSE68k | ose68k | ose | OSE)
580 basic_machine=m68k-ericsson
581 os=-ose
582 ;;
583 fx2800)
584 basic_machine=i860-alliant
585 ;;
586 genix)
587 basic_machine=ns32k-ns
588 ;;
589 gmicro)
590 basic_machine=tron-gmicro
591 os=-sysv
592 ;;
593 go32)
594 basic_machine=i386-pc
595 os=-go32
596 ;;
597 h3050r* | hiux*)
598 basic_machine=hppa1.1-hitachi
599 os=-hiuxwe2
600 ;;
601 h8300hms)
602 basic_machine=h8300-hitachi
603 os=-hms
604 ;;
605 h8300xray)
606 basic_machine=h8300-hitachi
607 os=-xray
608 ;;
609 h8500hms)
610 basic_machine=h8500-hitachi
611 os=-hms
612 ;;
613 harris)
614 basic_machine=m88k-harris
615 os=-sysv3
616 ;;
617 hp300-*)
618 basic_machine=m68k-hp
619 ;;
620 hp300bsd)
621 basic_machine=m68k-hp
622 os=-bsd
623 ;;
624 hp300hpux)
625 basic_machine=m68k-hp
626 os=-hpux
627 ;;
628 hp3k9[0-9][0-9] | hp9[0-9][0-9])
629 basic_machine=hppa1.0-hp
630 ;;
631 hp9k2[0-9][0-9] | hp9k31[0-9])
632 basic_machine=m68000-hp
633 ;;
634 hp9k3[2-9][0-9])
635 basic_machine=m68k-hp
636 ;;
637 hp9k6[0-9][0-9] | hp6[0-9][0-9])
638 basic_machine=hppa1.0-hp
639 ;;
640 hp9k7[0-79][0-9] | hp7[0-79][0-9])
641 basic_machine=hppa1.1-hp
642 ;;
643 hp9k78[0-9] | hp78[0-9])
644 # FIXME: really hppa2.0-hp
645 basic_machine=hppa1.1-hp
646 ;;
647 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
648 # FIXME: really hppa2.0-hp
649 basic_machine=hppa1.1-hp
650 ;;
651 hp9k8[0-9][13679] | hp8[0-9][13679])
652 basic_machine=hppa1.1-hp
653 ;;
654 hp9k8[0-9][0-9] | hp8[0-9][0-9])
655 basic_machine=hppa1.0-hp
656 ;;
657 hppa-next)
658 os=-nextstep3
659 ;;
660 hppaosf)
661 basic_machine=hppa1.1-hp
662 os=-osf
663 ;;
664 hppro)
665 basic_machine=hppa1.1-hp
666 os=-proelf
667 ;;
668 i370-ibm* | ibm*)
669 basic_machine=i370-ibm
670 ;;
671# I'm not sure what "Sysv32" means. Should this be sysv3.2?
672 i*86v32)
673 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
674 os=-sysv32
675 ;;
676 i*86v4*)
677 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
678 os=-sysv4
679 ;;
680 i*86v)
681 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
682 os=-sysv
683 ;;
684 i*86sol2)
685 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
686 os=-solaris2
687 ;;
688 i386mach)
689 basic_machine=i386-mach
690 os=-mach
691 ;;
692 i386-vsta | vsta)
693 basic_machine=i386-unknown
694 os=-vsta
695 ;;
696 iris | iris4d)
697 basic_machine=mips-sgi
698 case $os in
699 -irix*)
700 ;;
701 *)
702 os=-irix4
703 ;;
704 esac
705 ;;
706 isi68 | isi)
707 basic_machine=m68k-isi
708 os=-sysv
709 ;;
710 m68knommu)
711 basic_machine=m68k-unknown
712 os=-linux
713 ;;
714 m68knommu-*)
715 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
716 os=-linux
717 ;;
718 m88k-omron*)
719 basic_machine=m88k-omron
720 ;;
721 magnum | m3230)
722 basic_machine=mips-mips
723 os=-sysv
724 ;;
725 merlin)
726 basic_machine=ns32k-utek
727 os=-sysv
728 ;;
729 mingw32)
730 basic_machine=i386-pc
731 os=-mingw32
732 ;;
733 mingw32ce)
734 basic_machine=arm-unknown
735 os=-mingw32ce
736 ;;
737 miniframe)
738 basic_machine=m68000-convergent
739 ;;
740 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
741 basic_machine=m68k-atari
742 os=-mint
743 ;;
744 mips3*-*)
745 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
746 ;;
747 mips3*)
748 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
749 ;;
750 monitor)
751 basic_machine=m68k-rom68k
752 os=-coff
753 ;;
754 morphos)
755 basic_machine=powerpc-unknown
756 os=-morphos
757 ;;
758 msdos)
759 basic_machine=i386-pc
760 os=-msdos
761 ;;
762 ms1-*)
763 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
764 ;;
765 mvs)
766 basic_machine=i370-ibm
767 os=-mvs
768 ;;
769 ncr3000)
770 basic_machine=i486-ncr
771 os=-sysv4
772 ;;
773 netbsd386)
774 basic_machine=i386-unknown
775 os=-netbsd
776 ;;
777 netwinder)
778 basic_machine=armv4l-rebel
779 os=-linux
780 ;;
781 news | news700 | news800 | news900)
782 basic_machine=m68k-sony
783 os=-newsos
784 ;;
785 news1000)
786 basic_machine=m68030-sony
787 os=-newsos
788 ;;
789 news-3600 | risc-news)
790 basic_machine=mips-sony
791 os=-newsos
792 ;;
793 necv70)
794 basic_machine=v70-nec
795 os=-sysv
796 ;;
797 next | m*-next )
798 basic_machine=m68k-next
799 case $os in
800 -nextstep* )
801 ;;
802 -ns2*)
803 os=-nextstep2
804 ;;
805 *)
806 os=-nextstep3
807 ;;
808 esac
809 ;;
810 nh3000)
811 basic_machine=m68k-harris
812 os=-cxux
813 ;;
814 nh[45]000)
815 basic_machine=m88k-harris
816 os=-cxux
817 ;;
818 nindy960)
819 basic_machine=i960-intel
820 os=-nindy
821 ;;
822 mon960)
823 basic_machine=i960-intel
824 os=-mon960
825 ;;
826 nonstopux)
827 basic_machine=mips-compaq
828 os=-nonstopux
829 ;;
830 np1)
831 basic_machine=np1-gould
832 ;;
833 nsr-tandem)
834 basic_machine=nsr-tandem
835 ;;
836 op50n-* | op60c-*)
837 basic_machine=hppa1.1-oki
838 os=-proelf
839 ;;
840 openrisc | openrisc-*)
841 basic_machine=or32-unknown
842 ;;
843 os400)
844 basic_machine=powerpc-ibm
845 os=-os400
846 ;;
847 OSE68000 | ose68000)
848 basic_machine=m68000-ericsson
849 os=-ose
850 ;;
851 os68k)
852 basic_machine=m68k-none
853 os=-os68k
854 ;;
855 pa-hitachi)
856 basic_machine=hppa1.1-hitachi
857 os=-hiuxwe2
858 ;;
859 paragon)
860 basic_machine=i860-intel
861 os=-osf
862 ;;
863 parisc)
864 basic_machine=hppa-unknown
865 os=-linux
866 ;;
867 parisc-*)
868 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
869 os=-linux
870 ;;
871 pbd)
872 basic_machine=sparc-tti
873 ;;
874 pbb)
875 basic_machine=m68k-tti
876 ;;
877 pc532 | pc532-*)
878 basic_machine=ns32k-pc532
879 ;;
880 pc98)
881 basic_machine=i386-pc
882 ;;
883 pc98-*)
884 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
885 ;;
886 pentium | p5 | k5 | k6 | nexgen | viac3)
887 basic_machine=i586-pc
888 ;;
889 pentiumpro | p6 | 6x86 | athlon | athlon_*)
890 basic_machine=i686-pc
891 ;;
892 pentiumii | pentium2 | pentiumiii | pentium3)
893 basic_machine=i686-pc
894 ;;
895 pentium4)
896 basic_machine=i786-pc
897 ;;
898 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
899 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
900 ;;
901 pentiumpro-* | p6-* | 6x86-* | athlon-*)
902 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
903 ;;
904 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
905 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
906 ;;
907 pentium4-*)
908 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
909 ;;
910 pn)
911 basic_machine=pn-gould
912 ;;
913 power) basic_machine=power-ibm
914 ;;
915 ppc) basic_machine=powerpc-unknown
916 ;;
917 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
918 ;;
919 ppcle | powerpclittle | ppc-le | powerpc-little)
920 basic_machine=powerpcle-unknown
921 ;;
922 ppcle-* | powerpclittle-*)
923 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
924 ;;
925 ppc64) basic_machine=powerpc64-unknown
926 ;;
927 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
928 ;;
929 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
930 basic_machine=powerpc64le-unknown
931 ;;
932 ppc64le-* | powerpc64little-*)
933 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
934 ;;
935 ps2)
936 basic_machine=i386-ibm
937 ;;
938 pw32)
939 basic_machine=i586-unknown
940 os=-pw32
941 ;;
942 rdos)
943 basic_machine=i386-pc
944 os=-rdos
945 ;;
946 rom68k)
947 basic_machine=m68k-rom68k
948 os=-coff
949 ;;
950 rm[46]00)
951 basic_machine=mips-siemens
952 ;;
953 rtpc | rtpc-*)
954 basic_machine=romp-ibm
955 ;;
956 s390 | s390-*)
957 basic_machine=s390-ibm
958 ;;
959 s390x | s390x-*)
960 basic_machine=s390x-ibm
961 ;;
962 sa29200)
963 basic_machine=a29k-amd
964 os=-udi
965 ;;
966 sb1)
967 basic_machine=mipsisa64sb1-unknown
968 ;;
969 sb1el)
970 basic_machine=mipsisa64sb1el-unknown
971 ;;
972 sde)
973 basic_machine=mipsisa32-sde
974 os=-elf
975 ;;
976 sei)
977 basic_machine=mips-sei
978 os=-seiux
979 ;;
980 sequent)
981 basic_machine=i386-sequent
982 ;;
983 sh)
984 basic_machine=sh-hitachi
985 os=-hms
986 ;;
987 sh5el)
988 basic_machine=sh5le-unknown
989 ;;
990 sh64)
991 basic_machine=sh64-unknown
992 ;;
993 sparclite-wrs | simso-wrs)
994 basic_machine=sparclite-wrs
995 os=-vxworks
996 ;;
997 sps7)
998 basic_machine=m68k-bull
999 os=-sysv2
1000 ;;
1001 spur)
1002 basic_machine=spur-unknown
1003 ;;
1004 st2000)
1005 basic_machine=m68k-tandem
1006 ;;
1007 stratus)
1008 basic_machine=i860-stratus
1009 os=-sysv4
1010 ;;
1011 sun2)
1012 basic_machine=m68000-sun
1013 ;;
1014 sun2os3)
1015 basic_machine=m68000-sun
1016 os=-sunos3
1017 ;;
1018 sun2os4)
1019 basic_machine=m68000-sun
1020 os=-sunos4
1021 ;;
1022 sun3os3)
1023 basic_machine=m68k-sun
1024 os=-sunos3
1025 ;;
1026 sun3os4)
1027 basic_machine=m68k-sun
1028 os=-sunos4
1029 ;;
1030 sun4os3)
1031 basic_machine=sparc-sun
1032 os=-sunos3
1033 ;;
1034 sun4os4)
1035 basic_machine=sparc-sun
1036 os=-sunos4
1037 ;;
1038 sun4sol2)
1039 basic_machine=sparc-sun
1040 os=-solaris2
1041 ;;
1042 sun3 | sun3-*)
1043 basic_machine=m68k-sun
1044 ;;
1045 sun4)
1046 basic_machine=sparc-sun
1047 ;;
1048 sun386 | sun386i | roadrunner)
1049 basic_machine=i386-sun
1050 ;;
1051 sv1)
1052 basic_machine=sv1-cray
1053 os=-unicos
1054 ;;
1055 symmetry)
1056 basic_machine=i386-sequent
1057 os=-dynix
1058 ;;
1059 t3e)
1060 basic_machine=alphaev5-cray
1061 os=-unicos
1062 ;;
1063 t90)
1064 basic_machine=t90-cray
1065 os=-unicos
1066 ;;
1067 tic54x | c54x*)
1068 basic_machine=tic54x-unknown
1069 os=-coff
1070 ;;
1071 tic55x | c55x*)
1072 basic_machine=tic55x-unknown
1073 os=-coff
1074 ;;
1075 tic6x | c6x*)
1076 basic_machine=tic6x-unknown
1077 os=-coff
1078 ;;
1079 tile*)
1080 basic_machine=tile-unknown
1081 os=-linux-gnu
1082 ;;
1083 tx39)
1084 basic_machine=mipstx39-unknown
1085 ;;
1086 tx39el)
1087 basic_machine=mipstx39el-unknown
1088 ;;
1089 toad1)
1090 basic_machine=pdp10-xkl
1091 os=-tops20
1092 ;;
1093 tower | tower-32)
1094 basic_machine=m68k-ncr
1095 ;;
1096 tpf)
1097 basic_machine=s390x-ibm
1098 os=-tpf
1099 ;;
1100 udi29k)
1101 basic_machine=a29k-amd
1102 os=-udi
1103 ;;
1104 ultra3)
1105 basic_machine=a29k-nyu
1106 os=-sym1
1107 ;;
1108 v810 | necv810)
1109 basic_machine=v810-nec
1110 os=-none
1111 ;;
1112 vaxv)
1113 basic_machine=vax-dec
1114 os=-sysv
1115 ;;
1116 vms)
1117 basic_machine=vax-dec
1118 os=-vms
1119 ;;
1120 vpp*|vx|vx-*)
1121 basic_machine=f301-fujitsu
1122 ;;
1123 vxworks960)
1124 basic_machine=i960-wrs
1125 os=-vxworks
1126 ;;
1127 vxworks68)
1128 basic_machine=m68k-wrs
1129 os=-vxworks
1130 ;;
1131 vxworks29k)
1132 basic_machine=a29k-wrs
1133 os=-vxworks
1134 ;;
1135 w65*)
1136 basic_machine=w65-wdc
1137 os=-none
1138 ;;
1139 w89k-*)
1140 basic_machine=hppa1.1-winbond
1141 os=-proelf
1142 ;;
1143 xbox)
1144 basic_machine=i686-pc
1145 os=-mingw32
1146 ;;
1147 xps | xps100)
1148 basic_machine=xps100-honeywell
1149 ;;
1150 ymp)
1151 basic_machine=ymp-cray
1152 os=-unicos
1153 ;;
1154 z8k-*-coff)
1155 basic_machine=z8k-unknown
1156 os=-sim
1157 ;;
1158 z80-*-coff)
1159 basic_machine=z80-unknown
1160 os=-sim
1161 ;;
1162 none)
1163 basic_machine=none-none
1164 os=-none
1165 ;;
1166
1167# Here we handle the default manufacturer of certain CPU types. It is in
1168# some cases the only manufacturer, in others, it is the most popular.
1169 w89k)
1170 basic_machine=hppa1.1-winbond
1171 ;;
1172 op50n)
1173 basic_machine=hppa1.1-oki
1174 ;;
1175 op60c)
1176 basic_machine=hppa1.1-oki
1177 ;;
1178 romp)
1179 basic_machine=romp-ibm
1180 ;;
1181 mmix)
1182 basic_machine=mmix-knuth
1183 ;;
1184 rs6000)
1185 basic_machine=rs6000-ibm
1186 ;;
1187 vax)
1188 basic_machine=vax-dec
1189 ;;
1190 pdp10)
1191 # there are many clones, so DEC is not a safe bet
1192 basic_machine=pdp10-unknown
1193 ;;
1194 pdp11)
1195 basic_machine=pdp11-dec
1196 ;;
1197 we32k)
1198 basic_machine=we32k-att
1199 ;;
1200 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1201 basic_machine=sh-unknown
1202 ;;
1203 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1204 basic_machine=sparc-sun
1205 ;;
1206 cydra)
1207 basic_machine=cydra-cydrome
1208 ;;
1209 orion)
1210 basic_machine=orion-highlevel
1211 ;;
1212 orion105)
1213 basic_machine=clipper-highlevel
1214 ;;
1215 mac | mpw | mac-mpw)
1216 basic_machine=m68k-apple
1217 ;;
1218 pmac | pmac-mpw)
1219 basic_machine=powerpc-apple
1220 ;;
1221 *-unknown)
1222 # Make sure to match an already-canonicalized machine name.
1223 ;;
1224 *)
1225 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1226 exit 1
1227 ;;
1228esac
1229
1230# Here we canonicalize certain aliases for manufacturers.
1231case $basic_machine in
1232 *-digital*)
1233 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1234 ;;
1235 *-commodore*)
1236 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1237 ;;
1238 *)
1239 ;;
1240esac
1241
1242# Decode manufacturer-specific aliases for certain operating systems.
1243
1244if [ x"$os" != x"" ]
1245then
1246case $os in
1247 # First match some system type aliases
1248 # that might get confused with valid system types.
1249 # -solaris* is a basic system type, with this one exception.
1250 -solaris1 | -solaris1.*)
1251 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1252 ;;
1253 -solaris)
1254 os=-solaris2
1255 ;;
1256 -svr4*)
1257 os=-sysv4
1258 ;;
1259 -unixware*)
1260 os=-sysv4.2uw
1261 ;;
1262 -gnu/linux*)
1263 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1264 ;;
1265 # First accept the basic system types.
1266 # The portable systems comes first.
1267 # Each alternative MUST END IN A *, to match a version number.
1268 # -sysv* is not here because it comes later, after sysvr4.
1269 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1270 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1271 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1272 | -kopensolaris* \
1273 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1274 | -aos* | -aros* \
1275 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1276 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1277 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1278 | -openbsd* | -solidbsd* \
1279 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1280 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1281 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1282 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1283 | -chorusos* | -chorusrdb* | -cegcc* \
1284 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1285 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1286 | -uxpv* | -beos* | -mpeix* | -udk* \
1287 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1288 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1289 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1290 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1291 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1292 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1293 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1294 # Remember, each alternative MUST END IN *, to match a version number.
1295 ;;
1296 -qnx*)
1297 case $basic_machine in
1298 x86-* | i*86-*)
1299 ;;
1300 *)
1301 os=-nto$os
1302 ;;
1303 esac
1304 ;;
1305 -nto-qnx*)
1306 ;;
1307 -nto*)
1308 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1309 ;;
1310 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1311 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1312 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1313 ;;
1314 -mac*)
1315 os=`echo $os | sed -e 's|mac|macos|'`
1316 ;;
1317 -linux-dietlibc)
1318 os=-linux-dietlibc
1319 ;;
1320 -linux*)
1321 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1322 ;;
1323 -sunos5*)
1324 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1325 ;;
1326 -sunos6*)
1327 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1328 ;;
1329 -opened*)
1330 os=-openedition
1331 ;;
1332 -os400*)
1333 os=-os400
1334 ;;
1335 -wince*)
1336 os=-wince
1337 ;;
1338 -osfrose*)
1339 os=-osfrose
1340 ;;
1341 -osf*)
1342 os=-osf
1343 ;;
1344 -utek*)
1345 os=-bsd
1346 ;;
1347 -dynix*)
1348 os=-bsd
1349 ;;
1350 -acis*)
1351 os=-aos
1352 ;;
1353 -atheos*)
1354 os=-atheos
1355 ;;
1356 -syllable*)
1357 os=-syllable
1358 ;;
1359 -386bsd)
1360 os=-bsd
1361 ;;
1362 -ctix* | -uts*)
1363 os=-sysv
1364 ;;
1365 -nova*)
1366 os=-rtmk-nova
1367 ;;
1368 -ns2 )
1369 os=-nextstep2
1370 ;;
1371 -nsk*)
1372 os=-nsk
1373 ;;
1374 # Preserve the version number of sinix5.
1375 -sinix5.*)
1376 os=`echo $os | sed -e 's|sinix|sysv|'`
1377 ;;
1378 -sinix*)
1379 os=-sysv4
1380 ;;
1381 -tpf*)
1382 os=-tpf
1383 ;;
1384 -triton*)
1385 os=-sysv3
1386 ;;
1387 -oss*)
1388 os=-sysv3
1389 ;;
1390 -svr4)
1391 os=-sysv4
1392 ;;
1393 -svr3)
1394 os=-sysv3
1395 ;;
1396 -sysvr4)
1397 os=-sysv4
1398 ;;
1399 # This must come after -sysvr4.
1400 -sysv*)
1401 ;;
1402 -ose*)
1403 os=-ose
1404 ;;
1405 -es1800*)
1406 os=-ose
1407 ;;
1408 -xenix)
1409 os=-xenix
1410 ;;
1411 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1412 os=-mint
1413 ;;
1414 -aros*)
1415 os=-aros
1416 ;;
1417 -kaos*)
1418 os=-kaos
1419 ;;
1420 -zvmoe)
1421 os=-zvmoe
1422 ;;
1423 -dicos*)
1424 os=-dicos
1425 ;;
1426 -none)
1427 ;;
1428 *)
1429 # Get rid of the `-' at the beginning of $os.
1430 os=`echo $os | sed 's/[^-]*-//'`
1431 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1432 exit 1
1433 ;;
1434esac
1435else
1436
1437# Here we handle the default operating systems that come with various machines.
1438# The value should be what the vendor currently ships out the door with their
1439# machine or put another way, the most popular os provided with the machine.
1440
1441# Note that if you're going to try to match "-MANUFACTURER" here (say,
1442# "-sun"), then you have to tell the case statement up towards the top
1443# that MANUFACTURER isn't an operating system. Otherwise, code above
1444# will signal an error saying that MANUFACTURER isn't an operating
1445# system, and we'll never get to this point.
1446
1447case $basic_machine in
1448 score-*)
1449 os=-elf
1450 ;;
1451 spu-*)
1452 os=-elf
1453 ;;
1454 *-acorn)
1455 os=-riscix1.2
1456 ;;
1457 arm*-rebel)
1458 os=-linux
1459 ;;
1460 arm*-semi)
1461 os=-aout
1462 ;;
1463 c4x-* | tic4x-*)
1464 os=-coff
1465 ;;
1466 # This must come before the *-dec entry.
1467 pdp10-*)
1468 os=-tops20
1469 ;;
1470 pdp11-*)
1471 os=-none
1472 ;;
1473 *-dec | vax-*)
1474 os=-ultrix4.2
1475 ;;
1476 m68*-apollo)
1477 os=-domain
1478 ;;
1479 i386-sun)
1480 os=-sunos4.0.2
1481 ;;
1482 m68000-sun)
1483 os=-sunos3
1484 # This also exists in the configure program, but was not the
1485 # default.
1486 # os=-sunos4
1487 ;;
1488 m68*-cisco)
1489 os=-aout
1490 ;;
1491 mep-*)
1492 os=-elf
1493 ;;
1494 mips*-cisco)
1495 os=-elf
1496 ;;
1497 mips*-*)
1498 os=-elf
1499 ;;
1500 or32-*)
1501 os=-coff
1502 ;;
1503 *-tti) # must be before sparc entry or we get the wrong os.
1504 os=-sysv3
1505 ;;
1506 sparc-* | *-sun)
1507 os=-sunos4.1.1
1508 ;;
1509 *-be)
1510 os=-beos
1511 ;;
1512 *-haiku)
1513 os=-haiku
1514 ;;
1515 *-ibm)
1516 os=-aix
1517 ;;
1518 *-knuth)
1519 os=-mmixware
1520 ;;
1521 *-wec)
1522 os=-proelf
1523 ;;
1524 *-winbond)
1525 os=-proelf
1526 ;;
1527 *-oki)
1528 os=-proelf
1529 ;;
1530 *-hp)
1531 os=-hpux
1532 ;;
1533 *-hitachi)
1534 os=-hiux
1535 ;;
1536 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1537 os=-sysv
1538 ;;
1539 *-cbm)
1540 os=-amigaos
1541 ;;
1542 *-dg)
1543 os=-dgux
1544 ;;
1545 *-dolphin)
1546 os=-sysv3
1547 ;;
1548 m68k-ccur)
1549 os=-rtu
1550 ;;
1551 m88k-omron*)
1552 os=-luna
1553 ;;
1554 *-next )
1555 os=-nextstep
1556 ;;
1557 *-sequent)
1558 os=-ptx
1559 ;;
1560 *-crds)
1561 os=-unos
1562 ;;
1563 *-ns)
1564 os=-genix
1565 ;;
1566 i370-*)
1567 os=-mvs
1568 ;;
1569 *-next)
1570 os=-nextstep3
1571 ;;
1572 *-gould)
1573 os=-sysv
1574 ;;
1575 *-highlevel)
1576 os=-bsd
1577 ;;
1578 *-encore)
1579 os=-bsd
1580 ;;
1581 *-sgi)
1582 os=-irix
1583 ;;
1584 *-siemens)
1585 os=-sysv4
1586 ;;
1587 *-masscomp)
1588 os=-rtu
1589 ;;
1590 f30[01]-fujitsu | f700-fujitsu)
1591 os=-uxpv
1592 ;;
1593 *-rom68k)
1594 os=-coff
1595 ;;
1596 *-*bug)
1597 os=-coff
1598 ;;
1599 *-apple)
1600 os=-macos
1601 ;;
1602 *-atari*)
1603 os=-mint
1604 ;;
1605 *)
1606 os=-none
1607 ;;
1608esac
1609fi
1610
1611# Here we handle the case where we know the os, and the CPU type, but not the
1612# manufacturer. We pick the logical manufacturer.
1613vendor=unknown
1614case $basic_machine in
1615 *-unknown)
1616 case $os in
1617 -riscix*)
1618 vendor=acorn
1619 ;;
1620 -sunos*)
1621 vendor=sun
1622 ;;
1623 -cnk*|-aix*)
1624 vendor=ibm
1625 ;;
1626 -beos*)
1627 vendor=be
1628 ;;
1629 -hpux*)
1630 vendor=hp
1631 ;;
1632 -mpeix*)
1633 vendor=hp
1634 ;;
1635 -hiux*)
1636 vendor=hitachi
1637 ;;
1638 -unos*)
1639 vendor=crds
1640 ;;
1641 -dgux*)
1642 vendor=dg
1643 ;;
1644 -luna*)
1645 vendor=omron
1646 ;;
1647 -genix*)
1648 vendor=ns
1649 ;;
1650 -mvs* | -opened*)
1651 vendor=ibm
1652 ;;
1653 -os400*)
1654 vendor=ibm
1655 ;;
1656 -ptx*)
1657 vendor=sequent
1658 ;;
1659 -tpf*)
1660 vendor=ibm
1661 ;;
1662 -vxsim* | -vxworks* | -windiss*)
1663 vendor=wrs
1664 ;;
1665 -aux*)
1666 vendor=apple
1667 ;;
1668 -hms*)
1669 vendor=hitachi
1670 ;;
1671 -mpw* | -macos*)
1672 vendor=apple
1673 ;;
1674 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1675 vendor=atari
1676 ;;
1677 -vos*)
1678 vendor=stratus
1679 ;;
1680 esac
1681 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1682 ;;
1683esac
1684
1685echo $basic_machine$os
1686exit
1687
1688# Local variables:
1689# eval: (add-hook 'write-file-hooks 'time-stamp)
1690# time-stamp-start: "timestamp='"
1691# time-stamp-format: "%:y-%02m-%02d"
1692# time-stamp-end: "'"
1693# End:
diff --git a/libraries/embryo/configure b/libraries/embryo/configure
new file mode 100755
index 0000000..466326f
--- /dev/null
+++ b/libraries/embryo/configure
@@ -0,0 +1,15821 @@
1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.67 for embryo 1.1.0.
4#
5# Report bugs to <enlightenment-devel@lists.sourceforge.net>.
6#
7#
8# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
9# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
10# Foundation, Inc.
11#
12#
13# This configure script is free software; the Free Software Foundation
14# gives unlimited permission to copy, distribute and modify it.
15## -------------------- ##
16## M4sh Initialization. ##
17## -------------------- ##
18
19# Be more Bourne compatible
20DUALCASE=1; export DUALCASE # for MKS sh
21if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
22 emulate sh
23 NULLCMD=:
24 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
25 # is contrary to our usage. Disable this feature.
26 alias -g '${1+"$@"}'='"$@"'
27 setopt NO_GLOB_SUBST
28else
29 case `(set -o) 2>/dev/null` in #(
30 *posix*) :
31 set -o posix ;; #(
32 *) :
33 ;;
34esac
35fi
36
37
38as_nl='
39'
40export as_nl
41# Printing a long string crashes Solaris 7 /usr/bin/printf.
42as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
43as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
44as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
45# Prefer a ksh shell builtin over an external printf program on Solaris,
46# but without wasting forks for bash or zsh.
47if test -z "$BASH_VERSION$ZSH_VERSION" \
48 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
49 as_echo='print -r --'
50 as_echo_n='print -rn --'
51elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
52 as_echo='printf %s\n'
53 as_echo_n='printf %s'
54else
55 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
56 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
57 as_echo_n='/usr/ucb/echo -n'
58 else
59 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
60 as_echo_n_body='eval
61 arg=$1;
62 case $arg in #(
63 *"$as_nl"*)
64 expr "X$arg" : "X\\(.*\\)$as_nl";
65 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
66 esac;
67 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
68 '
69 export as_echo_n_body
70 as_echo_n='sh -c $as_echo_n_body as_echo'
71 fi
72 export as_echo_body
73 as_echo='sh -c $as_echo_body as_echo'
74fi
75
76# The user is always right.
77if test "${PATH_SEPARATOR+set}" != set; then
78 PATH_SEPARATOR=:
79 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
80 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
81 PATH_SEPARATOR=';'
82 }
83fi
84
85
86# IFS
87# We need space, tab and new line, in precisely that order. Quoting is
88# there to prevent editors from complaining about space-tab.
89# (If _AS_PATH_WALK were called with IFS unset, it would disable word
90# splitting by setting IFS to empty value.)
91IFS=" "" $as_nl"
92
93# Find who we are. Look in the path if we contain no directory separator.
94case $0 in #((
95 *[\\/]* ) as_myself=$0 ;;
96 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
97for as_dir in $PATH
98do
99 IFS=$as_save_IFS
100 test -z "$as_dir" && as_dir=.
101 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
102 done
103IFS=$as_save_IFS
104
105 ;;
106esac
107# We did not find ourselves, most probably we were run as `sh COMMAND'
108# in which case we are not to be found in the path.
109if test "x$as_myself" = x; then
110 as_myself=$0
111fi
112if test ! -f "$as_myself"; then
113 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
114 exit 1
115fi
116
117# Unset variables that we do not need and which cause bugs (e.g. in
118# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
119# suppresses any "Segmentation fault" message there. '((' could
120# trigger a bug in pdksh 5.2.14.
121for as_var in BASH_ENV ENV MAIL MAILPATH
122do eval test x\${$as_var+set} = xset \
123 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
124done
125PS1='$ '
126PS2='> '
127PS4='+ '
128
129# NLS nuisances.
130LC_ALL=C
131export LC_ALL
132LANGUAGE=C
133export LANGUAGE
134
135# CDPATH.
136(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
137
138if test "x$CONFIG_SHELL" = x; then
139 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
140 emulate sh
141 NULLCMD=:
142 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
143 # is contrary to our usage. Disable this feature.
144 alias -g '\${1+\"\$@\"}'='\"\$@\"'
145 setopt NO_GLOB_SUBST
146else
147 case \`(set -o) 2>/dev/null\` in #(
148 *posix*) :
149 set -o posix ;; #(
150 *) :
151 ;;
152esac
153fi
154"
155 as_required="as_fn_return () { (exit \$1); }
156as_fn_success () { as_fn_return 0; }
157as_fn_failure () { as_fn_return 1; }
158as_fn_ret_success () { return 0; }
159as_fn_ret_failure () { return 1; }
160
161exitcode=0
162as_fn_success || { exitcode=1; echo as_fn_success failed.; }
163as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
164as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
165as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
166if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
167
168else
169 exitcode=1; echo positional parameters were not saved.
170fi
171test x\$exitcode = x0 || exit 1"
172 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
173 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
174 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
175 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
176test \$(( 1 + 1 )) = 2 || exit 1"
177 if (eval "$as_required") 2>/dev/null; then :
178 as_have_required=yes
179else
180 as_have_required=no
181fi
182 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
183
184else
185 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
186as_found=false
187for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
188do
189 IFS=$as_save_IFS
190 test -z "$as_dir" && as_dir=.
191 as_found=:
192 case $as_dir in #(
193 /*)
194 for as_base in sh bash ksh sh5; do
195 # Try only shells that exist, to save several forks.
196 as_shell=$as_dir/$as_base
197 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
198 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
199 CONFIG_SHELL=$as_shell as_have_required=yes
200 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
201 break 2
202fi
203fi
204 done;;
205 esac
206 as_found=false
207done
208$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
209 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
210 CONFIG_SHELL=$SHELL as_have_required=yes
211fi; }
212IFS=$as_save_IFS
213
214
215 if test "x$CONFIG_SHELL" != x; then :
216 # We cannot yet assume a decent shell, so we have to provide a
217 # neutralization value for shells without unset; and this also
218 # works around shells that cannot unset nonexistent variables.
219 BASH_ENV=/dev/null
220 ENV=/dev/null
221 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
222 export CONFIG_SHELL
223 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
224fi
225
226 if test x$as_have_required = xno; then :
227 $as_echo "$0: This script requires a shell more modern than all"
228 $as_echo "$0: the shells that I found on your system."
229 if test x${ZSH_VERSION+set} = xset ; then
230 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
231 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
232 else
233 $as_echo "$0: Please tell bug-autoconf@gnu.org and
234$0: enlightenment-devel@lists.sourceforge.net about your
235$0: system, including any error possibly output before this
236$0: message. Then install a modern shell, or manually run
237$0: the script under such a shell if you do have one."
238 fi
239 exit 1
240fi
241fi
242fi
243SHELL=${CONFIG_SHELL-/bin/sh}
244export SHELL
245# Unset more variables known to interfere with behavior of common tools.
246CLICOLOR_FORCE= GREP_OPTIONS=
247unset CLICOLOR_FORCE GREP_OPTIONS
248
249## --------------------- ##
250## M4sh Shell Functions. ##
251## --------------------- ##
252# as_fn_unset VAR
253# ---------------
254# Portably unset VAR.
255as_fn_unset ()
256{
257 { eval $1=; unset $1;}
258}
259as_unset=as_fn_unset
260
261# as_fn_set_status STATUS
262# -----------------------
263# Set $? to STATUS, without forking.
264as_fn_set_status ()
265{
266 return $1
267} # as_fn_set_status
268
269# as_fn_exit STATUS
270# -----------------
271# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
272as_fn_exit ()
273{
274 set +e
275 as_fn_set_status $1
276 exit $1
277} # as_fn_exit
278
279# as_fn_mkdir_p
280# -------------
281# Create "$as_dir" as a directory, including parents if necessary.
282as_fn_mkdir_p ()
283{
284
285 case $as_dir in #(
286 -*) as_dir=./$as_dir;;
287 esac
288 test -d "$as_dir" || eval $as_mkdir_p || {
289 as_dirs=
290 while :; do
291 case $as_dir in #(
292 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
293 *) as_qdir=$as_dir;;
294 esac
295 as_dirs="'$as_qdir' $as_dirs"
296 as_dir=`$as_dirname -- "$as_dir" ||
297$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
298 X"$as_dir" : 'X\(//\)[^/]' \| \
299 X"$as_dir" : 'X\(//\)$' \| \
300 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
301$as_echo X"$as_dir" |
302 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
303 s//\1/
304 q
305 }
306 /^X\(\/\/\)[^/].*/{
307 s//\1/
308 q
309 }
310 /^X\(\/\/\)$/{
311 s//\1/
312 q
313 }
314 /^X\(\/\).*/{
315 s//\1/
316 q
317 }
318 s/.*/./; q'`
319 test -d "$as_dir" && break
320 done
321 test -z "$as_dirs" || eval "mkdir $as_dirs"
322 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
323
324
325} # as_fn_mkdir_p
326# as_fn_append VAR VALUE
327# ----------------------
328# Append the text in VALUE to the end of the definition contained in VAR. Take
329# advantage of any shell optimizations that allow amortized linear growth over
330# repeated appends, instead of the typical quadratic growth present in naive
331# implementations.
332if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
333 eval 'as_fn_append ()
334 {
335 eval $1+=\$2
336 }'
337else
338 as_fn_append ()
339 {
340 eval $1=\$$1\$2
341 }
342fi # as_fn_append
343
344# as_fn_arith ARG...
345# ------------------
346# Perform arithmetic evaluation on the ARGs, and store the result in the
347# global $as_val. Take advantage of shells that can avoid forks. The arguments
348# must be portable across $(()) and expr.
349if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
350 eval 'as_fn_arith ()
351 {
352 as_val=$(( $* ))
353 }'
354else
355 as_fn_arith ()
356 {
357 as_val=`expr "$@" || test $? -eq 1`
358 }
359fi # as_fn_arith
360
361
362# as_fn_error STATUS ERROR [LINENO LOG_FD]
363# ----------------------------------------
364# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
365# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
366# script with STATUS, using 1 if that was 0.
367as_fn_error ()
368{
369 as_status=$1; test $as_status -eq 0 && as_status=1
370 if test "$4"; then
371 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
372 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
373 fi
374 $as_echo "$as_me: error: $2" >&2
375 as_fn_exit $as_status
376} # as_fn_error
377
378if expr a : '\(a\)' >/dev/null 2>&1 &&
379 test "X`expr 00001 : '.*\(...\)'`" = X001; then
380 as_expr=expr
381else
382 as_expr=false
383fi
384
385if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
386 as_basename=basename
387else
388 as_basename=false
389fi
390
391if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
392 as_dirname=dirname
393else
394 as_dirname=false
395fi
396
397as_me=`$as_basename -- "$0" ||
398$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
399 X"$0" : 'X\(//\)$' \| \
400 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
401$as_echo X/"$0" |
402 sed '/^.*\/\([^/][^/]*\)\/*$/{
403 s//\1/
404 q
405 }
406 /^X\/\(\/\/\)$/{
407 s//\1/
408 q
409 }
410 /^X\/\(\/\).*/{
411 s//\1/
412 q
413 }
414 s/.*/./; q'`
415
416# Avoid depending upon Character Ranges.
417as_cr_letters='abcdefghijklmnopqrstuvwxyz'
418as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
419as_cr_Letters=$as_cr_letters$as_cr_LETTERS
420as_cr_digits='0123456789'
421as_cr_alnum=$as_cr_Letters$as_cr_digits
422
423
424 as_lineno_1=$LINENO as_lineno_1a=$LINENO
425 as_lineno_2=$LINENO as_lineno_2a=$LINENO
426 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
427 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
428 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
429 sed -n '
430 p
431 /[$]LINENO/=
432 ' <$as_myself |
433 sed '
434 s/[$]LINENO.*/&-/
435 t lineno
436 b
437 :lineno
438 N
439 :loop
440 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
441 t loop
442 s/-\n.*//
443 ' >$as_me.lineno &&
444 chmod +x "$as_me.lineno" ||
445 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
446
447 # Don't try to exec as it changes $[0], causing all sort of problems
448 # (the dirname of $[0] is not the place where we might find the
449 # original and so on. Autoconf is especially sensitive to this).
450 . "./$as_me.lineno"
451 # Exit status is that of the last command.
452 exit
453}
454
455ECHO_C= ECHO_N= ECHO_T=
456case `echo -n x` in #(((((
457-n*)
458 case `echo 'xy\c'` in
459 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
460 xy) ECHO_C='\c';;
461 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
462 ECHO_T=' ';;
463 esac;;
464*)
465 ECHO_N='-n';;
466esac
467
468rm -f conf$$ conf$$.exe conf$$.file
469if test -d conf$$.dir; then
470 rm -f conf$$.dir/conf$$.file
471else
472 rm -f conf$$.dir
473 mkdir conf$$.dir 2>/dev/null
474fi
475if (echo >conf$$.file) 2>/dev/null; then
476 if ln -s conf$$.file conf$$ 2>/dev/null; then
477 as_ln_s='ln -s'
478 # ... but there are two gotchas:
479 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
480 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
481 # In both cases, we have to default to `cp -p'.
482 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
483 as_ln_s='cp -p'
484 elif ln conf$$.file conf$$ 2>/dev/null; then
485 as_ln_s=ln
486 else
487 as_ln_s='cp -p'
488 fi
489else
490 as_ln_s='cp -p'
491fi
492rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
493rmdir conf$$.dir 2>/dev/null
494
495if mkdir -p . 2>/dev/null; then
496 as_mkdir_p='mkdir -p "$as_dir"'
497else
498 test -d ./-p && rmdir ./-p
499 as_mkdir_p=false
500fi
501
502if test -x / >/dev/null 2>&1; then
503 as_test_x='test -x'
504else
505 if ls -dL / >/dev/null 2>&1; then
506 as_ls_L_option=L
507 else
508 as_ls_L_option=
509 fi
510 as_test_x='
511 eval sh -c '\''
512 if test -d "$1"; then
513 test -d "$1/.";
514 else
515 case $1 in #(
516 -*)set "./$1";;
517 esac;
518 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
519 ???[sx]*):;;*)false;;esac;fi
520 '\'' sh
521 '
522fi
523as_executable_p=$as_test_x
524
525# Sed expression to map a string onto a valid CPP name.
526as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
527
528# Sed expression to map a string onto a valid variable name.
529as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
530
531
532
533# Check that we are running under the correct shell.
534SHELL=${CONFIG_SHELL-/bin/sh}
535
536case X$lt_ECHO in
537X*--fallback-echo)
538 # Remove one level of quotation (which was required for Make).
539 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
540 ;;
541esac
542
543ECHO=${lt_ECHO-echo}
544if test "X$1" = X--no-reexec; then
545 # Discard the --no-reexec flag, and continue.
546 shift
547elif test "X$1" = X--fallback-echo; then
548 # Avoid inline document here, it may be left over
549 :
550elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
551 # Yippee, $ECHO works!
552 :
553else
554 # Restart under the correct shell.
555 exec $SHELL "$0" --no-reexec ${1+"$@"}
556fi
557
558if test "X$1" = X--fallback-echo; then
559 # used as fallback echo
560 shift
561 cat <<_LT_EOF
562$*
563_LT_EOF
564 exit 0
565fi
566
567# The HP-UX ksh and POSIX shell print the target directory to stdout
568# if CDPATH is set.
569(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
570
571if test -z "$lt_ECHO"; then
572 if test "X${echo_test_string+set}" != Xset; then
573 # find a string as large as possible, as long as the shell can cope with it
574 for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
575 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
576 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
577 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
578 then
579 break
580 fi
581 done
582 fi
583
584 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
585 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
586 test "X$echo_testing_string" = "X$echo_test_string"; then
587 :
588 else
589 # The Solaris, AIX, and Digital Unix default echo programs unquote
590 # backslashes. This makes it impossible to quote backslashes using
591 # echo "$something" | sed 's/\\/\\\\/g'
592 #
593 # So, first we look for a working echo in the user's PATH.
594
595 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
596 for dir in $PATH /usr/ucb; do
597 IFS="$lt_save_ifs"
598 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
599 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
600 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
601 test "X$echo_testing_string" = "X$echo_test_string"; then
602 ECHO="$dir/echo"
603 break
604 fi
605 done
606 IFS="$lt_save_ifs"
607
608 if test "X$ECHO" = Xecho; then
609 # We didn't find a better echo, so look for alternatives.
610 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
611 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
612 test "X$echo_testing_string" = "X$echo_test_string"; then
613 # This shell has a builtin print -r that does the trick.
614 ECHO='print -r'
615 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
616 test "X$CONFIG_SHELL" != X/bin/ksh; then
617 # If we have ksh, try running configure again with it.
618 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
619 export ORIGINAL_CONFIG_SHELL
620 CONFIG_SHELL=/bin/ksh
621 export CONFIG_SHELL
622 exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
623 else
624 # Try using printf.
625 ECHO='printf %s\n'
626 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
627 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
628 test "X$echo_testing_string" = "X$echo_test_string"; then
629 # Cool, printf works
630 :
631 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
632 test "X$echo_testing_string" = 'X\t' &&
633 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
634 test "X$echo_testing_string" = "X$echo_test_string"; then
635 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
636 export CONFIG_SHELL
637 SHELL="$CONFIG_SHELL"
638 export SHELL
639 ECHO="$CONFIG_SHELL $0 --fallback-echo"
640 elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
641 test "X$echo_testing_string" = 'X\t' &&
642 echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
643 test "X$echo_testing_string" = "X$echo_test_string"; then
644 ECHO="$CONFIG_SHELL $0 --fallback-echo"
645 else
646 # maybe with a smaller string...
647 prev=:
648
649 for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
650 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
651 then
652 break
653 fi
654 prev="$cmd"
655 done
656
657 if test "$prev" != 'sed 50q "$0"'; then
658 echo_test_string=`eval $prev`
659 export echo_test_string
660 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
661 else
662 # Oops. We lost completely, so just stick with echo.
663 ECHO=echo
664 fi
665 fi
666 fi
667 fi
668 fi
669fi
670
671# Copy echo and quote the copy suitably for passing to libtool from
672# the Makefile, instead of quoting the original, which is used later.
673lt_ECHO=$ECHO
674if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
675 lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
676fi
677
678
679
680
681test -n "$DJDIR" || exec 7<&0 </dev/null
682exec 6>&1
683
684# Name of the host.
685# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
686# so uname gets run too.
687ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
688
689#
690# Initializations.
691#
692ac_default_prefix=/usr/local
693ac_clean_files=
694ac_config_libobj_dir=.
695LIBOBJS=
696cross_compiling=no
697subdirs=
698MFLAGS=
699MAKEFLAGS=
700
701# Identity of this package.
702PACKAGE_NAME='embryo'
703PACKAGE_TARNAME='embryo'
704PACKAGE_VERSION='1.1.0'
705PACKAGE_STRING='embryo 1.1.0'
706PACKAGE_BUGREPORT='enlightenment-devel@lists.sourceforge.net'
707PACKAGE_URL=''
708
709ac_unique_file="configure.ac"
710# Factoring default headers for most tests.
711ac_includes_default="\
712#include <stdio.h>
713#ifdef HAVE_SYS_TYPES_H
714# include <sys/types.h>
715#endif
716#ifdef HAVE_SYS_STAT_H
717# include <sys/stat.h>
718#endif
719#ifdef STDC_HEADERS
720# include <stdlib.h>
721# include <stddef.h>
722#else
723# ifdef HAVE_STDLIB_H
724# include <stdlib.h>
725# endif
726#endif
727#ifdef HAVE_STRING_H
728# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
729# include <memory.h>
730# endif
731# include <string.h>
732#endif
733#ifdef HAVE_STRINGS_H
734# include <strings.h>
735#endif
736#ifdef HAVE_INTTYPES_H
737# include <inttypes.h>
738#endif
739#ifdef HAVE_STDINT_H
740# include <stdint.h>
741#endif
742#ifdef HAVE_UNISTD_H
743# include <unistd.h>
744#endif"
745
746ac_subst_vars='am__EXEEXT_FALSE
747am__EXEEXT_TRUE
748LTLIBOBJS
749LIBOBJS
750embryoincludedir
751requirement_embryo
752EFL_FNMATCH_LIBS
753ALLOCA
754lt_enable_auto_import
755EMBRYO_CFLAGS
756EMBRYO_CPPFLAGS
757EINA_LIBS
758EINA_CFLAGS
759EFL_EMBRYO_BUILD
760EVIL_LIBS
761EVIL_CFLAGS
762pkgconfig_requires_private
763PKG_CONFIG_LIBDIR
764PKG_CONFIG_PATH
765PKG_CONFIG
766EFL_BUILD_DOC_FALSE
767EFL_BUILD_DOC_TRUE
768efl_doxygen
769efl_have_doxygen
770BUILD_EMBRYO_CC_FALSE
771BUILD_EMBRYO_CC_TRUE
772EMBRYO_CC_PRG
773VMAJ
774release_info
775version_info
776CPP
777OTOOL64
778OTOOL
779LIPO
780NMEDIT
781DSYMUTIL
782lt_ECHO
783RANLIB
784AR
785LN_S
786NM
787ac_ct_DUMPBIN
788DUMPBIN
789LD
790FGREP
791EGREP
792GREP
793SED
794am__fastdepCC_FALSE
795am__fastdepCC_TRUE
796CCDEPMODE
797AMDEPBACKSLASH
798AMDEP_FALSE
799AMDEP_TRUE
800am__quote
801am__include
802DEPDIR
803OBJEXT
804EXEEXT
805ac_ct_CC
806CPPFLAGS
807LDFLAGS
808CFLAGS
809CC
810LIBTOOL
811OBJDUMP
812DLLTOOL
813AS
814host_os
815host_vendor
816host_cpu
817host
818build_os
819build_vendor
820build_cpu
821build
822AM_BACKSLASH
823AM_DEFAULT_VERBOSITY
824am__untar
825am__tar
826AMTAR
827am__leading_dot
828SET_MAKE
829AWK
830mkdir_p
831MKDIR_P
832INSTALL_STRIP_PROGRAM
833STRIP
834install_sh
835MAKEINFO
836AUTOHEADER
837AUTOMAKE
838AUTOCONF
839ACLOCAL
840VERSION
841PACKAGE
842CYGPATH_W
843am__isrc
844INSTALL_DATA
845INSTALL_SCRIPT
846INSTALL_PROGRAM
847target_alias
848host_alias
849build_alias
850LIBS
851ECHO_T
852ECHO_N
853ECHO_C
854DEFS
855mandir
856localedir
857libdir
858psdir
859pdfdir
860dvidir
861htmldir
862infodir
863docdir
864oldincludedir
865includedir
866localstatedir
867sharedstatedir
868sysconfdir
869datadir
870datarootdir
871libexecdir
872sbindir
873bindir
874program_transform_name
875prefix
876exec_prefix
877PACKAGE_URL
878PACKAGE_BUGREPORT
879PACKAGE_STRING
880PACKAGE_VERSION
881PACKAGE_TARNAME
882PACKAGE_NAME
883PATH_SEPARATOR
884SHELL'
885ac_subst_files=''
886ac_user_opts='
887enable_option_checking
888enable_silent_rules
889enable_shared
890enable_static
891with_pic
892enable_fast_install
893enable_dependency_tracking
894with_gnu_ld
895enable_libtool_lock
896enable_embryo_cc
897enable_doc
898with_doxygen
899'
900 ac_precious_vars='build_alias
901host_alias
902target_alias
903CC
904CFLAGS
905LDFLAGS
906LIBS
907CPPFLAGS
908CPP
909PKG_CONFIG
910PKG_CONFIG_PATH
911PKG_CONFIG_LIBDIR
912EVIL_CFLAGS
913EVIL_LIBS
914EINA_CFLAGS
915EINA_LIBS'
916
917
918# Initialize some variables set by options.
919ac_init_help=
920ac_init_version=false
921ac_unrecognized_opts=
922ac_unrecognized_sep=
923# The variables have the same names as the options, with
924# dashes changed to underlines.
925cache_file=/dev/null
926exec_prefix=NONE
927no_create=
928no_recursion=
929prefix=NONE
930program_prefix=NONE
931program_suffix=NONE
932program_transform_name=s,x,x,
933silent=
934site=
935srcdir=
936verbose=
937x_includes=NONE
938x_libraries=NONE
939
940# Installation directory options.
941# These are left unexpanded so users can "make install exec_prefix=/foo"
942# and all the variables that are supposed to be based on exec_prefix
943# by default will actually change.
944# Use braces instead of parens because sh, perl, etc. also accept them.
945# (The list follows the same order as the GNU Coding Standards.)
946bindir='${exec_prefix}/bin'
947sbindir='${exec_prefix}/sbin'
948libexecdir='${exec_prefix}/libexec'
949datarootdir='${prefix}/share'
950datadir='${datarootdir}'
951sysconfdir='${prefix}/etc'
952sharedstatedir='${prefix}/com'
953localstatedir='${prefix}/var'
954includedir='${prefix}/include'
955oldincludedir='/usr/include'
956docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
957infodir='${datarootdir}/info'
958htmldir='${docdir}'
959dvidir='${docdir}'
960pdfdir='${docdir}'
961psdir='${docdir}'
962libdir='${exec_prefix}/lib'
963localedir='${datarootdir}/locale'
964mandir='${datarootdir}/man'
965
966ac_prev=
967ac_dashdash=
968for ac_option
969do
970 # If the previous option needs an argument, assign it.
971 if test -n "$ac_prev"; then
972 eval $ac_prev=\$ac_option
973 ac_prev=
974 continue
975 fi
976
977 case $ac_option in
978 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
979 *=) ac_optarg= ;;
980 *) ac_optarg=yes ;;
981 esac
982
983 # Accept the important Cygnus configure options, so we can diagnose typos.
984
985 case $ac_dashdash$ac_option in
986 --)
987 ac_dashdash=yes ;;
988
989 -bindir | --bindir | --bindi | --bind | --bin | --bi)
990 ac_prev=bindir ;;
991 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
992 bindir=$ac_optarg ;;
993
994 -build | --build | --buil | --bui | --bu)
995 ac_prev=build_alias ;;
996 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
997 build_alias=$ac_optarg ;;
998
999 -cache-file | --cache-file | --cache-fil | --cache-fi \
1000 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1001 ac_prev=cache_file ;;
1002 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1003 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1004 cache_file=$ac_optarg ;;
1005
1006 --config-cache | -C)
1007 cache_file=config.cache ;;
1008
1009 -datadir | --datadir | --datadi | --datad)
1010 ac_prev=datadir ;;
1011 -datadir=* | --datadir=* | --datadi=* | --datad=*)
1012 datadir=$ac_optarg ;;
1013
1014 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
1015 | --dataroo | --dataro | --datar)
1016 ac_prev=datarootdir ;;
1017 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
1018 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
1019 datarootdir=$ac_optarg ;;
1020
1021 -disable-* | --disable-*)
1022 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1023 # Reject names that are not valid shell variable names.
1024 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1025 as_fn_error $? "invalid feature name: $ac_useropt"
1026 ac_useropt_orig=$ac_useropt
1027 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1028 case $ac_user_opts in
1029 *"
1030"enable_$ac_useropt"
1031"*) ;;
1032 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1033 ac_unrecognized_sep=', ';;
1034 esac
1035 eval enable_$ac_useropt=no ;;
1036
1037 -docdir | --docdir | --docdi | --doc | --do)
1038 ac_prev=docdir ;;
1039 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1040 docdir=$ac_optarg ;;
1041
1042 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1043 ac_prev=dvidir ;;
1044 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1045 dvidir=$ac_optarg ;;
1046
1047 -enable-* | --enable-*)
1048 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1049 # Reject names that are not valid shell variable names.
1050 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1051 as_fn_error $? "invalid feature name: $ac_useropt"
1052 ac_useropt_orig=$ac_useropt
1053 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1054 case $ac_user_opts in
1055 *"
1056"enable_$ac_useropt"
1057"*) ;;
1058 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1059 ac_unrecognized_sep=', ';;
1060 esac
1061 eval enable_$ac_useropt=\$ac_optarg ;;
1062
1063 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1064 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1065 | --exec | --exe | --ex)
1066 ac_prev=exec_prefix ;;
1067 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1068 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1069 | --exec=* | --exe=* | --ex=*)
1070 exec_prefix=$ac_optarg ;;
1071
1072 -gas | --gas | --ga | --g)
1073 # Obsolete; use --with-gas.
1074 with_gas=yes ;;
1075
1076 -help | --help | --hel | --he | -h)
1077 ac_init_help=long ;;
1078 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1079 ac_init_help=recursive ;;
1080 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1081 ac_init_help=short ;;
1082
1083 -host | --host | --hos | --ho)
1084 ac_prev=host_alias ;;
1085 -host=* | --host=* | --hos=* | --ho=*)
1086 host_alias=$ac_optarg ;;
1087
1088 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1089 ac_prev=htmldir ;;
1090 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1091 | --ht=*)
1092 htmldir=$ac_optarg ;;
1093
1094 -includedir | --includedir | --includedi | --included | --include \
1095 | --includ | --inclu | --incl | --inc)
1096 ac_prev=includedir ;;
1097 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1098 | --includ=* | --inclu=* | --incl=* | --inc=*)
1099 includedir=$ac_optarg ;;
1100
1101 -infodir | --infodir | --infodi | --infod | --info | --inf)
1102 ac_prev=infodir ;;
1103 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1104 infodir=$ac_optarg ;;
1105
1106 -libdir | --libdir | --libdi | --libd)
1107 ac_prev=libdir ;;
1108 -libdir=* | --libdir=* | --libdi=* | --libd=*)
1109 libdir=$ac_optarg ;;
1110
1111 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1112 | --libexe | --libex | --libe)
1113 ac_prev=libexecdir ;;
1114 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1115 | --libexe=* | --libex=* | --libe=*)
1116 libexecdir=$ac_optarg ;;
1117
1118 -localedir | --localedir | --localedi | --localed | --locale)
1119 ac_prev=localedir ;;
1120 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1121 localedir=$ac_optarg ;;
1122
1123 -localstatedir | --localstatedir | --localstatedi | --localstated \
1124 | --localstate | --localstat | --localsta | --localst | --locals)
1125 ac_prev=localstatedir ;;
1126 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1127 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1128 localstatedir=$ac_optarg ;;
1129
1130 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1131 ac_prev=mandir ;;
1132 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1133 mandir=$ac_optarg ;;
1134
1135 -nfp | --nfp | --nf)
1136 # Obsolete; use --without-fp.
1137 with_fp=no ;;
1138
1139 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1140 | --no-cr | --no-c | -n)
1141 no_create=yes ;;
1142
1143 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1144 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1145 no_recursion=yes ;;
1146
1147 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1148 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1149 | --oldin | --oldi | --old | --ol | --o)
1150 ac_prev=oldincludedir ;;
1151 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1152 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1153 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1154 oldincludedir=$ac_optarg ;;
1155
1156 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1157 ac_prev=prefix ;;
1158 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1159 prefix=$ac_optarg ;;
1160
1161 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1162 | --program-pre | --program-pr | --program-p)
1163 ac_prev=program_prefix ;;
1164 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1165 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1166 program_prefix=$ac_optarg ;;
1167
1168 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1169 | --program-suf | --program-su | --program-s)
1170 ac_prev=program_suffix ;;
1171 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1172 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1173 program_suffix=$ac_optarg ;;
1174
1175 -program-transform-name | --program-transform-name \
1176 | --program-transform-nam | --program-transform-na \
1177 | --program-transform-n | --program-transform- \
1178 | --program-transform | --program-transfor \
1179 | --program-transfo | --program-transf \
1180 | --program-trans | --program-tran \
1181 | --progr-tra | --program-tr | --program-t)
1182 ac_prev=program_transform_name ;;
1183 -program-transform-name=* | --program-transform-name=* \
1184 | --program-transform-nam=* | --program-transform-na=* \
1185 | --program-transform-n=* | --program-transform-=* \
1186 | --program-transform=* | --program-transfor=* \
1187 | --program-transfo=* | --program-transf=* \
1188 | --program-trans=* | --program-tran=* \
1189 | --progr-tra=* | --program-tr=* | --program-t=*)
1190 program_transform_name=$ac_optarg ;;
1191
1192 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1193 ac_prev=pdfdir ;;
1194 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1195 pdfdir=$ac_optarg ;;
1196
1197 -psdir | --psdir | --psdi | --psd | --ps)
1198 ac_prev=psdir ;;
1199 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1200 psdir=$ac_optarg ;;
1201
1202 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1203 | -silent | --silent | --silen | --sile | --sil)
1204 silent=yes ;;
1205
1206 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1207 ac_prev=sbindir ;;
1208 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1209 | --sbi=* | --sb=*)
1210 sbindir=$ac_optarg ;;
1211
1212 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1213 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1214 | --sharedst | --shareds | --shared | --share | --shar \
1215 | --sha | --sh)
1216 ac_prev=sharedstatedir ;;
1217 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1218 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1219 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1220 | --sha=* | --sh=*)
1221 sharedstatedir=$ac_optarg ;;
1222
1223 -site | --site | --sit)
1224 ac_prev=site ;;
1225 -site=* | --site=* | --sit=*)
1226 site=$ac_optarg ;;
1227
1228 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1229 ac_prev=srcdir ;;
1230 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1231 srcdir=$ac_optarg ;;
1232
1233 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1234 | --syscon | --sysco | --sysc | --sys | --sy)
1235 ac_prev=sysconfdir ;;
1236 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1237 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1238 sysconfdir=$ac_optarg ;;
1239
1240 -target | --target | --targe | --targ | --tar | --ta | --t)
1241 ac_prev=target_alias ;;
1242 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1243 target_alias=$ac_optarg ;;
1244
1245 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1246 verbose=yes ;;
1247
1248 -version | --version | --versio | --versi | --vers | -V)
1249 ac_init_version=: ;;
1250
1251 -with-* | --with-*)
1252 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1253 # Reject names that are not valid shell variable names.
1254 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1255 as_fn_error $? "invalid package name: $ac_useropt"
1256 ac_useropt_orig=$ac_useropt
1257 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1258 case $ac_user_opts in
1259 *"
1260"with_$ac_useropt"
1261"*) ;;
1262 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1263 ac_unrecognized_sep=', ';;
1264 esac
1265 eval with_$ac_useropt=\$ac_optarg ;;
1266
1267 -without-* | --without-*)
1268 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1269 # Reject names that are not valid shell variable names.
1270 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1271 as_fn_error $? "invalid package name: $ac_useropt"
1272 ac_useropt_orig=$ac_useropt
1273 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1274 case $ac_user_opts in
1275 *"
1276"with_$ac_useropt"
1277"*) ;;
1278 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1279 ac_unrecognized_sep=', ';;
1280 esac
1281 eval with_$ac_useropt=no ;;
1282
1283 --x)
1284 # Obsolete; use --with-x.
1285 with_x=yes ;;
1286
1287 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1288 | --x-incl | --x-inc | --x-in | --x-i)
1289 ac_prev=x_includes ;;
1290 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1291 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1292 x_includes=$ac_optarg ;;
1293
1294 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1295 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1296 ac_prev=x_libraries ;;
1297 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1298 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1299 x_libraries=$ac_optarg ;;
1300
1301 -*) as_fn_error $? "unrecognized option: \`$ac_option'
1302Try \`$0 --help' for more information"
1303 ;;
1304
1305 *=*)
1306 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1307 # Reject names that are not valid shell variable names.
1308 case $ac_envvar in #(
1309 '' | [0-9]* | *[!_$as_cr_alnum]* )
1310 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1311 esac
1312 eval $ac_envvar=\$ac_optarg
1313 export $ac_envvar ;;
1314
1315 *)
1316 # FIXME: should be removed in autoconf 3.0.
1317 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1318 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1319 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1320 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1321 ;;
1322
1323 esac
1324done
1325
1326if test -n "$ac_prev"; then
1327 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1328 as_fn_error $? "missing argument to $ac_option"
1329fi
1330
1331if test -n "$ac_unrecognized_opts"; then
1332 case $enable_option_checking in
1333 no) ;;
1334 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1335 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1336 esac
1337fi
1338
1339# Check all directory arguments for consistency.
1340for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1341 datadir sysconfdir sharedstatedir localstatedir includedir \
1342 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1343 libdir localedir mandir
1344do
1345 eval ac_val=\$$ac_var
1346 # Remove trailing slashes.
1347 case $ac_val in
1348 */ )
1349 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1350 eval $ac_var=\$ac_val;;
1351 esac
1352 # Be sure to have absolute directory names.
1353 case $ac_val in
1354 [\\/$]* | ?:[\\/]* ) continue;;
1355 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1356 esac
1357 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1358done
1359
1360# There might be people who depend on the old broken behavior: `$host'
1361# used to hold the argument of --host etc.
1362# FIXME: To remove some day.
1363build=$build_alias
1364host=$host_alias
1365target=$target_alias
1366
1367# FIXME: To remove some day.
1368if test "x$host_alias" != x; then
1369 if test "x$build_alias" = x; then
1370 cross_compiling=maybe
1371 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1372 If a cross compiler is detected then cross compile mode will be used" >&2
1373 elif test "x$build_alias" != "x$host_alias"; then
1374 cross_compiling=yes
1375 fi
1376fi
1377
1378ac_tool_prefix=
1379test -n "$host_alias" && ac_tool_prefix=$host_alias-
1380
1381test "$silent" = yes && exec 6>/dev/null
1382
1383
1384ac_pwd=`pwd` && test -n "$ac_pwd" &&
1385ac_ls_di=`ls -di .` &&
1386ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1387 as_fn_error $? "working directory cannot be determined"
1388test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1389 as_fn_error $? "pwd does not report name of working directory"
1390
1391
1392# Find the source files, if location was not specified.
1393if test -z "$srcdir"; then
1394 ac_srcdir_defaulted=yes
1395 # Try the directory containing this script, then the parent directory.
1396 ac_confdir=`$as_dirname -- "$as_myself" ||
1397$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1398 X"$as_myself" : 'X\(//\)[^/]' \| \
1399 X"$as_myself" : 'X\(//\)$' \| \
1400 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1401$as_echo X"$as_myself" |
1402 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1403 s//\1/
1404 q
1405 }
1406 /^X\(\/\/\)[^/].*/{
1407 s//\1/
1408 q
1409 }
1410 /^X\(\/\/\)$/{
1411 s//\1/
1412 q
1413 }
1414 /^X\(\/\).*/{
1415 s//\1/
1416 q
1417 }
1418 s/.*/./; q'`
1419 srcdir=$ac_confdir
1420 if test ! -r "$srcdir/$ac_unique_file"; then
1421 srcdir=..
1422 fi
1423else
1424 ac_srcdir_defaulted=no
1425fi
1426if test ! -r "$srcdir/$ac_unique_file"; then
1427 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1428 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1429fi
1430ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1431ac_abs_confdir=`(
1432 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1433 pwd)`
1434# When building in place, set srcdir=.
1435if test "$ac_abs_confdir" = "$ac_pwd"; then
1436 srcdir=.
1437fi
1438# Remove unnecessary trailing slashes from srcdir.
1439# Double slashes in file names in object file debugging info
1440# mess up M-x gdb in Emacs.
1441case $srcdir in
1442*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1443esac
1444for ac_var in $ac_precious_vars; do
1445 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1446 eval ac_env_${ac_var}_value=\$${ac_var}
1447 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1448 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1449done
1450
1451#
1452# Report the --help message.
1453#
1454if test "$ac_init_help" = "long"; then
1455 # Omit some internal or obsolete options to make the list less imposing.
1456 # This message is too long to be a string in the A/UX 3.1 sh.
1457 cat <<_ACEOF
1458\`configure' configures embryo 1.1.0 to adapt to many kinds of systems.
1459
1460Usage: $0 [OPTION]... [VAR=VALUE]...
1461
1462To assign environment variables (e.g., CC, CFLAGS...), specify them as
1463VAR=VALUE. See below for descriptions of some of the useful variables.
1464
1465Defaults for the options are specified in brackets.
1466
1467Configuration:
1468 -h, --help display this help and exit
1469 --help=short display options specific to this package
1470 --help=recursive display the short help of all the included packages
1471 -V, --version display version information and exit
1472 -q, --quiet, --silent do not print \`checking ...' messages
1473 --cache-file=FILE cache test results in FILE [disabled]
1474 -C, --config-cache alias for \`--cache-file=config.cache'
1475 -n, --no-create do not create output files
1476 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1477
1478Installation directories:
1479 --prefix=PREFIX install architecture-independent files in PREFIX
1480 [$ac_default_prefix]
1481 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1482 [PREFIX]
1483
1484By default, \`make install' will install all the files in
1485\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1486an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1487for instance \`--prefix=\$HOME'.
1488
1489For better control, use the options below.
1490
1491Fine tuning of the installation directories:
1492 --bindir=DIR user executables [EPREFIX/bin]
1493 --sbindir=DIR system admin executables [EPREFIX/sbin]
1494 --libexecdir=DIR program executables [EPREFIX/libexec]
1495 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1496 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1497 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1498 --libdir=DIR object code libraries [EPREFIX/lib]
1499 --includedir=DIR C header files [PREFIX/include]
1500 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1501 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1502 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1503 --infodir=DIR info documentation [DATAROOTDIR/info]
1504 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1505 --mandir=DIR man documentation [DATAROOTDIR/man]
1506 --docdir=DIR documentation root [DATAROOTDIR/doc/embryo]
1507 --htmldir=DIR html documentation [DOCDIR]
1508 --dvidir=DIR dvi documentation [DOCDIR]
1509 --pdfdir=DIR pdf documentation [DOCDIR]
1510 --psdir=DIR ps documentation [DOCDIR]
1511_ACEOF
1512
1513 cat <<\_ACEOF
1514
1515Program names:
1516 --program-prefix=PREFIX prepend PREFIX to installed program names
1517 --program-suffix=SUFFIX append SUFFIX to installed program names
1518 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1519
1520System types:
1521 --build=BUILD configure for building on BUILD [guessed]
1522 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1523_ACEOF
1524fi
1525
1526if test -n "$ac_init_help"; then
1527 case $ac_init_help in
1528 short | recursive ) echo "Configuration of embryo 1.1.0:";;
1529 esac
1530 cat <<\_ACEOF
1531
1532Optional Features:
1533 --disable-option-checking ignore unrecognized --enable/--with options
1534 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1535 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1536 --enable-silent-rules less verbose build output (undo: `make V=1')
1537 --disable-silent-rules verbose build output (undo: `make V=0')
1538 --enable-shared[=PKGS] build shared libraries [default=yes]
1539 --enable-static[=PKGS] build static libraries [default=yes]
1540 --enable-fast-install[=PKGS]
1541 optimize for fast installation [default=yes]
1542 --disable-dependency-tracking speeds up one-time build
1543 --enable-dependency-tracking do not reject slow dependency extractors
1544 --disable-libtool-lock avoid locking (might break parallel builds)
1545 --disable-embryo-cc disable building of embryo_cc
1546 --disable-doc Disable documentation build [default=enabled]
1547
1548Optional Packages:
1549 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1550 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1551 --with-pic try to use only PIC/non-PIC objects [default=use
1552 both]
1553 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1554 --with-doxygen=FILE doxygen program to use [default=doxygen]
1555
1556Some influential environment variables:
1557 CC C compiler command
1558 CFLAGS C compiler flags
1559 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1560 nonstandard directory <lib dir>
1561 LIBS libraries to pass to the linker, e.g. -l<library>
1562 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1563 you have headers in a nonstandard directory <include dir>
1564 CPP C preprocessor
1565 PKG_CONFIG path to pkg-config utility
1566 PKG_CONFIG_PATH
1567 directories to add to pkg-config's search path
1568 PKG_CONFIG_LIBDIR
1569 path overriding pkg-config's built-in search path
1570 EVIL_CFLAGS C compiler flags for EVIL, overriding pkg-config
1571 EVIL_LIBS linker flags for EVIL, overriding pkg-config
1572 EINA_CFLAGS C compiler flags for EINA, overriding pkg-config
1573 EINA_LIBS linker flags for EINA, overriding pkg-config
1574
1575Use these variables to override the choices made by `configure' or to help
1576it to find libraries and programs with nonstandard names/locations.
1577
1578Report bugs to <enlightenment-devel@lists.sourceforge.net>.
1579_ACEOF
1580ac_status=$?
1581fi
1582
1583if test "$ac_init_help" = "recursive"; then
1584 # If there are subdirs, report their specific --help.
1585 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1586 test -d "$ac_dir" ||
1587 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1588 continue
1589 ac_builddir=.
1590
1591case "$ac_dir" in
1592.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1593*)
1594 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1595 # A ".." for each directory in $ac_dir_suffix.
1596 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1597 case $ac_top_builddir_sub in
1598 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1599 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1600 esac ;;
1601esac
1602ac_abs_top_builddir=$ac_pwd
1603ac_abs_builddir=$ac_pwd$ac_dir_suffix
1604# for backward compatibility:
1605ac_top_builddir=$ac_top_build_prefix
1606
1607case $srcdir in
1608 .) # We are building in place.
1609 ac_srcdir=.
1610 ac_top_srcdir=$ac_top_builddir_sub
1611 ac_abs_top_srcdir=$ac_pwd ;;
1612 [\\/]* | ?:[\\/]* ) # Absolute name.
1613 ac_srcdir=$srcdir$ac_dir_suffix;
1614 ac_top_srcdir=$srcdir
1615 ac_abs_top_srcdir=$srcdir ;;
1616 *) # Relative name.
1617 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1618 ac_top_srcdir=$ac_top_build_prefix$srcdir
1619 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1620esac
1621ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1622
1623 cd "$ac_dir" || { ac_status=$?; continue; }
1624 # Check for guested configure.
1625 if test -f "$ac_srcdir/configure.gnu"; then
1626 echo &&
1627 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1628 elif test -f "$ac_srcdir/configure"; then
1629 echo &&
1630 $SHELL "$ac_srcdir/configure" --help=recursive
1631 else
1632 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1633 fi || ac_status=$?
1634 cd "$ac_pwd" || { ac_status=$?; break; }
1635 done
1636fi
1637
1638test -n "$ac_init_help" && exit $ac_status
1639if $ac_init_version; then
1640 cat <<\_ACEOF
1641embryo configure 1.1.0
1642generated by GNU Autoconf 2.67
1643
1644Copyright (C) 2010 Free Software Foundation, Inc.
1645This configure script is free software; the Free Software Foundation
1646gives unlimited permission to copy, distribute and modify it.
1647_ACEOF
1648 exit
1649fi
1650
1651## ------------------------ ##
1652## Autoconf initialization. ##
1653## ------------------------ ##
1654
1655# ac_fn_c_try_compile LINENO
1656# --------------------------
1657# Try to compile conftest.$ac_ext, and return whether this succeeded.
1658ac_fn_c_try_compile ()
1659{
1660 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1661 rm -f conftest.$ac_objext
1662 if { { ac_try="$ac_compile"
1663case "(($ac_try" in
1664 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1665 *) ac_try_echo=$ac_try;;
1666esac
1667eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1668$as_echo "$ac_try_echo"; } >&5
1669 (eval "$ac_compile") 2>conftest.err
1670 ac_status=$?
1671 if test -s conftest.err; then
1672 grep -v '^ *+' conftest.err >conftest.er1
1673 cat conftest.er1 >&5
1674 mv -f conftest.er1 conftest.err
1675 fi
1676 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1677 test $ac_status = 0; } && {
1678 test -z "$ac_c_werror_flag" ||
1679 test ! -s conftest.err
1680 } && test -s conftest.$ac_objext; then :
1681 ac_retval=0
1682else
1683 $as_echo "$as_me: failed program was:" >&5
1684sed 's/^/| /' conftest.$ac_ext >&5
1685
1686 ac_retval=1
1687fi
1688 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1689 as_fn_set_status $ac_retval
1690
1691} # ac_fn_c_try_compile
1692
1693# ac_fn_c_try_link LINENO
1694# -----------------------
1695# Try to link conftest.$ac_ext, and return whether this succeeded.
1696ac_fn_c_try_link ()
1697{
1698 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1699 rm -f conftest.$ac_objext conftest$ac_exeext
1700 if { { ac_try="$ac_link"
1701case "(($ac_try" in
1702 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1703 *) ac_try_echo=$ac_try;;
1704esac
1705eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1706$as_echo "$ac_try_echo"; } >&5
1707 (eval "$ac_link") 2>conftest.err
1708 ac_status=$?
1709 if test -s conftest.err; then
1710 grep -v '^ *+' conftest.err >conftest.er1
1711 cat conftest.er1 >&5
1712 mv -f conftest.er1 conftest.err
1713 fi
1714 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1715 test $ac_status = 0; } && {
1716 test -z "$ac_c_werror_flag" ||
1717 test ! -s conftest.err
1718 } && test -s conftest$ac_exeext && {
1719 test "$cross_compiling" = yes ||
1720 $as_test_x conftest$ac_exeext
1721 }; then :
1722 ac_retval=0
1723else
1724 $as_echo "$as_me: failed program was:" >&5
1725sed 's/^/| /' conftest.$ac_ext >&5
1726
1727 ac_retval=1
1728fi
1729 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1730 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1731 # interfere with the next link command; also delete a directory that is
1732 # left behind by Apple's compiler. We do this before executing the actions.
1733 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1734 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1735 as_fn_set_status $ac_retval
1736
1737} # ac_fn_c_try_link
1738
1739# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1740# -------------------------------------------------------
1741# Tests whether HEADER exists and can be compiled using the include files in
1742# INCLUDES, setting the cache variable VAR accordingly.
1743ac_fn_c_check_header_compile ()
1744{
1745 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1746 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1747$as_echo_n "checking for $2... " >&6; }
1748if eval "test \"\${$3+set}\"" = set; then :
1749 $as_echo_n "(cached) " >&6
1750else
1751 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1752/* end confdefs.h. */
1753$4
1754#include <$2>
1755_ACEOF
1756if ac_fn_c_try_compile "$LINENO"; then :
1757 eval "$3=yes"
1758else
1759 eval "$3=no"
1760fi
1761rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1762fi
1763eval ac_res=\$$3
1764 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1765$as_echo "$ac_res" >&6; }
1766 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1767
1768} # ac_fn_c_check_header_compile
1769
1770# ac_fn_c_try_cpp LINENO
1771# ----------------------
1772# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1773ac_fn_c_try_cpp ()
1774{
1775 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1776 if { { ac_try="$ac_cpp conftest.$ac_ext"
1777case "(($ac_try" in
1778 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1779 *) ac_try_echo=$ac_try;;
1780esac
1781eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1782$as_echo "$ac_try_echo"; } >&5
1783 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1784 ac_status=$?
1785 if test -s conftest.err; then
1786 grep -v '^ *+' conftest.err >conftest.er1
1787 cat conftest.er1 >&5
1788 mv -f conftest.er1 conftest.err
1789 fi
1790 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1791 test $ac_status = 0; } > conftest.i && {
1792 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1793 test ! -s conftest.err
1794 }; then :
1795 ac_retval=0
1796else
1797 $as_echo "$as_me: failed program was:" >&5
1798sed 's/^/| /' conftest.$ac_ext >&5
1799
1800 ac_retval=1
1801fi
1802 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1803 as_fn_set_status $ac_retval
1804
1805} # ac_fn_c_try_cpp
1806
1807# ac_fn_c_try_run LINENO
1808# ----------------------
1809# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1810# that executables *can* be run.
1811ac_fn_c_try_run ()
1812{
1813 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1814 if { { ac_try="$ac_link"
1815case "(($ac_try" in
1816 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1817 *) ac_try_echo=$ac_try;;
1818esac
1819eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1820$as_echo "$ac_try_echo"; } >&5
1821 (eval "$ac_link") 2>&5
1822 ac_status=$?
1823 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1824 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1825 { { case "(($ac_try" in
1826 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1827 *) ac_try_echo=$ac_try;;
1828esac
1829eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1830$as_echo "$ac_try_echo"; } >&5
1831 (eval "$ac_try") 2>&5
1832 ac_status=$?
1833 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1834 test $ac_status = 0; }; }; then :
1835 ac_retval=0
1836else
1837 $as_echo "$as_me: program exited with status $ac_status" >&5
1838 $as_echo "$as_me: failed program was:" >&5
1839sed 's/^/| /' conftest.$ac_ext >&5
1840
1841 ac_retval=$ac_status
1842fi
1843 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1844 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1845 as_fn_set_status $ac_retval
1846
1847} # ac_fn_c_try_run
1848
1849# ac_fn_c_check_func LINENO FUNC VAR
1850# ----------------------------------
1851# Tests whether FUNC exists, setting the cache variable VAR accordingly
1852ac_fn_c_check_func ()
1853{
1854 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1855 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1856$as_echo_n "checking for $2... " >&6; }
1857if eval "test \"\${$3+set}\"" = set; then :
1858 $as_echo_n "(cached) " >&6
1859else
1860 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1861/* end confdefs.h. */
1862/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1863 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1864#define $2 innocuous_$2
1865
1866/* System header to define __stub macros and hopefully few prototypes,
1867 which can conflict with char $2 (); below.
1868 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1869 <limits.h> exists even on freestanding compilers. */
1870
1871#ifdef __STDC__
1872# include <limits.h>
1873#else
1874# include <assert.h>
1875#endif
1876
1877#undef $2
1878
1879/* Override any GCC internal prototype to avoid an error.
1880 Use char because int might match the return type of a GCC
1881 builtin and then its argument prototype would still apply. */
1882#ifdef __cplusplus
1883extern "C"
1884#endif
1885char $2 ();
1886/* The GNU C library defines this for functions which it implements
1887 to always fail with ENOSYS. Some functions are actually named
1888 something starting with __ and the normal name is an alias. */
1889#if defined __stub_$2 || defined __stub___$2
1890choke me
1891#endif
1892
1893int
1894main ()
1895{
1896return $2 ();
1897 ;
1898 return 0;
1899}
1900_ACEOF
1901if ac_fn_c_try_link "$LINENO"; then :
1902 eval "$3=yes"
1903else
1904 eval "$3=no"
1905fi
1906rm -f core conftest.err conftest.$ac_objext \
1907 conftest$ac_exeext conftest.$ac_ext
1908fi
1909eval ac_res=\$$3
1910 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1911$as_echo "$ac_res" >&6; }
1912 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1913
1914} # ac_fn_c_check_func
1915
1916# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1917# -------------------------------------------------------
1918# Tests whether HEADER exists, giving a warning if it cannot be compiled using
1919# the include files in INCLUDES and setting the cache variable VAR
1920# accordingly.
1921ac_fn_c_check_header_mongrel ()
1922{
1923 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1924 if eval "test \"\${$3+set}\"" = set; then :
1925 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1926$as_echo_n "checking for $2... " >&6; }
1927if eval "test \"\${$3+set}\"" = set; then :
1928 $as_echo_n "(cached) " >&6
1929fi
1930eval ac_res=\$$3
1931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1932$as_echo "$ac_res" >&6; }
1933else
1934 # Is the header compilable?
1935{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1936$as_echo_n "checking $2 usability... " >&6; }
1937cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1938/* end confdefs.h. */
1939$4
1940#include <$2>
1941_ACEOF
1942if ac_fn_c_try_compile "$LINENO"; then :
1943 ac_header_compiler=yes
1944else
1945 ac_header_compiler=no
1946fi
1947rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1948{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1949$as_echo "$ac_header_compiler" >&6; }
1950
1951# Is the header present?
1952{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1953$as_echo_n "checking $2 presence... " >&6; }
1954cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1955/* end confdefs.h. */
1956#include <$2>
1957_ACEOF
1958if ac_fn_c_try_cpp "$LINENO"; then :
1959 ac_header_preproc=yes
1960else
1961 ac_header_preproc=no
1962fi
1963rm -f conftest.err conftest.i conftest.$ac_ext
1964{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1965$as_echo "$ac_header_preproc" >&6; }
1966
1967# So? What about this header?
1968case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1969 yes:no: )
1970 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1971$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1972 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1973$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1974 ;;
1975 no:yes:* )
1976 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1977$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1978 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
1979$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
1980 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1981$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1982 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
1983$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
1984 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1985$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1986( $as_echo "## -------------------------------------------------------- ##
1987## Report this to enlightenment-devel@lists.sourceforge.net ##
1988## -------------------------------------------------------- ##"
1989 ) | sed "s/^/$as_me: WARNING: /" >&2
1990 ;;
1991esac
1992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1993$as_echo_n "checking for $2... " >&6; }
1994if eval "test \"\${$3+set}\"" = set; then :
1995 $as_echo_n "(cached) " >&6
1996else
1997 eval "$3=\$ac_header_compiler"
1998fi
1999eval ac_res=\$$3
2000 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2001$as_echo "$ac_res" >&6; }
2002fi
2003 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2004
2005} # ac_fn_c_check_header_mongrel
2006cat >config.log <<_ACEOF
2007This file contains any messages produced by compilers while
2008running configure, to aid debugging if configure makes a mistake.
2009
2010It was created by embryo $as_me 1.1.0, which was
2011generated by GNU Autoconf 2.67. Invocation command line was
2012
2013 $ $0 $@
2014
2015_ACEOF
2016exec 5>>config.log
2017{
2018cat <<_ASUNAME
2019## --------- ##
2020## Platform. ##
2021## --------- ##
2022
2023hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2024uname -m = `(uname -m) 2>/dev/null || echo unknown`
2025uname -r = `(uname -r) 2>/dev/null || echo unknown`
2026uname -s = `(uname -s) 2>/dev/null || echo unknown`
2027uname -v = `(uname -v) 2>/dev/null || echo unknown`
2028
2029/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2030/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
2031
2032/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
2033/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
2034/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2035/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
2036/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
2037/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
2038/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
2039
2040_ASUNAME
2041
2042as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2043for as_dir in $PATH
2044do
2045 IFS=$as_save_IFS
2046 test -z "$as_dir" && as_dir=.
2047 $as_echo "PATH: $as_dir"
2048 done
2049IFS=$as_save_IFS
2050
2051} >&5
2052
2053cat >&5 <<_ACEOF
2054
2055
2056## ----------- ##
2057## Core tests. ##
2058## ----------- ##
2059
2060_ACEOF
2061
2062
2063# Keep a trace of the command line.
2064# Strip out --no-create and --no-recursion so they do not pile up.
2065# Strip out --silent because we don't want to record it for future runs.
2066# Also quote any args containing shell meta-characters.
2067# Make two passes to allow for proper duplicate-argument suppression.
2068ac_configure_args=
2069ac_configure_args0=
2070ac_configure_args1=
2071ac_must_keep_next=false
2072for ac_pass in 1 2
2073do
2074 for ac_arg
2075 do
2076 case $ac_arg in
2077 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2078 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2079 | -silent | --silent | --silen | --sile | --sil)
2080 continue ;;
2081 *\'*)
2082 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2083 esac
2084 case $ac_pass in
2085 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2086 2)
2087 as_fn_append ac_configure_args1 " '$ac_arg'"
2088 if test $ac_must_keep_next = true; then
2089 ac_must_keep_next=false # Got value, back to normal.
2090 else
2091 case $ac_arg in
2092 *=* | --config-cache | -C | -disable-* | --disable-* \
2093 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2094 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2095 | -with-* | --with-* | -without-* | --without-* | --x)
2096 case "$ac_configure_args0 " in
2097 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2098 esac
2099 ;;
2100 -* ) ac_must_keep_next=true ;;
2101 esac
2102 fi
2103 as_fn_append ac_configure_args " '$ac_arg'"
2104 ;;
2105 esac
2106 done
2107done
2108{ ac_configure_args0=; unset ac_configure_args0;}
2109{ ac_configure_args1=; unset ac_configure_args1;}
2110
2111# When interrupted or exit'd, cleanup temporary files, and complete
2112# config.log. We remove comments because anyway the quotes in there
2113# would cause problems or look ugly.
2114# WARNING: Use '\'' to represent an apostrophe within the trap.
2115# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2116trap 'exit_status=$?
2117 # Save into config.log some information that might help in debugging.
2118 {
2119 echo
2120
2121 $as_echo "## ---------------- ##
2122## Cache variables. ##
2123## ---------------- ##"
2124 echo
2125 # The following way of writing the cache mishandles newlines in values,
2126(
2127 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2128 eval ac_val=\$$ac_var
2129 case $ac_val in #(
2130 *${as_nl}*)
2131 case $ac_var in #(
2132 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2133$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2134 esac
2135 case $ac_var in #(
2136 _ | IFS | as_nl) ;; #(
2137 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2138 *) { eval $ac_var=; unset $ac_var;} ;;
2139 esac ;;
2140 esac
2141 done
2142 (set) 2>&1 |
2143 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2144 *${as_nl}ac_space=\ *)
2145 sed -n \
2146 "s/'\''/'\''\\\\'\'''\''/g;
2147 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2148 ;; #(
2149 *)
2150 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2151 ;;
2152 esac |
2153 sort
2154)
2155 echo
2156
2157 $as_echo "## ----------------- ##
2158## Output variables. ##
2159## ----------------- ##"
2160 echo
2161 for ac_var in $ac_subst_vars
2162 do
2163 eval ac_val=\$$ac_var
2164 case $ac_val in
2165 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2166 esac
2167 $as_echo "$ac_var='\''$ac_val'\''"
2168 done | sort
2169 echo
2170
2171 if test -n "$ac_subst_files"; then
2172 $as_echo "## ------------------- ##
2173## File substitutions. ##
2174## ------------------- ##"
2175 echo
2176 for ac_var in $ac_subst_files
2177 do
2178 eval ac_val=\$$ac_var
2179 case $ac_val in
2180 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2181 esac
2182 $as_echo "$ac_var='\''$ac_val'\''"
2183 done | sort
2184 echo
2185 fi
2186
2187 if test -s confdefs.h; then
2188 $as_echo "## ----------- ##
2189## confdefs.h. ##
2190## ----------- ##"
2191 echo
2192 cat confdefs.h
2193 echo
2194 fi
2195 test "$ac_signal" != 0 &&
2196 $as_echo "$as_me: caught signal $ac_signal"
2197 $as_echo "$as_me: exit $exit_status"
2198 } >&5
2199 rm -f core *.core core.conftest.* &&
2200 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2201 exit $exit_status
2202' 0
2203for ac_signal in 1 2 13 15; do
2204 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2205done
2206ac_signal=0
2207
2208# confdefs.h avoids OS command line length limits that DEFS can exceed.
2209rm -f -r conftest* confdefs.h
2210
2211$as_echo "/* confdefs.h */" > confdefs.h
2212
2213# Predefined preprocessor variables.
2214
2215cat >>confdefs.h <<_ACEOF
2216#define PACKAGE_NAME "$PACKAGE_NAME"
2217_ACEOF
2218
2219cat >>confdefs.h <<_ACEOF
2220#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2221_ACEOF
2222
2223cat >>confdefs.h <<_ACEOF
2224#define PACKAGE_VERSION "$PACKAGE_VERSION"
2225_ACEOF
2226
2227cat >>confdefs.h <<_ACEOF
2228#define PACKAGE_STRING "$PACKAGE_STRING"
2229_ACEOF
2230
2231cat >>confdefs.h <<_ACEOF
2232#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2233_ACEOF
2234
2235cat >>confdefs.h <<_ACEOF
2236#define PACKAGE_URL "$PACKAGE_URL"
2237_ACEOF
2238
2239
2240# Let the site file select an alternate cache file if it wants to.
2241# Prefer an explicitly selected file to automatically selected ones.
2242ac_site_file1=NONE
2243ac_site_file2=NONE
2244if test -n "$CONFIG_SITE"; then
2245 # We do not want a PATH search for config.site.
2246 case $CONFIG_SITE in #((
2247 -*) ac_site_file1=./$CONFIG_SITE;;
2248 */*) ac_site_file1=$CONFIG_SITE;;
2249 *) ac_site_file1=./$CONFIG_SITE;;
2250 esac
2251elif test "x$prefix" != xNONE; then
2252 ac_site_file1=$prefix/share/config.site
2253 ac_site_file2=$prefix/etc/config.site
2254else
2255 ac_site_file1=$ac_default_prefix/share/config.site
2256 ac_site_file2=$ac_default_prefix/etc/config.site
2257fi
2258for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2259do
2260 test "x$ac_site_file" = xNONE && continue
2261 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2262 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2263$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2264 sed 's/^/| /' "$ac_site_file" >&5
2265 . "$ac_site_file" \
2266 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2267$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2268as_fn_error $? "failed to load site script $ac_site_file
2269See \`config.log' for more details" "$LINENO" 5 ; }
2270 fi
2271done
2272
2273if test -r "$cache_file"; then
2274 # Some versions of bash will fail to source /dev/null (special files
2275 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
2276 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2277 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2278$as_echo "$as_me: loading cache $cache_file" >&6;}
2279 case $cache_file in
2280 [\\/]* | ?:[\\/]* ) . "$cache_file";;
2281 *) . "./$cache_file";;
2282 esac
2283 fi
2284else
2285 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2286$as_echo "$as_me: creating cache $cache_file" >&6;}
2287 >$cache_file
2288fi
2289
2290# Check that the precious variables saved in the cache have kept the same
2291# value.
2292ac_cache_corrupted=false
2293for ac_var in $ac_precious_vars; do
2294 eval ac_old_set=\$ac_cv_env_${ac_var}_set
2295 eval ac_new_set=\$ac_env_${ac_var}_set
2296 eval ac_old_val=\$ac_cv_env_${ac_var}_value
2297 eval ac_new_val=\$ac_env_${ac_var}_value
2298 case $ac_old_set,$ac_new_set in
2299 set,)
2300 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2301$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2302 ac_cache_corrupted=: ;;
2303 ,set)
2304 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2305$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2306 ac_cache_corrupted=: ;;
2307 ,);;
2308 *)
2309 if test "x$ac_old_val" != "x$ac_new_val"; then
2310 # differences in whitespace do not lead to failure.
2311 ac_old_val_w=`echo x $ac_old_val`
2312 ac_new_val_w=`echo x $ac_new_val`
2313 if test "$ac_old_val_w" != "$ac_new_val_w"; then
2314 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2315$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2316 ac_cache_corrupted=:
2317 else
2318 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2319$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2320 eval $ac_var=\$ac_old_val
2321 fi
2322 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
2323$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
2324 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
2325$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
2326 fi;;
2327 esac
2328 # Pass precious variables to config.status.
2329 if test "$ac_new_set" = set; then
2330 case $ac_new_val in
2331 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2332 *) ac_arg=$ac_var=$ac_new_val ;;
2333 esac
2334 case " $ac_configure_args " in
2335 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2336 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2337 esac
2338 fi
2339done
2340if $ac_cache_corrupted; then
2341 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2342$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2343 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2344$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2345 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2346fi
2347## -------------------- ##
2348## Main body of script. ##
2349## -------------------- ##
2350
2351ac_ext=c
2352ac_cpp='$CPP $CPPFLAGS'
2353ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2354ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2355ac_compiler_gnu=$ac_cv_c_compiler_gnu
2356
2357
2358
2359
2360
2361
2362ac_config_headers="$ac_config_headers config.h"
2363
2364
2365
2366
2367am__api_version='1.11'
2368
2369ac_aux_dir=
2370for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2371 if test -f "$ac_dir/install-sh"; then
2372 ac_aux_dir=$ac_dir
2373 ac_install_sh="$ac_aux_dir/install-sh -c"
2374 break
2375 elif test -f "$ac_dir/install.sh"; then
2376 ac_aux_dir=$ac_dir
2377 ac_install_sh="$ac_aux_dir/install.sh -c"
2378 break
2379 elif test -f "$ac_dir/shtool"; then
2380 ac_aux_dir=$ac_dir
2381 ac_install_sh="$ac_aux_dir/shtool install -c"
2382 break
2383 fi
2384done
2385if test -z "$ac_aux_dir"; then
2386 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
2387fi
2388
2389# These three variables are undocumented and unsupported,
2390# and are intended to be withdrawn in a future Autoconf release.
2391# They can cause serious problems if a builder's source tree is in a directory
2392# whose full name contains unusual characters.
2393ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
2394ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
2395ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
2396
2397
2398# Find a good install program. We prefer a C program (faster),
2399# so one script is as good as another. But avoid the broken or
2400# incompatible versions:
2401# SysV /etc/install, /usr/sbin/install
2402# SunOS /usr/etc/install
2403# IRIX /sbin/install
2404# AIX /bin/install
2405# AmigaOS /C/install, which installs bootblocks on floppy discs
2406# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2407# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2408# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2409# OS/2's system install, which has a completely different semantic
2410# ./install, which can be erroneously created by make from ./install.sh.
2411# Reject install programs that cannot install multiple files.
2412{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
2413$as_echo_n "checking for a BSD-compatible install... " >&6; }
2414if test -z "$INSTALL"; then
2415if test "${ac_cv_path_install+set}" = set; then :
2416 $as_echo_n "(cached) " >&6
2417else
2418 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2419for as_dir in $PATH
2420do
2421 IFS=$as_save_IFS
2422 test -z "$as_dir" && as_dir=.
2423 # Account for people who put trailing slashes in PATH elements.
2424case $as_dir/ in #((
2425 ./ | .// | /[cC]/* | \
2426 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2427 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
2428 /usr/ucb/* ) ;;
2429 *)
2430 # OSF1 and SCO ODT 3.0 have their own names for install.
2431 # Don't use installbsd from OSF since it installs stuff as root
2432 # by default.
2433 for ac_prog in ginstall scoinst install; do
2434 for ac_exec_ext in '' $ac_executable_extensions; do
2435 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2436 if test $ac_prog = install &&
2437 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2438 # AIX install. It has an incompatible calling convention.
2439 :
2440 elif test $ac_prog = install &&
2441 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2442 # program-specific install script used by HP pwplus--don't use.
2443 :
2444 else
2445 rm -rf conftest.one conftest.two conftest.dir
2446 echo one > conftest.one
2447 echo two > conftest.two
2448 mkdir conftest.dir
2449 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2450 test -s conftest.one && test -s conftest.two &&
2451 test -s conftest.dir/conftest.one &&
2452 test -s conftest.dir/conftest.two
2453 then
2454 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2455 break 3
2456 fi
2457 fi
2458 fi
2459 done
2460 done
2461 ;;
2462esac
2463
2464 done
2465IFS=$as_save_IFS
2466
2467rm -rf conftest.one conftest.two conftest.dir
2468
2469fi
2470 if test "${ac_cv_path_install+set}" = set; then
2471 INSTALL=$ac_cv_path_install
2472 else
2473 # As a last resort, use the slow shell script. Don't cache a
2474 # value for INSTALL within a source directory, because that will
2475 # break other packages using the cache if that directory is
2476 # removed, or if the value is a relative name.
2477 INSTALL=$ac_install_sh
2478 fi
2479fi
2480{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
2481$as_echo "$INSTALL" >&6; }
2482
2483# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2484# It thinks the first close brace ends the variable substitution.
2485test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2486
2487test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2488
2489test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2490
2491{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2492$as_echo_n "checking whether build environment is sane... " >&6; }
2493# Just in case
2494sleep 1
2495echo timestamp > conftest.file
2496# Reject unsafe characters in $srcdir or the absolute working directory
2497# name. Accept space and tab only in the latter.
2498am_lf='
2499'
2500case `pwd` in
2501 *[\\\"\#\$\&\'\`$am_lf]*)
2502 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
2503esac
2504case $srcdir in
2505 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2506 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
2507esac
2508
2509# Do `set' in a subshell so we don't clobber the current shell's
2510# arguments. Must try -L first in case configure is actually a
2511# symlink; some systems play weird games with the mod time of symlinks
2512# (eg FreeBSD returns the mod time of the symlink's containing
2513# directory).
2514if (
2515 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2516 if test "$*" = "X"; then
2517 # -L didn't work.
2518 set X `ls -t "$srcdir/configure" conftest.file`
2519 fi
2520 rm -f conftest.file
2521 if test "$*" != "X $srcdir/configure conftest.file" \
2522 && test "$*" != "X conftest.file $srcdir/configure"; then
2523
2524 # If neither matched, then we have a broken ls. This can happen
2525 # if, for instance, CONFIG_SHELL is bash and it inherits a
2526 # broken ls alias from the environment. This has actually
2527 # happened. Such a system could not be considered "sane".
2528 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
2529alias in your environment" "$LINENO" 5
2530 fi
2531
2532 test "$2" = conftest.file
2533 )
2534then
2535 # Ok.
2536 :
2537else
2538 as_fn_error $? "newly created file is older than distributed files!
2539Check your system clock" "$LINENO" 5
2540fi
2541{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2542$as_echo "yes" >&6; }
2543test "$program_prefix" != NONE &&
2544 program_transform_name="s&^&$program_prefix&;$program_transform_name"
2545# Use a double $ so make ignores it.
2546test "$program_suffix" != NONE &&
2547 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2548# Double any \ or $.
2549# By default was `s,x,x', remove it if useless.
2550ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2551program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2552
2553# expand $ac_aux_dir to an absolute path
2554am_aux_dir=`cd $ac_aux_dir && pwd`
2555
2556if test x"${MISSING+set}" != xset; then
2557 case $am_aux_dir in
2558 *\ * | *\ *)
2559 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2560 *)
2561 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2562 esac
2563fi
2564# Use eval to expand $SHELL
2565if eval "$MISSING --run true"; then
2566 am_missing_run="$MISSING --run "
2567else
2568 am_missing_run=
2569 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
2570$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
2571fi
2572
2573if test x"${install_sh}" != xset; then
2574 case $am_aux_dir in
2575 *\ * | *\ *)
2576 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2577 *)
2578 install_sh="\${SHELL} $am_aux_dir/install-sh"
2579 esac
2580fi
2581
2582# Installed binaries are usually stripped using `strip' when the user
2583# run `make install-strip'. However `strip' might not be the right
2584# tool to use in cross-compilation environments, therefore Automake
2585# will honor the `STRIP' environment variable to overrule this program.
2586if test "$cross_compiling" != no; then
2587 if test -n "$ac_tool_prefix"; then
2588 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2589set dummy ${ac_tool_prefix}strip; ac_word=$2
2590{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2591$as_echo_n "checking for $ac_word... " >&6; }
2592if test "${ac_cv_prog_STRIP+set}" = set; then :
2593 $as_echo_n "(cached) " >&6
2594else
2595 if test -n "$STRIP"; then
2596 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2597else
2598as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2599for as_dir in $PATH
2600do
2601 IFS=$as_save_IFS
2602 test -z "$as_dir" && as_dir=.
2603 for ac_exec_ext in '' $ac_executable_extensions; do
2604 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2605 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2606 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2607 break 2
2608 fi
2609done
2610 done
2611IFS=$as_save_IFS
2612
2613fi
2614fi
2615STRIP=$ac_cv_prog_STRIP
2616if test -n "$STRIP"; then
2617 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
2618$as_echo "$STRIP" >&6; }
2619else
2620 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2621$as_echo "no" >&6; }
2622fi
2623
2624
2625fi
2626if test -z "$ac_cv_prog_STRIP"; then
2627 ac_ct_STRIP=$STRIP
2628 # Extract the first word of "strip", so it can be a program name with args.
2629set dummy strip; ac_word=$2
2630{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2631$as_echo_n "checking for $ac_word... " >&6; }
2632if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
2633 $as_echo_n "(cached) " >&6
2634else
2635 if test -n "$ac_ct_STRIP"; then
2636 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
2637else
2638as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2639for as_dir in $PATH
2640do
2641 IFS=$as_save_IFS
2642 test -z "$as_dir" && as_dir=.
2643 for ac_exec_ext in '' $ac_executable_extensions; do
2644 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2645 ac_cv_prog_ac_ct_STRIP="strip"
2646 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2647 break 2
2648 fi
2649done
2650 done
2651IFS=$as_save_IFS
2652
2653fi
2654fi
2655ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
2656if test -n "$ac_ct_STRIP"; then
2657 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
2658$as_echo "$ac_ct_STRIP" >&6; }
2659else
2660 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2661$as_echo "no" >&6; }
2662fi
2663
2664 if test "x$ac_ct_STRIP" = x; then
2665 STRIP=":"
2666 else
2667 case $cross_compiling:$ac_tool_warned in
2668yes:)
2669{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2670$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2671ac_tool_warned=yes ;;
2672esac
2673 STRIP=$ac_ct_STRIP
2674 fi
2675else
2676 STRIP="$ac_cv_prog_STRIP"
2677fi
2678
2679fi
2680INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2681
2682{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
2683$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
2684if test -z "$MKDIR_P"; then
2685 if test "${ac_cv_path_mkdir+set}" = set; then :
2686 $as_echo_n "(cached) " >&6
2687else
2688 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2689for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
2690do
2691 IFS=$as_save_IFS
2692 test -z "$as_dir" && as_dir=.
2693 for ac_prog in mkdir gmkdir; do
2694 for ac_exec_ext in '' $ac_executable_extensions; do
2695 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
2696 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2697 'mkdir (GNU coreutils) '* | \
2698 'mkdir (coreutils) '* | \
2699 'mkdir (fileutils) '4.1*)
2700 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
2701 break 3;;
2702 esac
2703 done
2704 done
2705 done
2706IFS=$as_save_IFS
2707
2708fi
2709
2710 test -d ./--version && rmdir ./--version
2711 if test "${ac_cv_path_mkdir+set}" = set; then
2712 MKDIR_P="$ac_cv_path_mkdir -p"
2713 else
2714 # As a last resort, use the slow shell script. Don't cache a
2715 # value for MKDIR_P within a source directory, because that will
2716 # break other packages using the cache if that directory is
2717 # removed, or if the value is a relative name.
2718 MKDIR_P="$ac_install_sh -d"
2719 fi
2720fi
2721{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
2722$as_echo "$MKDIR_P" >&6; }
2723
2724mkdir_p="$MKDIR_P"
2725case $mkdir_p in
2726 [\\/$]* | ?:[\\/]*) ;;
2727 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2728esac
2729
2730for ac_prog in gawk mawk nawk awk
2731do
2732 # Extract the first word of "$ac_prog", so it can be a program name with args.
2733set dummy $ac_prog; ac_word=$2
2734{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2735$as_echo_n "checking for $ac_word... " >&6; }
2736if test "${ac_cv_prog_AWK+set}" = set; then :
2737 $as_echo_n "(cached) " >&6
2738else
2739 if test -n "$AWK"; then
2740 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2741else
2742as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2743for as_dir in $PATH
2744do
2745 IFS=$as_save_IFS
2746 test -z "$as_dir" && as_dir=.
2747 for ac_exec_ext in '' $ac_executable_extensions; do
2748 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2749 ac_cv_prog_AWK="$ac_prog"
2750 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2751 break 2
2752 fi
2753done
2754 done
2755IFS=$as_save_IFS
2756
2757fi
2758fi
2759AWK=$ac_cv_prog_AWK
2760if test -n "$AWK"; then
2761 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
2762$as_echo "$AWK" >&6; }
2763else
2764 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2765$as_echo "no" >&6; }
2766fi
2767
2768
2769 test -n "$AWK" && break
2770done
2771
2772{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2773$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
2774set x ${MAKE-make}
2775ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2776if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
2777 $as_echo_n "(cached) " >&6
2778else
2779 cat >conftest.make <<\_ACEOF
2780SHELL = /bin/sh
2781all:
2782 @echo '@@@%%%=$(MAKE)=@@@%%%'
2783_ACEOF
2784# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
2785case `${MAKE-make} -f conftest.make 2>/dev/null` in
2786 *@@@%%%=?*=@@@%%%*)
2787 eval ac_cv_prog_make_${ac_make}_set=yes;;
2788 *)
2789 eval ac_cv_prog_make_${ac_make}_set=no;;
2790esac
2791rm -f conftest.make
2792fi
2793if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2794 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2795$as_echo "yes" >&6; }
2796 SET_MAKE=
2797else
2798 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2799$as_echo "no" >&6; }
2800 SET_MAKE="MAKE=${MAKE-make}"
2801fi
2802
2803rm -rf .tst 2>/dev/null
2804mkdir .tst 2>/dev/null
2805if test -d .tst; then
2806 am__leading_dot=.
2807else
2808 am__leading_dot=_
2809fi
2810rmdir .tst 2>/dev/null
2811
2812if test "`cd $srcdir && pwd`" != "`pwd`"; then
2813 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2814 # is not polluted with repeated "-I."
2815 am__isrc=' -I$(srcdir)'
2816 # test to see if srcdir already configured
2817 if test -f $srcdir/config.status; then
2818 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
2819 fi
2820fi
2821
2822# test whether we have cygpath
2823if test -z "$CYGPATH_W"; then
2824 if (cygpath --version) >/dev/null 2>/dev/null; then
2825 CYGPATH_W='cygpath -w'
2826 else
2827 CYGPATH_W=echo
2828 fi
2829fi
2830
2831
2832# Define the identity of the package.
2833 PACKAGE='embryo'
2834 VERSION='1.1.0'
2835
2836
2837cat >>confdefs.h <<_ACEOF
2838#define PACKAGE "$PACKAGE"
2839_ACEOF
2840
2841
2842cat >>confdefs.h <<_ACEOF
2843#define VERSION "$VERSION"
2844_ACEOF
2845
2846# Some tools Automake needs.
2847
2848ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
2849
2850
2851AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
2852
2853
2854AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
2855
2856
2857AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2858
2859
2860MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2861
2862# We need awk for the "check" target. The system "awk" is bad on
2863# some platforms.
2864# Always define AMTAR for backward compatibility.
2865
2866AMTAR=${AMTAR-"${am_missing_run}tar"}
2867
2868am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
2869
2870
2871
2872
2873
2874# Check whether --enable-silent-rules was given.
2875if test "${enable_silent_rules+set}" = set; then :
2876 enableval=$enable_silent_rules;
2877fi
2878
2879case $enable_silent_rules in
2880yes) AM_DEFAULT_VERBOSITY=0;;
2881no) AM_DEFAULT_VERBOSITY=1;;
2882*) AM_DEFAULT_VERBOSITY=0;;
2883esac
2884AM_BACKSLASH='\'
2885
2886
2887# Make sure we can run config.sub.
2888$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2889 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2890
2891{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2892$as_echo_n "checking build system type... " >&6; }
2893if test "${ac_cv_build+set}" = set; then :
2894 $as_echo_n "(cached) " >&6
2895else
2896 ac_build_alias=$build_alias
2897test "x$ac_build_alias" = x &&
2898 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2899test "x$ac_build_alias" = x &&
2900 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2901ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2902 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2903
2904fi
2905{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2906$as_echo "$ac_cv_build" >&6; }
2907case $ac_cv_build in
2908*-*-*) ;;
2909*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
2910esac
2911build=$ac_cv_build
2912ac_save_IFS=$IFS; IFS='-'
2913set x $ac_cv_build
2914shift
2915build_cpu=$1
2916build_vendor=$2
2917shift; shift
2918# Remember, the first character of IFS is used to create $*,
2919# except with old shells:
2920build_os=$*
2921IFS=$ac_save_IFS
2922case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2923
2924
2925{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2926$as_echo_n "checking host system type... " >&6; }
2927if test "${ac_cv_host+set}" = set; then :
2928 $as_echo_n "(cached) " >&6
2929else
2930 if test "x$host_alias" = x; then
2931 ac_cv_host=$ac_cv_build
2932else
2933 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2934 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2935fi
2936
2937fi
2938{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2939$as_echo "$ac_cv_host" >&6; }
2940case $ac_cv_host in
2941*-*-*) ;;
2942*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
2943esac
2944host=$ac_cv_host
2945ac_save_IFS=$IFS; IFS='-'
2946set x $ac_cv_host
2947shift
2948host_cpu=$1
2949host_vendor=$2
2950shift; shift
2951# Remember, the first character of IFS is used to create $*,
2952# except with old shells:
2953host_os=$*
2954IFS=$ac_save_IFS
2955case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2956
2957
2958enable_win32_dll=yes
2959
2960case $host in
2961*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
2962 if test -n "$ac_tool_prefix"; then
2963 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
2964set dummy ${ac_tool_prefix}as; ac_word=$2
2965{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2966$as_echo_n "checking for $ac_word... " >&6; }
2967if test "${ac_cv_prog_AS+set}" = set; then :
2968 $as_echo_n "(cached) " >&6
2969else
2970 if test -n "$AS"; then
2971 ac_cv_prog_AS="$AS" # Let the user override the test.
2972else
2973as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2974for as_dir in $PATH
2975do
2976 IFS=$as_save_IFS
2977 test -z "$as_dir" && as_dir=.
2978 for ac_exec_ext in '' $ac_executable_extensions; do
2979 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2980 ac_cv_prog_AS="${ac_tool_prefix}as"
2981 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2982 break 2
2983 fi
2984done
2985 done
2986IFS=$as_save_IFS
2987
2988fi
2989fi
2990AS=$ac_cv_prog_AS
2991if test -n "$AS"; then
2992 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
2993$as_echo "$AS" >&6; }
2994else
2995 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2996$as_echo "no" >&6; }
2997fi
2998
2999
3000fi
3001if test -z "$ac_cv_prog_AS"; then
3002 ac_ct_AS=$AS
3003 # Extract the first word of "as", so it can be a program name with args.
3004set dummy as; ac_word=$2
3005{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3006$as_echo_n "checking for $ac_word... " >&6; }
3007if test "${ac_cv_prog_ac_ct_AS+set}" = set; then :
3008 $as_echo_n "(cached) " >&6
3009else
3010 if test -n "$ac_ct_AS"; then
3011 ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
3012else
3013as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3014for as_dir in $PATH
3015do
3016 IFS=$as_save_IFS
3017 test -z "$as_dir" && as_dir=.
3018 for ac_exec_ext in '' $ac_executable_extensions; do
3019 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3020 ac_cv_prog_ac_ct_AS="as"
3021 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3022 break 2
3023 fi
3024done
3025 done
3026IFS=$as_save_IFS
3027
3028fi
3029fi
3030ac_ct_AS=$ac_cv_prog_ac_ct_AS
3031if test -n "$ac_ct_AS"; then
3032 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
3033$as_echo "$ac_ct_AS" >&6; }
3034else
3035 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3036$as_echo "no" >&6; }
3037fi
3038
3039 if test "x$ac_ct_AS" = x; then
3040 AS="false"
3041 else
3042 case $cross_compiling:$ac_tool_warned in
3043yes:)
3044{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3045$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3046ac_tool_warned=yes ;;
3047esac
3048 AS=$ac_ct_AS
3049 fi
3050else
3051 AS="$ac_cv_prog_AS"
3052fi
3053
3054 if test -n "$ac_tool_prefix"; then
3055 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3056set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3057{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3058$as_echo_n "checking for $ac_word... " >&6; }
3059if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
3060 $as_echo_n "(cached) " >&6
3061else
3062 if test -n "$DLLTOOL"; then
3063 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3064else
3065as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3066for as_dir in $PATH
3067do
3068 IFS=$as_save_IFS
3069 test -z "$as_dir" && as_dir=.
3070 for ac_exec_ext in '' $ac_executable_extensions; do
3071 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3072 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3073 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3074 break 2
3075 fi
3076done
3077 done
3078IFS=$as_save_IFS
3079
3080fi
3081fi
3082DLLTOOL=$ac_cv_prog_DLLTOOL
3083if test -n "$DLLTOOL"; then
3084 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
3085$as_echo "$DLLTOOL" >&6; }
3086else
3087 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3088$as_echo "no" >&6; }
3089fi
3090
3091
3092fi
3093if test -z "$ac_cv_prog_DLLTOOL"; then
3094 ac_ct_DLLTOOL=$DLLTOOL
3095 # Extract the first word of "dlltool", so it can be a program name with args.
3096set dummy dlltool; ac_word=$2
3097{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3098$as_echo_n "checking for $ac_word... " >&6; }
3099if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
3100 $as_echo_n "(cached) " >&6
3101else
3102 if test -n "$ac_ct_DLLTOOL"; then
3103 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
3104else
3105as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3106for as_dir in $PATH
3107do
3108 IFS=$as_save_IFS
3109 test -z "$as_dir" && as_dir=.
3110 for ac_exec_ext in '' $ac_executable_extensions; do
3111 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3112 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
3113 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3114 break 2
3115 fi
3116done
3117 done
3118IFS=$as_save_IFS
3119
3120fi
3121fi
3122ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
3123if test -n "$ac_ct_DLLTOOL"; then
3124 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
3125$as_echo "$ac_ct_DLLTOOL" >&6; }
3126else
3127 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3128$as_echo "no" >&6; }
3129fi
3130
3131 if test "x$ac_ct_DLLTOOL" = x; then
3132 DLLTOOL="false"
3133 else
3134 case $cross_compiling:$ac_tool_warned in
3135yes:)
3136{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3137$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3138ac_tool_warned=yes ;;
3139esac
3140 DLLTOOL=$ac_ct_DLLTOOL
3141 fi
3142else
3143 DLLTOOL="$ac_cv_prog_DLLTOOL"
3144fi
3145
3146 if test -n "$ac_tool_prefix"; then
3147 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3148set dummy ${ac_tool_prefix}objdump; ac_word=$2
3149{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3150$as_echo_n "checking for $ac_word... " >&6; }
3151if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
3152 $as_echo_n "(cached) " >&6
3153else
3154 if test -n "$OBJDUMP"; then
3155 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3156else
3157as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3158for as_dir in $PATH
3159do
3160 IFS=$as_save_IFS
3161 test -z "$as_dir" && as_dir=.
3162 for ac_exec_ext in '' $ac_executable_extensions; do
3163 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3164 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3165 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3166 break 2
3167 fi
3168done
3169 done
3170IFS=$as_save_IFS
3171
3172fi
3173fi
3174OBJDUMP=$ac_cv_prog_OBJDUMP
3175if test -n "$OBJDUMP"; then
3176 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
3177$as_echo "$OBJDUMP" >&6; }
3178else
3179 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3180$as_echo "no" >&6; }
3181fi
3182
3183
3184fi
3185if test -z "$ac_cv_prog_OBJDUMP"; then
3186 ac_ct_OBJDUMP=$OBJDUMP
3187 # Extract the first word of "objdump", so it can be a program name with args.
3188set dummy objdump; ac_word=$2
3189{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3190$as_echo_n "checking for $ac_word... " >&6; }
3191if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
3192 $as_echo_n "(cached) " >&6
3193else
3194 if test -n "$ac_ct_OBJDUMP"; then
3195 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
3196else
3197as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3198for as_dir in $PATH
3199do
3200 IFS=$as_save_IFS
3201 test -z "$as_dir" && as_dir=.
3202 for ac_exec_ext in '' $ac_executable_extensions; do
3203 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3204 ac_cv_prog_ac_ct_OBJDUMP="objdump"
3205 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3206 break 2
3207 fi
3208done
3209 done
3210IFS=$as_save_IFS
3211
3212fi
3213fi
3214ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
3215if test -n "$ac_ct_OBJDUMP"; then
3216 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
3217$as_echo "$ac_ct_OBJDUMP" >&6; }
3218else
3219 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3220$as_echo "no" >&6; }
3221fi
3222
3223 if test "x$ac_ct_OBJDUMP" = x; then
3224 OBJDUMP="false"
3225 else
3226 case $cross_compiling:$ac_tool_warned in
3227yes:)
3228{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3229$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3230ac_tool_warned=yes ;;
3231esac
3232 OBJDUMP=$ac_ct_OBJDUMP
3233 fi
3234else
3235 OBJDUMP="$ac_cv_prog_OBJDUMP"
3236fi
3237
3238 ;;
3239esac
3240
3241test -z "$AS" && AS=as
3242
3243
3244
3245
3246
3247test -z "$DLLTOOL" && DLLTOOL=dlltool
3248
3249
3250
3251
3252
3253test -z "$OBJDUMP" && OBJDUMP=objdump
3254
3255
3256
3257
3258
3259
3260
3261case `pwd` in
3262 *\ * | *\ *)
3263 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
3264$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
3265esac
3266
3267
3268
3269macro_version='2.2.6b'
3270macro_revision='1.3017'
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284ltmain="$ac_aux_dir/ltmain.sh"
3285
3286DEPDIR="${am__leading_dot}deps"
3287
3288ac_config_commands="$ac_config_commands depfiles"
3289
3290
3291am_make=${MAKE-make}
3292cat > confinc << 'END'
3293am__doit:
3294 @echo this is the am__doit target
3295.PHONY: am__doit
3296END
3297# If we don't find an include directive, just comment out the code.
3298{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3299$as_echo_n "checking for style of include used by $am_make... " >&6; }
3300am__include="#"
3301am__quote=
3302_am_result=none
3303# First try GNU make style include.
3304echo "include confinc" > confmf
3305# Ignore all kinds of additional output from `make'.
3306case `$am_make -s -f confmf 2> /dev/null` in #(
3307*the\ am__doit\ target*)
3308 am__include=include
3309 am__quote=
3310 _am_result=GNU
3311 ;;
3312esac
3313# Now try BSD make style include.
3314if test "$am__include" = "#"; then
3315 echo '.include "confinc"' > confmf
3316 case `$am_make -s -f confmf 2> /dev/null` in #(
3317 *the\ am__doit\ target*)
3318 am__include=.include
3319 am__quote="\""
3320 _am_result=BSD
3321 ;;
3322 esac
3323fi
3324
3325
3326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3327$as_echo "$_am_result" >&6; }
3328rm -f confinc confmf
3329
3330# Check whether --enable-dependency-tracking was given.
3331if test "${enable_dependency_tracking+set}" = set; then :
3332 enableval=$enable_dependency_tracking;
3333fi
3334
3335if test "x$enable_dependency_tracking" != xno; then
3336 am_depcomp="$ac_aux_dir/depcomp"
3337 AMDEPBACKSLASH='\'
3338fi
3339 if test "x$enable_dependency_tracking" != xno; then
3340 AMDEP_TRUE=
3341 AMDEP_FALSE='#'
3342else
3343 AMDEP_TRUE='#'
3344 AMDEP_FALSE=
3345fi
3346
3347
3348ac_ext=c
3349ac_cpp='$CPP $CPPFLAGS'
3350ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3351ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3352ac_compiler_gnu=$ac_cv_c_compiler_gnu
3353if test -n "$ac_tool_prefix"; then
3354 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3355set dummy ${ac_tool_prefix}gcc; ac_word=$2
3356{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3357$as_echo_n "checking for $ac_word... " >&6; }
3358if test "${ac_cv_prog_CC+set}" = set; then :
3359 $as_echo_n "(cached) " >&6
3360else
3361 if test -n "$CC"; then
3362 ac_cv_prog_CC="$CC" # Let the user override the test.
3363else
3364as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3365for as_dir in $PATH
3366do
3367 IFS=$as_save_IFS
3368 test -z "$as_dir" && as_dir=.
3369 for ac_exec_ext in '' $ac_executable_extensions; do
3370 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3371 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3372 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3373 break 2
3374 fi
3375done
3376 done
3377IFS=$as_save_IFS
3378
3379fi
3380fi
3381CC=$ac_cv_prog_CC
3382if test -n "$CC"; then
3383 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3384$as_echo "$CC" >&6; }
3385else
3386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3387$as_echo "no" >&6; }
3388fi
3389
3390
3391fi
3392if test -z "$ac_cv_prog_CC"; then
3393 ac_ct_CC=$CC
3394 # Extract the first word of "gcc", so it can be a program name with args.
3395set dummy gcc; ac_word=$2
3396{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3397$as_echo_n "checking for $ac_word... " >&6; }
3398if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
3399 $as_echo_n "(cached) " >&6
3400else
3401 if test -n "$ac_ct_CC"; then
3402 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3403else
3404as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3405for as_dir in $PATH
3406do
3407 IFS=$as_save_IFS
3408 test -z "$as_dir" && as_dir=.
3409 for ac_exec_ext in '' $ac_executable_extensions; do
3410 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3411 ac_cv_prog_ac_ct_CC="gcc"
3412 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3413 break 2
3414 fi
3415done
3416 done
3417IFS=$as_save_IFS
3418
3419fi
3420fi
3421ac_ct_CC=$ac_cv_prog_ac_ct_CC
3422if test -n "$ac_ct_CC"; then
3423 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3424$as_echo "$ac_ct_CC" >&6; }
3425else
3426 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3427$as_echo "no" >&6; }
3428fi
3429
3430 if test "x$ac_ct_CC" = x; then
3431 CC=""
3432 else
3433 case $cross_compiling:$ac_tool_warned in
3434yes:)
3435{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3436$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3437ac_tool_warned=yes ;;
3438esac
3439 CC=$ac_ct_CC
3440 fi
3441else
3442 CC="$ac_cv_prog_CC"
3443fi
3444
3445if test -z "$CC"; then
3446 if test -n "$ac_tool_prefix"; then
3447 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3448set dummy ${ac_tool_prefix}cc; ac_word=$2
3449{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3450$as_echo_n "checking for $ac_word... " >&6; }
3451if test "${ac_cv_prog_CC+set}" = set; then :
3452 $as_echo_n "(cached) " >&6
3453else
3454 if test -n "$CC"; then
3455 ac_cv_prog_CC="$CC" # Let the user override the test.
3456else
3457as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3458for as_dir in $PATH
3459do
3460 IFS=$as_save_IFS
3461 test -z "$as_dir" && as_dir=.
3462 for ac_exec_ext in '' $ac_executable_extensions; do
3463 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3464 ac_cv_prog_CC="${ac_tool_prefix}cc"
3465 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3466 break 2
3467 fi
3468done
3469 done
3470IFS=$as_save_IFS
3471
3472fi
3473fi
3474CC=$ac_cv_prog_CC
3475if test -n "$CC"; then
3476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3477$as_echo "$CC" >&6; }
3478else
3479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3480$as_echo "no" >&6; }
3481fi
3482
3483
3484 fi
3485fi
3486if test -z "$CC"; then
3487 # Extract the first word of "cc", so it can be a program name with args.
3488set dummy cc; ac_word=$2
3489{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3490$as_echo_n "checking for $ac_word... " >&6; }
3491if test "${ac_cv_prog_CC+set}" = set; then :
3492 $as_echo_n "(cached) " >&6
3493else
3494 if test -n "$CC"; then
3495 ac_cv_prog_CC="$CC" # Let the user override the test.
3496else
3497 ac_prog_rejected=no
3498as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3499for as_dir in $PATH
3500do
3501 IFS=$as_save_IFS
3502 test -z "$as_dir" && as_dir=.
3503 for ac_exec_ext in '' $ac_executable_extensions; do
3504 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3505 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3506 ac_prog_rejected=yes
3507 continue
3508 fi
3509 ac_cv_prog_CC="cc"
3510 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3511 break 2
3512 fi
3513done
3514 done
3515IFS=$as_save_IFS
3516
3517if test $ac_prog_rejected = yes; then
3518 # We found a bogon in the path, so make sure we never use it.
3519 set dummy $ac_cv_prog_CC
3520 shift
3521 if test $# != 0; then
3522 # We chose a different compiler from the bogus one.
3523 # However, it has the same basename, so the bogon will be chosen
3524 # first if we set CC to just the basename; use the full file name.
3525 shift
3526 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3527 fi
3528fi
3529fi
3530fi
3531CC=$ac_cv_prog_CC
3532if test -n "$CC"; then
3533 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3534$as_echo "$CC" >&6; }
3535else
3536 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3537$as_echo "no" >&6; }
3538fi
3539
3540
3541fi
3542if test -z "$CC"; then
3543 if test -n "$ac_tool_prefix"; then
3544 for ac_prog in cl.exe
3545 do
3546 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3547set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3548{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3549$as_echo_n "checking for $ac_word... " >&6; }
3550if test "${ac_cv_prog_CC+set}" = set; then :
3551 $as_echo_n "(cached) " >&6
3552else
3553 if test -n "$CC"; then
3554 ac_cv_prog_CC="$CC" # Let the user override the test.
3555else
3556as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3557for as_dir in $PATH
3558do
3559 IFS=$as_save_IFS
3560 test -z "$as_dir" && as_dir=.
3561 for ac_exec_ext in '' $ac_executable_extensions; do
3562 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3563 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3564 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3565 break 2
3566 fi
3567done
3568 done
3569IFS=$as_save_IFS
3570
3571fi
3572fi
3573CC=$ac_cv_prog_CC
3574if test -n "$CC"; then
3575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3576$as_echo "$CC" >&6; }
3577else
3578 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3579$as_echo "no" >&6; }
3580fi
3581
3582
3583 test -n "$CC" && break
3584 done
3585fi
3586if test -z "$CC"; then
3587 ac_ct_CC=$CC
3588 for ac_prog in cl.exe
3589do
3590 # Extract the first word of "$ac_prog", so it can be a program name with args.
3591set dummy $ac_prog; ac_word=$2
3592{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3593$as_echo_n "checking for $ac_word... " >&6; }
3594if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
3595 $as_echo_n "(cached) " >&6
3596else
3597 if test -n "$ac_ct_CC"; then
3598 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3599else
3600as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3601for as_dir in $PATH
3602do
3603 IFS=$as_save_IFS
3604 test -z "$as_dir" && as_dir=.
3605 for ac_exec_ext in '' $ac_executable_extensions; do
3606 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3607 ac_cv_prog_ac_ct_CC="$ac_prog"
3608 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3609 break 2
3610 fi
3611done
3612 done
3613IFS=$as_save_IFS
3614
3615fi
3616fi
3617ac_ct_CC=$ac_cv_prog_ac_ct_CC
3618if test -n "$ac_ct_CC"; then
3619 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3620$as_echo "$ac_ct_CC" >&6; }
3621else
3622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3623$as_echo "no" >&6; }
3624fi
3625
3626
3627 test -n "$ac_ct_CC" && break
3628done
3629
3630 if test "x$ac_ct_CC" = x; then
3631 CC=""
3632 else
3633 case $cross_compiling:$ac_tool_warned in
3634yes:)
3635{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3636$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3637ac_tool_warned=yes ;;
3638esac
3639 CC=$ac_ct_CC
3640 fi
3641fi
3642
3643fi
3644
3645
3646test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3647$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3648as_fn_error $? "no acceptable C compiler found in \$PATH
3649See \`config.log' for more details" "$LINENO" 5 ; }
3650
3651# Provide some information about the compiler.
3652$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3653set X $ac_compile
3654ac_compiler=$2
3655for ac_option in --version -v -V -qversion; do
3656 { { ac_try="$ac_compiler $ac_option >&5"
3657case "(($ac_try" in
3658 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3659 *) ac_try_echo=$ac_try;;
3660esac
3661eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3662$as_echo "$ac_try_echo"; } >&5
3663 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3664 ac_status=$?
3665 if test -s conftest.err; then
3666 sed '10a\
3667... rest of stderr output deleted ...
3668 10q' conftest.err >conftest.er1
3669 cat conftest.er1 >&5
3670 fi
3671 rm -f conftest.er1 conftest.err
3672 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3673 test $ac_status = 0; }
3674done
3675
3676cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3677/* end confdefs.h. */
3678
3679int
3680main ()
3681{
3682
3683 ;
3684 return 0;
3685}
3686_ACEOF
3687ac_clean_files_save=$ac_clean_files
3688ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3689# Try to create an executable without -o first, disregard a.out.
3690# It will help us diagnose broken compilers, and finding out an intuition
3691# of exeext.
3692{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3693$as_echo_n "checking whether the C compiler works... " >&6; }
3694ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3695
3696# The possible output files:
3697ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3698
3699ac_rmfiles=
3700for ac_file in $ac_files
3701do
3702 case $ac_file in
3703 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3704 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3705 esac
3706done
3707rm -f $ac_rmfiles
3708
3709if { { ac_try="$ac_link_default"
3710case "(($ac_try" in
3711 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3712 *) ac_try_echo=$ac_try;;
3713esac
3714eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3715$as_echo "$ac_try_echo"; } >&5
3716 (eval "$ac_link_default") 2>&5
3717 ac_status=$?
3718 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3719 test $ac_status = 0; }; then :
3720 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3721# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3722# in a Makefile. We should not override ac_cv_exeext if it was cached,
3723# so that the user can short-circuit this test for compilers unknown to
3724# Autoconf.
3725for ac_file in $ac_files ''
3726do
3727 test -f "$ac_file" || continue
3728 case $ac_file in
3729 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3730 ;;
3731 [ab].out )
3732 # We found the default executable, but exeext='' is most
3733 # certainly right.
3734 break;;
3735 *.* )
3736 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3737 then :; else
3738 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3739 fi
3740 # We set ac_cv_exeext here because the later test for it is not
3741 # safe: cross compilers may not add the suffix if given an `-o'
3742 # argument, so we may need to know it at that point already.
3743 # Even if this section looks crufty: it has the advantage of
3744 # actually working.
3745 break;;
3746 * )
3747 break;;
3748 esac
3749done
3750test "$ac_cv_exeext" = no && ac_cv_exeext=
3751
3752else
3753 ac_file=''
3754fi
3755if test -z "$ac_file"; then :
3756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3757$as_echo "no" >&6; }
3758$as_echo "$as_me: failed program was:" >&5
3759sed 's/^/| /' conftest.$ac_ext >&5
3760
3761{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3762$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3763as_fn_error 77 "C compiler cannot create executables
3764See \`config.log' for more details" "$LINENO" 5 ; }
3765else
3766 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3767$as_echo "yes" >&6; }
3768fi
3769{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3770$as_echo_n "checking for C compiler default output file name... " >&6; }
3771{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3772$as_echo "$ac_file" >&6; }
3773ac_exeext=$ac_cv_exeext
3774
3775rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3776ac_clean_files=$ac_clean_files_save
3777{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3778$as_echo_n "checking for suffix of executables... " >&6; }
3779if { { ac_try="$ac_link"
3780case "(($ac_try" in
3781 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3782 *) ac_try_echo=$ac_try;;
3783esac
3784eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3785$as_echo "$ac_try_echo"; } >&5
3786 (eval "$ac_link") 2>&5
3787 ac_status=$?
3788 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3789 test $ac_status = 0; }; then :
3790 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3791# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3792# work properly (i.e., refer to `conftest.exe'), while it won't with
3793# `rm'.
3794for ac_file in conftest.exe conftest conftest.*; do
3795 test -f "$ac_file" || continue
3796 case $ac_file in
3797 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3798 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3799 break;;
3800 * ) break;;
3801 esac
3802done
3803else
3804 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3805$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3806as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3807See \`config.log' for more details" "$LINENO" 5 ; }
3808fi
3809rm -f conftest conftest$ac_cv_exeext
3810{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3811$as_echo "$ac_cv_exeext" >&6; }
3812
3813rm -f conftest.$ac_ext
3814EXEEXT=$ac_cv_exeext
3815ac_exeext=$EXEEXT
3816cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3817/* end confdefs.h. */
3818#include <stdio.h>
3819int
3820main ()
3821{
3822FILE *f = fopen ("conftest.out", "w");
3823 return ferror (f) || fclose (f) != 0;
3824
3825 ;
3826 return 0;
3827}
3828_ACEOF
3829ac_clean_files="$ac_clean_files conftest.out"
3830# Check that the compiler produces executables we can run. If not, either
3831# the compiler is broken, or we cross compile.
3832{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3833$as_echo_n "checking whether we are cross compiling... " >&6; }
3834if test "$cross_compiling" != yes; then
3835 { { ac_try="$ac_link"
3836case "(($ac_try" in
3837 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3838 *) ac_try_echo=$ac_try;;
3839esac
3840eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3841$as_echo "$ac_try_echo"; } >&5
3842 (eval "$ac_link") 2>&5
3843 ac_status=$?
3844 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3845 test $ac_status = 0; }
3846 if { ac_try='./conftest$ac_cv_exeext'
3847 { { case "(($ac_try" in
3848 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3849 *) ac_try_echo=$ac_try;;
3850esac
3851eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3852$as_echo "$ac_try_echo"; } >&5
3853 (eval "$ac_try") 2>&5
3854 ac_status=$?
3855 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3856 test $ac_status = 0; }; }; then
3857 cross_compiling=no
3858 else
3859 if test "$cross_compiling" = maybe; then
3860 cross_compiling=yes
3861 else
3862 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3863$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3864as_fn_error $? "cannot run C compiled programs.
3865If you meant to cross compile, use \`--host'.
3866See \`config.log' for more details" "$LINENO" 5 ; }
3867 fi
3868 fi
3869fi
3870{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3871$as_echo "$cross_compiling" >&6; }
3872
3873rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3874ac_clean_files=$ac_clean_files_save
3875{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3876$as_echo_n "checking for suffix of object files... " >&6; }
3877if test "${ac_cv_objext+set}" = set; then :
3878 $as_echo_n "(cached) " >&6
3879else
3880 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3881/* end confdefs.h. */
3882
3883int
3884main ()
3885{
3886
3887 ;
3888 return 0;
3889}
3890_ACEOF
3891rm -f conftest.o conftest.obj
3892if { { ac_try="$ac_compile"
3893case "(($ac_try" in
3894 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3895 *) ac_try_echo=$ac_try;;
3896esac
3897eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3898$as_echo "$ac_try_echo"; } >&5
3899 (eval "$ac_compile") 2>&5
3900 ac_status=$?
3901 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3902 test $ac_status = 0; }; then :
3903 for ac_file in conftest.o conftest.obj conftest.*; do
3904 test -f "$ac_file" || continue;
3905 case $ac_file in
3906 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3907 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3908 break;;
3909 esac
3910done
3911else
3912 $as_echo "$as_me: failed program was:" >&5
3913sed 's/^/| /' conftest.$ac_ext >&5
3914
3915{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3916$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3917as_fn_error $? "cannot compute suffix of object files: cannot compile
3918See \`config.log' for more details" "$LINENO" 5 ; }
3919fi
3920rm -f conftest.$ac_cv_objext conftest.$ac_ext
3921fi
3922{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3923$as_echo "$ac_cv_objext" >&6; }
3924OBJEXT=$ac_cv_objext
3925ac_objext=$OBJEXT
3926{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
3927$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3928if test "${ac_cv_c_compiler_gnu+set}" = set; then :
3929 $as_echo_n "(cached) " >&6
3930else
3931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3932/* end confdefs.h. */
3933
3934int
3935main ()
3936{
3937#ifndef __GNUC__
3938 choke me
3939#endif
3940
3941 ;
3942 return 0;
3943}
3944_ACEOF
3945if ac_fn_c_try_compile "$LINENO"; then :
3946 ac_compiler_gnu=yes
3947else
3948 ac_compiler_gnu=no
3949fi
3950rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3951ac_cv_c_compiler_gnu=$ac_compiler_gnu
3952
3953fi
3954{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3955$as_echo "$ac_cv_c_compiler_gnu" >&6; }
3956if test $ac_compiler_gnu = yes; then
3957 GCC=yes
3958else
3959 GCC=
3960fi
3961ac_test_CFLAGS=${CFLAGS+set}
3962ac_save_CFLAGS=$CFLAGS
3963{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3964$as_echo_n "checking whether $CC accepts -g... " >&6; }
3965if test "${ac_cv_prog_cc_g+set}" = set; then :
3966 $as_echo_n "(cached) " >&6
3967else
3968 ac_save_c_werror_flag=$ac_c_werror_flag
3969 ac_c_werror_flag=yes
3970 ac_cv_prog_cc_g=no
3971 CFLAGS="-g"
3972 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3973/* end confdefs.h. */
3974
3975int
3976main ()
3977{
3978
3979 ;
3980 return 0;
3981}
3982_ACEOF
3983if ac_fn_c_try_compile "$LINENO"; then :
3984 ac_cv_prog_cc_g=yes
3985else
3986 CFLAGS=""
3987 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3988/* end confdefs.h. */
3989
3990int
3991main ()
3992{
3993
3994 ;
3995 return 0;
3996}
3997_ACEOF
3998if ac_fn_c_try_compile "$LINENO"; then :
3999
4000else
4001 ac_c_werror_flag=$ac_save_c_werror_flag
4002 CFLAGS="-g"
4003 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4004/* end confdefs.h. */
4005
4006int
4007main ()
4008{
4009
4010 ;
4011 return 0;
4012}
4013_ACEOF
4014if ac_fn_c_try_compile "$LINENO"; then :
4015 ac_cv_prog_cc_g=yes
4016fi
4017rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4018fi
4019rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4020fi
4021rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4022 ac_c_werror_flag=$ac_save_c_werror_flag
4023fi
4024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4025$as_echo "$ac_cv_prog_cc_g" >&6; }
4026if test "$ac_test_CFLAGS" = set; then
4027 CFLAGS=$ac_save_CFLAGS
4028elif test $ac_cv_prog_cc_g = yes; then
4029 if test "$GCC" = yes; then
4030 CFLAGS="-g -O2"
4031 else
4032 CFLAGS="-g"
4033 fi
4034else
4035 if test "$GCC" = yes; then
4036 CFLAGS="-O2"
4037 else
4038 CFLAGS=
4039 fi
4040fi
4041{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4042$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4043if test "${ac_cv_prog_cc_c89+set}" = set; then :
4044 $as_echo_n "(cached) " >&6
4045else
4046 ac_cv_prog_cc_c89=no
4047ac_save_CC=$CC
4048cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4049/* end confdefs.h. */
4050#include <stdarg.h>
4051#include <stdio.h>
4052#include <sys/types.h>
4053#include <sys/stat.h>
4054/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4055struct buf { int x; };
4056FILE * (*rcsopen) (struct buf *, struct stat *, int);
4057static char *e (p, i)
4058 char **p;
4059 int i;
4060{
4061 return p[i];
4062}
4063static char *f (char * (*g) (char **, int), char **p, ...)
4064{
4065 char *s;
4066 va_list v;
4067 va_start (v,p);
4068 s = g (p, va_arg (v,int));
4069 va_end (v);
4070 return s;
4071}
4072
4073/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
4074 function prototypes and stuff, but not '\xHH' hex character constants.
4075 These don't provoke an error unfortunately, instead are silently treated
4076 as 'x'. The following induces an error, until -std is added to get
4077 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
4078 array size at least. It's necessary to write '\x00'==0 to get something
4079 that's true only with -std. */
4080int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4081
4082/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4083 inside strings and character constants. */
4084#define FOO(x) 'x'
4085int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4086
4087int test (int i, double x);
4088struct s1 {int (*f) (int a);};
4089struct s2 {int (*f) (double a);};
4090int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4091int argc;
4092char **argv;
4093int
4094main ()
4095{
4096return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
4097 ;
4098 return 0;
4099}
4100_ACEOF
4101for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4102 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4103do
4104 CC="$ac_save_CC $ac_arg"
4105 if ac_fn_c_try_compile "$LINENO"; then :
4106 ac_cv_prog_cc_c89=$ac_arg
4107fi
4108rm -f core conftest.err conftest.$ac_objext
4109 test "x$ac_cv_prog_cc_c89" != "xno" && break
4110done
4111rm -f conftest.$ac_ext
4112CC=$ac_save_CC
4113
4114fi
4115# AC_CACHE_VAL
4116case "x$ac_cv_prog_cc_c89" in
4117 x)
4118 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4119$as_echo "none needed" >&6; } ;;
4120 xno)
4121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4122$as_echo "unsupported" >&6; } ;;
4123 *)
4124 CC="$CC $ac_cv_prog_cc_c89"
4125 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4126$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4127esac
4128if test "x$ac_cv_prog_cc_c89" != xno; then :
4129
4130fi
4131
4132ac_ext=c
4133ac_cpp='$CPP $CPPFLAGS'
4134ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4135ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4136ac_compiler_gnu=$ac_cv_c_compiler_gnu
4137
4138depcc="$CC" am_compiler_list=
4139
4140{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
4141$as_echo_n "checking dependency style of $depcc... " >&6; }
4142if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
4143 $as_echo_n "(cached) " >&6
4144else
4145 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
4146 # We make a subdir and do the tests there. Otherwise we can end up
4147 # making bogus files that we don't know about and never remove. For
4148 # instance it was reported that on HP-UX the gcc test will end up
4149 # making a dummy file named `D' -- because `-MD' means `put the output
4150 # in D'.
4151 mkdir conftest.dir
4152 # Copy depcomp to subdir because otherwise we won't find it if we're
4153 # using a relative directory.
4154 cp "$am_depcomp" conftest.dir
4155 cd conftest.dir
4156 # We will build objects and dependencies in a subdirectory because
4157 # it helps to detect inapplicable dependency modes. For instance
4158 # both Tru64's cc and ICC support -MD to output dependencies as a
4159 # side effect of compilation, but ICC will put the dependencies in
4160 # the current directory while Tru64 will put them in the object
4161 # directory.
4162 mkdir sub
4163
4164 am_cv_CC_dependencies_compiler_type=none
4165 if test "$am_compiler_list" = ""; then
4166 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
4167 fi
4168 am__universal=false
4169 case " $depcc " in #(
4170 *\ -arch\ *\ -arch\ *) am__universal=true ;;
4171 esac
4172
4173 for depmode in $am_compiler_list; do
4174 # Setup a source with many dependencies, because some compilers
4175 # like to wrap large dependency lists on column 80 (with \), and
4176 # we should not choose a depcomp mode which is confused by this.
4177 #
4178 # We need to recreate these files for each test, as the compiler may
4179 # overwrite some of them when testing with obscure command lines.
4180 # This happens at least with the AIX C compiler.
4181 : > sub/conftest.c
4182 for i in 1 2 3 4 5 6; do
4183 echo '#include "conftst'$i'.h"' >> sub/conftest.c
4184 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
4185 # Solaris 8's {/usr,}/bin/sh.
4186 touch sub/conftst$i.h
4187 done
4188 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4189
4190 # We check with `-c' and `-o' for the sake of the "dashmstdout"
4191 # mode. It turns out that the SunPro C++ compiler does not properly
4192 # handle `-M -o', and we need to detect this. Also, some Intel
4193 # versions had trouble with output in subdirs
4194 am__obj=sub/conftest.${OBJEXT-o}
4195 am__minus_obj="-o $am__obj"
4196 case $depmode in
4197 gcc)
4198 # This depmode causes a compiler race in universal mode.
4199 test "$am__universal" = false || continue
4200 ;;
4201 nosideeffect)
4202 # after this tag, mechanisms are not by side-effect, so they'll
4203 # only be used when explicitly requested
4204 if test "x$enable_dependency_tracking" = xyes; then
4205 continue
4206 else
4207 break
4208 fi
4209 ;;
4210 msvisualcpp | msvcmsys)
4211 # This compiler won't grok `-c -o', but also, the minuso test has
4212 # not run yet. These depmodes are late enough in the game, and
4213 # so weak that their functioning should not be impacted.
4214 am__obj=conftest.${OBJEXT-o}
4215 am__minus_obj=
4216 ;;
4217 none) break ;;
4218 esac
4219 if depmode=$depmode \
4220 source=sub/conftest.c object=$am__obj \
4221 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4222 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4223 >/dev/null 2>conftest.err &&
4224 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4225 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4226 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4227 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4228 # icc doesn't choke on unknown options, it will just issue warnings
4229 # or remarks (even with -Werror). So we grep stderr for any message
4230 # that says an option was ignored or not supported.
4231 # When given -MP, icc 7.0 and 7.1 complain thusly:
4232 # icc: Command line warning: ignoring option '-M'; no argument required
4233 # The diagnosis changed in icc 8.0:
4234 # icc: Command line remark: option '-MP' not supported
4235 if (grep 'ignoring option' conftest.err ||
4236 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4237 am_cv_CC_dependencies_compiler_type=$depmode
4238 break
4239 fi
4240 fi
4241 done
4242
4243 cd ..
4244 rm -rf conftest.dir
4245else
4246 am_cv_CC_dependencies_compiler_type=none
4247fi
4248
4249fi
4250{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
4251$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
4252CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
4253
4254 if
4255 test "x$enable_dependency_tracking" != xno \
4256 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
4257 am__fastdepCC_TRUE=
4258 am__fastdepCC_FALSE='#'
4259else
4260 am__fastdepCC_TRUE='#'
4261 am__fastdepCC_FALSE=
4262fi
4263
4264
4265{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4266$as_echo_n "checking for a sed that does not truncate output... " >&6; }
4267if test "${ac_cv_path_SED+set}" = set; then :
4268 $as_echo_n "(cached) " >&6
4269else
4270 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4271 for ac_i in 1 2 3 4 5 6 7; do
4272 ac_script="$ac_script$as_nl$ac_script"
4273 done
4274 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4275 { ac_script=; unset ac_script;}
4276 if test -z "$SED"; then
4277 ac_path_SED_found=false
4278 # Loop through the user's path and test for each of PROGNAME-LIST
4279 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4280for as_dir in $PATH
4281do
4282 IFS=$as_save_IFS
4283 test -z "$as_dir" && as_dir=.
4284 for ac_prog in sed gsed; do
4285 for ac_exec_ext in '' $ac_executable_extensions; do
4286 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4287 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
4288# Check for GNU ac_path_SED and select it if it is found.
4289 # Check for GNU $ac_path_SED
4290case `"$ac_path_SED" --version 2>&1` in
4291*GNU*)
4292 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4293*)
4294 ac_count=0
4295 $as_echo_n 0123456789 >"conftest.in"
4296 while :
4297 do
4298 cat "conftest.in" "conftest.in" >"conftest.tmp"
4299 mv "conftest.tmp" "conftest.in"
4300 cp "conftest.in" "conftest.nl"
4301 $as_echo '' >> "conftest.nl"
4302 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4303 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4304 as_fn_arith $ac_count + 1 && ac_count=$as_val
4305 if test $ac_count -gt ${ac_path_SED_max-0}; then
4306 # Best one so far, save it but keep looking for a better one
4307 ac_cv_path_SED="$ac_path_SED"
4308 ac_path_SED_max=$ac_count
4309 fi
4310 # 10*(2^10) chars as input seems more than enough
4311 test $ac_count -gt 10 && break
4312 done
4313 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4314esac
4315
4316 $ac_path_SED_found && break 3
4317 done
4318 done
4319 done
4320IFS=$as_save_IFS
4321 if test -z "$ac_cv_path_SED"; then
4322 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
4323 fi
4324else
4325 ac_cv_path_SED=$SED
4326fi
4327
4328fi
4329{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4330$as_echo "$ac_cv_path_SED" >&6; }
4331 SED="$ac_cv_path_SED"
4332 rm -f conftest.sed
4333
4334test -z "$SED" && SED=sed
4335Xsed="$SED -e 1s/^X//"
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4348$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4349if test "${ac_cv_path_GREP+set}" = set; then :
4350 $as_echo_n "(cached) " >&6
4351else
4352 if test -z "$GREP"; then
4353 ac_path_GREP_found=false
4354 # Loop through the user's path and test for each of PROGNAME-LIST
4355 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4356for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4357do
4358 IFS=$as_save_IFS
4359 test -z "$as_dir" && as_dir=.
4360 for ac_prog in grep ggrep; do
4361 for ac_exec_ext in '' $ac_executable_extensions; do
4362 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4363 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4364# Check for GNU ac_path_GREP and select it if it is found.
4365 # Check for GNU $ac_path_GREP
4366case `"$ac_path_GREP" --version 2>&1` in
4367*GNU*)
4368 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4369*)
4370 ac_count=0
4371 $as_echo_n 0123456789 >"conftest.in"
4372 while :
4373 do
4374 cat "conftest.in" "conftest.in" >"conftest.tmp"
4375 mv "conftest.tmp" "conftest.in"
4376 cp "conftest.in" "conftest.nl"
4377 $as_echo 'GREP' >> "conftest.nl"
4378 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4379 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4380 as_fn_arith $ac_count + 1 && ac_count=$as_val
4381 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4382 # Best one so far, save it but keep looking for a better one
4383 ac_cv_path_GREP="$ac_path_GREP"
4384 ac_path_GREP_max=$ac_count
4385 fi
4386 # 10*(2^10) chars as input seems more than enough
4387 test $ac_count -gt 10 && break
4388 done
4389 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4390esac
4391
4392 $ac_path_GREP_found && break 3
4393 done
4394 done
4395 done
4396IFS=$as_save_IFS
4397 if test -z "$ac_cv_path_GREP"; then
4398 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4399 fi
4400else
4401 ac_cv_path_GREP=$GREP
4402fi
4403
4404fi
4405{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4406$as_echo "$ac_cv_path_GREP" >&6; }
4407 GREP="$ac_cv_path_GREP"
4408
4409
4410{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4411$as_echo_n "checking for egrep... " >&6; }
4412if test "${ac_cv_path_EGREP+set}" = set; then :
4413 $as_echo_n "(cached) " >&6
4414else
4415 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4416 then ac_cv_path_EGREP="$GREP -E"
4417 else
4418 if test -z "$EGREP"; then
4419 ac_path_EGREP_found=false
4420 # Loop through the user's path and test for each of PROGNAME-LIST
4421 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4422for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4423do
4424 IFS=$as_save_IFS
4425 test -z "$as_dir" && as_dir=.
4426 for ac_prog in egrep; do
4427 for ac_exec_ext in '' $ac_executable_extensions; do
4428 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4429 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4430# Check for GNU ac_path_EGREP and select it if it is found.
4431 # Check for GNU $ac_path_EGREP
4432case `"$ac_path_EGREP" --version 2>&1` in
4433*GNU*)
4434 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4435*)
4436 ac_count=0
4437 $as_echo_n 0123456789 >"conftest.in"
4438 while :
4439 do
4440 cat "conftest.in" "conftest.in" >"conftest.tmp"
4441 mv "conftest.tmp" "conftest.in"
4442 cp "conftest.in" "conftest.nl"
4443 $as_echo 'EGREP' >> "conftest.nl"
4444 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4445 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4446 as_fn_arith $ac_count + 1 && ac_count=$as_val
4447 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4448 # Best one so far, save it but keep looking for a better one
4449 ac_cv_path_EGREP="$ac_path_EGREP"
4450 ac_path_EGREP_max=$ac_count
4451 fi
4452 # 10*(2^10) chars as input seems more than enough
4453 test $ac_count -gt 10 && break
4454 done
4455 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4456esac
4457
4458 $ac_path_EGREP_found && break 3
4459 done
4460 done
4461 done
4462IFS=$as_save_IFS
4463 if test -z "$ac_cv_path_EGREP"; then
4464 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4465 fi
4466else
4467 ac_cv_path_EGREP=$EGREP
4468fi
4469
4470 fi
4471fi
4472{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4473$as_echo "$ac_cv_path_EGREP" >&6; }
4474 EGREP="$ac_cv_path_EGREP"
4475
4476
4477{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4478$as_echo_n "checking for fgrep... " >&6; }
4479if test "${ac_cv_path_FGREP+set}" = set; then :
4480 $as_echo_n "(cached) " >&6
4481else
4482 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4483 then ac_cv_path_FGREP="$GREP -F"
4484 else
4485 if test -z "$FGREP"; then
4486 ac_path_FGREP_found=false
4487 # Loop through the user's path and test for each of PROGNAME-LIST
4488 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4489for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4490do
4491 IFS=$as_save_IFS
4492 test -z "$as_dir" && as_dir=.
4493 for ac_prog in fgrep; do
4494 for ac_exec_ext in '' $ac_executable_extensions; do
4495 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4496 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
4497# Check for GNU ac_path_FGREP and select it if it is found.
4498 # Check for GNU $ac_path_FGREP
4499case `"$ac_path_FGREP" --version 2>&1` in
4500*GNU*)
4501 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4502*)
4503 ac_count=0
4504 $as_echo_n 0123456789 >"conftest.in"
4505 while :
4506 do
4507 cat "conftest.in" "conftest.in" >"conftest.tmp"
4508 mv "conftest.tmp" "conftest.in"
4509 cp "conftest.in" "conftest.nl"
4510 $as_echo 'FGREP' >> "conftest.nl"
4511 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4512 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4513 as_fn_arith $ac_count + 1 && ac_count=$as_val
4514 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4515 # Best one so far, save it but keep looking for a better one
4516 ac_cv_path_FGREP="$ac_path_FGREP"
4517 ac_path_FGREP_max=$ac_count
4518 fi
4519 # 10*(2^10) chars as input seems more than enough
4520 test $ac_count -gt 10 && break
4521 done
4522 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4523esac
4524
4525 $ac_path_FGREP_found && break 3
4526 done
4527 done
4528 done
4529IFS=$as_save_IFS
4530 if test -z "$ac_cv_path_FGREP"; then
4531 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4532 fi
4533else
4534 ac_cv_path_FGREP=$FGREP
4535fi
4536
4537 fi
4538fi
4539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4540$as_echo "$ac_cv_path_FGREP" >&6; }
4541 FGREP="$ac_cv_path_FGREP"
4542
4543
4544test -z "$GREP" && GREP=grep
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564# Check whether --with-gnu-ld was given.
4565if test "${with_gnu_ld+set}" = set; then :
4566 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4567else
4568 with_gnu_ld=no
4569fi
4570
4571ac_prog=ld
4572if test "$GCC" = yes; then
4573 # Check if gcc -print-prog-name=ld gives a path.
4574 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4575$as_echo_n "checking for ld used by $CC... " >&6; }
4576 case $host in
4577 *-*-mingw*)
4578 # gcc leaves a trailing carriage return which upsets mingw
4579 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4580 *)
4581 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4582 esac
4583 case $ac_prog in
4584 # Accept absolute paths.
4585 [\\/]* | ?:[\\/]*)
4586 re_direlt='/[^/][^/]*/\.\./'
4587 # Canonicalize the pathname of ld
4588 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4589 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4590 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4591 done
4592 test -z "$LD" && LD="$ac_prog"
4593 ;;
4594 "")
4595 # If it fails, then pretend we aren't using GCC.
4596 ac_prog=ld
4597 ;;
4598 *)
4599 # If it is relative, then search for the first ld in PATH.
4600 with_gnu_ld=unknown
4601 ;;
4602 esac
4603elif test "$with_gnu_ld" = yes; then
4604 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4605$as_echo_n "checking for GNU ld... " >&6; }
4606else
4607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4608$as_echo_n "checking for non-GNU ld... " >&6; }
4609fi
4610if test "${lt_cv_path_LD+set}" = set; then :
4611 $as_echo_n "(cached) " >&6
4612else
4613 if test -z "$LD"; then
4614 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4615 for ac_dir in $PATH; do
4616 IFS="$lt_save_ifs"
4617 test -z "$ac_dir" && ac_dir=.
4618 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4619 lt_cv_path_LD="$ac_dir/$ac_prog"
4620 # Check to see if the program is GNU ld. I'd rather use --version,
4621 # but apparently some variants of GNU ld only accept -v.
4622 # Break only if it was the GNU/non-GNU ld that we prefer.
4623 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4624 *GNU* | *'with BFD'*)
4625 test "$with_gnu_ld" != no && break
4626 ;;
4627 *)
4628 test "$with_gnu_ld" != yes && break
4629 ;;
4630 esac
4631 fi
4632 done
4633 IFS="$lt_save_ifs"
4634else
4635 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4636fi
4637fi
4638
4639LD="$lt_cv_path_LD"
4640if test -n "$LD"; then
4641 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4642$as_echo "$LD" >&6; }
4643else
4644 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4645$as_echo "no" >&6; }
4646fi
4647test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
4648{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4649$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4650if test "${lt_cv_prog_gnu_ld+set}" = set; then :
4651 $as_echo_n "(cached) " >&6
4652else
4653 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4654case `$LD -v 2>&1 </dev/null` in
4655*GNU* | *'with BFD'*)
4656 lt_cv_prog_gnu_ld=yes
4657 ;;
4658*)
4659 lt_cv_prog_gnu_ld=no
4660 ;;
4661esac
4662fi
4663{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4664$as_echo "$lt_cv_prog_gnu_ld" >&6; }
4665with_gnu_ld=$lt_cv_prog_gnu_ld
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4676$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4677if test "${lt_cv_path_NM+set}" = set; then :
4678 $as_echo_n "(cached) " >&6
4679else
4680 if test -n "$NM"; then
4681 # Let the user override the test.
4682 lt_cv_path_NM="$NM"
4683else
4684 lt_nm_to_check="${ac_tool_prefix}nm"
4685 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4686 lt_nm_to_check="$lt_nm_to_check nm"
4687 fi
4688 for lt_tmp_nm in $lt_nm_to_check; do
4689 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4690 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4691 IFS="$lt_save_ifs"
4692 test -z "$ac_dir" && ac_dir=.
4693 tmp_nm="$ac_dir/$lt_tmp_nm"
4694 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4695 # Check to see if the nm accepts a BSD-compat flag.
4696 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4697 # nm: unknown option "B" ignored
4698 # Tru64's nm complains that /dev/null is an invalid object file
4699 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4700 */dev/null* | *'Invalid file or object type'*)
4701 lt_cv_path_NM="$tmp_nm -B"
4702 break
4703 ;;
4704 *)
4705 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4706 */dev/null*)
4707 lt_cv_path_NM="$tmp_nm -p"
4708 break
4709 ;;
4710 *)
4711 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4712 continue # so that we can try to find one that supports BSD flags
4713 ;;
4714 esac
4715 ;;
4716 esac
4717 fi
4718 done
4719 IFS="$lt_save_ifs"
4720 done
4721 : ${lt_cv_path_NM=no}
4722fi
4723fi
4724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4725$as_echo "$lt_cv_path_NM" >&6; }
4726if test "$lt_cv_path_NM" != "no"; then
4727 NM="$lt_cv_path_NM"
4728else
4729 # Didn't find any BSD compatible name lister, look for dumpbin.
4730 if test -n "$ac_tool_prefix"; then
4731 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4732 do
4733 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4734set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4735{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4736$as_echo_n "checking for $ac_word... " >&6; }
4737if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
4738 $as_echo_n "(cached) " >&6
4739else
4740 if test -n "$DUMPBIN"; then
4741 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4742else
4743as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4744for as_dir in $PATH
4745do
4746 IFS=$as_save_IFS
4747 test -z "$as_dir" && as_dir=.
4748 for ac_exec_ext in '' $ac_executable_extensions; do
4749 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4750 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4751 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4752 break 2
4753 fi
4754done
4755 done
4756IFS=$as_save_IFS
4757
4758fi
4759fi
4760DUMPBIN=$ac_cv_prog_DUMPBIN
4761if test -n "$DUMPBIN"; then
4762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4763$as_echo "$DUMPBIN" >&6; }
4764else
4765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4766$as_echo "no" >&6; }
4767fi
4768
4769
4770 test -n "$DUMPBIN" && break
4771 done
4772fi
4773if test -z "$DUMPBIN"; then
4774 ac_ct_DUMPBIN=$DUMPBIN
4775 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4776do
4777 # Extract the first word of "$ac_prog", so it can be a program name with args.
4778set dummy $ac_prog; ac_word=$2
4779{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4780$as_echo_n "checking for $ac_word... " >&6; }
4781if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
4782 $as_echo_n "(cached) " >&6
4783else
4784 if test -n "$ac_ct_DUMPBIN"; then
4785 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4786else
4787as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4788for as_dir in $PATH
4789do
4790 IFS=$as_save_IFS
4791 test -z "$as_dir" && as_dir=.
4792 for ac_exec_ext in '' $ac_executable_extensions; do
4793 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4794 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4795 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4796 break 2
4797 fi
4798done
4799 done
4800IFS=$as_save_IFS
4801
4802fi
4803fi
4804ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4805if test -n "$ac_ct_DUMPBIN"; then
4806 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4807$as_echo "$ac_ct_DUMPBIN" >&6; }
4808else
4809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4810$as_echo "no" >&6; }
4811fi
4812
4813
4814 test -n "$ac_ct_DUMPBIN" && break
4815done
4816
4817 if test "x$ac_ct_DUMPBIN" = x; then
4818 DUMPBIN=":"
4819 else
4820 case $cross_compiling:$ac_tool_warned in
4821yes:)
4822{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4823$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4824ac_tool_warned=yes ;;
4825esac
4826 DUMPBIN=$ac_ct_DUMPBIN
4827 fi
4828fi
4829
4830
4831 if test "$DUMPBIN" != ":"; then
4832 NM="$DUMPBIN"
4833 fi
4834fi
4835test -z "$NM" && NM=nm
4836
4837
4838
4839
4840
4841
4842{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4843$as_echo_n "checking the name lister ($NM) interface... " >&6; }
4844if test "${lt_cv_nm_interface+set}" = set; then :
4845 $as_echo_n "(cached) " >&6
4846else
4847 lt_cv_nm_interface="BSD nm"
4848 echo "int some_variable = 0;" > conftest.$ac_ext
4849 (eval echo "\"\$as_me:4849: $ac_compile\"" >&5)
4850 (eval "$ac_compile" 2>conftest.err)
4851 cat conftest.err >&5
4852 (eval echo "\"\$as_me:4852: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4853 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4854 cat conftest.err >&5
4855 (eval echo "\"\$as_me:4855: output\"" >&5)
4856 cat conftest.out >&5
4857 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4858 lt_cv_nm_interface="MS dumpbin"
4859 fi
4860 rm -f conftest*
4861fi
4862{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4863$as_echo "$lt_cv_nm_interface" >&6; }
4864
4865{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4866$as_echo_n "checking whether ln -s works... " >&6; }
4867LN_S=$as_ln_s
4868if test "$LN_S" = "ln -s"; then
4869 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4870$as_echo "yes" >&6; }
4871else
4872 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4873$as_echo "no, using $LN_S" >&6; }
4874fi
4875
4876# find the maximum length of command line arguments
4877{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4878$as_echo_n "checking the maximum length of command line arguments... " >&6; }
4879if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
4880 $as_echo_n "(cached) " >&6
4881else
4882 i=0
4883 teststring="ABCD"
4884
4885 case $build_os in
4886 msdosdjgpp*)
4887 # On DJGPP, this test can blow up pretty badly due to problems in libc
4888 # (any single argument exceeding 2000 bytes causes a buffer overrun
4889 # during glob expansion). Even if it were fixed, the result of this
4890 # check would be larger than it should be.
4891 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4892 ;;
4893
4894 gnu*)
4895 # Under GNU Hurd, this test is not required because there is
4896 # no limit to the length of command line arguments.
4897 # Libtool will interpret -1 as no limit whatsoever
4898 lt_cv_sys_max_cmd_len=-1;
4899 ;;
4900
4901 cygwin* | mingw* | cegcc*)
4902 # On Win9x/ME, this test blows up -- it succeeds, but takes
4903 # about 5 minutes as the teststring grows exponentially.
4904 # Worse, since 9x/ME are not pre-emptively multitasking,
4905 # you end up with a "frozen" computer, even though with patience
4906 # the test eventually succeeds (with a max line length of 256k).
4907 # Instead, let's just punt: use the minimum linelength reported by
4908 # all of the supported platforms: 8192 (on NT/2K/XP).
4909 lt_cv_sys_max_cmd_len=8192;
4910 ;;
4911
4912 amigaos*)
4913 # On AmigaOS with pdksh, this test takes hours, literally.
4914 # So we just punt and use a minimum line length of 8192.
4915 lt_cv_sys_max_cmd_len=8192;
4916 ;;
4917
4918 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
4919 # This has been around since 386BSD, at least. Likely further.
4920 if test -x /sbin/sysctl; then
4921 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4922 elif test -x /usr/sbin/sysctl; then
4923 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4924 else
4925 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4926 fi
4927 # And add a safety zone
4928 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4929 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4930 ;;
4931
4932 interix*)
4933 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4934 lt_cv_sys_max_cmd_len=196608
4935 ;;
4936
4937 osf*)
4938 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4939 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4940 # nice to cause kernel panics so lets avoid the loop below.
4941 # First set a reasonable default.
4942 lt_cv_sys_max_cmd_len=16384
4943 #
4944 if test -x /sbin/sysconfig; then
4945 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4946 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4947 esac
4948 fi
4949 ;;
4950 sco3.2v5*)
4951 lt_cv_sys_max_cmd_len=102400
4952 ;;
4953 sysv5* | sco5v6* | sysv4.2uw2*)
4954 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4955 if test -n "$kargmax"; then
4956 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4957 else
4958 lt_cv_sys_max_cmd_len=32768
4959 fi
4960 ;;
4961 *)
4962 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4963 if test -n "$lt_cv_sys_max_cmd_len"; then
4964 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4965 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4966 else
4967 # Make teststring a little bigger before we do anything with it.
4968 # a 1K string should be a reasonable start.
4969 for i in 1 2 3 4 5 6 7 8 ; do
4970 teststring=$teststring$teststring
4971 done
4972 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4973 # If test is not a shell built-in, we'll probably end up computing a
4974 # maximum length that is only half of the actual maximum length, but
4975 # we can't tell.
4976 while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
4977 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
4978 test $i != 17 # 1/2 MB should be enough
4979 do
4980 i=`expr $i + 1`
4981 teststring=$teststring$teststring
4982 done
4983 # Only check the string length outside the loop.
4984 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4985 teststring=
4986 # Add a significant safety factor because C++ compilers can tack on
4987 # massive amounts of additional arguments before passing them to the
4988 # linker. It appears as though 1/2 is a usable value.
4989 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4990 fi
4991 ;;
4992 esac
4993
4994fi
4995
4996if test -n $lt_cv_sys_max_cmd_len ; then
4997 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4998$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4999else
5000 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
5001$as_echo "none" >&6; }
5002fi
5003max_cmd_len=$lt_cv_sys_max_cmd_len
5004
5005
5006
5007
5008
5009
5010: ${CP="cp -f"}
5011: ${MV="mv -f"}
5012: ${RM="rm -f"}
5013
5014{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
5015$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
5016# Try some XSI features
5017xsi_shell=no
5018( _lt_dummy="a/b/c"
5019 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
5020 = c,a/b,, \
5021 && eval 'test $(( 1 + 1 )) -eq 2 \
5022 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
5023 && xsi_shell=yes
5024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
5025$as_echo "$xsi_shell" >&6; }
5026
5027
5028{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
5029$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
5030lt_shell_append=no
5031( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
5032 >/dev/null 2>&1 \
5033 && lt_shell_append=yes
5034{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
5035$as_echo "$lt_shell_append" >&6; }
5036
5037
5038if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
5039 lt_unset=unset
5040else
5041 lt_unset=false
5042fi
5043
5044
5045
5046
5047
5048# test EBCDIC or ASCII
5049case `echo X|tr X '\101'` in
5050 A) # ASCII based system
5051 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
5052 lt_SP2NL='tr \040 \012'
5053 lt_NL2SP='tr \015\012 \040\040'
5054 ;;
5055 *) # EBCDIC based system
5056 lt_SP2NL='tr \100 \n'
5057 lt_NL2SP='tr \r\n \100\100'
5058 ;;
5059esac
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5070$as_echo_n "checking for $LD option to reload object files... " >&6; }
5071if test "${lt_cv_ld_reload_flag+set}" = set; then :
5072 $as_echo_n "(cached) " >&6
5073else
5074 lt_cv_ld_reload_flag='-r'
5075fi
5076{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5077$as_echo "$lt_cv_ld_reload_flag" >&6; }
5078reload_flag=$lt_cv_ld_reload_flag
5079case $reload_flag in
5080"" | " "*) ;;
5081*) reload_flag=" $reload_flag" ;;
5082esac
5083reload_cmds='$LD$reload_flag -o $output$reload_objs'
5084case $host_os in
5085 darwin*)
5086 if test "$GCC" = yes; then
5087 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5088 else
5089 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5090 fi
5091 ;;
5092esac
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102if test -n "$ac_tool_prefix"; then
5103 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5104set dummy ${ac_tool_prefix}objdump; ac_word=$2
5105{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5106$as_echo_n "checking for $ac_word... " >&6; }
5107if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
5108 $as_echo_n "(cached) " >&6
5109else
5110 if test -n "$OBJDUMP"; then
5111 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5112else
5113as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5114for as_dir in $PATH
5115do
5116 IFS=$as_save_IFS
5117 test -z "$as_dir" && as_dir=.
5118 for ac_exec_ext in '' $ac_executable_extensions; do
5119 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5120 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5121 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5122 break 2
5123 fi
5124done
5125 done
5126IFS=$as_save_IFS
5127
5128fi
5129fi
5130OBJDUMP=$ac_cv_prog_OBJDUMP
5131if test -n "$OBJDUMP"; then
5132 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5133$as_echo "$OBJDUMP" >&6; }
5134else
5135 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5136$as_echo "no" >&6; }
5137fi
5138
5139
5140fi
5141if test -z "$ac_cv_prog_OBJDUMP"; then
5142 ac_ct_OBJDUMP=$OBJDUMP
5143 # Extract the first word of "objdump", so it can be a program name with args.
5144set dummy objdump; ac_word=$2
5145{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5146$as_echo_n "checking for $ac_word... " >&6; }
5147if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
5148 $as_echo_n "(cached) " >&6
5149else
5150 if test -n "$ac_ct_OBJDUMP"; then
5151 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5152else
5153as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5154for as_dir in $PATH
5155do
5156 IFS=$as_save_IFS
5157 test -z "$as_dir" && as_dir=.
5158 for ac_exec_ext in '' $ac_executable_extensions; do
5159 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5160 ac_cv_prog_ac_ct_OBJDUMP="objdump"
5161 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5162 break 2
5163 fi
5164done
5165 done
5166IFS=$as_save_IFS
5167
5168fi
5169fi
5170ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5171if test -n "$ac_ct_OBJDUMP"; then
5172 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5173$as_echo "$ac_ct_OBJDUMP" >&6; }
5174else
5175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5176$as_echo "no" >&6; }
5177fi
5178
5179 if test "x$ac_ct_OBJDUMP" = x; then
5180 OBJDUMP="false"
5181 else
5182 case $cross_compiling:$ac_tool_warned in
5183yes:)
5184{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5185$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5186ac_tool_warned=yes ;;
5187esac
5188 OBJDUMP=$ac_ct_OBJDUMP
5189 fi
5190else
5191 OBJDUMP="$ac_cv_prog_OBJDUMP"
5192fi
5193
5194test -z "$OBJDUMP" && OBJDUMP=objdump
5195
5196
5197
5198
5199
5200
5201{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5202$as_echo_n "checking how to recognize dependent libraries... " >&6; }
5203if test "${lt_cv_deplibs_check_method+set}" = set; then :
5204 $as_echo_n "(cached) " >&6
5205else
5206 lt_cv_file_magic_cmd='$MAGIC_CMD'
5207lt_cv_file_magic_test_file=
5208lt_cv_deplibs_check_method='unknown'
5209# Need to set the preceding variable on all platforms that support
5210# interlibrary dependencies.
5211# 'none' -- dependencies not supported.
5212# `unknown' -- same as none, but documents that we really don't know.
5213# 'pass_all' -- all dependencies passed with no checks.
5214# 'test_compile' -- check by making test program.
5215# 'file_magic [[regex]]' -- check by looking for files in library path
5216# which responds to the $file_magic_cmd with a given extended regex.
5217# If you have `file' or equivalent on your system and you're not sure
5218# whether `pass_all' will *always* work, you probably want this one.
5219
5220case $host_os in
5221aix[4-9]*)
5222 lt_cv_deplibs_check_method=pass_all
5223 ;;
5224
5225beos*)
5226 lt_cv_deplibs_check_method=pass_all
5227 ;;
5228
5229bsdi[45]*)
5230 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5231 lt_cv_file_magic_cmd='/usr/bin/file -L'
5232 lt_cv_file_magic_test_file=/shlib/libc.so
5233 ;;
5234
5235cygwin*)
5236 # func_win32_libid is a shell function defined in ltmain.sh
5237 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5238 lt_cv_file_magic_cmd='func_win32_libid'
5239 ;;
5240
5241mingw* | pw32*)
5242 # Base MSYS/MinGW do not provide the 'file' command needed by
5243 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5244 # unless we find 'file', for example because we are cross-compiling.
5245 if ( file / ) >/dev/null 2>&1; then
5246 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5247 lt_cv_file_magic_cmd='func_win32_libid'
5248 else
5249 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5250 lt_cv_file_magic_cmd='$OBJDUMP -f'
5251 fi
5252 ;;
5253
5254cegcc)
5255 # use the weaker test based on 'objdump'. See mingw*.
5256 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5257 lt_cv_file_magic_cmd='$OBJDUMP -f'
5258 ;;
5259
5260darwin* | rhapsody*)
5261 lt_cv_deplibs_check_method=pass_all
5262 ;;
5263
5264freebsd* | dragonfly*)
5265 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5266 case $host_cpu in
5267 i*86 )
5268 # Not sure whether the presence of OpenBSD here was a mistake.
5269 # Let's accept both of them until this is cleared up.
5270 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5271 lt_cv_file_magic_cmd=/usr/bin/file
5272 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5273 ;;
5274 esac
5275 else
5276 lt_cv_deplibs_check_method=pass_all
5277 fi
5278 ;;
5279
5280gnu*)
5281 lt_cv_deplibs_check_method=pass_all
5282 ;;
5283
5284hpux10.20* | hpux11*)
5285 lt_cv_file_magic_cmd=/usr/bin/file
5286 case $host_cpu in
5287 ia64*)
5288 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5289 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5290 ;;
5291 hppa*64*)
5292 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
5293 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5294 ;;
5295 *)
5296 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
5297 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5298 ;;
5299 esac
5300 ;;
5301
5302interix[3-9]*)
5303 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5304 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5305 ;;
5306
5307irix5* | irix6* | nonstopux*)
5308 case $LD in
5309 *-32|*"-32 ") libmagic=32-bit;;
5310 *-n32|*"-n32 ") libmagic=N32;;
5311 *-64|*"-64 ") libmagic=64-bit;;
5312 *) libmagic=never-match;;
5313 esac
5314 lt_cv_deplibs_check_method=pass_all
5315 ;;
5316
5317# This must be Linux ELF.
5318linux* | k*bsd*-gnu | kopensolaris*-gnu)
5319 lt_cv_deplibs_check_method=pass_all
5320 ;;
5321
5322netbsd* | netbsdelf*-gnu)
5323 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5324 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5325 else
5326 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5327 fi
5328 ;;
5329
5330newos6*)
5331 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5332 lt_cv_file_magic_cmd=/usr/bin/file
5333 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5334 ;;
5335
5336*nto* | *qnx*)
5337 lt_cv_deplibs_check_method=pass_all
5338 ;;
5339
5340openbsd*)
5341 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5342 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5343 else
5344 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5345 fi
5346 ;;
5347
5348osf3* | osf4* | osf5*)
5349 lt_cv_deplibs_check_method=pass_all
5350 ;;
5351
5352rdos*)
5353 lt_cv_deplibs_check_method=pass_all
5354 ;;
5355
5356solaris*)
5357 lt_cv_deplibs_check_method=pass_all
5358 ;;
5359
5360sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5361 lt_cv_deplibs_check_method=pass_all
5362 ;;
5363
5364sysv4 | sysv4.3*)
5365 case $host_vendor in
5366 motorola)
5367 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5368 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5369 ;;
5370 ncr)
5371 lt_cv_deplibs_check_method=pass_all
5372 ;;
5373 sequent)
5374 lt_cv_file_magic_cmd='/bin/file'
5375 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5376 ;;
5377 sni)
5378 lt_cv_file_magic_cmd='/bin/file'
5379 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5380 lt_cv_file_magic_test_file=/lib/libc.so
5381 ;;
5382 siemens)
5383 lt_cv_deplibs_check_method=pass_all
5384 ;;
5385 pc)
5386 lt_cv_deplibs_check_method=pass_all
5387 ;;
5388 esac
5389 ;;
5390
5391tpf*)
5392 lt_cv_deplibs_check_method=pass_all
5393 ;;
5394esac
5395
5396fi
5397{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5398$as_echo "$lt_cv_deplibs_check_method" >&6; }
5399file_magic_cmd=$lt_cv_file_magic_cmd
5400deplibs_check_method=$lt_cv_deplibs_check_method
5401test -z "$deplibs_check_method" && deplibs_check_method=unknown
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414if test -n "$ac_tool_prefix"; then
5415 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5416set dummy ${ac_tool_prefix}ar; ac_word=$2
5417{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5418$as_echo_n "checking for $ac_word... " >&6; }
5419if test "${ac_cv_prog_AR+set}" = set; then :
5420 $as_echo_n "(cached) " >&6
5421else
5422 if test -n "$AR"; then
5423 ac_cv_prog_AR="$AR" # Let the user override the test.
5424else
5425as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5426for as_dir in $PATH
5427do
5428 IFS=$as_save_IFS
5429 test -z "$as_dir" && as_dir=.
5430 for ac_exec_ext in '' $ac_executable_extensions; do
5431 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5432 ac_cv_prog_AR="${ac_tool_prefix}ar"
5433 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5434 break 2
5435 fi
5436done
5437 done
5438IFS=$as_save_IFS
5439
5440fi
5441fi
5442AR=$ac_cv_prog_AR
5443if test -n "$AR"; then
5444 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5445$as_echo "$AR" >&6; }
5446else
5447 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5448$as_echo "no" >&6; }
5449fi
5450
5451
5452fi
5453if test -z "$ac_cv_prog_AR"; then
5454 ac_ct_AR=$AR
5455 # Extract the first word of "ar", so it can be a program name with args.
5456set dummy ar; ac_word=$2
5457{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5458$as_echo_n "checking for $ac_word... " >&6; }
5459if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
5460 $as_echo_n "(cached) " >&6
5461else
5462 if test -n "$ac_ct_AR"; then
5463 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5464else
5465as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5466for as_dir in $PATH
5467do
5468 IFS=$as_save_IFS
5469 test -z "$as_dir" && as_dir=.
5470 for ac_exec_ext in '' $ac_executable_extensions; do
5471 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5472 ac_cv_prog_ac_ct_AR="ar"
5473 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5474 break 2
5475 fi
5476done
5477 done
5478IFS=$as_save_IFS
5479
5480fi
5481fi
5482ac_ct_AR=$ac_cv_prog_ac_ct_AR
5483if test -n "$ac_ct_AR"; then
5484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5485$as_echo "$ac_ct_AR" >&6; }
5486else
5487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5488$as_echo "no" >&6; }
5489fi
5490
5491 if test "x$ac_ct_AR" = x; then
5492 AR="false"
5493 else
5494 case $cross_compiling:$ac_tool_warned in
5495yes:)
5496{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5497$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5498ac_tool_warned=yes ;;
5499esac
5500 AR=$ac_ct_AR
5501 fi
5502else
5503 AR="$ac_cv_prog_AR"
5504fi
5505
5506test -z "$AR" && AR=ar
5507test -z "$AR_FLAGS" && AR_FLAGS=cru
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519if test -n "$ac_tool_prefix"; then
5520 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5521set dummy ${ac_tool_prefix}strip; ac_word=$2
5522{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5523$as_echo_n "checking for $ac_word... " >&6; }
5524if test "${ac_cv_prog_STRIP+set}" = set; then :
5525 $as_echo_n "(cached) " >&6
5526else
5527 if test -n "$STRIP"; then
5528 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5529else
5530as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5531for as_dir in $PATH
5532do
5533 IFS=$as_save_IFS
5534 test -z "$as_dir" && as_dir=.
5535 for ac_exec_ext in '' $ac_executable_extensions; do
5536 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5537 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5538 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5539 break 2
5540 fi
5541done
5542 done
5543IFS=$as_save_IFS
5544
5545fi
5546fi
5547STRIP=$ac_cv_prog_STRIP
5548if test -n "$STRIP"; then
5549 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5550$as_echo "$STRIP" >&6; }
5551else
5552 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5553$as_echo "no" >&6; }
5554fi
5555
5556
5557fi
5558if test -z "$ac_cv_prog_STRIP"; then
5559 ac_ct_STRIP=$STRIP
5560 # Extract the first word of "strip", so it can be a program name with args.
5561set dummy strip; ac_word=$2
5562{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5563$as_echo_n "checking for $ac_word... " >&6; }
5564if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
5565 $as_echo_n "(cached) " >&6
5566else
5567 if test -n "$ac_ct_STRIP"; then
5568 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5569else
5570as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5571for as_dir in $PATH
5572do
5573 IFS=$as_save_IFS
5574 test -z "$as_dir" && as_dir=.
5575 for ac_exec_ext in '' $ac_executable_extensions; do
5576 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5577 ac_cv_prog_ac_ct_STRIP="strip"
5578 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5579 break 2
5580 fi
5581done
5582 done
5583IFS=$as_save_IFS
5584
5585fi
5586fi
5587ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5588if test -n "$ac_ct_STRIP"; then
5589 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5590$as_echo "$ac_ct_STRIP" >&6; }
5591else
5592 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5593$as_echo "no" >&6; }
5594fi
5595
5596 if test "x$ac_ct_STRIP" = x; then
5597 STRIP=":"
5598 else
5599 case $cross_compiling:$ac_tool_warned in
5600yes:)
5601{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5602$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5603ac_tool_warned=yes ;;
5604esac
5605 STRIP=$ac_ct_STRIP
5606 fi
5607else
5608 STRIP="$ac_cv_prog_STRIP"
5609fi
5610
5611test -z "$STRIP" && STRIP=:
5612
5613
5614
5615
5616
5617
5618if test -n "$ac_tool_prefix"; then
5619 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5620set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5621{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5622$as_echo_n "checking for $ac_word... " >&6; }
5623if test "${ac_cv_prog_RANLIB+set}" = set; then :
5624 $as_echo_n "(cached) " >&6
5625else
5626 if test -n "$RANLIB"; then
5627 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5628else
5629as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5630for as_dir in $PATH
5631do
5632 IFS=$as_save_IFS
5633 test -z "$as_dir" && as_dir=.
5634 for ac_exec_ext in '' $ac_executable_extensions; do
5635 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5636 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5637 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5638 break 2
5639 fi
5640done
5641 done
5642IFS=$as_save_IFS
5643
5644fi
5645fi
5646RANLIB=$ac_cv_prog_RANLIB
5647if test -n "$RANLIB"; then
5648 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5649$as_echo "$RANLIB" >&6; }
5650else
5651 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5652$as_echo "no" >&6; }
5653fi
5654
5655
5656fi
5657if test -z "$ac_cv_prog_RANLIB"; then
5658 ac_ct_RANLIB=$RANLIB
5659 # Extract the first word of "ranlib", so it can be a program name with args.
5660set dummy ranlib; ac_word=$2
5661{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5662$as_echo_n "checking for $ac_word... " >&6; }
5663if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
5664 $as_echo_n "(cached) " >&6
5665else
5666 if test -n "$ac_ct_RANLIB"; then
5667 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5668else
5669as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5670for as_dir in $PATH
5671do
5672 IFS=$as_save_IFS
5673 test -z "$as_dir" && as_dir=.
5674 for ac_exec_ext in '' $ac_executable_extensions; do
5675 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5676 ac_cv_prog_ac_ct_RANLIB="ranlib"
5677 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5678 break 2
5679 fi
5680done
5681 done
5682IFS=$as_save_IFS
5683
5684fi
5685fi
5686ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5687if test -n "$ac_ct_RANLIB"; then
5688 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5689$as_echo "$ac_ct_RANLIB" >&6; }
5690else
5691 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5692$as_echo "no" >&6; }
5693fi
5694
5695 if test "x$ac_ct_RANLIB" = x; then
5696 RANLIB=":"
5697 else
5698 case $cross_compiling:$ac_tool_warned in
5699yes:)
5700{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5701$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5702ac_tool_warned=yes ;;
5703esac
5704 RANLIB=$ac_ct_RANLIB
5705 fi
5706else
5707 RANLIB="$ac_cv_prog_RANLIB"
5708fi
5709
5710test -z "$RANLIB" && RANLIB=:
5711
5712
5713
5714
5715
5716
5717# Determine commands to create old-style static archives.
5718old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5719old_postinstall_cmds='chmod 644 $oldlib'
5720old_postuninstall_cmds=
5721
5722if test -n "$RANLIB"; then
5723 case $host_os in
5724 openbsd*)
5725 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
5726 ;;
5727 *)
5728 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
5729 ;;
5730 esac
5731 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5732fi
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767# If no C compiler was specified, use CC.
5768LTCC=${LTCC-"$CC"}
5769
5770# If no C compiler flags were specified, use CFLAGS.
5771LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
5772
5773# Allow CC to be a program name with arguments.
5774compiler=$CC
5775
5776
5777# Check for command to grab the raw symbol name followed by C symbol from nm.
5778{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
5779$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
5780if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
5781 $as_echo_n "(cached) " >&6
5782else
5783
5784# These are sane defaults that work on at least a few old systems.
5785# [They come from Ultrix. What could be older than Ultrix?!! ;)]
5786
5787# Character class describing NM global symbol codes.
5788symcode='[BCDEGRST]'
5789
5790# Regexp to match symbols that can be accessed directly from C.
5791sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
5792
5793# Define system-specific variables.
5794case $host_os in
5795aix*)
5796 symcode='[BCDT]'
5797 ;;
5798cygwin* | mingw* | pw32* | cegcc*)
5799 symcode='[ABCDGISTW]'
5800 ;;
5801hpux*)
5802 if test "$host_cpu" = ia64; then
5803 symcode='[ABCDEGRST]'
5804 fi
5805 ;;
5806irix* | nonstopux*)
5807 symcode='[BCDEGRST]'
5808 ;;
5809osf*)
5810 symcode='[BCDEGQRST]'
5811 ;;
5812solaris*)
5813 symcode='[BDRT]'
5814 ;;
5815sco3.2v5*)
5816 symcode='[DT]'
5817 ;;
5818sysv4.2uw2*)
5819 symcode='[DT]'
5820 ;;
5821sysv5* | sco5v6* | unixware* | OpenUNIX*)
5822 symcode='[ABDT]'
5823 ;;
5824sysv4)
5825 symcode='[DFNSTU]'
5826 ;;
5827esac
5828
5829# If we're using GNU nm, then use its standard symbol codes.
5830case `$NM -V 2>&1` in
5831*GNU* | *'with BFD'*)
5832 symcode='[ABCDGIRSTW]' ;;
5833esac
5834
5835# Transform an extracted symbol line into a proper C declaration.
5836# Some systems (esp. on ia64) link data and code symbols differently,
5837# so use this general approach.
5838lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5839
5840# Transform an extracted symbol line into symbol name and symbol address
5841lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5842lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
5843
5844# Handle CRLF in mingw tool chain
5845opt_cr=
5846case $build_os in
5847mingw*)
5848 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5849 ;;
5850esac
5851
5852# Try without a prefix underscore, then with it.
5853for ac_symprfx in "" "_"; do
5854
5855 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5856 symxfrm="\\1 $ac_symprfx\\2 \\2"
5857
5858 # Write the raw and C identifiers.
5859 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5860 # Fake it for dumpbin and say T for any non-static function
5861 # and D for any global variable.
5862 # Also find C++ and __fastcall symbols from MSVC++,
5863 # which start with @ or ?.
5864 lt_cv_sys_global_symbol_pipe="$AWK '"\
5865" {last_section=section; section=\$ 3};"\
5866" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5867" \$ 0!~/External *\|/{next};"\
5868" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5869" {if(hide[section]) next};"\
5870" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5871" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5872" s[1]~/^[@?]/{print s[1], s[1]; next};"\
5873" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5874" ' prfx=^$ac_symprfx"
5875 else
5876 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5877 fi
5878
5879 # Check to see that the pipe works correctly.
5880 pipe_works=no
5881
5882 rm -f conftest*
5883 cat > conftest.$ac_ext <<_LT_EOF
5884#ifdef __cplusplus
5885extern "C" {
5886#endif
5887char nm_test_var;
5888void nm_test_func(void);
5889void nm_test_func(void){}
5890#ifdef __cplusplus
5891}
5892#endif
5893int main(){nm_test_var='a';nm_test_func();return(0);}
5894_LT_EOF
5895
5896 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5897 (eval $ac_compile) 2>&5
5898 ac_status=$?
5899 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5900 test $ac_status = 0; }; then
5901 # Now try to grab the symbols.
5902 nlist=conftest.nm
5903 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
5904 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
5905 ac_status=$?
5906 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5907 test $ac_status = 0; } && test -s "$nlist"; then
5908 # Try sorting and uniquifying the output.
5909 if sort "$nlist" | uniq > "$nlist"T; then
5910 mv -f "$nlist"T "$nlist"
5911 else
5912 rm -f "$nlist"T
5913 fi
5914
5915 # Make sure that we snagged all the symbols we need.
5916 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5917 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5918 cat <<_LT_EOF > conftest.$ac_ext
5919#ifdef __cplusplus
5920extern "C" {
5921#endif
5922
5923_LT_EOF
5924 # Now generate the symbol file.
5925 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5926
5927 cat <<_LT_EOF >> conftest.$ac_ext
5928
5929/* The mapping between symbol names and symbols. */
5930const struct {
5931 const char *name;
5932 void *address;
5933}
5934lt__PROGRAM__LTX_preloaded_symbols[] =
5935{
5936 { "@PROGRAM@", (void *) 0 },
5937_LT_EOF
5938 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5939 cat <<\_LT_EOF >> conftest.$ac_ext
5940 {0, (void *) 0}
5941};
5942
5943/* This works around a problem in FreeBSD linker */
5944#ifdef FREEBSD_WORKAROUND
5945static const void *lt_preloaded_setup() {
5946 return lt__PROGRAM__LTX_preloaded_symbols;
5947}
5948#endif
5949
5950#ifdef __cplusplus
5951}
5952#endif
5953_LT_EOF
5954 # Now try linking the two files.
5955 mv conftest.$ac_objext conftstm.$ac_objext
5956 lt_save_LIBS="$LIBS"
5957 lt_save_CFLAGS="$CFLAGS"
5958 LIBS="conftstm.$ac_objext"
5959 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
5960 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
5961 (eval $ac_link) 2>&5
5962 ac_status=$?
5963 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5964 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
5965 pipe_works=yes
5966 fi
5967 LIBS="$lt_save_LIBS"
5968 CFLAGS="$lt_save_CFLAGS"
5969 else
5970 echo "cannot find nm_test_func in $nlist" >&5
5971 fi
5972 else
5973 echo "cannot find nm_test_var in $nlist" >&5
5974 fi
5975 else
5976 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
5977 fi
5978 else
5979 echo "$progname: failed program was:" >&5
5980 cat conftest.$ac_ext >&5
5981 fi
5982 rm -rf conftest* conftst*
5983
5984 # Do not use the global_symbol_pipe unless it works.
5985 if test "$pipe_works" = yes; then
5986 break
5987 else
5988 lt_cv_sys_global_symbol_pipe=
5989 fi
5990done
5991
5992fi
5993
5994if test -z "$lt_cv_sys_global_symbol_pipe"; then
5995 lt_cv_sys_global_symbol_to_cdecl=
5996fi
5997if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5998 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
5999$as_echo "failed" >&6; }
6000else
6001 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
6002$as_echo "ok" >&6; }
6003fi
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027# Check whether --enable-libtool-lock was given.
6028if test "${enable_libtool_lock+set}" = set; then :
6029 enableval=$enable_libtool_lock;
6030fi
6031
6032test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6033
6034# Some flags need to be propagated to the compiler or linker for good
6035# libtool support.
6036case $host in
6037ia64-*-hpux*)
6038 # Find out which ABI we are using.
6039 echo 'int i;' > conftest.$ac_ext
6040 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6041 (eval $ac_compile) 2>&5
6042 ac_status=$?
6043 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6044 test $ac_status = 0; }; then
6045 case `/usr/bin/file conftest.$ac_objext` in
6046 *ELF-32*)
6047 HPUX_IA64_MODE="32"
6048 ;;
6049 *ELF-64*)
6050 HPUX_IA64_MODE="64"
6051 ;;
6052 esac
6053 fi
6054 rm -rf conftest*
6055 ;;
6056*-*-irix6*)
6057 # Find out which ABI we are using.
6058 echo '#line 6058 "configure"' > conftest.$ac_ext
6059 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6060 (eval $ac_compile) 2>&5
6061 ac_status=$?
6062 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6063 test $ac_status = 0; }; then
6064 if test "$lt_cv_prog_gnu_ld" = yes; then
6065 case `/usr/bin/file conftest.$ac_objext` in
6066 *32-bit*)
6067 LD="${LD-ld} -melf32bsmip"
6068 ;;
6069 *N32*)
6070 LD="${LD-ld} -melf32bmipn32"
6071 ;;
6072 *64-bit*)
6073 LD="${LD-ld} -melf64bmip"
6074 ;;
6075 esac
6076 else
6077 case `/usr/bin/file conftest.$ac_objext` in
6078 *32-bit*)
6079 LD="${LD-ld} -32"
6080 ;;
6081 *N32*)
6082 LD="${LD-ld} -n32"
6083 ;;
6084 *64-bit*)
6085 LD="${LD-ld} -64"
6086 ;;
6087 esac
6088 fi
6089 fi
6090 rm -rf conftest*
6091 ;;
6092
6093x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6094s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6095 # Find out which ABI we are using.
6096 echo 'int i;' > conftest.$ac_ext
6097 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6098 (eval $ac_compile) 2>&5
6099 ac_status=$?
6100 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6101 test $ac_status = 0; }; then
6102 case `/usr/bin/file conftest.o` in
6103 *32-bit*)
6104 case $host in
6105 x86_64-*kfreebsd*-gnu)
6106 LD="${LD-ld} -m elf_i386_fbsd"
6107 ;;
6108 x86_64-*linux*)
6109 LD="${LD-ld} -m elf_i386"
6110 ;;
6111 ppc64-*linux*|powerpc64-*linux*)
6112 LD="${LD-ld} -m elf32ppclinux"
6113 ;;
6114 s390x-*linux*)
6115 LD="${LD-ld} -m elf_s390"
6116 ;;
6117 sparc64-*linux*)
6118 LD="${LD-ld} -m elf32_sparc"
6119 ;;
6120 esac
6121 ;;
6122 *64-bit*)
6123 case $host in
6124 x86_64-*kfreebsd*-gnu)
6125 LD="${LD-ld} -m elf_x86_64_fbsd"
6126 ;;
6127 x86_64-*linux*)
6128 LD="${LD-ld} -m elf_x86_64"
6129 ;;
6130 ppc*-*linux*|powerpc*-*linux*)
6131 LD="${LD-ld} -m elf64ppc"
6132 ;;
6133 s390*-*linux*|s390*-*tpf*)
6134 LD="${LD-ld} -m elf64_s390"
6135 ;;
6136 sparc*-*linux*)
6137 LD="${LD-ld} -m elf64_sparc"
6138 ;;
6139 esac
6140 ;;
6141 esac
6142 fi
6143 rm -rf conftest*
6144 ;;
6145
6146*-*-sco3.2v5*)
6147 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6148 SAVE_CFLAGS="$CFLAGS"
6149 CFLAGS="$CFLAGS -belf"
6150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6151$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6152if test "${lt_cv_cc_needs_belf+set}" = set; then :
6153 $as_echo_n "(cached) " >&6
6154else
6155 ac_ext=c
6156ac_cpp='$CPP $CPPFLAGS'
6157ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6158ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6159ac_compiler_gnu=$ac_cv_c_compiler_gnu
6160
6161 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6162/* end confdefs.h. */
6163
6164int
6165main ()
6166{
6167
6168 ;
6169 return 0;
6170}
6171_ACEOF
6172if ac_fn_c_try_link "$LINENO"; then :
6173 lt_cv_cc_needs_belf=yes
6174else
6175 lt_cv_cc_needs_belf=no
6176fi
6177rm -f core conftest.err conftest.$ac_objext \
6178 conftest$ac_exeext conftest.$ac_ext
6179 ac_ext=c
6180ac_cpp='$CPP $CPPFLAGS'
6181ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6182ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6183ac_compiler_gnu=$ac_cv_c_compiler_gnu
6184
6185fi
6186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6187$as_echo "$lt_cv_cc_needs_belf" >&6; }
6188 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6189 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6190 CFLAGS="$SAVE_CFLAGS"
6191 fi
6192 ;;
6193sparc*-*solaris*)
6194 # Find out which ABI we are using.
6195 echo 'int i;' > conftest.$ac_ext
6196 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6197 (eval $ac_compile) 2>&5
6198 ac_status=$?
6199 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6200 test $ac_status = 0; }; then
6201 case `/usr/bin/file conftest.o` in
6202 *64-bit*)
6203 case $lt_cv_prog_gnu_ld in
6204 yes*) LD="${LD-ld} -m elf64_sparc" ;;
6205 *)
6206 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6207 LD="${LD-ld} -64"
6208 fi
6209 ;;
6210 esac
6211 ;;
6212 esac
6213 fi
6214 rm -rf conftest*
6215 ;;
6216esac
6217
6218need_locks="$enable_libtool_lock"
6219
6220
6221 case $host_os in
6222 rhapsody* | darwin*)
6223 if test -n "$ac_tool_prefix"; then
6224 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6225set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6226{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6227$as_echo_n "checking for $ac_word... " >&6; }
6228if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
6229 $as_echo_n "(cached) " >&6
6230else
6231 if test -n "$DSYMUTIL"; then
6232 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6233else
6234as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6235for as_dir in $PATH
6236do
6237 IFS=$as_save_IFS
6238 test -z "$as_dir" && as_dir=.
6239 for ac_exec_ext in '' $ac_executable_extensions; do
6240 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6241 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6242 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6243 break 2
6244 fi
6245done
6246 done
6247IFS=$as_save_IFS
6248
6249fi
6250fi
6251DSYMUTIL=$ac_cv_prog_DSYMUTIL
6252if test -n "$DSYMUTIL"; then
6253 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6254$as_echo "$DSYMUTIL" >&6; }
6255else
6256 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6257$as_echo "no" >&6; }
6258fi
6259
6260
6261fi
6262if test -z "$ac_cv_prog_DSYMUTIL"; then
6263 ac_ct_DSYMUTIL=$DSYMUTIL
6264 # Extract the first word of "dsymutil", so it can be a program name with args.
6265set dummy dsymutil; ac_word=$2
6266{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6267$as_echo_n "checking for $ac_word... " >&6; }
6268if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
6269 $as_echo_n "(cached) " >&6
6270else
6271 if test -n "$ac_ct_DSYMUTIL"; then
6272 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6273else
6274as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6275for as_dir in $PATH
6276do
6277 IFS=$as_save_IFS
6278 test -z "$as_dir" && as_dir=.
6279 for ac_exec_ext in '' $ac_executable_extensions; do
6280 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6281 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6282 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6283 break 2
6284 fi
6285done
6286 done
6287IFS=$as_save_IFS
6288
6289fi
6290fi
6291ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6292if test -n "$ac_ct_DSYMUTIL"; then
6293 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6294$as_echo "$ac_ct_DSYMUTIL" >&6; }
6295else
6296 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6297$as_echo "no" >&6; }
6298fi
6299
6300 if test "x$ac_ct_DSYMUTIL" = x; then
6301 DSYMUTIL=":"
6302 else
6303 case $cross_compiling:$ac_tool_warned in
6304yes:)
6305{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6306$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6307ac_tool_warned=yes ;;
6308esac
6309 DSYMUTIL=$ac_ct_DSYMUTIL
6310 fi
6311else
6312 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6313fi
6314
6315 if test -n "$ac_tool_prefix"; then
6316 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6317set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6318{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6319$as_echo_n "checking for $ac_word... " >&6; }
6320if test "${ac_cv_prog_NMEDIT+set}" = set; then :
6321 $as_echo_n "(cached) " >&6
6322else
6323 if test -n "$NMEDIT"; then
6324 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6325else
6326as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6327for as_dir in $PATH
6328do
6329 IFS=$as_save_IFS
6330 test -z "$as_dir" && as_dir=.
6331 for ac_exec_ext in '' $ac_executable_extensions; do
6332 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6333 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
6334 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6335 break 2
6336 fi
6337done
6338 done
6339IFS=$as_save_IFS
6340
6341fi
6342fi
6343NMEDIT=$ac_cv_prog_NMEDIT
6344if test -n "$NMEDIT"; then
6345 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
6346$as_echo "$NMEDIT" >&6; }
6347else
6348 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6349$as_echo "no" >&6; }
6350fi
6351
6352
6353fi
6354if test -z "$ac_cv_prog_NMEDIT"; then
6355 ac_ct_NMEDIT=$NMEDIT
6356 # Extract the first word of "nmedit", so it can be a program name with args.
6357set dummy nmedit; ac_word=$2
6358{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6359$as_echo_n "checking for $ac_word... " >&6; }
6360if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
6361 $as_echo_n "(cached) " >&6
6362else
6363 if test -n "$ac_ct_NMEDIT"; then
6364 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
6365else
6366as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6367for as_dir in $PATH
6368do
6369 IFS=$as_save_IFS
6370 test -z "$as_dir" && as_dir=.
6371 for ac_exec_ext in '' $ac_executable_extensions; do
6372 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6373 ac_cv_prog_ac_ct_NMEDIT="nmedit"
6374 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6375 break 2
6376 fi
6377done
6378 done
6379IFS=$as_save_IFS
6380
6381fi
6382fi
6383ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
6384if test -n "$ac_ct_NMEDIT"; then
6385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
6386$as_echo "$ac_ct_NMEDIT" >&6; }
6387else
6388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6389$as_echo "no" >&6; }
6390fi
6391
6392 if test "x$ac_ct_NMEDIT" = x; then
6393 NMEDIT=":"
6394 else
6395 case $cross_compiling:$ac_tool_warned in
6396yes:)
6397{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6398$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6399ac_tool_warned=yes ;;
6400esac
6401 NMEDIT=$ac_ct_NMEDIT
6402 fi
6403else
6404 NMEDIT="$ac_cv_prog_NMEDIT"
6405fi
6406
6407 if test -n "$ac_tool_prefix"; then
6408 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
6409set dummy ${ac_tool_prefix}lipo; ac_word=$2
6410{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6411$as_echo_n "checking for $ac_word... " >&6; }
6412if test "${ac_cv_prog_LIPO+set}" = set; then :
6413 $as_echo_n "(cached) " >&6
6414else
6415 if test -n "$LIPO"; then
6416 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
6417else
6418as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6419for as_dir in $PATH
6420do
6421 IFS=$as_save_IFS
6422 test -z "$as_dir" && as_dir=.
6423 for ac_exec_ext in '' $ac_executable_extensions; do
6424 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6425 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
6426 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6427 break 2
6428 fi
6429done
6430 done
6431IFS=$as_save_IFS
6432
6433fi
6434fi
6435LIPO=$ac_cv_prog_LIPO
6436if test -n "$LIPO"; then
6437 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
6438$as_echo "$LIPO" >&6; }
6439else
6440 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6441$as_echo "no" >&6; }
6442fi
6443
6444
6445fi
6446if test -z "$ac_cv_prog_LIPO"; then
6447 ac_ct_LIPO=$LIPO
6448 # Extract the first word of "lipo", so it can be a program name with args.
6449set dummy lipo; ac_word=$2
6450{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6451$as_echo_n "checking for $ac_word... " >&6; }
6452if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
6453 $as_echo_n "(cached) " >&6
6454else
6455 if test -n "$ac_ct_LIPO"; then
6456 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
6457else
6458as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6459for as_dir in $PATH
6460do
6461 IFS=$as_save_IFS
6462 test -z "$as_dir" && as_dir=.
6463 for ac_exec_ext in '' $ac_executable_extensions; do
6464 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6465 ac_cv_prog_ac_ct_LIPO="lipo"
6466 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6467 break 2
6468 fi
6469done
6470 done
6471IFS=$as_save_IFS
6472
6473fi
6474fi
6475ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
6476if test -n "$ac_ct_LIPO"; then
6477 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
6478$as_echo "$ac_ct_LIPO" >&6; }
6479else
6480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6481$as_echo "no" >&6; }
6482fi
6483
6484 if test "x$ac_ct_LIPO" = x; then
6485 LIPO=":"
6486 else
6487 case $cross_compiling:$ac_tool_warned in
6488yes:)
6489{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6490$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6491ac_tool_warned=yes ;;
6492esac
6493 LIPO=$ac_ct_LIPO
6494 fi
6495else
6496 LIPO="$ac_cv_prog_LIPO"
6497fi
6498
6499 if test -n "$ac_tool_prefix"; then
6500 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
6501set dummy ${ac_tool_prefix}otool; ac_word=$2
6502{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6503$as_echo_n "checking for $ac_word... " >&6; }
6504if test "${ac_cv_prog_OTOOL+set}" = set; then :
6505 $as_echo_n "(cached) " >&6
6506else
6507 if test -n "$OTOOL"; then
6508 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
6509else
6510as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6511for as_dir in $PATH
6512do
6513 IFS=$as_save_IFS
6514 test -z "$as_dir" && as_dir=.
6515 for ac_exec_ext in '' $ac_executable_extensions; do
6516 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6517 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
6518 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6519 break 2
6520 fi
6521done
6522 done
6523IFS=$as_save_IFS
6524
6525fi
6526fi
6527OTOOL=$ac_cv_prog_OTOOL
6528if test -n "$OTOOL"; then
6529 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
6530$as_echo "$OTOOL" >&6; }
6531else
6532 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6533$as_echo "no" >&6; }
6534fi
6535
6536
6537fi
6538if test -z "$ac_cv_prog_OTOOL"; then
6539 ac_ct_OTOOL=$OTOOL
6540 # Extract the first word of "otool", so it can be a program name with args.
6541set dummy otool; ac_word=$2
6542{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6543$as_echo_n "checking for $ac_word... " >&6; }
6544if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
6545 $as_echo_n "(cached) " >&6
6546else
6547 if test -n "$ac_ct_OTOOL"; then
6548 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
6549else
6550as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6551for as_dir in $PATH
6552do
6553 IFS=$as_save_IFS
6554 test -z "$as_dir" && as_dir=.
6555 for ac_exec_ext in '' $ac_executable_extensions; do
6556 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6557 ac_cv_prog_ac_ct_OTOOL="otool"
6558 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6559 break 2
6560 fi
6561done
6562 done
6563IFS=$as_save_IFS
6564
6565fi
6566fi
6567ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
6568if test -n "$ac_ct_OTOOL"; then
6569 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
6570$as_echo "$ac_ct_OTOOL" >&6; }
6571else
6572 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6573$as_echo "no" >&6; }
6574fi
6575
6576 if test "x$ac_ct_OTOOL" = x; then
6577 OTOOL=":"
6578 else
6579 case $cross_compiling:$ac_tool_warned in
6580yes:)
6581{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6582$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6583ac_tool_warned=yes ;;
6584esac
6585 OTOOL=$ac_ct_OTOOL
6586 fi
6587else
6588 OTOOL="$ac_cv_prog_OTOOL"
6589fi
6590
6591 if test -n "$ac_tool_prefix"; then
6592 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
6593set dummy ${ac_tool_prefix}otool64; ac_word=$2
6594{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6595$as_echo_n "checking for $ac_word... " >&6; }
6596if test "${ac_cv_prog_OTOOL64+set}" = set; then :
6597 $as_echo_n "(cached) " >&6
6598else
6599 if test -n "$OTOOL64"; then
6600 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
6601else
6602as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6603for as_dir in $PATH
6604do
6605 IFS=$as_save_IFS
6606 test -z "$as_dir" && as_dir=.
6607 for ac_exec_ext in '' $ac_executable_extensions; do
6608 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6609 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
6610 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6611 break 2
6612 fi
6613done
6614 done
6615IFS=$as_save_IFS
6616
6617fi
6618fi
6619OTOOL64=$ac_cv_prog_OTOOL64
6620if test -n "$OTOOL64"; then
6621 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
6622$as_echo "$OTOOL64" >&6; }
6623else
6624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6625$as_echo "no" >&6; }
6626fi
6627
6628
6629fi
6630if test -z "$ac_cv_prog_OTOOL64"; then
6631 ac_ct_OTOOL64=$OTOOL64
6632 # Extract the first word of "otool64", so it can be a program name with args.
6633set dummy otool64; ac_word=$2
6634{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6635$as_echo_n "checking for $ac_word... " >&6; }
6636if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
6637 $as_echo_n "(cached) " >&6
6638else
6639 if test -n "$ac_ct_OTOOL64"; then
6640 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
6641else
6642as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6643for as_dir in $PATH
6644do
6645 IFS=$as_save_IFS
6646 test -z "$as_dir" && as_dir=.
6647 for ac_exec_ext in '' $ac_executable_extensions; do
6648 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6649 ac_cv_prog_ac_ct_OTOOL64="otool64"
6650 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6651 break 2
6652 fi
6653done
6654 done
6655IFS=$as_save_IFS
6656
6657fi
6658fi
6659ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
6660if test -n "$ac_ct_OTOOL64"; then
6661 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
6662$as_echo "$ac_ct_OTOOL64" >&6; }
6663else
6664 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6665$as_echo "no" >&6; }
6666fi
6667
6668 if test "x$ac_ct_OTOOL64" = x; then
6669 OTOOL64=":"
6670 else
6671 case $cross_compiling:$ac_tool_warned in
6672yes:)
6673{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6674$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6675ac_tool_warned=yes ;;
6676esac
6677 OTOOL64=$ac_ct_OTOOL64
6678 fi
6679else
6680 OTOOL64="$ac_cv_prog_OTOOL64"
6681fi
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
6710$as_echo_n "checking for -single_module linker flag... " >&6; }
6711if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
6712 $as_echo_n "(cached) " >&6
6713else
6714 lt_cv_apple_cc_single_mod=no
6715 if test -z "${LT_MULTI_MODULE}"; then
6716 # By default we will add the -single_module flag. You can override
6717 # by either setting the environment variable LT_MULTI_MODULE
6718 # non-empty at configure time, or by adding -multi_module to the
6719 # link flags.
6720 rm -rf libconftest.dylib*
6721 echo "int foo(void){return 1;}" > conftest.c
6722 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6723-dynamiclib -Wl,-single_module conftest.c" >&5
6724 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6725 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
6726 _lt_result=$?
6727 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
6728 lt_cv_apple_cc_single_mod=yes
6729 else
6730 cat conftest.err >&5
6731 fi
6732 rm -rf libconftest.dylib*
6733 rm -f conftest.*
6734 fi
6735fi
6736{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
6737$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
6738 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
6739$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
6740if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
6741 $as_echo_n "(cached) " >&6
6742else
6743 lt_cv_ld_exported_symbols_list=no
6744 save_LDFLAGS=$LDFLAGS
6745 echo "_main" > conftest.sym
6746 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
6747 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6748/* end confdefs.h. */
6749
6750int
6751main ()
6752{
6753
6754 ;
6755 return 0;
6756}
6757_ACEOF
6758if ac_fn_c_try_link "$LINENO"; then :
6759 lt_cv_ld_exported_symbols_list=yes
6760else
6761 lt_cv_ld_exported_symbols_list=no
6762fi
6763rm -f core conftest.err conftest.$ac_objext \
6764 conftest$ac_exeext conftest.$ac_ext
6765 LDFLAGS="$save_LDFLAGS"
6766
6767fi
6768{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
6769$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
6770 case $host_os in
6771 rhapsody* | darwin1.[012])
6772 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
6773 darwin1.*)
6774 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6775 darwin*) # darwin 5.x on
6776 # if running on 10.5 or later, the deployment target defaults
6777 # to the OS version, if on x86, and 10.4, the deployment
6778 # target defaults to 10.4. Don't you love it?
6779 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
6780 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
6781 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6782 10.[012]*)
6783 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6784 10.*)
6785 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6786 esac
6787 ;;
6788 esac
6789 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
6790 _lt_dar_single_mod='$single_module'
6791 fi
6792 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6793 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
6794 else
6795 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
6796 fi
6797 if test "$DSYMUTIL" != ":"; then
6798 _lt_dsymutil='~$DSYMUTIL $lib || :'
6799 else
6800 _lt_dsymutil=
6801 fi
6802 ;;
6803 esac
6804
6805ac_ext=c
6806ac_cpp='$CPP $CPPFLAGS'
6807ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6808ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6809ac_compiler_gnu=$ac_cv_c_compiler_gnu
6810{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6811$as_echo_n "checking how to run the C preprocessor... " >&6; }
6812# On Suns, sometimes $CPP names a directory.
6813if test -n "$CPP" && test -d "$CPP"; then
6814 CPP=
6815fi
6816if test -z "$CPP"; then
6817 if test "${ac_cv_prog_CPP+set}" = set; then :
6818 $as_echo_n "(cached) " >&6
6819else
6820 # Double quotes because CPP needs to be expanded
6821 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6822 do
6823 ac_preproc_ok=false
6824for ac_c_preproc_warn_flag in '' yes
6825do
6826 # Use a header file that comes with gcc, so configuring glibc
6827 # with a fresh cross-compiler works.
6828 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6829 # <limits.h> exists even on freestanding compilers.
6830 # On the NeXT, cc -E runs the code through the compiler's parser,
6831 # not just through cpp. "Syntax error" is here to catch this case.
6832 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6833/* end confdefs.h. */
6834#ifdef __STDC__
6835# include <limits.h>
6836#else
6837# include <assert.h>
6838#endif
6839 Syntax error
6840_ACEOF
6841if ac_fn_c_try_cpp "$LINENO"; then :
6842
6843else
6844 # Broken: fails on valid input.
6845continue
6846fi
6847rm -f conftest.err conftest.i conftest.$ac_ext
6848
6849 # OK, works on sane cases. Now check whether nonexistent headers
6850 # can be detected and how.
6851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6852/* end confdefs.h. */
6853#include <ac_nonexistent.h>
6854_ACEOF
6855if ac_fn_c_try_cpp "$LINENO"; then :
6856 # Broken: success on invalid input.
6857continue
6858else
6859 # Passes both tests.
6860ac_preproc_ok=:
6861break
6862fi
6863rm -f conftest.err conftest.i conftest.$ac_ext
6864
6865done
6866# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6867rm -f conftest.i conftest.err conftest.$ac_ext
6868if $ac_preproc_ok; then :
6869 break
6870fi
6871
6872 done
6873 ac_cv_prog_CPP=$CPP
6874
6875fi
6876 CPP=$ac_cv_prog_CPP
6877else
6878 ac_cv_prog_CPP=$CPP
6879fi
6880{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6881$as_echo "$CPP" >&6; }
6882ac_preproc_ok=false
6883for ac_c_preproc_warn_flag in '' yes
6884do
6885 # Use a header file that comes with gcc, so configuring glibc
6886 # with a fresh cross-compiler works.
6887 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6888 # <limits.h> exists even on freestanding compilers.
6889 # On the NeXT, cc -E runs the code through the compiler's parser,
6890 # not just through cpp. "Syntax error" is here to catch this case.
6891 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6892/* end confdefs.h. */
6893#ifdef __STDC__
6894# include <limits.h>
6895#else
6896# include <assert.h>
6897#endif
6898 Syntax error
6899_ACEOF
6900if ac_fn_c_try_cpp "$LINENO"; then :
6901
6902else
6903 # Broken: fails on valid input.
6904continue
6905fi
6906rm -f conftest.err conftest.i conftest.$ac_ext
6907
6908 # OK, works on sane cases. Now check whether nonexistent headers
6909 # can be detected and how.
6910 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6911/* end confdefs.h. */
6912#include <ac_nonexistent.h>
6913_ACEOF
6914if ac_fn_c_try_cpp "$LINENO"; then :
6915 # Broken: success on invalid input.
6916continue
6917else
6918 # Passes both tests.
6919ac_preproc_ok=:
6920break
6921fi
6922rm -f conftest.err conftest.i conftest.$ac_ext
6923
6924done
6925# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6926rm -f conftest.i conftest.err conftest.$ac_ext
6927if $ac_preproc_ok; then :
6928
6929else
6930 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6931$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6932as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
6933See \`config.log' for more details" "$LINENO" 5 ; }
6934fi
6935
6936ac_ext=c
6937ac_cpp='$CPP $CPPFLAGS'
6938ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6939ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6940ac_compiler_gnu=$ac_cv_c_compiler_gnu
6941
6942
6943{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
6944$as_echo_n "checking for ANSI C header files... " >&6; }
6945if test "${ac_cv_header_stdc+set}" = set; then :
6946 $as_echo_n "(cached) " >&6
6947else
6948 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6949/* end confdefs.h. */
6950#include <stdlib.h>
6951#include <stdarg.h>
6952#include <string.h>
6953#include <float.h>
6954
6955int
6956main ()
6957{
6958
6959 ;
6960 return 0;
6961}
6962_ACEOF
6963if ac_fn_c_try_compile "$LINENO"; then :
6964 ac_cv_header_stdc=yes
6965else
6966 ac_cv_header_stdc=no
6967fi
6968rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6969
6970if test $ac_cv_header_stdc = yes; then
6971 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6972 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6973/* end confdefs.h. */
6974#include <string.h>
6975
6976_ACEOF
6977if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6978 $EGREP "memchr" >/dev/null 2>&1; then :
6979
6980else
6981 ac_cv_header_stdc=no
6982fi
6983rm -f conftest*
6984
6985fi
6986
6987if test $ac_cv_header_stdc = yes; then
6988 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6990/* end confdefs.h. */
6991#include <stdlib.h>
6992
6993_ACEOF
6994if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6995 $EGREP "free" >/dev/null 2>&1; then :
6996
6997else
6998 ac_cv_header_stdc=no
6999fi
7000rm -f conftest*
7001
7002fi
7003
7004if test $ac_cv_header_stdc = yes; then
7005 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7006 if test "$cross_compiling" = yes; then :
7007 :
7008else
7009 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7010/* end confdefs.h. */
7011#include <ctype.h>
7012#include <stdlib.h>
7013#if ((' ' & 0x0FF) == 0x020)
7014# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7015# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7016#else
7017# define ISLOWER(c) \
7018 (('a' <= (c) && (c) <= 'i') \
7019 || ('j' <= (c) && (c) <= 'r') \
7020 || ('s' <= (c) && (c) <= 'z'))
7021# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7022#endif
7023
7024#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7025int
7026main ()
7027{
7028 int i;
7029 for (i = 0; i < 256; i++)
7030 if (XOR (islower (i), ISLOWER (i))
7031 || toupper (i) != TOUPPER (i))
7032 return 2;
7033 return 0;
7034}
7035_ACEOF
7036if ac_fn_c_try_run "$LINENO"; then :
7037
7038else
7039 ac_cv_header_stdc=no
7040fi
7041rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7042 conftest.$ac_objext conftest.beam conftest.$ac_ext
7043fi
7044
7045fi
7046fi
7047{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7048$as_echo "$ac_cv_header_stdc" >&6; }
7049if test $ac_cv_header_stdc = yes; then
7050
7051$as_echo "#define STDC_HEADERS 1" >>confdefs.h
7052
7053fi
7054
7055# On IRIX 5.3, sys/types and inttypes.h are conflicting.
7056for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7057 inttypes.h stdint.h unistd.h
7058do :
7059 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7060ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7061"
7062if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7063 cat >>confdefs.h <<_ACEOF
7064#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7065_ACEOF
7066
7067fi
7068
7069done
7070
7071
7072for ac_header in dlfcn.h
7073do :
7074 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7075"
7076if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
7077 cat >>confdefs.h <<_ACEOF
7078#define HAVE_DLFCN_H 1
7079_ACEOF
7080
7081fi
7082
7083done
7084
7085
7086
7087# Set options
7088
7089
7090
7091 enable_dlopen=no
7092
7093
7094
7095 # Check whether --enable-shared was given.
7096if test "${enable_shared+set}" = set; then :
7097 enableval=$enable_shared; p=${PACKAGE-default}
7098 case $enableval in
7099 yes) enable_shared=yes ;;
7100 no) enable_shared=no ;;
7101 *)
7102 enable_shared=no
7103 # Look at the argument we got. We use all the common list separators.
7104 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7105 for pkg in $enableval; do
7106 IFS="$lt_save_ifs"
7107 if test "X$pkg" = "X$p"; then
7108 enable_shared=yes
7109 fi
7110 done
7111 IFS="$lt_save_ifs"
7112 ;;
7113 esac
7114else
7115 enable_shared=yes
7116fi
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126 # Check whether --enable-static was given.
7127if test "${enable_static+set}" = set; then :
7128 enableval=$enable_static; p=${PACKAGE-default}
7129 case $enableval in
7130 yes) enable_static=yes ;;
7131 no) enable_static=no ;;
7132 *)
7133 enable_static=no
7134 # Look at the argument we got. We use all the common list separators.
7135 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7136 for pkg in $enableval; do
7137 IFS="$lt_save_ifs"
7138 if test "X$pkg" = "X$p"; then
7139 enable_static=yes
7140 fi
7141 done
7142 IFS="$lt_save_ifs"
7143 ;;
7144 esac
7145else
7146 enable_static=yes
7147fi
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158# Check whether --with-pic was given.
7159if test "${with_pic+set}" = set; then :
7160 withval=$with_pic; pic_mode="$withval"
7161else
7162 pic_mode=default
7163fi
7164
7165
7166test -z "$pic_mode" && pic_mode=default
7167
7168
7169
7170
7171
7172
7173
7174 # Check whether --enable-fast-install was given.
7175if test "${enable_fast_install+set}" = set; then :
7176 enableval=$enable_fast_install; p=${PACKAGE-default}
7177 case $enableval in
7178 yes) enable_fast_install=yes ;;
7179 no) enable_fast_install=no ;;
7180 *)
7181 enable_fast_install=no
7182 # Look at the argument we got. We use all the common list separators.
7183 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7184 for pkg in $enableval; do
7185 IFS="$lt_save_ifs"
7186 if test "X$pkg" = "X$p"; then
7187 enable_fast_install=yes
7188 fi
7189 done
7190 IFS="$lt_save_ifs"
7191 ;;
7192 esac
7193else
7194 enable_fast_install=yes
7195fi
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207# This can be used to rebuild libtool when needed
7208LIBTOOL_DEPS="$ltmain"
7209
7210# Always use our own libtool.
7211LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237test -z "$LN_S" && LN_S="ln -s"
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252if test -n "${ZSH_VERSION+set}" ; then
7253 setopt NO_GLOB_SUBST
7254fi
7255
7256{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
7257$as_echo_n "checking for objdir... " >&6; }
7258if test "${lt_cv_objdir+set}" = set; then :
7259 $as_echo_n "(cached) " >&6
7260else
7261 rm -f .libs 2>/dev/null
7262mkdir .libs 2>/dev/null
7263if test -d .libs; then
7264 lt_cv_objdir=.libs
7265else
7266 # MS-DOS does not allow filenames that begin with a dot.
7267 lt_cv_objdir=_libs
7268fi
7269rmdir .libs 2>/dev/null
7270fi
7271{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
7272$as_echo "$lt_cv_objdir" >&6; }
7273objdir=$lt_cv_objdir
7274
7275
7276
7277
7278
7279cat >>confdefs.h <<_ACEOF
7280#define LT_OBJDIR "$lt_cv_objdir/"
7281_ACEOF
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299case $host_os in
7300aix3*)
7301 # AIX sometimes has problems with the GCC collect2 program. For some
7302 # reason, if we set the COLLECT_NAMES environment variable, the problems
7303 # vanish in a puff of smoke.
7304 if test "X${COLLECT_NAMES+set}" != Xset; then
7305 COLLECT_NAMES=
7306 export COLLECT_NAMES
7307 fi
7308 ;;
7309esac
7310
7311# Sed substitution that helps us do robust quoting. It backslashifies
7312# metacharacters that are still active within double-quoted strings.
7313sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
7314
7315# Same as above, but do not quote variable references.
7316double_quote_subst='s/\(["`\\]\)/\\\1/g'
7317
7318# Sed substitution to delay expansion of an escaped shell variable in a
7319# double_quote_subst'ed string.
7320delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
7321
7322# Sed substitution to delay expansion of an escaped single quote.
7323delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
7324
7325# Sed substitution to avoid accidental globbing in evaled expressions
7326no_glob_subst='s/\*/\\\*/g'
7327
7328# Global variables:
7329ofile=libtool
7330can_build_shared=yes
7331
7332# All known linkers require a `.a' archive for static linking (except MSVC,
7333# which needs '.lib').
7334libext=a
7335
7336with_gnu_ld="$lt_cv_prog_gnu_ld"
7337
7338old_CC="$CC"
7339old_CFLAGS="$CFLAGS"
7340
7341# Set sane defaults for various variables
7342test -z "$CC" && CC=cc
7343test -z "$LTCC" && LTCC=$CC
7344test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
7345test -z "$LD" && LD=ld
7346test -z "$ac_objext" && ac_objext=o
7347
7348for cc_temp in $compiler""; do
7349 case $cc_temp in
7350 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
7351 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
7352 \-*) ;;
7353 *) break;;
7354 esac
7355done
7356cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
7357
7358
7359# Only perform the check for file, if the check method requires it
7360test -z "$MAGIC_CMD" && MAGIC_CMD=file
7361case $deplibs_check_method in
7362file_magic*)
7363 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
7364 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
7365$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
7366if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7367 $as_echo_n "(cached) " >&6
7368else
7369 case $MAGIC_CMD in
7370[\\/*] | ?:[\\/]*)
7371 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7372 ;;
7373*)
7374 lt_save_MAGIC_CMD="$MAGIC_CMD"
7375 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7376 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7377 for ac_dir in $ac_dummy; do
7378 IFS="$lt_save_ifs"
7379 test -z "$ac_dir" && ac_dir=.
7380 if test -f $ac_dir/${ac_tool_prefix}file; then
7381 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
7382 if test -n "$file_magic_test_file"; then
7383 case $deplibs_check_method in
7384 "file_magic "*)
7385 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7386 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7387 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7388 $EGREP "$file_magic_regex" > /dev/null; then
7389 :
7390 else
7391 cat <<_LT_EOF 1>&2
7392
7393*** Warning: the command libtool uses to detect shared libraries,
7394*** $file_magic_cmd, produces output that libtool cannot recognize.
7395*** The result is that libtool may fail to recognize shared libraries
7396*** as such. This will affect the creation of libtool libraries that
7397*** depend on shared libraries, but programs linked with such libtool
7398*** libraries will work regardless of this problem. Nevertheless, you
7399*** may want to report the problem to your system manager and/or to
7400*** bug-libtool@gnu.org
7401
7402_LT_EOF
7403 fi ;;
7404 esac
7405 fi
7406 break
7407 fi
7408 done
7409 IFS="$lt_save_ifs"
7410 MAGIC_CMD="$lt_save_MAGIC_CMD"
7411 ;;
7412esac
7413fi
7414
7415MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7416if test -n "$MAGIC_CMD"; then
7417 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7418$as_echo "$MAGIC_CMD" >&6; }
7419else
7420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7421$as_echo "no" >&6; }
7422fi
7423
7424
7425
7426
7427
7428if test -z "$lt_cv_path_MAGIC_CMD"; then
7429 if test -n "$ac_tool_prefix"; then
7430 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
7431$as_echo_n "checking for file... " >&6; }
7432if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7433 $as_echo_n "(cached) " >&6
7434else
7435 case $MAGIC_CMD in
7436[\\/*] | ?:[\\/]*)
7437 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7438 ;;
7439*)
7440 lt_save_MAGIC_CMD="$MAGIC_CMD"
7441 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7442 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7443 for ac_dir in $ac_dummy; do
7444 IFS="$lt_save_ifs"
7445 test -z "$ac_dir" && ac_dir=.
7446 if test -f $ac_dir/file; then
7447 lt_cv_path_MAGIC_CMD="$ac_dir/file"
7448 if test -n "$file_magic_test_file"; then
7449 case $deplibs_check_method in
7450 "file_magic "*)
7451 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7452 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7453 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7454 $EGREP "$file_magic_regex" > /dev/null; then
7455 :
7456 else
7457 cat <<_LT_EOF 1>&2
7458
7459*** Warning: the command libtool uses to detect shared libraries,
7460*** $file_magic_cmd, produces output that libtool cannot recognize.
7461*** The result is that libtool may fail to recognize shared libraries
7462*** as such. This will affect the creation of libtool libraries that
7463*** depend on shared libraries, but programs linked with such libtool
7464*** libraries will work regardless of this problem. Nevertheless, you
7465*** may want to report the problem to your system manager and/or to
7466*** bug-libtool@gnu.org
7467
7468_LT_EOF
7469 fi ;;
7470 esac
7471 fi
7472 break
7473 fi
7474 done
7475 IFS="$lt_save_ifs"
7476 MAGIC_CMD="$lt_save_MAGIC_CMD"
7477 ;;
7478esac
7479fi
7480
7481MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7482if test -n "$MAGIC_CMD"; then
7483 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7484$as_echo "$MAGIC_CMD" >&6; }
7485else
7486 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7487$as_echo "no" >&6; }
7488fi
7489
7490
7491 else
7492 MAGIC_CMD=:
7493 fi
7494fi
7495
7496 fi
7497 ;;
7498esac
7499
7500# Use C for the default configuration in the libtool script
7501
7502lt_save_CC="$CC"
7503ac_ext=c
7504ac_cpp='$CPP $CPPFLAGS'
7505ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7506ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7507ac_compiler_gnu=$ac_cv_c_compiler_gnu
7508
7509
7510# Source file extension for C test sources.
7511ac_ext=c
7512
7513# Object file extension for compiled C test sources.
7514objext=o
7515objext=$objext
7516
7517# Code to be used in simple compile tests
7518lt_simple_compile_test_code="int some_variable = 0;"
7519
7520# Code to be used in simple link tests
7521lt_simple_link_test_code='int main(){return(0);}'
7522
7523
7524
7525
7526
7527
7528
7529# If no C compiler was specified, use CC.
7530LTCC=${LTCC-"$CC"}
7531
7532# If no C compiler flags were specified, use CFLAGS.
7533LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
7534
7535# Allow CC to be a program name with arguments.
7536compiler=$CC
7537
7538# Save the default compiler, since it gets overwritten when the other
7539# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7540compiler_DEFAULT=$CC
7541
7542# save warnings/boilerplate of simple test code
7543ac_outfile=conftest.$ac_objext
7544echo "$lt_simple_compile_test_code" >conftest.$ac_ext
7545eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7546_lt_compiler_boilerplate=`cat conftest.err`
7547$RM conftest*
7548
7549ac_outfile=conftest.$ac_objext
7550echo "$lt_simple_link_test_code" >conftest.$ac_ext
7551eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7552_lt_linker_boilerplate=`cat conftest.err`
7553$RM -r conftest*
7554
7555
7556## CAVEAT EMPTOR:
7557## There is no encapsulation within the following macros, do not change
7558## the running order or otherwise move them around unless you know exactly
7559## what you are doing...
7560if test -n "$compiler"; then
7561
7562lt_prog_compiler_no_builtin_flag=
7563
7564if test "$GCC" = yes; then
7565 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
7566
7567 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
7568$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
7569if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
7570 $as_echo_n "(cached) " >&6
7571else
7572 lt_cv_prog_compiler_rtti_exceptions=no
7573 ac_outfile=conftest.$ac_objext
7574 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7575 lt_compiler_flag="-fno-rtti -fno-exceptions"
7576 # Insert the option either (1) after the last *FLAGS variable, or
7577 # (2) before a word containing "conftest.", or (3) at the end.
7578 # Note that $ac_compile itself does not contain backslashes and begins
7579 # with a dollar sign (not a hyphen), so the echo should work correctly.
7580 # The option is referenced via a variable to avoid confusing sed.
7581 lt_compile=`echo "$ac_compile" | $SED \
7582 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7583 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7584 -e 's:$: $lt_compiler_flag:'`
7585 (eval echo "\"\$as_me:7585: $lt_compile\"" >&5)
7586 (eval "$lt_compile" 2>conftest.err)
7587 ac_status=$?
7588 cat conftest.err >&5
7589 echo "$as_me:7589: \$? = $ac_status" >&5
7590 if (exit $ac_status) && test -s "$ac_outfile"; then
7591 # The compiler can only warn and ignore the option if not recognized
7592 # So say no if there are warnings other than the usual output.
7593 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7594 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7595 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7596 lt_cv_prog_compiler_rtti_exceptions=yes
7597 fi
7598 fi
7599 $RM conftest*
7600
7601fi
7602{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
7603$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
7604
7605if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
7606 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
7607else
7608 :
7609fi
7610
7611fi
7612
7613
7614
7615
7616
7617
7618 lt_prog_compiler_wl=
7619lt_prog_compiler_pic=
7620lt_prog_compiler_static=
7621
7622{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
7623$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
7624
7625 if test "$GCC" = yes; then
7626 lt_prog_compiler_wl='-Wl,'
7627 lt_prog_compiler_static='-static'
7628
7629 case $host_os in
7630 aix*)
7631 # All AIX code is PIC.
7632 if test "$host_cpu" = ia64; then
7633 # AIX 5 now supports IA64 processor
7634 lt_prog_compiler_static='-Bstatic'
7635 fi
7636 ;;
7637
7638 amigaos*)
7639 case $host_cpu in
7640 powerpc)
7641 # see comment about AmigaOS4 .so support
7642 lt_prog_compiler_pic='-fPIC'
7643 ;;
7644 m68k)
7645 # FIXME: we need at least 68020 code to build shared libraries, but
7646 # adding the `-m68020' flag to GCC prevents building anything better,
7647 # like `-m68040'.
7648 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
7649 ;;
7650 esac
7651 ;;
7652
7653 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7654 # PIC is the default for these OSes.
7655 ;;
7656
7657 mingw* | cygwin* | pw32* | os2* | cegcc*)
7658 # This hack is so that the source file can tell whether it is being
7659 # built for inclusion in a dll (and should export symbols for example).
7660 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7661 # (--disable-auto-import) libraries
7662 lt_prog_compiler_pic='-DDLL_EXPORT'
7663 ;;
7664
7665 darwin* | rhapsody*)
7666 # PIC is the default on this platform
7667 # Common symbols not allowed in MH_DYLIB files
7668 lt_prog_compiler_pic='-fno-common'
7669 ;;
7670
7671 hpux*)
7672 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7673 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7674 # sets the default TLS model and affects inlining.
7675 case $host_cpu in
7676 hppa*64*)
7677 # +Z the default
7678 ;;
7679 *)
7680 lt_prog_compiler_pic='-fPIC'
7681 ;;
7682 esac
7683 ;;
7684
7685 interix[3-9]*)
7686 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7687 # Instead, we relocate shared libraries at runtime.
7688 ;;
7689
7690 msdosdjgpp*)
7691 # Just because we use GCC doesn't mean we suddenly get shared libraries
7692 # on systems that don't support them.
7693 lt_prog_compiler_can_build_shared=no
7694 enable_shared=no
7695 ;;
7696
7697 *nto* | *qnx*)
7698 # QNX uses GNU C++, but need to define -shared option too, otherwise
7699 # it will coredump.
7700 lt_prog_compiler_pic='-fPIC -shared'
7701 ;;
7702
7703 sysv4*MP*)
7704 if test -d /usr/nec; then
7705 lt_prog_compiler_pic=-Kconform_pic
7706 fi
7707 ;;
7708
7709 *)
7710 lt_prog_compiler_pic='-fPIC'
7711 ;;
7712 esac
7713 else
7714 # PORTME Check for flag to pass linker flags through the system compiler.
7715 case $host_os in
7716 aix*)
7717 lt_prog_compiler_wl='-Wl,'
7718 if test "$host_cpu" = ia64; then
7719 # AIX 5 now supports IA64 processor
7720 lt_prog_compiler_static='-Bstatic'
7721 else
7722 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
7723 fi
7724 ;;
7725
7726 mingw* | cygwin* | pw32* | os2* | cegcc*)
7727 # This hack is so that the source file can tell whether it is being
7728 # built for inclusion in a dll (and should export symbols for example).
7729 lt_prog_compiler_pic='-DDLL_EXPORT'
7730 ;;
7731
7732 hpux9* | hpux10* | hpux11*)
7733 lt_prog_compiler_wl='-Wl,'
7734 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7735 # not for PA HP-UX.
7736 case $host_cpu in
7737 hppa*64*|ia64*)
7738 # +Z the default
7739 ;;
7740 *)
7741 lt_prog_compiler_pic='+Z'
7742 ;;
7743 esac
7744 # Is there a better lt_prog_compiler_static that works with the bundled CC?
7745 lt_prog_compiler_static='${wl}-a ${wl}archive'
7746 ;;
7747
7748 irix5* | irix6* | nonstopux*)
7749 lt_prog_compiler_wl='-Wl,'
7750 # PIC (with -KPIC) is the default.
7751 lt_prog_compiler_static='-non_shared'
7752 ;;
7753
7754 linux* | k*bsd*-gnu | kopensolaris*-gnu)
7755 case $cc_basename in
7756 # old Intel for x86_64 which still supported -KPIC.
7757 ecc*)
7758 lt_prog_compiler_wl='-Wl,'
7759 lt_prog_compiler_pic='-KPIC'
7760 lt_prog_compiler_static='-static'
7761 ;;
7762 # icc used to be incompatible with GCC.
7763 # ICC 10 doesn't accept -KPIC any more.
7764 icc* | ifort*)
7765 lt_prog_compiler_wl='-Wl,'
7766 lt_prog_compiler_pic='-fPIC'
7767 lt_prog_compiler_static='-static'
7768 ;;
7769 # Lahey Fortran 8.1.
7770 lf95*)
7771 lt_prog_compiler_wl='-Wl,'
7772 lt_prog_compiler_pic='--shared'
7773 lt_prog_compiler_static='--static'
7774 ;;
7775 pgcc* | pgf77* | pgf90* | pgf95*)
7776 # Portland Group compilers (*not* the Pentium gcc compiler,
7777 # which looks to be a dead project)
7778 lt_prog_compiler_wl='-Wl,'
7779 lt_prog_compiler_pic='-fpic'
7780 lt_prog_compiler_static='-Bstatic'
7781 ;;
7782 ccc*)
7783 lt_prog_compiler_wl='-Wl,'
7784 # All Alpha code is PIC.
7785 lt_prog_compiler_static='-non_shared'
7786 ;;
7787 xl*)
7788 # IBM XL C 8.0/Fortran 10.1 on PPC
7789 lt_prog_compiler_wl='-Wl,'
7790 lt_prog_compiler_pic='-qpic'
7791 lt_prog_compiler_static='-qstaticlink'
7792 ;;
7793 *)
7794 case `$CC -V 2>&1 | sed 5q` in
7795 *Sun\ C*)
7796 # Sun C 5.9
7797 lt_prog_compiler_pic='-KPIC'
7798 lt_prog_compiler_static='-Bstatic'
7799 lt_prog_compiler_wl='-Wl,'
7800 ;;
7801 *Sun\ F*)
7802 # Sun Fortran 8.3 passes all unrecognized flags to the linker
7803 lt_prog_compiler_pic='-KPIC'
7804 lt_prog_compiler_static='-Bstatic'
7805 lt_prog_compiler_wl=''
7806 ;;
7807 esac
7808 ;;
7809 esac
7810 ;;
7811
7812 newsos6)
7813 lt_prog_compiler_pic='-KPIC'
7814 lt_prog_compiler_static='-Bstatic'
7815 ;;
7816
7817 *nto* | *qnx*)
7818 # QNX uses GNU C++, but need to define -shared option too, otherwise
7819 # it will coredump.
7820 lt_prog_compiler_pic='-fPIC -shared'
7821 ;;
7822
7823 osf3* | osf4* | osf5*)
7824 lt_prog_compiler_wl='-Wl,'
7825 # All OSF/1 code is PIC.
7826 lt_prog_compiler_static='-non_shared'
7827 ;;
7828
7829 rdos*)
7830 lt_prog_compiler_static='-non_shared'
7831 ;;
7832
7833 solaris*)
7834 lt_prog_compiler_pic='-KPIC'
7835 lt_prog_compiler_static='-Bstatic'
7836 case $cc_basename in
7837 f77* | f90* | f95*)
7838 lt_prog_compiler_wl='-Qoption ld ';;
7839 *)
7840 lt_prog_compiler_wl='-Wl,';;
7841 esac
7842 ;;
7843
7844 sunos4*)
7845 lt_prog_compiler_wl='-Qoption ld '
7846 lt_prog_compiler_pic='-PIC'
7847 lt_prog_compiler_static='-Bstatic'
7848 ;;
7849
7850 sysv4 | sysv4.2uw2* | sysv4.3*)
7851 lt_prog_compiler_wl='-Wl,'
7852 lt_prog_compiler_pic='-KPIC'
7853 lt_prog_compiler_static='-Bstatic'
7854 ;;
7855
7856 sysv4*MP*)
7857 if test -d /usr/nec ;then
7858 lt_prog_compiler_pic='-Kconform_pic'
7859 lt_prog_compiler_static='-Bstatic'
7860 fi
7861 ;;
7862
7863 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7864 lt_prog_compiler_wl='-Wl,'
7865 lt_prog_compiler_pic='-KPIC'
7866 lt_prog_compiler_static='-Bstatic'
7867 ;;
7868
7869 unicos*)
7870 lt_prog_compiler_wl='-Wl,'
7871 lt_prog_compiler_can_build_shared=no
7872 ;;
7873
7874 uts4*)
7875 lt_prog_compiler_pic='-pic'
7876 lt_prog_compiler_static='-Bstatic'
7877 ;;
7878
7879 *)
7880 lt_prog_compiler_can_build_shared=no
7881 ;;
7882 esac
7883 fi
7884
7885case $host_os in
7886 # For platforms which do not support PIC, -DPIC is meaningless:
7887 *djgpp*)
7888 lt_prog_compiler_pic=
7889 ;;
7890 *)
7891 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
7892 ;;
7893esac
7894{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
7895$as_echo "$lt_prog_compiler_pic" >&6; }
7896
7897
7898
7899
7900
7901
7902#
7903# Check to make sure the PIC flag actually works.
7904#
7905if test -n "$lt_prog_compiler_pic"; then
7906 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
7907$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
7908if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
7909 $as_echo_n "(cached) " >&6
7910else
7911 lt_cv_prog_compiler_pic_works=no
7912 ac_outfile=conftest.$ac_objext
7913 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7914 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
7915 # Insert the option either (1) after the last *FLAGS variable, or
7916 # (2) before a word containing "conftest.", or (3) at the end.
7917 # Note that $ac_compile itself does not contain backslashes and begins
7918 # with a dollar sign (not a hyphen), so the echo should work correctly.
7919 # The option is referenced via a variable to avoid confusing sed.
7920 lt_compile=`echo "$ac_compile" | $SED \
7921 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7922 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7923 -e 's:$: $lt_compiler_flag:'`
7924 (eval echo "\"\$as_me:7924: $lt_compile\"" >&5)
7925 (eval "$lt_compile" 2>conftest.err)
7926 ac_status=$?
7927 cat conftest.err >&5
7928 echo "$as_me:7928: \$? = $ac_status" >&5
7929 if (exit $ac_status) && test -s "$ac_outfile"; then
7930 # The compiler can only warn and ignore the option if not recognized
7931 # So say no if there are warnings other than the usual output.
7932 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7933 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7934 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7935 lt_cv_prog_compiler_pic_works=yes
7936 fi
7937 fi
7938 $RM conftest*
7939
7940fi
7941{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
7942$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
7943
7944if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
7945 case $lt_prog_compiler_pic in
7946 "" | " "*) ;;
7947 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
7948 esac
7949else
7950 lt_prog_compiler_pic=
7951 lt_prog_compiler_can_build_shared=no
7952fi
7953
7954fi
7955
7956
7957
7958
7959
7960
7961#
7962# Check to make sure the static flag actually works.
7963#
7964wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
7965{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
7966$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
7967if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
7968 $as_echo_n "(cached) " >&6
7969else
7970 lt_cv_prog_compiler_static_works=no
7971 save_LDFLAGS="$LDFLAGS"
7972 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
7973 echo "$lt_simple_link_test_code" > conftest.$ac_ext
7974 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
7975 # The linker can only warn and ignore the option if not recognized
7976 # So say no if there are warnings
7977 if test -s conftest.err; then
7978 # Append any errors to the config.log.
7979 cat conftest.err 1>&5
7980 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
7981 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7982 if diff conftest.exp conftest.er2 >/dev/null; then
7983 lt_cv_prog_compiler_static_works=yes
7984 fi
7985 else
7986 lt_cv_prog_compiler_static_works=yes
7987 fi
7988 fi
7989 $RM -r conftest*
7990 LDFLAGS="$save_LDFLAGS"
7991
7992fi
7993{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
7994$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
7995
7996if test x"$lt_cv_prog_compiler_static_works" = xyes; then
7997 :
7998else
7999 lt_prog_compiler_static=
8000fi
8001
8002
8003
8004
8005
8006
8007
8008 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8009$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8010if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8011 $as_echo_n "(cached) " >&6
8012else
8013 lt_cv_prog_compiler_c_o=no
8014 $RM -r conftest 2>/dev/null
8015 mkdir conftest
8016 cd conftest
8017 mkdir out
8018 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8019
8020 lt_compiler_flag="-o out/conftest2.$ac_objext"
8021 # Insert the option either (1) after the last *FLAGS variable, or
8022 # (2) before a word containing "conftest.", or (3) at the end.
8023 # Note that $ac_compile itself does not contain backslashes and begins
8024 # with a dollar sign (not a hyphen), so the echo should work correctly.
8025 lt_compile=`echo "$ac_compile" | $SED \
8026 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8027 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8028 -e 's:$: $lt_compiler_flag:'`
8029 (eval echo "\"\$as_me:8029: $lt_compile\"" >&5)
8030 (eval "$lt_compile" 2>out/conftest.err)
8031 ac_status=$?
8032 cat out/conftest.err >&5
8033 echo "$as_me:8033: \$? = $ac_status" >&5
8034 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8035 then
8036 # The compiler can only warn and ignore the option if not recognized
8037 # So say no if there are warnings
8038 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
8039 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8040 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8041 lt_cv_prog_compiler_c_o=yes
8042 fi
8043 fi
8044 chmod u+w . 2>&5
8045 $RM conftest*
8046 # SGI C++ compiler will create directory out/ii_files/ for
8047 # template instantiation
8048 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8049 $RM out/* && rmdir out
8050 cd ..
8051 $RM -r conftest
8052 $RM conftest*
8053
8054fi
8055{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8056$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8057
8058
8059
8060
8061
8062
8063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8064$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8065if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8066 $as_echo_n "(cached) " >&6
8067else
8068 lt_cv_prog_compiler_c_o=no
8069 $RM -r conftest 2>/dev/null
8070 mkdir conftest
8071 cd conftest
8072 mkdir out
8073 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8074
8075 lt_compiler_flag="-o out/conftest2.$ac_objext"
8076 # Insert the option either (1) after the last *FLAGS variable, or
8077 # (2) before a word containing "conftest.", or (3) at the end.
8078 # Note that $ac_compile itself does not contain backslashes and begins
8079 # with a dollar sign (not a hyphen), so the echo should work correctly.
8080 lt_compile=`echo "$ac_compile" | $SED \
8081 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8082 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8083 -e 's:$: $lt_compiler_flag:'`
8084 (eval echo "\"\$as_me:8084: $lt_compile\"" >&5)
8085 (eval "$lt_compile" 2>out/conftest.err)
8086 ac_status=$?
8087 cat out/conftest.err >&5
8088 echo "$as_me:8088: \$? = $ac_status" >&5
8089 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8090 then
8091 # The compiler can only warn and ignore the option if not recognized
8092 # So say no if there are warnings
8093 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
8094 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8095 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8096 lt_cv_prog_compiler_c_o=yes
8097 fi
8098 fi
8099 chmod u+w . 2>&5
8100 $RM conftest*
8101 # SGI C++ compiler will create directory out/ii_files/ for
8102 # template instantiation
8103 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8104 $RM out/* && rmdir out
8105 cd ..
8106 $RM -r conftest
8107 $RM conftest*
8108
8109fi
8110{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8111$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8112
8113
8114
8115
8116hard_links="nottested"
8117if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
8118 # do not overwrite the value of need_locks provided by the user
8119 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8120$as_echo_n "checking if we can lock with hard links... " >&6; }
8121 hard_links=yes
8122 $RM conftest*
8123 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8124 touch conftest.a
8125 ln conftest.a conftest.b 2>&5 || hard_links=no
8126 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8127 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8128$as_echo "$hard_links" >&6; }
8129 if test "$hard_links" = no; then
8130 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8131$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
8132 need_locks=warn
8133 fi
8134else
8135 need_locks=no
8136fi
8137
8138
8139
8140
8141
8142
8143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8144$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8145
8146 runpath_var=
8147 allow_undefined_flag=
8148 always_export_symbols=no
8149 archive_cmds=
8150 archive_expsym_cmds=
8151 compiler_needs_object=no
8152 enable_shared_with_static_runtimes=no
8153 export_dynamic_flag_spec=
8154 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8155 hardcode_automatic=no
8156 hardcode_direct=no
8157 hardcode_direct_absolute=no
8158 hardcode_libdir_flag_spec=
8159 hardcode_libdir_flag_spec_ld=
8160 hardcode_libdir_separator=
8161 hardcode_minus_L=no
8162 hardcode_shlibpath_var=unsupported
8163 inherit_rpath=no
8164 link_all_deplibs=unknown
8165 module_cmds=
8166 module_expsym_cmds=
8167 old_archive_from_new_cmds=
8168 old_archive_from_expsyms_cmds=
8169 thread_safe_flag_spec=
8170 whole_archive_flag_spec=
8171 # include_expsyms should be a list of space-separated symbols to be *always*
8172 # included in the symbol list
8173 include_expsyms=
8174 # exclude_expsyms can be an extended regexp of symbols to exclude
8175 # it will be wrapped by ` (' and `)$', so one must not match beginning or
8176 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8177 # as well as any symbol that contains `d'.
8178 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
8179 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8180 # platforms (ab)use it in PIC code, but their linkers get confused if
8181 # the symbol is explicitly referenced. Since portable code cannot
8182 # rely on this symbol name, it's probably fine to never include it in
8183 # preloaded symbol tables.
8184 # Exclude shared library initialization/finalization symbols.
8185 extract_expsyms_cmds=
8186
8187 case $host_os in
8188 cygwin* | mingw* | pw32* | cegcc*)
8189 # FIXME: the MSVC++ port hasn't been tested in a loooong time
8190 # When not using gcc, we currently assume that we are using
8191 # Microsoft Visual C++.
8192 if test "$GCC" != yes; then
8193 with_gnu_ld=no
8194 fi
8195 ;;
8196 interix*)
8197 # we just hope/assume this is gcc and not c89 (= MSVC++)
8198 with_gnu_ld=yes
8199 ;;
8200 openbsd*)
8201 with_gnu_ld=no
8202 ;;
8203 linux* | k*bsd*-gnu)
8204 link_all_deplibs=no
8205 ;;
8206 esac
8207
8208 ld_shlibs=yes
8209 if test "$with_gnu_ld" = yes; then
8210 # If archive_cmds runs LD, not CC, wlarc should be empty
8211 wlarc='${wl}'
8212
8213 # Set some defaults for GNU ld with shared library support. These
8214 # are reset later if shared libraries are not supported. Putting them
8215 # here allows them to be overridden if necessary.
8216 runpath_var=LD_RUN_PATH
8217 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8218 export_dynamic_flag_spec='${wl}--export-dynamic'
8219 # ancient GNU ld didn't support --whole-archive et. al.
8220 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8221 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8222 else
8223 whole_archive_flag_spec=
8224 fi
8225 supports_anon_versioning=no
8226 case `$LD -v 2>&1` in
8227 *GNU\ gold*) supports_anon_versioning=yes ;;
8228 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
8229 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8230 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8231 *\ 2.11.*) ;; # other 2.11 versions
8232 *) supports_anon_versioning=yes ;;
8233 esac
8234
8235 # See if GNU ld supports shared libraries.
8236 case $host_os in
8237 aix[3-9]*)
8238 # On AIX/PPC, the GNU linker is very broken
8239 if test "$host_cpu" != ia64; then
8240 ld_shlibs=no
8241 cat <<_LT_EOF 1>&2
8242
8243*** Warning: the GNU linker, at least up to release 2.9.1, is reported
8244*** to be unable to reliably create shared libraries on AIX.
8245*** Therefore, libtool is disabling shared libraries support. If you
8246*** really care for shared libraries, you may want to modify your PATH
8247*** so that a non-GNU linker is found, and then restart.
8248
8249_LT_EOF
8250 fi
8251 ;;
8252
8253 amigaos*)
8254 case $host_cpu in
8255 powerpc)
8256 # see comment about AmigaOS4 .so support
8257 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8258 archive_expsym_cmds=''
8259 ;;
8260 m68k)
8261 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8262 hardcode_libdir_flag_spec='-L$libdir'
8263 hardcode_minus_L=yes
8264 ;;
8265 esac
8266 ;;
8267
8268 beos*)
8269 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8270 allow_undefined_flag=unsupported
8271 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8272 # support --undefined. This deserves some investigation. FIXME
8273 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8274 else
8275 ld_shlibs=no
8276 fi
8277 ;;
8278
8279 cygwin* | mingw* | pw32* | cegcc*)
8280 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
8281 # as there is no search path for DLLs.
8282 hardcode_libdir_flag_spec='-L$libdir'
8283 allow_undefined_flag=unsupported
8284 always_export_symbols=no
8285 enable_shared_with_static_runtimes=yes
8286 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8287
8288 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8289 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8290 # If the export-symbols file already is a .def file (1st line
8291 # is EXPORTS), use it as is; otherwise, prepend...
8292 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8293 cp $export_symbols $output_objdir/$soname.def;
8294 else
8295 echo EXPORTS > $output_objdir/$soname.def;
8296 cat $export_symbols >> $output_objdir/$soname.def;
8297 fi~
8298 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8299 else
8300 ld_shlibs=no
8301 fi
8302 ;;
8303
8304 interix[3-9]*)
8305 hardcode_direct=no
8306 hardcode_shlibpath_var=no
8307 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8308 export_dynamic_flag_spec='${wl}-E'
8309 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8310 # Instead, shared libraries are loaded at an image base (0x10000000 by
8311 # default) and relocated if they conflict, which is a slow very memory
8312 # consuming and fragmenting process. To avoid this, we pick a random,
8313 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8314 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
8315 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8316 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8317 ;;
8318
8319 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8320 tmp_diet=no
8321 if test "$host_os" = linux-dietlibc; then
8322 case $cc_basename in
8323 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
8324 esac
8325 fi
8326 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8327 && test "$tmp_diet" = no
8328 then
8329 tmp_addflag=
8330 tmp_sharedflag='-shared'
8331 case $cc_basename,$host_cpu in
8332 pgcc*) # Portland Group C compiler
8333 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8334 tmp_addflag=' $pic_flag'
8335 ;;
8336 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
8337 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8338 tmp_addflag=' $pic_flag -Mnomain' ;;
8339 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
8340 tmp_addflag=' -i_dynamic' ;;
8341 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
8342 tmp_addflag=' -i_dynamic -nofor_main' ;;
8343 ifc* | ifort*) # Intel Fortran compiler
8344 tmp_addflag=' -nofor_main' ;;
8345 lf95*) # Lahey Fortran 8.1
8346 whole_archive_flag_spec=
8347 tmp_sharedflag='--shared' ;;
8348 xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8349 tmp_sharedflag='-qmkshrobj'
8350 tmp_addflag= ;;
8351 esac
8352 case `$CC -V 2>&1 | sed 5q` in
8353 *Sun\ C*) # Sun C 5.9
8354 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8355 compiler_needs_object=yes
8356 tmp_sharedflag='-G' ;;
8357 *Sun\ F*) # Sun Fortran 8.3
8358 tmp_sharedflag='-G' ;;
8359 esac
8360 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8361
8362 if test "x$supports_anon_versioning" = xyes; then
8363 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8364 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8365 echo "local: *; };" >> $output_objdir/$libname.ver~
8366 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8367 fi
8368
8369 case $cc_basename in
8370 xlf*)
8371 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8372 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
8373 hardcode_libdir_flag_spec=
8374 hardcode_libdir_flag_spec_ld='-rpath $libdir'
8375 archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
8376 if test "x$supports_anon_versioning" = xyes; then
8377 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8378 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8379 echo "local: *; };" >> $output_objdir/$libname.ver~
8380 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8381 fi
8382 ;;
8383 esac
8384 else
8385 ld_shlibs=no
8386 fi
8387 ;;
8388
8389 netbsd* | netbsdelf*-gnu)
8390 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8391 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8392 wlarc=
8393 else
8394 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8395 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8396 fi
8397 ;;
8398
8399 solaris*)
8400 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8401 ld_shlibs=no
8402 cat <<_LT_EOF 1>&2
8403
8404*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8405*** create shared libraries on Solaris systems. Therefore, libtool
8406*** is disabling shared libraries support. We urge you to upgrade GNU
8407*** binutils to release 2.9.1 or newer. Another option is to modify
8408*** your PATH or compiler configuration so that the native linker is
8409*** used, and then restart.
8410
8411_LT_EOF
8412 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8413 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8414 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8415 else
8416 ld_shlibs=no
8417 fi
8418 ;;
8419
8420 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8421 case `$LD -v 2>&1` in
8422 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
8423 ld_shlibs=no
8424 cat <<_LT_EOF 1>&2
8425
8426*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
8427*** reliably create shared libraries on SCO systems. Therefore, libtool
8428*** is disabling shared libraries support. We urge you to upgrade GNU
8429*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
8430*** your PATH or compiler configuration so that the native linker is
8431*** used, and then restart.
8432
8433_LT_EOF
8434 ;;
8435 *)
8436 # For security reasons, it is highly recommended that you always
8437 # use absolute paths for naming shared libraries, and exclude the
8438 # DT_RUNPATH tag from executables and libraries. But doing so
8439 # requires that you compile everything twice, which is a pain.
8440 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8441 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8442 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8443 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8444 else
8445 ld_shlibs=no
8446 fi
8447 ;;
8448 esac
8449 ;;
8450
8451 sunos4*)
8452 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8453 wlarc=
8454 hardcode_direct=yes
8455 hardcode_shlibpath_var=no
8456 ;;
8457
8458 *)
8459 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8460 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8461 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8462 else
8463 ld_shlibs=no
8464 fi
8465 ;;
8466 esac
8467
8468 if test "$ld_shlibs" = no; then
8469 runpath_var=
8470 hardcode_libdir_flag_spec=
8471 export_dynamic_flag_spec=
8472 whole_archive_flag_spec=
8473 fi
8474 else
8475 # PORTME fill in a description of your system's linker (not GNU ld)
8476 case $host_os in
8477 aix3*)
8478 allow_undefined_flag=unsupported
8479 always_export_symbols=yes
8480 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8481 # Note: this linker hardcodes the directories in LIBPATH if there
8482 # are no directories specified by -L.
8483 hardcode_minus_L=yes
8484 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
8485 # Neither direct hardcoding nor static linking is supported with a
8486 # broken collect2.
8487 hardcode_direct=unsupported
8488 fi
8489 ;;
8490
8491 aix[4-9]*)
8492 if test "$host_cpu" = ia64; then
8493 # On IA64, the linker does run time linking by default, so we don't
8494 # have to do anything special.
8495 aix_use_runtimelinking=no
8496 exp_sym_flag='-Bexport'
8497 no_entry_flag=""
8498 else
8499 # If we're using GNU nm, then we don't want the "-C" option.
8500 # -C means demangle to AIX nm, but means don't demangle with GNU nm
8501 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8502 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8503 else
8504 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8505 fi
8506 aix_use_runtimelinking=no
8507
8508 # Test if we are trying to use run time linking or normal
8509 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8510 # need to do runtime linking.
8511 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
8512 for ld_flag in $LDFLAGS; do
8513 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
8514 aix_use_runtimelinking=yes
8515 break
8516 fi
8517 done
8518 ;;
8519 esac
8520
8521 exp_sym_flag='-bexport'
8522 no_entry_flag='-bnoentry'
8523 fi
8524
8525 # When large executables or shared objects are built, AIX ld can
8526 # have problems creating the table of contents. If linking a library
8527 # or program results in "error TOC overflow" add -mminimal-toc to
8528 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
8529 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8530
8531 archive_cmds=''
8532 hardcode_direct=yes
8533 hardcode_direct_absolute=yes
8534 hardcode_libdir_separator=':'
8535 link_all_deplibs=yes
8536 file_list_spec='${wl}-f,'
8537
8538 if test "$GCC" = yes; then
8539 case $host_os in aix4.[012]|aix4.[012].*)
8540 # We only want to do this on AIX 4.2 and lower, the check
8541 # below for broken collect2 doesn't work under 4.3+
8542 collect2name=`${CC} -print-prog-name=collect2`
8543 if test -f "$collect2name" &&
8544 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8545 then
8546 # We have reworked collect2
8547 :
8548 else
8549 # We have old collect2
8550 hardcode_direct=unsupported
8551 # It fails to find uninstalled libraries when the uninstalled
8552 # path is not listed in the libpath. Setting hardcode_minus_L
8553 # to unsupported forces relinking
8554 hardcode_minus_L=yes
8555 hardcode_libdir_flag_spec='-L$libdir'
8556 hardcode_libdir_separator=
8557 fi
8558 ;;
8559 esac
8560 shared_flag='-shared'
8561 if test "$aix_use_runtimelinking" = yes; then
8562 shared_flag="$shared_flag "'${wl}-G'
8563 fi
8564 link_all_deplibs=no
8565 else
8566 # not using gcc
8567 if test "$host_cpu" = ia64; then
8568 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8569 # chokes on -Wl,-G. The following line is correct:
8570 shared_flag='-G'
8571 else
8572 if test "$aix_use_runtimelinking" = yes; then
8573 shared_flag='${wl}-G'
8574 else
8575 shared_flag='${wl}-bM:SRE'
8576 fi
8577 fi
8578 fi
8579
8580 export_dynamic_flag_spec='${wl}-bexpall'
8581 # It seems that -bexpall does not export symbols beginning with
8582 # underscore (_), so it is better to generate a list of symbols to export.
8583 always_export_symbols=yes
8584 if test "$aix_use_runtimelinking" = yes; then
8585 # Warning - without using the other runtime loading flags (-brtl),
8586 # -berok will link without error, but may produce a broken library.
8587 allow_undefined_flag='-berok'
8588 # Determine the default libpath from the value encoded in an
8589 # empty executable.
8590 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8591/* end confdefs.h. */
8592
8593int
8594main ()
8595{
8596
8597 ;
8598 return 0;
8599}
8600_ACEOF
8601if ac_fn_c_try_link "$LINENO"; then :
8602
8603lt_aix_libpath_sed='
8604 /Import File Strings/,/^$/ {
8605 /^0/ {
8606 s/^0 *\(.*\)$/\1/
8607 p
8608 }
8609 }'
8610aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8611# Check for a 64-bit object if we didn't find anything.
8612if test -z "$aix_libpath"; then
8613 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8614fi
8615fi
8616rm -f core conftest.err conftest.$ac_objext \
8617 conftest$ac_exeext conftest.$ac_ext
8618if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8619
8620 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8621 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8622 else
8623 if test "$host_cpu" = ia64; then
8624 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
8625 allow_undefined_flag="-z nodefs"
8626 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
8627 else
8628 # Determine the default libpath from the value encoded in an
8629 # empty executable.
8630 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8631/* end confdefs.h. */
8632
8633int
8634main ()
8635{
8636
8637 ;
8638 return 0;
8639}
8640_ACEOF
8641if ac_fn_c_try_link "$LINENO"; then :
8642
8643lt_aix_libpath_sed='
8644 /Import File Strings/,/^$/ {
8645 /^0/ {
8646 s/^0 *\(.*\)$/\1/
8647 p
8648 }
8649 }'
8650aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8651# Check for a 64-bit object if we didn't find anything.
8652if test -z "$aix_libpath"; then
8653 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8654fi
8655fi
8656rm -f core conftest.err conftest.$ac_objext \
8657 conftest$ac_exeext conftest.$ac_ext
8658if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8659
8660 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8661 # Warning - without using the other run time loading flags,
8662 # -berok will link without error, but may produce a broken library.
8663 no_undefined_flag=' ${wl}-bernotok'
8664 allow_undefined_flag=' ${wl}-berok'
8665 # Exported symbols can be pulled into shared objects from archives
8666 whole_archive_flag_spec='$convenience'
8667 archive_cmds_need_lc=yes
8668 # This is similar to how AIX traditionally builds its shared libraries.
8669 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8670 fi
8671 fi
8672 ;;
8673
8674 amigaos*)
8675 case $host_cpu in
8676 powerpc)
8677 # see comment about AmigaOS4 .so support
8678 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8679 archive_expsym_cmds=''
8680 ;;
8681 m68k)
8682 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8683 hardcode_libdir_flag_spec='-L$libdir'
8684 hardcode_minus_L=yes
8685 ;;
8686 esac
8687 ;;
8688
8689 bsdi[45]*)
8690 export_dynamic_flag_spec=-rdynamic
8691 ;;
8692
8693 cygwin* | mingw* | pw32* | cegcc*)
8694 # When not using gcc, we currently assume that we are using
8695 # Microsoft Visual C++.
8696 # hardcode_libdir_flag_spec is actually meaningless, as there is
8697 # no search path for DLLs.
8698 hardcode_libdir_flag_spec=' '
8699 allow_undefined_flag=unsupported
8700 # Tell ltmain to make .lib files, not .a files.
8701 libext=lib
8702 # Tell ltmain to make .dll files, not .so files.
8703 shrext_cmds=".dll"
8704 # FIXME: Setting linknames here is a bad hack.
8705 archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
8706 # The linker will automatically build a .lib file if we build a DLL.
8707 old_archive_from_new_cmds='true'
8708 # FIXME: Should let the user specify the lib program.
8709 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8710 fix_srcfile_path='`cygpath -w "$srcfile"`'
8711 enable_shared_with_static_runtimes=yes
8712 ;;
8713
8714 darwin* | rhapsody*)
8715
8716
8717 archive_cmds_need_lc=no
8718 hardcode_direct=no
8719 hardcode_automatic=yes
8720 hardcode_shlibpath_var=unsupported
8721 whole_archive_flag_spec=''
8722 link_all_deplibs=yes
8723 allow_undefined_flag="$_lt_dar_allow_undefined"
8724 case $cc_basename in
8725 ifort*) _lt_dar_can_shared=yes ;;
8726 *) _lt_dar_can_shared=$GCC ;;
8727 esac
8728 if test "$_lt_dar_can_shared" = "yes"; then
8729 output_verbose_link_cmd=echo
8730 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
8731 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
8732 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
8733 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
8734
8735 else
8736 ld_shlibs=no
8737 fi
8738
8739 ;;
8740
8741 dgux*)
8742 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8743 hardcode_libdir_flag_spec='-L$libdir'
8744 hardcode_shlibpath_var=no
8745 ;;
8746
8747 freebsd1*)
8748 ld_shlibs=no
8749 ;;
8750
8751 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8752 # support. Future versions do this automatically, but an explicit c++rt0.o
8753 # does not break anything, and helps significantly (at the cost of a little
8754 # extra space).
8755 freebsd2.2*)
8756 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8757 hardcode_libdir_flag_spec='-R$libdir'
8758 hardcode_direct=yes
8759 hardcode_shlibpath_var=no
8760 ;;
8761
8762 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8763 freebsd2*)
8764 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8765 hardcode_direct=yes
8766 hardcode_minus_L=yes
8767 hardcode_shlibpath_var=no
8768 ;;
8769
8770 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8771 freebsd* | dragonfly*)
8772 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8773 hardcode_libdir_flag_spec='-R$libdir'
8774 hardcode_direct=yes
8775 hardcode_shlibpath_var=no
8776 ;;
8777
8778 hpux9*)
8779 if test "$GCC" = yes; then
8780 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8781 else
8782 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8783 fi
8784 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8785 hardcode_libdir_separator=:
8786 hardcode_direct=yes
8787
8788 # hardcode_minus_L: Not really in the search PATH,
8789 # but as the default location of the library.
8790 hardcode_minus_L=yes
8791 export_dynamic_flag_spec='${wl}-E'
8792 ;;
8793
8794 hpux10*)
8795 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8796 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8797 else
8798 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8799 fi
8800 if test "$with_gnu_ld" = no; then
8801 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8802 hardcode_libdir_flag_spec_ld='+b $libdir'
8803 hardcode_libdir_separator=:
8804 hardcode_direct=yes
8805 hardcode_direct_absolute=yes
8806 export_dynamic_flag_spec='${wl}-E'
8807 # hardcode_minus_L: Not really in the search PATH,
8808 # but as the default location of the library.
8809 hardcode_minus_L=yes
8810 fi
8811 ;;
8812
8813 hpux11*)
8814 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8815 case $host_cpu in
8816 hppa*64*)
8817 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8818 ;;
8819 ia64*)
8820 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8821 ;;
8822 *)
8823 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8824 ;;
8825 esac
8826 else
8827 case $host_cpu in
8828 hppa*64*)
8829 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8830 ;;
8831 ia64*)
8832 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8833 ;;
8834 *)
8835 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8836 ;;
8837 esac
8838 fi
8839 if test "$with_gnu_ld" = no; then
8840 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8841 hardcode_libdir_separator=:
8842
8843 case $host_cpu in
8844 hppa*64*|ia64*)
8845 hardcode_direct=no
8846 hardcode_shlibpath_var=no
8847 ;;
8848 *)
8849 hardcode_direct=yes
8850 hardcode_direct_absolute=yes
8851 export_dynamic_flag_spec='${wl}-E'
8852
8853 # hardcode_minus_L: Not really in the search PATH,
8854 # but as the default location of the library.
8855 hardcode_minus_L=yes
8856 ;;
8857 esac
8858 fi
8859 ;;
8860
8861 irix5* | irix6* | nonstopux*)
8862 if test "$GCC" = yes; then
8863 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8864 # Try to use the -exported_symbol ld option, if it does not
8865 # work, assume that -exports_file does not work either and
8866 # implicitly export all symbols.
8867 save_LDFLAGS="$LDFLAGS"
8868 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
8869 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8870/* end confdefs.h. */
8871int foo(void) {}
8872_ACEOF
8873if ac_fn_c_try_link "$LINENO"; then :
8874 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
8875
8876fi
8877rm -f core conftest.err conftest.$ac_objext \
8878 conftest$ac_exeext conftest.$ac_ext
8879 LDFLAGS="$save_LDFLAGS"
8880 else
8881 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8882 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
8883 fi
8884 archive_cmds_need_lc='no'
8885 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8886 hardcode_libdir_separator=:
8887 inherit_rpath=yes
8888 link_all_deplibs=yes
8889 ;;
8890
8891 netbsd* | netbsdelf*-gnu)
8892 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8893 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
8894 else
8895 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
8896 fi
8897 hardcode_libdir_flag_spec='-R$libdir'
8898 hardcode_direct=yes
8899 hardcode_shlibpath_var=no
8900 ;;
8901
8902 newsos6)
8903 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8904 hardcode_direct=yes
8905 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8906 hardcode_libdir_separator=:
8907 hardcode_shlibpath_var=no
8908 ;;
8909
8910 *nto* | *qnx*)
8911 ;;
8912
8913 openbsd*)
8914 if test -f /usr/libexec/ld.so; then
8915 hardcode_direct=yes
8916 hardcode_shlibpath_var=no
8917 hardcode_direct_absolute=yes
8918 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8919 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8920 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8921 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8922 export_dynamic_flag_spec='${wl}-E'
8923 else
8924 case $host_os in
8925 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8926 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8927 hardcode_libdir_flag_spec='-R$libdir'
8928 ;;
8929 *)
8930 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8931 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8932 ;;
8933 esac
8934 fi
8935 else
8936 ld_shlibs=no
8937 fi
8938 ;;
8939
8940 os2*)
8941 hardcode_libdir_flag_spec='-L$libdir'
8942 hardcode_minus_L=yes
8943 allow_undefined_flag=unsupported
8944 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8945 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8946 ;;
8947
8948 osf3*)
8949 if test "$GCC" = yes; then
8950 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8951 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8952 else
8953 allow_undefined_flag=' -expect_unresolved \*'
8954 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8955 fi
8956 archive_cmds_need_lc='no'
8957 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8958 hardcode_libdir_separator=:
8959 ;;
8960
8961 osf4* | osf5*) # as osf3* with the addition of -msym flag
8962 if test "$GCC" = yes; then
8963 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8964 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8965 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8966 else
8967 allow_undefined_flag=' -expect_unresolved \*'
8968 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8969 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
8970 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
8971
8972 # Both c and cxx compiler support -rpath directly
8973 hardcode_libdir_flag_spec='-rpath $libdir'
8974 fi
8975 archive_cmds_need_lc='no'
8976 hardcode_libdir_separator=:
8977 ;;
8978
8979 solaris*)
8980 no_undefined_flag=' -z defs'
8981 if test "$GCC" = yes; then
8982 wlarc='${wl}'
8983 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8984 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8985 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8986 else
8987 case `$CC -V 2>&1` in
8988 *"Compilers 5.0"*)
8989 wlarc=''
8990 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8991 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8992 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
8993 ;;
8994 *)
8995 wlarc='${wl}'
8996 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
8997 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8998 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8999 ;;
9000 esac
9001 fi
9002 hardcode_libdir_flag_spec='-R$libdir'
9003 hardcode_shlibpath_var=no
9004 case $host_os in
9005 solaris2.[0-5] | solaris2.[0-5].*) ;;
9006 *)
9007 # The compiler driver will combine and reorder linker options,
9008 # but understands `-z linker_flag'. GCC discards it without `$wl',
9009 # but is careful enough not to reorder.
9010 # Supported since Solaris 2.6 (maybe 2.5.1?)
9011 if test "$GCC" = yes; then
9012 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9013 else
9014 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
9015 fi
9016 ;;
9017 esac
9018 link_all_deplibs=yes
9019 ;;
9020
9021 sunos4*)
9022 if test "x$host_vendor" = xsequent; then
9023 # Use $CC to link under sequent, because it throws in some extra .o
9024 # files that make .init and .fini sections work.
9025 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9026 else
9027 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9028 fi
9029 hardcode_libdir_flag_spec='-L$libdir'
9030 hardcode_direct=yes
9031 hardcode_minus_L=yes
9032 hardcode_shlibpath_var=no
9033 ;;
9034
9035 sysv4)
9036 case $host_vendor in
9037 sni)
9038 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9039 hardcode_direct=yes # is this really true???
9040 ;;
9041 siemens)
9042 ## LD is ld it makes a PLAMLIB
9043 ## CC just makes a GrossModule.
9044 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9045 reload_cmds='$CC -r -o $output$reload_objs'
9046 hardcode_direct=no
9047 ;;
9048 motorola)
9049 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9050 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
9051 ;;
9052 esac
9053 runpath_var='LD_RUN_PATH'
9054 hardcode_shlibpath_var=no
9055 ;;
9056
9057 sysv4.3*)
9058 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9059 hardcode_shlibpath_var=no
9060 export_dynamic_flag_spec='-Bexport'
9061 ;;
9062
9063 sysv4*MP*)
9064 if test -d /usr/nec; then
9065 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9066 hardcode_shlibpath_var=no
9067 runpath_var=LD_RUN_PATH
9068 hardcode_runpath_var=yes
9069 ld_shlibs=yes
9070 fi
9071 ;;
9072
9073 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
9074 no_undefined_flag='${wl}-z,text'
9075 archive_cmds_need_lc=no
9076 hardcode_shlibpath_var=no
9077 runpath_var='LD_RUN_PATH'
9078
9079 if test "$GCC" = yes; then
9080 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9081 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9082 else
9083 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9084 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9085 fi
9086 ;;
9087
9088 sysv5* | sco3.2v5* | sco5v6*)
9089 # Note: We can NOT use -z defs as we might desire, because we do not
9090 # link with -lc, and that would cause any symbols used from libc to
9091 # always be unresolved, which means just about no library would
9092 # ever link correctly. If we're not using GNU ld we use -z text
9093 # though, which does catch some bad symbols but isn't as heavy-handed
9094 # as -z defs.
9095 no_undefined_flag='${wl}-z,text'
9096 allow_undefined_flag='${wl}-z,nodefs'
9097 archive_cmds_need_lc=no
9098 hardcode_shlibpath_var=no
9099 hardcode_libdir_flag_spec='${wl}-R,$libdir'
9100 hardcode_libdir_separator=':'
9101 link_all_deplibs=yes
9102 export_dynamic_flag_spec='${wl}-Bexport'
9103 runpath_var='LD_RUN_PATH'
9104
9105 if test "$GCC" = yes; then
9106 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9107 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9108 else
9109 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9110 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9111 fi
9112 ;;
9113
9114 uts4*)
9115 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9116 hardcode_libdir_flag_spec='-L$libdir'
9117 hardcode_shlibpath_var=no
9118 ;;
9119
9120 *)
9121 ld_shlibs=no
9122 ;;
9123 esac
9124
9125 if test x$host_vendor = xsni; then
9126 case $host in
9127 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9128 export_dynamic_flag_spec='${wl}-Blargedynsym'
9129 ;;
9130 esac
9131 fi
9132 fi
9133
9134{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
9135$as_echo "$ld_shlibs" >&6; }
9136test "$ld_shlibs" = no && can_build_shared=no
9137
9138with_gnu_ld=$with_gnu_ld
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154#
9155# Do we need to explicitly link libc?
9156#
9157case "x$archive_cmds_need_lc" in
9158x|xyes)
9159 # Assume -lc should be added
9160 archive_cmds_need_lc=yes
9161
9162 if test "$enable_shared" = yes && test "$GCC" = yes; then
9163 case $archive_cmds in
9164 *'~'*)
9165 # FIXME: we may have to deal with multi-command sequences.
9166 ;;
9167 '$CC '*)
9168 # Test whether the compiler implicitly links with -lc since on some
9169 # systems, -lgcc has to come before -lc. If gcc already passes -lc
9170 # to ld, don't add -lc before -lgcc.
9171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
9172$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
9173 $RM conftest*
9174 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9175
9176 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
9177 (eval $ac_compile) 2>&5
9178 ac_status=$?
9179 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9180 test $ac_status = 0; } 2>conftest.err; then
9181 soname=conftest
9182 lib=conftest
9183 libobjs=conftest.$ac_objext
9184 deplibs=
9185 wl=$lt_prog_compiler_wl
9186 pic_flag=$lt_prog_compiler_pic
9187 compiler_flags=-v
9188 linker_flags=-v
9189 verstring=
9190 output_objdir=.
9191 libname=conftest
9192 lt_save_allow_undefined_flag=$allow_undefined_flag
9193 allow_undefined_flag=
9194 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
9195 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
9196 ac_status=$?
9197 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9198 test $ac_status = 0; }
9199 then
9200 archive_cmds_need_lc=no
9201 else
9202 archive_cmds_need_lc=yes
9203 fi
9204 allow_undefined_flag=$lt_save_allow_undefined_flag
9205 else
9206 cat conftest.err 1>&5
9207 fi
9208 $RM conftest*
9209 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
9210$as_echo "$archive_cmds_need_lc" >&6; }
9211 ;;
9212 esac
9213 fi
9214 ;;
9215esac
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
9374$as_echo_n "checking dynamic linker characteristics... " >&6; }
9375
9376if test "$GCC" = yes; then
9377 case $host_os in
9378 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
9379 *) lt_awk_arg="/^libraries:/" ;;
9380 esac
9381 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9382 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
9383 # if the path contains ";" then we assume it to be the separator
9384 # otherwise default to the standard path separator (i.e. ":") - it is
9385 # assumed that no part of a normal pathname contains ";" but that should
9386 # okay in the real world where ";" in dirpaths is itself problematic.
9387 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
9388 else
9389 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9390 fi
9391 # Ok, now we have the path, separated by spaces, we can step through it
9392 # and add multilib dir if necessary.
9393 lt_tmp_lt_search_path_spec=
9394 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
9395 for lt_sys_path in $lt_search_path_spec; do
9396 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
9397 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
9398 else
9399 test -d "$lt_sys_path" && \
9400 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
9401 fi
9402 done
9403 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
9404BEGIN {RS=" "; FS="/|\n";} {
9405 lt_foo="";
9406 lt_count=0;
9407 for (lt_i = NF; lt_i > 0; lt_i--) {
9408 if ($lt_i != "" && $lt_i != ".") {
9409 if ($lt_i == "..") {
9410 lt_count++;
9411 } else {
9412 if (lt_count == 0) {
9413 lt_foo="/" $lt_i lt_foo;
9414 } else {
9415 lt_count--;
9416 }
9417 }
9418 }
9419 }
9420 if (lt_foo != "") { lt_freq[lt_foo]++; }
9421 if (lt_freq[lt_foo] == 1) { print lt_foo; }
9422}'`
9423 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
9424else
9425 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
9426fi
9427library_names_spec=
9428libname_spec='lib$name'
9429soname_spec=
9430shrext_cmds=".so"
9431postinstall_cmds=
9432postuninstall_cmds=
9433finish_cmds=
9434finish_eval=
9435shlibpath_var=
9436shlibpath_overrides_runpath=unknown
9437version_type=none
9438dynamic_linker="$host_os ld.so"
9439sys_lib_dlsearch_path_spec="/lib /usr/lib"
9440need_lib_prefix=unknown
9441hardcode_into_libs=no
9442
9443# when you set need_version to no, make sure it does not cause -set_version
9444# flags to be left without arguments
9445need_version=unknown
9446
9447case $host_os in
9448aix3*)
9449 version_type=linux
9450 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
9451 shlibpath_var=LIBPATH
9452
9453 # AIX 3 has no versioning support, so we append a major version to the name.
9454 soname_spec='${libname}${release}${shared_ext}$major'
9455 ;;
9456
9457aix[4-9]*)
9458 version_type=linux
9459 need_lib_prefix=no
9460 need_version=no
9461 hardcode_into_libs=yes
9462 if test "$host_cpu" = ia64; then
9463 # AIX 5 supports IA64
9464 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
9465 shlibpath_var=LD_LIBRARY_PATH
9466 else
9467 # With GCC up to 2.95.x, collect2 would create an import file
9468 # for dependence libraries. The import file would start with
9469 # the line `#! .'. This would cause the generated library to
9470 # depend on `.', always an invalid library. This was fixed in
9471 # development snapshots of GCC prior to 3.0.
9472 case $host_os in
9473 aix4 | aix4.[01] | aix4.[01].*)
9474 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
9475 echo ' yes '
9476 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
9477 :
9478 else
9479 can_build_shared=no
9480 fi
9481 ;;
9482 esac
9483 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
9484 # soname into executable. Probably we can add versioning support to
9485 # collect2, so additional links can be useful in future.
9486 if test "$aix_use_runtimelinking" = yes; then
9487 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
9488 # instead of lib<name>.a to let people know that these are not
9489 # typical AIX shared libraries.
9490 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9491 else
9492 # We preserve .a as extension for shared libraries through AIX4.2
9493 # and later when we are not doing run time linking.
9494 library_names_spec='${libname}${release}.a $libname.a'
9495 soname_spec='${libname}${release}${shared_ext}$major'
9496 fi
9497 shlibpath_var=LIBPATH
9498 fi
9499 ;;
9500
9501amigaos*)
9502 case $host_cpu in
9503 powerpc)
9504 # Since July 2007 AmigaOS4 officially supports .so libraries.
9505 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
9506 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9507 ;;
9508 m68k)
9509 library_names_spec='$libname.ixlibrary $libname.a'
9510 # Create ${libname}_ixlibrary.a entries in /sys/libs.
9511 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
9512 ;;
9513 esac
9514 ;;
9515
9516beos*)
9517 library_names_spec='${libname}${shared_ext}'
9518 dynamic_linker="$host_os ld.so"
9519 shlibpath_var=LIBRARY_PATH
9520 ;;
9521
9522bsdi[45]*)
9523 version_type=linux
9524 need_version=no
9525 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9526 soname_spec='${libname}${release}${shared_ext}$major'
9527 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
9528 shlibpath_var=LD_LIBRARY_PATH
9529 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
9530 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
9531 # the default ld.so.conf also contains /usr/contrib/lib and
9532 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
9533 # libtool to hard-code these into programs
9534 ;;
9535
9536cygwin* | mingw* | pw32* | cegcc*)
9537 version_type=windows
9538 shrext_cmds=".dll"
9539 need_version=no
9540 need_lib_prefix=no
9541
9542 case $GCC,$host_os in
9543 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
9544 library_names_spec='$libname.dll.a'
9545 # DLL is installed to $(libdir)/../bin by postinstall_cmds
9546 postinstall_cmds='base_file=`basename \${file}`~
9547 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
9548 dldir=$destdir/`dirname \$dlpath`~
9549 test -d \$dldir || mkdir -p \$dldir~
9550 $install_prog $dir/$dlname \$dldir/$dlname~
9551 chmod a+x \$dldir/$dlname~
9552 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
9553 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
9554 fi'
9555 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
9556 dlpath=$dir/\$dldll~
9557 $RM \$dlpath'
9558 shlibpath_overrides_runpath=yes
9559
9560 case $host_os in
9561 cygwin*)
9562 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
9563 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9564 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
9565 ;;
9566 mingw* | cegcc*)
9567 # MinGW DLLs use traditional 'lib' prefix
9568 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9569 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9570 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
9571 # It is most probably a Windows format PATH printed by
9572 # mingw gcc, but we are running on Cygwin. Gcc prints its search
9573 # path with ; separators, and with drive letters. We can handle the
9574 # drive letters (cygwin fileutils understands them), so leave them,
9575 # especially as we might pass files found there to a mingw objdump,
9576 # which wouldn't understand a cygwinified path. Ahh.
9577 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
9578 else
9579 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9580 fi
9581 ;;
9582 pw32*)
9583 # pw32 DLLs use 'pw' prefix rather than 'lib'
9584 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9585 ;;
9586 esac
9587 ;;
9588
9589 *)
9590 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
9591 ;;
9592 esac
9593 dynamic_linker='Win32 ld.exe'
9594 # FIXME: first we should search . and the directory the executable is in
9595 shlibpath_var=PATH
9596 ;;
9597
9598darwin* | rhapsody*)
9599 dynamic_linker="$host_os dyld"
9600 version_type=darwin
9601 need_lib_prefix=no
9602 need_version=no
9603 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
9604 soname_spec='${libname}${release}${major}$shared_ext'
9605 shlibpath_overrides_runpath=yes
9606 shlibpath_var=DYLD_LIBRARY_PATH
9607 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
9608
9609 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
9610 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
9611 ;;
9612
9613dgux*)
9614 version_type=linux
9615 need_lib_prefix=no
9616 need_version=no
9617 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
9618 soname_spec='${libname}${release}${shared_ext}$major'
9619 shlibpath_var=LD_LIBRARY_PATH
9620 ;;
9621
9622freebsd1*)
9623 dynamic_linker=no
9624 ;;
9625
9626freebsd* | dragonfly*)
9627 # DragonFly does not have aout. When/if they implement a new
9628 # versioning mechanism, adjust this.
9629 if test -x /usr/bin/objformat; then
9630 objformat=`/usr/bin/objformat`
9631 else
9632 case $host_os in
9633 freebsd[123]*) objformat=aout ;;
9634 *) objformat=elf ;;
9635 esac
9636 fi
9637 version_type=freebsd-$objformat
9638 case $version_type in
9639 freebsd-elf*)
9640 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9641 need_version=no
9642 need_lib_prefix=no
9643 ;;
9644 freebsd-*)
9645 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
9646 need_version=yes
9647 ;;
9648 esac
9649 shlibpath_var=LD_LIBRARY_PATH
9650 case $host_os in
9651 freebsd2*)
9652 shlibpath_overrides_runpath=yes
9653 ;;
9654 freebsd3.[01]* | freebsdelf3.[01]*)
9655 shlibpath_overrides_runpath=yes
9656 hardcode_into_libs=yes
9657 ;;
9658 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
9659 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
9660 shlibpath_overrides_runpath=no
9661 hardcode_into_libs=yes
9662 ;;
9663 *) # from 4.6 on, and DragonFly
9664 shlibpath_overrides_runpath=yes
9665 hardcode_into_libs=yes
9666 ;;
9667 esac
9668 ;;
9669
9670gnu*)
9671 version_type=linux
9672 need_lib_prefix=no
9673 need_version=no
9674 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
9675 soname_spec='${libname}${release}${shared_ext}$major'
9676 shlibpath_var=LD_LIBRARY_PATH
9677 hardcode_into_libs=yes
9678 ;;
9679
9680hpux9* | hpux10* | hpux11*)
9681 # Give a soname corresponding to the major version so that dld.sl refuses to
9682 # link against other versions.
9683 version_type=sunos
9684 need_lib_prefix=no
9685 need_version=no
9686 case $host_cpu in
9687 ia64*)
9688 shrext_cmds='.so'
9689 hardcode_into_libs=yes
9690 dynamic_linker="$host_os dld.so"
9691 shlibpath_var=LD_LIBRARY_PATH
9692 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9693 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9694 soname_spec='${libname}${release}${shared_ext}$major'
9695 if test "X$HPUX_IA64_MODE" = X32; then
9696 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
9697 else
9698 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
9699 fi
9700 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9701 ;;
9702 hppa*64*)
9703 shrext_cmds='.sl'
9704 hardcode_into_libs=yes
9705 dynamic_linker="$host_os dld.sl"
9706 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
9707 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9708 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9709 soname_spec='${libname}${release}${shared_ext}$major'
9710 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
9711 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9712 ;;
9713 *)
9714 shrext_cmds='.sl'
9715 dynamic_linker="$host_os dld.sl"
9716 shlibpath_var=SHLIB_PATH
9717 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
9718 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9719 soname_spec='${libname}${release}${shared_ext}$major'
9720 ;;
9721 esac
9722 # HP-UX runs *really* slowly unless shared libraries are mode 555.
9723 postinstall_cmds='chmod 555 $lib'
9724 ;;
9725
9726interix[3-9]*)
9727 version_type=linux
9728 need_lib_prefix=no
9729 need_version=no
9730 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9731 soname_spec='${libname}${release}${shared_ext}$major'
9732 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
9733 shlibpath_var=LD_LIBRARY_PATH
9734 shlibpath_overrides_runpath=no
9735 hardcode_into_libs=yes
9736 ;;
9737
9738irix5* | irix6* | nonstopux*)
9739 case $host_os in
9740 nonstopux*) version_type=nonstopux ;;
9741 *)
9742 if test "$lt_cv_prog_gnu_ld" = yes; then
9743 version_type=linux
9744 else
9745 version_type=irix
9746 fi ;;
9747 esac
9748 need_lib_prefix=no
9749 need_version=no
9750 soname_spec='${libname}${release}${shared_ext}$major'
9751 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
9752 case $host_os in
9753 irix5* | nonstopux*)
9754 libsuff= shlibsuff=
9755 ;;
9756 *)
9757 case $LD in # libtool.m4 will add one of these switches to LD
9758 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
9759 libsuff= shlibsuff= libmagic=32-bit;;
9760 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
9761 libsuff=32 shlibsuff=N32 libmagic=N32;;
9762 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
9763 libsuff=64 shlibsuff=64 libmagic=64-bit;;
9764 *) libsuff= shlibsuff= libmagic=never-match;;
9765 esac
9766 ;;
9767 esac
9768 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
9769 shlibpath_overrides_runpath=no
9770 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
9771 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
9772 hardcode_into_libs=yes
9773 ;;
9774
9775# No shared lib support for Linux oldld, aout, or coff.
9776linux*oldld* | linux*aout* | linux*coff*)
9777 dynamic_linker=no
9778 ;;
9779
9780# This must be Linux ELF.
9781linux* | k*bsd*-gnu | kopensolaris*-gnu)
9782 version_type=linux
9783 need_lib_prefix=no
9784 need_version=no
9785 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9786 soname_spec='${libname}${release}${shared_ext}$major'
9787 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
9788 shlibpath_var=LD_LIBRARY_PATH
9789 shlibpath_overrides_runpath=no
9790 # Some binutils ld are patched to set DT_RUNPATH
9791 save_LDFLAGS=$LDFLAGS
9792 save_libdir=$libdir
9793 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
9794 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
9795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9796/* end confdefs.h. */
9797
9798int
9799main ()
9800{
9801
9802 ;
9803 return 0;
9804}
9805_ACEOF
9806if ac_fn_c_try_link "$LINENO"; then :
9807 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
9808 shlibpath_overrides_runpath=yes
9809fi
9810fi
9811rm -f core conftest.err conftest.$ac_objext \
9812 conftest$ac_exeext conftest.$ac_ext
9813 LDFLAGS=$save_LDFLAGS
9814 libdir=$save_libdir
9815
9816 # This implies no fast_install, which is unacceptable.
9817 # Some rework will be needed to allow for fast_install
9818 # before this can be enabled.
9819 hardcode_into_libs=yes
9820
9821 # Append ld.so.conf contents to the search path
9822 if test -f /etc/ld.so.conf; then
9823 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9824 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
9825 fi
9826
9827 # We used to test for /lib/ld.so.1 and disable shared libraries on
9828 # powerpc, because MkLinux only supported shared libraries with the
9829 # GNU dynamic linker. Since this was broken with cross compilers,
9830 # most powerpc-linux boxes support dynamic linking these days and
9831 # people can always --disable-shared, the test was removed, and we
9832 # assume the GNU/Linux dynamic linker is in use.
9833 dynamic_linker='GNU/Linux ld.so'
9834 ;;
9835
9836netbsdelf*-gnu)
9837 version_type=linux
9838 need_lib_prefix=no
9839 need_version=no
9840 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9841 soname_spec='${libname}${release}${shared_ext}$major'
9842 shlibpath_var=LD_LIBRARY_PATH
9843 shlibpath_overrides_runpath=no
9844 hardcode_into_libs=yes
9845 dynamic_linker='NetBSD ld.elf_so'
9846 ;;
9847
9848netbsd*)
9849 version_type=sunos
9850 need_lib_prefix=no
9851 need_version=no
9852 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9853 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9854 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9855 dynamic_linker='NetBSD (a.out) ld.so'
9856 else
9857 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9858 soname_spec='${libname}${release}${shared_ext}$major'
9859 dynamic_linker='NetBSD ld.elf_so'
9860 fi
9861 shlibpath_var=LD_LIBRARY_PATH
9862 shlibpath_overrides_runpath=yes
9863 hardcode_into_libs=yes
9864 ;;
9865
9866newsos6)
9867 version_type=linux
9868 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9869 shlibpath_var=LD_LIBRARY_PATH
9870 shlibpath_overrides_runpath=yes
9871 ;;
9872
9873*nto* | *qnx*)
9874 version_type=qnx
9875 need_lib_prefix=no
9876 need_version=no
9877 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9878 soname_spec='${libname}${release}${shared_ext}$major'
9879 shlibpath_var=LD_LIBRARY_PATH
9880 shlibpath_overrides_runpath=no
9881 hardcode_into_libs=yes
9882 dynamic_linker='ldqnx.so'
9883 ;;
9884
9885openbsd*)
9886 version_type=sunos
9887 sys_lib_dlsearch_path_spec="/usr/lib"
9888 need_lib_prefix=no
9889 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
9890 case $host_os in
9891 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
9892 *) need_version=no ;;
9893 esac
9894 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9895 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9896 shlibpath_var=LD_LIBRARY_PATH
9897 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9898 case $host_os in
9899 openbsd2.[89] | openbsd2.[89].*)
9900 shlibpath_overrides_runpath=no
9901 ;;
9902 *)
9903 shlibpath_overrides_runpath=yes
9904 ;;
9905 esac
9906 else
9907 shlibpath_overrides_runpath=yes
9908 fi
9909 ;;
9910
9911os2*)
9912 libname_spec='$name'
9913 shrext_cmds=".dll"
9914 need_lib_prefix=no
9915 library_names_spec='$libname${shared_ext} $libname.a'
9916 dynamic_linker='OS/2 ld.exe'
9917 shlibpath_var=LIBPATH
9918 ;;
9919
9920osf3* | osf4* | osf5*)
9921 version_type=osf
9922 need_lib_prefix=no
9923 need_version=no
9924 soname_spec='${libname}${release}${shared_ext}$major'
9925 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9926 shlibpath_var=LD_LIBRARY_PATH
9927 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
9928 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9929 ;;
9930
9931rdos*)
9932 dynamic_linker=no
9933 ;;
9934
9935solaris*)
9936 version_type=linux
9937 need_lib_prefix=no
9938 need_version=no
9939 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9940 soname_spec='${libname}${release}${shared_ext}$major'
9941 shlibpath_var=LD_LIBRARY_PATH
9942 shlibpath_overrides_runpath=yes
9943 hardcode_into_libs=yes
9944 # ldd complains unless libraries are executable
9945 postinstall_cmds='chmod +x $lib'
9946 ;;
9947
9948sunos4*)
9949 version_type=sunos
9950 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9951 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
9952 shlibpath_var=LD_LIBRARY_PATH
9953 shlibpath_overrides_runpath=yes
9954 if test "$with_gnu_ld" = yes; then
9955 need_lib_prefix=no
9956 fi
9957 need_version=yes
9958 ;;
9959
9960sysv4 | sysv4.3*)
9961 version_type=linux
9962 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9963 soname_spec='${libname}${release}${shared_ext}$major'
9964 shlibpath_var=LD_LIBRARY_PATH
9965 case $host_vendor in
9966 sni)
9967 shlibpath_overrides_runpath=no
9968 need_lib_prefix=no
9969 runpath_var=LD_RUN_PATH
9970 ;;
9971 siemens)
9972 need_lib_prefix=no
9973 ;;
9974 motorola)
9975 need_lib_prefix=no
9976 need_version=no
9977 shlibpath_overrides_runpath=no
9978 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
9979 ;;
9980 esac
9981 ;;
9982
9983sysv4*MP*)
9984 if test -d /usr/nec ;then
9985 version_type=linux
9986 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
9987 soname_spec='$libname${shared_ext}.$major'
9988 shlibpath_var=LD_LIBRARY_PATH
9989 fi
9990 ;;
9991
9992sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
9993 version_type=freebsd-elf
9994 need_lib_prefix=no
9995 need_version=no
9996 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9997 soname_spec='${libname}${release}${shared_ext}$major'
9998 shlibpath_var=LD_LIBRARY_PATH
9999 shlibpath_overrides_runpath=yes
10000 hardcode_into_libs=yes
10001 if test "$with_gnu_ld" = yes; then
10002 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
10003 else
10004 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
10005 case $host_os in
10006 sco3.2v5*)
10007 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
10008 ;;
10009 esac
10010 fi
10011 sys_lib_dlsearch_path_spec='/usr/lib'
10012 ;;
10013
10014tpf*)
10015 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
10016 version_type=linux
10017 need_lib_prefix=no
10018 need_version=no
10019 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10020 shlibpath_var=LD_LIBRARY_PATH
10021 shlibpath_overrides_runpath=no
10022 hardcode_into_libs=yes
10023 ;;
10024
10025uts4*)
10026 version_type=linux
10027 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10028 soname_spec='${libname}${release}${shared_ext}$major'
10029 shlibpath_var=LD_LIBRARY_PATH
10030 ;;
10031
10032*)
10033 dynamic_linker=no
10034 ;;
10035esac
10036{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
10037$as_echo "$dynamic_linker" >&6; }
10038test "$dynamic_linker" = no && can_build_shared=no
10039
10040variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
10041if test "$GCC" = yes; then
10042 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
10043fi
10044
10045if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
10046 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
10047fi
10048if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
10049 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
10050fi
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
10139$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
10140hardcode_action=
10141if test -n "$hardcode_libdir_flag_spec" ||
10142 test -n "$runpath_var" ||
10143 test "X$hardcode_automatic" = "Xyes" ; then
10144
10145 # We can hardcode non-existent directories.
10146 if test "$hardcode_direct" != no &&
10147 # If the only mechanism to avoid hardcoding is shlibpath_var, we
10148 # have to relink, otherwise we might link with an installed library
10149 # when we should be linking with a yet-to-be-installed one
10150 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
10151 test "$hardcode_minus_L" != no; then
10152 # Linking always hardcodes the temporary library directory.
10153 hardcode_action=relink
10154 else
10155 # We can link without hardcoding, and we can hardcode nonexisting dirs.
10156 hardcode_action=immediate
10157 fi
10158else
10159 # We cannot hardcode anything, or else we can only hardcode existing
10160 # directories.
10161 hardcode_action=unsupported
10162fi
10163{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
10164$as_echo "$hardcode_action" >&6; }
10165
10166if test "$hardcode_action" = relink ||
10167 test "$inherit_rpath" = yes; then
10168 # Fast installation is not supported
10169 enable_fast_install=no
10170elif test "$shlibpath_overrides_runpath" = yes ||
10171 test "$enable_shared" = no; then
10172 # Fast installation is not necessary
10173 enable_fast_install=needless
10174fi
10175
10176
10177
10178
10179
10180
10181 if test "x$enable_dlopen" != xyes; then
10182 enable_dlopen=unknown
10183 enable_dlopen_self=unknown
10184 enable_dlopen_self_static=unknown
10185else
10186 lt_cv_dlopen=no
10187 lt_cv_dlopen_libs=
10188
10189 case $host_os in
10190 beos*)
10191 lt_cv_dlopen="load_add_on"
10192 lt_cv_dlopen_libs=
10193 lt_cv_dlopen_self=yes
10194 ;;
10195
10196 mingw* | pw32* | cegcc*)
10197 lt_cv_dlopen="LoadLibrary"
10198 lt_cv_dlopen_libs=
10199 ;;
10200
10201 cygwin*)
10202 lt_cv_dlopen="dlopen"
10203 lt_cv_dlopen_libs=
10204 ;;
10205
10206 darwin*)
10207 # if libdl is installed we need to link against it
10208 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10209$as_echo_n "checking for dlopen in -ldl... " >&6; }
10210if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10211 $as_echo_n "(cached) " >&6
10212else
10213 ac_check_lib_save_LIBS=$LIBS
10214LIBS="-ldl $LIBS"
10215cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10216/* end confdefs.h. */
10217
10218/* Override any GCC internal prototype to avoid an error.
10219 Use char because int might match the return type of a GCC
10220 builtin and then its argument prototype would still apply. */
10221#ifdef __cplusplus
10222extern "C"
10223#endif
10224char dlopen ();
10225int
10226main ()
10227{
10228return dlopen ();
10229 ;
10230 return 0;
10231}
10232_ACEOF
10233if ac_fn_c_try_link "$LINENO"; then :
10234 ac_cv_lib_dl_dlopen=yes
10235else
10236 ac_cv_lib_dl_dlopen=no
10237fi
10238rm -f core conftest.err conftest.$ac_objext \
10239 conftest$ac_exeext conftest.$ac_ext
10240LIBS=$ac_check_lib_save_LIBS
10241fi
10242{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10243$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10244if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10245 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10246else
10247
10248 lt_cv_dlopen="dyld"
10249 lt_cv_dlopen_libs=
10250 lt_cv_dlopen_self=yes
10251
10252fi
10253
10254 ;;
10255
10256 *)
10257 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10258if test "x$ac_cv_func_shl_load" = x""yes; then :
10259 lt_cv_dlopen="shl_load"
10260else
10261 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
10262$as_echo_n "checking for shl_load in -ldld... " >&6; }
10263if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10264 $as_echo_n "(cached) " >&6
10265else
10266 ac_check_lib_save_LIBS=$LIBS
10267LIBS="-ldld $LIBS"
10268cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10269/* end confdefs.h. */
10270
10271/* Override any GCC internal prototype to avoid an error.
10272 Use char because int might match the return type of a GCC
10273 builtin and then its argument prototype would still apply. */
10274#ifdef __cplusplus
10275extern "C"
10276#endif
10277char shl_load ();
10278int
10279main ()
10280{
10281return shl_load ();
10282 ;
10283 return 0;
10284}
10285_ACEOF
10286if ac_fn_c_try_link "$LINENO"; then :
10287 ac_cv_lib_dld_shl_load=yes
10288else
10289 ac_cv_lib_dld_shl_load=no
10290fi
10291rm -f core conftest.err conftest.$ac_objext \
10292 conftest$ac_exeext conftest.$ac_ext
10293LIBS=$ac_check_lib_save_LIBS
10294fi
10295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
10296$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10297if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10298 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
10299else
10300 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
10301if test "x$ac_cv_func_dlopen" = x""yes; then :
10302 lt_cv_dlopen="dlopen"
10303else
10304 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10305$as_echo_n "checking for dlopen in -ldl... " >&6; }
10306if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10307 $as_echo_n "(cached) " >&6
10308else
10309 ac_check_lib_save_LIBS=$LIBS
10310LIBS="-ldl $LIBS"
10311cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10312/* end confdefs.h. */
10313
10314/* Override any GCC internal prototype to avoid an error.
10315 Use char because int might match the return type of a GCC
10316 builtin and then its argument prototype would still apply. */
10317#ifdef __cplusplus
10318extern "C"
10319#endif
10320char dlopen ();
10321int
10322main ()
10323{
10324return dlopen ();
10325 ;
10326 return 0;
10327}
10328_ACEOF
10329if ac_fn_c_try_link "$LINENO"; then :
10330 ac_cv_lib_dl_dlopen=yes
10331else
10332 ac_cv_lib_dl_dlopen=no
10333fi
10334rm -f core conftest.err conftest.$ac_objext \
10335 conftest$ac_exeext conftest.$ac_ext
10336LIBS=$ac_check_lib_save_LIBS
10337fi
10338{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10339$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10340if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10341 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10342else
10343 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
10344$as_echo_n "checking for dlopen in -lsvld... " >&6; }
10345if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
10346 $as_echo_n "(cached) " >&6
10347else
10348 ac_check_lib_save_LIBS=$LIBS
10349LIBS="-lsvld $LIBS"
10350cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10351/* end confdefs.h. */
10352
10353/* Override any GCC internal prototype to avoid an error.
10354 Use char because int might match the return type of a GCC
10355 builtin and then its argument prototype would still apply. */
10356#ifdef __cplusplus
10357extern "C"
10358#endif
10359char dlopen ();
10360int
10361main ()
10362{
10363return dlopen ();
10364 ;
10365 return 0;
10366}
10367_ACEOF
10368if ac_fn_c_try_link "$LINENO"; then :
10369 ac_cv_lib_svld_dlopen=yes
10370else
10371 ac_cv_lib_svld_dlopen=no
10372fi
10373rm -f core conftest.err conftest.$ac_objext \
10374 conftest$ac_exeext conftest.$ac_ext
10375LIBS=$ac_check_lib_save_LIBS
10376fi
10377{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
10378$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10379if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
10380 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
10381else
10382 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
10383$as_echo_n "checking for dld_link in -ldld... " >&6; }
10384if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
10385 $as_echo_n "(cached) " >&6
10386else
10387 ac_check_lib_save_LIBS=$LIBS
10388LIBS="-ldld $LIBS"
10389cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10390/* end confdefs.h. */
10391
10392/* Override any GCC internal prototype to avoid an error.
10393 Use char because int might match the return type of a GCC
10394 builtin and then its argument prototype would still apply. */
10395#ifdef __cplusplus
10396extern "C"
10397#endif
10398char dld_link ();
10399int
10400main ()
10401{
10402return dld_link ();
10403 ;
10404 return 0;
10405}
10406_ACEOF
10407if ac_fn_c_try_link "$LINENO"; then :
10408 ac_cv_lib_dld_dld_link=yes
10409else
10410 ac_cv_lib_dld_dld_link=no
10411fi
10412rm -f core conftest.err conftest.$ac_objext \
10413 conftest$ac_exeext conftest.$ac_ext
10414LIBS=$ac_check_lib_save_LIBS
10415fi
10416{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
10417$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10418if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
10419 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
10420fi
10421
10422
10423fi
10424
10425
10426fi
10427
10428
10429fi
10430
10431
10432fi
10433
10434
10435fi
10436
10437 ;;
10438 esac
10439
10440 if test "x$lt_cv_dlopen" != xno; then
10441 enable_dlopen=yes
10442 else
10443 enable_dlopen=no
10444 fi
10445
10446 case $lt_cv_dlopen in
10447 dlopen)
10448 save_CPPFLAGS="$CPPFLAGS"
10449 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
10450
10451 save_LDFLAGS="$LDFLAGS"
10452 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
10453
10454 save_LIBS="$LIBS"
10455 LIBS="$lt_cv_dlopen_libs $LIBS"
10456
10457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
10458$as_echo_n "checking whether a program can dlopen itself... " >&6; }
10459if test "${lt_cv_dlopen_self+set}" = set; then :
10460 $as_echo_n "(cached) " >&6
10461else
10462 if test "$cross_compiling" = yes; then :
10463 lt_cv_dlopen_self=cross
10464else
10465 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10466 lt_status=$lt_dlunknown
10467 cat > conftest.$ac_ext <<_LT_EOF
10468#line 10468 "configure"
10469#include "confdefs.h"
10470
10471#if HAVE_DLFCN_H
10472#include <dlfcn.h>
10473#endif
10474
10475#include <stdio.h>
10476
10477#ifdef RTLD_GLOBAL
10478# define LT_DLGLOBAL RTLD_GLOBAL
10479#else
10480# ifdef DL_GLOBAL
10481# define LT_DLGLOBAL DL_GLOBAL
10482# else
10483# define LT_DLGLOBAL 0
10484# endif
10485#endif
10486
10487/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10488 find out it does not work in some platform. */
10489#ifndef LT_DLLAZY_OR_NOW
10490# ifdef RTLD_LAZY
10491# define LT_DLLAZY_OR_NOW RTLD_LAZY
10492# else
10493# ifdef DL_LAZY
10494# define LT_DLLAZY_OR_NOW DL_LAZY
10495# else
10496# ifdef RTLD_NOW
10497# define LT_DLLAZY_OR_NOW RTLD_NOW
10498# else
10499# ifdef DL_NOW
10500# define LT_DLLAZY_OR_NOW DL_NOW
10501# else
10502# define LT_DLLAZY_OR_NOW 0
10503# endif
10504# endif
10505# endif
10506# endif
10507#endif
10508
10509void fnord() { int i=42;}
10510int main ()
10511{
10512 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10513 int status = $lt_dlunknown;
10514
10515 if (self)
10516 {
10517 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10518 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10519 /* dlclose (self); */
10520 }
10521 else
10522 puts (dlerror ());
10523
10524 return status;
10525}
10526_LT_EOF
10527 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10528 (eval $ac_link) 2>&5
10529 ac_status=$?
10530 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10531 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10532 (./conftest; exit; ) >&5 2>/dev/null
10533 lt_status=$?
10534 case x$lt_status in
10535 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
10536 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
10537 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
10538 esac
10539 else :
10540 # compilation failed
10541 lt_cv_dlopen_self=no
10542 fi
10543fi
10544rm -fr conftest*
10545
10546
10547fi
10548{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
10549$as_echo "$lt_cv_dlopen_self" >&6; }
10550
10551 if test "x$lt_cv_dlopen_self" = xyes; then
10552 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
10553 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
10554$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
10555if test "${lt_cv_dlopen_self_static+set}" = set; then :
10556 $as_echo_n "(cached) " >&6
10557else
10558 if test "$cross_compiling" = yes; then :
10559 lt_cv_dlopen_self_static=cross
10560else
10561 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10562 lt_status=$lt_dlunknown
10563 cat > conftest.$ac_ext <<_LT_EOF
10564#line 10564 "configure"
10565#include "confdefs.h"
10566
10567#if HAVE_DLFCN_H
10568#include <dlfcn.h>
10569#endif
10570
10571#include <stdio.h>
10572
10573#ifdef RTLD_GLOBAL
10574# define LT_DLGLOBAL RTLD_GLOBAL
10575#else
10576# ifdef DL_GLOBAL
10577# define LT_DLGLOBAL DL_GLOBAL
10578# else
10579# define LT_DLGLOBAL 0
10580# endif
10581#endif
10582
10583/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10584 find out it does not work in some platform. */
10585#ifndef LT_DLLAZY_OR_NOW
10586# ifdef RTLD_LAZY
10587# define LT_DLLAZY_OR_NOW RTLD_LAZY
10588# else
10589# ifdef DL_LAZY
10590# define LT_DLLAZY_OR_NOW DL_LAZY
10591# else
10592# ifdef RTLD_NOW
10593# define LT_DLLAZY_OR_NOW RTLD_NOW
10594# else
10595# ifdef DL_NOW
10596# define LT_DLLAZY_OR_NOW DL_NOW
10597# else
10598# define LT_DLLAZY_OR_NOW 0
10599# endif
10600# endif
10601# endif
10602# endif
10603#endif
10604
10605void fnord() { int i=42;}
10606int main ()
10607{
10608 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10609 int status = $lt_dlunknown;
10610
10611 if (self)
10612 {
10613 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10614 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10615 /* dlclose (self); */
10616 }
10617 else
10618 puts (dlerror ());
10619
10620 return status;
10621}
10622_LT_EOF
10623 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10624 (eval $ac_link) 2>&5
10625 ac_status=$?
10626 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10627 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10628 (./conftest; exit; ) >&5 2>/dev/null
10629 lt_status=$?
10630 case x$lt_status in
10631 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
10632 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
10633 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
10634 esac
10635 else :
10636 # compilation failed
10637 lt_cv_dlopen_self_static=no
10638 fi
10639fi
10640rm -fr conftest*
10641
10642
10643fi
10644{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
10645$as_echo "$lt_cv_dlopen_self_static" >&6; }
10646 fi
10647
10648 CPPFLAGS="$save_CPPFLAGS"
10649 LDFLAGS="$save_LDFLAGS"
10650 LIBS="$save_LIBS"
10651 ;;
10652 esac
10653
10654 case $lt_cv_dlopen_self in
10655 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
10656 *) enable_dlopen_self=unknown ;;
10657 esac
10658
10659 case $lt_cv_dlopen_self_static in
10660 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
10661 *) enable_dlopen_self_static=unknown ;;
10662 esac
10663fi
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681striplib=
10682old_striplib=
10683{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
10684$as_echo_n "checking whether stripping libraries is possible... " >&6; }
10685if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
10686 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
10687 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
10688 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10689$as_echo "yes" >&6; }
10690else
10691# FIXME - insert some real tests, host_os isn't really good enough
10692 case $host_os in
10693 darwin*)
10694 if test -n "$STRIP" ; then
10695 striplib="$STRIP -x"
10696 old_striplib="$STRIP -S"
10697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10698$as_echo "yes" >&6; }
10699 else
10700 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10701$as_echo "no" >&6; }
10702 fi
10703 ;;
10704 *)
10705 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10706$as_echo "no" >&6; }
10707 ;;
10708 esac
10709fi
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722 # Report which library types will actually be built
10723 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
10724$as_echo_n "checking if libtool supports shared libraries... " >&6; }
10725 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
10726$as_echo "$can_build_shared" >&6; }
10727
10728 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
10729$as_echo_n "checking whether to build shared libraries... " >&6; }
10730 test "$can_build_shared" = "no" && enable_shared=no
10731
10732 # On AIX, shared libraries and static libraries use the same namespace, and
10733 # are all built from PIC.
10734 case $host_os in
10735 aix3*)
10736 test "$enable_shared" = yes && enable_static=no
10737 if test -n "$RANLIB"; then
10738 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10739 postinstall_cmds='$RANLIB $lib'
10740 fi
10741 ;;
10742
10743 aix[4-9]*)
10744 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
10745 test "$enable_shared" = yes && enable_static=no
10746 fi
10747 ;;
10748 esac
10749 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
10750$as_echo "$enable_shared" >&6; }
10751
10752 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
10753$as_echo_n "checking whether to build static libraries... " >&6; }
10754 # Make sure either enable_shared or enable_static is yes.
10755 test "$enable_shared" = yes || enable_static=yes
10756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
10757$as_echo "$enable_static" >&6; }
10758
10759
10760
10761
10762fi
10763ac_ext=c
10764ac_cpp='$CPP $CPPFLAGS'
10765ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10766ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10767ac_compiler_gnu=$ac_cv_c_compiler_gnu
10768
10769CC="$lt_save_CC"
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783 ac_config_commands="$ac_config_commands libtool"
10784
10785
10786
10787
10788# Only expand once:
10789
10790
10791
10792##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
10793##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
10794
10795
10796
10797cat >>confdefs.h <<_ACEOF
10798#define VMAJ 1
10799_ACEOF
10800
10801
10802cat >>confdefs.h <<_ACEOF
10803#define VMIN 1
10804_ACEOF
10805
10806
10807cat >>confdefs.h <<_ACEOF
10808#define VMIC 0
10809_ACEOF
10810
10811
10812cat >>confdefs.h <<_ACEOF
10813#define VREV 0
10814_ACEOF
10815
10816version_info="2:0:1"
10817release_info=""
10818
10819
10820##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
10821##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
10822VMAJ=1
10823
10824
10825### Default options with respect to host
10826
10827
10828
10829
10830requirement_embryo=""
10831embryoincludedir="${datadir}/include"
10832
10833
10834### Additional options to configure
10835
10836
10837
10838
10839have_embryo_cc="yes"
10840
10841
10842# Check whether --enable-embryo-cc was given.
10843if test "${enable_embryo_cc+set}" = set; then :
10844 enableval=$enable_embryo_cc;
10845 if test "x${enableval}" = "xyes" ; then
10846 have_embryo_cc="yes"
10847 else
10848 have_embryo_cc="no"
10849 fi
10850
10851fi
10852
10853
10854{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build embryo_cc binary" >&5
10855$as_echo_n "checking whether to build embryo_cc binary... " >&6; }
10856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_embryo_cc" >&5
10857$as_echo "$have_embryo_cc" >&6; }
10858
10859if test "x$have_embryo_cc" = "xyes"; then
10860 EMBRYO_CC_PRG=embryo_cc${EXEEXT}
10861fi
10862
10863
10864
10865 if test "x$have_embryo_cc" = "xyes"; then
10866 BUILD_EMBRYO_CC_TRUE=
10867 BUILD_EMBRYO_CC_FALSE='#'
10868else
10869 BUILD_EMBRYO_CC_TRUE='#'
10870 BUILD_EMBRYO_CC_FALSE=
10871fi
10872
10873
10874if test "x$have_embryo_cc" = "xyes"; then :
10875
10876fi
10877
10878
10879
10880
10881### Checks for programs
10882ac_ext=c
10883ac_cpp='$CPP $CPPFLAGS'
10884ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10885ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10886ac_compiler_gnu=$ac_cv_c_compiler_gnu
10887if test -n "$ac_tool_prefix"; then
10888 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
10889set dummy ${ac_tool_prefix}gcc; ac_word=$2
10890{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10891$as_echo_n "checking for $ac_word... " >&6; }
10892if test "${ac_cv_prog_CC+set}" = set; then :
10893 $as_echo_n "(cached) " >&6
10894else
10895 if test -n "$CC"; then
10896 ac_cv_prog_CC="$CC" # Let the user override the test.
10897else
10898as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10899for as_dir in $PATH
10900do
10901 IFS=$as_save_IFS
10902 test -z "$as_dir" && as_dir=.
10903 for ac_exec_ext in '' $ac_executable_extensions; do
10904 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10905 ac_cv_prog_CC="${ac_tool_prefix}gcc"
10906 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10907 break 2
10908 fi
10909done
10910 done
10911IFS=$as_save_IFS
10912
10913fi
10914fi
10915CC=$ac_cv_prog_CC
10916if test -n "$CC"; then
10917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
10918$as_echo "$CC" >&6; }
10919else
10920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10921$as_echo "no" >&6; }
10922fi
10923
10924
10925fi
10926if test -z "$ac_cv_prog_CC"; then
10927 ac_ct_CC=$CC
10928 # Extract the first word of "gcc", so it can be a program name with args.
10929set dummy gcc; ac_word=$2
10930{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10931$as_echo_n "checking for $ac_word... " >&6; }
10932if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
10933 $as_echo_n "(cached) " >&6
10934else
10935 if test -n "$ac_ct_CC"; then
10936 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
10937else
10938as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10939for as_dir in $PATH
10940do
10941 IFS=$as_save_IFS
10942 test -z "$as_dir" && as_dir=.
10943 for ac_exec_ext in '' $ac_executable_extensions; do
10944 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10945 ac_cv_prog_ac_ct_CC="gcc"
10946 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10947 break 2
10948 fi
10949done
10950 done
10951IFS=$as_save_IFS
10952
10953fi
10954fi
10955ac_ct_CC=$ac_cv_prog_ac_ct_CC
10956if test -n "$ac_ct_CC"; then
10957 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
10958$as_echo "$ac_ct_CC" >&6; }
10959else
10960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10961$as_echo "no" >&6; }
10962fi
10963
10964 if test "x$ac_ct_CC" = x; then
10965 CC=""
10966 else
10967 case $cross_compiling:$ac_tool_warned in
10968yes:)
10969{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
10970$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
10971ac_tool_warned=yes ;;
10972esac
10973 CC=$ac_ct_CC
10974 fi
10975else
10976 CC="$ac_cv_prog_CC"
10977fi
10978
10979if test -z "$CC"; then
10980 if test -n "$ac_tool_prefix"; then
10981 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
10982set dummy ${ac_tool_prefix}cc; ac_word=$2
10983{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10984$as_echo_n "checking for $ac_word... " >&6; }
10985if test "${ac_cv_prog_CC+set}" = set; then :
10986 $as_echo_n "(cached) " >&6
10987else
10988 if test -n "$CC"; then
10989 ac_cv_prog_CC="$CC" # Let the user override the test.
10990else
10991as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10992for as_dir in $PATH
10993do
10994 IFS=$as_save_IFS
10995 test -z "$as_dir" && as_dir=.
10996 for ac_exec_ext in '' $ac_executable_extensions; do
10997 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10998 ac_cv_prog_CC="${ac_tool_prefix}cc"
10999 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11000 break 2
11001 fi
11002done
11003 done
11004IFS=$as_save_IFS
11005
11006fi
11007fi
11008CC=$ac_cv_prog_CC
11009if test -n "$CC"; then
11010 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
11011$as_echo "$CC" >&6; }
11012else
11013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11014$as_echo "no" >&6; }
11015fi
11016
11017
11018 fi
11019fi
11020if test -z "$CC"; then
11021 # Extract the first word of "cc", so it can be a program name with args.
11022set dummy cc; ac_word=$2
11023{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11024$as_echo_n "checking for $ac_word... " >&6; }
11025if test "${ac_cv_prog_CC+set}" = set; then :
11026 $as_echo_n "(cached) " >&6
11027else
11028 if test -n "$CC"; then
11029 ac_cv_prog_CC="$CC" # Let the user override the test.
11030else
11031 ac_prog_rejected=no
11032as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11033for as_dir in $PATH
11034do
11035 IFS=$as_save_IFS
11036 test -z "$as_dir" && as_dir=.
11037 for ac_exec_ext in '' $ac_executable_extensions; do
11038 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11039 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
11040 ac_prog_rejected=yes
11041 continue
11042 fi
11043 ac_cv_prog_CC="cc"
11044 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11045 break 2
11046 fi
11047done
11048 done
11049IFS=$as_save_IFS
11050
11051if test $ac_prog_rejected = yes; then
11052 # We found a bogon in the path, so make sure we never use it.
11053 set dummy $ac_cv_prog_CC
11054 shift
11055 if test $# != 0; then
11056 # We chose a different compiler from the bogus one.
11057 # However, it has the same basename, so the bogon will be chosen
11058 # first if we set CC to just the basename; use the full file name.
11059 shift
11060 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
11061 fi
11062fi
11063fi
11064fi
11065CC=$ac_cv_prog_CC
11066if test -n "$CC"; then
11067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
11068$as_echo "$CC" >&6; }
11069else
11070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11071$as_echo "no" >&6; }
11072fi
11073
11074
11075fi
11076if test -z "$CC"; then
11077 if test -n "$ac_tool_prefix"; then
11078 for ac_prog in cl.exe
11079 do
11080 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11081set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11082{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11083$as_echo_n "checking for $ac_word... " >&6; }
11084if test "${ac_cv_prog_CC+set}" = set; then :
11085 $as_echo_n "(cached) " >&6
11086else
11087 if test -n "$CC"; then
11088 ac_cv_prog_CC="$CC" # Let the user override the test.
11089else
11090as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11091for as_dir in $PATH
11092do
11093 IFS=$as_save_IFS
11094 test -z "$as_dir" && as_dir=.
11095 for ac_exec_ext in '' $ac_executable_extensions; do
11096 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11097 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
11098 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11099 break 2
11100 fi
11101done
11102 done
11103IFS=$as_save_IFS
11104
11105fi
11106fi
11107CC=$ac_cv_prog_CC
11108if test -n "$CC"; then
11109 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
11110$as_echo "$CC" >&6; }
11111else
11112 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11113$as_echo "no" >&6; }
11114fi
11115
11116
11117 test -n "$CC" && break
11118 done
11119fi
11120if test -z "$CC"; then
11121 ac_ct_CC=$CC
11122 for ac_prog in cl.exe
11123do
11124 # Extract the first word of "$ac_prog", so it can be a program name with args.
11125set dummy $ac_prog; ac_word=$2
11126{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11127$as_echo_n "checking for $ac_word... " >&6; }
11128if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
11129 $as_echo_n "(cached) " >&6
11130else
11131 if test -n "$ac_ct_CC"; then
11132 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
11133else
11134as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11135for as_dir in $PATH
11136do
11137 IFS=$as_save_IFS
11138 test -z "$as_dir" && as_dir=.
11139 for ac_exec_ext in '' $ac_executable_extensions; do
11140 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11141 ac_cv_prog_ac_ct_CC="$ac_prog"
11142 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11143 break 2
11144 fi
11145done
11146 done
11147IFS=$as_save_IFS
11148
11149fi
11150fi
11151ac_ct_CC=$ac_cv_prog_ac_ct_CC
11152if test -n "$ac_ct_CC"; then
11153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
11154$as_echo "$ac_ct_CC" >&6; }
11155else
11156 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11157$as_echo "no" >&6; }
11158fi
11159
11160
11161 test -n "$ac_ct_CC" && break
11162done
11163
11164 if test "x$ac_ct_CC" = x; then
11165 CC=""
11166 else
11167 case $cross_compiling:$ac_tool_warned in
11168yes:)
11169{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
11170$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
11171ac_tool_warned=yes ;;
11172esac
11173 CC=$ac_ct_CC
11174 fi
11175fi
11176
11177fi
11178
11179
11180test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11181$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11182as_fn_error $? "no acceptable C compiler found in \$PATH
11183See \`config.log' for more details" "$LINENO" 5 ; }
11184
11185# Provide some information about the compiler.
11186$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
11187set X $ac_compile
11188ac_compiler=$2
11189for ac_option in --version -v -V -qversion; do
11190 { { ac_try="$ac_compiler $ac_option >&5"
11191case "(($ac_try" in
11192 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11193 *) ac_try_echo=$ac_try;;
11194esac
11195eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11196$as_echo "$ac_try_echo"; } >&5
11197 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
11198 ac_status=$?
11199 if test -s conftest.err; then
11200 sed '10a\
11201... rest of stderr output deleted ...
11202 10q' conftest.err >conftest.er1
11203 cat conftest.er1 >&5
11204 fi
11205 rm -f conftest.er1 conftest.err
11206 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11207 test $ac_status = 0; }
11208done
11209
11210{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
11211$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
11212if test "${ac_cv_c_compiler_gnu+set}" = set; then :
11213 $as_echo_n "(cached) " >&6
11214else
11215 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11216/* end confdefs.h. */
11217
11218int
11219main ()
11220{
11221#ifndef __GNUC__
11222 choke me
11223#endif
11224
11225 ;
11226 return 0;
11227}
11228_ACEOF
11229if ac_fn_c_try_compile "$LINENO"; then :
11230 ac_compiler_gnu=yes
11231else
11232 ac_compiler_gnu=no
11233fi
11234rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11235ac_cv_c_compiler_gnu=$ac_compiler_gnu
11236
11237fi
11238{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
11239$as_echo "$ac_cv_c_compiler_gnu" >&6; }
11240if test $ac_compiler_gnu = yes; then
11241 GCC=yes
11242else
11243 GCC=
11244fi
11245ac_test_CFLAGS=${CFLAGS+set}
11246ac_save_CFLAGS=$CFLAGS
11247{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
11248$as_echo_n "checking whether $CC accepts -g... " >&6; }
11249if test "${ac_cv_prog_cc_g+set}" = set; then :
11250 $as_echo_n "(cached) " >&6
11251else
11252 ac_save_c_werror_flag=$ac_c_werror_flag
11253 ac_c_werror_flag=yes
11254 ac_cv_prog_cc_g=no
11255 CFLAGS="-g"
11256 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11257/* end confdefs.h. */
11258
11259int
11260main ()
11261{
11262
11263 ;
11264 return 0;
11265}
11266_ACEOF
11267if ac_fn_c_try_compile "$LINENO"; then :
11268 ac_cv_prog_cc_g=yes
11269else
11270 CFLAGS=""
11271 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11272/* end confdefs.h. */
11273
11274int
11275main ()
11276{
11277
11278 ;
11279 return 0;
11280}
11281_ACEOF
11282if ac_fn_c_try_compile "$LINENO"; then :
11283
11284else
11285 ac_c_werror_flag=$ac_save_c_werror_flag
11286 CFLAGS="-g"
11287 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11288/* end confdefs.h. */
11289
11290int
11291main ()
11292{
11293
11294 ;
11295 return 0;
11296}
11297_ACEOF
11298if ac_fn_c_try_compile "$LINENO"; then :
11299 ac_cv_prog_cc_g=yes
11300fi
11301rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11302fi
11303rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11304fi
11305rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11306 ac_c_werror_flag=$ac_save_c_werror_flag
11307fi
11308{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
11309$as_echo "$ac_cv_prog_cc_g" >&6; }
11310if test "$ac_test_CFLAGS" = set; then
11311 CFLAGS=$ac_save_CFLAGS
11312elif test $ac_cv_prog_cc_g = yes; then
11313 if test "$GCC" = yes; then
11314 CFLAGS="-g -O2"
11315 else
11316 CFLAGS="-g"
11317 fi
11318else
11319 if test "$GCC" = yes; then
11320 CFLAGS="-O2"
11321 else
11322 CFLAGS=
11323 fi
11324fi
11325{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
11326$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
11327if test "${ac_cv_prog_cc_c89+set}" = set; then :
11328 $as_echo_n "(cached) " >&6
11329else
11330 ac_cv_prog_cc_c89=no
11331ac_save_CC=$CC
11332cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11333/* end confdefs.h. */
11334#include <stdarg.h>
11335#include <stdio.h>
11336#include <sys/types.h>
11337#include <sys/stat.h>
11338/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
11339struct buf { int x; };
11340FILE * (*rcsopen) (struct buf *, struct stat *, int);
11341static char *e (p, i)
11342 char **p;
11343 int i;
11344{
11345 return p[i];
11346}
11347static char *f (char * (*g) (char **, int), char **p, ...)
11348{
11349 char *s;
11350 va_list v;
11351 va_start (v,p);
11352 s = g (p, va_arg (v,int));
11353 va_end (v);
11354 return s;
11355}
11356
11357/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
11358 function prototypes and stuff, but not '\xHH' hex character constants.
11359 These don't provoke an error unfortunately, instead are silently treated
11360 as 'x'. The following induces an error, until -std is added to get
11361 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
11362 array size at least. It's necessary to write '\x00'==0 to get something
11363 that's true only with -std. */
11364int osf4_cc_array ['\x00' == 0 ? 1 : -1];
11365
11366/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
11367 inside strings and character constants. */
11368#define FOO(x) 'x'
11369int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
11370
11371int test (int i, double x);
11372struct s1 {int (*f) (int a);};
11373struct s2 {int (*f) (double a);};
11374int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
11375int argc;
11376char **argv;
11377int
11378main ()
11379{
11380return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
11381 ;
11382 return 0;
11383}
11384_ACEOF
11385for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
11386 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
11387do
11388 CC="$ac_save_CC $ac_arg"
11389 if ac_fn_c_try_compile "$LINENO"; then :
11390 ac_cv_prog_cc_c89=$ac_arg
11391fi
11392rm -f core conftest.err conftest.$ac_objext
11393 test "x$ac_cv_prog_cc_c89" != "xno" && break
11394done
11395rm -f conftest.$ac_ext
11396CC=$ac_save_CC
11397
11398fi
11399# AC_CACHE_VAL
11400case "x$ac_cv_prog_cc_c89" in
11401 x)
11402 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
11403$as_echo "none needed" >&6; } ;;
11404 xno)
11405 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
11406$as_echo "unsupported" >&6; } ;;
11407 *)
11408 CC="$CC $ac_cv_prog_cc_c89"
11409 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
11410$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
11411esac
11412if test "x$ac_cv_prog_cc_c89" != xno; then :
11413
11414fi
11415
11416ac_ext=c
11417ac_cpp='$CPP $CPPFLAGS'
11418ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11419ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11420ac_compiler_gnu=$ac_cv_c_compiler_gnu
11421
11422depcc="$CC" am_compiler_list=
11423
11424{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
11425$as_echo_n "checking dependency style of $depcc... " >&6; }
11426if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
11427 $as_echo_n "(cached) " >&6
11428else
11429 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11430 # We make a subdir and do the tests there. Otherwise we can end up
11431 # making bogus files that we don't know about and never remove. For
11432 # instance it was reported that on HP-UX the gcc test will end up
11433 # making a dummy file named `D' -- because `-MD' means `put the output
11434 # in D'.
11435 mkdir conftest.dir
11436 # Copy depcomp to subdir because otherwise we won't find it if we're
11437 # using a relative directory.
11438 cp "$am_depcomp" conftest.dir
11439 cd conftest.dir
11440 # We will build objects and dependencies in a subdirectory because
11441 # it helps to detect inapplicable dependency modes. For instance
11442 # both Tru64's cc and ICC support -MD to output dependencies as a
11443 # side effect of compilation, but ICC will put the dependencies in
11444 # the current directory while Tru64 will put them in the object
11445 # directory.
11446 mkdir sub
11447
11448 am_cv_CC_dependencies_compiler_type=none
11449 if test "$am_compiler_list" = ""; then
11450 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
11451 fi
11452 am__universal=false
11453 case " $depcc " in #(
11454 *\ -arch\ *\ -arch\ *) am__universal=true ;;
11455 esac
11456
11457 for depmode in $am_compiler_list; do
11458 # Setup a source with many dependencies, because some compilers
11459 # like to wrap large dependency lists on column 80 (with \), and
11460 # we should not choose a depcomp mode which is confused by this.
11461 #
11462 # We need to recreate these files for each test, as the compiler may
11463 # overwrite some of them when testing with obscure command lines.
11464 # This happens at least with the AIX C compiler.
11465 : > sub/conftest.c
11466 for i in 1 2 3 4 5 6; do
11467 echo '#include "conftst'$i'.h"' >> sub/conftest.c
11468 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
11469 # Solaris 8's {/usr,}/bin/sh.
11470 touch sub/conftst$i.h
11471 done
11472 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11473
11474 # We check with `-c' and `-o' for the sake of the "dashmstdout"
11475 # mode. It turns out that the SunPro C++ compiler does not properly
11476 # handle `-M -o', and we need to detect this. Also, some Intel
11477 # versions had trouble with output in subdirs
11478 am__obj=sub/conftest.${OBJEXT-o}
11479 am__minus_obj="-o $am__obj"
11480 case $depmode in
11481 gcc)
11482 # This depmode causes a compiler race in universal mode.
11483 test "$am__universal" = false || continue
11484 ;;
11485 nosideeffect)
11486 # after this tag, mechanisms are not by side-effect, so they'll
11487 # only be used when explicitly requested
11488 if test "x$enable_dependency_tracking" = xyes; then
11489 continue
11490 else
11491 break
11492 fi
11493 ;;
11494 msvisualcpp | msvcmsys)
11495 # This compiler won't grok `-c -o', but also, the minuso test has
11496 # not run yet. These depmodes are late enough in the game, and
11497 # so weak that their functioning should not be impacted.
11498 am__obj=conftest.${OBJEXT-o}
11499 am__minus_obj=
11500 ;;
11501 none) break ;;
11502 esac
11503 if depmode=$depmode \
11504 source=sub/conftest.c object=$am__obj \
11505 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11506 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11507 >/dev/null 2>conftest.err &&
11508 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11509 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11510 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11511 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11512 # icc doesn't choke on unknown options, it will just issue warnings
11513 # or remarks (even with -Werror). So we grep stderr for any message
11514 # that says an option was ignored or not supported.
11515 # When given -MP, icc 7.0 and 7.1 complain thusly:
11516 # icc: Command line warning: ignoring option '-M'; no argument required
11517 # The diagnosis changed in icc 8.0:
11518 # icc: Command line remark: option '-MP' not supported
11519 if (grep 'ignoring option' conftest.err ||
11520 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11521 am_cv_CC_dependencies_compiler_type=$depmode
11522 break
11523 fi
11524 fi
11525 done
11526
11527 cd ..
11528 rm -rf conftest.dir
11529else
11530 am_cv_CC_dependencies_compiler_type=none
11531fi
11532
11533fi
11534{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
11535$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
11536CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
11537
11538 if
11539 test "x$enable_dependency_tracking" != xno \
11540 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
11541 am__fastdepCC_TRUE=
11542 am__fastdepCC_FALSE='#'
11543else
11544 am__fastdepCC_TRUE='#'
11545 am__fastdepCC_FALSE=
11546fi
11547
11548
11549
11550# doxygen program for documentation building
11551
11552
11553
11554# Check whether --enable-doc was given.
11555if test "${enable_doc+set}" = set; then :
11556 enableval=$enable_doc;
11557 if test "x${enableval}" = "xyes" ; then
11558 efl_enable_doc="yes"
11559 else
11560 efl_enable_doc="no"
11561 fi
11562
11563else
11564 efl_enable_doc="yes"
11565fi
11566
11567
11568{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5
11569$as_echo_n "checking whether to build documentation... " >&6; }
11570{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${efl_enable_doc}" >&5
11571$as_echo "${efl_enable_doc}" >&6; }
11572
11573if test "x${efl_enable_doc}" = "xyes" ; then
11574
11575
11576 efl_doxygen="doxygen"
11577
11578
11579# Check whether --with-doxygen was given.
11580if test "${with_doxygen+set}" = set; then :
11581 withval=$with_doxygen;
11582 efl_doxygen=${withval}
11583 # Extract the first word of "${efl_doxygen}", so it can be a program name with args.
11584set dummy ${efl_doxygen}; ac_word=$2
11585{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11586$as_echo_n "checking for $ac_word... " >&6; }
11587if test "${ac_cv_prog_efl_have_doxygen+set}" = set; then :
11588 $as_echo_n "(cached) " >&6
11589else
11590 if test -n "$efl_have_doxygen"; then
11591 ac_cv_prog_efl_have_doxygen="$efl_have_doxygen" # Let the user override the test.
11592else
11593as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11594for as_dir in $PATH
11595do
11596 IFS=$as_save_IFS
11597 test -z "$as_dir" && as_dir=.
11598 for ac_exec_ext in '' $ac_executable_extensions; do
11599 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11600 ac_cv_prog_efl_have_doxygen="yes"
11601 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11602 break 2
11603 fi
11604done
11605 done
11606IFS=$as_save_IFS
11607
11608 test -z "$ac_cv_prog_efl_have_doxygen" && ac_cv_prog_efl_have_doxygen="no"
11609fi
11610fi
11611efl_have_doxygen=$ac_cv_prog_efl_have_doxygen
11612if test -n "$efl_have_doxygen"; then
11613 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $efl_have_doxygen" >&5
11614$as_echo "$efl_have_doxygen" >&6; }
11615else
11616 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11617$as_echo "no" >&6; }
11618fi
11619
11620
11621 if test "x${efl_have_doxygen}" = "xno" ; then
11622 echo "WARNING:"
11623 echo "The doxygen program you specified:"
11624 echo "${efl_doxygen}"
11625 echo "was not found. Please check the path and make sure "
11626 echo "the program exists and is executable."
11627 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no doxygen detected. Documentation will not be built" >&5
11628$as_echo "$as_me: WARNING: no doxygen detected. Documentation will not be built" >&2;}
11629 fi
11630
11631else
11632 # Extract the first word of "${efl_doxygen}", so it can be a program name with args.
11633set dummy ${efl_doxygen}; ac_word=$2
11634{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11635$as_echo_n "checking for $ac_word... " >&6; }
11636if test "${ac_cv_prog_efl_have_doxygen+set}" = set; then :
11637 $as_echo_n "(cached) " >&6
11638else
11639 if test -n "$efl_have_doxygen"; then
11640 ac_cv_prog_efl_have_doxygen="$efl_have_doxygen" # Let the user override the test.
11641else
11642as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11643for as_dir in $PATH
11644do
11645 IFS=$as_save_IFS
11646 test -z "$as_dir" && as_dir=.
11647 for ac_exec_ext in '' $ac_executable_extensions; do
11648 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11649 ac_cv_prog_efl_have_doxygen="yes"
11650 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11651 break 2
11652 fi
11653done
11654 done
11655IFS=$as_save_IFS
11656
11657 test -z "$ac_cv_prog_efl_have_doxygen" && ac_cv_prog_efl_have_doxygen="no"
11658fi
11659fi
11660efl_have_doxygen=$ac_cv_prog_efl_have_doxygen
11661if test -n "$efl_have_doxygen"; then
11662 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $efl_have_doxygen" >&5
11663$as_echo "$efl_have_doxygen" >&6; }
11664else
11665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11666$as_echo "no" >&6; }
11667fi
11668
11669
11670 if test "x${efl_have_doxygen}" = "xno" ; then
11671 echo "WARNING:"
11672 echo "The doxygen program was not found in your execute path."
11673 echo "You may have doxygen installed somewhere not covered by your path."
11674 echo ""
11675 echo "If this is the case make sure you have the packages installed, AND"
11676 echo "that the doxygen program is in your execute path (see your"
11677 echo "shell manual page on setting the \$PATH environment variable), OR"
11678 echo "alternatively, specify the program to use with --with-doxygen."
11679 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no doxygen detected. Documentation will not be built" >&5
11680$as_echo "$as_me: WARNING: no doxygen detected. Documentation will not be built" >&2;}
11681 fi
11682
11683fi
11684
11685fi
11686
11687
11688
11689if ! test "x${efl_have_doxygen}" = "xyes" ; then
11690 efl_enable_doc="no"
11691fi
11692
11693 if test "x${efl_enable_doc}" = "xyes"; then
11694 EFL_BUILD_DOC_TRUE=
11695 EFL_BUILD_DOC_FALSE='#'
11696else
11697 EFL_BUILD_DOC_TRUE='#'
11698 EFL_BUILD_DOC_FALSE=
11699fi
11700
11701
11702if test "x${efl_enable_doc}" = "xyes" ; then
11703 build_doc="yes"
11704else
11705 build_doc="no"
11706fi
11707
11708
11709
11710# pkg-config
11711
11712
11713
11714
11715
11716
11717
11718if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
11719 if test -n "$ac_tool_prefix"; then
11720 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
11721set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
11722{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11723$as_echo_n "checking for $ac_word... " >&6; }
11724if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
11725 $as_echo_n "(cached) " >&6
11726else
11727 case $PKG_CONFIG in
11728 [\\/]* | ?:[\\/]*)
11729 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
11730 ;;
11731 *)
11732 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11733for as_dir in $PATH
11734do
11735 IFS=$as_save_IFS
11736 test -z "$as_dir" && as_dir=.
11737 for ac_exec_ext in '' $ac_executable_extensions; do
11738 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11739 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
11740 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11741 break 2
11742 fi
11743done
11744 done
11745IFS=$as_save_IFS
11746
11747 ;;
11748esac
11749fi
11750PKG_CONFIG=$ac_cv_path_PKG_CONFIG
11751if test -n "$PKG_CONFIG"; then
11752 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
11753$as_echo "$PKG_CONFIG" >&6; }
11754else
11755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11756$as_echo "no" >&6; }
11757fi
11758
11759
11760fi
11761if test -z "$ac_cv_path_PKG_CONFIG"; then
11762 ac_pt_PKG_CONFIG=$PKG_CONFIG
11763 # Extract the first word of "pkg-config", so it can be a program name with args.
11764set dummy pkg-config; ac_word=$2
11765{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11766$as_echo_n "checking for $ac_word... " >&6; }
11767if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
11768 $as_echo_n "(cached) " >&6
11769else
11770 case $ac_pt_PKG_CONFIG in
11771 [\\/]* | ?:[\\/]*)
11772 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
11773 ;;
11774 *)
11775 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11776for as_dir in $PATH
11777do
11778 IFS=$as_save_IFS
11779 test -z "$as_dir" && as_dir=.
11780 for ac_exec_ext in '' $ac_executable_extensions; do
11781 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11782 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
11783 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11784 break 2
11785 fi
11786done
11787 done
11788IFS=$as_save_IFS
11789
11790 ;;
11791esac
11792fi
11793ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
11794if test -n "$ac_pt_PKG_CONFIG"; then
11795 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
11796$as_echo "$ac_pt_PKG_CONFIG" >&6; }
11797else
11798 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11799$as_echo "no" >&6; }
11800fi
11801
11802 if test "x$ac_pt_PKG_CONFIG" = x; then
11803 PKG_CONFIG=""
11804 else
11805 case $cross_compiling:$ac_tool_warned in
11806yes:)
11807{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
11808$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
11809ac_tool_warned=yes ;;
11810esac
11811 PKG_CONFIG=$ac_pt_PKG_CONFIG
11812 fi
11813else
11814 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
11815fi
11816
11817fi
11818if test -n "$PKG_CONFIG"; then
11819 _pkg_min_version=0.9.0
11820 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
11821$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
11822 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
11823 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11824$as_echo "yes" >&6; }
11825 else
11826 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11827$as_echo "no" >&6; }
11828 PKG_CONFIG=""
11829 fi
11830fi
11831
11832# Check whether pkg-config supports Requires.private
11833if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
11834 pkgconfig_requires_private="Requires.private"
11835else
11836 pkgconfig_requires_private="Requires"
11837fi
11838
11839
11840
11841### Checks for libraries
11842
11843# Evil library for compilation on Windows
11844
11845EFL_EMBRYO_BUILD=""
11846case "$host_os" in
11847 mingw*)
11848
11849pkg_failed=no
11850{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVIL" >&5
11851$as_echo_n "checking for EVIL... " >&6; }
11852
11853if test -n "$EVIL_CFLAGS"; then
11854 pkg_cv_EVIL_CFLAGS="$EVIL_CFLAGS"
11855 elif test -n "$PKG_CONFIG"; then
11856 if test -n "$PKG_CONFIG" && \
11857 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evil >= 1.0.0\""; } >&5
11858 ($PKG_CONFIG --exists --print-errors "evil >= 1.0.0") 2>&5
11859 ac_status=$?
11860 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11861 test $ac_status = 0; }; then
11862 pkg_cv_EVIL_CFLAGS=`$PKG_CONFIG --cflags "evil >= 1.0.0" 2>/dev/null`
11863else
11864 pkg_failed=yes
11865fi
11866 else
11867 pkg_failed=untried
11868fi
11869if test -n "$EVIL_LIBS"; then
11870 pkg_cv_EVIL_LIBS="$EVIL_LIBS"
11871 elif test -n "$PKG_CONFIG"; then
11872 if test -n "$PKG_CONFIG" && \
11873 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evil >= 1.0.0\""; } >&5
11874 ($PKG_CONFIG --exists --print-errors "evil >= 1.0.0") 2>&5
11875 ac_status=$?
11876 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11877 test $ac_status = 0; }; then
11878 pkg_cv_EVIL_LIBS=`$PKG_CONFIG --libs "evil >= 1.0.0" 2>/dev/null`
11879else
11880 pkg_failed=yes
11881fi
11882 else
11883 pkg_failed=untried
11884fi
11885
11886
11887
11888if test $pkg_failed = yes; then
11889 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11890$as_echo "no" >&6; }
11891
11892if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11893 _pkg_short_errors_supported=yes
11894else
11895 _pkg_short_errors_supported=no
11896fi
11897 if test $_pkg_short_errors_supported = yes; then
11898 EVIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "evil >= 1.0.0" 2>&1`
11899 else
11900 EVIL_PKG_ERRORS=`$PKG_CONFIG --print-errors "evil >= 1.0.0" 2>&1`
11901 fi
11902 # Put the nasty error message in config.log where it belongs
11903 echo "$EVIL_PKG_ERRORS" >&5
11904
11905 as_fn_error $? "Package requirements (evil >= 1.0.0) were not met:
11906
11907$EVIL_PKG_ERRORS
11908
11909Consider adjusting the PKG_CONFIG_PATH environment variable if you
11910installed software in a non-standard prefix.
11911
11912Alternatively, you may set the environment variables EVIL_CFLAGS
11913and EVIL_LIBS to avoid the need to call pkg-config.
11914See the pkg-config man page for more details." "$LINENO" 5
11915elif test $pkg_failed = untried; then
11916 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11917$as_echo "no" >&6; }
11918 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11919$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11920as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11921is in your PATH or set the PKG_CONFIG environment variable to the full
11922path to pkg-config.
11923
11924Alternatively, you may set the environment variables EVIL_CFLAGS
11925and EVIL_LIBS to avoid the need to call pkg-config.
11926See the pkg-config man page for more details.
11927
11928To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11929See \`config.log' for more details" "$LINENO" 5 ; }
11930else
11931 EVIL_CFLAGS=$pkg_cv_EVIL_CFLAGS
11932 EVIL_LIBS=$pkg_cv_EVIL_LIBS
11933 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11934$as_echo "yes" >&6; }
11935
11936fi
11937
11938$as_echo "#define HAVE_EVIL 1" >>confdefs.h
11939
11940 requirement_embryo="evil ${requirement_embryo}"
11941 EFL_EMBRYO_BUILD="-DEFL_EMBRYO_BUILD"
11942 ;;
11943esac
11944
11945
11946# For embryo_cc_prefix.c
11947
11948pkg_failed=no
11949{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EINA" >&5
11950$as_echo_n "checking for EINA... " >&6; }
11951
11952if test -n "$EINA_CFLAGS"; then
11953 pkg_cv_EINA_CFLAGS="$EINA_CFLAGS"
11954 elif test -n "$PKG_CONFIG"; then
11955 if test -n "$PKG_CONFIG" && \
11956 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eina >= 1.1.0\""; } >&5
11957 ($PKG_CONFIG --exists --print-errors "eina >= 1.1.0") 2>&5
11958 ac_status=$?
11959 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11960 test $ac_status = 0; }; then
11961 pkg_cv_EINA_CFLAGS=`$PKG_CONFIG --cflags "eina >= 1.1.0" 2>/dev/null`
11962else
11963 pkg_failed=yes
11964fi
11965 else
11966 pkg_failed=untried
11967fi
11968if test -n "$EINA_LIBS"; then
11969 pkg_cv_EINA_LIBS="$EINA_LIBS"
11970 elif test -n "$PKG_CONFIG"; then
11971 if test -n "$PKG_CONFIG" && \
11972 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eina >= 1.1.0\""; } >&5
11973 ($PKG_CONFIG --exists --print-errors "eina >= 1.1.0") 2>&5
11974 ac_status=$?
11975 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11976 test $ac_status = 0; }; then
11977 pkg_cv_EINA_LIBS=`$PKG_CONFIG --libs "eina >= 1.1.0" 2>/dev/null`
11978else
11979 pkg_failed=yes
11980fi
11981 else
11982 pkg_failed=untried
11983fi
11984
11985
11986
11987if test $pkg_failed = yes; then
11988 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11989$as_echo "no" >&6; }
11990
11991if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11992 _pkg_short_errors_supported=yes
11993else
11994 _pkg_short_errors_supported=no
11995fi
11996 if test $_pkg_short_errors_supported = yes; then
11997 EINA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "eina >= 1.1.0" 2>&1`
11998 else
11999 EINA_PKG_ERRORS=`$PKG_CONFIG --print-errors "eina >= 1.1.0" 2>&1`
12000 fi
12001 # Put the nasty error message in config.log where it belongs
12002 echo "$EINA_PKG_ERRORS" >&5
12003
12004 as_fn_error $? "Package requirements (eina >= 1.1.0) were not met:
12005
12006$EINA_PKG_ERRORS
12007
12008Consider adjusting the PKG_CONFIG_PATH environment variable if you
12009installed software in a non-standard prefix.
12010
12011Alternatively, you may set the environment variables EINA_CFLAGS
12012and EINA_LIBS to avoid the need to call pkg-config.
12013See the pkg-config man page for more details." "$LINENO" 5
12014elif test $pkg_failed = untried; then
12015 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12016$as_echo "no" >&6; }
12017 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12018$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12019as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
12020is in your PATH or set the PKG_CONFIG environment variable to the full
12021path to pkg-config.
12022
12023Alternatively, you may set the environment variables EINA_CFLAGS
12024and EINA_LIBS to avoid the need to call pkg-config.
12025See the pkg-config man page for more details.
12026
12027To get pkg-config, see <http://pkg-config.freedesktop.org/>.
12028See \`config.log' for more details" "$LINENO" 5 ; }
12029else
12030 EINA_CFLAGS=$pkg_cv_EINA_CFLAGS
12031 EINA_LIBS=$pkg_cv_EINA_LIBS
12032 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12033$as_echo "yes" >&6; }
12034
12035fi
12036
12037### Checks for header files
12038
12039for ac_header in unistd.h
12040do :
12041 ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
12042if test "x$ac_cv_header_unistd_h" = x""yes; then :
12043 cat >>confdefs.h <<_ACEOF
12044#define HAVE_UNISTD_H 1
12045_ACEOF
12046
12047fi
12048
12049done
12050
12051
12052
12053default_max="4096"
12054ac_ext=c
12055ac_cpp='$CPP $CPPFLAGS'
12056ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12057ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12058ac_compiler_gnu=$ac_cv_c_compiler_gnu
12059
12060
12061{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PATH_MAX in limits.h" >&5
12062$as_echo_n "checking for PATH_MAX in limits.h... " >&6; }
12063cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12064/* end confdefs.h. */
12065
12066#include <limits.h>
12067
12068int
12069main ()
12070{
12071
12072int i = PATH_MAX;
12073
12074 ;
12075 return 0;
12076}
12077_ACEOF
12078if ac_fn_c_try_compile "$LINENO"; then :
12079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12080$as_echo "yes" >&6; }
12081else
12082
12083
12084cat >>confdefs.h <<_ACEOF
12085#define PATH_MAX ${default_max}
12086_ACEOF
12087
12088 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: using ${default_max}" >&5
12089$as_echo "no: using ${default_max}" >&6; }
12090
12091fi
12092rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12093
12094ac_ext=c
12095ac_cpp='$CPP $CPPFLAGS'
12096ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12097ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12098ac_compiler_gnu=$ac_cv_c_compiler_gnu
12099
12100
12101
12102
12103
12104### Checks for types
12105
12106
12107### Checks for structures
12108
12109
12110### Checks for compiler characteristics
12111 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
12112$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
12113if test "${ac_cv_c_bigendian+set}" = set; then :
12114 $as_echo_n "(cached) " >&6
12115else
12116 ac_cv_c_bigendian=unknown
12117 # See if we're dealing with a universal compiler.
12118 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12119/* end confdefs.h. */
12120#ifndef __APPLE_CC__
12121 not a universal capable compiler
12122 #endif
12123 typedef int dummy;
12124
12125_ACEOF
12126if ac_fn_c_try_compile "$LINENO"; then :
12127
12128 # Check for potential -arch flags. It is not universal unless
12129 # there are at least two -arch flags with different values.
12130 ac_arch=
12131 ac_prev=
12132 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12133 if test -n "$ac_prev"; then
12134 case $ac_word in
12135 i?86 | x86_64 | ppc | ppc64)
12136 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12137 ac_arch=$ac_word
12138 else
12139 ac_cv_c_bigendian=universal
12140 break
12141 fi
12142 ;;
12143 esac
12144 ac_prev=
12145 elif test "x$ac_word" = "x-arch"; then
12146 ac_prev=arch
12147 fi
12148 done
12149fi
12150rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12151 if test $ac_cv_c_bigendian = unknown; then
12152 # See if sys/param.h defines the BYTE_ORDER macro.
12153 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12154/* end confdefs.h. */
12155#include <sys/types.h>
12156 #include <sys/param.h>
12157
12158int
12159main ()
12160{
12161#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12162 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12163 && LITTLE_ENDIAN)
12164 bogus endian macros
12165 #endif
12166
12167 ;
12168 return 0;
12169}
12170_ACEOF
12171if ac_fn_c_try_compile "$LINENO"; then :
12172 # It does; now see whether it defined to BIG_ENDIAN or not.
12173 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12174/* end confdefs.h. */
12175#include <sys/types.h>
12176 #include <sys/param.h>
12177
12178int
12179main ()
12180{
12181#if BYTE_ORDER != BIG_ENDIAN
12182 not big endian
12183 #endif
12184
12185 ;
12186 return 0;
12187}
12188_ACEOF
12189if ac_fn_c_try_compile "$LINENO"; then :
12190 ac_cv_c_bigendian=yes
12191else
12192 ac_cv_c_bigendian=no
12193fi
12194rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12195fi
12196rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12197 fi
12198 if test $ac_cv_c_bigendian = unknown; then
12199 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12201/* end confdefs.h. */
12202#include <limits.h>
12203
12204int
12205main ()
12206{
12207#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12208 bogus endian macros
12209 #endif
12210
12211 ;
12212 return 0;
12213}
12214_ACEOF
12215if ac_fn_c_try_compile "$LINENO"; then :
12216 # It does; now see whether it defined to _BIG_ENDIAN or not.
12217 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12218/* end confdefs.h. */
12219#include <limits.h>
12220
12221int
12222main ()
12223{
12224#ifndef _BIG_ENDIAN
12225 not big endian
12226 #endif
12227
12228 ;
12229 return 0;
12230}
12231_ACEOF
12232if ac_fn_c_try_compile "$LINENO"; then :
12233 ac_cv_c_bigendian=yes
12234else
12235 ac_cv_c_bigendian=no
12236fi
12237rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12238fi
12239rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12240 fi
12241 if test $ac_cv_c_bigendian = unknown; then
12242 # Compile a test program.
12243 if test "$cross_compiling" = yes; then :
12244 # Try to guess by grepping values from an object file.
12245 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12246/* end confdefs.h. */
12247short int ascii_mm[] =
12248 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12249 short int ascii_ii[] =
12250 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12251 int use_ascii (int i) {
12252 return ascii_mm[i] + ascii_ii[i];
12253 }
12254 short int ebcdic_ii[] =
12255 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12256 short int ebcdic_mm[] =
12257 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12258 int use_ebcdic (int i) {
12259 return ebcdic_mm[i] + ebcdic_ii[i];
12260 }
12261 extern int foo;
12262
12263int
12264main ()
12265{
12266return use_ascii (foo) == use_ebcdic (foo);
12267 ;
12268 return 0;
12269}
12270_ACEOF
12271if ac_fn_c_try_compile "$LINENO"; then :
12272 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12273 ac_cv_c_bigendian=yes
12274 fi
12275 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12276 if test "$ac_cv_c_bigendian" = unknown; then
12277 ac_cv_c_bigendian=no
12278 else
12279 # finding both strings is unlikely to happen, but who knows?
12280 ac_cv_c_bigendian=unknown
12281 fi
12282 fi
12283fi
12284rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12285else
12286 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12287/* end confdefs.h. */
12288$ac_includes_default
12289int
12290main ()
12291{
12292
12293 /* Are we little or big endian? From Harbison&Steele. */
12294 union
12295 {
12296 long int l;
12297 char c[sizeof (long int)];
12298 } u;
12299 u.l = 1;
12300 return u.c[sizeof (long int) - 1] == 1;
12301
12302 ;
12303 return 0;
12304}
12305_ACEOF
12306if ac_fn_c_try_run "$LINENO"; then :
12307 ac_cv_c_bigendian=no
12308else
12309 ac_cv_c_bigendian=yes
12310fi
12311rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12312 conftest.$ac_objext conftest.beam conftest.$ac_ext
12313fi
12314
12315 fi
12316fi
12317{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
12318$as_echo "$ac_cv_c_bigendian" >&6; }
12319 case $ac_cv_c_bigendian in #(
12320 yes)
12321 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
12322;; #(
12323 no)
12324 ;; #(
12325 universal)
12326
12327$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
12328
12329 ;; #(
12330 *)
12331 as_fn_error $? "unknown endianness
12332 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
12333 esac
12334
12335if test "x$CC" != xcc; then
12336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
12337$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
12338else
12339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
12340$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
12341fi
12342set dummy $CC; ac_cc=`$as_echo "$2" |
12343 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
12344if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
12345 $as_echo_n "(cached) " >&6
12346else
12347 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12348/* end confdefs.h. */
12349
12350int
12351main ()
12352{
12353
12354 ;
12355 return 0;
12356}
12357_ACEOF
12358# Make sure it works both with $CC and with simple cc.
12359# We do the test twice because some compilers refuse to overwrite an
12360# existing .o file with -o, though they will create one.
12361ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
12362rm -f conftest2.*
12363if { { case "(($ac_try" in
12364 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12365 *) ac_try_echo=$ac_try;;
12366esac
12367eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12368$as_echo "$ac_try_echo"; } >&5
12369 (eval "$ac_try") 2>&5
12370 ac_status=$?
12371 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12372 test $ac_status = 0; } &&
12373 test -f conftest2.$ac_objext && { { case "(($ac_try" in
12374 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12375 *) ac_try_echo=$ac_try;;
12376esac
12377eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12378$as_echo "$ac_try_echo"; } >&5
12379 (eval "$ac_try") 2>&5
12380 ac_status=$?
12381 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12382 test $ac_status = 0; };
12383then
12384 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
12385 if test "x$CC" != xcc; then
12386 # Test first that cc exists at all.
12387 if { ac_try='cc -c conftest.$ac_ext >&5'
12388 { { case "(($ac_try" in
12389 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12390 *) ac_try_echo=$ac_try;;
12391esac
12392eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12393$as_echo "$ac_try_echo"; } >&5
12394 (eval "$ac_try") 2>&5
12395 ac_status=$?
12396 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12397 test $ac_status = 0; }; }; then
12398 ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
12399 rm -f conftest2.*
12400 if { { case "(($ac_try" in
12401 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12402 *) ac_try_echo=$ac_try;;
12403esac
12404eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12405$as_echo "$ac_try_echo"; } >&5
12406 (eval "$ac_try") 2>&5
12407 ac_status=$?
12408 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12409 test $ac_status = 0; } &&
12410 test -f conftest2.$ac_objext && { { case "(($ac_try" in
12411 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12412 *) ac_try_echo=$ac_try;;
12413esac
12414eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12415$as_echo "$ac_try_echo"; } >&5
12416 (eval "$ac_try") 2>&5
12417 ac_status=$?
12418 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12419 test $ac_status = 0; };
12420 then
12421 # cc works too.
12422 :
12423 else
12424 # cc exists but doesn't like -o.
12425 eval ac_cv_prog_cc_${ac_cc}_c_o=no
12426 fi
12427 fi
12428 fi
12429else
12430 eval ac_cv_prog_cc_${ac_cc}_c_o=no
12431fi
12432rm -f core conftest*
12433
12434fi
12435if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
12436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12437$as_echo "yes" >&6; }
12438else
12439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12440$as_echo "no" >&6; }
12441
12442$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
12443
12444fi
12445
12446# FIXME: we rely on the cache variable name because
12447# there is no other way.
12448set dummy $CC
12449am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
12450eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
12451if test "$am_t" != yes; then
12452 # Losing compiler, so override with the script.
12453 # FIXME: It is wrong to rewrite CC.
12454 # But if we don't then we get into trouble of one sort or another.
12455 # A longer-term fix would be to have automake use am__CC in this case,
12456 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12457 CC="$am_aux_dir/compile $CC"
12458fi
12459
12460
12461{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
12462$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
12463if test "${ac_cv_c_const+set}" = set; then :
12464 $as_echo_n "(cached) " >&6
12465else
12466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12467/* end confdefs.h. */
12468
12469int
12470main ()
12471{
12472/* FIXME: Include the comments suggested by Paul. */
12473#ifndef __cplusplus
12474 /* Ultrix mips cc rejects this. */
12475 typedef int charset[2];
12476 const charset cs;
12477 /* SunOS 4.1.1 cc rejects this. */
12478 char const *const *pcpcc;
12479 char **ppc;
12480 /* NEC SVR4.0.2 mips cc rejects this. */
12481 struct point {int x, y;};
12482 static struct point const zero = {0,0};
12483 /* AIX XL C 1.02.0.0 rejects this.
12484 It does not let you subtract one const X* pointer from another in
12485 an arm of an if-expression whose if-part is not a constant
12486 expression */
12487 const char *g = "string";
12488 pcpcc = &g + (g ? g-g : 0);
12489 /* HPUX 7.0 cc rejects these. */
12490 ++pcpcc;
12491 ppc = (char**) pcpcc;
12492 pcpcc = (char const *const *) ppc;
12493 { /* SCO 3.2v4 cc rejects this. */
12494 char *t;
12495 char const *s = 0 ? (char *) 0 : (char const *) 0;
12496
12497 *t++ = 0;
12498 if (s) return 0;
12499 }
12500 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
12501 int x[] = {25, 17};
12502 const int *foo = &x[0];
12503 ++foo;
12504 }
12505 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
12506 typedef const int *iptr;
12507 iptr p = 0;
12508 ++p;
12509 }
12510 { /* AIX XL C 1.02.0.0 rejects this saying
12511 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
12512 struct s { int j; const int *ap[3]; };
12513 struct s *b; b->j = 5;
12514 }
12515 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
12516 const int foo = 10;
12517 if (!foo) return 0;
12518 }
12519 return !cs[0] && !zero.x;
12520#endif
12521
12522 ;
12523 return 0;
12524}
12525_ACEOF
12526if ac_fn_c_try_compile "$LINENO"; then :
12527 ac_cv_c_const=yes
12528else
12529 ac_cv_c_const=no
12530fi
12531rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12532fi
12533{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
12534$as_echo "$ac_cv_c_const" >&6; }
12535if test $ac_cv_c_const = no; then
12536
12537$as_echo "#define const /**/" >>confdefs.h
12538
12539fi
12540
12541{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
12542$as_echo_n "checking for inline... " >&6; }
12543if test "${ac_cv_c_inline+set}" = set; then :
12544 $as_echo_n "(cached) " >&6
12545else
12546 ac_cv_c_inline=no
12547for ac_kw in inline __inline__ __inline; do
12548 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12549/* end confdefs.h. */
12550#ifndef __cplusplus
12551typedef int foo_t;
12552static $ac_kw foo_t static_foo () {return 0; }
12553$ac_kw foo_t foo () {return 0; }
12554#endif
12555
12556_ACEOF
12557if ac_fn_c_try_compile "$LINENO"; then :
12558 ac_cv_c_inline=$ac_kw
12559fi
12560rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12561 test "$ac_cv_c_inline" != no && break
12562done
12563
12564fi
12565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
12566$as_echo "$ac_cv_c_inline" >&6; }
12567
12568case $ac_cv_c_inline in
12569 inline | yes) ;;
12570 *)
12571 case $ac_cv_c_inline in
12572 no) ac_val=;;
12573 *) ac_val=$ac_cv_c_inline;;
12574 esac
12575 cat >>confdefs.h <<_ACEOF
12576#ifndef __cplusplus
12577#define inline $ac_val
12578#endif
12579_ACEOF
12580 ;;
12581esac
12582
12583 case $ac_cv_prog_cc_stdc in #(
12584 no) :
12585 ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
12586 *) :
12587 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
12588$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
12589if test "${ac_cv_prog_cc_c99+set}" = set; then :
12590 $as_echo_n "(cached) " >&6
12591else
12592 ac_cv_prog_cc_c99=no
12593ac_save_CC=$CC
12594cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12595/* end confdefs.h. */
12596#include <stdarg.h>
12597#include <stdbool.h>
12598#include <stdlib.h>
12599#include <wchar.h>
12600#include <stdio.h>
12601
12602// Check varargs macros. These examples are taken from C99 6.10.3.5.
12603#define debug(...) fprintf (stderr, __VA_ARGS__)
12604#define showlist(...) puts (#__VA_ARGS__)
12605#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
12606static void
12607test_varargs_macros (void)
12608{
12609 int x = 1234;
12610 int y = 5678;
12611 debug ("Flag");
12612 debug ("X = %d\n", x);
12613 showlist (The first, second, and third items.);
12614 report (x>y, "x is %d but y is %d", x, y);
12615}
12616
12617// Check long long types.
12618#define BIG64 18446744073709551615ull
12619#define BIG32 4294967295ul
12620#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
12621#if !BIG_OK
12622 your preprocessor is broken;
12623#endif
12624#if BIG_OK
12625#else
12626 your preprocessor is broken;
12627#endif
12628static long long int bignum = -9223372036854775807LL;
12629static unsigned long long int ubignum = BIG64;
12630
12631struct incomplete_array
12632{
12633 int datasize;
12634 double data[];
12635};
12636
12637struct named_init {
12638 int number;
12639 const wchar_t *name;
12640 double average;
12641};
12642
12643typedef const char *ccp;
12644
12645static inline int
12646test_restrict (ccp restrict text)
12647{
12648 // See if C++-style comments work.
12649 // Iterate through items via the restricted pointer.
12650 // Also check for declarations in for loops.
12651 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
12652 continue;
12653 return 0;
12654}
12655
12656// Check varargs and va_copy.
12657static void
12658test_varargs (const char *format, ...)
12659{
12660 va_list args;
12661 va_start (args, format);
12662 va_list args_copy;
12663 va_copy (args_copy, args);
12664
12665 const char *str;
12666 int number;
12667 float fnumber;
12668
12669 while (*format)
12670 {
12671 switch (*format++)
12672 {
12673 case 's': // string
12674 str = va_arg (args_copy, const char *);
12675 break;
12676 case 'd': // int
12677 number = va_arg (args_copy, int);
12678 break;
12679 case 'f': // float
12680 fnumber = va_arg (args_copy, double);
12681 break;
12682 default:
12683 break;
12684 }
12685 }
12686 va_end (args_copy);
12687 va_end (args);
12688}
12689
12690int
12691main ()
12692{
12693
12694 // Check bool.
12695 _Bool success = false;
12696
12697 // Check restrict.
12698 if (test_restrict ("String literal") == 0)
12699 success = true;
12700 char *restrict newvar = "Another string";
12701
12702 // Check varargs.
12703 test_varargs ("s, d' f .", "string", 65, 34.234);
12704 test_varargs_macros ();
12705
12706 // Check flexible array members.
12707 struct incomplete_array *ia =
12708 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
12709 ia->datasize = 10;
12710 for (int i = 0; i < ia->datasize; ++i)
12711 ia->data[i] = i * 1.234;
12712
12713 // Check named initializers.
12714 struct named_init ni = {
12715 .number = 34,
12716 .name = L"Test wide string",
12717 .average = 543.34343,
12718 };
12719
12720 ni.number = 58;
12721
12722 int dynamic_array[ni.number];
12723 dynamic_array[ni.number - 1] = 543;
12724
12725 // work around unused variable warnings
12726 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
12727 || dynamic_array[ni.number - 1] != 543);
12728
12729 ;
12730 return 0;
12731}
12732_ACEOF
12733for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
12734do
12735 CC="$ac_save_CC $ac_arg"
12736 if ac_fn_c_try_compile "$LINENO"; then :
12737 ac_cv_prog_cc_c99=$ac_arg
12738fi
12739rm -f core conftest.err conftest.$ac_objext
12740 test "x$ac_cv_prog_cc_c99" != "xno" && break
12741done
12742rm -f conftest.$ac_ext
12743CC=$ac_save_CC
12744
12745fi
12746# AC_CACHE_VAL
12747case "x$ac_cv_prog_cc_c99" in
12748 x)
12749 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
12750$as_echo "none needed" >&6; } ;;
12751 xno)
12752 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
12753$as_echo "unsupported" >&6; } ;;
12754 *)
12755 CC="$CC $ac_cv_prog_cc_c99"
12756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
12757$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
12758esac
12759if test "x$ac_cv_prog_cc_c99" != xno; then :
12760 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
12761else
12762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
12763$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
12764if test "${ac_cv_prog_cc_c89+set}" = set; then :
12765 $as_echo_n "(cached) " >&6
12766else
12767 ac_cv_prog_cc_c89=no
12768ac_save_CC=$CC
12769cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12770/* end confdefs.h. */
12771#include <stdarg.h>
12772#include <stdio.h>
12773#include <sys/types.h>
12774#include <sys/stat.h>
12775/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
12776struct buf { int x; };
12777FILE * (*rcsopen) (struct buf *, struct stat *, int);
12778static char *e (p, i)
12779 char **p;
12780 int i;
12781{
12782 return p[i];
12783}
12784static char *f (char * (*g) (char **, int), char **p, ...)
12785{
12786 char *s;
12787 va_list v;
12788 va_start (v,p);
12789 s = g (p, va_arg (v,int));
12790 va_end (v);
12791 return s;
12792}
12793
12794/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
12795 function prototypes and stuff, but not '\xHH' hex character constants.
12796 These don't provoke an error unfortunately, instead are silently treated
12797 as 'x'. The following induces an error, until -std is added to get
12798 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
12799 array size at least. It's necessary to write '\x00'==0 to get something
12800 that's true only with -std. */
12801int osf4_cc_array ['\x00' == 0 ? 1 : -1];
12802
12803/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
12804 inside strings and character constants. */
12805#define FOO(x) 'x'
12806int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
12807
12808int test (int i, double x);
12809struct s1 {int (*f) (int a);};
12810struct s2 {int (*f) (double a);};
12811int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
12812int argc;
12813char **argv;
12814int
12815main ()
12816{
12817return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
12818 ;
12819 return 0;
12820}
12821_ACEOF
12822for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
12823 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
12824do
12825 CC="$ac_save_CC $ac_arg"
12826 if ac_fn_c_try_compile "$LINENO"; then :
12827 ac_cv_prog_cc_c89=$ac_arg
12828fi
12829rm -f core conftest.err conftest.$ac_objext
12830 test "x$ac_cv_prog_cc_c89" != "xno" && break
12831done
12832rm -f conftest.$ac_ext
12833CC=$ac_save_CC
12834
12835fi
12836# AC_CACHE_VAL
12837case "x$ac_cv_prog_cc_c89" in
12838 x)
12839 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
12840$as_echo "none needed" >&6; } ;;
12841 xno)
12842 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
12843$as_echo "unsupported" >&6; } ;;
12844 *)
12845 CC="$CC $ac_cv_prog_cc_c89"
12846 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
12847$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
12848esac
12849if test "x$ac_cv_prog_cc_c89" != xno; then :
12850 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
12851else
12852 ac_cv_prog_cc_stdc=no
12853fi
12854
12855fi
12856 ;;
12857esac
12858 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
12859$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
12860 if test "${ac_cv_prog_cc_stdc+set}" = set; then :
12861 $as_echo_n "(cached) " >&6
12862fi
12863
12864 case $ac_cv_prog_cc_stdc in #(
12865 no) :
12866 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
12867$as_echo "unsupported" >&6; } ;; #(
12868 '') :
12869 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
12870$as_echo "none needed" >&6; } ;; #(
12871 *) :
12872 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
12873$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
12874esac
12875
12876{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
12877$as_echo_n "checking for ANSI C header files... " >&6; }
12878if test "${ac_cv_header_stdc+set}" = set; then :
12879 $as_echo_n "(cached) " >&6
12880else
12881 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12882/* end confdefs.h. */
12883#include <stdlib.h>
12884#include <stdarg.h>
12885#include <string.h>
12886#include <float.h>
12887
12888int
12889main ()
12890{
12891
12892 ;
12893 return 0;
12894}
12895_ACEOF
12896if ac_fn_c_try_compile "$LINENO"; then :
12897 ac_cv_header_stdc=yes
12898else
12899 ac_cv_header_stdc=no
12900fi
12901rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12902
12903if test $ac_cv_header_stdc = yes; then
12904 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12905 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12906/* end confdefs.h. */
12907#include <string.h>
12908
12909_ACEOF
12910if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12911 $EGREP "memchr" >/dev/null 2>&1; then :
12912
12913else
12914 ac_cv_header_stdc=no
12915fi
12916rm -f conftest*
12917
12918fi
12919
12920if test $ac_cv_header_stdc = yes; then
12921 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12922 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12923/* end confdefs.h. */
12924#include <stdlib.h>
12925
12926_ACEOF
12927if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12928 $EGREP "free" >/dev/null 2>&1; then :
12929
12930else
12931 ac_cv_header_stdc=no
12932fi
12933rm -f conftest*
12934
12935fi
12936
12937if test $ac_cv_header_stdc = yes; then
12938 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12939 if test "$cross_compiling" = yes; then :
12940 :
12941else
12942 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12943/* end confdefs.h. */
12944#include <ctype.h>
12945#include <stdlib.h>
12946#if ((' ' & 0x0FF) == 0x020)
12947# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12948# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12949#else
12950# define ISLOWER(c) \
12951 (('a' <= (c) && (c) <= 'i') \
12952 || ('j' <= (c) && (c) <= 'r') \
12953 || ('s' <= (c) && (c) <= 'z'))
12954# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12955#endif
12956
12957#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12958int
12959main ()
12960{
12961 int i;
12962 for (i = 0; i < 256; i++)
12963 if (XOR (islower (i), ISLOWER (i))
12964 || toupper (i) != TOUPPER (i))
12965 return 2;
12966 return 0;
12967}
12968_ACEOF
12969if ac_fn_c_try_run "$LINENO"; then :
12970
12971else
12972 ac_cv_header_stdc=no
12973fi
12974rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12975 conftest.$ac_objext conftest.beam conftest.$ac_ext
12976fi
12977
12978fi
12979fi
12980{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
12981$as_echo "$ac_cv_header_stdc" >&6; }
12982if test $ac_cv_header_stdc = yes; then
12983
12984$as_echo "#define STDC_HEADERS 1" >>confdefs.h
12985
12986fi
12987
12988
12989
12990{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5
12991$as_echo_n "checking for __attribute__... " >&6; }
12992
12993if test "${ac_cv___attribute__+set}" = set; then :
12994 $as_echo_n "(cached) " >&6
12995else
12996 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12997/* end confdefs.h. */
12998
12999#include <stdlib.h>
13000
13001int func(int x);
13002int foo(int x __attribute__ ((unused)))
13003{
13004 exit(1);
13005}
13006
13007int
13008main ()
13009{
13010
13011 ;
13012 return 0;
13013}
13014_ACEOF
13015if ac_fn_c_try_compile "$LINENO"; then :
13016 ac_cv___attribute__="yes"
13017else
13018 ac_cv___attribute__="no"
13019
13020fi
13021rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13022fi
13023
13024
13025{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute__" >&5
13026$as_echo "$ac_cv___attribute__" >&6; }
13027
13028if test "x${ac_cv___attribute__}" = "xyes" ; then
13029
13030$as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
13031
13032
13033$as_echo "#define __UNUSED__ __attribute__((unused))" >>confdefs.h
13034
13035 else
13036
13037$as_echo "#define __UNUSED__ /**/" >>confdefs.h
13038
13039fi
13040
13041
13042
13043EMBRYO_CPPFLAGS=""
13044EMBRYO_CFLAGS=""
13045case "$host_os" in
13046 mingw32ce*)
13047 EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420"
13048 ;;
13049esac
13050
13051
13052
13053
13054### Checks for linker characteristics
13055
13056lt_enable_auto_import=""
13057case "$host_os" in
13058 mingw*)
13059 lt_enable_auto_import="-Wl,--enable-auto-import"
13060 ;;
13061esac
13062
13063
13064
13065### Checks for library functions
13066
13067{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
13068$as_echo_n "checking for library containing strerror... " >&6; }
13069if test "${ac_cv_search_strerror+set}" = set; then :
13070 $as_echo_n "(cached) " >&6
13071else
13072 ac_func_search_save_LIBS=$LIBS
13073cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13074/* end confdefs.h. */
13075
13076/* Override any GCC internal prototype to avoid an error.
13077 Use char because int might match the return type of a GCC
13078 builtin and then its argument prototype would still apply. */
13079#ifdef __cplusplus
13080extern "C"
13081#endif
13082char strerror ();
13083int
13084main ()
13085{
13086return strerror ();
13087 ;
13088 return 0;
13089}
13090_ACEOF
13091for ac_lib in '' cposix; do
13092 if test -z "$ac_lib"; then
13093 ac_res="none required"
13094 else
13095 ac_res=-l$ac_lib
13096 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
13097 fi
13098 if ac_fn_c_try_link "$LINENO"; then :
13099 ac_cv_search_strerror=$ac_res
13100fi
13101rm -f core conftest.err conftest.$ac_objext \
13102 conftest$ac_exeext
13103 if test "${ac_cv_search_strerror+set}" = set; then :
13104 break
13105fi
13106done
13107if test "${ac_cv_search_strerror+set}" = set; then :
13108
13109else
13110 ac_cv_search_strerror=no
13111fi
13112rm conftest.$ac_ext
13113LIBS=$ac_func_search_save_LIBS
13114fi
13115{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
13116$as_echo "$ac_cv_search_strerror" >&6; }
13117ac_res=$ac_cv_search_strerror
13118if test "$ac_res" != no; then :
13119 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
13120
13121fi
13122
13123
13124# alloca
13125# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
13126# for constant arguments. Useless!
13127{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
13128$as_echo_n "checking for working alloca.h... " >&6; }
13129if test "${ac_cv_working_alloca_h+set}" = set; then :
13130 $as_echo_n "(cached) " >&6
13131else
13132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13133/* end confdefs.h. */
13134#include <alloca.h>
13135int
13136main ()
13137{
13138char *p = (char *) alloca (2 * sizeof (int));
13139 if (p) return 0;
13140 ;
13141 return 0;
13142}
13143_ACEOF
13144if ac_fn_c_try_link "$LINENO"; then :
13145 ac_cv_working_alloca_h=yes
13146else
13147 ac_cv_working_alloca_h=no
13148fi
13149rm -f core conftest.err conftest.$ac_objext \
13150 conftest$ac_exeext conftest.$ac_ext
13151fi
13152{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
13153$as_echo "$ac_cv_working_alloca_h" >&6; }
13154if test $ac_cv_working_alloca_h = yes; then
13155
13156$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
13157
13158fi
13159
13160{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
13161$as_echo_n "checking for alloca... " >&6; }
13162if test "${ac_cv_func_alloca_works+set}" = set; then :
13163 $as_echo_n "(cached) " >&6
13164else
13165 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13166/* end confdefs.h. */
13167#ifdef __GNUC__
13168# define alloca __builtin_alloca
13169#else
13170# ifdef _MSC_VER
13171# include <malloc.h>
13172# define alloca _alloca
13173# else
13174# ifdef HAVE_ALLOCA_H
13175# include <alloca.h>
13176# else
13177# ifdef _AIX
13178 #pragma alloca
13179# else
13180# ifndef alloca /* predefined by HP cc +Olibcalls */
13181char *alloca ();
13182# endif
13183# endif
13184# endif
13185# endif
13186#endif
13187
13188int
13189main ()
13190{
13191char *p = (char *) alloca (1);
13192 if (p) return 0;
13193 ;
13194 return 0;
13195}
13196_ACEOF
13197if ac_fn_c_try_link "$LINENO"; then :
13198 ac_cv_func_alloca_works=yes
13199else
13200 ac_cv_func_alloca_works=no
13201fi
13202rm -f core conftest.err conftest.$ac_objext \
13203 conftest$ac_exeext conftest.$ac_ext
13204fi
13205{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
13206$as_echo "$ac_cv_func_alloca_works" >&6; }
13207
13208if test $ac_cv_func_alloca_works = yes; then
13209
13210$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
13211
13212else
13213 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
13214# that cause trouble. Some versions do not even contain alloca or
13215# contain a buggy version. If you still want to use their alloca,
13216# use ar to extract alloca.o from them instead of compiling alloca.c.
13217
13218ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
13219
13220$as_echo "#define C_ALLOCA 1" >>confdefs.h
13221
13222
13223{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
13224$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
13225if test "${ac_cv_os_cray+set}" = set; then :
13226 $as_echo_n "(cached) " >&6
13227else
13228 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13229/* end confdefs.h. */
13230#if defined CRAY && ! defined CRAY2
13231webecray
13232#else
13233wenotbecray
13234#endif
13235
13236_ACEOF
13237if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13238 $EGREP "webecray" >/dev/null 2>&1; then :
13239 ac_cv_os_cray=yes
13240else
13241 ac_cv_os_cray=no
13242fi
13243rm -f conftest*
13244
13245fi
13246{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
13247$as_echo "$ac_cv_os_cray" >&6; }
13248if test $ac_cv_os_cray = yes; then
13249 for ac_func in _getb67 GETB67 getb67; do
13250 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13251ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13252if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13253
13254cat >>confdefs.h <<_ACEOF
13255#define CRAY_STACKSEG_END $ac_func
13256_ACEOF
13257
13258 break
13259fi
13260
13261 done
13262fi
13263
13264{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
13265$as_echo_n "checking stack direction for C alloca... " >&6; }
13266if test "${ac_cv_c_stack_direction+set}" = set; then :
13267 $as_echo_n "(cached) " >&6
13268else
13269 if test "$cross_compiling" = yes; then :
13270 ac_cv_c_stack_direction=0
13271else
13272 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13273/* end confdefs.h. */
13274$ac_includes_default
13275int
13276find_stack_direction ()
13277{
13278 static char *addr = 0;
13279 auto char dummy;
13280 if (addr == 0)
13281 {
13282 addr = &dummy;
13283 return find_stack_direction ();
13284 }
13285 else
13286 return (&dummy > addr) ? 1 : -1;
13287}
13288
13289int
13290main ()
13291{
13292 return find_stack_direction () < 0;
13293}
13294_ACEOF
13295if ac_fn_c_try_run "$LINENO"; then :
13296 ac_cv_c_stack_direction=1
13297else
13298 ac_cv_c_stack_direction=-1
13299fi
13300rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13301 conftest.$ac_objext conftest.beam conftest.$ac_ext
13302fi
13303
13304fi
13305{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
13306$as_echo "$ac_cv_c_stack_direction" >&6; }
13307cat >>confdefs.h <<_ACEOF
13308#define STACK_DIRECTION $ac_cv_c_stack_direction
13309_ACEOF
13310
13311
13312fi
13313
13314
13315# fnmatch
13316
13317
13318ac_fn_c_check_header_mongrel "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default"
13319if test "x$ac_cv_header_fnmatch_h" = x""yes; then :
13320 _efl_have_fnmatch="yes"
13321else
13322 _efl_have_fnmatch="no"
13323fi
13324
13325
13326
13327if test "x${_efl_have_fnmatch}" = "xyes" ; then
13328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fnmatch" >&5
13329$as_echo_n "checking for library containing fnmatch... " >&6; }
13330if test "${ac_cv_search_fnmatch+set}" = set; then :
13331 $as_echo_n "(cached) " >&6
13332else
13333 ac_func_search_save_LIBS=$LIBS
13334cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13335/* end confdefs.h. */
13336
13337/* Override any GCC internal prototype to avoid an error.
13338 Use char because int might match the return type of a GCC
13339 builtin and then its argument prototype would still apply. */
13340#ifdef __cplusplus
13341extern "C"
13342#endif
13343char fnmatch ();
13344int
13345main ()
13346{
13347return fnmatch ();
13348 ;
13349 return 0;
13350}
13351_ACEOF
13352for ac_lib in '' fnmatch evil iberty; do
13353 if test -z "$ac_lib"; then
13354 ac_res="none required"
13355 else
13356 ac_res=-l$ac_lib
13357 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
13358 fi
13359 if ac_fn_c_try_link "$LINENO"; then :
13360 ac_cv_search_fnmatch=$ac_res
13361fi
13362rm -f core conftest.err conftest.$ac_objext \
13363 conftest$ac_exeext
13364 if test "${ac_cv_search_fnmatch+set}" = set; then :
13365 break
13366fi
13367done
13368if test "${ac_cv_search_fnmatch+set}" = set; then :
13369
13370else
13371 ac_cv_search_fnmatch=no
13372fi
13373rm conftest.$ac_ext
13374LIBS=$ac_func_search_save_LIBS
13375fi
13376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fnmatch" >&5
13377$as_echo "$ac_cv_search_fnmatch" >&6; }
13378ac_res=$ac_cv_search_fnmatch
13379if test "$ac_res" != no; then :
13380 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
13381 _efl_have_fnmatch="yes"
13382else
13383 _efl_have_fnmatch="no"
13384fi
13385
13386fi
13387
13388EFL_FNMATCH_LIBS=""
13389
13390if (! test "x${ac_cv_search_fnmatch}" = "xnone required") && (! test "x${ac_cv_search_fnmatch}" = "xno") && (! test "x${ac_cv_search_fnmatch}" = "x-levil") ; then
13391 EFL_FNMATCH_LIBS=${ac_cv_search_fnmatch}
13392fi
13393
13394
13395
13396if test "x$_efl_have_fnmatch" = "xyes"; then :
13397
13398else
13399 as_fn_error $? "Cannot find fnmatch()" "$LINENO" 5
13400fi
13401
13402
13403
13404case "$host_os" in
13405 mingw*)
13406
13407$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
13408
13409 ;;
13410 *)
13411 for ac_func in gettimeofday
13412do :
13413 ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
13414if test "x$ac_cv_func_gettimeofday" = x""yes; then :
13415 cat >>confdefs.h <<_ACEOF
13416#define HAVE_GETTIMEOFDAY 1
13417_ACEOF
13418
13419fi
13420done
13421
13422 ;;
13423esac
13424
13425
13426
13427
13428
13429ac_config_files="$ac_config_files Makefile doc/Makefile doc/Doxyfile doc/embryo.dox embryo.pc include/Makefile src/Makefile src/lib/Makefile src/bin/Makefile embryo.spec"
13430
13431cat >confcache <<\_ACEOF
13432# This file is a shell script that caches the results of configure
13433# tests run on this system so they can be shared between configure
13434# scripts and configure runs, see configure's option --config-cache.
13435# It is not useful on other systems. If it contains results you don't
13436# want to keep, you may remove or edit it.
13437#
13438# config.status only pays attention to the cache file if you give it
13439# the --recheck option to rerun configure.
13440#
13441# `ac_cv_env_foo' variables (set or unset) will be overridden when
13442# loading this file, other *unset* `ac_cv_foo' will be assigned the
13443# following values.
13444
13445_ACEOF
13446
13447# The following way of writing the cache mishandles newlines in values,
13448# but we know of no workaround that is simple, portable, and efficient.
13449# So, we kill variables containing newlines.
13450# Ultrix sh set writes to stderr and can't be redirected directly,
13451# and sets the high bit in the cache file unless we assign to the vars.
13452(
13453 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
13454 eval ac_val=\$$ac_var
13455 case $ac_val in #(
13456 *${as_nl}*)
13457 case $ac_var in #(
13458 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
13459$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
13460 esac
13461 case $ac_var in #(
13462 _ | IFS | as_nl) ;; #(
13463 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
13464 *) { eval $ac_var=; unset $ac_var;} ;;
13465 esac ;;
13466 esac
13467 done
13468
13469 (set) 2>&1 |
13470 case $as_nl`(ac_space=' '; set) 2>&1` in #(
13471 *${as_nl}ac_space=\ *)
13472 # `set' does not quote correctly, so add quotes: double-quote
13473 # substitution turns \\\\ into \\, and sed turns \\ into \.
13474 sed -n \
13475 "s/'/'\\\\''/g;
13476 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13477 ;; #(
13478 *)
13479 # `set' quotes correctly as required by POSIX, so do not add quotes.
13480 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
13481 ;;
13482 esac |
13483 sort
13484) |
13485 sed '
13486 /^ac_cv_env_/b end
13487 t clear
13488 :clear
13489 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13490 t end
13491 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13492 :end' >>confcache
13493if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
13494 if test -w "$cache_file"; then
13495 test "x$cache_file" != "x/dev/null" &&
13496 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
13497$as_echo "$as_me: updating cache $cache_file" >&6;}
13498 cat confcache >$cache_file
13499 else
13500 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
13501$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
13502 fi
13503fi
13504rm -f confcache
13505
13506test "x$prefix" = xNONE && prefix=$ac_default_prefix
13507# Let make expand exec_prefix.
13508test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13509
13510DEFS=-DHAVE_CONFIG_H
13511
13512ac_libobjs=
13513ac_ltlibobjs=
13514U=
13515for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
13516 # 1. Remove the extension, and $U if already installed.
13517 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
13518 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
13519 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
13520 # will be set to the directory where LIBOBJS objects are built.
13521 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
13522 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
13523done
13524LIBOBJS=$ac_libobjs
13525
13526LTLIBOBJS=$ac_ltlibobjs
13527
13528
13529 if test -n "$EXEEXT"; then
13530 am__EXEEXT_TRUE=
13531 am__EXEEXT_FALSE='#'
13532else
13533 am__EXEEXT_TRUE='#'
13534 am__EXEEXT_FALSE=
13535fi
13536
13537if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
13538 as_fn_error $? "conditional \"AMDEP\" was never defined.
13539Usually this means the macro was only invoked conditionally." "$LINENO" 5
13540fi
13541if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
13542 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
13543Usually this means the macro was only invoked conditionally." "$LINENO" 5
13544fi
13545if test -z "${BUILD_EMBRYO_CC_TRUE}" && test -z "${BUILD_EMBRYO_CC_FALSE}"; then
13546 as_fn_error $? "conditional \"BUILD_EMBRYO_CC\" was never defined.
13547Usually this means the macro was only invoked conditionally." "$LINENO" 5
13548fi
13549if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
13550 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
13551Usually this means the macro was only invoked conditionally." "$LINENO" 5
13552fi
13553if test -z "${EFL_BUILD_DOC_TRUE}" && test -z "${EFL_BUILD_DOC_FALSE}"; then
13554 as_fn_error $? "conditional \"EFL_BUILD_DOC\" was never defined.
13555Usually this means the macro was only invoked conditionally." "$LINENO" 5
13556fi
13557
13558
13559: ${CONFIG_STATUS=./config.status}
13560ac_write_fail=0
13561ac_clean_files_save=$ac_clean_files
13562ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13563{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
13564$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
13565as_write_fail=0
13566cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
13567#! $SHELL
13568# Generated by $as_me.
13569# Run this file to recreate the current configuration.
13570# Compiler output produced by configure, useful for debugging
13571# configure, is in config.log if it exists.
13572
13573debug=false
13574ac_cs_recheck=false
13575ac_cs_silent=false
13576
13577SHELL=\${CONFIG_SHELL-$SHELL}
13578export SHELL
13579_ASEOF
13580cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
13581## -------------------- ##
13582## M4sh Initialization. ##
13583## -------------------- ##
13584
13585# Be more Bourne compatible
13586DUALCASE=1; export DUALCASE # for MKS sh
13587if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
13588 emulate sh
13589 NULLCMD=:
13590 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
13591 # is contrary to our usage. Disable this feature.
13592 alias -g '${1+"$@"}'='"$@"'
13593 setopt NO_GLOB_SUBST
13594else
13595 case `(set -o) 2>/dev/null` in #(
13596 *posix*) :
13597 set -o posix ;; #(
13598 *) :
13599 ;;
13600esac
13601fi
13602
13603
13604as_nl='
13605'
13606export as_nl
13607# Printing a long string crashes Solaris 7 /usr/bin/printf.
13608as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
13609as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
13610as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
13611# Prefer a ksh shell builtin over an external printf program on Solaris,
13612# but without wasting forks for bash or zsh.
13613if test -z "$BASH_VERSION$ZSH_VERSION" \
13614 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
13615 as_echo='print -r --'
13616 as_echo_n='print -rn --'
13617elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
13618 as_echo='printf %s\n'
13619 as_echo_n='printf %s'
13620else
13621 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
13622 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
13623 as_echo_n='/usr/ucb/echo -n'
13624 else
13625 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
13626 as_echo_n_body='eval
13627 arg=$1;
13628 case $arg in #(
13629 *"$as_nl"*)
13630 expr "X$arg" : "X\\(.*\\)$as_nl";
13631 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
13632 esac;
13633 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
13634 '
13635 export as_echo_n_body
13636 as_echo_n='sh -c $as_echo_n_body as_echo'
13637 fi
13638 export as_echo_body
13639 as_echo='sh -c $as_echo_body as_echo'
13640fi
13641
13642# The user is always right.
13643if test "${PATH_SEPARATOR+set}" != set; then
13644 PATH_SEPARATOR=:
13645 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
13646 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
13647 PATH_SEPARATOR=';'
13648 }
13649fi
13650
13651
13652# IFS
13653# We need space, tab and new line, in precisely that order. Quoting is
13654# there to prevent editors from complaining about space-tab.
13655# (If _AS_PATH_WALK were called with IFS unset, it would disable word
13656# splitting by setting IFS to empty value.)
13657IFS=" "" $as_nl"
13658
13659# Find who we are. Look in the path if we contain no directory separator.
13660case $0 in #((
13661 *[\\/]* ) as_myself=$0 ;;
13662 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13663for as_dir in $PATH
13664do
13665 IFS=$as_save_IFS
13666 test -z "$as_dir" && as_dir=.
13667 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
13668 done
13669IFS=$as_save_IFS
13670
13671 ;;
13672esac
13673# We did not find ourselves, most probably we were run as `sh COMMAND'
13674# in which case we are not to be found in the path.
13675if test "x$as_myself" = x; then
13676 as_myself=$0
13677fi
13678if test ! -f "$as_myself"; then
13679 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
13680 exit 1
13681fi
13682
13683# Unset variables that we do not need and which cause bugs (e.g. in
13684# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
13685# suppresses any "Segmentation fault" message there. '((' could
13686# trigger a bug in pdksh 5.2.14.
13687for as_var in BASH_ENV ENV MAIL MAILPATH
13688do eval test x\${$as_var+set} = xset \
13689 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
13690done
13691PS1='$ '
13692PS2='> '
13693PS4='+ '
13694
13695# NLS nuisances.
13696LC_ALL=C
13697export LC_ALL
13698LANGUAGE=C
13699export LANGUAGE
13700
13701# CDPATH.
13702(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
13703
13704
13705# as_fn_error STATUS ERROR [LINENO LOG_FD]
13706# ----------------------------------------
13707# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
13708# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
13709# script with STATUS, using 1 if that was 0.
13710as_fn_error ()
13711{
13712 as_status=$1; test $as_status -eq 0 && as_status=1
13713 if test "$4"; then
13714 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
13715 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
13716 fi
13717 $as_echo "$as_me: error: $2" >&2
13718 as_fn_exit $as_status
13719} # as_fn_error
13720
13721
13722# as_fn_set_status STATUS
13723# -----------------------
13724# Set $? to STATUS, without forking.
13725as_fn_set_status ()
13726{
13727 return $1
13728} # as_fn_set_status
13729
13730# as_fn_exit STATUS
13731# -----------------
13732# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
13733as_fn_exit ()
13734{
13735 set +e
13736 as_fn_set_status $1
13737 exit $1
13738} # as_fn_exit
13739
13740# as_fn_unset VAR
13741# ---------------
13742# Portably unset VAR.
13743as_fn_unset ()
13744{
13745 { eval $1=; unset $1;}
13746}
13747as_unset=as_fn_unset
13748# as_fn_append VAR VALUE
13749# ----------------------
13750# Append the text in VALUE to the end of the definition contained in VAR. Take
13751# advantage of any shell optimizations that allow amortized linear growth over
13752# repeated appends, instead of the typical quadratic growth present in naive
13753# implementations.
13754if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
13755 eval 'as_fn_append ()
13756 {
13757 eval $1+=\$2
13758 }'
13759else
13760 as_fn_append ()
13761 {
13762 eval $1=\$$1\$2
13763 }
13764fi # as_fn_append
13765
13766# as_fn_arith ARG...
13767# ------------------
13768# Perform arithmetic evaluation on the ARGs, and store the result in the
13769# global $as_val. Take advantage of shells that can avoid forks. The arguments
13770# must be portable across $(()) and expr.
13771if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
13772 eval 'as_fn_arith ()
13773 {
13774 as_val=$(( $* ))
13775 }'
13776else
13777 as_fn_arith ()
13778 {
13779 as_val=`expr "$@" || test $? -eq 1`
13780 }
13781fi # as_fn_arith
13782
13783
13784if expr a : '\(a\)' >/dev/null 2>&1 &&
13785 test "X`expr 00001 : '.*\(...\)'`" = X001; then
13786 as_expr=expr
13787else
13788 as_expr=false
13789fi
13790
13791if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
13792 as_basename=basename
13793else
13794 as_basename=false
13795fi
13796
13797if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
13798 as_dirname=dirname
13799else
13800 as_dirname=false
13801fi
13802
13803as_me=`$as_basename -- "$0" ||
13804$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
13805 X"$0" : 'X\(//\)$' \| \
13806 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
13807$as_echo X/"$0" |
13808 sed '/^.*\/\([^/][^/]*\)\/*$/{
13809 s//\1/
13810 q
13811 }
13812 /^X\/\(\/\/\)$/{
13813 s//\1/
13814 q
13815 }
13816 /^X\/\(\/\).*/{
13817 s//\1/
13818 q
13819 }
13820 s/.*/./; q'`
13821
13822# Avoid depending upon Character Ranges.
13823as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13824as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13825as_cr_Letters=$as_cr_letters$as_cr_LETTERS
13826as_cr_digits='0123456789'
13827as_cr_alnum=$as_cr_Letters$as_cr_digits
13828
13829ECHO_C= ECHO_N= ECHO_T=
13830case `echo -n x` in #(((((
13831-n*)
13832 case `echo 'xy\c'` in
13833 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
13834 xy) ECHO_C='\c';;
13835 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
13836 ECHO_T=' ';;
13837 esac;;
13838*)
13839 ECHO_N='-n';;
13840esac
13841
13842rm -f conf$$ conf$$.exe conf$$.file
13843if test -d conf$$.dir; then
13844 rm -f conf$$.dir/conf$$.file
13845else
13846 rm -f conf$$.dir
13847 mkdir conf$$.dir 2>/dev/null
13848fi
13849if (echo >conf$$.file) 2>/dev/null; then
13850 if ln -s conf$$.file conf$$ 2>/dev/null; then
13851 as_ln_s='ln -s'
13852 # ... but there are two gotchas:
13853 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
13854 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
13855 # In both cases, we have to default to `cp -p'.
13856 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
13857 as_ln_s='cp -p'
13858 elif ln conf$$.file conf$$ 2>/dev/null; then
13859 as_ln_s=ln
13860 else
13861 as_ln_s='cp -p'
13862 fi
13863else
13864 as_ln_s='cp -p'
13865fi
13866rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
13867rmdir conf$$.dir 2>/dev/null
13868
13869
13870# as_fn_mkdir_p
13871# -------------
13872# Create "$as_dir" as a directory, including parents if necessary.
13873as_fn_mkdir_p ()
13874{
13875
13876 case $as_dir in #(
13877 -*) as_dir=./$as_dir;;
13878 esac
13879 test -d "$as_dir" || eval $as_mkdir_p || {
13880 as_dirs=
13881 while :; do
13882 case $as_dir in #(
13883 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
13884 *) as_qdir=$as_dir;;
13885 esac
13886 as_dirs="'$as_qdir' $as_dirs"
13887 as_dir=`$as_dirname -- "$as_dir" ||
13888$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13889 X"$as_dir" : 'X\(//\)[^/]' \| \
13890 X"$as_dir" : 'X\(//\)$' \| \
13891 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
13892$as_echo X"$as_dir" |
13893 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13894 s//\1/
13895 q
13896 }
13897 /^X\(\/\/\)[^/].*/{
13898 s//\1/
13899 q
13900 }
13901 /^X\(\/\/\)$/{
13902 s//\1/
13903 q
13904 }
13905 /^X\(\/\).*/{
13906 s//\1/
13907 q
13908 }
13909 s/.*/./; q'`
13910 test -d "$as_dir" && break
13911 done
13912 test -z "$as_dirs" || eval "mkdir $as_dirs"
13913 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
13914
13915
13916} # as_fn_mkdir_p
13917if mkdir -p . 2>/dev/null; then
13918 as_mkdir_p='mkdir -p "$as_dir"'
13919else
13920 test -d ./-p && rmdir ./-p
13921 as_mkdir_p=false
13922fi
13923
13924if test -x / >/dev/null 2>&1; then
13925 as_test_x='test -x'
13926else
13927 if ls -dL / >/dev/null 2>&1; then
13928 as_ls_L_option=L
13929 else
13930 as_ls_L_option=
13931 fi
13932 as_test_x='
13933 eval sh -c '\''
13934 if test -d "$1"; then
13935 test -d "$1/.";
13936 else
13937 case $1 in #(
13938 -*)set "./$1";;
13939 esac;
13940 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
13941 ???[sx]*):;;*)false;;esac;fi
13942 '\'' sh
13943 '
13944fi
13945as_executable_p=$as_test_x
13946
13947# Sed expression to map a string onto a valid CPP name.
13948as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
13949
13950# Sed expression to map a string onto a valid variable name.
13951as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
13952
13953
13954exec 6>&1
13955## ----------------------------------- ##
13956## Main body of $CONFIG_STATUS script. ##
13957## ----------------------------------- ##
13958_ASEOF
13959test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
13960
13961cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13962# Save the log message, to keep $0 and so on meaningful, and to
13963# report actual input values of CONFIG_FILES etc. instead of their
13964# values after options handling.
13965ac_log="
13966This file was extended by embryo $as_me 1.1.0, which was
13967generated by GNU Autoconf 2.67. Invocation command line was
13968
13969 CONFIG_FILES = $CONFIG_FILES
13970 CONFIG_HEADERS = $CONFIG_HEADERS
13971 CONFIG_LINKS = $CONFIG_LINKS
13972 CONFIG_COMMANDS = $CONFIG_COMMANDS
13973 $ $0 $@
13974
13975on `(hostname || uname -n) 2>/dev/null | sed 1q`
13976"
13977
13978_ACEOF
13979
13980case $ac_config_files in *"
13981"*) set x $ac_config_files; shift; ac_config_files=$*;;
13982esac
13983
13984case $ac_config_headers in *"
13985"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
13986esac
13987
13988
13989cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13990# Files that config.status was made for.
13991config_files="$ac_config_files"
13992config_headers="$ac_config_headers"
13993config_commands="$ac_config_commands"
13994
13995_ACEOF
13996
13997cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13998ac_cs_usage="\
13999\`$as_me' instantiates files and other configuration actions
14000from templates according to the current configuration. Unless the files
14001and actions are specified as TAGs, all are instantiated by default.
14002
14003Usage: $0 [OPTION]... [TAG]...
14004
14005 -h, --help print this help, then exit
14006 -V, --version print version number and configuration settings, then exit
14007 --config print configuration, then exit
14008 -q, --quiet, --silent
14009 do not print progress messages
14010 -d, --debug don't remove temporary files
14011 --recheck update $as_me by reconfiguring in the same conditions
14012 --file=FILE[:TEMPLATE]
14013 instantiate the configuration file FILE
14014 --header=FILE[:TEMPLATE]
14015 instantiate the configuration header FILE
14016
14017Configuration files:
14018$config_files
14019
14020Configuration headers:
14021$config_headers
14022
14023Configuration commands:
14024$config_commands
14025
14026Report bugs to <enlightenment-devel@lists.sourceforge.net>."
14027
14028_ACEOF
14029cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14030ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
14031ac_cs_version="\\
14032embryo config.status 1.1.0
14033configured by $0, generated by GNU Autoconf 2.67,
14034 with options \\"\$ac_cs_config\\"
14035
14036Copyright (C) 2010 Free Software Foundation, Inc.
14037This config.status script is free software; the Free Software Foundation
14038gives unlimited permission to copy, distribute and modify it."
14039
14040ac_pwd='$ac_pwd'
14041srcdir='$srcdir'
14042INSTALL='$INSTALL'
14043MKDIR_P='$MKDIR_P'
14044AWK='$AWK'
14045test -n "\$AWK" || AWK=awk
14046_ACEOF
14047
14048cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14049# The default lists apply if the user does not specify any file.
14050ac_need_defaults=:
14051while test $# != 0
14052do
14053 case $1 in
14054 --*=?*)
14055 ac_option=`expr "X$1" : 'X\([^=]*\)='`
14056 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
14057 ac_shift=:
14058 ;;
14059 --*=)
14060 ac_option=`expr "X$1" : 'X\([^=]*\)='`
14061 ac_optarg=
14062 ac_shift=:
14063 ;;
14064 *)
14065 ac_option=$1
14066 ac_optarg=$2
14067 ac_shift=shift
14068 ;;
14069 esac
14070
14071 case $ac_option in
14072 # Handling of the options.
14073 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14074 ac_cs_recheck=: ;;
14075 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
14076 $as_echo "$ac_cs_version"; exit ;;
14077 --config | --confi | --conf | --con | --co | --c )
14078 $as_echo "$ac_cs_config"; exit ;;
14079 --debug | --debu | --deb | --de | --d | -d )
14080 debug=: ;;
14081 --file | --fil | --fi | --f )
14082 $ac_shift
14083 case $ac_optarg in
14084 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
14085 '') as_fn_error $? "missing file argument" ;;
14086 esac
14087 as_fn_append CONFIG_FILES " '$ac_optarg'"
14088 ac_need_defaults=false;;
14089 --header | --heade | --head | --hea )
14090 $ac_shift
14091 case $ac_optarg in
14092 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
14093 esac
14094 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
14095 ac_need_defaults=false;;
14096 --he | --h)
14097 # Conflict between --help and --header
14098 as_fn_error $? "ambiguous option: \`$1'
14099Try \`$0 --help' for more information.";;
14100 --help | --hel | -h )
14101 $as_echo "$ac_cs_usage"; exit ;;
14102 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
14103 | -silent | --silent | --silen | --sile | --sil | --si | --s)
14104 ac_cs_silent=: ;;
14105
14106 # This is an error.
14107 -*) as_fn_error $? "unrecognized option: \`$1'
14108Try \`$0 --help' for more information." ;;
14109
14110 *) as_fn_append ac_config_targets " $1"
14111 ac_need_defaults=false ;;
14112
14113 esac
14114 shift
14115done
14116
14117ac_configure_extra_args=
14118
14119if $ac_cs_silent; then
14120 exec 6>/dev/null
14121 ac_configure_extra_args="$ac_configure_extra_args --silent"
14122fi
14123
14124_ACEOF
14125cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14126if \$ac_cs_recheck; then
14127 set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
14128 shift
14129 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
14130 CONFIG_SHELL='$SHELL'
14131 export CONFIG_SHELL
14132 exec "\$@"
14133fi
14134
14135_ACEOF
14136cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14137exec 5>>config.log
14138{
14139 echo
14140 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
14141## Running $as_me. ##
14142_ASBOX
14143 $as_echo "$ac_log"
14144} >&5
14145
14146_ACEOF
14147cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14148#
14149# INIT-COMMANDS
14150#
14151AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
14152
14153
14154# The HP-UX ksh and POSIX shell print the target directory to stdout
14155# if CDPATH is set.
14156(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
14157
14158sed_quote_subst='$sed_quote_subst'
14159double_quote_subst='$double_quote_subst'
14160delay_variable_subst='$delay_variable_subst'
14161AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`'
14162DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`'
14163OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
14164macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
14165macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
14166enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
14167enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
14168pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
14169enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
14170host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
14171host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
14172host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
14173build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
14174build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
14175build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
14176SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
14177Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
14178GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
14179EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
14180FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
14181LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
14182NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
14183LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
14184max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
14185ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
14186exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
14187lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
14188lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
14189lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
14190reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
14191reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14192deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
14193file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
14194AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
14195AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
14196STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
14197RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
14198old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14199old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14200old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14201CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
14202CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
14203compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
14204GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
14205lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
14206lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
14207lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
14208lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
14209objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
14210SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
14211ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
14212MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
14213lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
14214lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
14215lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
14216lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
14217lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
14218need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
14219DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
14220NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
14221LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
14222OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
14223OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
14224libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
14225shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14226extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14227archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
14228enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
14229export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
14230whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
14231compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
14232old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14233old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14234archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14235archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14236module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14237module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14238with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
14239allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
14240no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
14241hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
14242hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
14243hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
14244hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
14245hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
14246hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
14247hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
14248hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
14249inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
14250link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
14251fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
14252always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
14253export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14254exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
14255include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
14256prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14257file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
14258variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
14259need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
14260need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
14261version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
14262runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
14263shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
14264shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
14265libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
14266library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
14267soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
14268postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14269postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14270finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
14271finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
14272hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
14273sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
14274sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
14275hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
14276enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
14277enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
14278enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
14279old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
14280striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
14281
14282LTCC='$LTCC'
14283LTCFLAGS='$LTCFLAGS'
14284compiler='$compiler_DEFAULT'
14285
14286# Quote evaled strings.
14287for var in SED \
14288GREP \
14289EGREP \
14290FGREP \
14291LD \
14292NM \
14293LN_S \
14294lt_SP2NL \
14295lt_NL2SP \
14296reload_flag \
14297deplibs_check_method \
14298file_magic_cmd \
14299AR \
14300AR_FLAGS \
14301STRIP \
14302RANLIB \
14303CC \
14304CFLAGS \
14305compiler \
14306lt_cv_sys_global_symbol_pipe \
14307lt_cv_sys_global_symbol_to_cdecl \
14308lt_cv_sys_global_symbol_to_c_name_address \
14309lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
14310SHELL \
14311ECHO \
14312lt_prog_compiler_no_builtin_flag \
14313lt_prog_compiler_wl \
14314lt_prog_compiler_pic \
14315lt_prog_compiler_static \
14316lt_cv_prog_compiler_c_o \
14317need_locks \
14318DSYMUTIL \
14319NMEDIT \
14320LIPO \
14321OTOOL \
14322OTOOL64 \
14323shrext_cmds \
14324export_dynamic_flag_spec \
14325whole_archive_flag_spec \
14326compiler_needs_object \
14327with_gnu_ld \
14328allow_undefined_flag \
14329no_undefined_flag \
14330hardcode_libdir_flag_spec \
14331hardcode_libdir_flag_spec_ld \
14332hardcode_libdir_separator \
14333fix_srcfile_path \
14334exclude_expsyms \
14335include_expsyms \
14336file_list_spec \
14337variables_saved_for_relink \
14338libname_spec \
14339library_names_spec \
14340soname_spec \
14341finish_eval \
14342old_striplib \
14343striplib; do
14344 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
14345 *[\\\\\\\`\\"\\\$]*)
14346 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
14347 ;;
14348 *)
14349 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
14350 ;;
14351 esac
14352done
14353
14354# Double-quote double-evaled strings.
14355for var in reload_cmds \
14356old_postinstall_cmds \
14357old_postuninstall_cmds \
14358old_archive_cmds \
14359extract_expsyms_cmds \
14360old_archive_from_new_cmds \
14361old_archive_from_expsyms_cmds \
14362archive_cmds \
14363archive_expsym_cmds \
14364module_cmds \
14365module_expsym_cmds \
14366export_symbols_cmds \
14367prelink_cmds \
14368postinstall_cmds \
14369postuninstall_cmds \
14370finish_cmds \
14371sys_lib_search_path_spec \
14372sys_lib_dlsearch_path_spec; do
14373 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
14374 *[\\\\\\\`\\"\\\$]*)
14375 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
14376 ;;
14377 *)
14378 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
14379 ;;
14380 esac
14381done
14382
14383# Fix-up fallback echo if it was mangled by the above quoting rules.
14384case \$lt_ECHO in
14385*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
14386 ;;
14387esac
14388
14389ac_aux_dir='$ac_aux_dir'
14390xsi_shell='$xsi_shell'
14391lt_shell_append='$lt_shell_append'
14392
14393# See if we are running on zsh, and set the options which allow our
14394# commands through without removal of \ escapes INIT.
14395if test -n "\${ZSH_VERSION+set}" ; then
14396 setopt NO_GLOB_SUBST
14397fi
14398
14399
14400 PACKAGE='$PACKAGE'
14401 VERSION='$VERSION'
14402 TIMESTAMP='$TIMESTAMP'
14403 RM='$RM'
14404 ofile='$ofile'
14405
14406
14407
14408
14409_ACEOF
14410
14411cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14412
14413# Handling of arguments.
14414for ac_config_target in $ac_config_targets
14415do
14416 case $ac_config_target in
14417 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
14418 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
14419 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
14420 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14421 "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
14422 "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;;
14423 "doc/embryo.dox") CONFIG_FILES="$CONFIG_FILES doc/embryo.dox" ;;
14424 "embryo.pc") CONFIG_FILES="$CONFIG_FILES embryo.pc" ;;
14425 "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
14426 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
14427 "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
14428 "src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES src/bin/Makefile" ;;
14429 "embryo.spec") CONFIG_FILES="$CONFIG_FILES embryo.spec" ;;
14430
14431 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
14432 esac
14433done
14434
14435
14436# If the user did not use the arguments to specify the items to instantiate,
14437# then the envvar interface is used. Set only those that are not.
14438# We use the long form for the default assignment because of an extremely
14439# bizarre bug on SunOS 4.1.3.
14440if $ac_need_defaults; then
14441 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14442 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14443 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14444fi
14445
14446# Have a temporary directory for convenience. Make it in the build tree
14447# simply because there is no reason against having it here, and in addition,
14448# creating and moving files from /tmp can sometimes cause problems.
14449# Hook for its removal unless debugging.
14450# Note that there is a small window in which the directory will not be cleaned:
14451# after its creation but before its name has been assigned to `$tmp'.
14452$debug ||
14453{
14454 tmp=
14455 trap 'exit_status=$?
14456 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
14457' 0
14458 trap 'as_fn_exit 1' 1 2 13 15
14459}
14460# Create a (secure) tmp directory for tmp files.
14461
14462{
14463 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
14464 test -n "$tmp" && test -d "$tmp"
14465} ||
14466{
14467 tmp=./conf$$-$RANDOM
14468 (umask 077 && mkdir "$tmp")
14469} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
14470
14471# Set up the scripts for CONFIG_FILES section.
14472# No need to generate them if there are no CONFIG_FILES.
14473# This happens for instance with `./config.status config.h'.
14474if test -n "$CONFIG_FILES"; then
14475
14476
14477ac_cr=`echo X | tr X '\015'`
14478# On cygwin, bash can eat \r inside `` if the user requested igncr.
14479# But we know of no other shell where ac_cr would be empty at this
14480# point, so we can use a bashism as a fallback.
14481if test "x$ac_cr" = x; then
14482 eval ac_cr=\$\'\\r\'
14483fi
14484ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
14485if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
14486 ac_cs_awk_cr='\\r'
14487else
14488 ac_cs_awk_cr=$ac_cr
14489fi
14490
14491echo 'BEGIN {' >"$tmp/subs1.awk" &&
14492_ACEOF
14493
14494
14495{
14496 echo "cat >conf$$subs.awk <<_ACEOF" &&
14497 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
14498 echo "_ACEOF"
14499} >conf$$subs.sh ||
14500 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14501ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
14502ac_delim='%!_!# '
14503for ac_last_try in false false false false false :; do
14504 . ./conf$$subs.sh ||
14505 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14506
14507 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
14508 if test $ac_delim_n = $ac_delim_num; then
14509 break
14510 elif $ac_last_try; then
14511 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14512 else
14513 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
14514 fi
14515done
14516rm -f conf$$subs.sh
14517
14518cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14519cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
14520_ACEOF
14521sed -n '
14522h
14523s/^/S["/; s/!.*/"]=/
14524p
14525g
14526s/^[^!]*!//
14527:repl
14528t repl
14529s/'"$ac_delim"'$//
14530t delim
14531:nl
14532h
14533s/\(.\{148\}\)..*/\1/
14534t more1
14535s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
14536p
14537n
14538b repl
14539:more1
14540s/["\\]/\\&/g; s/^/"/; s/$/"\\/
14541p
14542g
14543s/.\{148\}//
14544t nl
14545:delim
14546h
14547s/\(.\{148\}\)..*/\1/
14548t more2
14549s/["\\]/\\&/g; s/^/"/; s/$/"/
14550p
14551b
14552:more2
14553s/["\\]/\\&/g; s/^/"/; s/$/"\\/
14554p
14555g
14556s/.\{148\}//
14557t delim
14558' <conf$$subs.awk | sed '
14559/^[^""]/{
14560 N
14561 s/\n//
14562}
14563' >>$CONFIG_STATUS || ac_write_fail=1
14564rm -f conf$$subs.awk
14565cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14566_ACAWK
14567cat >>"\$tmp/subs1.awk" <<_ACAWK &&
14568 for (key in S) S_is_set[key] = 1
14569 FS = ""
14570
14571}
14572{
14573 line = $ 0
14574 nfields = split(line, field, "@")
14575 substed = 0
14576 len = length(field[1])
14577 for (i = 2; i < nfields; i++) {
14578 key = field[i]
14579 keylen = length(key)
14580 if (S_is_set[key]) {
14581 value = S[key]
14582 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
14583 len += length(value) + length(field[++i])
14584 substed = 1
14585 } else
14586 len += 1 + keylen
14587 }
14588
14589 print line
14590}
14591
14592_ACAWK
14593_ACEOF
14594cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14595if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
14596 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
14597else
14598 cat
14599fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
14600 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
14601_ACEOF
14602
14603# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
14604# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
14605# trailing colons and then remove the whole line if VPATH becomes empty
14606# (actually we leave an empty line to preserve line numbers).
14607if test "x$srcdir" = x.; then
14608 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
14609h
14610s///
14611s/^/:/
14612s/[ ]*$/:/
14613s/:\$(srcdir):/:/g
14614s/:\${srcdir}:/:/g
14615s/:@srcdir@:/:/g
14616s/^:*//
14617s/:*$//
14618x
14619s/\(=[ ]*\).*/\1/
14620G
14621s/\n//
14622s/^[^=]*=[ ]*$//
14623}'
14624fi
14625
14626cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14627fi # test -n "$CONFIG_FILES"
14628
14629# Set up the scripts for CONFIG_HEADERS section.
14630# No need to generate them if there are no CONFIG_HEADERS.
14631# This happens for instance with `./config.status Makefile'.
14632if test -n "$CONFIG_HEADERS"; then
14633cat >"$tmp/defines.awk" <<\_ACAWK ||
14634BEGIN {
14635_ACEOF
14636
14637# Transform confdefs.h into an awk script `defines.awk', embedded as
14638# here-document in config.status, that substitutes the proper values into
14639# config.h.in to produce config.h.
14640
14641# Create a delimiter string that does not exist in confdefs.h, to ease
14642# handling of long lines.
14643ac_delim='%!_!# '
14644for ac_last_try in false false :; do
14645 ac_t=`sed -n "/$ac_delim/p" confdefs.h`
14646 if test -z "$ac_t"; then
14647 break
14648 elif $ac_last_try; then
14649 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
14650 else
14651 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
14652 fi
14653done
14654
14655# For the awk script, D is an array of macro values keyed by name,
14656# likewise P contains macro parameters if any. Preserve backslash
14657# newline sequences.
14658
14659ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
14660sed -n '
14661s/.\{148\}/&'"$ac_delim"'/g
14662t rset
14663:rset
14664s/^[ ]*#[ ]*define[ ][ ]*/ /
14665t def
14666d
14667:def
14668s/\\$//
14669t bsnl
14670s/["\\]/\\&/g
14671s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
14672D["\1"]=" \3"/p
14673s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
14674d
14675:bsnl
14676s/["\\]/\\&/g
14677s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
14678D["\1"]=" \3\\\\\\n"\\/p
14679t cont
14680s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
14681t cont
14682d
14683:cont
14684n
14685s/.\{148\}/&'"$ac_delim"'/g
14686t clear
14687:clear
14688s/\\$//
14689t bsnlc
14690s/["\\]/\\&/g; s/^/"/; s/$/"/p
14691d
14692:bsnlc
14693s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
14694b cont
14695' <confdefs.h | sed '
14696s/'"$ac_delim"'/"\\\
14697"/g' >>$CONFIG_STATUS || ac_write_fail=1
14698
14699cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14700 for (key in D) D_is_set[key] = 1
14701 FS = ""
14702}
14703/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
14704 line = \$ 0
14705 split(line, arg, " ")
14706 if (arg[1] == "#") {
14707 defundef = arg[2]
14708 mac1 = arg[3]
14709 } else {
14710 defundef = substr(arg[1], 2)
14711 mac1 = arg[2]
14712 }
14713 split(mac1, mac2, "(") #)
14714 macro = mac2[1]
14715 prefix = substr(line, 1, index(line, defundef) - 1)
14716 if (D_is_set[macro]) {
14717 # Preserve the white space surrounding the "#".
14718 print prefix "define", macro P[macro] D[macro]
14719 next
14720 } else {
14721 # Replace #undef with comments. This is necessary, for example,
14722 # in the case of _POSIX_SOURCE, which is predefined and required
14723 # on some systems where configure will not decide to define it.
14724 if (defundef == "undef") {
14725 print "/*", prefix defundef, macro, "*/"
14726 next
14727 }
14728 }
14729}
14730{ print }
14731_ACAWK
14732_ACEOF
14733cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14734 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
14735fi # test -n "$CONFIG_HEADERS"
14736
14737
14738eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
14739shift
14740for ac_tag
14741do
14742 case $ac_tag in
14743 :[FHLC]) ac_mode=$ac_tag; continue;;
14744 esac
14745 case $ac_mode$ac_tag in
14746 :[FHL]*:*);;
14747 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
14748 :[FH]-) ac_tag=-:-;;
14749 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
14750 esac
14751 ac_save_IFS=$IFS
14752 IFS=:
14753 set x $ac_tag
14754 IFS=$ac_save_IFS
14755 shift
14756 ac_file=$1
14757 shift
14758
14759 case $ac_mode in
14760 :L) ac_source=$1;;
14761 :[FH])
14762 ac_file_inputs=
14763 for ac_f
14764 do
14765 case $ac_f in
14766 -) ac_f="$tmp/stdin";;
14767 *) # Look for the file first in the build tree, then in the source tree
14768 # (if the path is not absolute). The absolute path cannot be DOS-style,
14769 # because $ac_f cannot contain `:'.
14770 test -f "$ac_f" ||
14771 case $ac_f in
14772 [\\/$]*) false;;
14773 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
14774 esac ||
14775 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
14776 esac
14777 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
14778 as_fn_append ac_file_inputs " '$ac_f'"
14779 done
14780
14781 # Let's still pretend it is `configure' which instantiates (i.e., don't
14782 # use $as_me), people would be surprised to read:
14783 # /* config.h. Generated by config.status. */
14784 configure_input='Generated from '`
14785 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
14786 `' by configure.'
14787 if test x"$ac_file" != x-; then
14788 configure_input="$ac_file. $configure_input"
14789 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
14790$as_echo "$as_me: creating $ac_file" >&6;}
14791 fi
14792 # Neutralize special characters interpreted by sed in replacement strings.
14793 case $configure_input in #(
14794 *\&* | *\|* | *\\* )
14795 ac_sed_conf_input=`$as_echo "$configure_input" |
14796 sed 's/[\\\\&|]/\\\\&/g'`;; #(
14797 *) ac_sed_conf_input=$configure_input;;
14798 esac
14799
14800 case $ac_tag in
14801 *:-:* | *:-) cat >"$tmp/stdin" \
14802 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
14803 esac
14804 ;;
14805 esac
14806
14807 ac_dir=`$as_dirname -- "$ac_file" ||
14808$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14809 X"$ac_file" : 'X\(//\)[^/]' \| \
14810 X"$ac_file" : 'X\(//\)$' \| \
14811 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
14812$as_echo X"$ac_file" |
14813 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14814 s//\1/
14815 q
14816 }
14817 /^X\(\/\/\)[^/].*/{
14818 s//\1/
14819 q
14820 }
14821 /^X\(\/\/\)$/{
14822 s//\1/
14823 q
14824 }
14825 /^X\(\/\).*/{
14826 s//\1/
14827 q
14828 }
14829 s/.*/./; q'`
14830 as_dir="$ac_dir"; as_fn_mkdir_p
14831 ac_builddir=.
14832
14833case "$ac_dir" in
14834.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
14835*)
14836 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
14837 # A ".." for each directory in $ac_dir_suffix.
14838 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
14839 case $ac_top_builddir_sub in
14840 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
14841 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
14842 esac ;;
14843esac
14844ac_abs_top_builddir=$ac_pwd
14845ac_abs_builddir=$ac_pwd$ac_dir_suffix
14846# for backward compatibility:
14847ac_top_builddir=$ac_top_build_prefix
14848
14849case $srcdir in
14850 .) # We are building in place.
14851 ac_srcdir=.
14852 ac_top_srcdir=$ac_top_builddir_sub
14853 ac_abs_top_srcdir=$ac_pwd ;;
14854 [\\/]* | ?:[\\/]* ) # Absolute name.
14855 ac_srcdir=$srcdir$ac_dir_suffix;
14856 ac_top_srcdir=$srcdir
14857 ac_abs_top_srcdir=$srcdir ;;
14858 *) # Relative name.
14859 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
14860 ac_top_srcdir=$ac_top_build_prefix$srcdir
14861 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
14862esac
14863ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
14864
14865
14866 case $ac_mode in
14867 :F)
14868 #
14869 # CONFIG_FILE
14870 #
14871
14872 case $INSTALL in
14873 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14874 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
14875 esac
14876 ac_MKDIR_P=$MKDIR_P
14877 case $MKDIR_P in
14878 [\\/$]* | ?:[\\/]* ) ;;
14879 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
14880 esac
14881_ACEOF
14882
14883cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14884# If the template does not know about datarootdir, expand it.
14885# FIXME: This hack should be removed a few years after 2.60.
14886ac_datarootdir_hack=; ac_datarootdir_seen=
14887ac_sed_dataroot='
14888/datarootdir/ {
14889 p
14890 q
14891}
14892/@datadir@/p
14893/@docdir@/p
14894/@infodir@/p
14895/@localedir@/p
14896/@mandir@/p'
14897case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
14898*datarootdir*) ac_datarootdir_seen=yes;;
14899*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
14900 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
14901$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
14902_ACEOF
14903cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14904 ac_datarootdir_hack='
14905 s&@datadir@&$datadir&g
14906 s&@docdir@&$docdir&g
14907 s&@infodir@&$infodir&g
14908 s&@localedir@&$localedir&g
14909 s&@mandir@&$mandir&g
14910 s&\\\${datarootdir}&$datarootdir&g' ;;
14911esac
14912_ACEOF
14913
14914# Neutralize VPATH when `$srcdir' = `.'.
14915# Shell code in configure.ac might set extrasub.
14916# FIXME: do we really want to maintain this feature?
14917cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14918ac_sed_extra="$ac_vpsub
14919$extrasub
14920_ACEOF
14921cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14922:t
14923/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14924s|@configure_input@|$ac_sed_conf_input|;t t
14925s&@top_builddir@&$ac_top_builddir_sub&;t t
14926s&@top_build_prefix@&$ac_top_build_prefix&;t t
14927s&@srcdir@&$ac_srcdir&;t t
14928s&@abs_srcdir@&$ac_abs_srcdir&;t t
14929s&@top_srcdir@&$ac_top_srcdir&;t t
14930s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
14931s&@builddir@&$ac_builddir&;t t
14932s&@abs_builddir@&$ac_abs_builddir&;t t
14933s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
14934s&@INSTALL@&$ac_INSTALL&;t t
14935s&@MKDIR_P@&$ac_MKDIR_P&;t t
14936$ac_datarootdir_hack
14937"
14938eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
14939 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
14940
14941test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
14942 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
14943 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
14944 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
14945which seems to be undefined. Please make sure it is defined" >&5
14946$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
14947which seems to be undefined. Please make sure it is defined" >&2;}
14948
14949 rm -f "$tmp/stdin"
14950 case $ac_file in
14951 -) cat "$tmp/out" && rm -f "$tmp/out";;
14952 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
14953 esac \
14954 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
14955 ;;
14956 :H)
14957 #
14958 # CONFIG_HEADER
14959 #
14960 if test x"$ac_file" != x-; then
14961 {
14962 $as_echo "/* $configure_input */" \
14963 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
14964 } >"$tmp/config.h" \
14965 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
14966 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
14967 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
14968$as_echo "$as_me: $ac_file is unchanged" >&6;}
14969 else
14970 rm -f "$ac_file"
14971 mv "$tmp/config.h" "$ac_file" \
14972 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
14973 fi
14974 else
14975 $as_echo "/* $configure_input */" \
14976 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
14977 || as_fn_error $? "could not create -" "$LINENO" 5
14978 fi
14979# Compute "$ac_file"'s index in $config_headers.
14980_am_arg="$ac_file"
14981_am_stamp_count=1
14982for _am_header in $config_headers :; do
14983 case $_am_header in
14984 $_am_arg | $_am_arg:* )
14985 break ;;
14986 * )
14987 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
14988 esac
14989done
14990echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
14991$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14992 X"$_am_arg" : 'X\(//\)[^/]' \| \
14993 X"$_am_arg" : 'X\(//\)$' \| \
14994 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
14995$as_echo X"$_am_arg" |
14996 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14997 s//\1/
14998 q
14999 }
15000 /^X\(\/\/\)[^/].*/{
15001 s//\1/
15002 q
15003 }
15004 /^X\(\/\/\)$/{
15005 s//\1/
15006 q
15007 }
15008 /^X\(\/\).*/{
15009 s//\1/
15010 q
15011 }
15012 s/.*/./; q'`/stamp-h$_am_stamp_count
15013 ;;
15014
15015 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
15016$as_echo "$as_me: executing $ac_file commands" >&6;}
15017 ;;
15018 esac
15019
15020
15021 case $ac_file$ac_mode in
15022 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
15023 # Autoconf 2.62 quotes --file arguments for eval, but not when files
15024 # are listed without --file. Let's play safe and only enable the eval
15025 # if we detect the quoting.
15026 case $CONFIG_FILES in
15027 *\'*) eval set x "$CONFIG_FILES" ;;
15028 *) set x $CONFIG_FILES ;;
15029 esac
15030 shift
15031 for mf
15032 do
15033 # Strip MF so we end up with the name of the file.
15034 mf=`echo "$mf" | sed -e 's/:.*$//'`
15035 # Check whether this is an Automake generated Makefile or not.
15036 # We used to match only the files named `Makefile.in', but
15037 # some people rename them; so instead we look at the file content.
15038 # Grep'ing the first line is not enough: some people post-process
15039 # each Makefile.in and add a new line on top of each file to say so.
15040 # Grep'ing the whole file is not good either: AIX grep has a line
15041 # limit of 2048, but all sed's we know have understand at least 4000.
15042 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
15043 dirpart=`$as_dirname -- "$mf" ||
15044$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15045 X"$mf" : 'X\(//\)[^/]' \| \
15046 X"$mf" : 'X\(//\)$' \| \
15047 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
15048$as_echo X"$mf" |
15049 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15050 s//\1/
15051 q
15052 }
15053 /^X\(\/\/\)[^/].*/{
15054 s//\1/
15055 q
15056 }
15057 /^X\(\/\/\)$/{
15058 s//\1/
15059 q
15060 }
15061 /^X\(\/\).*/{
15062 s//\1/
15063 q
15064 }
15065 s/.*/./; q'`
15066 else
15067 continue
15068 fi
15069 # Extract the definition of DEPDIR, am__include, and am__quote
15070 # from the Makefile without running `make'.
15071 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
15072 test -z "$DEPDIR" && continue
15073 am__include=`sed -n 's/^am__include = //p' < "$mf"`
15074 test -z "am__include" && continue
15075 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
15076 # When using ansi2knr, U may be empty or an underscore; expand it
15077 U=`sed -n 's/^U = //p' < "$mf"`
15078 # Find all dependency output files, they are included files with
15079 # $(DEPDIR) in their names. We invoke sed twice because it is the
15080 # simplest approach to changing $(DEPDIR) to its actual value in the
15081 # expansion.
15082 for file in `sed -n "
15083 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
15084 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
15085 # Make sure the directory exists.
15086 test -f "$dirpart/$file" && continue
15087 fdir=`$as_dirname -- "$file" ||
15088$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15089 X"$file" : 'X\(//\)[^/]' \| \
15090 X"$file" : 'X\(//\)$' \| \
15091 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
15092$as_echo X"$file" |
15093 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15094 s//\1/
15095 q
15096 }
15097 /^X\(\/\/\)[^/].*/{
15098 s//\1/
15099 q
15100 }
15101 /^X\(\/\/\)$/{
15102 s//\1/
15103 q
15104 }
15105 /^X\(\/\).*/{
15106 s//\1/
15107 q
15108 }
15109 s/.*/./; q'`
15110 as_dir=$dirpart/$fdir; as_fn_mkdir_p
15111 # echo "creating $dirpart/$file"
15112 echo '# dummy' > "$dirpart/$file"
15113 done
15114 done
15115}
15116 ;;
15117 "libtool":C)
15118
15119 # See if we are running on zsh, and set the options which allow our
15120 # commands through without removal of \ escapes.
15121 if test -n "${ZSH_VERSION+set}" ; then
15122 setopt NO_GLOB_SUBST
15123 fi
15124
15125 cfgfile="${ofile}T"
15126 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
15127 $RM "$cfgfile"
15128
15129 cat <<_LT_EOF >> "$cfgfile"
15130#! $SHELL
15131
15132# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
15133# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
15134# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15135# NOTE: Changes made to this file will be lost: look at ltmain.sh.
15136#
15137# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
15138# 2006, 2007, 2008 Free Software Foundation, Inc.
15139# Written by Gordon Matzigkeit, 1996
15140#
15141# This file is part of GNU Libtool.
15142#
15143# GNU Libtool is free software; you can redistribute it and/or
15144# modify it under the terms of the GNU General Public License as
15145# published by the Free Software Foundation; either version 2 of
15146# the License, or (at your option) any later version.
15147#
15148# As a special exception to the GNU General Public License,
15149# if you distribute this file as part of a program or library that
15150# is built using GNU Libtool, you may include this file under the
15151# same distribution terms that you use for the rest of that program.
15152#
15153# GNU Libtool is distributed in the hope that it will be useful,
15154# but WITHOUT ANY WARRANTY; without even the implied warranty of
15155# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15156# GNU General Public License for more details.
15157#
15158# You should have received a copy of the GNU General Public License
15159# along with GNU Libtool; see the file COPYING. If not, a copy
15160# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
15161# obtained by writing to the Free Software Foundation, Inc.,
15162# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15163
15164
15165# The names of the tagged configurations supported by this script.
15166available_tags=""
15167
15168# ### BEGIN LIBTOOL CONFIG
15169
15170# Assembler program.
15171AS=$AS
15172
15173# DLL creation program.
15174DLLTOOL=$DLLTOOL
15175
15176# Object dumper program.
15177OBJDUMP=$OBJDUMP
15178
15179# Which release of libtool.m4 was used?
15180macro_version=$macro_version
15181macro_revision=$macro_revision
15182
15183# Whether or not to build shared libraries.
15184build_libtool_libs=$enable_shared
15185
15186# Whether or not to build static libraries.
15187build_old_libs=$enable_static
15188
15189# What type of objects to build.
15190pic_mode=$pic_mode
15191
15192# Whether or not to optimize for fast installation.
15193fast_install=$enable_fast_install
15194
15195# The host system.
15196host_alias=$host_alias
15197host=$host
15198host_os=$host_os
15199
15200# The build system.
15201build_alias=$build_alias
15202build=$build
15203build_os=$build_os
15204
15205# A sed program that does not truncate output.
15206SED=$lt_SED
15207
15208# Sed that helps us avoid accidentally triggering echo(1) options like -n.
15209Xsed="\$SED -e 1s/^X//"
15210
15211# A grep program that handles long lines.
15212GREP=$lt_GREP
15213
15214# An ERE matcher.
15215EGREP=$lt_EGREP
15216
15217# A literal string matcher.
15218FGREP=$lt_FGREP
15219
15220# A BSD- or MS-compatible name lister.
15221NM=$lt_NM
15222
15223# Whether we need soft or hard links.
15224LN_S=$lt_LN_S
15225
15226# What is the maximum length of a command?
15227max_cmd_len=$max_cmd_len
15228
15229# Object file suffix (normally "o").
15230objext=$ac_objext
15231
15232# Executable file suffix (normally "").
15233exeext=$exeext
15234
15235# whether the shell understands "unset".
15236lt_unset=$lt_unset
15237
15238# turn spaces into newlines.
15239SP2NL=$lt_lt_SP2NL
15240
15241# turn newlines into spaces.
15242NL2SP=$lt_lt_NL2SP
15243
15244# How to create reloadable object files.
15245reload_flag=$lt_reload_flag
15246reload_cmds=$lt_reload_cmds
15247
15248# Method to check whether dependent libraries are shared objects.
15249deplibs_check_method=$lt_deplibs_check_method
15250
15251# Command to use when deplibs_check_method == "file_magic".
15252file_magic_cmd=$lt_file_magic_cmd
15253
15254# The archiver.
15255AR=$lt_AR
15256AR_FLAGS=$lt_AR_FLAGS
15257
15258# A symbol stripping program.
15259STRIP=$lt_STRIP
15260
15261# Commands used to install an old-style archive.
15262RANLIB=$lt_RANLIB
15263old_postinstall_cmds=$lt_old_postinstall_cmds
15264old_postuninstall_cmds=$lt_old_postuninstall_cmds
15265
15266# A C compiler.
15267LTCC=$lt_CC
15268
15269# LTCC compiler flags.
15270LTCFLAGS=$lt_CFLAGS
15271
15272# Take the output of nm and produce a listing of raw symbols and C names.
15273global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
15274
15275# Transform the output of nm in a proper C declaration.
15276global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
15277
15278# Transform the output of nm in a C name address pair.
15279global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
15280
15281# Transform the output of nm in a C name address pair when lib prefix is needed.
15282global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
15283
15284# The name of the directory that contains temporary libtool files.
15285objdir=$objdir
15286
15287# Shell to use when invoking shell scripts.
15288SHELL=$lt_SHELL
15289
15290# An echo program that does not interpret backslashes.
15291ECHO=$lt_ECHO
15292
15293# Used to examine libraries when file_magic_cmd begins with "file".
15294MAGIC_CMD=$MAGIC_CMD
15295
15296# Must we lock files when doing compilation?
15297need_locks=$lt_need_locks
15298
15299# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
15300DSYMUTIL=$lt_DSYMUTIL
15301
15302# Tool to change global to local symbols on Mac OS X.
15303NMEDIT=$lt_NMEDIT
15304
15305# Tool to manipulate fat objects and archives on Mac OS X.
15306LIPO=$lt_LIPO
15307
15308# ldd/readelf like tool for Mach-O binaries on Mac OS X.
15309OTOOL=$lt_OTOOL
15310
15311# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
15312OTOOL64=$lt_OTOOL64
15313
15314# Old archive suffix (normally "a").
15315libext=$libext
15316
15317# Shared library suffix (normally ".so").
15318shrext_cmds=$lt_shrext_cmds
15319
15320# The commands to extract the exported symbol list from a shared archive.
15321extract_expsyms_cmds=$lt_extract_expsyms_cmds
15322
15323# Variables whose values should be saved in libtool wrapper scripts and
15324# restored at link time.
15325variables_saved_for_relink=$lt_variables_saved_for_relink
15326
15327# Do we need the "lib" prefix for modules?
15328need_lib_prefix=$need_lib_prefix
15329
15330# Do we need a version for libraries?
15331need_version=$need_version
15332
15333# Library versioning type.
15334version_type=$version_type
15335
15336# Shared library runtime path variable.
15337runpath_var=$runpath_var
15338
15339# Shared library path variable.
15340shlibpath_var=$shlibpath_var
15341
15342# Is shlibpath searched before the hard-coded library search path?
15343shlibpath_overrides_runpath=$shlibpath_overrides_runpath
15344
15345# Format of library name prefix.
15346libname_spec=$lt_libname_spec
15347
15348# List of archive names. First name is the real one, the rest are links.
15349# The last name is the one that the linker finds with -lNAME
15350library_names_spec=$lt_library_names_spec
15351
15352# The coded name of the library, if different from the real name.
15353soname_spec=$lt_soname_spec
15354
15355# Command to use after installation of a shared archive.
15356postinstall_cmds=$lt_postinstall_cmds
15357
15358# Command to use after uninstallation of a shared archive.
15359postuninstall_cmds=$lt_postuninstall_cmds
15360
15361# Commands used to finish a libtool library installation in a directory.
15362finish_cmds=$lt_finish_cmds
15363
15364# As "finish_cmds", except a single script fragment to be evaled but
15365# not shown.
15366finish_eval=$lt_finish_eval
15367
15368# Whether we should hardcode library paths into libraries.
15369hardcode_into_libs=$hardcode_into_libs
15370
15371# Compile-time system search path for libraries.
15372sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
15373
15374# Run-time system search path for libraries.
15375sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
15376
15377# Whether dlopen is supported.
15378dlopen_support=$enable_dlopen
15379
15380# Whether dlopen of programs is supported.
15381dlopen_self=$enable_dlopen_self
15382
15383# Whether dlopen of statically linked programs is supported.
15384dlopen_self_static=$enable_dlopen_self_static
15385
15386# Commands to strip libraries.
15387old_striplib=$lt_old_striplib
15388striplib=$lt_striplib
15389
15390
15391# The linker used to build libraries.
15392LD=$lt_LD
15393
15394# Commands used to build an old-style archive.
15395old_archive_cmds=$lt_old_archive_cmds
15396
15397# A language specific compiler.
15398CC=$lt_compiler
15399
15400# Is the compiler the GNU compiler?
15401with_gcc=$GCC
15402
15403# Compiler flag to turn off builtin functions.
15404no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
15405
15406# How to pass a linker flag through the compiler.
15407wl=$lt_lt_prog_compiler_wl
15408
15409# Additional compiler flags for building library objects.
15410pic_flag=$lt_lt_prog_compiler_pic
15411
15412# Compiler flag to prevent dynamic linking.
15413link_static_flag=$lt_lt_prog_compiler_static
15414
15415# Does compiler simultaneously support -c and -o options?
15416compiler_c_o=$lt_lt_cv_prog_compiler_c_o
15417
15418# Whether or not to add -lc for building shared libraries.
15419build_libtool_need_lc=$archive_cmds_need_lc
15420
15421# Whether or not to disallow shared libs when runtime libs are static.
15422allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
15423
15424# Compiler flag to allow reflexive dlopens.
15425export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
15426
15427# Compiler flag to generate shared objects directly from archives.
15428whole_archive_flag_spec=$lt_whole_archive_flag_spec
15429
15430# Whether the compiler copes with passing no objects directly.
15431compiler_needs_object=$lt_compiler_needs_object
15432
15433# Create an old-style archive from a shared archive.
15434old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
15435
15436# Create a temporary old-style archive to link instead of a shared archive.
15437old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
15438
15439# Commands used to build a shared archive.
15440archive_cmds=$lt_archive_cmds
15441archive_expsym_cmds=$lt_archive_expsym_cmds
15442
15443# Commands used to build a loadable module if different from building
15444# a shared archive.
15445module_cmds=$lt_module_cmds
15446module_expsym_cmds=$lt_module_expsym_cmds
15447
15448# Whether we are building with GNU ld or not.
15449with_gnu_ld=$lt_with_gnu_ld
15450
15451# Flag that allows shared libraries with undefined symbols to be built.
15452allow_undefined_flag=$lt_allow_undefined_flag
15453
15454# Flag that enforces no undefined symbols.
15455no_undefined_flag=$lt_no_undefined_flag
15456
15457# Flag to hardcode \$libdir into a binary during linking.
15458# This must work even if \$libdir does not exist
15459hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
15460
15461# If ld is used when linking, flag to hardcode \$libdir into a binary
15462# during linking. This must work even if \$libdir does not exist.
15463hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
15464
15465# Whether we need a single "-rpath" flag with a separated argument.
15466hardcode_libdir_separator=$lt_hardcode_libdir_separator
15467
15468# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
15469# DIR into the resulting binary.
15470hardcode_direct=$hardcode_direct
15471
15472# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
15473# DIR into the resulting binary and the resulting library dependency is
15474# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
15475# library is relocated.
15476hardcode_direct_absolute=$hardcode_direct_absolute
15477
15478# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
15479# into the resulting binary.
15480hardcode_minus_L=$hardcode_minus_L
15481
15482# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
15483# into the resulting binary.
15484hardcode_shlibpath_var=$hardcode_shlibpath_var
15485
15486# Set to "yes" if building a shared library automatically hardcodes DIR
15487# into the library and all subsequent libraries and executables linked
15488# against it.
15489hardcode_automatic=$hardcode_automatic
15490
15491# Set to yes if linker adds runtime paths of dependent libraries
15492# to runtime path list.
15493inherit_rpath=$inherit_rpath
15494
15495# Whether libtool must link a program against all its dependency libraries.
15496link_all_deplibs=$link_all_deplibs
15497
15498# Fix the shell variable \$srcfile for the compiler.
15499fix_srcfile_path=$lt_fix_srcfile_path
15500
15501# Set to "yes" if exported symbols are required.
15502always_export_symbols=$always_export_symbols
15503
15504# The commands to list exported symbols.
15505export_symbols_cmds=$lt_export_symbols_cmds
15506
15507# Symbols that should not be listed in the preloaded symbols.
15508exclude_expsyms=$lt_exclude_expsyms
15509
15510# Symbols that must always be exported.
15511include_expsyms=$lt_include_expsyms
15512
15513# Commands necessary for linking programs (against libraries) with templates.
15514prelink_cmds=$lt_prelink_cmds
15515
15516# Specify filename containing input files.
15517file_list_spec=$lt_file_list_spec
15518
15519# How to hardcode a shared library path into an executable.
15520hardcode_action=$hardcode_action
15521
15522# ### END LIBTOOL CONFIG
15523
15524_LT_EOF
15525
15526 case $host_os in
15527 aix3*)
15528 cat <<\_LT_EOF >> "$cfgfile"
15529# AIX sometimes has problems with the GCC collect2 program. For some
15530# reason, if we set the COLLECT_NAMES environment variable, the problems
15531# vanish in a puff of smoke.
15532if test "X${COLLECT_NAMES+set}" != Xset; then
15533 COLLECT_NAMES=
15534 export COLLECT_NAMES
15535fi
15536_LT_EOF
15537 ;;
15538 esac
15539
15540
15541ltmain="$ac_aux_dir/ltmain.sh"
15542
15543
15544 # We use sed instead of cat because bash on DJGPP gets confused if
15545 # if finds mixed CR/LF and LF-only lines. Since sed operates in
15546 # text mode, it properly converts lines to CR/LF. This bash problem
15547 # is reportedly fixed, but why not run on old versions too?
15548 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
15549 || (rm -f "$cfgfile"; exit 1)
15550
15551 case $xsi_shell in
15552 yes)
15553 cat << \_LT_EOF >> "$cfgfile"
15554
15555# func_dirname file append nondir_replacement
15556# Compute the dirname of FILE. If nonempty, add APPEND to the result,
15557# otherwise set result to NONDIR_REPLACEMENT.
15558func_dirname ()
15559{
15560 case ${1} in
15561 */*) func_dirname_result="${1%/*}${2}" ;;
15562 * ) func_dirname_result="${3}" ;;
15563 esac
15564}
15565
15566# func_basename file
15567func_basename ()
15568{
15569 func_basename_result="${1##*/}"
15570}
15571
15572# func_dirname_and_basename file append nondir_replacement
15573# perform func_basename and func_dirname in a single function
15574# call:
15575# dirname: Compute the dirname of FILE. If nonempty,
15576# add APPEND to the result, otherwise set result
15577# to NONDIR_REPLACEMENT.
15578# value returned in "$func_dirname_result"
15579# basename: Compute filename of FILE.
15580# value retuned in "$func_basename_result"
15581# Implementation must be kept synchronized with func_dirname
15582# and func_basename. For efficiency, we do not delegate to
15583# those functions but instead duplicate the functionality here.
15584func_dirname_and_basename ()
15585{
15586 case ${1} in
15587 */*) func_dirname_result="${1%/*}${2}" ;;
15588 * ) func_dirname_result="${3}" ;;
15589 esac
15590 func_basename_result="${1##*/}"
15591}
15592
15593# func_stripname prefix suffix name
15594# strip PREFIX and SUFFIX off of NAME.
15595# PREFIX and SUFFIX must not contain globbing or regex special
15596# characters, hashes, percent signs, but SUFFIX may contain a leading
15597# dot (in which case that matches only a dot).
15598func_stripname ()
15599{
15600 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
15601 # positional parameters, so assign one to ordinary parameter first.
15602 func_stripname_result=${3}
15603 func_stripname_result=${func_stripname_result#"${1}"}
15604 func_stripname_result=${func_stripname_result%"${2}"}
15605}
15606
15607# func_opt_split
15608func_opt_split ()
15609{
15610 func_opt_split_opt=${1%%=*}
15611 func_opt_split_arg=${1#*=}
15612}
15613
15614# func_lo2o object
15615func_lo2o ()
15616{
15617 case ${1} in
15618 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
15619 *) func_lo2o_result=${1} ;;
15620 esac
15621}
15622
15623# func_xform libobj-or-source
15624func_xform ()
15625{
15626 func_xform_result=${1%.*}.lo
15627}
15628
15629# func_arith arithmetic-term...
15630func_arith ()
15631{
15632 func_arith_result=$(( $* ))
15633}
15634
15635# func_len string
15636# STRING may not start with a hyphen.
15637func_len ()
15638{
15639 func_len_result=${#1}
15640}
15641
15642_LT_EOF
15643 ;;
15644 *) # Bourne compatible functions.
15645 cat << \_LT_EOF >> "$cfgfile"
15646
15647# func_dirname file append nondir_replacement
15648# Compute the dirname of FILE. If nonempty, add APPEND to the result,
15649# otherwise set result to NONDIR_REPLACEMENT.
15650func_dirname ()
15651{
15652 # Extract subdirectory from the argument.
15653 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
15654 if test "X$func_dirname_result" = "X${1}"; then
15655 func_dirname_result="${3}"
15656 else
15657 func_dirname_result="$func_dirname_result${2}"
15658 fi
15659}
15660
15661# func_basename file
15662func_basename ()
15663{
15664 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
15665}
15666
15667
15668# func_stripname prefix suffix name
15669# strip PREFIX and SUFFIX off of NAME.
15670# PREFIX and SUFFIX must not contain globbing or regex special
15671# characters, hashes, percent signs, but SUFFIX may contain a leading
15672# dot (in which case that matches only a dot).
15673# func_strip_suffix prefix name
15674func_stripname ()
15675{
15676 case ${2} in
15677 .*) func_stripname_result=`$ECHO "X${3}" \
15678 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
15679 *) func_stripname_result=`$ECHO "X${3}" \
15680 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
15681 esac
15682}
15683
15684# sed scripts:
15685my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
15686my_sed_long_arg='1s/^-[^=]*=//'
15687
15688# func_opt_split
15689func_opt_split ()
15690{
15691 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
15692 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
15693}
15694
15695# func_lo2o object
15696func_lo2o ()
15697{
15698 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
15699}
15700
15701# func_xform libobj-or-source
15702func_xform ()
15703{
15704 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
15705}
15706
15707# func_arith arithmetic-term...
15708func_arith ()
15709{
15710 func_arith_result=`expr "$@"`
15711}
15712
15713# func_len string
15714# STRING may not start with a hyphen.
15715func_len ()
15716{
15717 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
15718}
15719
15720_LT_EOF
15721esac
15722
15723case $lt_shell_append in
15724 yes)
15725 cat << \_LT_EOF >> "$cfgfile"
15726
15727# func_append var value
15728# Append VALUE to the end of shell variable VAR.
15729func_append ()
15730{
15731 eval "$1+=\$2"
15732}
15733_LT_EOF
15734 ;;
15735 *)
15736 cat << \_LT_EOF >> "$cfgfile"
15737
15738# func_append var value
15739# Append VALUE to the end of shell variable VAR.
15740func_append ()
15741{
15742 eval "$1=\$$1\$2"
15743}
15744
15745_LT_EOF
15746 ;;
15747 esac
15748
15749
15750 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
15751 || (rm -f "$cfgfile"; exit 1)
15752
15753 mv -f "$cfgfile" "$ofile" ||
15754 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
15755 chmod +x "$ofile"
15756
15757 ;;
15758
15759 esac
15760done # for ac_tag
15761
15762
15763as_fn_exit 0
15764_ACEOF
15765ac_clean_files=$ac_clean_files_save
15766
15767test $ac_write_fail = 0 ||
15768 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
15769
15770
15771# configure is writing to config.log, and then calls config.status.
15772# config.status does its own redirection, appending to config.log.
15773# Unfortunately, on DOS this fails, as config.log is still kept open
15774# by configure, so config.status won't be able to write to it; its
15775# output is simply discarded. So we exec the FD to /dev/null,
15776# effectively closing config.log, so it can be properly (re)opened and
15777# appended to by config.status. When coming back to configure, we
15778# need to make the FD available again.
15779if test "$no_create" != yes; then
15780 ac_cs_success=:
15781 ac_config_status_args=
15782 test "$silent" = yes &&
15783 ac_config_status_args="$ac_config_status_args --quiet"
15784 exec 5>/dev/null
15785 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
15786 exec 5>>config.log
15787 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15788 # would make configure fail if this is the last instruction.
15789 $ac_cs_success || as_fn_exit 1
15790fi
15791if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
15792 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
15793$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
15794fi
15795
15796
15797
15798#####################################################################
15799## Info
15800
15801echo
15802echo
15803echo
15804echo "------------------------------------------------------------------------"
15805echo "$PACKAGE $VERSION"
15806echo "------------------------------------------------------------------------"
15807echo
15808echo "Configuration Options Summary:"
15809echo
15810echo " Build embryo_cc......: $have_embryo_cc"
15811echo
15812echo " Documentation........: ${build_doc}"
15813echo
15814echo "Compilation............: make (or gmake)"
15815echo " CPPFLAGS.............: $CPPFLAGS"
15816echo " CFLAGS...............: $CFLAGS"
15817echo " LDFLAGS..............: $LDFLAGS"
15818echo
15819echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
15820echo " prefix...............: $prefix"
15821echo
diff --git a/libraries/embryo/configure.ac b/libraries/embryo/configure.ac
new file mode 100644
index 0000000..721a9c1
--- /dev/null
+++ b/libraries/embryo/configure.ac
@@ -0,0 +1,215 @@
1##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3m4_define([v_maj], [1])
4m4_define([v_min], [1])
5m4_define([v_mic], [0])
6m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8##-- When released, remove the dnl on the below line
9m4_undefine([v_rev])
10##-- When doing snapshots - change soname. remove dnl on below line
11dnl m4_define([relname], [ver-pre-svn-07])
12dnl m4_define([v_rel], [-release ver-pre-svn-07])
13##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15m4_define([lt_cur], m4_eval(v_maj + v_min))
16m4_define([lt_rev], v_mic)
17m4_define([lt_age], v_min)
18##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21AC_INIT([embryo], [v_ver], [enlightenment-devel@lists.sourceforge.net])
22AC_PREREQ([2.52])
23AC_CONFIG_SRCDIR([configure.ac])
24AC_CONFIG_MACRO_DIR([m4])
25
26AC_CONFIG_HEADERS([config.h])
27AH_TOP([
28#ifndef EFL_CONFIG_H__
29#define EFL_CONFIG_H__
30])
31AH_BOTTOM([
32#endif /* EFL_CONFIG_H__ */
33])
34
35AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38AC_LIBTOOL_WIN32_DLL
39define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
40define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
41AC_PROG_LIBTOOL
42
43##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
44##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
45m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
46m4_ifdef([v_rel], , [m4_define([v_rel], [])])
47AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
48AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
49AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
50AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
51version_info="lt_cur:lt_rev:lt_age"
52release_info="v_rel"
53AC_SUBST(version_info)
54AC_SUBST(release_info)
55##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
56##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
57VMAJ=v_maj
58AC_SUBST(VMAJ)
59
60### Default options with respect to host
61
62AC_CANONICAL_BUILD
63AC_CANONICAL_HOST
64
65requirement_embryo=""
66embryoincludedir="${datadir}/include"
67
68
69### Additional options to configure
70
71EFL_ENABLE_BIN([embryo-cc])
72
73
74### Checks for programs
75AC_PROG_CC
76
77# doxygen program for documentation building
78
79EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
80
81# pkg-config
82
83PKG_PROG_PKG_CONFIG
84
85# Check whether pkg-config supports Requires.private
86if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
87 pkgconfig_requires_private="Requires.private"
88else
89 pkgconfig_requires_private="Requires"
90fi
91AC_SUBST(pkgconfig_requires_private)
92
93
94### Checks for libraries
95
96# Evil library for compilation on Windows
97
98EFL_EMBRYO_BUILD=""
99case "$host_os" in
100 mingw*)
101 PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
102 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
103 requirement_embryo="evil ${requirement_embryo}"
104 EFL_EMBRYO_BUILD="-DEFL_EMBRYO_BUILD"
105 ;;
106esac
107AC_SUBST(EFL_EMBRYO_BUILD)
108
109# For embryo_cc_prefix.c
110PKG_CHECK_MODULES([EINA], [eina >= 1.1.0])
111
112### Checks for header files
113
114AC_CHECK_HEADERS([unistd.h])
115EFL_CHECK_PATH_MAX
116
117
118### Checks for types
119
120
121### Checks for structures
122
123
124### Checks for compiler characteristics
125AC_C_BIGENDIAN
126AM_PROG_CC_C_O
127AC_C_CONST
128AC_C_INLINE
129AC_PROG_CC_STDC
130AC_HEADER_STDC
131AC_C___ATTRIBUTE__
132
133EMBRYO_CPPFLAGS=""
134EMBRYO_CFLAGS=""
135case "$host_os" in
136 mingw32ce*)
137 EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420"
138 ;;
139esac
140AC_SUBST(EMBRYO_CPPFLAGS)
141AC_SUBST(EMBRYO_CFLAGS)
142
143
144### Checks for linker characteristics
145
146lt_enable_auto_import=""
147case "$host_os" in
148 mingw*)
149 lt_enable_auto_import="-Wl,--enable-auto-import"
150 ;;
151esac
152AC_SUBST(lt_enable_auto_import)
153
154
155### Checks for library functions
156
157AC_ISC_POSIX
158
159# alloca
160AC_FUNC_ALLOCA
161
162# fnmatch
163EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
164
165case "$host_os" in
166 mingw*)
167 AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defined to 1 (MinGW platform)])
168 ;;
169 *)
170 AC_CHECK_FUNCS(gettimeofday)
171 ;;
172esac
173
174
175AC_SUBST(requirement_embryo)
176AC_SUBST(embryoincludedir)
177
178AC_OUTPUT([
179Makefile
180doc/Makefile
181doc/Doxyfile
182doc/embryo.dox
183embryo.pc
184include/Makefile
185src/Makefile
186src/lib/Makefile
187src/bin/Makefile
188embryo.spec
189])
190
191
192#####################################################################
193## Info
194
195echo
196echo
197echo
198echo "------------------------------------------------------------------------"
199echo "$PACKAGE $VERSION"
200echo "------------------------------------------------------------------------"
201echo
202echo "Configuration Options Summary:"
203echo
204echo " Build embryo_cc......: $have_embryo_cc"
205echo
206echo " Documentation........: ${build_doc}"
207echo
208echo "Compilation............: make (or gmake)"
209echo " CPPFLAGS.............: $CPPFLAGS"
210echo " CFLAGS...............: $CFLAGS"
211echo " LDFLAGS..............: $LDFLAGS"
212echo
213echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
214echo " prefix...............: $prefix"
215echo
diff --git a/libraries/embryo/depcomp b/libraries/embryo/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/libraries/embryo/depcomp
@@ -0,0 +1,630 @@
1#! /bin/sh
2# depcomp - compile a program generating dependencies as side-effects
3
4scriptversion=2009-04-28.21; # UTC
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
7# Software Foundation, Inc.
8
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2, or (at your option)
12# any later version.
13
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
28
29case $1 in
30 '')
31 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
32 exit 1;
33 ;;
34 -h | --h*)
35 cat <<\EOF
36Usage: depcomp [--help] [--version] PROGRAM [ARGS]
37
38Run PROGRAMS ARGS to compile a file, generating dependencies
39as side-effects.
40
41Environment variables:
42 depmode Dependency tracking mode.
43 source Source file read by `PROGRAMS ARGS'.
44 object Object file output by `PROGRAMS ARGS'.
45 DEPDIR directory where to store dependencies.
46 depfile Dependency file to output.
47 tmpdepfile Temporary file to use when outputing dependencies.
48 libtool Whether libtool is used (yes/no).
49
50Report bugs to <bug-automake@gnu.org>.
51EOF
52 exit $?
53 ;;
54 -v | --v*)
55 echo "depcomp $scriptversion"
56 exit $?
57 ;;
58esac
59
60if test -z "$depmode" || test -z "$source" || test -z "$object"; then
61 echo "depcomp: Variables source, object and depmode must be set" 1>&2
62 exit 1
63fi
64
65# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
66depfile=${depfile-`echo "$object" |
67 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
68tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
69
70rm -f "$tmpdepfile"
71
72# Some modes work just like other modes, but use different flags. We
73# parameterize here, but still list the modes in the big case below,
74# to make depend.m4 easier to write. Note that we *cannot* use a case
75# here, because this file can only contain one case statement.
76if test "$depmode" = hp; then
77 # HP compiler uses -M and no extra arg.
78 gccflag=-M
79 depmode=gcc
80fi
81
82if test "$depmode" = dashXmstdout; then
83 # This is just like dashmstdout with a different argument.
84 dashmflag=-xM
85 depmode=dashmstdout
86fi
87
88cygpath_u="cygpath -u -f -"
89if test "$depmode" = msvcmsys; then
90 # This is just like msvisualcpp but w/o cygpath translation.
91 # Just convert the backslash-escaped backslashes to single forward
92 # slashes to satisfy depend.m4
93 cygpath_u="sed s,\\\\\\\\,/,g"
94 depmode=msvisualcpp
95fi
96
97case "$depmode" in
98gcc3)
99## gcc 3 implements dependency tracking that does exactly what
100## we want. Yay! Note: for some reason libtool 1.4 doesn't like
101## it if -MD -MP comes after the -MF stuff. Hmm.
102## Unfortunately, FreeBSD c89 acceptance of flags depends upon
103## the command line argument order; so add the flags where they
104## appear in depend2.am. Note that the slowdown incurred here
105## affects only configure: in makefiles, %FASTDEP% shortcuts this.
106 for arg
107 do
108 case $arg in
109 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
110 *) set fnord "$@" "$arg" ;;
111 esac
112 shift # fnord
113 shift # $arg
114 done
115 "$@"
116 stat=$?
117 if test $stat -eq 0; then :
118 else
119 rm -f "$tmpdepfile"
120 exit $stat
121 fi
122 mv "$tmpdepfile" "$depfile"
123 ;;
124
125gcc)
126## There are various ways to get dependency output from gcc. Here's
127## why we pick this rather obscure method:
128## - Don't want to use -MD because we'd like the dependencies to end
129## up in a subdir. Having to rename by hand is ugly.
130## (We might end up doing this anyway to support other compilers.)
131## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
132## -MM, not -M (despite what the docs say).
133## - Using -M directly means running the compiler twice (even worse
134## than renaming).
135 if test -z "$gccflag"; then
136 gccflag=-MD,
137 fi
138 "$@" -Wp,"$gccflag$tmpdepfile"
139 stat=$?
140 if test $stat -eq 0; then :
141 else
142 rm -f "$tmpdepfile"
143 exit $stat
144 fi
145 rm -f "$depfile"
146 echo "$object : \\" > "$depfile"
147 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
148## The second -e expression handles DOS-style file names with drive letters.
149 sed -e 's/^[^:]*: / /' \
150 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
151## This next piece of magic avoids the `deleted header file' problem.
152## The problem is that when a header file which appears in a .P file
153## is deleted, the dependency causes make to die (because there is
154## typically no way to rebuild the header). We avoid this by adding
155## dummy dependencies for each header file. Too bad gcc doesn't do
156## this for us directly.
157 tr ' ' '
158' < "$tmpdepfile" |
159## Some versions of gcc put a space before the `:'. On the theory
160## that the space means something, we add a space to the output as
161## well.
162## Some versions of the HPUX 10.20 sed can't process this invocation
163## correctly. Breaking it into two sed invocations is a workaround.
164 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
165 rm -f "$tmpdepfile"
166 ;;
167
168hp)
169 # This case exists only to let depend.m4 do its work. It works by
170 # looking at the text of this script. This case will never be run,
171 # since it is checked for above.
172 exit 1
173 ;;
174
175sgi)
176 if test "$libtool" = yes; then
177 "$@" "-Wp,-MDupdate,$tmpdepfile"
178 else
179 "$@" -MDupdate "$tmpdepfile"
180 fi
181 stat=$?
182 if test $stat -eq 0; then :
183 else
184 rm -f "$tmpdepfile"
185 exit $stat
186 fi
187 rm -f "$depfile"
188
189 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
190 echo "$object : \\" > "$depfile"
191
192 # Clip off the initial element (the dependent). Don't try to be
193 # clever and replace this with sed code, as IRIX sed won't handle
194 # lines with more than a fixed number of characters (4096 in
195 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
196 # the IRIX cc adds comments like `#:fec' to the end of the
197 # dependency line.
198 tr ' ' '
199' < "$tmpdepfile" \
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
201 tr '
202' ' ' >> "$depfile"
203 echo >> "$depfile"
204
205 # The second pass generates a dummy entry for each header file.
206 tr ' ' '
207' < "$tmpdepfile" \
208 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
209 >> "$depfile"
210 else
211 # The sourcefile does not contain any dependencies, so just
212 # store a dummy comment line, to avoid errors with the Makefile
213 # "include basename.Plo" scheme.
214 echo "#dummy" > "$depfile"
215 fi
216 rm -f "$tmpdepfile"
217 ;;
218
219aix)
220 # The C for AIX Compiler uses -M and outputs the dependencies
221 # in a .u file. In older versions, this file always lives in the
222 # current directory. Also, the AIX compiler puts `$object:' at the
223 # start of each line; $object doesn't have directory information.
224 # Version 6 uses the directory in both cases.
225 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
226 test "x$dir" = "x$object" && dir=
227 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
228 if test "$libtool" = yes; then
229 tmpdepfile1=$dir$base.u
230 tmpdepfile2=$base.u
231 tmpdepfile3=$dir.libs/$base.u
232 "$@" -Wc,-M
233 else
234 tmpdepfile1=$dir$base.u
235 tmpdepfile2=$dir$base.u
236 tmpdepfile3=$dir$base.u
237 "$@" -M
238 fi
239 stat=$?
240
241 if test $stat -eq 0; then :
242 else
243 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
244 exit $stat
245 fi
246
247 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
248 do
249 test -f "$tmpdepfile" && break
250 done
251 if test -f "$tmpdepfile"; then
252 # Each line is of the form `foo.o: dependent.h'.
253 # Do two passes, one to just change these to
254 # `$object: dependent.h' and one to simply `dependent.h:'.
255 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
256 # That's a tab and a space in the [].
257 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
258 else
259 # The sourcefile does not contain any dependencies, so just
260 # store a dummy comment line, to avoid errors with the Makefile
261 # "include basename.Plo" scheme.
262 echo "#dummy" > "$depfile"
263 fi
264 rm -f "$tmpdepfile"
265 ;;
266
267icc)
268 # Intel's C compiler understands `-MD -MF file'. However on
269 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
270 # ICC 7.0 will fill foo.d with something like
271 # foo.o: sub/foo.c
272 # foo.o: sub/foo.h
273 # which is wrong. We want:
274 # sub/foo.o: sub/foo.c
275 # sub/foo.o: sub/foo.h
276 # sub/foo.c:
277 # sub/foo.h:
278 # ICC 7.1 will output
279 # foo.o: sub/foo.c sub/foo.h
280 # and will wrap long lines using \ :
281 # foo.o: sub/foo.c ... \
282 # sub/foo.h ... \
283 # ...
284
285 "$@" -MD -MF "$tmpdepfile"
286 stat=$?
287 if test $stat -eq 0; then :
288 else
289 rm -f "$tmpdepfile"
290 exit $stat
291 fi
292 rm -f "$depfile"
293 # Each line is of the form `foo.o: dependent.h',
294 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
295 # Do two passes, one to just change these to
296 # `$object: dependent.h' and one to simply `dependent.h:'.
297 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
298 # Some versions of the HPUX 10.20 sed can't process this invocation
299 # correctly. Breaking it into two sed invocations is a workaround.
300 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
301 sed -e 's/$/ :/' >> "$depfile"
302 rm -f "$tmpdepfile"
303 ;;
304
305hp2)
306 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
307 # compilers, which have integrated preprocessors. The correct option
308 # to use with these is +Maked; it writes dependencies to a file named
309 # 'foo.d', which lands next to the object file, wherever that
310 # happens to be.
311 # Much of this is similar to the tru64 case; see comments there.
312 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
313 test "x$dir" = "x$object" && dir=
314 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
315 if test "$libtool" = yes; then
316 tmpdepfile1=$dir$base.d
317 tmpdepfile2=$dir.libs/$base.d
318 "$@" -Wc,+Maked
319 else
320 tmpdepfile1=$dir$base.d
321 tmpdepfile2=$dir$base.d
322 "$@" +Maked
323 fi
324 stat=$?
325 if test $stat -eq 0; then :
326 else
327 rm -f "$tmpdepfile1" "$tmpdepfile2"
328 exit $stat
329 fi
330
331 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
332 do
333 test -f "$tmpdepfile" && break
334 done
335 if test -f "$tmpdepfile"; then
336 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
337 # Add `dependent.h:' lines.
338 sed -ne '2,${
339 s/^ *//
340 s/ \\*$//
341 s/$/:/
342 p
343 }' "$tmpdepfile" >> "$depfile"
344 else
345 echo "#dummy" > "$depfile"
346 fi
347 rm -f "$tmpdepfile" "$tmpdepfile2"
348 ;;
349
350tru64)
351 # The Tru64 compiler uses -MD to generate dependencies as a side
352 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
353 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
354 # dependencies in `foo.d' instead, so we check for that too.
355 # Subdirectories are respected.
356 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
357 test "x$dir" = "x$object" && dir=
358 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
359
360 if test "$libtool" = yes; then
361 # With Tru64 cc, shared objects can also be used to make a
362 # static library. This mechanism is used in libtool 1.4 series to
363 # handle both shared and static libraries in a single compilation.
364 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
365 #
366 # With libtool 1.5 this exception was removed, and libtool now
367 # generates 2 separate objects for the 2 libraries. These two
368 # compilations output dependencies in $dir.libs/$base.o.d and
369 # in $dir$base.o.d. We have to check for both files, because
370 # one of the two compilations can be disabled. We should prefer
371 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
372 # automatically cleaned when .libs/ is deleted, while ignoring
373 # the former would cause a distcleancheck panic.
374 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
375 tmpdepfile2=$dir$base.o.d # libtool 1.5
376 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
377 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
378 "$@" -Wc,-MD
379 else
380 tmpdepfile1=$dir$base.o.d
381 tmpdepfile2=$dir$base.d
382 tmpdepfile3=$dir$base.d
383 tmpdepfile4=$dir$base.d
384 "$@" -MD
385 fi
386
387 stat=$?
388 if test $stat -eq 0; then :
389 else
390 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
391 exit $stat
392 fi
393
394 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
395 do
396 test -f "$tmpdepfile" && break
397 done
398 if test -f "$tmpdepfile"; then
399 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
400 # That's a tab and a space in the [].
401 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
402 else
403 echo "#dummy" > "$depfile"
404 fi
405 rm -f "$tmpdepfile"
406 ;;
407
408#nosideeffect)
409 # This comment above is used by automake to tell side-effect
410 # dependency tracking mechanisms from slower ones.
411
412dashmstdout)
413 # Important note: in order to support this mode, a compiler *must*
414 # always write the preprocessed file to stdout, regardless of -o.
415 "$@" || exit $?
416
417 # Remove the call to Libtool.
418 if test "$libtool" = yes; then
419 while test "X$1" != 'X--mode=compile'; do
420 shift
421 done
422 shift
423 fi
424
425 # Remove `-o $object'.
426 IFS=" "
427 for arg
428 do
429 case $arg in
430 -o)
431 shift
432 ;;
433 $object)
434 shift
435 ;;
436 *)
437 set fnord "$@" "$arg"
438 shift # fnord
439 shift # $arg
440 ;;
441 esac
442 done
443
444 test -z "$dashmflag" && dashmflag=-M
445 # Require at least two characters before searching for `:'
446 # in the target name. This is to cope with DOS-style filenames:
447 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
448 "$@" $dashmflag |
449 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
450 rm -f "$depfile"
451 cat < "$tmpdepfile" > "$depfile"
452 tr ' ' '
453' < "$tmpdepfile" | \
454## Some versions of the HPUX 10.20 sed can't process this invocation
455## correctly. Breaking it into two sed invocations is a workaround.
456 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
457 rm -f "$tmpdepfile"
458 ;;
459
460dashXmstdout)
461 # This case only exists to satisfy depend.m4. It is never actually
462 # run, as this mode is specially recognized in the preamble.
463 exit 1
464 ;;
465
466makedepend)
467 "$@" || exit $?
468 # Remove any Libtool call
469 if test "$libtool" = yes; then
470 while test "X$1" != 'X--mode=compile'; do
471 shift
472 done
473 shift
474 fi
475 # X makedepend
476 shift
477 cleared=no eat=no
478 for arg
479 do
480 case $cleared in
481 no)
482 set ""; shift
483 cleared=yes ;;
484 esac
485 if test $eat = yes; then
486 eat=no
487 continue
488 fi
489 case "$arg" in
490 -D*|-I*)
491 set fnord "$@" "$arg"; shift ;;
492 # Strip any option that makedepend may not understand. Remove
493 # the object too, otherwise makedepend will parse it as a source file.
494 -arch)
495 eat=yes ;;
496 -*|$object)
497 ;;
498 *)
499 set fnord "$@" "$arg"; shift ;;
500 esac
501 done
502 obj_suffix=`echo "$object" | sed 's/^.*\././'`
503 touch "$tmpdepfile"
504 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
505 rm -f "$depfile"
506 cat < "$tmpdepfile" > "$depfile"
507 sed '1,2d' "$tmpdepfile" | tr ' ' '
508' | \
509## Some versions of the HPUX 10.20 sed can't process this invocation
510## correctly. Breaking it into two sed invocations is a workaround.
511 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
512 rm -f "$tmpdepfile" "$tmpdepfile".bak
513 ;;
514
515cpp)
516 # Important note: in order to support this mode, a compiler *must*
517 # always write the preprocessed file to stdout.
518 "$@" || exit $?
519
520 # Remove the call to Libtool.
521 if test "$libtool" = yes; then
522 while test "X$1" != 'X--mode=compile'; do
523 shift
524 done
525 shift
526 fi
527
528 # Remove `-o $object'.
529 IFS=" "
530 for arg
531 do
532 case $arg in
533 -o)
534 shift
535 ;;
536 $object)
537 shift
538 ;;
539 *)
540 set fnord "$@" "$arg"
541 shift # fnord
542 shift # $arg
543 ;;
544 esac
545 done
546
547 "$@" -E |
548 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
549 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
550 sed '$ s: \\$::' > "$tmpdepfile"
551 rm -f "$depfile"
552 echo "$object : \\" > "$depfile"
553 cat < "$tmpdepfile" >> "$depfile"
554 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
555 rm -f "$tmpdepfile"
556 ;;
557
558msvisualcpp)
559 # Important note: in order to support this mode, a compiler *must*
560 # always write the preprocessed file to stdout.
561 "$@" || exit $?
562
563 # Remove the call to Libtool.
564 if test "$libtool" = yes; then
565 while test "X$1" != 'X--mode=compile'; do
566 shift
567 done
568 shift
569 fi
570
571 IFS=" "
572 for arg
573 do
574 case "$arg" in
575 -o)
576 shift
577 ;;
578 $object)
579 shift
580 ;;
581 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
582 set fnord "$@"
583 shift
584 shift
585 ;;
586 *)
587 set fnord "$@" "$arg"
588 shift
589 shift
590 ;;
591 esac
592 done
593 "$@" -E 2>/dev/null |
594 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
595 rm -f "$depfile"
596 echo "$object : \\" > "$depfile"
597 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
598 echo " " >> "$depfile"
599 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
600 rm -f "$tmpdepfile"
601 ;;
602
603msvcmsys)
604 # This case exists only to let depend.m4 do its work. It works by
605 # looking at the text of this script. This case will never be run,
606 # since it is checked for above.
607 exit 1
608 ;;
609
610none)
611 exec "$@"
612 ;;
613
614*)
615 echo "Unknown depmode $depmode" 1>&2
616 exit 1
617 ;;
618esac
619
620exit 0
621
622# Local Variables:
623# mode: shell-script
624# sh-indentation: 2
625# eval: (add-hook 'write-file-hooks 'time-stamp)
626# time-stamp-start: "scriptversion="
627# time-stamp-format: "%:y-%02m-%02d.%02H"
628# time-stamp-time-zone: "UTC"
629# time-stamp-end: "; # UTC"
630# End:
diff --git a/libraries/embryo/doc/Doxyfile b/libraries/embryo/doc/Doxyfile
new file mode 100644
index 0000000..8b66dc9
--- /dev/null
+++ b/libraries/embryo/doc/Doxyfile
@@ -0,0 +1,139 @@
1PROJECT_NAME = Embryo
2PROJECT_NUMBER =
3OUTPUT_DIRECTORY = .
4INPUT = ./embryo.dox ../src/lib/
5IMAGE_PATH = img
6OUTPUT_LANGUAGE = English
7GENERATE_HTML = YES
8HTML_OUTPUT = html
9HTML_FILE_EXTENSION = .html
10HTML_HEADER = ./head.html
11HTML_FOOTER = ./foot.html
12HTML_STYLESHEET = ./e.css
13HTML_ALIGN_MEMBERS = YES
14ENUM_VALUES_PER_LINE = 1
15GENERATE_HTMLHELP = NO
16CHM_FILE =
17HHC_LOCATION =
18GENERATE_CHI = NO
19BINARY_TOC = NO
20TOC_EXPAND = NO
21DISABLE_INDEX = YES
22EXTRACT_ALL = NO
23EXTRACT_PRIVATE = NO
24EXTRACT_STATIC = NO
25EXTRACT_LOCAL_CLASSES = NO
26HIDE_UNDOC_MEMBERS = YES
27HIDE_UNDOC_CLASSES = YES
28HIDE_FRIEND_COMPOUNDS = YES
29BRIEF_MEMBER_DESC = YES
30REPEAT_BRIEF = YES
31ALWAYS_DETAILED_SEC = NO
32INLINE_INHERITED_MEMB = NO
33FULL_PATH_NAMES = NO
34STRIP_FROM_PATH =
35INTERNAL_DOCS = NO
36STRIP_CODE_COMMENTS = YES
37CASE_SENSE_NAMES = YES
38SHORT_NAMES = NO
39HIDE_SCOPE_NAMES = NO
40VERBATIM_HEADERS = NO
41SHOW_INCLUDE_FILES = NO
42JAVADOC_AUTOBRIEF = YES
43MULTILINE_CPP_IS_BRIEF = NO
44DETAILS_AT_TOP = NO
45INHERIT_DOCS = YES
46INLINE_INFO = YES
47SORT_MEMBER_DOCS = YES
48DISTRIBUTE_GROUP_DOC = NO
49TAB_SIZE = 2
50GENERATE_TODOLIST = YES
51GENERATE_TESTLIST = YES
52GENERATE_BUGLIST = YES
53GENERATE_DEPRECATEDLIST= YES
54ALIASES =
55ENABLED_SECTIONS =
56MAX_INITIALIZER_LINES = 30
57OPTIMIZE_OUTPUT_FOR_C = YES
58OPTIMIZE_OUTPUT_JAVA = NO
59SHOW_USED_FILES = NO
60QUIET = YES
61WARNINGS = YES
62WARN_IF_UNDOCUMENTED = YES
63WARN_FORMAT = "$file:$line: $text"
64WARN_LOGFILE =
65FILE_PATTERNS =
66RECURSIVE = NO
67EXCLUDE =
68EXCLUDE_SYMLINKS = NO
69EXCLUDE_PATTERNS =
70EXAMPLE_PATH = ../src/examples
71EXAMPLE_PATTERNS =
72EXAMPLE_RECURSIVE = NO
73INPUT_FILTER =
74FILTER_SOURCE_FILES = NO
75SOURCE_BROWSER = NO
76INLINE_SOURCES = NO
77REFERENCED_BY_RELATION = YES
78REFERENCES_RELATION = YES
79ALPHABETICAL_INDEX = YES
80COLS_IN_ALPHA_INDEX = 2
81IGNORE_PREFIX =
82GENERATE_TREEVIEW = NO
83TREEVIEW_WIDTH = 250
84GENERATE_LATEX = YES
85LATEX_OUTPUT = latex
86LATEX_CMD_NAME = latex
87MAKEINDEX_CMD_NAME = makeindex
88COMPACT_LATEX = NO
89PAPER_TYPE = a4wide
90EXTRA_PACKAGES =
91LATEX_HEADER =
92PDF_HYPERLINKS = YES
93USE_PDFLATEX = NO
94LATEX_BATCHMODE = NO
95GENERATE_RTF = NO
96RTF_OUTPUT = rtf
97COMPACT_RTF = NO
98RTF_HYPERLINKS = NO
99RTF_STYLESHEET_FILE =
100RTF_EXTENSIONS_FILE =
101GENERATE_MAN = YES
102MAN_OUTPUT = man
103MAN_EXTENSION = .3
104MAN_LINKS = YES
105GENERATE_XML = NO
106XML_SCHEMA =
107XML_DTD =
108GENERATE_AUTOGEN_DEF = NO
109ENABLE_PREPROCESSING = YES
110MACRO_EXPANSION = NO
111EXPAND_ONLY_PREDEF = NO
112SEARCH_INCLUDES = NO
113INCLUDE_PATH =
114INCLUDE_FILE_PATTERNS =
115PREDEFINED =
116EXPAND_AS_DEFINED =
117SKIP_FUNCTION_MACROS = YES
118TAGFILES =
119GENERATE_TAGFILE =
120ALLEXTERNALS = NO
121EXTERNAL_GROUPS = YES
122PERL_PATH = /usr/bin/perl
123CLASS_DIAGRAMS = NO
124HIDE_UNDOC_RELATIONS = YES
125HAVE_DOT = NO
126CLASS_GRAPH = NO
127COLLABORATION_GRAPH = NO
128TEMPLATE_RELATIONS = NO
129INCLUDE_GRAPH = NO
130INCLUDED_BY_GRAPH = NO
131GRAPHICAL_HIERARCHY = NO
132DOT_IMAGE_FORMAT = png
133DOT_PATH =
134DOTFILE_DIRS =
135MAX_DOT_GRAPH_WIDTH = 512
136MAX_DOT_GRAPH_HEIGHT = 512
137GENERATE_LEGEND = YES
138DOT_CLEANUP = YES
139SEARCHENGINE = NO
diff --git a/libraries/embryo/doc/Doxyfile.in b/libraries/embryo/doc/Doxyfile.in
new file mode 100644
index 0000000..6659a7d
--- /dev/null
+++ b/libraries/embryo/doc/Doxyfile.in
@@ -0,0 +1,139 @@
1PROJECT_NAME = Embryo
2PROJECT_NUMBER =
3OUTPUT_DIRECTORY = .
4INPUT = @srcdir@/embryo.dox @top_srcdir@/src/lib/
5IMAGE_PATH = img
6OUTPUT_LANGUAGE = English
7GENERATE_HTML = YES
8HTML_OUTPUT = html
9HTML_FILE_EXTENSION = .html
10HTML_HEADER = @srcdir@/head.html
11HTML_FOOTER = @srcdir@/foot.html
12HTML_STYLESHEET = @srcdir@/e.css
13HTML_ALIGN_MEMBERS = YES
14ENUM_VALUES_PER_LINE = 1
15GENERATE_HTMLHELP = NO
16CHM_FILE =
17HHC_LOCATION =
18GENERATE_CHI = NO
19BINARY_TOC = NO
20TOC_EXPAND = NO
21DISABLE_INDEX = YES
22EXTRACT_ALL = NO
23EXTRACT_PRIVATE = NO
24EXTRACT_STATIC = NO
25EXTRACT_LOCAL_CLASSES = NO
26HIDE_UNDOC_MEMBERS = YES
27HIDE_UNDOC_CLASSES = YES
28HIDE_FRIEND_COMPOUNDS = YES
29BRIEF_MEMBER_DESC = YES
30REPEAT_BRIEF = YES
31ALWAYS_DETAILED_SEC = NO
32INLINE_INHERITED_MEMB = NO
33FULL_PATH_NAMES = NO
34STRIP_FROM_PATH =
35INTERNAL_DOCS = NO
36STRIP_CODE_COMMENTS = YES
37CASE_SENSE_NAMES = YES
38SHORT_NAMES = NO
39HIDE_SCOPE_NAMES = NO
40VERBATIM_HEADERS = NO
41SHOW_INCLUDE_FILES = NO
42JAVADOC_AUTOBRIEF = YES
43MULTILINE_CPP_IS_BRIEF = NO
44DETAILS_AT_TOP = NO
45INHERIT_DOCS = YES
46INLINE_INFO = YES
47SORT_MEMBER_DOCS = YES
48DISTRIBUTE_GROUP_DOC = NO
49TAB_SIZE = 2
50GENERATE_TODOLIST = YES
51GENERATE_TESTLIST = YES
52GENERATE_BUGLIST = YES
53GENERATE_DEPRECATEDLIST= YES
54ALIASES =
55ENABLED_SECTIONS =
56MAX_INITIALIZER_LINES = 30
57OPTIMIZE_OUTPUT_FOR_C = YES
58OPTIMIZE_OUTPUT_JAVA = NO
59SHOW_USED_FILES = NO
60QUIET = YES
61WARNINGS = YES
62WARN_IF_UNDOCUMENTED = YES
63WARN_FORMAT = "$file:$line: $text"
64WARN_LOGFILE =
65FILE_PATTERNS =
66RECURSIVE = NO
67EXCLUDE =
68EXCLUDE_SYMLINKS = NO
69EXCLUDE_PATTERNS =
70EXAMPLE_PATH = @top_srcdir@/src/examples
71EXAMPLE_PATTERNS =
72EXAMPLE_RECURSIVE = NO
73INPUT_FILTER =
74FILTER_SOURCE_FILES = NO
75SOURCE_BROWSER = NO
76INLINE_SOURCES = NO
77REFERENCED_BY_RELATION = YES
78REFERENCES_RELATION = YES
79ALPHABETICAL_INDEX = YES
80COLS_IN_ALPHA_INDEX = 2
81IGNORE_PREFIX =
82GENERATE_TREEVIEW = NO
83TREEVIEW_WIDTH = 250
84GENERATE_LATEX = YES
85LATEX_OUTPUT = latex
86LATEX_CMD_NAME = latex
87MAKEINDEX_CMD_NAME = makeindex
88COMPACT_LATEX = NO
89PAPER_TYPE = a4wide
90EXTRA_PACKAGES =
91LATEX_HEADER =
92PDF_HYPERLINKS = YES
93USE_PDFLATEX = NO
94LATEX_BATCHMODE = NO
95GENERATE_RTF = NO
96RTF_OUTPUT = rtf
97COMPACT_RTF = NO
98RTF_HYPERLINKS = NO
99RTF_STYLESHEET_FILE =
100RTF_EXTENSIONS_FILE =
101GENERATE_MAN = YES
102MAN_OUTPUT = man
103MAN_EXTENSION = .3
104MAN_LINKS = YES
105GENERATE_XML = NO
106XML_SCHEMA =
107XML_DTD =
108GENERATE_AUTOGEN_DEF = NO
109ENABLE_PREPROCESSING = YES
110MACRO_EXPANSION = NO
111EXPAND_ONLY_PREDEF = NO
112SEARCH_INCLUDES = NO
113INCLUDE_PATH =
114INCLUDE_FILE_PATTERNS =
115PREDEFINED =
116EXPAND_AS_DEFINED =
117SKIP_FUNCTION_MACROS = YES
118TAGFILES =
119GENERATE_TAGFILE =
120ALLEXTERNALS = NO
121EXTERNAL_GROUPS = YES
122PERL_PATH = /usr/bin/perl
123CLASS_DIAGRAMS = NO
124HIDE_UNDOC_RELATIONS = YES
125HAVE_DOT = NO
126CLASS_GRAPH = NO
127COLLABORATION_GRAPH = NO
128TEMPLATE_RELATIONS = NO
129INCLUDE_GRAPH = NO
130INCLUDED_BY_GRAPH = NO
131GRAPHICAL_HIERARCHY = NO
132DOT_IMAGE_FORMAT = png
133DOT_PATH =
134DOTFILE_DIRS =
135MAX_DOT_GRAPH_WIDTH = 512
136MAX_DOT_GRAPH_HEIGHT = 512
137GENERATE_LEGEND = YES
138DOT_CLEANUP = YES
139SEARCHENGINE = NO
diff --git a/libraries/embryo/doc/Makefile.am b/libraries/embryo/doc/Makefile.am
new file mode 100644
index 0000000..91c79f3
--- /dev/null
+++ b/libraries/embryo/doc/Makefile.am
@@ -0,0 +1,33 @@
1
2MAINTAINERCLEANFILES = Makefile.in embryo.dox
3
4.PHONY: doc
5
6PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
7
8if EFL_BUILD_DOC
9
10doc-clean:
11 rm -rf html/ latex/ man/ xml/ $(top_builddir)/$(PACKAGE_DOCNAME).tar*
12
13doc: all doc-clean
14 $(efl_doxygen)
15 cp $(srcdir)/img/* html/
16 rm -rf $(PACKAGE_DOCNAME).tar*
17 mkdir -p $(PACKAGE_DOCNAME)/doc
18 cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc
19 tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
20 bzip2 -9 $(PACKAGE_DOCNAME).tar
21 rm -rf $(PACKAGE_DOCNAME)/
22 mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir)
23
24clean-local: doc-clean
25
26else
27
28doc:
29 @echo "Documentation not built. Run ./configure --help"
30
31endif
32
33EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) embryo.dox.in
diff --git a/libraries/embryo/doc/Makefile.in b/libraries/embryo/doc/Makefile.in
new file mode 100644
index 0000000..4b53f1d
--- /dev/null
+++ b/libraries/embryo/doc/Makefile.in
@@ -0,0 +1,416 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = doc
37DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
38 $(srcdir)/Makefile.in $(srcdir)/embryo.dox.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
41 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
44 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
45 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
46 $(top_srcdir)/configure.ac
47am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
48 $(ACLOCAL_M4)
49mkinstalldirs = $(install_sh) -d
50CONFIG_HEADER = $(top_builddir)/config.h
51CONFIG_CLEAN_FILES = Doxyfile embryo.dox
52CONFIG_CLEAN_VPATH_FILES =
53AM_V_GEN = $(am__v_GEN_$(V))
54am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
55am__v_GEN_0 = @echo " GEN " $@;
56AM_V_at = $(am__v_at_$(V))
57am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
58am__v_at_0 = @
59SOURCES =
60DIST_SOURCES =
61DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
62ACLOCAL = @ACLOCAL@
63ALLOCA = @ALLOCA@
64AMTAR = @AMTAR@
65AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
66AR = @AR@
67AS = @AS@
68AUTOCONF = @AUTOCONF@
69AUTOHEADER = @AUTOHEADER@
70AUTOMAKE = @AUTOMAKE@
71AWK = @AWK@
72CC = @CC@
73CCDEPMODE = @CCDEPMODE@
74CFLAGS = @CFLAGS@
75CPP = @CPP@
76CPPFLAGS = @CPPFLAGS@
77CYGPATH_W = @CYGPATH_W@
78DEFS = @DEFS@
79DEPDIR = @DEPDIR@
80DLLTOOL = @DLLTOOL@
81DSYMUTIL = @DSYMUTIL@
82DUMPBIN = @DUMPBIN@
83ECHO_C = @ECHO_C@
84ECHO_N = @ECHO_N@
85ECHO_T = @ECHO_T@
86EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
87EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
88EGREP = @EGREP@
89EINA_CFLAGS = @EINA_CFLAGS@
90EINA_LIBS = @EINA_LIBS@
91EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
92EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
93EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
94EVIL_CFLAGS = @EVIL_CFLAGS@
95EVIL_LIBS = @EVIL_LIBS@
96EXEEXT = @EXEEXT@
97FGREP = @FGREP@
98GREP = @GREP@
99INSTALL = @INSTALL@
100INSTALL_DATA = @INSTALL_DATA@
101INSTALL_PROGRAM = @INSTALL_PROGRAM@
102INSTALL_SCRIPT = @INSTALL_SCRIPT@
103INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
104LD = @LD@
105LDFLAGS = @LDFLAGS@
106LIBOBJS = @LIBOBJS@
107LIBS = @LIBS@
108LIBTOOL = @LIBTOOL@
109LIPO = @LIPO@
110LN_S = @LN_S@
111LTLIBOBJS = @LTLIBOBJS@
112MAKEINFO = @MAKEINFO@
113MKDIR_P = @MKDIR_P@
114NM = @NM@
115NMEDIT = @NMEDIT@
116OBJDUMP = @OBJDUMP@
117OBJEXT = @OBJEXT@
118OTOOL = @OTOOL@
119OTOOL64 = @OTOOL64@
120PACKAGE = @PACKAGE@
121PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
122PACKAGE_NAME = @PACKAGE_NAME@
123PACKAGE_STRING = @PACKAGE_STRING@
124PACKAGE_TARNAME = @PACKAGE_TARNAME@
125PACKAGE_URL = @PACKAGE_URL@
126PACKAGE_VERSION = @PACKAGE_VERSION@
127PATH_SEPARATOR = @PATH_SEPARATOR@
128PKG_CONFIG = @PKG_CONFIG@
129PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
130PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
131RANLIB = @RANLIB@
132SED = @SED@
133SET_MAKE = @SET_MAKE@
134SHELL = @SHELL@
135STRIP = @STRIP@
136VERSION = @VERSION@
137VMAJ = @VMAJ@
138abs_builddir = @abs_builddir@
139abs_srcdir = @abs_srcdir@
140abs_top_builddir = @abs_top_builddir@
141abs_top_srcdir = @abs_top_srcdir@
142ac_ct_CC = @ac_ct_CC@
143ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
144am__include = @am__include@
145am__leading_dot = @am__leading_dot@
146am__quote = @am__quote@
147am__tar = @am__tar@
148am__untar = @am__untar@
149bindir = @bindir@
150build = @build@
151build_alias = @build_alias@
152build_cpu = @build_cpu@
153build_os = @build_os@
154build_vendor = @build_vendor@
155builddir = @builddir@
156datadir = @datadir@
157datarootdir = @datarootdir@
158docdir = @docdir@
159dvidir = @dvidir@
160efl_doxygen = @efl_doxygen@
161efl_have_doxygen = @efl_have_doxygen@
162embryoincludedir = @embryoincludedir@
163exec_prefix = @exec_prefix@
164host = @host@
165host_alias = @host_alias@
166host_cpu = @host_cpu@
167host_os = @host_os@
168host_vendor = @host_vendor@
169htmldir = @htmldir@
170includedir = @includedir@
171infodir = @infodir@
172install_sh = @install_sh@
173libdir = @libdir@
174libexecdir = @libexecdir@
175localedir = @localedir@
176localstatedir = @localstatedir@
177lt_ECHO = @lt_ECHO@
178lt_enable_auto_import = @lt_enable_auto_import@
179mandir = @mandir@
180mkdir_p = @mkdir_p@
181oldincludedir = @oldincludedir@
182pdfdir = @pdfdir@
183pkgconfig_requires_private = @pkgconfig_requires_private@
184prefix = @prefix@
185program_transform_name = @program_transform_name@
186psdir = @psdir@
187release_info = @release_info@
188requirement_embryo = @requirement_embryo@
189sbindir = @sbindir@
190sharedstatedir = @sharedstatedir@
191srcdir = @srcdir@
192sysconfdir = @sysconfdir@
193target_alias = @target_alias@
194top_build_prefix = @top_build_prefix@
195top_builddir = @top_builddir@
196top_srcdir = @top_srcdir@
197version_info = @version_info@
198MAINTAINERCLEANFILES = Makefile.in embryo.dox
199PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
200EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) embryo.dox.in
201all: all-am
202
203.SUFFIXES:
204$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
205 @for dep in $?; do \
206 case '$(am__configure_deps)' in \
207 *$$dep*) \
208 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
209 && { if test -f $@; then exit 0; else break; fi; }; \
210 exit 1;; \
211 esac; \
212 done; \
213 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
214 $(am__cd) $(top_srcdir) && \
215 $(AUTOMAKE) --gnu doc/Makefile
216.PRECIOUS: Makefile
217Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
218 @case '$?' in \
219 *config.status*) \
220 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
221 *) \
222 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
223 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
224 esac;
225
226$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
227 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
228
229$(top_srcdir)/configure: $(am__configure_deps)
230 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
231$(ACLOCAL_M4): $(am__aclocal_m4_deps)
232 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
233$(am__aclocal_m4_deps):
234Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
235 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
236embryo.dox: $(top_builddir)/config.status $(srcdir)/embryo.dox.in
237 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
238
239mostlyclean-libtool:
240 -rm -f *.lo
241
242clean-libtool:
243 -rm -rf .libs _libs
244tags: TAGS
245TAGS:
246
247ctags: CTAGS
248CTAGS:
249
250
251distdir: $(DISTFILES)
252 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
253 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
254 list='$(DISTFILES)'; \
255 dist_files=`for file in $$list; do echo $$file; done | \
256 sed -e "s|^$$srcdirstrip/||;t" \
257 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
258 case $$dist_files in \
259 */*) $(MKDIR_P) `echo "$$dist_files" | \
260 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
261 sort -u` ;; \
262 esac; \
263 for file in $$dist_files; do \
264 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
265 if test -d $$d/$$file; then \
266 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
267 if test -d "$(distdir)/$$file"; then \
268 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
269 fi; \
270 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
271 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
272 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
273 fi; \
274 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
275 else \
276 test -f "$(distdir)/$$file" \
277 || cp -p $$d/$$file "$(distdir)/$$file" \
278 || exit 1; \
279 fi; \
280 done
281check-am: all-am
282check: check-am
283all-am: Makefile
284installdirs:
285install: install-am
286install-exec: install-exec-am
287install-data: install-data-am
288uninstall: uninstall-am
289
290install-am: all-am
291 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
292
293installcheck: installcheck-am
294install-strip:
295 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
296 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
297 `test -z '$(STRIP)' || \
298 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
299mostlyclean-generic:
300
301clean-generic:
302
303distclean-generic:
304 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
305 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
306
307maintainer-clean-generic:
308 @echo "This command is intended for maintainers to use"
309 @echo "it deletes files that may require special tools to rebuild."
310 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
311@EFL_BUILD_DOC_FALSE@clean-local:
312clean: clean-am
313
314clean-am: clean-generic clean-libtool clean-local mostlyclean-am
315
316distclean: distclean-am
317 -rm -f Makefile
318distclean-am: clean-am distclean-generic
319
320dvi: dvi-am
321
322dvi-am:
323
324html: html-am
325
326html-am:
327
328info: info-am
329
330info-am:
331
332install-data-am:
333
334install-dvi: install-dvi-am
335
336install-dvi-am:
337
338install-exec-am:
339
340install-html: install-html-am
341
342install-html-am:
343
344install-info: install-info-am
345
346install-info-am:
347
348install-man:
349
350install-pdf: install-pdf-am
351
352install-pdf-am:
353
354install-ps: install-ps-am
355
356install-ps-am:
357
358installcheck-am:
359
360maintainer-clean: maintainer-clean-am
361 -rm -f Makefile
362maintainer-clean-am: distclean-am maintainer-clean-generic
363
364mostlyclean: mostlyclean-am
365
366mostlyclean-am: mostlyclean-generic mostlyclean-libtool
367
368pdf: pdf-am
369
370pdf-am:
371
372ps: ps-am
373
374ps-am:
375
376uninstall-am:
377
378.MAKE: install-am install-strip
379
380.PHONY: all all-am check check-am clean clean-generic clean-libtool \
381 clean-local distclean distclean-generic distclean-libtool \
382 distdir dvi dvi-am html html-am info info-am install \
383 install-am install-data install-data-am install-dvi \
384 install-dvi-am install-exec install-exec-am install-html \
385 install-html-am install-info install-info-am install-man \
386 install-pdf install-pdf-am install-ps install-ps-am \
387 install-strip installcheck installcheck-am installdirs \
388 maintainer-clean maintainer-clean-generic mostlyclean \
389 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
390 uninstall uninstall-am
391
392
393.PHONY: doc
394
395@EFL_BUILD_DOC_TRUE@doc-clean:
396@EFL_BUILD_DOC_TRUE@ rm -rf html/ latex/ man/ xml/ $(top_builddir)/$(PACKAGE_DOCNAME).tar*
397
398@EFL_BUILD_DOC_TRUE@doc: all doc-clean
399@EFL_BUILD_DOC_TRUE@ $(efl_doxygen)
400@EFL_BUILD_DOC_TRUE@ cp $(srcdir)/img/* html/
401@EFL_BUILD_DOC_TRUE@ rm -rf $(PACKAGE_DOCNAME).tar*
402@EFL_BUILD_DOC_TRUE@ mkdir -p $(PACKAGE_DOCNAME)/doc
403@EFL_BUILD_DOC_TRUE@ cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc
404@EFL_BUILD_DOC_TRUE@ tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
405@EFL_BUILD_DOC_TRUE@ bzip2 -9 $(PACKAGE_DOCNAME).tar
406@EFL_BUILD_DOC_TRUE@ rm -rf $(PACKAGE_DOCNAME)/
407@EFL_BUILD_DOC_TRUE@ mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir)
408
409@EFL_BUILD_DOC_TRUE@clean-local: doc-clean
410
411@EFL_BUILD_DOC_FALSE@doc:
412@EFL_BUILD_DOC_FALSE@ @echo "Documentation not built. Run ./configure --help"
413
414# Tell versions [3.59,3.63) of GNU make to not export all variables.
415# Otherwise a system limit (for SysV at least) may be exceeded.
416.NOEXPORT:
diff --git a/libraries/embryo/doc/e.css b/libraries/embryo/doc/e.css
new file mode 100644
index 0000000..07ebd1e
--- /dev/null
+++ b/libraries/embryo/doc/e.css
@@ -0,0 +1,436 @@
1/*
2 Author:
3 Andres Blanc <andresblanc@gmail.com>
4 DaveMDS Andreoli <dave@gurumeditation.it>
5
6 Supported Browsers:
7 ie7, opera9, konqueror4 and firefox3
8
9 Please use a different file for ie6, ie5, etc. hacks.
10*/
11
12
13/* Necessary to place the footer at the bottom of the page */
14html, body {
15 height: 100%;
16 margin: 0px;
17 padding: 0px;
18}
19
20#container {
21 min-height: 100%;
22 height: auto !important;
23 height: 100%;
24 margin: 0 auto -53px;
25}
26
27#footer, #push {
28 height: 53px;
29}
30
31
32* html #container {
33 height: 100%;
34}
35
36/* Prevent floating elements overflowing containers */
37.clear {
38 clear: both;
39 width: 0px;
40 height: 0px;
41}
42
43/* Flexible & centered layout from 750 to 960 pixels */
44.layout {
45 max-width: 960px;
46 min-width: 760px;
47 margin-left: auto;
48 margin-right: auto;
49}
50
51body {
52 /*font-family: Lucida Grande, Helvetica, sans-serif;*/
53 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
54}
55
56/* Prevent design overflowing the viewport in small resolutions */
57#container {
58 padding-right: 17px;
59 padding-left: 17px;
60 background-image: url(head_bg.png);
61 background-repeat: repeat-x;
62}
63
64#header {
65 width: 100%;
66 height: 102px;
67}
68
69#header h1 {
70 width: 63px;
71 height: 63px;
72 background-image: url(e.png);
73 background-repeat: no-repeat;
74 position: absolute;
75 margin: 0px;
76}
77
78#header h1 span {
79 display: none;
80}
81
82#header h2 {
83 display: none;
84}
85
86/* .menu-container is used to set properties common to .menu and .submenu */
87#header .menu-container {
88}
89
90#header .menu-container ul {
91 list-style-type: none;
92 list-style-position: inside;
93 margin: 0;
94}
95
96#header .menu-container li {
97 display: block;
98 float: right;
99}
100
101#header .menu {
102 height: 63px;
103 display: block;
104 background-image: url(menu_bg.png);
105 background-repeat: repeat-x;
106}
107
108#header .menu ul {
109 height: 100%;
110 display: block;
111 background-image: url(menu_bg_last.png);
112 background-repeat: no-repeat;
113 background-position: top right;
114 padding-right: 17px;
115}
116
117#header .menu li {
118 height: 100%;
119 text-align: center;
120 background-image: url(menu_bg_unsel.png);
121 background-repeat: no-repeat;
122}
123
124#header .menu a {
125 height: 100%;
126 display: block;
127 color: #cdcdcd;
128 text-decoration: none;
129 font-size: 10pt;
130 line-height: 59px;
131 text-align: center;
132 padding: 0px 15px 0px 15px;
133}
134
135#header .menu li:hover {
136 background-image: url(menu_bg_hover.png);
137 background-repeat: no-repeat;
138}
139
140#header .menu li:hover a {
141 color: #FFFFFF;
142}
143
144#header .menu li.current {
145 background-image: url(menu_bg_current.png);
146 background-repeat: no-repeat;
147}
148
149#header .menu li.current a {
150 color: #646464;
151}
152
153
154/* Hide all the submenus but the current */
155#header .submenu ul {
156 display: none;
157}
158
159#header .submenu .current {
160 display: block;
161}
162
163#header .submenu {
164 font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
165 margin-top: 10px;
166}
167
168#header .submenu a {
169 color: #888888;
170 text-decoration: none;
171 font-size: 0.9em;
172 line-height: 15px;
173 padding:0px 5px 0px 5px;
174}
175
176#header .submenu a:hover {
177 color: #444444;
178}
179
180#header .submenu li {
181 border-left: 1px solid #DDDDDD;
182}
183
184#header .submenu li:last-child {
185 border-left: 0;
186}
187
188#header .doxytitle {
189 position: absolute;
190 font-size: 1.8em;
191 font-weight: bold;
192 color: #444444;
193 line-height: 35px;
194}
195
196#header small {
197 font-size: 0.4em;
198}
199
200#footer {
201 background-image: url(foot_bg.png);
202 width: 100%;
203}
204
205#footer table {
206 width: 100%;
207 text-align: center;
208 white-space: nowrap;
209 padding: 5px 30px 5px 30px;
210 font-size: 0.8em;
211 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
212 color: #888888;
213}
214
215#footer td.copyright {
216 width: 100%;
217}
218
219/*
220 Author:
221 Andres Blanc <andresblanc@gmail.com>
222 DaveMDS Andreoli <dave@gurumeditation.it>
223
224 Supported Browsers:
225 ie7, opera9, konqueror4 and firefox3
226
227 Please use a different file for ie6, ie5, etc. hacks.
228*/
229
230
231/* Necessary to place the footer at the bottom of the page */
232html, body {
233 height: 100%;
234 margin: 0px;
235 padding: 0px;
236}
237
238#container {
239 min-height: 100%;
240 height: auto !important;
241 height: 100%;
242 margin: 0 auto -53px;
243}
244
245#footer, #push {
246 height: 53px;
247}
248
249
250* html #container {
251 height: 100%;
252}
253
254/* Prevent floating elements overflowing containers */
255.clear {
256 clear: both;
257 width: 0px;
258 height: 0px;
259}
260
261/* Flexible & centered layout from 750 to 960 pixels */
262.layout {
263 max-width: 960px;
264 min-width: 760px;
265 margin-left: auto;
266 margin-right: auto;
267}
268
269body {
270 /*font-family: Lucida Grande, Helvetica, sans-serif;*/
271 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
272}
273
274/* Prevent design overflowing the viewport in small resolutions */
275#container {
276 padding-right: 17px;
277 padding-left: 17px;
278 background-image: url(head_bg.png);
279 background-repeat: repeat-x;
280}
281
282#header {
283 width: 100%;
284 height: 102px;
285}
286
287#header h1 {
288 width: 63px;
289 height: 63px;
290 background-image: url(e.png);
291 background-repeat: no-repeat;
292 position: absolute;
293 margin: 0px;
294}
295
296#header h1 span {
297 display: none;
298}
299
300#header h2 {
301 display: none;
302}
303
304/* .menu-container is used to set properties common to .menu and .submenu */
305#header .menu-container {
306}
307
308#header .menu-container ul {
309 list-style-type: none;
310 list-style-position: inside;
311 margin: 0;
312}
313
314#header .menu-container li {
315 display: block;
316 float: right;
317}
318
319#header .menu {
320 height: 63px;
321 display: block;
322 background-image: url(menu_bg.png);
323 background-repeat: repeat-x;
324}
325
326#header .menu ul {
327 height: 100%;
328 display: block;
329 background-image: url(menu_bg_last.png);
330 background-repeat: no-repeat;
331 background-position: top right;
332 padding-right: 17px;
333}
334
335#header .menu li {
336 height: 100%;
337 text-align: center;
338 background-image: url(menu_bg_unsel.png);
339 background-repeat: no-repeat;
340}
341
342#header .menu a {
343 height: 100%;
344 display: block;
345 color: #cdcdcd;
346 text-decoration: none;
347 font-size: 10pt;
348 line-height: 59px;
349 text-align: center;
350 padding: 0px 15px 0px 15px;
351}
352
353#header .menu li:hover {
354 background-image: url(menu_bg_hover.png);
355 background-repeat: no-repeat;
356}
357
358#header .menu li:hover a {
359 color: #FFFFFF;
360}
361
362#header .menu li.current {
363 background-image: url(menu_bg_current.png);
364 background-repeat: no-repeat;
365}
366
367#header .menu li.current a {
368 color: #646464;
369}
370
371
372/* Hide all the submenus but the current */
373#header .submenu ul {
374 display: none;
375}
376
377#header .submenu .current {
378 display: block;
379}
380
381#header .submenu {
382 font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
383 margin-top: 10px;
384}
385
386#header .submenu a {
387 color: #888888;
388 text-decoration: none;
389 font-size: 0.9em;
390 line-height: 15px;
391 padding:0px 5px 0px 5px;
392}
393
394#header .submenu a:hover {
395 color: #444444;
396}
397
398#header .submenu li {
399 border-left: 1px solid #DDDDDD;
400}
401
402#header .submenu li:last-child {
403 border-left: 0;
404}
405
406#header .doxytitle {
407 position: absolute;
408 font-size: 1.8em;
409 font-weight: bold;
410 color: #444444;
411 line-height: 35px;
412}
413
414#header small {
415 font-size: 0.4em;
416}
417
418#footer {
419 background-image: url(foot_bg.png);
420 width: 100%;
421}
422
423#footer table {
424 width: 100%;
425 text-align: center;
426 white-space: nowrap;
427 padding: 5px 30px 5px 30px;
428 font-size: 0.8em;
429 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
430 color: #888888;
431}
432
433#footer td.copyright {
434 width: 100%;
435}
436
diff --git a/libraries/embryo/doc/embryo.dox.in b/libraries/embryo/doc/embryo.dox.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libraries/embryo/doc/embryo.dox.in
diff --git a/libraries/embryo/doc/foot.html b/libraries/embryo/doc/foot.html
new file mode 100644
index 0000000..78ef911
--- /dev/null
+++ b/libraries/embryo/doc/foot.html
@@ -0,0 +1,19 @@
1
2 <div id="push"></div>
3 </div> <!-- #content -->
4 </div> <!-- .layout -->
5
6 </div> <!-- #container -->
7
8
9 <div id="footer">
10 <table><tr>
11 <td class="poweredby"><img src="doxygen.png"></td>
12 <td class="copyright">Copyright &copy;$year Enlightenment</td>
13 <td class="generated">Docs generated $datetime</td>
14 </tr></table>
15 </div>
16
17
18</body>
19</html>
diff --git a/libraries/embryo/doc/head.html b/libraries/embryo/doc/head.html
new file mode 100644
index 0000000..48032d9
--- /dev/null
+++ b/libraries/embryo/doc/head.html
@@ -0,0 +1,66 @@
1<html>
2<head>
3 <title>$title</title>
4 <meta http-equiv="content-type" content="text/html;charset=UTF-8">
5 <meta name="author" content="Andres Blanc" >
6
7 <link rel="icon" href="img/favicon.png" type="image/x-icon">
8 <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
9 <link rel="icon" href="img/favicon.png" type="image/ico">
10 <link rel="shortcut icon" href="img/favicon.png" type="image/ico">
11
12 <link rel="stylesheet" type="text/css" media="screen" href="e.css">
13 <link rel="stylesheet" type="text/css" media="screen" href="edoxy.css">
14</head>
15
16<body>
17
18<div id="container">
19
20<div id="header">
21<div class="layout">
22
23 <h1><span>Enlightenment</span></h1>
24 <h2><span>Beauty at your fingertips</span></h2>
25
26 <div class="menu-container">
27 <div class="menu">
28 <ul>
29 <li class="current"><a href="http://web.enlightenment.org/p.php?p=docs">Docs</a></li>
30 <li><a href="http://trac.enlightenment.org/e">Tracker</a></li>
31 <li><a href="http://www.enlightenment.org/p.php?p=contact">Contact</a></li>
32 <li><a href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></li>
33 <li><a href="http://www.enlightenment.org/p.php?p=support">Support</a></li>
34 <li><a href="http://www.enlightenment.org/p.php?p=download">Download</a></li>
35 <li><a href="http://www.enlightenment.org/p.php?p=about">About</a></li>
36 <li><a href="http://www.enlightenment.org/p.php?p=news">News</a></li>
37 <li><a href="http://www.enlightenment.org/">Home</a></li>
38 </ul>
39 </div>
40 </div>
41
42 <div class="doxytitle">
43 $projectname Documentation <small>at $date</small>
44 </div>
45
46 <div class="menu-container">
47 <div class="submenu">
48 <ul class="current">
49 <li><a href="todo.html">Todo</a></li>
50 <li><a href="files.html">Files</a></li>
51 <li><a href="annotated.html">Data Structures</a></li>
52 <li><a href="globals.html">Globals</a></li>
53 <li><a href="modules.html">Modules</a></li>
54 <li><a href="pages.html">Related Pages</a></li>
55 <li class="current"><a href="index.html">Main Page</a></li>
56 </ul>
57 </div>
58 </div>
59
60
61 <div class="clear"></div>
62</div>
63</div>
64
65<div id="content">
66<div class="layout">
diff --git a/libraries/embryo/doc/img/e.png b/libraries/embryo/doc/img/e.png
new file mode 100644
index 0000000..b3884a5
--- /dev/null
+++ b/libraries/embryo/doc/img/e.png
Binary files differ
diff --git a/libraries/embryo/doc/img/e_big.png b/libraries/embryo/doc/img/e_big.png
new file mode 100644
index 0000000..d42aeb4
--- /dev/null
+++ b/libraries/embryo/doc/img/e_big.png
Binary files differ
diff --git a/libraries/embryo/doc/img/edoxy.css b/libraries/embryo/doc/img/edoxy.css
new file mode 100644
index 0000000..616a0c5
--- /dev/null
+++ b/libraries/embryo/doc/img/edoxy.css
@@ -0,0 +1,966 @@
1/*
2 * This file contain a custom doxygen style to match e.org graphics
3 */
4
5
6
7/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
8 font-family: Geneva, Arial, Helvetica, sans-serif;
9}*/
10BODY, TD {
11 font-size: 12px;
12}
13H1 {
14 text-align: center;
15 font-size: 160%;
16}
17H2 {
18 font-size: 120%;
19}
20H3 {
21 font-size: 100%;
22}
23CAPTION {
24 font-weight: bold
25}
26DIV.qindex {
27 width: 100%;
28 background-color: #e8eef2;
29 border: 1px solid #84b0c7;
30 text-align: center;
31 margin: 2px;
32 padding: 2px;
33 line-height: 140%;
34}
35DIV.navpath {
36 width: 100%;
37 background-color: #e8eef2;
38 border: 1px solid #84b0c7;
39 text-align: center;
40 margin: 2px;
41 padding: 2px;
42 line-height: 140%;
43}
44DIV.navtab {
45 background-color: #e8eef2;
46 border: 1px solid #84b0c7;
47 text-align: center;
48 margin: 2px;
49 margin-right: 15px;
50 padding: 2px;
51}
52TD.navtab {
53 font-size: 70%;
54}
55A.qindex {
56 text-decoration: none;
57 font-weight: bold;
58 color: #1A419D;
59}
60A.qindex:visited {
61 text-decoration: none;
62 font-weight: bold;
63 color: #1A419D
64}
65A.qindex:hover {
66 text-decoration: none;
67 background-color: #ddddff;
68}
69A.qindexHL {
70 text-decoration: none;
71 font-weight: bold;
72 background-color: #6666cc;
73 color: #ffffff;
74 border: 1px double #9295C2;
75}
76A.qindexHL:hover {
77 text-decoration: none;
78 background-color: #6666cc;
79 color: #ffffff;
80}
81A.qindexHL:visited {
82 text-decoration: none;
83 background-color: #6666cc;
84 color: #ffffff
85}
86A.el {
87 text-decoration: none;
88 font-weight: bold
89}
90A.elRef {
91 font-weight: bold
92}
93A.code:link {
94 text-decoration: none;
95 font-weight: normal;
96 color: #0000FF
97}
98A.code:visited {
99 text-decoration: none;
100 font-weight: normal;
101 color: #0000FF
102}
103A.codeRef:link {
104 font-weight: normal;
105 color: #0000FF
106}
107A.codeRef:visited {
108 font-weight: normal;
109 color: #0000FF
110}
111A:hover, A:visited:hover {
112 text-decoration: none;
113 /* background-color: #f2f2ff; */
114 color: #000055;
115}
116A.anchor {
117 color: #000;
118}
119DL.el {
120 margin-left: -1cm
121}
122.fragment {
123 font-family: monospace, fixed;
124 font-size: 95%;
125}
126PRE.fragment {
127 border: 1px solid #CCCCCC;
128 background-color: #f5f5f5;
129 margin-top: 4px;
130 margin-bottom: 4px;
131 margin-left: 2px;
132 margin-right: 8px;
133 padding-left: 6px;
134 padding-right: 6px;
135 padding-top: 4px;
136 padding-bottom: 4px;
137}
138DIV.ah {
139 background-color: black;
140 font-weight: bold;
141 color: #ffffff;
142 margin-bottom: 3px;
143 margin-top: 3px
144}
145
146DIV.groupHeader {
147 margin-left: 16px;
148 margin-top: 12px;
149 margin-bottom: 6px;
150 font-weight: bold;
151}
152DIV.groupText {
153 margin-left: 16px;
154 font-style: italic;
155 font-size: 90%
156}
157/*BODY {
158 background: white;
159 color: black;
160 margin-right: 20px;
161 margin-left: 20px;
162}*/
163TD.indexkey {
164 background-color: #e8eef2;
165 font-weight: bold;
166 padding-right : 10px;
167 padding-top : 2px;
168 padding-left : 10px;
169 padding-bottom : 2px;
170 margin-left : 0px;
171 margin-right : 0px;
172 margin-top : 2px;
173 margin-bottom : 2px;
174 border: 1px solid #CCCCCC;
175}
176TD.indexvalue {
177 background-color: #e8eef2;
178 font-style: italic;
179 padding-right : 10px;
180 padding-top : 2px;
181 padding-left : 10px;
182 padding-bottom : 2px;
183 margin-left : 0px;
184 margin-right : 0px;
185 margin-top : 2px;
186 margin-bottom : 2px;
187 border: 1px solid #CCCCCC;
188}
189TR.memlist {
190 background-color: #f0f0f0;
191}
192P.formulaDsp {
193 text-align: center;
194}
195IMG.formulaDsp {
196}
197IMG.formulaInl {
198 vertical-align: middle;
199}
200SPAN.keyword { color: #008000 }
201SPAN.keywordtype { color: #604020 }
202SPAN.keywordflow { color: #e08000 }
203SPAN.comment { color: #800000 }
204SPAN.preprocessor { color: #806020 }
205SPAN.stringliteral { color: #002080 }
206SPAN.charliteral { color: #008080 }
207SPAN.vhdldigit { color: #ff00ff }
208SPAN.vhdlchar { color: #000000 }
209SPAN.vhdlkeyword { color: #700070 }
210SPAN.vhdllogic { color: #ff0000 }
211
212.mdescLeft {
213 padding: 0px 8px 4px 8px;
214 font-size: 80%;
215 font-style: italic;
216 background-color: #FAFAFA;
217 border-top: 1px none #E0E0E0;
218 border-right: 1px none #E0E0E0;
219 border-bottom: 1px none #E0E0E0;
220 border-left: 1px none #E0E0E0;
221 margin: 0px;
222}
223.mdescRight {
224 padding: 0px 8px 4px 8px;
225 font-size: 80%;
226 font-style: italic;
227 background-color: #FAFAFA;
228 border-top: 1px none #E0E0E0;
229 border-right: 1px none #E0E0E0;
230 border-bottom: 1px none #E0E0E0;
231 border-left: 1px none #E0E0E0;
232 margin: 0px;
233}
234.memItemLeft {
235 padding: 1px 0px 0px 8px;
236 margin: 4px;
237 border-top-width: 1px;
238 border-right-width: 1px;
239 border-bottom-width: 1px;
240 border-left-width: 1px;
241 border-top-color: #E0E0E0;
242 border-right-color: #E0E0E0;
243 border-bottom-color: #E0E0E0;
244 border-left-color: #E0E0E0;
245 border-top-style: solid;
246 border-right-style: none;
247 border-bottom-style: none;
248 border-left-style: none;
249 background-color: #FAFAFA;
250 font-size: 80%;
251}
252.memItemRight {
253 padding: 1px 8px 0px 8px;
254 margin: 4px;
255 border-top-width: 1px;
256 border-right-width: 1px;
257 border-bottom-width: 1px;
258 border-left-width: 1px;
259 border-top-color: #E0E0E0;
260 border-right-color: #E0E0E0;
261 border-bottom-color: #E0E0E0;
262 border-left-color: #E0E0E0;
263 border-top-style: solid;
264 border-right-style: none;
265 border-bottom-style: none;
266 border-left-style: none;
267 background-color: #FAFAFA;
268 font-size: 80%;
269}
270.memTemplItemLeft {
271 padding: 1px 0px 0px 8px;
272 margin: 4px;
273 border-top-width: 1px;
274 border-right-width: 1px;
275 border-bottom-width: 1px;
276 border-left-width: 1px;
277 border-top-color: #E0E0E0;
278 border-right-color: #E0E0E0;
279 border-bottom-color: #E0E0E0;
280 border-left-color: #E0E0E0;
281 border-top-style: none;
282 border-right-style: none;
283 border-bottom-style: none;
284 border-left-style: none;
285 background-color: #FAFAFA;
286 font-size: 80%;
287}
288.memTemplItemRight {
289 padding: 1px 8px 0px 8px;
290 margin: 4px;
291 border-top-width: 1px;
292 border-right-width: 1px;
293 border-bottom-width: 1px;
294 border-left-width: 1px;
295 border-top-color: #E0E0E0;
296 border-right-color: #E0E0E0;
297 border-bottom-color: #E0E0E0;
298 border-left-color: #E0E0E0;
299 border-top-style: none;
300 border-right-style: none;
301 border-bottom-style: none;
302 border-left-style: none;
303 background-color: #FAFAFA;
304 font-size: 80%;
305}
306.memTemplParams {
307 padding: 1px 0px 0px 8px;
308 margin: 4px;
309 border-top-width: 1px;
310 border-right-width: 1px;
311 border-bottom-width: 1px;
312 border-left-width: 1px;
313 border-top-color: #E0E0E0;
314 border-right-color: #E0E0E0;
315 border-bottom-color: #E0E0E0;
316 border-left-color: #E0E0E0;
317 border-top-style: solid;
318 border-right-style: none;
319 border-bottom-style: none;
320 border-left-style: none;
321 color: #606060;
322 background-color: #FAFAFA;
323 font-size: 80%;
324}
325.search {
326 color: #003399;
327 font-weight: bold;
328}
329FORM.search {
330 margin-bottom: 0px;
331 margin-top: 0px;
332}
333INPUT.search {
334 font-size: 75%;
335 color: #000080;
336 font-weight: normal;
337 background-color: #e8eef2;
338}
339TD.tiny {
340 font-size: 75%;
341}
342a {
343 color: #1A41A8;
344}
345a:visited {
346 color: #2A3798;
347}
348.dirtab {
349 padding: 4px;
350 border-collapse: collapse;
351 border: 1px solid #84b0c7;
352}
353TH.dirtab {
354 background: #e8eef2;
355 font-weight: bold;
356}
357HR {
358 height: 1px;
359 border: none;
360 border-top: 1px solid black;
361}
362
363/* Style for detailed member documentation */
364.memtemplate {
365 font-size: 80%;
366 color: #606060;
367 font-weight: normal;
368 margin-left: 3px;
369}
370.memnav {
371 background-color: #e8eef2;
372 border: 1px solid #84b0c7;
373 text-align: center;
374 margin: 2px;
375 margin-right: 15px;
376 padding: 2px;
377}
378.memitem {
379 padding: 4px;
380 background-color: #eef3f5;
381 border-width: 1px;
382 border-style: solid;
383 border-color: #dedeee;
384 -moz-border-radius: 8px 8px 8px 8px;
385}
386.memname {
387 white-space: nowrap;
388 font-weight: bold;
389}
390.memdoc{
391 padding-left: 10px;
392}
393.memproto {
394 background-color: #d5e1e8;
395 width: 100%;
396 border-width: 1px;
397 border-style: solid;
398 border-color: #84b0c7;
399 font-weight: bold;
400 -moz-border-radius: 8px 8px 8px 8px;
401}
402.paramkey {
403 text-align: right;
404}
405.paramtype {
406 white-space: nowrap;
407}
408.paramname {
409 color: #602020;
410 font-style: italic;
411 white-space: nowrap;
412}
413/* End Styling for detailed member documentation */
414
415/* for the tree view */
416.ftvtree {
417 font-family: sans-serif;
418 margin:0.5em;
419}
420/* these are for tree view when used as main index */
421.directory {
422 font-size: 9pt;
423 font-weight: bold;
424}
425.directory h3 {
426 margin: 0px;
427 margin-top: 1em;
428 font-size: 11pt;
429}
430
431/* The following two styles can be used to replace the root node title */
432/* with an image of your choice. Simply uncomment the next two styles, */
433/* specify the name of your image and be sure to set 'height' to the */
434/* proper pixel height of your image. */
435
436/* .directory h3.swap { */
437/* height: 61px; */
438/* background-repeat: no-repeat; */
439/* background-image: url("yourimage.gif"); */
440/* } */
441/* .directory h3.swap span { */
442/* display: none; */
443/* } */
444
445.directory > h3 {
446 margin-top: 0;
447}
448.directory p {
449 margin: 0px;
450 white-space: nowrap;
451}
452.directory div {
453 display: none;
454 margin: 0px;
455}
456.directory img {
457 vertical-align: -30%;
458}
459/* these are for tree view when not used as main index */
460.directory-alt {
461 font-size: 100%;
462 font-weight: bold;
463}
464.directory-alt h3 {
465 margin: 0px;
466 margin-top: 1em;
467 font-size: 11pt;
468}
469.directory-alt > h3 {
470 margin-top: 0;
471}
472.directory-alt p {
473 margin: 0px;
474 white-space: nowrap;
475}
476.directory-alt div {
477 display: none;
478 margin: 0px;
479}
480.directory-alt img {
481 vertical-align: -30%;
482}
483
484/*
485 * This file contain a custom doxygen style to match e.org graphics
486 */
487
488
489
490/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
491 font-family: Geneva, Arial, Helvetica, sans-serif;
492}*/
493BODY, TD {
494 font-size: 12px;
495}
496H1 {
497 text-align: center;
498 font-size: 160%;
499}
500H2 {
501 font-size: 120%;
502}
503H3 {
504 font-size: 100%;
505}
506CAPTION {
507 font-weight: bold
508}
509DIV.qindex {
510 width: 100%;
511 background-color: #e8eef2;
512 border: 1px solid #84b0c7;
513 text-align: center;
514 margin: 2px;
515 padding: 2px;
516 line-height: 140%;
517}
518DIV.navpath {
519 width: 100%;
520 background-color: #e8eef2;
521 border: 1px solid #84b0c7;
522 text-align: center;
523 margin: 2px;
524 padding: 2px;
525 line-height: 140%;
526}
527DIV.navtab {
528 background-color: #e8eef2;
529 border: 1px solid #84b0c7;
530 text-align: center;
531 margin: 2px;
532 margin-right: 15px;
533 padding: 2px;
534}
535TD.navtab {
536 font-size: 70%;
537}
538A.qindex {
539 text-decoration: none;
540 font-weight: bold;
541 color: #1A419D;
542}
543A.qindex:visited {
544 text-decoration: none;
545 font-weight: bold;
546 color: #1A419D
547}
548A.qindex:hover {
549 text-decoration: none;
550 background-color: #ddddff;
551}
552A.qindexHL {
553 text-decoration: none;
554 font-weight: bold;
555 background-color: #6666cc;
556 color: #ffffff;
557 border: 1px double #9295C2;
558}
559A.qindexHL:hover {
560 text-decoration: none;
561 background-color: #6666cc;
562 color: #ffffff;
563}
564A.qindexHL:visited {
565 text-decoration: none;
566 background-color: #6666cc;
567 color: #ffffff
568}
569A.el {
570 text-decoration: none;
571 font-weight: bold
572}
573A.elRef {
574 font-weight: bold
575}
576A.code:link {
577 text-decoration: none;
578 font-weight: normal;
579 color: #0000FF
580}
581A.code:visited {
582 text-decoration: none;
583 font-weight: normal;
584 color: #0000FF
585}
586A.codeRef:link {
587 font-weight: normal;
588 color: #0000FF
589}
590A.codeRef:visited {
591 font-weight: normal;
592 color: #0000FF
593}
594A:hover, A:visited:hover {
595 text-decoration: none;
596 /* background-color: #f2f2ff; */
597 color: #000055;
598}
599A.anchor {
600 color: #000;
601}
602DL.el {
603 margin-left: -1cm
604}
605.fragment {
606 font-family: monospace, fixed;
607 font-size: 95%;
608}
609PRE.fragment {
610 border: 1px solid #CCCCCC;
611 background-color: #f5f5f5;
612 margin-top: 4px;
613 margin-bottom: 4px;
614 margin-left: 2px;
615 margin-right: 8px;
616 padding-left: 6px;
617 padding-right: 6px;
618 padding-top: 4px;
619 padding-bottom: 4px;
620}
621DIV.ah {
622 background-color: black;
623 font-weight: bold;
624 color: #ffffff;
625 margin-bottom: 3px;
626 margin-top: 3px
627}
628
629DIV.groupHeader {
630 margin-left: 16px;
631 margin-top: 12px;
632 margin-bottom: 6px;
633 font-weight: bold;
634}
635DIV.groupText {
636 margin-left: 16px;
637 font-style: italic;
638 font-size: 90%
639}
640/*BODY {
641 background: white;
642 color: black;
643 margin-right: 20px;
644 margin-left: 20px;
645}*/
646TD.indexkey {
647 background-color: #e8eef2;
648 font-weight: bold;
649 padding-right : 10px;
650 padding-top : 2px;
651 padding-left : 10px;
652 padding-bottom : 2px;
653 margin-left : 0px;
654 margin-right : 0px;
655 margin-top : 2px;
656 margin-bottom : 2px;
657 border: 1px solid #CCCCCC;
658}
659TD.indexvalue {
660 background-color: #e8eef2;
661 font-style: italic;
662 padding-right : 10px;
663 padding-top : 2px;
664 padding-left : 10px;
665 padding-bottom : 2px;
666 margin-left : 0px;
667 margin-right : 0px;
668 margin-top : 2px;
669 margin-bottom : 2px;
670 border: 1px solid #CCCCCC;
671}
672TR.memlist {
673 background-color: #f0f0f0;
674}
675P.formulaDsp {
676 text-align: center;
677}
678IMG.formulaDsp {
679}
680IMG.formulaInl {
681 vertical-align: middle;
682}
683SPAN.keyword { color: #008000 }
684SPAN.keywordtype { color: #604020 }
685SPAN.keywordflow { color: #e08000 }
686SPAN.comment { color: #800000 }
687SPAN.preprocessor { color: #806020 }
688SPAN.stringliteral { color: #002080 }
689SPAN.charliteral { color: #008080 }
690SPAN.vhdldigit { color: #ff00ff }
691SPAN.vhdlchar { color: #000000 }
692SPAN.vhdlkeyword { color: #700070 }
693SPAN.vhdllogic { color: #ff0000 }
694
695.mdescLeft {
696 padding: 0px 8px 4px 8px;
697 font-size: 80%;
698 font-style: italic;
699 background-color: #FAFAFA;
700 border-top: 1px none #E0E0E0;
701 border-right: 1px none #E0E0E0;
702 border-bottom: 1px none #E0E0E0;
703 border-left: 1px none #E0E0E0;
704 margin: 0px;
705}
706.mdescRight {
707 padding: 0px 8px 4px 8px;
708 font-size: 80%;
709 font-style: italic;
710 background-color: #FAFAFA;
711 border-top: 1px none #E0E0E0;
712 border-right: 1px none #E0E0E0;
713 border-bottom: 1px none #E0E0E0;
714 border-left: 1px none #E0E0E0;
715 margin: 0px;
716}
717.memItemLeft {
718 padding: 1px 0px 0px 8px;
719 margin: 4px;
720 border-top-width: 1px;
721 border-right-width: 1px;
722 border-bottom-width: 1px;
723 border-left-width: 1px;
724 border-top-color: #E0E0E0;
725 border-right-color: #E0E0E0;
726 border-bottom-color: #E0E0E0;
727 border-left-color: #E0E0E0;
728 border-top-style: solid;
729 border-right-style: none;
730 border-bottom-style: none;
731 border-left-style: none;
732 background-color: #FAFAFA;
733 font-size: 80%;
734}
735.memItemRight {
736 padding: 1px 8px 0px 8px;
737 margin: 4px;
738 border-top-width: 1px;
739 border-right-width: 1px;
740 border-bottom-width: 1px;
741 border-left-width: 1px;
742 border-top-color: #E0E0E0;
743 border-right-color: #E0E0E0;
744 border-bottom-color: #E0E0E0;
745 border-left-color: #E0E0E0;
746 border-top-style: solid;
747 border-right-style: none;
748 border-bottom-style: none;
749 border-left-style: none;
750 background-color: #FAFAFA;
751 font-size: 80%;
752}
753.memTemplItemLeft {
754 padding: 1px 0px 0px 8px;
755 margin: 4px;
756 border-top-width: 1px;
757 border-right-width: 1px;
758 border-bottom-width: 1px;
759 border-left-width: 1px;
760 border-top-color: #E0E0E0;
761 border-right-color: #E0E0E0;
762 border-bottom-color: #E0E0E0;
763 border-left-color: #E0E0E0;
764 border-top-style: none;
765 border-right-style: none;
766 border-bottom-style: none;
767 border-left-style: none;
768 background-color: #FAFAFA;
769 font-size: 80%;
770}
771.memTemplItemRight {
772 padding: 1px 8px 0px 8px;
773 margin: 4px;
774 border-top-width: 1px;
775 border-right-width: 1px;
776 border-bottom-width: 1px;
777 border-left-width: 1px;
778 border-top-color: #E0E0E0;
779 border-right-color: #E0E0E0;
780 border-bottom-color: #E0E0E0;
781 border-left-color: #E0E0E0;
782 border-top-style: none;
783 border-right-style: none;
784 border-bottom-style: none;
785 border-left-style: none;
786 background-color: #FAFAFA;
787 font-size: 80%;
788}
789.memTemplParams {
790 padding: 1px 0px 0px 8px;
791 margin: 4px;
792 border-top-width: 1px;
793 border-right-width: 1px;
794 border-bottom-width: 1px;
795 border-left-width: 1px;
796 border-top-color: #E0E0E0;
797 border-right-color: #E0E0E0;
798 border-bottom-color: #E0E0E0;
799 border-left-color: #E0E0E0;
800 border-top-style: solid;
801 border-right-style: none;
802 border-bottom-style: none;
803 border-left-style: none;
804 color: #606060;
805 background-color: #FAFAFA;
806 font-size: 80%;
807}
808.search {
809 color: #003399;
810 font-weight: bold;
811}
812FORM.search {
813 margin-bottom: 0px;
814 margin-top: 0px;
815}
816INPUT.search {
817 font-size: 75%;
818 color: #000080;
819 font-weight: normal;
820 background-color: #e8eef2;
821}
822TD.tiny {
823 font-size: 75%;
824}
825a {
826 color: #1A41A8;
827}
828a:visited {
829 color: #2A3798;
830}
831.dirtab {
832 padding: 4px;
833 border-collapse: collapse;
834 border: 1px solid #84b0c7;
835}
836TH.dirtab {
837 background: #e8eef2;
838 font-weight: bold;
839}
840HR {
841 height: 1px;
842 border: none;
843 border-top: 1px solid black;
844}
845
846/* Style for detailed member documentation */
847.memtemplate {
848 font-size: 80%;
849 color: #606060;
850 font-weight: normal;
851 margin-left: 3px;
852}
853.memnav {
854 background-color: #e8eef2;
855 border: 1px solid #84b0c7;
856 text-align: center;
857 margin: 2px;
858 margin-right: 15px;
859 padding: 2px;
860}
861.memitem {
862 padding: 4px;
863 background-color: #eef3f5;
864 border-width: 1px;
865 border-style: solid;
866 border-color: #dedeee;
867 -moz-border-radius: 8px 8px 8px 8px;
868}
869.memname {
870 white-space: nowrap;
871 font-weight: bold;
872}
873.memdoc{
874 padding-left: 10px;
875}
876.memproto {
877 background-color: #d5e1e8;
878 width: 100%;
879 border-width: 1px;
880 border-style: solid;
881 border-color: #84b0c7;
882 font-weight: bold;
883 -moz-border-radius: 8px 8px 8px 8px;
884}
885.paramkey {
886 text-align: right;
887}
888.paramtype {
889 white-space: nowrap;
890}
891.paramname {
892 color: #602020;
893 font-style: italic;
894 white-space: nowrap;
895}
896/* End Styling for detailed member documentation */
897
898/* for the tree view */
899.ftvtree {
900 font-family: sans-serif;
901 margin:0.5em;
902}
903/* these are for tree view when used as main index */
904.directory {
905 font-size: 9pt;
906 font-weight: bold;
907}
908.directory h3 {
909 margin: 0px;
910 margin-top: 1em;
911 font-size: 11pt;
912}
913
914/* The following two styles can be used to replace the root node title */
915/* with an image of your choice. Simply uncomment the next two styles, */
916/* specify the name of your image and be sure to set 'height' to the */
917/* proper pixel height of your image. */
918
919/* .directory h3.swap { */
920/* height: 61px; */
921/* background-repeat: no-repeat; */
922/* background-image: url("yourimage.gif"); */
923/* } */
924/* .directory h3.swap span { */
925/* display: none; */
926/* } */
927
928.directory > h3 {
929 margin-top: 0;
930}
931.directory p {
932 margin: 0px;
933 white-space: nowrap;
934}
935.directory div {
936 display: none;
937 margin: 0px;
938}
939.directory img {
940 vertical-align: -30%;
941}
942/* these are for tree view when not used as main index */
943.directory-alt {
944 font-size: 100%;
945 font-weight: bold;
946}
947.directory-alt h3 {
948 margin: 0px;
949 margin-top: 1em;
950 font-size: 11pt;
951}
952.directory-alt > h3 {
953 margin-top: 0;
954}
955.directory-alt p {
956 margin: 0px;
957 white-space: nowrap;
958}
959.directory-alt div {
960 display: none;
961 margin: 0px;
962}
963.directory-alt img {
964 vertical-align: -30%;
965}
966
diff --git a/libraries/embryo/doc/img/foot_bg.png b/libraries/embryo/doc/img/foot_bg.png
new file mode 100644
index 0000000..b24f3a4
--- /dev/null
+++ b/libraries/embryo/doc/img/foot_bg.png
Binary files differ
diff --git a/libraries/embryo/doc/img/head_bg.png b/libraries/embryo/doc/img/head_bg.png
new file mode 100644
index 0000000..081dc13
--- /dev/null
+++ b/libraries/embryo/doc/img/head_bg.png
Binary files differ
diff --git a/libraries/embryo/doc/img/hilite.png b/libraries/embryo/doc/img/hilite.png
new file mode 100644
index 0000000..88a4381
--- /dev/null
+++ b/libraries/embryo/doc/img/hilite.png
Binary files differ
diff --git a/libraries/embryo/doc/img/menu_bg.png b/libraries/embryo/doc/img/menu_bg.png
new file mode 100644
index 0000000..e978743
--- /dev/null
+++ b/libraries/embryo/doc/img/menu_bg.png
Binary files differ
diff --git a/libraries/embryo/doc/img/menu_bg_current.png b/libraries/embryo/doc/img/menu_bg_current.png
new file mode 100644
index 0000000..de97c92
--- /dev/null
+++ b/libraries/embryo/doc/img/menu_bg_current.png
Binary files differ
diff --git a/libraries/embryo/doc/img/menu_bg_hover.png b/libraries/embryo/doc/img/menu_bg_hover.png
new file mode 100644
index 0000000..3fd851d
--- /dev/null
+++ b/libraries/embryo/doc/img/menu_bg_hover.png
Binary files differ
diff --git a/libraries/embryo/doc/img/menu_bg_last.png b/libraries/embryo/doc/img/menu_bg_last.png
new file mode 100644
index 0000000..88c116c
--- /dev/null
+++ b/libraries/embryo/doc/img/menu_bg_last.png
Binary files differ
diff --git a/libraries/embryo/doc/img/menu_bg_unsel.png b/libraries/embryo/doc/img/menu_bg_unsel.png
new file mode 100644
index 0000000..50e5fd8
--- /dev/null
+++ b/libraries/embryo/doc/img/menu_bg_unsel.png
Binary files differ
diff --git a/libraries/embryo/embryo.pc.in b/libraries/embryo/embryo.pc.in
new file mode 100644
index 0000000..540f27c
--- /dev/null
+++ b/libraries/embryo/embryo.pc.in
@@ -0,0 +1,15 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5datarootdir=@datarootdir@
6datadir=@datadir@/@PACKAGE@
7embryoincludedir=@embryoincludedir@
8
9Name: embryo
10Description: A small virtual machine engine and bytecode compiler
11@pkgconfig_requires_private@: @requirement_embryo@
12Version: @VERSION@
13Libs: -L${libdir} -lembryo
14Libs.private: @EFL_FNMATCH_LIBS@ -lm
15Cflags: -I${includedir}/embryo-@VMAJ@
diff --git a/libraries/embryo/embryo.spec b/libraries/embryo/embryo.spec
new file mode 100644
index 0000000..aba0f0e
--- /dev/null
+++ b/libraries/embryo/embryo.spec
@@ -0,0 +1,77 @@
1%define _missing_doc_files_terminate_build 0
2
3%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}}
4
5Summary: A small virtual machine engine (in a library) and bytecode compiler
6Name: embryo
7Version: 1.1.0
8Release: %{_rel}
9License: BSD
10Group: System Environment/Libraries
11Source: %{name}-%{version}.tar.gz
12Packager: %{?_packager:%{_packager}}%{!?_packager:Michael Jennings <mej@eterm.org>}
13Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project (http://www.enlightenment.org/)}
14Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
15URL: http://www.enlightenment.org/
16BuildRoot: %{_tmppath}/%{name}-%{version}-root
17
18%description
19Embryo is a tiny library designed as a virtual machine to interpret a
20limited set of small compiled programs.
21
22%package devel
23Summary: Embryo headers, static libraries, documentation and test programs
24Group: System Environment/Libraries
25Requires: %{name} = %{version}
26
27%description devel
28Headers, static libraries, test programs and documentation for Embryo
29
30%package bin
31Summary: Embryo bytecode compiler and needed data files
32Group: System Environment/Libraries
33Requires: %{name} = %{version}
34
35%description bin
36The embryo bytecode compiler and its files
37
38%prep
39%setup -q
40
41%build
42%{configure} --prefix=%{_prefix}
43### use this if you have build problems
44#./configure --prefix=%{_prefix}
45%{__make} %{?_smp_mflags} %{?mflags}
46
47%install
48%{__make} %{?mflags_install} DESTDIR=$RPM_BUILD_ROOT install
49
50%clean
51test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
52
53%post
54/sbin/ldconfig
55
56%postun
57/sbin/ldconfig
58
59%files
60%defattr(-, root, root)
61%doc AUTHORS COPYING* README
62%{_libdir}/*.so.*
63
64%files bin
65%defattr(-, root, root)
66%attr(755,root,root) %{_bindir}/embryo_cc
67%{_datadir}/embryo/include
68
69%files devel
70%defattr(-, root, root)
71%{_libdir}/*.so
72%{_libdir}/*.la
73%{_libdir}/*.a
74%{_libdir}/pkgconfig/*
75%{_includedir}/embryo-1/*.h
76
77%changelog
diff --git a/libraries/embryo/embryo.spec.in b/libraries/embryo/embryo.spec.in
new file mode 100644
index 0000000..4c37ede
--- /dev/null
+++ b/libraries/embryo/embryo.spec.in
@@ -0,0 +1,77 @@
1%define _missing_doc_files_terminate_build 0
2
3%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}}
4
5Summary: A small virtual machine engine (in a library) and bytecode compiler
6Name: @PACKAGE@
7Version: @VERSION@
8Release: %{_rel}
9License: BSD
10Group: System Environment/Libraries
11Source: %{name}-%{version}.tar.gz
12Packager: %{?_packager:%{_packager}}%{!?_packager:Michael Jennings <mej@eterm.org>}
13Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project (http://www.enlightenment.org/)}
14Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
15URL: http://www.enlightenment.org/
16BuildRoot: %{_tmppath}/%{name}-%{version}-root
17
18%description
19Embryo is a tiny library designed as a virtual machine to interpret a
20limited set of small compiled programs.
21
22%package devel
23Summary: Embryo headers, static libraries, documentation and test programs
24Group: System Environment/Libraries
25Requires: %{name} = %{version}
26
27%description devel
28Headers, static libraries, test programs and documentation for Embryo
29
30%package bin
31Summary: Embryo bytecode compiler and needed data files
32Group: System Environment/Libraries
33Requires: %{name} = %{version}
34
35%description bin
36The embryo bytecode compiler and its files
37
38%prep
39%setup -q
40
41%build
42%{configure} --prefix=%{_prefix}
43### use this if you have build problems
44#./configure --prefix=%{_prefix}
45%{__make} %{?_smp_mflags} %{?mflags}
46
47%install
48%{__make} %{?mflags_install} DESTDIR=$RPM_BUILD_ROOT install
49
50%clean
51test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
52
53%post
54/sbin/ldconfig
55
56%postun
57/sbin/ldconfig
58
59%files
60%defattr(-, root, root)
61%doc AUTHORS COPYING* README
62%{_libdir}/*.so.*
63
64%files bin
65%defattr(-, root, root)
66%attr(755,root,root) %{_bindir}/embryo_cc
67%{_datadir}/embryo/include
68
69%files devel
70%defattr(-, root, root)
71%{_libdir}/*.so
72%{_libdir}/*.la
73%{_libdir}/*.a
74%{_libdir}/pkgconfig/*
75%{_includedir}/embryo-1/*.h
76
77%changelog
diff --git a/libraries/embryo/include/Makefile.am b/libraries/embryo/include/Makefile.am
new file mode 100644
index 0000000..006ee14
--- /dev/null
+++ b/libraries/embryo/include/Makefile.am
@@ -0,0 +1,7 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3filesdir = $(datadir)/embryo/include
4files_DATA = \
5default.inc
6
7EXTRA_DIST = $(files_DATA)
diff --git a/libraries/embryo/include/Makefile.in b/libraries/embryo/include/Makefile.in
new file mode 100644
index 0000000..a5456cd
--- /dev/null
+++ b/libraries/embryo/include/Makefile.in
@@ -0,0 +1,439 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = include
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
41 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
42 $(top_srcdir)/m4/efl_fnmatch.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
44 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
45 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
46 $(top_srcdir)/configure.ac
47am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
48 $(ACLOCAL_M4)
49mkinstalldirs = $(install_sh) -d
50CONFIG_HEADER = $(top_builddir)/config.h
51CONFIG_CLEAN_FILES =
52CONFIG_CLEAN_VPATH_FILES =
53AM_V_GEN = $(am__v_GEN_$(V))
54am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
55am__v_GEN_0 = @echo " GEN " $@;
56AM_V_at = $(am__v_at_$(V))
57am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
58am__v_at_0 = @
59SOURCES =
60DIST_SOURCES =
61am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
62am__vpath_adj = case $$p in \
63 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
64 *) f=$$p;; \
65 esac;
66am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
67am__install_max = 40
68am__nobase_strip_setup = \
69 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
70am__nobase_strip = \
71 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
72am__nobase_list = $(am__nobase_strip_setup); \
73 for p in $$list; do echo "$$p $$p"; done | \
74 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
75 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
76 if (++n[$$2] == $(am__install_max)) \
77 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
78 END { for (dir in files) print dir, files[dir] }'
79am__base_list = \
80 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
81 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
82am__installdirs = "$(DESTDIR)$(filesdir)"
83DATA = $(files_DATA)
84DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
85ACLOCAL = @ACLOCAL@
86ALLOCA = @ALLOCA@
87AMTAR = @AMTAR@
88AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
89AR = @AR@
90AS = @AS@
91AUTOCONF = @AUTOCONF@
92AUTOHEADER = @AUTOHEADER@
93AUTOMAKE = @AUTOMAKE@
94AWK = @AWK@
95CC = @CC@
96CCDEPMODE = @CCDEPMODE@
97CFLAGS = @CFLAGS@
98CPP = @CPP@
99CPPFLAGS = @CPPFLAGS@
100CYGPATH_W = @CYGPATH_W@
101DEFS = @DEFS@
102DEPDIR = @DEPDIR@
103DLLTOOL = @DLLTOOL@
104DSYMUTIL = @DSYMUTIL@
105DUMPBIN = @DUMPBIN@
106ECHO_C = @ECHO_C@
107ECHO_N = @ECHO_N@
108ECHO_T = @ECHO_T@
109EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
110EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
111EGREP = @EGREP@
112EINA_CFLAGS = @EINA_CFLAGS@
113EINA_LIBS = @EINA_LIBS@
114EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
115EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
116EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
117EVIL_CFLAGS = @EVIL_CFLAGS@
118EVIL_LIBS = @EVIL_LIBS@
119EXEEXT = @EXEEXT@
120FGREP = @FGREP@
121GREP = @GREP@
122INSTALL = @INSTALL@
123INSTALL_DATA = @INSTALL_DATA@
124INSTALL_PROGRAM = @INSTALL_PROGRAM@
125INSTALL_SCRIPT = @INSTALL_SCRIPT@
126INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
127LD = @LD@
128LDFLAGS = @LDFLAGS@
129LIBOBJS = @LIBOBJS@
130LIBS = @LIBS@
131LIBTOOL = @LIBTOOL@
132LIPO = @LIPO@
133LN_S = @LN_S@
134LTLIBOBJS = @LTLIBOBJS@
135MAKEINFO = @MAKEINFO@
136MKDIR_P = @MKDIR_P@
137NM = @NM@
138NMEDIT = @NMEDIT@
139OBJDUMP = @OBJDUMP@
140OBJEXT = @OBJEXT@
141OTOOL = @OTOOL@
142OTOOL64 = @OTOOL64@
143PACKAGE = @PACKAGE@
144PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
145PACKAGE_NAME = @PACKAGE_NAME@
146PACKAGE_STRING = @PACKAGE_STRING@
147PACKAGE_TARNAME = @PACKAGE_TARNAME@
148PACKAGE_URL = @PACKAGE_URL@
149PACKAGE_VERSION = @PACKAGE_VERSION@
150PATH_SEPARATOR = @PATH_SEPARATOR@
151PKG_CONFIG = @PKG_CONFIG@
152PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
153PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
154RANLIB = @RANLIB@
155SED = @SED@
156SET_MAKE = @SET_MAKE@
157SHELL = @SHELL@
158STRIP = @STRIP@
159VERSION = @VERSION@
160VMAJ = @VMAJ@
161abs_builddir = @abs_builddir@
162abs_srcdir = @abs_srcdir@
163abs_top_builddir = @abs_top_builddir@
164abs_top_srcdir = @abs_top_srcdir@
165ac_ct_CC = @ac_ct_CC@
166ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
167am__include = @am__include@
168am__leading_dot = @am__leading_dot@
169am__quote = @am__quote@
170am__tar = @am__tar@
171am__untar = @am__untar@
172bindir = @bindir@
173build = @build@
174build_alias = @build_alias@
175build_cpu = @build_cpu@
176build_os = @build_os@
177build_vendor = @build_vendor@
178builddir = @builddir@
179datadir = @datadir@
180datarootdir = @datarootdir@
181docdir = @docdir@
182dvidir = @dvidir@
183efl_doxygen = @efl_doxygen@
184efl_have_doxygen = @efl_have_doxygen@
185embryoincludedir = @embryoincludedir@
186exec_prefix = @exec_prefix@
187host = @host@
188host_alias = @host_alias@
189host_cpu = @host_cpu@
190host_os = @host_os@
191host_vendor = @host_vendor@
192htmldir = @htmldir@
193includedir = @includedir@
194infodir = @infodir@
195install_sh = @install_sh@
196libdir = @libdir@
197libexecdir = @libexecdir@
198localedir = @localedir@
199localstatedir = @localstatedir@
200lt_ECHO = @lt_ECHO@
201lt_enable_auto_import = @lt_enable_auto_import@
202mandir = @mandir@
203mkdir_p = @mkdir_p@
204oldincludedir = @oldincludedir@
205pdfdir = @pdfdir@
206pkgconfig_requires_private = @pkgconfig_requires_private@
207prefix = @prefix@
208program_transform_name = @program_transform_name@
209psdir = @psdir@
210release_info = @release_info@
211requirement_embryo = @requirement_embryo@
212sbindir = @sbindir@
213sharedstatedir = @sharedstatedir@
214srcdir = @srcdir@
215sysconfdir = @sysconfdir@
216target_alias = @target_alias@
217top_build_prefix = @top_build_prefix@
218top_builddir = @top_builddir@
219top_srcdir = @top_srcdir@
220version_info = @version_info@
221MAINTAINERCLEANFILES = Makefile.in
222filesdir = $(datadir)/embryo/include
223files_DATA = \
224default.inc
225
226EXTRA_DIST = $(files_DATA)
227all: all-am
228
229.SUFFIXES:
230$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
231 @for dep in $?; do \
232 case '$(am__configure_deps)' in \
233 *$$dep*) \
234 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
235 && { if test -f $@; then exit 0; else break; fi; }; \
236 exit 1;; \
237 esac; \
238 done; \
239 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
240 $(am__cd) $(top_srcdir) && \
241 $(AUTOMAKE) --gnu include/Makefile
242.PRECIOUS: Makefile
243Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
244 @case '$?' in \
245 *config.status*) \
246 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
247 *) \
248 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
249 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
250 esac;
251
252$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
253 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
254
255$(top_srcdir)/configure: $(am__configure_deps)
256 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
257$(ACLOCAL_M4): $(am__aclocal_m4_deps)
258 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
259$(am__aclocal_m4_deps):
260
261mostlyclean-libtool:
262 -rm -f *.lo
263
264clean-libtool:
265 -rm -rf .libs _libs
266install-filesDATA: $(files_DATA)
267 @$(NORMAL_INSTALL)
268 test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)"
269 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
270 for p in $$list; do \
271 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
272 echo "$$d$$p"; \
273 done | $(am__base_list) | \
274 while read files; do \
275 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \
276 $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \
277 done
278
279uninstall-filesDATA:
280 @$(NORMAL_UNINSTALL)
281 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
282 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
283 test -n "$$files" || exit 0; \
284 echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \
285 cd "$(DESTDIR)$(filesdir)" && rm -f $$files
286tags: TAGS
287TAGS:
288
289ctags: CTAGS
290CTAGS:
291
292
293distdir: $(DISTFILES)
294 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
295 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
296 list='$(DISTFILES)'; \
297 dist_files=`for file in $$list; do echo $$file; done | \
298 sed -e "s|^$$srcdirstrip/||;t" \
299 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
300 case $$dist_files in \
301 */*) $(MKDIR_P) `echo "$$dist_files" | \
302 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
303 sort -u` ;; \
304 esac; \
305 for file in $$dist_files; do \
306 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
307 if test -d $$d/$$file; then \
308 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
309 if test -d "$(distdir)/$$file"; then \
310 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
311 fi; \
312 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
313 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
314 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
315 fi; \
316 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
317 else \
318 test -f "$(distdir)/$$file" \
319 || cp -p $$d/$$file "$(distdir)/$$file" \
320 || exit 1; \
321 fi; \
322 done
323check-am: all-am
324check: check-am
325all-am: Makefile $(DATA)
326installdirs:
327 for dir in "$(DESTDIR)$(filesdir)"; do \
328 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
329 done
330install: install-am
331install-exec: install-exec-am
332install-data: install-data-am
333uninstall: uninstall-am
334
335install-am: all-am
336 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
337
338installcheck: installcheck-am
339install-strip:
340 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
341 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
342 `test -z '$(STRIP)' || \
343 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
344mostlyclean-generic:
345
346clean-generic:
347
348distclean-generic:
349 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
350 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
351
352maintainer-clean-generic:
353 @echo "This command is intended for maintainers to use"
354 @echo "it deletes files that may require special tools to rebuild."
355 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
356clean: clean-am
357
358clean-am: clean-generic clean-libtool mostlyclean-am
359
360distclean: distclean-am
361 -rm -f Makefile
362distclean-am: clean-am distclean-generic
363
364dvi: dvi-am
365
366dvi-am:
367
368html: html-am
369
370html-am:
371
372info: info-am
373
374info-am:
375
376install-data-am: install-filesDATA
377
378install-dvi: install-dvi-am
379
380install-dvi-am:
381
382install-exec-am:
383
384install-html: install-html-am
385
386install-html-am:
387
388install-info: install-info-am
389
390install-info-am:
391
392install-man:
393
394install-pdf: install-pdf-am
395
396install-pdf-am:
397
398install-ps: install-ps-am
399
400install-ps-am:
401
402installcheck-am:
403
404maintainer-clean: maintainer-clean-am
405 -rm -f Makefile
406maintainer-clean-am: distclean-am maintainer-clean-generic
407
408mostlyclean: mostlyclean-am
409
410mostlyclean-am: mostlyclean-generic mostlyclean-libtool
411
412pdf: pdf-am
413
414pdf-am:
415
416ps: ps-am
417
418ps-am:
419
420uninstall-am: uninstall-filesDATA
421
422.MAKE: install-am install-strip
423
424.PHONY: all all-am check check-am clean clean-generic clean-libtool \
425 distclean distclean-generic distclean-libtool distdir dvi \
426 dvi-am html html-am info info-am install install-am \
427 install-data install-data-am install-dvi install-dvi-am \
428 install-exec install-exec-am install-filesDATA install-html \
429 install-html-am install-info install-info-am install-man \
430 install-pdf install-pdf-am install-ps install-ps-am \
431 install-strip installcheck installcheck-am installdirs \
432 maintainer-clean maintainer-clean-generic mostlyclean \
433 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
434 uninstall uninstall-am uninstall-filesDATA
435
436
437# Tell versions [3.59,3.63) of GNU make to not export all variables.
438# Otherwise a system limit (for SysV at least) may be exceeded.
439.NOEXPORT:
diff --git a/libraries/embryo/include/default.inc b/libraries/embryo/include/default.inc
new file mode 100644
index 0000000..0733503
--- /dev/null
+++ b/libraries/embryo/include/default.inc
@@ -0,0 +1,213 @@
1/* Float arithmetic
2 *
3 * (c) Copyright 1999, Artran, Inc.
4 * Written by Greg Garner (gmg@artran.com)
5 * Modified in March 2001 to include user defined
6 * operators for the floating point functions.
7 * (c) Copyright 2004, Carsten Haitzler
8 * Modified March 2004 by Carsten Haitzler <raster@rasterman.com> to conform
9 * to E coding style
10 * Became default include for embryo...
11 * Added string functions
12 * Added rand functions
13 * Added time functions
14 *
15 * This file is provided as is (no warranties).
16 */
17#if defined DEFAULT_INC
18#endinput
19#endif
20#define DEFAULT_INC
21
22#pragma rational Float
23
24#define PI 3.1415926535897932384626433832795
25
26/* Different methods of rounding */
27enum Float_Round_Method
28{
29 ROUND, FLOOR, CEIL, TOZERO
30};
31/* different angle addressing modes (default is radians) */
32enum Float_Angle_Mode
33{
34 RADIAN, DEGREES, GRADES
35};
36
37/* varags - get numebr of args to a function */
38native numargs();
39/* varags - get arg no "arg" */
40native getarg(arg, index=0);
41native getsarg(arg, buf[], buflen);
42native Float:getfarg(arg, index=0);
43/* varags - set arg no "arg" */
44native setarg(arg, index=0, value);
45native setfarg(arg, index=0, Float:value);
46
47/* Convert a string into a floating point value */
48native Float:atof(const string[]);
49/* Return the fractional part of a float */
50native Float:fract(Float:value);
51/* Round a float into a integer value */
52native round(Float:value, Float_Round_Method:method=ROUND);
53/* Return the square root of value, same as float_power(value, 0.5) */
54native Float:sqrt(Float:value);
55/* Return the value raised to the power of the exponent */
56native Float:pow(Float:value, Float:exponent);
57/* Return the logarithm */
58native Float:log(Float:value, Float:base=10.0);
59/* Return the sine, cosine or tangent. The input angle may be in radian*/
60/* degrees or grades. */
61native Float:sin(Float:value, Float_Angle_Mode:mode=RADIAN);
62native Float:cos(Float:value, Float_Angle_Mode:mode=RADIAN);
63native Float:tan(Float:value, Float_Angle_Mode:mode=RADIAN);
64/* Return the absolute value */
65native Float:abs(Float:value);
66/* return integer from string */
67native atoi(str[]);
68/* return 0 if string matches glob, non-zero otherwise */
69native fnmatch(glob[], str[]);
70/* same as strcmp() */
71native strcmp(str1[], str2[]);
72/* same as strncmp */
73native strncmp(str1[], str2[], n);
74/* same as strcpy */
75native strcpy(dst[], src[]);
76/* same as strncpy except it nul terminates */
77native strncpy(dst[], src[], n);
78/* same as strlen */
79native strlen(str[]);
80/* same as strcat */
81native strcat(dst[], src[]);
82/* same as strncat except it nul terminates */
83native strncat(dst[], src[], n);
84/* prepends src string onto start of dst string */
85native strprep(dst[], src[]);
86/* prepends at most n chars from src string onto dst string */
87native strnprep(dst[], src[], n);
88/* cuts chars from char n to (not including) n2, and puts them in str */
89native strcut(dst[], str[], n, n2);
90/* same as snprintf, except only supports %%, %c, %i, %d, %f, %x, %X, %s, \n and \t */
91native snprintf(dst[], dstn, fmt[], ...);
92/* same as strstr */
93native strstr(str[], ndl[]);
94/* same as strchr, except ch must be a 1 charater long string, and returns string index */
95native strchr(str[], ch[]);
96/* same as strrchr, except ch must be a 1 charater long string and returns string index */
97native strrchr(str[], ch[]);
98/* return random number 0 - 65535 */
99native rand();
100/* return random number 0.0 - 1.0 */
101native Float:randf();
102/* return seconds since midnight as a float */
103native Float:seconds();
104/* return the current date, year, time etc. in the variables provided */
105native date(&year, &month, &day, &yearday, &weekday, &hr, &min, &Float:sec);
106
107/*****************************************************************************/
108/*****************************************************************************/
109/*****************************************************************************/
110/*****************************************************************************/
111/*****************************************************************************/
112/*****************************************************************************/
113/*****************************************************************************/
114/*****************************************************************************/
115/*****************************************************************************/
116/*****************************************************************************/
117/*****************************************************************************/
118/*****************************************************************************/
119/*****************************************************************************/
120/*****************************************************************************/
121/*****************************************************************************/
122/*****************************************************************************/
123/*****************************************************************************/
124/*****************************************************************************/
125/*****************************************************************************/
126/*****************************************************************************/
127/*****************************************************************************/
128/*****************************************************************************/
129/*****************************************************************************/
130/*****************************************************************************/
131/*****************************************************************************/
132/*****************************************************************************/
133
134/**************************************************/
135/* Hidden calls - all are overloaded on operators */
136/**************************************************/
137
138/* Convert an integer into a floating point value */
139native Float:float(value);
140/* Multiple two floats together */
141native Float:float_mul(Float:oper1, Float:oper2);
142/* Divide the dividend float by the divisor float */
143native Float:float_div(Float:dividend, Float:divisor);
144/* Add two floats together */
145native Float:float_add(Float:oper1, Float:oper2);
146/* Subtract oper2 float from oper1 float */
147native Float:float_sub(Float:oper1, Float:oper2);
148/* Compare two integers. If the two elements are equal, return 0. */
149/* If the first argument is greater than the second argument, return 1, */
150/* If the first argument is less than the second argument, return -1. */
151native float_cmp(Float:oper1, Float:oper2);
152/* user defined operators */
153native Float:operator*(Float:oper1, Float:oper2) = float_mul;
154native Float:operator/(Float:oper1, Float:oper2) = float_div;
155native Float:operator+(Float:oper1, Float:oper2) = float_add;
156native Float:operator-(Float:oper1, Float:oper2) = float_sub;
157native Float:operator=(oper) = float;
158stock Float:operator++(Float:oper)
159 return oper+1.0;
160stock Float:operator--(Float:oper)
161 return oper-1.0;
162stock Float:operator-(Float:oper)
163 return oper^Float:0x80000000; /* IEEE values are sign/magnitude */
164stock Float:operator*(Float:oper1, oper2)
165 return float_mul(oper1, float(oper2)); /* "*" is commutative */
166stock Float:operator/(Float:oper1, oper2)
167 return float_div(oper1, float(oper2));
168stock Float:operator/(oper1, Float:oper2)
169 return float_div(float(oper1), oper2);
170stock Float:operator+(Float:oper1, oper2)
171 return float_add(oper1, float(oper2)); /* "+" is commutative */
172stock Float:operator-(Float:oper1, oper2)
173 return float_sub(oper1, float(oper2));
174stock Float:operator-(oper1, Float:oper2)
175 return float_sub(float(oper1), oper2);
176stock bool:operator==(Float:oper1, Float:oper2)
177 return float_cmp(oper1, oper2) == 0;
178stock bool:operator==(Float:oper1, oper2)
179 return float_cmp(oper1, float(oper2)) == 0; /* "==" is commutative */
180stock bool:operator!=(Float:oper1, Float:oper2)
181 return float_cmp(oper1, oper2) != 0;
182stock bool:operator!=(Float:oper1, oper2)
183 return float_cmp(oper1, float(oper2)) != 0; /* "!=" is commutative */
184stock bool:operator>(Float:oper1, Float:oper2)
185 return float_cmp(oper1, oper2) > 0;
186stock bool:operator>(Float:oper1, oper2)
187 return float_cmp(oper1, float(oper2)) > 0;
188stock bool:operator>(oper1, Float:oper2)
189 return float_cmp(float(oper1), oper2) > 0;
190stock bool:operator>=(Float:oper1, Float:oper2)
191 return float_cmp(oper1, oper2) >= 0;
192stock bool:operator>=(Float:oper1, oper2)
193 return float_cmp(oper1, float(oper2)) >= 0;
194stock bool:operator>=(oper1, Float:oper2)
195 return float_cmp(float(oper1), oper2) >= 0;
196stock bool:operator<(Float:oper1, Float:oper2)
197 return float_cmp(oper1, oper2) < 0;
198stock bool:operator<(Float:oper1, oper2)
199 return float_cmp(oper1, float(oper2)) < 0;
200stock bool:operator<(oper1, Float:oper2)
201 return float_cmp(float(oper1), oper2) < 0;
202stock bool:operator<=(Float:oper1, Float:oper2)
203 return float_cmp(oper1, oper2) <= 0;
204stock bool:operator<=(Float:oper1, oper2)
205 return float_cmp(oper1, float(oper2)) <= 0;
206stock bool:operator<=(oper1, Float:oper2)
207 return float_cmp(float(oper1), oper2) <= 0;
208stock bool:operator!(Float:oper)
209 return (_:oper & 0x7fffffff) == 0;
210/* forbidden operations */
211forward operator%(Float:oper1, Float:oper2);
212forward operator%(Float:oper1, oper2);
213forward operator%(oper1, Float:oper2);
diff --git a/libraries/embryo/install-sh b/libraries/embryo/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/libraries/embryo/install-sh
@@ -0,0 +1,520 @@
1#!/bin/sh
2# install - install a program, script, or datafile
3
4scriptversion=2009-04-28.21; # UTC
5
6# This originates from X11R5 (mit/util/scripts/install.sh), which was
7# later released in X11R6 (xc/config/util/install.sh) with the
8# following copyright and license.
9#
10# Copyright (C) 1994 X Consortium
11#
12# Permission is hereby granted, free of charge, to any person obtaining a copy
13# of this software and associated documentation files (the "Software"), to
14# deal in the Software without restriction, including without limitation the
15# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16# sell copies of the Software, and to permit persons to whom the Software is
17# furnished to do so, subject to the following conditions:
18#
19# The above copyright notice and this permission notice shall be included in
20# all copies or substantial portions of the Software.
21#
22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
27# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28#
29# Except as contained in this notice, the name of the X Consortium shall not
30# be used in advertising or otherwise to promote the sale, use or other deal-
31# ings in this Software without prior written authorization from the X Consor-
32# tium.
33#
34#
35# FSF changes to this file are in the public domain.
36#
37# Calling this script install-sh is preferred over install.sh, to prevent
38# `make' implicit rules from creating a file called install from it
39# when there is no Makefile.
40#
41# This script is compatible with the BSD install script, but was written
42# from scratch.
43
44nl='
45'
46IFS=" "" $nl"
47
48# set DOITPROG to echo to test this script
49
50# Don't use :- since 4.3BSD and earlier shells don't like it.
51doit=${DOITPROG-}
52if test -z "$doit"; then
53 doit_exec=exec
54else
55 doit_exec=$doit
56fi
57
58# Put in absolute file names if you don't have them in your path;
59# or use environment vars.
60
61chgrpprog=${CHGRPPROG-chgrp}
62chmodprog=${CHMODPROG-chmod}
63chownprog=${CHOWNPROG-chown}
64cmpprog=${CMPPROG-cmp}
65cpprog=${CPPROG-cp}
66mkdirprog=${MKDIRPROG-mkdir}
67mvprog=${MVPROG-mv}
68rmprog=${RMPROG-rm}
69stripprog=${STRIPPROG-strip}
70
71posix_glob='?'
72initialize_posix_glob='
73 test "$posix_glob" != "?" || {
74 if (set -f) 2>/dev/null; then
75 posix_glob=
76 else
77 posix_glob=:
78 fi
79 }
80'
81
82posix_mkdir=
83
84# Desired mode of installed file.
85mode=0755
86
87chgrpcmd=
88chmodcmd=$chmodprog
89chowncmd=
90mvcmd=$mvprog
91rmcmd="$rmprog -f"
92stripcmd=
93
94src=
95dst=
96dir_arg=
97dst_arg=
98
99copy_on_change=false
100no_target_directory=
101
102usage="\
103Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
104 or: $0 [OPTION]... SRCFILES... DIRECTORY
105 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
106 or: $0 [OPTION]... -d DIRECTORIES...
107
108In the 1st form, copy SRCFILE to DSTFILE.
109In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
110In the 4th, create DIRECTORIES.
111
112Options:
113 --help display this help and exit.
114 --version display version info and exit.
115
116 -c (ignored)
117 -C install only if different (preserve the last data modification time)
118 -d create directories instead of installing files.
119 -g GROUP $chgrpprog installed files to GROUP.
120 -m MODE $chmodprog installed files to MODE.
121 -o USER $chownprog installed files to USER.
122 -s $stripprog installed files.
123 -t DIRECTORY install into DIRECTORY.
124 -T report an error if DSTFILE is a directory.
125
126Environment variables override the default commands:
127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
128 RMPROG STRIPPROG
129"
130
131while test $# -ne 0; do
132 case $1 in
133 -c) ;;
134
135 -C) copy_on_change=true;;
136
137 -d) dir_arg=true;;
138
139 -g) chgrpcmd="$chgrpprog $2"
140 shift;;
141
142 --help) echo "$usage"; exit $?;;
143
144 -m) mode=$2
145 case $mode in
146 *' '* | *' '* | *'
147'* | *'*'* | *'?'* | *'['*)
148 echo "$0: invalid mode: $mode" >&2
149 exit 1;;
150 esac
151 shift;;
152
153 -o) chowncmd="$chownprog $2"
154 shift;;
155
156 -s) stripcmd=$stripprog;;
157
158 -t) dst_arg=$2
159 shift;;
160
161 -T) no_target_directory=true;;
162
163 --version) echo "$0 $scriptversion"; exit $?;;
164
165 --) shift
166 break;;
167
168 -*) echo "$0: invalid option: $1" >&2
169 exit 1;;
170
171 *) break;;
172 esac
173 shift
174done
175
176if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
177 # When -d is used, all remaining arguments are directories to create.
178 # When -t is used, the destination is already specified.
179 # Otherwise, the last argument is the destination. Remove it from $@.
180 for arg
181 do
182 if test -n "$dst_arg"; then
183 # $@ is not empty: it contains at least $arg.
184 set fnord "$@" "$dst_arg"
185 shift # fnord
186 fi
187 shift # arg
188 dst_arg=$arg
189 done
190fi
191
192if test $# -eq 0; then
193 if test -z "$dir_arg"; then
194 echo "$0: no input file specified." >&2
195 exit 1
196 fi
197 # It's OK to call `install-sh -d' without argument.
198 # This can happen when creating conditional directories.
199 exit 0
200fi
201
202if test -z "$dir_arg"; then
203 trap '(exit $?); exit' 1 2 13 15
204
205 # Set umask so as not to create temps with too-generous modes.
206 # However, 'strip' requires both read and write access to temps.
207 case $mode in
208 # Optimize common cases.
209 *644) cp_umask=133;;
210 *755) cp_umask=22;;
211
212 *[0-7])
213 if test -z "$stripcmd"; then
214 u_plus_rw=
215 else
216 u_plus_rw='% 200'
217 fi
218 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
219 *)
220 if test -z "$stripcmd"; then
221 u_plus_rw=
222 else
223 u_plus_rw=,u+rw
224 fi
225 cp_umask=$mode$u_plus_rw;;
226 esac
227fi
228
229for src
230do
231 # Protect names starting with `-'.
232 case $src in
233 -*) src=./$src;;
234 esac
235
236 if test -n "$dir_arg"; then
237 dst=$src
238 dstdir=$dst
239 test -d "$dstdir"
240 dstdir_status=$?
241 else
242
243 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
244 # might cause directories to be created, which would be especially bad
245 # if $src (and thus $dsttmp) contains '*'.
246 if test ! -f "$src" && test ! -d "$src"; then
247 echo "$0: $src does not exist." >&2
248 exit 1
249 fi
250
251 if test -z "$dst_arg"; then
252 echo "$0: no destination specified." >&2
253 exit 1
254 fi
255
256 dst=$dst_arg
257 # Protect names starting with `-'.
258 case $dst in
259 -*) dst=./$dst;;
260 esac
261
262 # If destination is a directory, append the input filename; won't work
263 # if double slashes aren't ignored.
264 if test -d "$dst"; then
265 if test -n "$no_target_directory"; then
266 echo "$0: $dst_arg: Is a directory" >&2
267 exit 1
268 fi
269 dstdir=$dst
270 dst=$dstdir/`basename "$src"`
271 dstdir_status=0
272 else
273 # Prefer dirname, but fall back on a substitute if dirname fails.
274 dstdir=`
275 (dirname "$dst") 2>/dev/null ||
276 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
277 X"$dst" : 'X\(//\)[^/]' \| \
278 X"$dst" : 'X\(//\)$' \| \
279 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
280 echo X"$dst" |
281 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
282 s//\1/
283 q
284 }
285 /^X\(\/\/\)[^/].*/{
286 s//\1/
287 q
288 }
289 /^X\(\/\/\)$/{
290 s//\1/
291 q
292 }
293 /^X\(\/\).*/{
294 s//\1/
295 q
296 }
297 s/.*/./; q'
298 `
299
300 test -d "$dstdir"
301 dstdir_status=$?
302 fi
303 fi
304
305 obsolete_mkdir_used=false
306
307 if test $dstdir_status != 0; then
308 case $posix_mkdir in
309 '')
310 # Create intermediate dirs using mode 755 as modified by the umask.
311 # This is like FreeBSD 'install' as of 1997-10-28.
312 umask=`umask`
313 case $stripcmd.$umask in
314 # Optimize common cases.
315 *[2367][2367]) mkdir_umask=$umask;;
316 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
317
318 *[0-7])
319 mkdir_umask=`expr $umask + 22 \
320 - $umask % 100 % 40 + $umask % 20 \
321 - $umask % 10 % 4 + $umask % 2
322 `;;
323 *) mkdir_umask=$umask,go-w;;
324 esac
325
326 # With -d, create the new directory with the user-specified mode.
327 # Otherwise, rely on $mkdir_umask.
328 if test -n "$dir_arg"; then
329 mkdir_mode=-m$mode
330 else
331 mkdir_mode=
332 fi
333
334 posix_mkdir=false
335 case $umask in
336 *[123567][0-7][0-7])
337 # POSIX mkdir -p sets u+wx bits regardless of umask, which
338 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
339 ;;
340 *)
341 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
342 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
343
344 if (umask $mkdir_umask &&
345 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
346 then
347 if test -z "$dir_arg" || {
348 # Check for POSIX incompatibilities with -m.
349 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
350 # other-writeable bit of parent directory when it shouldn't.
351 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
352 ls_ld_tmpdir=`ls -ld "$tmpdir"`
353 case $ls_ld_tmpdir in
354 d????-?r-*) different_mode=700;;
355 d????-?--*) different_mode=755;;
356 *) false;;
357 esac &&
358 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
359 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
360 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
361 }
362 }
363 then posix_mkdir=:
364 fi
365 rmdir "$tmpdir/d" "$tmpdir"
366 else
367 # Remove any dirs left behind by ancient mkdir implementations.
368 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
369 fi
370 trap '' 0;;
371 esac;;
372 esac
373
374 if
375 $posix_mkdir && (
376 umask $mkdir_umask &&
377 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
378 )
379 then :
380 else
381
382 # The umask is ridiculous, or mkdir does not conform to POSIX,
383 # or it failed possibly due to a race condition. Create the
384 # directory the slow way, step by step, checking for races as we go.
385
386 case $dstdir in
387 /*) prefix='/';;
388 -*) prefix='./';;
389 *) prefix='';;
390 esac
391
392 eval "$initialize_posix_glob"
393
394 oIFS=$IFS
395 IFS=/
396 $posix_glob set -f
397 set fnord $dstdir
398 shift
399 $posix_glob set +f
400 IFS=$oIFS
401
402 prefixes=
403
404 for d
405 do
406 test -z "$d" && continue
407
408 prefix=$prefix$d
409 if test -d "$prefix"; then
410 prefixes=
411 else
412 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415 # Don't fail if two instances are running concurrently.
416 test -d "$prefix" || exit 1
417 else
418 case $prefix in
419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420 *) qprefix=$prefix;;
421 esac
422 prefixes="$prefixes '$qprefix'"
423 fi
424 fi
425 prefix=$prefix/
426 done
427
428 if test -n "$prefixes"; then
429 # Don't fail if two instances are running concurrently.
430 (umask $mkdir_umask &&
431 eval "\$doit_exec \$mkdirprog $prefixes") ||
432 test -d "$dstdir" || exit 1
433 obsolete_mkdir_used=true
434 fi
435 fi
436 fi
437
438 if test -n "$dir_arg"; then
439 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
440 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
441 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
442 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
443 else
444
445 # Make a couple of temp file names in the proper directory.
446 dsttmp=$dstdir/_inst.$$_
447 rmtmp=$dstdir/_rm.$$_
448
449 # Trap to clean up those temp files at exit.
450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451
452 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
454
455 # and set any options; do chmod last to preserve setuid bits.
456 #
457 # If any of these fail, we abort the whole thing. If we want to
458 # ignore errors from any of these, just make sure not to ignore
459 # errors from the above "$doit $cpprog $src $dsttmp" command.
460 #
461 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
462 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
463 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
464 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
465
466 # If -C, don't bother to copy if it wouldn't change the file.
467 if $copy_on_change &&
468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
470
471 eval "$initialize_posix_glob" &&
472 $posix_glob set -f &&
473 set X $old && old=:$2:$4:$5:$6 &&
474 set X $new && new=:$2:$4:$5:$6 &&
475 $posix_glob set +f &&
476
477 test "$old" = "$new" &&
478 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
479 then
480 rm -f "$dsttmp"
481 else
482 # Rename the file to the real destination.
483 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
484
485 # The rename failed, perhaps because mv can't rename something else
486 # to itself, or perhaps because mv is so ancient that it does not
487 # support -f.
488 {
489 # Now remove or move aside any old file at destination location.
490 # We try this two ways since rm can't unlink itself on some
491 # systems and the destination file might be busy for other
492 # reasons. In this case, the final cleanup might fail but the new
493 # file should still install successfully.
494 {
495 test ! -f "$dst" ||
496 $doit $rmcmd -f "$dst" 2>/dev/null ||
497 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
498 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
499 } ||
500 { echo "$0: cannot unlink or rename $dst" >&2
501 (exit 1); exit 1
502 }
503 } &&
504
505 # Now rename the file to the real destination.
506 $doit $mvcmd "$dsttmp" "$dst"
507 }
508 fi || exit 1
509
510 trap '' 0
511 fi
512done
513
514# Local variables:
515# eval: (add-hook 'write-file-hooks 'time-stamp)
516# time-stamp-start: "scriptversion="
517# time-stamp-format: "%:y-%02m-%02d.%02H"
518# time-stamp-time-zone: "UTC"
519# time-stamp-end: "; # UTC"
520# End:
diff --git a/libraries/embryo/ltmain.sh b/libraries/embryo/ltmain.sh
new file mode 100755
index 0000000..fa4b1e1
--- /dev/null
+++ b/libraries/embryo/ltmain.sh
@@ -0,0 +1,8413 @@
1# Generated from ltmain.m4sh.
2
3# ltmain.sh (GNU libtool) 2.2.6b
4# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
6# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
7# This is free software; see the source for copying conditions. There is NO
8# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
10# GNU Libtool is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# As a special exception to the GNU General Public License,
16# if you distribute this file as part of a program or library that
17# is built using GNU Libtool, you may include this file under the
18# same distribution terms that you use for the rest of that program.
19#
20# GNU Libtool is distributed in the hope that it will be useful, but
21# WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23# General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with GNU Libtool; see the file COPYING. If not, a copy
27# can be downloaded from http://www.gnu.org/licenses/gpl.html,
28# or obtained by writing to the Free Software Foundation, Inc.,
29# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
31# Usage: $progname [OPTION]... [MODE-ARG]...
32#
33# Provide generalized library-building support services.
34#
35# --config show all configuration variables
36# --debug enable verbose shell tracing
37# -n, --dry-run display commands without modifying any files
38# --features display basic configuration information and exit
39# --mode=MODE use operation mode MODE
40# --preserve-dup-deps don't remove duplicate dependency libraries
41# --quiet, --silent don't print informational messages
42# --tag=TAG use configuration variables from tag TAG
43# -v, --verbose print informational messages (default)
44# --version print version information
45# -h, --help print short or long help message
46#
47# MODE must be one of the following:
48#
49# clean remove files from the build directory
50# compile compile a source file into a libtool object
51# execute automatically set library path, then run a program
52# finish complete the installation of libtool libraries
53# install install libraries or executables
54# link create a library or an executable
55# uninstall remove libraries from an installed directory
56#
57# MODE-ARGS vary depending on the MODE.
58# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59#
60# When reporting a bug, please describe a test case to reproduce it and
61# include the following information:
62#
63# host-triplet: $host
64# shell: $SHELL
65# compiler: $LTCC
66# compiler flags: $LTCFLAGS
67# linker: $LD (gnu? $with_gnu_ld)
68# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3
69# automake: $automake_version
70# autoconf: $autoconf_version
71#
72# Report bugs to <bug-libtool@gnu.org>.
73
74PROGRAM=ltmain.sh
75PACKAGE=libtool
76VERSION="2.2.6b Debian-2.2.6b-2ubuntu3"
77TIMESTAMP=""
78package_revision=1.3017
79
80# Be Bourne compatible
81if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
82 emulate sh
83 NULLCMD=:
84 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
85 # is contrary to our usage. Disable this feature.
86 alias -g '${1+"$@"}'='"$@"'
87 setopt NO_GLOB_SUBST
88else
89 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
90fi
91BIN_SH=xpg4; export BIN_SH # for Tru64
92DUALCASE=1; export DUALCASE # for MKS sh
93
94# NLS nuisances: We save the old values to restore during execute mode.
95# Only set LANG and LC_ALL to C if already set.
96# These must not be set unconditionally because not all systems understand
97# e.g. LANG=C (notably SCO).
98lt_user_locale=
99lt_safe_locale=
100for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
101do
102 eval "if test \"\${$lt_var+set}\" = set; then
103 save_$lt_var=\$$lt_var
104 $lt_var=C
105 export $lt_var
106 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
107 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
108 fi"
109done
110
111$lt_unset CDPATH
112
113
114
115
116
117: ${CP="cp -f"}
118: ${ECHO="echo"}
119: ${EGREP="/bin/grep -E"}
120: ${FGREP="/bin/grep -F"}
121: ${GREP="/bin/grep"}
122: ${LN_S="ln -s"}
123: ${MAKE="make"}
124: ${MKDIR="mkdir"}
125: ${MV="mv -f"}
126: ${RM="rm -f"}
127: ${SED="/bin/sed"}
128: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129: ${Xsed="$SED -e 1s/^X//"}
130
131# Global variables:
132EXIT_SUCCESS=0
133EXIT_FAILURE=1
134EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
135EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
136
137exit_status=$EXIT_SUCCESS
138
139# Make sure IFS has a sensible default
140lt_nl='
141'
142IFS=" $lt_nl"
143
144dirname="s,/[^/]*$,,"
145basename="s,^.*/,,"
146
147# func_dirname_and_basename file append nondir_replacement
148# perform func_basename and func_dirname in a single function
149# call:
150# dirname: Compute the dirname of FILE. If nonempty,
151# add APPEND to the result, otherwise set result
152# to NONDIR_REPLACEMENT.
153# value returned in "$func_dirname_result"
154# basename: Compute filename of FILE.
155# value retuned in "$func_basename_result"
156# Implementation must be kept synchronized with func_dirname
157# and func_basename. For efficiency, we do not delegate to
158# those functions but instead duplicate the functionality here.
159func_dirname_and_basename ()
160{
161 # Extract subdirectory from the argument.
162 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
163 if test "X$func_dirname_result" = "X${1}"; then
164 func_dirname_result="${3}"
165 else
166 func_dirname_result="$func_dirname_result${2}"
167 fi
168 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
169}
170
171# Generated shell functions inserted here.
172
173# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
174# is ksh but when the shell is invoked as "sh" and the current value of
175# the _XPG environment variable is not equal to 1 (one), the special
176# positional parameter $0, within a function call, is the name of the
177# function.
178progpath="$0"
179
180# The name of this program:
181# In the unlikely event $progname began with a '-', it would play havoc with
182# func_echo (imagine progname=-n), so we prepend ./ in that case:
183func_dirname_and_basename "$progpath"
184progname=$func_basename_result
185case $progname in
186 -*) progname=./$progname ;;
187esac
188
189# Make sure we have an absolute path for reexecution:
190case $progpath in
191 [\\/]*|[A-Za-z]:\\*) ;;
192 *[\\/]*)
193 progdir=$func_dirname_result
194 progdir=`cd "$progdir" && pwd`
195 progpath="$progdir/$progname"
196 ;;
197 *)
198 save_IFS="$IFS"
199 IFS=:
200 for progdir in $PATH; do
201 IFS="$save_IFS"
202 test -x "$progdir/$progname" && break
203 done
204 IFS="$save_IFS"
205 test -n "$progdir" || progdir=`pwd`
206 progpath="$progdir/$progname"
207 ;;
208esac
209
210# Sed substitution that helps us do robust quoting. It backslashifies
211# metacharacters that are still active within double-quoted strings.
212Xsed="${SED}"' -e 1s/^X//'
213sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
214
215# Same as above, but do not quote variable references.
216double_quote_subst='s/\(["`\\]\)/\\\1/g'
217
218# Re-`\' parameter expansions in output of double_quote_subst that were
219# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
220# in input to double_quote_subst, that '$' was protected from expansion.
221# Since each input `\' is now two `\'s, look for any number of runs of
222# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
223bs='\\'
224bs2='\\\\'
225bs4='\\\\\\\\'
226dollar='\$'
227sed_double_backslash="\
228 s/$bs4/&\\
229/g
230 s/^$bs2$dollar/$bs&/
231 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
232 s/\n//g"
233
234# Standard options:
235opt_dry_run=false
236opt_help=false
237opt_quiet=false
238opt_verbose=false
239opt_warning=:
240
241# func_echo arg...
242# Echo program name prefixed message, along with the current mode
243# name if it has been set yet.
244func_echo ()
245{
246 $ECHO "$progname${mode+: }$mode: $*"
247}
248
249# func_verbose arg...
250# Echo program name prefixed message in verbose mode only.
251func_verbose ()
252{
253 $opt_verbose && func_echo ${1+"$@"}
254
255 # A bug in bash halts the script if the last line of a function
256 # fails when set -e is in force, so we need another command to
257 # work around that:
258 :
259}
260
261# func_error arg...
262# Echo program name prefixed message to standard error.
263func_error ()
264{
265 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
266}
267
268# func_warning arg...
269# Echo program name prefixed warning message to standard error.
270func_warning ()
271{
272 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
273
274 # bash bug again:
275 :
276}
277
278# func_fatal_error arg...
279# Echo program name prefixed message to standard error, and exit.
280func_fatal_error ()
281{
282 func_error ${1+"$@"}
283 exit $EXIT_FAILURE
284}
285
286# func_fatal_help arg...
287# Echo program name prefixed message to standard error, followed by
288# a help hint, and exit.
289func_fatal_help ()
290{
291 func_error ${1+"$@"}
292 func_fatal_error "$help"
293}
294help="Try \`$progname --help' for more information." ## default
295
296
297# func_grep expression filename
298# Check whether EXPRESSION matches any line of FILENAME, without output.
299func_grep ()
300{
301 $GREP "$1" "$2" >/dev/null 2>&1
302}
303
304
305# func_mkdir_p directory-path
306# Make sure the entire path to DIRECTORY-PATH is available.
307func_mkdir_p ()
308{
309 my_directory_path="$1"
310 my_dir_list=
311
312 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
313
314 # Protect directory names starting with `-'
315 case $my_directory_path in
316 -*) my_directory_path="./$my_directory_path" ;;
317 esac
318
319 # While some portion of DIR does not yet exist...
320 while test ! -d "$my_directory_path"; do
321 # ...make a list in topmost first order. Use a colon delimited
322 # list incase some portion of path contains whitespace.
323 my_dir_list="$my_directory_path:$my_dir_list"
324
325 # If the last portion added has no slash in it, the list is done
326 case $my_directory_path in */*) ;; *) break ;; esac
327
328 # ...otherwise throw away the child directory and loop
329 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
330 done
331 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
332
333 save_mkdir_p_IFS="$IFS"; IFS=':'
334 for my_dir in $my_dir_list; do
335 IFS="$save_mkdir_p_IFS"
336 # mkdir can fail with a `File exist' error if two processes
337 # try to create one of the directories concurrently. Don't
338 # stop in that case!
339 $MKDIR "$my_dir" 2>/dev/null || :
340 done
341 IFS="$save_mkdir_p_IFS"
342
343 # Bail out if we (or some other process) failed to create a directory.
344 test -d "$my_directory_path" || \
345 func_fatal_error "Failed to create \`$1'"
346 fi
347}
348
349
350# func_mktempdir [string]
351# Make a temporary directory that won't clash with other running
352# libtool processes, and avoids race conditions if possible. If
353# given, STRING is the basename for that directory.
354func_mktempdir ()
355{
356 my_template="${TMPDIR-/tmp}/${1-$progname}"
357
358 if test "$opt_dry_run" = ":"; then
359 # Return a directory name, but don't create it in dry-run mode
360 my_tmpdir="${my_template}-$$"
361 else
362
363 # If mktemp works, use that first and foremost
364 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
365
366 if test ! -d "$my_tmpdir"; then
367 # Failing that, at least try and use $RANDOM to avoid a race
368 my_tmpdir="${my_template}-${RANDOM-0}$$"
369
370 save_mktempdir_umask=`umask`
371 umask 0077
372 $MKDIR "$my_tmpdir"
373 umask $save_mktempdir_umask
374 fi
375
376 # If we're not in dry-run mode, bomb out on failure
377 test -d "$my_tmpdir" || \
378 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
379 fi
380
381 $ECHO "X$my_tmpdir" | $Xsed
382}
383
384
385# func_quote_for_eval arg
386# Aesthetically quote ARG to be evaled later.
387# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
388# is double-quoted, suitable for a subsequent eval, whereas
389# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
390# which are still active within double quotes backslashified.
391func_quote_for_eval ()
392{
393 case $1 in
394 *[\\\`\"\$]*)
395 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
396 *)
397 func_quote_for_eval_unquoted_result="$1" ;;
398 esac
399
400 case $func_quote_for_eval_unquoted_result in
401 # Double-quote args containing shell metacharacters to delay
402 # word splitting, command substitution and and variable
403 # expansion for a subsequent eval.
404 # Many Bourne shells cannot handle close brackets correctly
405 # in scan sets, so we specify it separately.
406 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
407 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
408 ;;
409 *)
410 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
411 esac
412}
413
414
415# func_quote_for_expand arg
416# Aesthetically quote ARG to be evaled later; same as above,
417# but do not quote variable references.
418func_quote_for_expand ()
419{
420 case $1 in
421 *[\\\`\"]*)
422 my_arg=`$ECHO "X$1" | $Xsed \
423 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
424 *)
425 my_arg="$1" ;;
426 esac
427
428 case $my_arg in
429 # Double-quote args containing shell metacharacters to delay
430 # word splitting and command substitution for a subsequent eval.
431 # Many Bourne shells cannot handle close brackets correctly
432 # in scan sets, so we specify it separately.
433 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
434 my_arg="\"$my_arg\""
435 ;;
436 esac
437
438 func_quote_for_expand_result="$my_arg"
439}
440
441
442# func_show_eval cmd [fail_exp]
443# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
444# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
445# is given, then evaluate it.
446func_show_eval ()
447{
448 my_cmd="$1"
449 my_fail_exp="${2-:}"
450
451 ${opt_silent-false} || {
452 func_quote_for_expand "$my_cmd"
453 eval "func_echo $func_quote_for_expand_result"
454 }
455
456 if ${opt_dry_run-false}; then :; else
457 eval "$my_cmd"
458 my_status=$?
459 if test "$my_status" -eq 0; then :; else
460 eval "(exit $my_status); $my_fail_exp"
461 fi
462 fi
463}
464
465
466# func_show_eval_locale cmd [fail_exp]
467# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
468# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
469# is given, then evaluate it. Use the saved locale for evaluation.
470func_show_eval_locale ()
471{
472 my_cmd="$1"
473 my_fail_exp="${2-:}"
474
475 ${opt_silent-false} || {
476 func_quote_for_expand "$my_cmd"
477 eval "func_echo $func_quote_for_expand_result"
478 }
479
480 if ${opt_dry_run-false}; then :; else
481 eval "$lt_user_locale
482 $my_cmd"
483 my_status=$?
484 eval "$lt_safe_locale"
485 if test "$my_status" -eq 0; then :; else
486 eval "(exit $my_status); $my_fail_exp"
487 fi
488 fi
489}
490
491
492
493
494
495# func_version
496# Echo version message to standard output and exit.
497func_version ()
498{
499 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
500 s/^# //
501 s/^# *$//
502 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
503 p
504 }' < "$progpath"
505 exit $?
506}
507
508# func_usage
509# Echo short help message to standard output and exit.
510func_usage ()
511{
512 $SED -n '/^# Usage:/,/# -h/ {
513 s/^# //
514 s/^# *$//
515 s/\$progname/'$progname'/
516 p
517 }' < "$progpath"
518 $ECHO
519 $ECHO "run \`$progname --help | more' for full usage"
520 exit $?
521}
522
523# func_help
524# Echo long help message to standard output and exit.
525func_help ()
526{
527 $SED -n '/^# Usage:/,/# Report bugs to/ {
528 s/^# //
529 s/^# *$//
530 s*\$progname*'$progname'*
531 s*\$host*'"$host"'*
532 s*\$SHELL*'"$SHELL"'*
533 s*\$LTCC*'"$LTCC"'*
534 s*\$LTCFLAGS*'"$LTCFLAGS"'*
535 s*\$LD*'"$LD"'*
536 s/\$with_gnu_ld/'"$with_gnu_ld"'/
537 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
538 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
539 p
540 }' < "$progpath"
541 exit $?
542}
543
544# func_missing_arg argname
545# Echo program name prefixed message to standard error and set global
546# exit_cmd.
547func_missing_arg ()
548{
549 func_error "missing argument for $1"
550 exit_cmd=exit
551}
552
553exit_cmd=:
554
555
556
557
558
559# Check that we have a working $ECHO.
560if test "X$1" = X--no-reexec; then
561 # Discard the --no-reexec flag, and continue.
562 shift
563elif test "X$1" = X--fallback-echo; then
564 # Avoid inline document here, it may be left over
565 :
566elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
567 # Yippee, $ECHO works!
568 :
569else
570 # Restart under the correct shell, and then maybe $ECHO will work.
571 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
572fi
573
574if test "X$1" = X--fallback-echo; then
575 # used as fallback echo
576 shift
577 cat <<EOF
578$*
579EOF
580 exit $EXIT_SUCCESS
581fi
582
583magic="%%%MAGIC variable%%%"
584magic_exe="%%%MAGIC EXE variable%%%"
585
586# Global variables.
587# $mode is unset
588nonopt=
589execute_dlfiles=
590preserve_args=
591lo2o="s/\\.lo\$/.${objext}/"
592o2lo="s/\\.${objext}\$/.lo/"
593extracted_archives=
594extracted_serial=0
595
596opt_dry_run=false
597opt_duplicate_deps=false
598opt_silent=false
599opt_debug=:
600
601# If this variable is set in any of the actions, the command in it
602# will be execed at the end. This prevents here-documents from being
603# left over by shells.
604exec_cmd=
605
606# func_fatal_configuration arg...
607# Echo program name prefixed message to standard error, followed by
608# a configuration failure hint, and exit.
609func_fatal_configuration ()
610{
611 func_error ${1+"$@"}
612 func_error "See the $PACKAGE documentation for more information."
613 func_fatal_error "Fatal configuration error."
614}
615
616
617# func_config
618# Display the configuration for all the tags in this script.
619func_config ()
620{
621 re_begincf='^# ### BEGIN LIBTOOL'
622 re_endcf='^# ### END LIBTOOL'
623
624 # Default configuration.
625 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
626
627 # Now print the configurations for the tags.
628 for tagname in $taglist; do
629 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
630 done
631
632 exit $?
633}
634
635# func_features
636# Display the features supported by this script.
637func_features ()
638{
639 $ECHO "host: $host"
640 if test "$build_libtool_libs" = yes; then
641 $ECHO "enable shared libraries"
642 else
643 $ECHO "disable shared libraries"
644 fi
645 if test "$build_old_libs" = yes; then
646 $ECHO "enable static libraries"
647 else
648 $ECHO "disable static libraries"
649 fi
650
651 exit $?
652}
653
654# func_enable_tag tagname
655# Verify that TAGNAME is valid, and either flag an error and exit, or
656# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
657# variable here.
658func_enable_tag ()
659{
660 # Global variable:
661 tagname="$1"
662
663 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
664 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
665 sed_extractcf="/$re_begincf/,/$re_endcf/p"
666
667 # Validate tagname.
668 case $tagname in
669 *[!-_A-Za-z0-9,/]*)
670 func_fatal_error "invalid tag name: $tagname"
671 ;;
672 esac
673
674 # Don't test for the "default" C tag, as we know it's
675 # there but not specially marked.
676 case $tagname in
677 CC) ;;
678 *)
679 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
680 taglist="$taglist $tagname"
681
682 # Evaluate the configuration. Be careful to quote the path
683 # and the sed script, to avoid splitting on whitespace, but
684 # also don't use non-portable quotes within backquotes within
685 # quotes we have to do it in 2 steps:
686 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
687 eval "$extractedcf"
688 else
689 func_error "ignoring unknown tag $tagname"
690 fi
691 ;;
692 esac
693}
694
695# Parse options once, thoroughly. This comes as soon as possible in
696# the script to make things like `libtool --version' happen quickly.
697{
698
699 # Shorthand for --mode=foo, only valid as the first argument
700 case $1 in
701 clean|clea|cle|cl)
702 shift; set dummy --mode clean ${1+"$@"}; shift
703 ;;
704 compile|compil|compi|comp|com|co|c)
705 shift; set dummy --mode compile ${1+"$@"}; shift
706 ;;
707 execute|execut|execu|exec|exe|ex|e)
708 shift; set dummy --mode execute ${1+"$@"}; shift
709 ;;
710 finish|finis|fini|fin|fi|f)
711 shift; set dummy --mode finish ${1+"$@"}; shift
712 ;;
713 install|instal|insta|inst|ins|in|i)
714 shift; set dummy --mode install ${1+"$@"}; shift
715 ;;
716 link|lin|li|l)
717 shift; set dummy --mode link ${1+"$@"}; shift
718 ;;
719 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
720 shift; set dummy --mode uninstall ${1+"$@"}; shift
721 ;;
722 esac
723
724 # Parse non-mode specific arguments:
725 while test "$#" -gt 0; do
726 opt="$1"
727 shift
728
729 case $opt in
730 --config) func_config ;;
731
732 --debug) preserve_args="$preserve_args $opt"
733 func_echo "enabling shell trace mode"
734 opt_debug='set -x'
735 $opt_debug
736 ;;
737
738 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
739 execute_dlfiles="$execute_dlfiles $1"
740 shift
741 ;;
742
743 --dry-run | -n) opt_dry_run=: ;;
744 --features) func_features ;;
745 --finish) mode="finish" ;;
746
747 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
748 case $1 in
749 # Valid mode arguments:
750 clean) ;;
751 compile) ;;
752 execute) ;;
753 finish) ;;
754 install) ;;
755 link) ;;
756 relink) ;;
757 uninstall) ;;
758
759 # Catch anything else as an error
760 *) func_error "invalid argument for $opt"
761 exit_cmd=exit
762 break
763 ;;
764 esac
765
766 mode="$1"
767 shift
768 ;;
769
770 --preserve-dup-deps)
771 opt_duplicate_deps=: ;;
772
773 --quiet|--silent) preserve_args="$preserve_args $opt"
774 opt_silent=:
775 ;;
776
777 --verbose| -v) preserve_args="$preserve_args $opt"
778 opt_silent=false
779 ;;
780
781 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
782 preserve_args="$preserve_args $opt $1"
783 func_enable_tag "$1" # tagname is set here
784 shift
785 ;;
786
787 # Separate optargs to long options:
788 -dlopen=*|--mode=*|--tag=*)
789 func_opt_split "$opt"
790 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
791 shift
792 ;;
793
794 -\?|-h) func_usage ;;
795 --help) opt_help=: ;;
796 --version) func_version ;;
797
798 -*) func_fatal_help "unrecognized option \`$opt'" ;;
799
800 *) nonopt="$opt"
801 break
802 ;;
803 esac
804 done
805
806
807 case $host in
808 *cygwin* | *mingw* | *pw32* | *cegcc*)
809 # don't eliminate duplications in $postdeps and $predeps
810 opt_duplicate_compiler_generated_deps=:
811 ;;
812 *)
813 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
814 ;;
815 esac
816
817 # Having warned about all mis-specified options, bail out if
818 # anything was wrong.
819 $exit_cmd $EXIT_FAILURE
820}
821
822# func_check_version_match
823# Ensure that we are using m4 macros, and libtool script from the same
824# release of libtool.
825func_check_version_match ()
826{
827 if test "$package_revision" != "$macro_revision"; then
828 if test "$VERSION" != "$macro_version"; then
829 if test -z "$macro_version"; then
830 cat >&2 <<_LT_EOF
831$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
832$progname: definition of this LT_INIT comes from an older release.
833$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
834$progname: and run autoconf again.
835_LT_EOF
836 else
837 cat >&2 <<_LT_EOF
838$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
839$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
840$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
841$progname: and run autoconf again.
842_LT_EOF
843 fi
844 else
845 cat >&2 <<_LT_EOF
846$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
847$progname: but the definition of this LT_INIT comes from revision $macro_revision.
848$progname: You should recreate aclocal.m4 with macros from revision $package_revision
849$progname: of $PACKAGE $VERSION and run autoconf again.
850_LT_EOF
851 fi
852
853 exit $EXIT_MISMATCH
854 fi
855}
856
857
858## ----------- ##
859## Main. ##
860## ----------- ##
861
862$opt_help || {
863 # Sanity checks first:
864 func_check_version_match
865
866 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
867 func_fatal_configuration "not configured to build any kind of library"
868 fi
869
870 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
871
872
873 # Darwin sucks
874 eval std_shrext=\"$shrext_cmds\"
875
876
877 # Only execute mode is allowed to have -dlopen flags.
878 if test -n "$execute_dlfiles" && test "$mode" != execute; then
879 func_error "unrecognized option \`-dlopen'"
880 $ECHO "$help" 1>&2
881 exit $EXIT_FAILURE
882 fi
883
884 # Change the help message to a mode-specific one.
885 generic_help="$help"
886 help="Try \`$progname --help --mode=$mode' for more information."
887}
888
889
890# func_lalib_p file
891# True iff FILE is a libtool `.la' library or `.lo' object file.
892# This function is only a basic sanity check; it will hardly flush out
893# determined imposters.
894func_lalib_p ()
895{
896 test -f "$1" &&
897 $SED -e 4q "$1" 2>/dev/null \
898 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
899}
900
901# func_lalib_unsafe_p file
902# True iff FILE is a libtool `.la' library or `.lo' object file.
903# This function implements the same check as func_lalib_p without
904# resorting to external programs. To this end, it redirects stdin and
905# closes it afterwards, without saving the original file descriptor.
906# As a safety measure, use it only where a negative result would be
907# fatal anyway. Works if `file' does not exist.
908func_lalib_unsafe_p ()
909{
910 lalib_p=no
911 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
912 for lalib_p_l in 1 2 3 4
913 do
914 read lalib_p_line
915 case "$lalib_p_line" in
916 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
917 esac
918 done
919 exec 0<&5 5<&-
920 fi
921 test "$lalib_p" = yes
922}
923
924# func_ltwrapper_script_p file
925# True iff FILE is a libtool wrapper script
926# This function is only a basic sanity check; it will hardly flush out
927# determined imposters.
928func_ltwrapper_script_p ()
929{
930 func_lalib_p "$1"
931}
932
933# func_ltwrapper_executable_p file
934# True iff FILE is a libtool wrapper executable
935# This function is only a basic sanity check; it will hardly flush out
936# determined imposters.
937func_ltwrapper_executable_p ()
938{
939 func_ltwrapper_exec_suffix=
940 case $1 in
941 *.exe) ;;
942 *) func_ltwrapper_exec_suffix=.exe ;;
943 esac
944 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
945}
946
947# func_ltwrapper_scriptname file
948# Assumes file is an ltwrapper_executable
949# uses $file to determine the appropriate filename for a
950# temporary ltwrapper_script.
951func_ltwrapper_scriptname ()
952{
953 func_ltwrapper_scriptname_result=""
954 if func_ltwrapper_executable_p "$1"; then
955 func_dirname_and_basename "$1" "" "."
956 func_stripname '' '.exe' "$func_basename_result"
957 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
958 fi
959}
960
961# func_ltwrapper_p file
962# True iff FILE is a libtool wrapper script or wrapper executable
963# This function is only a basic sanity check; it will hardly flush out
964# determined imposters.
965func_ltwrapper_p ()
966{
967 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
968}
969
970
971# func_execute_cmds commands fail_cmd
972# Execute tilde-delimited COMMANDS.
973# If FAIL_CMD is given, eval that upon failure.
974# FAIL_CMD may read-access the current command in variable CMD!
975func_execute_cmds ()
976{
977 $opt_debug
978 save_ifs=$IFS; IFS='~'
979 for cmd in $1; do
980 IFS=$save_ifs
981 eval cmd=\"$cmd\"
982 func_show_eval "$cmd" "${2-:}"
983 done
984 IFS=$save_ifs
985}
986
987
988# func_source file
989# Source FILE, adding directory component if necessary.
990# Note that it is not necessary on cygwin/mingw to append a dot to
991# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
992# behavior happens only for exec(3), not for open(2)! Also, sourcing
993# `FILE.' does not work on cygwin managed mounts.
994func_source ()
995{
996 $opt_debug
997 case $1 in
998 */* | *\\*) . "$1" ;;
999 *) . "./$1" ;;
1000 esac
1001}
1002
1003
1004# func_infer_tag arg
1005# Infer tagged configuration to use if any are available and
1006# if one wasn't chosen via the "--tag" command line option.
1007# Only attempt this if the compiler in the base compile
1008# command doesn't match the default compiler.
1009# arg is usually of the form 'gcc ...'
1010func_infer_tag ()
1011{
1012 $opt_debug
1013 if test -n "$available_tags" && test -z "$tagname"; then
1014 CC_quoted=
1015 for arg in $CC; do
1016 func_quote_for_eval "$arg"
1017 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1018 done
1019 case $@ in
1020 # Blanks in the command may have been stripped by the calling shell,
1021 # but not from the CC environment variable when configure was run.
1022 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1023 # Blanks at the start of $base_compile will cause this to fail
1024 # if we don't check for them as well.
1025 *)
1026 for z in $available_tags; do
1027 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1028 # Evaluate the configuration.
1029 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1030 CC_quoted=
1031 for arg in $CC; do
1032 # Double-quote args containing other shell metacharacters.
1033 func_quote_for_eval "$arg"
1034 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1035 done
1036 case "$@ " in
1037 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1038 # The compiler in the base compile command matches
1039 # the one in the tagged configuration.
1040 # Assume this is the tagged configuration we want.
1041 tagname=$z
1042 break
1043 ;;
1044 esac
1045 fi
1046 done
1047 # If $tagname still isn't set, then no tagged configuration
1048 # was found and let the user know that the "--tag" command
1049 # line option must be used.
1050 if test -z "$tagname"; then
1051 func_echo "unable to infer tagged configuration"
1052 func_fatal_error "specify a tag with \`--tag'"
1053# else
1054# func_verbose "using $tagname tagged configuration"
1055 fi
1056 ;;
1057 esac
1058 fi
1059}
1060
1061
1062
1063# func_write_libtool_object output_name pic_name nonpic_name
1064# Create a libtool object file (analogous to a ".la" file),
1065# but don't create it if we're doing a dry run.
1066func_write_libtool_object ()
1067{
1068 write_libobj=${1}
1069 if test "$build_libtool_libs" = yes; then
1070 write_lobj=\'${2}\'
1071 else
1072 write_lobj=none
1073 fi
1074
1075 if test "$build_old_libs" = yes; then
1076 write_oldobj=\'${3}\'
1077 else
1078 write_oldobj=none
1079 fi
1080
1081 $opt_dry_run || {
1082 cat >${write_libobj}T <<EOF
1083# $write_libobj - a libtool object file
1084# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1085#
1086# Please DO NOT delete this file!
1087# It is necessary for linking the library.
1088
1089# Name of the PIC object.
1090pic_object=$write_lobj
1091
1092# Name of the non-PIC object
1093non_pic_object=$write_oldobj
1094
1095EOF
1096 $MV "${write_libobj}T" "${write_libobj}"
1097 }
1098}
1099
1100# func_mode_compile arg...
1101func_mode_compile ()
1102{
1103 $opt_debug
1104 # Get the compilation command and the source file.
1105 base_compile=
1106 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1107 suppress_opt=yes
1108 suppress_output=
1109 arg_mode=normal
1110 libobj=
1111 later=
1112 pie_flag=
1113
1114 for arg
1115 do
1116 case $arg_mode in
1117 arg )
1118 # do not "continue". Instead, add this to base_compile
1119 lastarg="$arg"
1120 arg_mode=normal
1121 ;;
1122
1123 target )
1124 libobj="$arg"
1125 arg_mode=normal
1126 continue
1127 ;;
1128
1129 normal )
1130 # Accept any command-line options.
1131 case $arg in
1132 -o)
1133 test -n "$libobj" && \
1134 func_fatal_error "you cannot specify \`-o' more than once"
1135 arg_mode=target
1136 continue
1137 ;;
1138
1139 -pie | -fpie | -fPIE)
1140 pie_flag="$pie_flag $arg"
1141 continue
1142 ;;
1143
1144 -shared | -static | -prefer-pic | -prefer-non-pic)
1145 later="$later $arg"
1146 continue
1147 ;;
1148
1149 -no-suppress)
1150 suppress_opt=no
1151 continue
1152 ;;
1153
1154 -Xcompiler)
1155 arg_mode=arg # the next one goes into the "base_compile" arg list
1156 continue # The current "srcfile" will either be retained or
1157 ;; # replaced later. I would guess that would be a bug.
1158
1159 -Wc,*)
1160 func_stripname '-Wc,' '' "$arg"
1161 args=$func_stripname_result
1162 lastarg=
1163 save_ifs="$IFS"; IFS=','
1164 for arg in $args; do
1165 IFS="$save_ifs"
1166 func_quote_for_eval "$arg"
1167 lastarg="$lastarg $func_quote_for_eval_result"
1168 done
1169 IFS="$save_ifs"
1170 func_stripname ' ' '' "$lastarg"
1171 lastarg=$func_stripname_result
1172
1173 # Add the arguments to base_compile.
1174 base_compile="$base_compile $lastarg"
1175 continue
1176 ;;
1177
1178 *)
1179 # Accept the current argument as the source file.
1180 # The previous "srcfile" becomes the current argument.
1181 #
1182 lastarg="$srcfile"
1183 srcfile="$arg"
1184 ;;
1185 esac # case $arg
1186 ;;
1187 esac # case $arg_mode
1188
1189 # Aesthetically quote the previous argument.
1190 func_quote_for_eval "$lastarg"
1191 base_compile="$base_compile $func_quote_for_eval_result"
1192 done # for arg
1193
1194 case $arg_mode in
1195 arg)
1196 func_fatal_error "you must specify an argument for -Xcompile"
1197 ;;
1198 target)
1199 func_fatal_error "you must specify a target with \`-o'"
1200 ;;
1201 *)
1202 # Get the name of the library object.
1203 test -z "$libobj" && {
1204 func_basename "$srcfile"
1205 libobj="$func_basename_result"
1206 }
1207 ;;
1208 esac
1209
1210 # Recognize several different file suffixes.
1211 # If the user specifies -o file.o, it is replaced with file.lo
1212 case $libobj in
1213 *.[cCFSifmso] | \
1214 *.ada | *.adb | *.ads | *.asm | \
1215 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1216 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1217 func_xform "$libobj"
1218 libobj=$func_xform_result
1219 ;;
1220 esac
1221
1222 case $libobj in
1223 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1224 *)
1225 func_fatal_error "cannot determine name of library object from \`$libobj'"
1226 ;;
1227 esac
1228
1229 func_infer_tag $base_compile
1230
1231 for arg in $later; do
1232 case $arg in
1233 -shared)
1234 test "$build_libtool_libs" != yes && \
1235 func_fatal_configuration "can not build a shared library"
1236 build_old_libs=no
1237 continue
1238 ;;
1239
1240 -static)
1241 build_libtool_libs=no
1242 build_old_libs=yes
1243 continue
1244 ;;
1245
1246 -prefer-pic)
1247 pic_mode=yes
1248 continue
1249 ;;
1250
1251 -prefer-non-pic)
1252 pic_mode=no
1253 continue
1254 ;;
1255 esac
1256 done
1257
1258 func_quote_for_eval "$libobj"
1259 test "X$libobj" != "X$func_quote_for_eval_result" \
1260 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1261 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1262 func_dirname_and_basename "$obj" "/" ""
1263 objname="$func_basename_result"
1264 xdir="$func_dirname_result"
1265 lobj=${xdir}$objdir/$objname
1266
1267 test -z "$base_compile" && \
1268 func_fatal_help "you must specify a compilation command"
1269
1270 # Delete any leftover library objects.
1271 if test "$build_old_libs" = yes; then
1272 removelist="$obj $lobj $libobj ${libobj}T"
1273 else
1274 removelist="$lobj $libobj ${libobj}T"
1275 fi
1276
1277 # On Cygwin there's no "real" PIC flag so we must build both object types
1278 case $host_os in
1279 cygwin* | mingw* | pw32* | os2* | cegcc*)
1280 pic_mode=default
1281 ;;
1282 esac
1283 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1284 # non-PIC code in shared libraries is not supported
1285 pic_mode=default
1286 fi
1287
1288 # Calculate the filename of the output object if compiler does
1289 # not support -o with -c
1290 if test "$compiler_c_o" = no; then
1291 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1292 lockfile="$output_obj.lock"
1293 else
1294 output_obj=
1295 need_locks=no
1296 lockfile=
1297 fi
1298
1299 # Lock this critical section if it is needed
1300 # We use this script file to make the link, it avoids creating a new file
1301 if test "$need_locks" = yes; then
1302 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1303 func_echo "Waiting for $lockfile to be removed"
1304 sleep 2
1305 done
1306 elif test "$need_locks" = warn; then
1307 if test -f "$lockfile"; then
1308 $ECHO "\
1309*** ERROR, $lockfile exists and contains:
1310`cat $lockfile 2>/dev/null`
1311
1312This indicates that another process is trying to use the same
1313temporary object file, and libtool could not work around it because
1314your compiler does not support \`-c' and \`-o' together. If you
1315repeat this compilation, it may succeed, by chance, but you had better
1316avoid parallel builds (make -j) in this platform, or get a better
1317compiler."
1318
1319 $opt_dry_run || $RM $removelist
1320 exit $EXIT_FAILURE
1321 fi
1322 removelist="$removelist $output_obj"
1323 $ECHO "$srcfile" > "$lockfile"
1324 fi
1325
1326 $opt_dry_run || $RM $removelist
1327 removelist="$removelist $lockfile"
1328 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1329
1330 if test -n "$fix_srcfile_path"; then
1331 eval srcfile=\"$fix_srcfile_path\"
1332 fi
1333 func_quote_for_eval "$srcfile"
1334 qsrcfile=$func_quote_for_eval_result
1335
1336 # Only build a PIC object if we are building libtool libraries.
1337 if test "$build_libtool_libs" = yes; then
1338 # Without this assignment, base_compile gets emptied.
1339 fbsd_hideous_sh_bug=$base_compile
1340
1341 if test "$pic_mode" != no; then
1342 command="$base_compile $qsrcfile $pic_flag"
1343 else
1344 # Don't build PIC code
1345 command="$base_compile $qsrcfile"
1346 fi
1347
1348 func_mkdir_p "$xdir$objdir"
1349
1350 if test -z "$output_obj"; then
1351 # Place PIC objects in $objdir
1352 command="$command -o $lobj"
1353 fi
1354
1355 func_show_eval_locale "$command" \
1356 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1357
1358 if test "$need_locks" = warn &&
1359 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1360 $ECHO "\
1361*** ERROR, $lockfile contains:
1362`cat $lockfile 2>/dev/null`
1363
1364but it should contain:
1365$srcfile
1366
1367This indicates that another process is trying to use the same
1368temporary object file, and libtool could not work around it because
1369your compiler does not support \`-c' and \`-o' together. If you
1370repeat this compilation, it may succeed, by chance, but you had better
1371avoid parallel builds (make -j) in this platform, or get a better
1372compiler."
1373
1374 $opt_dry_run || $RM $removelist
1375 exit $EXIT_FAILURE
1376 fi
1377
1378 # Just move the object if needed, then go on to compile the next one
1379 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1380 func_show_eval '$MV "$output_obj" "$lobj"' \
1381 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1382 fi
1383
1384 # Allow error messages only from the first compilation.
1385 if test "$suppress_opt" = yes; then
1386 suppress_output=' >/dev/null 2>&1'
1387 fi
1388 fi
1389
1390 # Only build a position-dependent object if we build old libraries.
1391 if test "$build_old_libs" = yes; then
1392 if test "$pic_mode" != yes; then
1393 # Don't build PIC code
1394 command="$base_compile $qsrcfile$pie_flag"
1395 else
1396 command="$base_compile $qsrcfile $pic_flag"
1397 fi
1398 if test "$compiler_c_o" = yes; then
1399 command="$command -o $obj"
1400 fi
1401
1402 # Suppress compiler output if we already did a PIC compilation.
1403 command="$command$suppress_output"
1404 func_show_eval_locale "$command" \
1405 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1406
1407 if test "$need_locks" = warn &&
1408 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1409 $ECHO "\
1410*** ERROR, $lockfile contains:
1411`cat $lockfile 2>/dev/null`
1412
1413but it should contain:
1414$srcfile
1415
1416This indicates that another process is trying to use the same
1417temporary object file, and libtool could not work around it because
1418your compiler does not support \`-c' and \`-o' together. If you
1419repeat this compilation, it may succeed, by chance, but you had better
1420avoid parallel builds (make -j) in this platform, or get a better
1421compiler."
1422
1423 $opt_dry_run || $RM $removelist
1424 exit $EXIT_FAILURE
1425 fi
1426
1427 # Just move the object if needed
1428 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1429 func_show_eval '$MV "$output_obj" "$obj"' \
1430 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1431 fi
1432 fi
1433
1434 $opt_dry_run || {
1435 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1436
1437 # Unlock the critical section if it was locked
1438 if test "$need_locks" != no; then
1439 removelist=$lockfile
1440 $RM "$lockfile"
1441 fi
1442 }
1443
1444 exit $EXIT_SUCCESS
1445}
1446
1447$opt_help || {
1448test "$mode" = compile && func_mode_compile ${1+"$@"}
1449}
1450
1451func_mode_help ()
1452{
1453 # We need to display help for each of the modes.
1454 case $mode in
1455 "")
1456 # Generic help is extracted from the usage comments
1457 # at the start of this file.
1458 func_help
1459 ;;
1460
1461 clean)
1462 $ECHO \
1463"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1464
1465Remove files from the build directory.
1466
1467RM is the name of the program to use to delete files associated with each FILE
1468(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1469to RM.
1470
1471If FILE is a libtool library, object or program, all the files associated
1472with it are deleted. Otherwise, only FILE itself is deleted using RM."
1473 ;;
1474
1475 compile)
1476 $ECHO \
1477"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1478
1479Compile a source file into a libtool library object.
1480
1481This mode accepts the following additional options:
1482
1483 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1484 -no-suppress do not suppress compiler output for multiple passes
1485 -prefer-pic try to building PIC objects only
1486 -prefer-non-pic try to building non-PIC objects only
1487 -shared do not build a \`.o' file suitable for static linking
1488 -static only build a \`.o' file suitable for static linking
1489
1490COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1491from the given SOURCEFILE.
1492
1493The output file name is determined by removing the directory component from
1494SOURCEFILE, then substituting the C source code suffix \`.c' with the
1495library object suffix, \`.lo'."
1496 ;;
1497
1498 execute)
1499 $ECHO \
1500"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1501
1502Automatically set library path, then run a program.
1503
1504This mode accepts the following additional options:
1505
1506 -dlopen FILE add the directory containing FILE to the library path
1507
1508This mode sets the library path environment variable according to \`-dlopen'
1509flags.
1510
1511If any of the ARGS are libtool executable wrappers, then they are translated
1512into their corresponding uninstalled binary, and any of their required library
1513directories are added to the library path.
1514
1515Then, COMMAND is executed, with ARGS as arguments."
1516 ;;
1517
1518 finish)
1519 $ECHO \
1520"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1521
1522Complete the installation of libtool libraries.
1523
1524Each LIBDIR is a directory that contains libtool libraries.
1525
1526The commands that this mode executes may require superuser privileges. Use
1527the \`--dry-run' option if you just want to see what would be executed."
1528 ;;
1529
1530 install)
1531 $ECHO \
1532"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1533
1534Install executables or libraries.
1535
1536INSTALL-COMMAND is the installation command. The first component should be
1537either the \`install' or \`cp' program.
1538
1539The following components of INSTALL-COMMAND are treated specially:
1540
1541 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1542
1543The rest of the components are interpreted as arguments to that command (only
1544BSD-compatible install options are recognized)."
1545 ;;
1546
1547 link)
1548 $ECHO \
1549"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1550
1551Link object files or libraries together to form another library, or to
1552create an executable program.
1553
1554LINK-COMMAND is a command using the C compiler that you would use to create
1555a program from several object files.
1556
1557The following components of LINK-COMMAND are treated specially:
1558
1559 -all-static do not do any dynamic linking at all
1560 -avoid-version do not add a version suffix if possible
1561 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1562 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1563 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1564 -export-symbols SYMFILE
1565 try to export only the symbols listed in SYMFILE
1566 -export-symbols-regex REGEX
1567 try to export only the symbols matching REGEX
1568 -LLIBDIR search LIBDIR for required installed libraries
1569 -lNAME OUTPUT-FILE requires the installed library libNAME
1570 -module build a library that can dlopened
1571 -no-fast-install disable the fast-install mode
1572 -no-install link a not-installable executable
1573 -no-undefined declare that a library does not refer to external symbols
1574 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1575 -objectlist FILE Use a list of object files found in FILE to specify objects
1576 -precious-files-regex REGEX
1577 don't remove output files matching REGEX
1578 -release RELEASE specify package release information
1579 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1580 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1581 -shared only do dynamic linking of libtool libraries
1582 -shrext SUFFIX override the standard shared library file extension
1583 -static do not do any dynamic linking of uninstalled libtool libraries
1584 -static-libtool-libs
1585 do not do any dynamic linking of libtool libraries
1586 -version-info CURRENT[:REVISION[:AGE]]
1587 specify library version info [each variable defaults to 0]
1588 -weak LIBNAME declare that the target provides the LIBNAME interface
1589
1590All other options (arguments beginning with \`-') are ignored.
1591
1592Every other argument is treated as a filename. Files ending in \`.la' are
1593treated as uninstalled libtool libraries, other files are standard or library
1594object files.
1595
1596If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1597only library objects (\`.lo' files) may be specified, and \`-rpath' is
1598required, except when creating a convenience library.
1599
1600If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1601using \`ar' and \`ranlib', or on Windows using \`lib'.
1602
1603If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1604is created, otherwise an executable program is created."
1605 ;;
1606
1607 uninstall)
1608 $ECHO \
1609"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1610
1611Remove libraries from an installation directory.
1612
1613RM is the name of the program to use to delete files associated with each FILE
1614(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1615to RM.
1616
1617If FILE is a libtool library, all the files associated with it are deleted.
1618Otherwise, only FILE itself is deleted using RM."
1619 ;;
1620
1621 *)
1622 func_fatal_help "invalid operation mode \`$mode'"
1623 ;;
1624 esac
1625
1626 $ECHO
1627 $ECHO "Try \`$progname --help' for more information about other modes."
1628
1629 exit $?
1630}
1631
1632 # Now that we've collected a possible --mode arg, show help if necessary
1633 $opt_help && func_mode_help
1634
1635
1636# func_mode_execute arg...
1637func_mode_execute ()
1638{
1639 $opt_debug
1640 # The first argument is the command name.
1641 cmd="$nonopt"
1642 test -z "$cmd" && \
1643 func_fatal_help "you must specify a COMMAND"
1644
1645 # Handle -dlopen flags immediately.
1646 for file in $execute_dlfiles; do
1647 test -f "$file" \
1648 || func_fatal_help "\`$file' is not a file"
1649
1650 dir=
1651 case $file in
1652 *.la)
1653 # Check to see that this really is a libtool archive.
1654 func_lalib_unsafe_p "$file" \
1655 || func_fatal_help "\`$lib' is not a valid libtool archive"
1656
1657 # Read the libtool library.
1658 dlname=
1659 library_names=
1660 func_source "$file"
1661
1662 # Skip this library if it cannot be dlopened.
1663 if test -z "$dlname"; then
1664 # Warn if it was a shared library.
1665 test -n "$library_names" && \
1666 func_warning "\`$file' was not linked with \`-export-dynamic'"
1667 continue
1668 fi
1669
1670 func_dirname "$file" "" "."
1671 dir="$func_dirname_result"
1672
1673 if test -f "$dir/$objdir/$dlname"; then
1674 dir="$dir/$objdir"
1675 else
1676 if test ! -f "$dir/$dlname"; then
1677 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1678 fi
1679 fi
1680 ;;
1681
1682 *.lo)
1683 # Just add the directory containing the .lo file.
1684 func_dirname "$file" "" "."
1685 dir="$func_dirname_result"
1686 ;;
1687
1688 *)
1689 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
1690 continue
1691 ;;
1692 esac
1693
1694 # Get the absolute pathname.
1695 absdir=`cd "$dir" && pwd`
1696 test -n "$absdir" && dir="$absdir"
1697
1698 # Now add the directory to shlibpath_var.
1699 if eval "test -z \"\$$shlibpath_var\""; then
1700 eval "$shlibpath_var=\"\$dir\""
1701 else
1702 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1703 fi
1704 done
1705
1706 # This variable tells wrapper scripts just to set shlibpath_var
1707 # rather than running their programs.
1708 libtool_execute_magic="$magic"
1709
1710 # Check if any of the arguments is a wrapper script.
1711 args=
1712 for file
1713 do
1714 case $file in
1715 -*) ;;
1716 *)
1717 # Do a test to see if this is really a libtool program.
1718 if func_ltwrapper_script_p "$file"; then
1719 func_source "$file"
1720 # Transform arg to wrapped name.
1721 file="$progdir/$program"
1722 elif func_ltwrapper_executable_p "$file"; then
1723 func_ltwrapper_scriptname "$file"
1724 func_source "$func_ltwrapper_scriptname_result"
1725 # Transform arg to wrapped name.
1726 file="$progdir/$program"
1727 fi
1728 ;;
1729 esac
1730 # Quote arguments (to preserve shell metacharacters).
1731 func_quote_for_eval "$file"
1732 args="$args $func_quote_for_eval_result"
1733 done
1734
1735 if test "X$opt_dry_run" = Xfalse; then
1736 if test -n "$shlibpath_var"; then
1737 # Export the shlibpath_var.
1738 eval "export $shlibpath_var"
1739 fi
1740
1741 # Restore saved environment variables
1742 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1743 do
1744 eval "if test \"\${save_$lt_var+set}\" = set; then
1745 $lt_var=\$save_$lt_var; export $lt_var
1746 else
1747 $lt_unset $lt_var
1748 fi"
1749 done
1750
1751 # Now prepare to actually exec the command.
1752 exec_cmd="\$cmd$args"
1753 else
1754 # Display what would be done.
1755 if test -n "$shlibpath_var"; then
1756 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1757 $ECHO "export $shlibpath_var"
1758 fi
1759 $ECHO "$cmd$args"
1760 exit $EXIT_SUCCESS
1761 fi
1762}
1763
1764test "$mode" = execute && func_mode_execute ${1+"$@"}
1765
1766
1767# func_mode_finish arg...
1768func_mode_finish ()
1769{
1770 $opt_debug
1771 libdirs="$nonopt"
1772 admincmds=
1773
1774 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1775 for dir
1776 do
1777 libdirs="$libdirs $dir"
1778 done
1779
1780 for libdir in $libdirs; do
1781 if test -n "$finish_cmds"; then
1782 # Do each command in the finish commands.
1783 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1784'"$cmd"'"'
1785 fi
1786 if test -n "$finish_eval"; then
1787 # Do the single finish_eval.
1788 eval cmds=\"$finish_eval\"
1789 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
1790 $cmds"
1791 fi
1792 done
1793 fi
1794
1795 # Exit here if they wanted silent mode.
1796 $opt_silent && exit $EXIT_SUCCESS
1797
1798 $ECHO "X----------------------------------------------------------------------" | $Xsed
1799 $ECHO "Libraries have been installed in:"
1800 for libdir in $libdirs; do
1801 $ECHO " $libdir"
1802 done
1803 $ECHO
1804 $ECHO "If you ever happen to want to link against installed libraries"
1805 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1806 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1807 $ECHO "flag during linking and do at least one of the following:"
1808 if test -n "$shlibpath_var"; then
1809 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1810 $ECHO " during execution"
1811 fi
1812 if test -n "$runpath_var"; then
1813 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1814 $ECHO " during linking"
1815 fi
1816 if test -n "$hardcode_libdir_flag_spec"; then
1817 libdir=LIBDIR
1818 eval flag=\"$hardcode_libdir_flag_spec\"
1819
1820 $ECHO " - use the \`$flag' linker flag"
1821 fi
1822 if test -n "$admincmds"; then
1823 $ECHO " - have your system administrator run these commands:$admincmds"
1824 fi
1825 if test -f /etc/ld.so.conf; then
1826 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1827 fi
1828 $ECHO
1829
1830 $ECHO "See any operating system documentation about shared libraries for"
1831 case $host in
1832 solaris2.[6789]|solaris2.1[0-9])
1833 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1834 $ECHO "pages."
1835 ;;
1836 *)
1837 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1838 ;;
1839 esac
1840 $ECHO "X----------------------------------------------------------------------" | $Xsed
1841 exit $EXIT_SUCCESS
1842}
1843
1844test "$mode" = finish && func_mode_finish ${1+"$@"}
1845
1846
1847# func_mode_install arg...
1848func_mode_install ()
1849{
1850 $opt_debug
1851 # There may be an optional sh(1) argument at the beginning of
1852 # install_prog (especially on Windows NT).
1853 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1854 # Allow the use of GNU shtool's install command.
1855 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
1856 # Aesthetically quote it.
1857 func_quote_for_eval "$nonopt"
1858 install_prog="$func_quote_for_eval_result "
1859 arg=$1
1860 shift
1861 else
1862 install_prog=
1863 arg=$nonopt
1864 fi
1865
1866 # The real first argument should be the name of the installation program.
1867 # Aesthetically quote it.
1868 func_quote_for_eval "$arg"
1869 install_prog="$install_prog$func_quote_for_eval_result"
1870
1871 # We need to accept at least all the BSD install flags.
1872 dest=
1873 files=
1874 opts=
1875 prev=
1876 install_type=
1877 isdir=no
1878 stripme=
1879 for arg
1880 do
1881 if test -n "$dest"; then
1882 files="$files $dest"
1883 dest=$arg
1884 continue
1885 fi
1886
1887 case $arg in
1888 -d) isdir=yes ;;
1889 -f)
1890 case " $install_prog " in
1891 *[\\\ /]cp\ *) ;;
1892 *) prev=$arg ;;
1893 esac
1894 ;;
1895 -g | -m | -o)
1896 prev=$arg
1897 ;;
1898 -s)
1899 stripme=" -s"
1900 continue
1901 ;;
1902 -*)
1903 ;;
1904 *)
1905 # If the previous option needed an argument, then skip it.
1906 if test -n "$prev"; then
1907 prev=
1908 else
1909 dest=$arg
1910 continue
1911 fi
1912 ;;
1913 esac
1914
1915 # Aesthetically quote the argument.
1916 func_quote_for_eval "$arg"
1917 install_prog="$install_prog $func_quote_for_eval_result"
1918 done
1919
1920 test -z "$install_prog" && \
1921 func_fatal_help "you must specify an install program"
1922
1923 test -n "$prev" && \
1924 func_fatal_help "the \`$prev' option requires an argument"
1925
1926 if test -z "$files"; then
1927 if test -z "$dest"; then
1928 func_fatal_help "no file or destination specified"
1929 else
1930 func_fatal_help "you must specify a destination"
1931 fi
1932 fi
1933
1934 # Strip any trailing slash from the destination.
1935 func_stripname '' '/' "$dest"
1936 dest=$func_stripname_result
1937
1938 # Check to see that the destination is a directory.
1939 test -d "$dest" && isdir=yes
1940 if test "$isdir" = yes; then
1941 destdir="$dest"
1942 destname=
1943 else
1944 func_dirname_and_basename "$dest" "" "."
1945 destdir="$func_dirname_result"
1946 destname="$func_basename_result"
1947
1948 # Not a directory, so check to see that there is only one file specified.
1949 set dummy $files; shift
1950 test "$#" -gt 1 && \
1951 func_fatal_help "\`$dest' is not a directory"
1952 fi
1953 case $destdir in
1954 [\\/]* | [A-Za-z]:[\\/]*) ;;
1955 *)
1956 for file in $files; do
1957 case $file in
1958 *.lo) ;;
1959 *)
1960 func_fatal_help "\`$destdir' must be an absolute directory name"
1961 ;;
1962 esac
1963 done
1964 ;;
1965 esac
1966
1967 # This variable tells wrapper scripts just to set variables rather
1968 # than running their programs.
1969 libtool_install_magic="$magic"
1970
1971 staticlibs=
1972 future_libdirs=
1973 current_libdirs=
1974 for file in $files; do
1975
1976 # Do each installation.
1977 case $file in
1978 *.$libext)
1979 # Do the static libraries later.
1980 staticlibs="$staticlibs $file"
1981 ;;
1982
1983 *.la)
1984 # Check to see that this really is a libtool archive.
1985 func_lalib_unsafe_p "$file" \
1986 || func_fatal_help "\`$file' is not a valid libtool archive"
1987
1988 library_names=
1989 old_library=
1990 relink_command=
1991 func_source "$file"
1992
1993 # Add the libdir to current_libdirs if it is the destination.
1994 if test "X$destdir" = "X$libdir"; then
1995 case "$current_libdirs " in
1996 *" $libdir "*) ;;
1997 *) current_libdirs="$current_libdirs $libdir" ;;
1998 esac
1999 else
2000 # Note the libdir as a future libdir.
2001 case "$future_libdirs " in
2002 *" $libdir "*) ;;
2003 *) future_libdirs="$future_libdirs $libdir" ;;
2004 esac
2005 fi
2006
2007 func_dirname "$file" "/" ""
2008 dir="$func_dirname_result"
2009 dir="$dir$objdir"
2010
2011 if test -n "$relink_command"; then
2012 # Determine the prefix the user has applied to our future dir.
2013 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2014
2015 # Don't allow the user to place us outside of our expected
2016 # location b/c this prevents finding dependent libraries that
2017 # are installed to the same prefix.
2018 # At present, this check doesn't affect windows .dll's that
2019 # are installed into $libdir/../bin (currently, that works fine)
2020 # but it's something to keep an eye on.
2021 test "$inst_prefix_dir" = "$destdir" && \
2022 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2023
2024 if test -n "$inst_prefix_dir"; then
2025 # Stick the inst_prefix_dir data into the link command.
2026 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2027 else
2028 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2029 fi
2030
2031 func_warning "relinking \`$file'"
2032 func_show_eval "$relink_command" \
2033 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2034 fi
2035
2036 # See the names of the shared library.
2037 set dummy $library_names; shift
2038 if test -n "$1"; then
2039 realname="$1"
2040 shift
2041
2042 srcname="$realname"
2043 test -n "$relink_command" && srcname="$realname"T
2044
2045 # Install the shared library and build the symlinks.
2046 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2047 'exit $?'
2048 tstripme="$stripme"
2049 case $host_os in
2050 cygwin* | mingw* | pw32* | cegcc*)
2051 case $realname in
2052 *.dll.a)
2053 tstripme=""
2054 ;;
2055 esac
2056 ;;
2057 esac
2058 if test -n "$tstripme" && test -n "$striplib"; then
2059 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2060 fi
2061
2062 if test "$#" -gt 0; then
2063 # Delete the old symlinks, and create new ones.
2064 # Try `ln -sf' first, because the `ln' binary might depend on
2065 # the symlink we replace! Solaris /bin/ln does not understand -f,
2066 # so we also need to try rm && ln -s.
2067 for linkname
2068 do
2069 test "$linkname" != "$realname" \
2070 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2071 done
2072 fi
2073
2074 # Do each command in the postinstall commands.
2075 lib="$destdir/$realname"
2076 func_execute_cmds "$postinstall_cmds" 'exit $?'
2077 fi
2078
2079 # Install the pseudo-library for information purposes.
2080 func_basename "$file"
2081 name="$func_basename_result"
2082 instname="$dir/$name"i
2083 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2084
2085 # Maybe install the static library, too.
2086 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2087 ;;
2088
2089 *.lo)
2090 # Install (i.e. copy) a libtool object.
2091
2092 # Figure out destination file name, if it wasn't already specified.
2093 if test -n "$destname"; then
2094 destfile="$destdir/$destname"
2095 else
2096 func_basename "$file"
2097 destfile="$func_basename_result"
2098 destfile="$destdir/$destfile"
2099 fi
2100
2101 # Deduce the name of the destination old-style object file.
2102 case $destfile in
2103 *.lo)
2104 func_lo2o "$destfile"
2105 staticdest=$func_lo2o_result
2106 ;;
2107 *.$objext)
2108 staticdest="$destfile"
2109 destfile=
2110 ;;
2111 *)
2112 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2113 ;;
2114 esac
2115
2116 # Install the libtool object if requested.
2117 test -n "$destfile" && \
2118 func_show_eval "$install_prog $file $destfile" 'exit $?'
2119
2120 # Install the old object if enabled.
2121 if test "$build_old_libs" = yes; then
2122 # Deduce the name of the old-style object file.
2123 func_lo2o "$file"
2124 staticobj=$func_lo2o_result
2125 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2126 fi
2127 exit $EXIT_SUCCESS
2128 ;;
2129
2130 *)
2131 # Figure out destination file name, if it wasn't already specified.
2132 if test -n "$destname"; then
2133 destfile="$destdir/$destname"
2134 else
2135 func_basename "$file"
2136 destfile="$func_basename_result"
2137 destfile="$destdir/$destfile"
2138 fi
2139
2140 # If the file is missing, and there is a .exe on the end, strip it
2141 # because it is most likely a libtool script we actually want to
2142 # install
2143 stripped_ext=""
2144 case $file in
2145 *.exe)
2146 if test ! -f "$file"; then
2147 func_stripname '' '.exe' "$file"
2148 file=$func_stripname_result
2149 stripped_ext=".exe"
2150 fi
2151 ;;
2152 esac
2153
2154 # Do a test to see if this is really a libtool program.
2155 case $host in
2156 *cygwin* | *mingw*)
2157 if func_ltwrapper_executable_p "$file"; then
2158 func_ltwrapper_scriptname "$file"
2159 wrapper=$func_ltwrapper_scriptname_result
2160 else
2161 func_stripname '' '.exe' "$file"
2162 wrapper=$func_stripname_result
2163 fi
2164 ;;
2165 *)
2166 wrapper=$file
2167 ;;
2168 esac
2169 if func_ltwrapper_script_p "$wrapper"; then
2170 notinst_deplibs=
2171 relink_command=
2172
2173 func_source "$wrapper"
2174
2175 # Check the variables that should have been set.
2176 test -z "$generated_by_libtool_version" && \
2177 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2178
2179 finalize=yes
2180 for lib in $notinst_deplibs; do
2181 # Check to see that each library is installed.
2182 libdir=
2183 if test -f "$lib"; then
2184 func_source "$lib"
2185 fi
2186 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2187 if test -n "$libdir" && test ! -f "$libfile"; then
2188 func_warning "\`$lib' has not been installed in \`$libdir'"
2189 finalize=no
2190 fi
2191 done
2192
2193 relink_command=
2194 func_source "$wrapper"
2195
2196 outputname=
2197 if test "$fast_install" = no && test -n "$relink_command"; then
2198 $opt_dry_run || {
2199 if test "$finalize" = yes; then
2200 tmpdir=`func_mktempdir`
2201 func_basename "$file$stripped_ext"
2202 file="$func_basename_result"
2203 outputname="$tmpdir/$file"
2204 # Replace the output file specification.
2205 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2206
2207 $opt_silent || {
2208 func_quote_for_expand "$relink_command"
2209 eval "func_echo $func_quote_for_expand_result"
2210 }
2211 if eval "$relink_command"; then :
2212 else
2213 func_error "error: relink \`$file' with the above command before installing it"
2214 $opt_dry_run || ${RM}r "$tmpdir"
2215 continue
2216 fi
2217 file="$outputname"
2218 else
2219 func_warning "cannot relink \`$file'"
2220 fi
2221 }
2222 else
2223 # Install the binary that we compiled earlier.
2224 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2225 fi
2226 fi
2227
2228 # remove .exe since cygwin /usr/bin/install will append another
2229 # one anyway
2230 case $install_prog,$host in
2231 */usr/bin/install*,*cygwin*)
2232 case $file:$destfile in
2233 *.exe:*.exe)
2234 # this is ok
2235 ;;
2236 *.exe:*)
2237 destfile=$destfile.exe
2238 ;;
2239 *:*.exe)
2240 func_stripname '' '.exe' "$destfile"
2241 destfile=$func_stripname_result
2242 ;;
2243 esac
2244 ;;
2245 esac
2246 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2247 $opt_dry_run || if test -n "$outputname"; then
2248 ${RM}r "$tmpdir"
2249 fi
2250 ;;
2251 esac
2252 done
2253
2254 for file in $staticlibs; do
2255 func_basename "$file"
2256 name="$func_basename_result"
2257
2258 # Set up the ranlib parameters.
2259 oldlib="$destdir/$name"
2260
2261 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2262
2263 if test -n "$stripme" && test -n "$old_striplib"; then
2264 func_show_eval "$old_striplib $oldlib" 'exit $?'
2265 fi
2266
2267 # Do each command in the postinstall commands.
2268 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2269 done
2270
2271 test -n "$future_libdirs" && \
2272 func_warning "remember to run \`$progname --finish$future_libdirs'"
2273
2274 if test -n "$current_libdirs"; then
2275 # Maybe just do a dry run.
2276 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2277 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2278 else
2279 exit $EXIT_SUCCESS
2280 fi
2281}
2282
2283test "$mode" = install && func_mode_install ${1+"$@"}
2284
2285
2286# func_generate_dlsyms outputname originator pic_p
2287# Extract symbols from dlprefiles and create ${outputname}S.o with
2288# a dlpreopen symbol table.
2289func_generate_dlsyms ()
2290{
2291 $opt_debug
2292 my_outputname="$1"
2293 my_originator="$2"
2294 my_pic_p="${3-no}"
2295 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2296 my_dlsyms=
2297
2298 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2299 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2300 my_dlsyms="${my_outputname}S.c"
2301 else
2302 func_error "not configured to extract global symbols from dlpreopened files"
2303 fi
2304 fi
2305
2306 if test -n "$my_dlsyms"; then
2307 case $my_dlsyms in
2308 "") ;;
2309 *.c)
2310 # Discover the nlist of each of the dlfiles.
2311 nlist="$output_objdir/${my_outputname}.nm"
2312
2313 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2314
2315 # Parse the name list into a source file.
2316 func_verbose "creating $output_objdir/$my_dlsyms"
2317
2318 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2319/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2320/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2321
2322#ifdef __cplusplus
2323extern \"C\" {
2324#endif
2325
2326/* External symbol declarations for the compiler. */\
2327"
2328
2329 if test "$dlself" = yes; then
2330 func_verbose "generating symbol list for \`$output'"
2331
2332 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2333
2334 # Add our own program objects to the symbol list.
2335 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2336 for progfile in $progfiles; do
2337 func_verbose "extracting global C symbols from \`$progfile'"
2338 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2339 done
2340
2341 if test -n "$exclude_expsyms"; then
2342 $opt_dry_run || {
2343 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2344 eval '$MV "$nlist"T "$nlist"'
2345 }
2346 fi
2347
2348 if test -n "$export_symbols_regex"; then
2349 $opt_dry_run || {
2350 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2351 eval '$MV "$nlist"T "$nlist"'
2352 }
2353 fi
2354
2355 # Prepare the list of exported symbols
2356 if test -z "$export_symbols"; then
2357 export_symbols="$output_objdir/$outputname.exp"
2358 $opt_dry_run || {
2359 $RM $export_symbols
2360 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2361 case $host in
2362 *cygwin* | *mingw* | *cegcc* )
2363 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2364 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2365 ;;
2366 esac
2367 }
2368 else
2369 $opt_dry_run || {
2370 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2371 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2372 eval '$MV "$nlist"T "$nlist"'
2373 case $host in
2374 *cygwin | *mingw* | *cegcc* )
2375 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2376 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2377 ;;
2378 esac
2379 }
2380 fi
2381 fi
2382
2383 for dlprefile in $dlprefiles; do
2384 func_verbose "extracting global C symbols from \`$dlprefile'"
2385 func_basename "$dlprefile"
2386 name="$func_basename_result"
2387 $opt_dry_run || {
2388 eval '$ECHO ": $name " >> "$nlist"'
2389 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2390 }
2391 done
2392
2393 $opt_dry_run || {
2394 # Make sure we have at least an empty file.
2395 test -f "$nlist" || : > "$nlist"
2396
2397 if test -n "$exclude_expsyms"; then
2398 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2399 $MV "$nlist"T "$nlist"
2400 fi
2401
2402 # Try sorting and uniquifying the output.
2403 if $GREP -v "^: " < "$nlist" |
2404 if sort -k 3 </dev/null >/dev/null 2>&1; then
2405 sort -k 3
2406 else
2407 sort +2
2408 fi |
2409 uniq > "$nlist"S; then
2410 :
2411 else
2412 $GREP -v "^: " < "$nlist" > "$nlist"S
2413 fi
2414
2415 if test -f "$nlist"S; then
2416 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2417 else
2418 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2419 fi
2420
2421 $ECHO >> "$output_objdir/$my_dlsyms" "\
2422
2423/* The mapping between symbol names and symbols. */
2424typedef struct {
2425 const char *name;
2426 void *address;
2427} lt_dlsymlist;
2428"
2429 case $host in
2430 *cygwin* | *mingw* | *cegcc* )
2431 $ECHO >> "$output_objdir/$my_dlsyms" "\
2432/* DATA imports from DLLs on WIN32 con't be const, because
2433 runtime relocations are performed -- see ld's documentation
2434 on pseudo-relocs. */"
2435 lt_dlsym_const= ;;
2436 *osf5*)
2437 echo >> "$output_objdir/$my_dlsyms" "\
2438/* This system does not cope well with relocations in const data */"
2439 lt_dlsym_const= ;;
2440 *)
2441 lt_dlsym_const=const ;;
2442 esac
2443
2444 $ECHO >> "$output_objdir/$my_dlsyms" "\
2445extern $lt_dlsym_const lt_dlsymlist
2446lt_${my_prefix}_LTX_preloaded_symbols[];
2447$lt_dlsym_const lt_dlsymlist
2448lt_${my_prefix}_LTX_preloaded_symbols[] =
2449{\
2450 { \"$my_originator\", (void *) 0 },"
2451
2452 case $need_lib_prefix in
2453 no)
2454 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2455 ;;
2456 *)
2457 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2458 ;;
2459 esac
2460 $ECHO >> "$output_objdir/$my_dlsyms" "\
2461 {0, (void *) 0}
2462};
2463
2464/* This works around a problem in FreeBSD linker */
2465#ifdef FREEBSD_WORKAROUND
2466static const void *lt_preloaded_setup() {
2467 return lt_${my_prefix}_LTX_preloaded_symbols;
2468}
2469#endif
2470
2471#ifdef __cplusplus
2472}
2473#endif\
2474"
2475 } # !$opt_dry_run
2476
2477 pic_flag_for_symtable=
2478 case "$compile_command " in
2479 *" -static "*) ;;
2480 *)
2481 case $host in
2482 # compiling the symbol table file with pic_flag works around
2483 # a FreeBSD bug that causes programs to crash when -lm is
2484 # linked before any other PIC object. But we must not use
2485 # pic_flag when linking with -static. The problem exists in
2486 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2487 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2488 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2489 *-*-hpux*)
2490 pic_flag_for_symtable=" $pic_flag" ;;
2491 *)
2492 if test "X$my_pic_p" != Xno; then
2493 pic_flag_for_symtable=" $pic_flag"
2494 fi
2495 ;;
2496 esac
2497 ;;
2498 esac
2499 symtab_cflags=
2500 for arg in $LTCFLAGS; do
2501 case $arg in
2502 -pie | -fpie | -fPIE) ;;
2503 *) symtab_cflags="$symtab_cflags $arg" ;;
2504 esac
2505 done
2506
2507 # Now compile the dynamic symbol file.
2508 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2509
2510 # Clean up the generated files.
2511 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2512
2513 # Transform the symbol file into the correct name.
2514 symfileobj="$output_objdir/${my_outputname}S.$objext"
2515 case $host in
2516 *cygwin* | *mingw* | *cegcc* )
2517 if test -f "$output_objdir/$my_outputname.def"; then
2518 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2520 else
2521 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2522 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2523 fi
2524 ;;
2525 *)
2526 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2527 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2528 ;;
2529 esac
2530 ;;
2531 *)
2532 func_fatal_error "unknown suffix for \`$my_dlsyms'"
2533 ;;
2534 esac
2535 else
2536 # We keep going just in case the user didn't refer to
2537 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2538 # really was required.
2539
2540 # Nullify the symbol file.
2541 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2542 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2543 fi
2544}
2545
2546# func_win32_libid arg
2547# return the library type of file 'arg'
2548#
2549# Need a lot of goo to handle *both* DLLs and import libs
2550# Has to be a shell function in order to 'eat' the argument
2551# that is supplied when $file_magic_command is called.
2552func_win32_libid ()
2553{
2554 $opt_debug
2555 win32_libid_type="unknown"
2556 win32_fileres=`file -L $1 2>/dev/null`
2557 case $win32_fileres in
2558 *ar\ archive\ import\ library*) # definitely import
2559 win32_libid_type="x86 archive import"
2560 ;;
2561 *ar\ archive*) # could be an import, or static
2562 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2563 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2564 win32_nmres=`eval $NM -f posix -A $1 |
2565 $SED -n -e '
2566 1,100{
2567 / I /{
2568 s,.*,import,
2569 p
2570 q
2571 }
2572 }'`
2573 case $win32_nmres in
2574 import*) win32_libid_type="x86 archive import";;
2575 *) win32_libid_type="x86 archive static";;
2576 esac
2577 fi
2578 ;;
2579 *DLL*)
2580 win32_libid_type="x86 DLL"
2581 ;;
2582 *executable*) # but shell scripts are "executable" too...
2583 case $win32_fileres in
2584 *MS\ Windows\ PE\ Intel*)
2585 win32_libid_type="x86 DLL"
2586 ;;
2587 esac
2588 ;;
2589 esac
2590 $ECHO "$win32_libid_type"
2591}
2592
2593
2594
2595# func_extract_an_archive dir oldlib
2596func_extract_an_archive ()
2597{
2598 $opt_debug
2599 f_ex_an_ar_dir="$1"; shift
2600 f_ex_an_ar_oldlib="$1"
2601 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2602 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2603 :
2604 else
2605 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2606 fi
2607}
2608
2609
2610# func_extract_archives gentop oldlib ...
2611func_extract_archives ()
2612{
2613 $opt_debug
2614 my_gentop="$1"; shift
2615 my_oldlibs=${1+"$@"}
2616 my_oldobjs=""
2617 my_xlib=""
2618 my_xabs=""
2619 my_xdir=""
2620
2621 for my_xlib in $my_oldlibs; do
2622 # Extract the objects.
2623 case $my_xlib in
2624 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
2625 *) my_xabs=`pwd`"/$my_xlib" ;;
2626 esac
2627 func_basename "$my_xlib"
2628 my_xlib="$func_basename_result"
2629 my_xlib_u=$my_xlib
2630 while :; do
2631 case " $extracted_archives " in
2632 *" $my_xlib_u "*)
2633 func_arith $extracted_serial + 1
2634 extracted_serial=$func_arith_result
2635 my_xlib_u=lt$extracted_serial-$my_xlib ;;
2636 *) break ;;
2637 esac
2638 done
2639 extracted_archives="$extracted_archives $my_xlib_u"
2640 my_xdir="$my_gentop/$my_xlib_u"
2641
2642 func_mkdir_p "$my_xdir"
2643
2644 case $host in
2645 *-darwin*)
2646 func_verbose "Extracting $my_xabs"
2647 # Do not bother doing anything if just a dry run
2648 $opt_dry_run || {
2649 darwin_orig_dir=`pwd`
2650 cd $my_xdir || exit $?
2651 darwin_archive=$my_xabs
2652 darwin_curdir=`pwd`
2653 darwin_base_archive=`basename "$darwin_archive"`
2654 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2655 if test -n "$darwin_arches"; then
2656 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2657 darwin_arch=
2658 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2659 for darwin_arch in $darwin_arches ; do
2660 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2661 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2662 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2663 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
2664 cd "$darwin_curdir"
2665 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2666 done # $darwin_arches
2667 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2668 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2669 darwin_file=
2670 darwin_files=
2671 for darwin_file in $darwin_filelist; do
2672 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2673 $LIPO -create -output "$darwin_file" $darwin_files
2674 done # $darwin_filelist
2675 $RM -rf unfat-$$
2676 cd "$darwin_orig_dir"
2677 else
2678 cd $darwin_orig_dir
2679 func_extract_an_archive "$my_xdir" "$my_xabs"
2680 fi # $darwin_arches
2681 } # !$opt_dry_run
2682 ;;
2683 *)
2684 func_extract_an_archive "$my_xdir" "$my_xabs"
2685 ;;
2686 esac
2687 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2688 done
2689
2690 func_extract_archives_result="$my_oldobjs"
2691}
2692
2693
2694
2695# func_emit_wrapper_part1 [arg=no]
2696#
2697# Emit the first part of a libtool wrapper script on stdout.
2698# For more information, see the description associated with
2699# func_emit_wrapper(), below.
2700func_emit_wrapper_part1 ()
2701{
2702 func_emit_wrapper_part1_arg1=no
2703 if test -n "$1" ; then
2704 func_emit_wrapper_part1_arg1=$1
2705 fi
2706
2707 $ECHO "\
2708#! $SHELL
2709
2710# $output - temporary wrapper script for $objdir/$outputname
2711# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2712#
2713# The $output program cannot be directly executed until all the libtool
2714# libraries that it depends on are installed.
2715#
2716# This wrapper script should never be moved out of the build directory.
2717# If it is, it will not operate correctly.
2718
2719# Sed substitution that helps us do robust quoting. It backslashifies
2720# metacharacters that are still active within double-quoted strings.
2721Xsed='${SED} -e 1s/^X//'
2722sed_quote_subst='$sed_quote_subst'
2723
2724# Be Bourne compatible
2725if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2726 emulate sh
2727 NULLCMD=:
2728 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2729 # is contrary to our usage. Disable this feature.
2730 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2731 setopt NO_GLOB_SUBST
2732else
2733 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2734fi
2735BIN_SH=xpg4; export BIN_SH # for Tru64
2736DUALCASE=1; export DUALCASE # for MKS sh
2737
2738# The HP-UX ksh and POSIX shell print the target directory to stdout
2739# if CDPATH is set.
2740(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2741
2742relink_command=\"$relink_command\"
2743
2744# This environment variable determines our operation mode.
2745if test \"\$libtool_install_magic\" = \"$magic\"; then
2746 # install mode needs the following variables:
2747 generated_by_libtool_version='$macro_version'
2748 notinst_deplibs='$notinst_deplibs'
2749else
2750 # When we are sourced in execute mode, \$file and \$ECHO are already set.
2751 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2752 ECHO=\"$qecho\"
2753 file=\"\$0\"
2754 # Make sure echo works.
2755 if test \"X\$1\" = X--no-reexec; then
2756 # Discard the --no-reexec flag, and continue.
2757 shift
2758 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2759 # Yippee, \$ECHO works!
2760 :
2761 else
2762 # Restart under the correct shell, and then maybe \$ECHO will work.
2763 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2764 fi
2765 fi\
2766"
2767 $ECHO "\
2768
2769 # Find the directory that this script lives in.
2770 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2771 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2772
2773 # Follow symbolic links until we get to the real thisdir.
2774 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2775 while test -n \"\$file\"; do
2776 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2777
2778 # If there was a directory component, then change thisdir.
2779 if test \"x\$destdir\" != \"x\$file\"; then
2780 case \"\$destdir\" in
2781 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2782 *) thisdir=\"\$thisdir/\$destdir\" ;;
2783 esac
2784 fi
2785
2786 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2787 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2788 done
2789"
2790}
2791# end: func_emit_wrapper_part1
2792
2793# func_emit_wrapper_part2 [arg=no]
2794#
2795# Emit the second part of a libtool wrapper script on stdout.
2796# For more information, see the description associated with
2797# func_emit_wrapper(), below.
2798func_emit_wrapper_part2 ()
2799{
2800 func_emit_wrapper_part2_arg1=no
2801 if test -n "$1" ; then
2802 func_emit_wrapper_part2_arg1=$1
2803 fi
2804
2805 $ECHO "\
2806
2807 # Usually 'no', except on cygwin/mingw when embedded into
2808 # the cwrapper.
2809 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2810 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2811 # special case for '.'
2812 if test \"\$thisdir\" = \".\"; then
2813 thisdir=\`pwd\`
2814 fi
2815 # remove .libs from thisdir
2816 case \"\$thisdir\" in
2817 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2818 $objdir ) thisdir=. ;;
2819 esac
2820 fi
2821
2822 # Try to get the absolute directory name.
2823 absdir=\`cd \"\$thisdir\" && pwd\`
2824 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2825"
2826
2827 if test "$fast_install" = yes; then
2828 $ECHO "\
2829 program=lt-'$outputname'$exeext
2830 progdir=\"\$thisdir/$objdir\"
2831
2832 if test ! -f \"\$progdir/\$program\" ||
2833 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2834 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2835
2836 file=\"\$\$-\$program\"
2837
2838 if test ! -d \"\$progdir\"; then
2839 $MKDIR \"\$progdir\"
2840 else
2841 $RM \"\$progdir/\$file\"
2842 fi"
2843
2844 $ECHO "\
2845
2846 # relink executable if necessary
2847 if test -n \"\$relink_command\"; then
2848 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2849 else
2850 $ECHO \"\$relink_command_output\" >&2
2851 $RM \"\$progdir/\$file\"
2852 exit 1
2853 fi
2854 fi
2855
2856 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2857 { $RM \"\$progdir/\$program\";
2858 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2859 $RM \"\$progdir/\$file\"
2860 fi"
2861 else
2862 $ECHO "\
2863 program='$outputname'
2864 progdir=\"\$thisdir/$objdir\"
2865"
2866 fi
2867
2868 $ECHO "\
2869
2870 if test -f \"\$progdir/\$program\"; then"
2871
2872 # Export our shlibpath_var if we have one.
2873 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2874 $ECHO "\
2875 # Add our own library path to $shlibpath_var
2876 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2877
2878 # Some systems cannot cope with colon-terminated $shlibpath_var
2879 # The second colon is a workaround for a bug in BeOS R4 sed
2880 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2881
2882 export $shlibpath_var
2883"
2884 fi
2885
2886 # fixup the dll searchpath if we need to.
2887 if test -n "$dllsearchpath"; then
2888 $ECHO "\
2889 # Add the dll search path components to the executable PATH
2890 PATH=$dllsearchpath:\$PATH
2891"
2892 fi
2893
2894 $ECHO "\
2895 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896 # Run the actual program with our arguments.
2897"
2898 case $host in
2899 # Backslashes separate directories on plain windows
2900 *-*-mingw | *-*-os2* | *-cegcc*)
2901 $ECHO "\
2902 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2903"
2904 ;;
2905
2906 *)
2907 $ECHO "\
2908 exec \"\$progdir/\$program\" \${1+\"\$@\"}
2909"
2910 ;;
2911 esac
2912 $ECHO "\
2913 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2914 exit 1
2915 fi
2916 else
2917 # The program doesn't exist.
2918 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2921 exit 1
2922 fi
2923fi\
2924"
2925}
2926# end: func_emit_wrapper_part2
2927
2928
2929# func_emit_wrapper [arg=no]
2930#
2931# Emit a libtool wrapper script on stdout.
2932# Don't directly open a file because we may want to
2933# incorporate the script contents within a cygwin/mingw
2934# wrapper executable. Must ONLY be called from within
2935# func_mode_link because it depends on a number of variables
2936# set therein.
2937#
2938# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2939# variable will take. If 'yes', then the emitted script
2940# will assume that the directory in which it is stored is
2941# the $objdir directory. This is a cygwin/mingw-specific
2942# behavior.
2943func_emit_wrapper ()
2944{
2945 func_emit_wrapper_arg1=no
2946 if test -n "$1" ; then
2947 func_emit_wrapper_arg1=$1
2948 fi
2949
2950 # split this up so that func_emit_cwrapperexe_src
2951 # can call each part independently.
2952 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2953 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2954}
2955
2956
2957# func_to_host_path arg
2958#
2959# Convert paths to host format when used with build tools.
2960# Intended for use with "native" mingw (where libtool itself
2961# is running under the msys shell), or in the following cross-
2962# build environments:
2963# $build $host
2964# mingw (msys) mingw [e.g. native]
2965# cygwin mingw
2966# *nix + wine mingw
2967# where wine is equipped with the `winepath' executable.
2968# In the native mingw case, the (msys) shell automatically
2969# converts paths for any non-msys applications it launches,
2970# but that facility isn't available from inside the cwrapper.
2971# Similar accommodations are necessary for $host mingw and
2972# $build cygwin. Calling this function does no harm for other
2973# $host/$build combinations not listed above.
2974#
2975# ARG is the path (on $build) that should be converted to
2976# the proper representation for $host. The result is stored
2977# in $func_to_host_path_result.
2978func_to_host_path ()
2979{
2980 func_to_host_path_result="$1"
2981 if test -n "$1" ; then
2982 case $host in
2983 *mingw* )
2984 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2985 case $build in
2986 *mingw* ) # actually, msys
2987 # awkward: cmd appends spaces to result
2988 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
2989 func_to_host_path_tmp1=`( cmd //c echo "$1" |\
2990 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2991 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2992 $SED -e "$lt_sed_naive_backslashify"`
2993 ;;
2994 *cygwin* )
2995 func_to_host_path_tmp1=`cygpath -w "$1"`
2996 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2997 $SED -e "$lt_sed_naive_backslashify"`
2998 ;;
2999 * )
3000 # Unfortunately, winepath does not exit with a non-zero
3001 # error code, so we are forced to check the contents of
3002 # stdout. On the other hand, if the command is not
3003 # found, the shell will set an exit code of 127 and print
3004 # *an error message* to stdout. So we must check for both
3005 # error code of zero AND non-empty stdout, which explains
3006 # the odd construction:
3007 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3008 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3009 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3010 $SED -e "$lt_sed_naive_backslashify"`
3011 else
3012 # Allow warning below.
3013 func_to_host_path_result=""
3014 fi
3015 ;;
3016 esac
3017 if test -z "$func_to_host_path_result" ; then
3018 func_error "Could not determine host path corresponding to"
3019 func_error " '$1'"
3020 func_error "Continuing, but uninstalled executables may not work."
3021 # Fallback:
3022 func_to_host_path_result="$1"
3023 fi
3024 ;;
3025 esac
3026 fi
3027}
3028# end: func_to_host_path
3029
3030# func_to_host_pathlist arg
3031#
3032# Convert pathlists to host format when used with build tools.
3033# See func_to_host_path(), above. This function supports the
3034# following $build/$host combinations (but does no harm for
3035# combinations not listed here):
3036# $build $host
3037# mingw (msys) mingw [e.g. native]
3038# cygwin mingw
3039# *nix + wine mingw
3040#
3041# Path separators are also converted from $build format to
3042# $host format. If ARG begins or ends with a path separator
3043# character, it is preserved (but converted to $host format)
3044# on output.
3045#
3046# ARG is a pathlist (on $build) that should be converted to
3047# the proper representation on $host. The result is stored
3048# in $func_to_host_pathlist_result.
3049func_to_host_pathlist ()
3050{
3051 func_to_host_pathlist_result="$1"
3052 if test -n "$1" ; then
3053 case $host in
3054 *mingw* )
3055 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3056 # Remove leading and trailing path separator characters from
3057 # ARG. msys behavior is inconsistent here, cygpath turns them
3058 # into '.;' and ';.', and winepath ignores them completely.
3059 func_to_host_pathlist_tmp2="$1"
3060 # Once set for this call, this variable should not be
3061 # reassigned. It is used in tha fallback case.
3062 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3063 $SED -e 's|^:*||' -e 's|:*$||'`
3064 case $build in
3065 *mingw* ) # Actually, msys.
3066 # Awkward: cmd appends spaces to result.
3067 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3068 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3069 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3070 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3071 $SED -e "$lt_sed_naive_backslashify"`
3072 ;;
3073 *cygwin* )
3074 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3075 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3076 $SED -e "$lt_sed_naive_backslashify"`
3077 ;;
3078 * )
3079 # unfortunately, winepath doesn't convert pathlists
3080 func_to_host_pathlist_result=""
3081 func_to_host_pathlist_oldIFS=$IFS
3082 IFS=:
3083 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3084 IFS=$func_to_host_pathlist_oldIFS
3085 if test -n "$func_to_host_pathlist_f" ; then
3086 func_to_host_path "$func_to_host_pathlist_f"
3087 if test -n "$func_to_host_path_result" ; then
3088 if test -z "$func_to_host_pathlist_result" ; then
3089 func_to_host_pathlist_result="$func_to_host_path_result"
3090 else
3091 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3092 fi
3093 fi
3094 fi
3095 IFS=:
3096 done
3097 IFS=$func_to_host_pathlist_oldIFS
3098 ;;
3099 esac
3100 if test -z "$func_to_host_pathlist_result" ; then
3101 func_error "Could not determine the host path(s) corresponding to"
3102 func_error " '$1'"
3103 func_error "Continuing, but uninstalled executables may not work."
3104 # Fallback. This may break if $1 contains DOS-style drive
3105 # specifications. The fix is not to complicate the expression
3106 # below, but for the user to provide a working wine installation
3107 # with winepath so that path translation in the cross-to-mingw
3108 # case works properly.
3109 lt_replace_pathsep_nix_to_dos="s|:|;|g"
3110 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3111 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3112 fi
3113 # Now, add the leading and trailing path separators back
3114 case "$1" in
3115 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3116 ;;
3117 esac
3118 case "$1" in
3119 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3120 ;;
3121 esac
3122 ;;
3123 esac
3124 fi
3125}
3126# end: func_to_host_pathlist
3127
3128# func_emit_cwrapperexe_src
3129# emit the source code for a wrapper executable on stdout
3130# Must ONLY be called from within func_mode_link because
3131# it depends on a number of variable set therein.
3132func_emit_cwrapperexe_src ()
3133{
3134 cat <<EOF
3135
3136/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3137 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3138
3139 The $output program cannot be directly executed until all the libtool
3140 libraries that it depends on are installed.
3141
3142 This wrapper executable should never be moved out of the build directory.
3143 If it is, it will not operate correctly.
3144
3145 Currently, it simply execs the wrapper *script* "$SHELL $output",
3146 but could eventually absorb all of the scripts functionality and
3147 exec $objdir/$outputname directly.
3148*/
3149EOF
3150 cat <<"EOF"
3151#include <stdio.h>
3152#include <stdlib.h>
3153#ifdef _MSC_VER
3154# include <direct.h>
3155# include <process.h>
3156# include <io.h>
3157# define setmode _setmode
3158#else
3159# include <unistd.h>
3160# include <stdint.h>
3161# ifdef __CYGWIN__
3162# include <io.h>
3163# define HAVE_SETENV
3164# ifdef __STRICT_ANSI__
3165char *realpath (const char *, char *);
3166int putenv (char *);
3167int setenv (const char *, const char *, int);
3168# endif
3169# endif
3170#endif
3171#include <malloc.h>
3172#include <stdarg.h>
3173#include <assert.h>
3174#include <string.h>
3175#include <ctype.h>
3176#include <errno.h>
3177#include <fcntl.h>
3178#include <sys/stat.h>
3179
3180#if defined(PATH_MAX)
3181# define LT_PATHMAX PATH_MAX
3182#elif defined(MAXPATHLEN)
3183# define LT_PATHMAX MAXPATHLEN
3184#else
3185# define LT_PATHMAX 1024
3186#endif
3187
3188#ifndef S_IXOTH
3189# define S_IXOTH 0
3190#endif
3191#ifndef S_IXGRP
3192# define S_IXGRP 0
3193#endif
3194
3195#ifdef _MSC_VER
3196# define S_IXUSR _S_IEXEC
3197# define stat _stat
3198# ifndef _INTPTR_T_DEFINED
3199# define intptr_t int
3200# endif
3201#endif
3202
3203#ifndef DIR_SEPARATOR
3204# define DIR_SEPARATOR '/'
3205# define PATH_SEPARATOR ':'
3206#endif
3207
3208#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3209 defined (__OS2__)
3210# define HAVE_DOS_BASED_FILE_SYSTEM
3211# define FOPEN_WB "wb"
3212# ifndef DIR_SEPARATOR_2
3213# define DIR_SEPARATOR_2 '\\'
3214# endif
3215# ifndef PATH_SEPARATOR_2
3216# define PATH_SEPARATOR_2 ';'
3217# endif
3218#endif
3219
3220#ifndef DIR_SEPARATOR_2
3221# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3222#else /* DIR_SEPARATOR_2 */
3223# define IS_DIR_SEPARATOR(ch) \
3224 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3225#endif /* DIR_SEPARATOR_2 */
3226
3227#ifndef PATH_SEPARATOR_2
3228# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3229#else /* PATH_SEPARATOR_2 */
3230# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3231#endif /* PATH_SEPARATOR_2 */
3232
3233#ifdef __CYGWIN__
3234# define FOPEN_WB "wb"
3235#endif
3236
3237#ifndef FOPEN_WB
3238# define FOPEN_WB "w"
3239#endif
3240#ifndef _O_BINARY
3241# define _O_BINARY 0
3242#endif
3243
3244#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3245#define XFREE(stale) do { \
3246 if (stale) { free ((void *) stale); stale = 0; } \
3247} while (0)
3248
3249#undef LTWRAPPER_DEBUGPRINTF
3250#if defined DEBUGWRAPPER
3251# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3252static void
3253ltwrapper_debugprintf (const char *fmt, ...)
3254{
3255 va_list args;
3256 va_start (args, fmt);
3257 (void) vfprintf (stderr, fmt, args);
3258 va_end (args);
3259}
3260#else
3261# define LTWRAPPER_DEBUGPRINTF(args)
3262#endif
3263
3264const char *program_name = NULL;
3265
3266void *xmalloc (size_t num);
3267char *xstrdup (const char *string);
3268const char *base_name (const char *name);
3269char *find_executable (const char *wrapper);
3270char *chase_symlinks (const char *pathspec);
3271int make_executable (const char *path);
3272int check_executable (const char *path);
3273char *strendzap (char *str, const char *pat);
3274void lt_fatal (const char *message, ...);
3275void lt_setenv (const char *name, const char *value);
3276char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3277void lt_opt_process_env_set (const char *arg);
3278void lt_opt_process_env_prepend (const char *arg);
3279void lt_opt_process_env_append (const char *arg);
3280int lt_split_name_value (const char *arg, char** name, char** value);
3281void lt_update_exe_path (const char *name, const char *value);
3282void lt_update_lib_path (const char *name, const char *value);
3283
3284static const char *script_text_part1 =
3285EOF
3286
3287 func_emit_wrapper_part1 yes |
3288 $SED -e 's/\([\\"]\)/\\\1/g' \
3289 -e 's/^/ "/' -e 's/$/\\n"/'
3290 echo ";"
3291 cat <<EOF
3292
3293static const char *script_text_part2 =
3294EOF
3295 func_emit_wrapper_part2 yes |
3296 $SED -e 's/\([\\"]\)/\\\1/g' \
3297 -e 's/^/ "/' -e 's/$/\\n"/'
3298 echo ";"
3299
3300 cat <<EOF
3301const char * MAGIC_EXE = "$magic_exe";
3302const char * LIB_PATH_VARNAME = "$shlibpath_var";
3303EOF
3304
3305 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3306 func_to_host_pathlist "$temp_rpath"
3307 cat <<EOF
3308const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3309EOF
3310 else
3311 cat <<"EOF"
3312const char * LIB_PATH_VALUE = "";
3313EOF
3314 fi
3315
3316 if test -n "$dllsearchpath"; then
3317 func_to_host_pathlist "$dllsearchpath:"
3318 cat <<EOF
3319const char * EXE_PATH_VARNAME = "PATH";
3320const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3321EOF
3322 else
3323 cat <<"EOF"
3324const char * EXE_PATH_VARNAME = "";
3325const char * EXE_PATH_VALUE = "";
3326EOF
3327 fi
3328
3329 if test "$fast_install" = yes; then
3330 cat <<EOF
3331const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3332EOF
3333 else
3334 cat <<EOF
3335const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3336EOF
3337 fi
3338
3339
3340 cat <<"EOF"
3341
3342#define LTWRAPPER_OPTION_PREFIX "--lt-"
3343#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3344
3345static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3346static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3347
3348static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3349
3350static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3351static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3352 /* argument is putenv-style "foo=bar", value of foo is set to bar */
3353
3354static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3355static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3356 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3357
3358static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3359static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3360 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3361
3362int
3363main (int argc, char *argv[])
3364{
3365 char **newargz;
3366 int newargc;
3367 char *tmp_pathspec;
3368 char *actual_cwrapper_path;
3369 char *actual_cwrapper_name;
3370 char *target_name;
3371 char *lt_argv_zero;
3372 intptr_t rval = 127;
3373
3374 int i;
3375
3376 program_name = (char *) xstrdup (base_name (argv[0]));
3377 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3378 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3379
3380 /* very simple arg parsing; don't want to rely on getopt */
3381 for (i = 1; i < argc; i++)
3382 {
3383 if (strcmp (argv[i], dumpscript_opt) == 0)
3384 {
3385EOF
3386 case "$host" in
3387 *mingw* | *cygwin* )
3388 # make stdout use "unix" line endings
3389 echo " setmode(1,_O_BINARY);"
3390 ;;
3391 esac
3392
3393 cat <<"EOF"
3394 printf ("%s", script_text_part1);
3395 printf ("%s", script_text_part2);
3396 return 0;
3397 }
3398 }
3399
3400 newargz = XMALLOC (char *, argc + 1);
3401 tmp_pathspec = find_executable (argv[0]);
3402 if (tmp_pathspec == NULL)
3403 lt_fatal ("Couldn't find %s", argv[0]);
3404 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3405 tmp_pathspec));
3406
3407 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3408 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3409 actual_cwrapper_path));
3410 XFREE (tmp_pathspec);
3411
3412 actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3413 strendzap (actual_cwrapper_path, actual_cwrapper_name);
3414
3415 /* wrapper name transforms */
3416 strendzap (actual_cwrapper_name, ".exe");
3417 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3418 XFREE (actual_cwrapper_name);
3419 actual_cwrapper_name = tmp_pathspec;
3420 tmp_pathspec = 0;
3421
3422 /* target_name transforms -- use actual target program name; might have lt- prefix */
3423 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3424 strendzap (target_name, ".exe");
3425 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3426 XFREE (target_name);
3427 target_name = tmp_pathspec;
3428 tmp_pathspec = 0;
3429
3430 LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3431 target_name));
3432EOF
3433
3434 cat <<EOF
3435 newargz[0] =
3436 XMALLOC (char, (strlen (actual_cwrapper_path) +
3437 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3438 strcpy (newargz[0], actual_cwrapper_path);
3439 strcat (newargz[0], "$objdir");
3440 strcat (newargz[0], "/");
3441EOF
3442
3443 cat <<"EOF"
3444 /* stop here, and copy so we don't have to do this twice */
3445 tmp_pathspec = xstrdup (newargz[0]);
3446
3447 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3448 strcat (newargz[0], actual_cwrapper_name);
3449
3450 /* DO want the lt- prefix here if it exists, so use target_name */
3451 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3452 XFREE (tmp_pathspec);
3453 tmp_pathspec = NULL;
3454EOF
3455
3456 case $host_os in
3457 mingw*)
3458 cat <<"EOF"
3459 {
3460 char* p;
3461 while ((p = strchr (newargz[0], '\\')) != NULL)
3462 {
3463 *p = '/';
3464 }
3465 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3466 {
3467 *p = '/';
3468 }
3469 }
3470EOF
3471 ;;
3472 esac
3473
3474 cat <<"EOF"
3475 XFREE (target_name);
3476 XFREE (actual_cwrapper_path);
3477 XFREE (actual_cwrapper_name);
3478
3479 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3481 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3482 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3483
3484 newargc=0;
3485 for (i = 1; i < argc; i++)
3486 {
3487 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3488 {
3489 if (argv[i][env_set_opt_len] == '=')
3490 {
3491 const char *p = argv[i] + env_set_opt_len + 1;
3492 lt_opt_process_env_set (p);
3493 }
3494 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3495 {
3496 lt_opt_process_env_set (argv[++i]); /* don't copy */
3497 }
3498 else
3499 lt_fatal ("%s missing required argument", env_set_opt);
3500 continue;
3501 }
3502 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3503 {
3504 if (argv[i][env_prepend_opt_len] == '=')
3505 {
3506 const char *p = argv[i] + env_prepend_opt_len + 1;
3507 lt_opt_process_env_prepend (p);
3508 }
3509 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3510 {
3511 lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3512 }
3513 else
3514 lt_fatal ("%s missing required argument", env_prepend_opt);
3515 continue;
3516 }
3517 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3518 {
3519 if (argv[i][env_append_opt_len] == '=')
3520 {
3521 const char *p = argv[i] + env_append_opt_len + 1;
3522 lt_opt_process_env_append (p);
3523 }
3524 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3525 {
3526 lt_opt_process_env_append (argv[++i]); /* don't copy */
3527 }
3528 else
3529 lt_fatal ("%s missing required argument", env_append_opt);
3530 continue;
3531 }
3532 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3533 {
3534 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3535 namespace, but it is not one of the ones we know about and
3536 have already dealt with, above (inluding dump-script), then
3537 report an error. Otherwise, targets might begin to believe
3538 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3539 namespace. The first time any user complains about this, we'll
3540 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3541 or a configure.ac-settable value.
3542 */
3543 lt_fatal ("Unrecognized option in %s namespace: '%s'",
3544 ltwrapper_option_prefix, argv[i]);
3545 }
3546 /* otherwise ... */
3547 newargz[++newargc] = xstrdup (argv[i]);
3548 }
3549 newargz[++newargc] = NULL;
3550
3551 LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3552 for (i = 0; i < newargc; i++)
3553 {
3554 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3555 }
3556
3557EOF
3558
3559 case $host_os in
3560 mingw*)
3561 cat <<"EOF"
3562 /* execv doesn't actually work on mingw as expected on unix */
3563 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3564 if (rval == -1)
3565 {
3566 /* failed to start process */
3567 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3568 return 127;
3569 }
3570 return rval;
3571EOF
3572 ;;
3573 *)
3574 cat <<"EOF"
3575 execv (lt_argv_zero, newargz);
3576 return rval; /* =127, but avoids unused variable warning */
3577EOF
3578 ;;
3579 esac
3580
3581 cat <<"EOF"
3582}
3583
3584void *
3585xmalloc (size_t num)
3586{
3587 void *p = (void *) malloc (num);
3588 if (!p)
3589 lt_fatal ("Memory exhausted");
3590
3591 return p;
3592}
3593
3594char *
3595xstrdup (const char *string)
3596{
3597 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3598 string) : NULL;
3599}
3600
3601const char *
3602base_name (const char *name)
3603{
3604 const char *base;
3605
3606#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3607 /* Skip over the disk name in MSDOS pathnames. */
3608 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3609 name += 2;
3610#endif
3611
3612 for (base = name; *name; name++)
3613 if (IS_DIR_SEPARATOR (*name))
3614 base = name + 1;
3615 return base;
3616}
3617
3618int
3619check_executable (const char *path)
3620{
3621 struct stat st;
3622
3623 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3624 path ? (*path ? path : "EMPTY!") : "NULL!"));
3625 if ((!path) || (!*path))
3626 return 0;
3627
3628 if ((stat (path, &st) >= 0)
3629 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3630 return 1;
3631 else
3632 return 0;
3633}
3634
3635int
3636make_executable (const char *path)
3637{
3638 int rval = 0;
3639 struct stat st;
3640
3641 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3642 path ? (*path ? path : "EMPTY!") : "NULL!"));
3643 if ((!path) || (!*path))
3644 return 0;
3645
3646 if (stat (path, &st) >= 0)
3647 {
3648 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3649 }
3650 return rval;
3651}
3652
3653/* Searches for the full path of the wrapper. Returns
3654 newly allocated full path name if found, NULL otherwise
3655 Does not chase symlinks, even on platforms that support them.
3656*/
3657char *
3658find_executable (const char *wrapper)
3659{
3660 int has_slash = 0;
3661 const char *p;
3662 const char *p_next;
3663 /* static buffer for getcwd */
3664 char tmp[LT_PATHMAX + 1];
3665 int tmp_len;
3666 char *concat_name;
3667
3668 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3669 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3670
3671 if ((wrapper == NULL) || (*wrapper == '\0'))
3672 return NULL;
3673
3674 /* Absolute path? */
3675#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3676 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3677 {
3678 concat_name = xstrdup (wrapper);
3679 if (check_executable (concat_name))
3680 return concat_name;
3681 XFREE (concat_name);
3682 }
3683 else
3684 {
3685#endif
3686 if (IS_DIR_SEPARATOR (wrapper[0]))
3687 {
3688 concat_name = xstrdup (wrapper);
3689 if (check_executable (concat_name))
3690 return concat_name;
3691 XFREE (concat_name);
3692 }
3693#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3694 }
3695#endif
3696
3697 for (p = wrapper; *p; p++)
3698 if (*p == '/')
3699 {
3700 has_slash = 1;
3701 break;
3702 }
3703 if (!has_slash)
3704 {
3705 /* no slashes; search PATH */
3706 const char *path = getenv ("PATH");
3707 if (path != NULL)
3708 {
3709 for (p = path; *p; p = p_next)
3710 {
3711 const char *q;
3712 size_t p_len;
3713 for (q = p; *q; q++)
3714 if (IS_PATH_SEPARATOR (*q))
3715 break;
3716 p_len = q - p;
3717 p_next = (*q == '\0' ? q : q + 1);
3718 if (p_len == 0)
3719 {
3720 /* empty path: current directory */
3721 if (getcwd (tmp, LT_PATHMAX) == NULL)
3722 lt_fatal ("getcwd failed");
3723 tmp_len = strlen (tmp);
3724 concat_name =
3725 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3726 memcpy (concat_name, tmp, tmp_len);
3727 concat_name[tmp_len] = '/';
3728 strcpy (concat_name + tmp_len + 1, wrapper);
3729 }
3730 else
3731 {
3732 concat_name =
3733 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3734 memcpy (concat_name, p, p_len);
3735 concat_name[p_len] = '/';
3736 strcpy (concat_name + p_len + 1, wrapper);
3737 }
3738 if (check_executable (concat_name))
3739 return concat_name;
3740 XFREE (concat_name);
3741 }
3742 }
3743 /* not found in PATH; assume curdir */
3744 }
3745 /* Relative path | not found in path: prepend cwd */
3746 if (getcwd (tmp, LT_PATHMAX) == NULL)
3747 lt_fatal ("getcwd failed");
3748 tmp_len = strlen (tmp);
3749 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3750 memcpy (concat_name, tmp, tmp_len);
3751 concat_name[tmp_len] = '/';
3752 strcpy (concat_name + tmp_len + 1, wrapper);
3753
3754 if (check_executable (concat_name))
3755 return concat_name;
3756 XFREE (concat_name);
3757 return NULL;
3758}
3759
3760char *
3761chase_symlinks (const char *pathspec)
3762{
3763#ifndef S_ISLNK
3764 return xstrdup (pathspec);
3765#else
3766 char buf[LT_PATHMAX];
3767 struct stat s;
3768 char *tmp_pathspec = xstrdup (pathspec);
3769 char *p;
3770 int has_symlinks = 0;
3771 while (strlen (tmp_pathspec) && !has_symlinks)
3772 {
3773 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3774 tmp_pathspec));
3775 if (lstat (tmp_pathspec, &s) == 0)
3776 {
3777 if (S_ISLNK (s.st_mode) != 0)
3778 {
3779 has_symlinks = 1;
3780 break;
3781 }
3782
3783 /* search backwards for last DIR_SEPARATOR */
3784 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3785 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3786 p--;
3787 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3788 {
3789 /* no more DIR_SEPARATORS left */
3790 break;
3791 }
3792 *p = '\0';
3793 }
3794 else
3795 {
3796 char *errstr = strerror (errno);
3797 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3798 }
3799 }
3800 XFREE (tmp_pathspec);
3801
3802 if (!has_symlinks)
3803 {
3804 return xstrdup (pathspec);
3805 }
3806
3807 tmp_pathspec = realpath (pathspec, buf);
3808 if (tmp_pathspec == 0)
3809 {
3810 lt_fatal ("Could not follow symlinks for %s", pathspec);
3811 }
3812 return xstrdup (tmp_pathspec);
3813#endif
3814}
3815
3816char *
3817strendzap (char *str, const char *pat)
3818{
3819 size_t len, patlen;
3820
3821 assert (str != NULL);
3822 assert (pat != NULL);
3823
3824 len = strlen (str);
3825 patlen = strlen (pat);
3826
3827 if (patlen <= len)
3828 {
3829 str += len - patlen;
3830 if (strcmp (str, pat) == 0)
3831 *str = '\0';
3832 }
3833 return str;
3834}
3835
3836static void
3837lt_error_core (int exit_status, const char *mode,
3838 const char *message, va_list ap)
3839{
3840 fprintf (stderr, "%s: %s: ", program_name, mode);
3841 vfprintf (stderr, message, ap);
3842 fprintf (stderr, ".\n");
3843
3844 if (exit_status >= 0)
3845 exit (exit_status);
3846}
3847
3848void
3849lt_fatal (const char *message, ...)
3850{
3851 va_list ap;
3852 va_start (ap, message);
3853 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3854 va_end (ap);
3855}
3856
3857void
3858lt_setenv (const char *name, const char *value)
3859{
3860 LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3861 (name ? name : "<NULL>"),
3862 (value ? value : "<NULL>")));
3863 {
3864#ifdef HAVE_SETENV
3865 /* always make a copy, for consistency with !HAVE_SETENV */
3866 char *str = xstrdup (value);
3867 setenv (name, str, 1);
3868#else
3869 int len = strlen (name) + 1 + strlen (value) + 1;
3870 char *str = XMALLOC (char, len);
3871 sprintf (str, "%s=%s", name, value);
3872 if (putenv (str) != EXIT_SUCCESS)
3873 {
3874 XFREE (str);
3875 }
3876#endif
3877 }
3878}
3879
3880char *
3881lt_extend_str (const char *orig_value, const char *add, int to_end)
3882{
3883 char *new_value;
3884 if (orig_value && *orig_value)
3885 {
3886 int orig_value_len = strlen (orig_value);
3887 int add_len = strlen (add);
3888 new_value = XMALLOC (char, add_len + orig_value_len + 1);
3889 if (to_end)
3890 {
3891 strcpy (new_value, orig_value);
3892 strcpy (new_value + orig_value_len, add);
3893 }
3894 else
3895 {
3896 strcpy (new_value, add);
3897 strcpy (new_value + add_len, orig_value);
3898 }
3899 }
3900 else
3901 {
3902 new_value = xstrdup (add);
3903 }
3904 return new_value;
3905}
3906
3907int
3908lt_split_name_value (const char *arg, char** name, char** value)
3909{
3910 const char *p;
3911 int len;
3912 if (!arg || !*arg)
3913 return 1;
3914
3915 p = strchr (arg, (int)'=');
3916
3917 if (!p)
3918 return 1;
3919
3920 *value = xstrdup (++p);
3921
3922 len = strlen (arg) - strlen (*value);
3923 *name = XMALLOC (char, len);
3924 strncpy (*name, arg, len-1);
3925 (*name)[len - 1] = '\0';
3926
3927 return 0;
3928}
3929
3930void
3931lt_opt_process_env_set (const char *arg)
3932{
3933 char *name = NULL;
3934 char *value = NULL;
3935
3936 if (lt_split_name_value (arg, &name, &value) != 0)
3937 {
3938 XFREE (name);
3939 XFREE (value);
3940 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3941 }
3942
3943 lt_setenv (name, value);
3944 XFREE (name);
3945 XFREE (value);
3946}
3947
3948void
3949lt_opt_process_env_prepend (const char *arg)
3950{
3951 char *name = NULL;
3952 char *value = NULL;
3953 char *new_value = NULL;
3954
3955 if (lt_split_name_value (arg, &name, &value) != 0)
3956 {
3957 XFREE (name);
3958 XFREE (value);
3959 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3960 }
3961
3962 new_value = lt_extend_str (getenv (name), value, 0);
3963 lt_setenv (name, new_value);
3964 XFREE (new_value);
3965 XFREE (name);
3966 XFREE (value);
3967}
3968
3969void
3970lt_opt_process_env_append (const char *arg)
3971{
3972 char *name = NULL;
3973 char *value = NULL;
3974 char *new_value = NULL;
3975
3976 if (lt_split_name_value (arg, &name, &value) != 0)
3977 {
3978 XFREE (name);
3979 XFREE (value);
3980 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3981 }
3982
3983 new_value = lt_extend_str (getenv (name), value, 1);
3984 lt_setenv (name, new_value);
3985 XFREE (new_value);
3986 XFREE (name);
3987 XFREE (value);
3988}
3989
3990void
3991lt_update_exe_path (const char *name, const char *value)
3992{
3993 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3994 (name ? name : "<NULL>"),
3995 (value ? value : "<NULL>")));
3996
3997 if (name && *name && value && *value)
3998 {
3999 char *new_value = lt_extend_str (getenv (name), value, 0);
4000 /* some systems can't cope with a ':'-terminated path #' */
4001 int len = strlen (new_value);
4002 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4003 {
4004 new_value[len-1] = '\0';
4005 }
4006 lt_setenv (name, new_value);
4007 XFREE (new_value);
4008 }
4009}
4010
4011void
4012lt_update_lib_path (const char *name, const char *value)
4013{
4014 LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4015 (name ? name : "<NULL>"),
4016 (value ? value : "<NULL>")));
4017
4018 if (name && *name && value && *value)
4019 {
4020 char *new_value = lt_extend_str (getenv (name), value, 0);
4021 lt_setenv (name, new_value);
4022 XFREE (new_value);
4023 }
4024}
4025
4026
4027EOF
4028}
4029# end: func_emit_cwrapperexe_src
4030
4031# func_mode_link arg...
4032func_mode_link ()
4033{
4034 $opt_debug
4035 case $host in
4036 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4037 # It is impossible to link a dll without this setting, and
4038 # we shouldn't force the makefile maintainer to figure out
4039 # which system we are compiling for in order to pass an extra
4040 # flag for every libtool invocation.
4041 # allow_undefined=no
4042
4043 # FIXME: Unfortunately, there are problems with the above when trying
4044 # to make a dll which has undefined symbols, in which case not
4045 # even a static library is built. For now, we need to specify
4046 # -no-undefined on the libtool link line when we can be certain
4047 # that all symbols are satisfied, otherwise we get a static library.
4048 allow_undefined=yes
4049 ;;
4050 *)
4051 allow_undefined=yes
4052 ;;
4053 esac
4054 libtool_args=$nonopt
4055 base_compile="$nonopt $@"
4056 compile_command=$nonopt
4057 finalize_command=$nonopt
4058
4059 compile_rpath=
4060 finalize_rpath=
4061 compile_shlibpath=
4062 finalize_shlibpath=
4063 convenience=
4064 old_convenience=
4065 deplibs=
4066 old_deplibs=
4067 compiler_flags=
4068 linker_flags=
4069 dllsearchpath=
4070 lib_search_path=`pwd`
4071 inst_prefix_dir=
4072 new_inherited_linker_flags=
4073
4074 avoid_version=no
4075 dlfiles=
4076 dlprefiles=
4077 dlself=no
4078 export_dynamic=no
4079 export_symbols=
4080 export_symbols_regex=
4081 generated=
4082 libobjs=
4083 ltlibs=
4084 module=no
4085 no_install=no
4086 objs=
4087 non_pic_objects=
4088 precious_files_regex=
4089 prefer_static_libs=no
4090 preload=no
4091 prev=
4092 prevarg=
4093 release=
4094 rpath=
4095 xrpath=
4096 perm_rpath=
4097 temp_rpath=
4098 thread_safe=no
4099 vinfo=
4100 vinfo_number=no
4101 weak_libs=
4102 single_module="${wl}-single_module"
4103 func_infer_tag $base_compile
4104
4105 # We need to know -static, to get the right output filenames.
4106 for arg
4107 do
4108 case $arg in
4109 -shared)
4110 test "$build_libtool_libs" != yes && \
4111 func_fatal_configuration "can not build a shared library"
4112 build_old_libs=no
4113 break
4114 ;;
4115 -all-static | -static | -static-libtool-libs)
4116 case $arg in
4117 -all-static)
4118 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4119 func_warning "complete static linking is impossible in this configuration"
4120 fi
4121 if test -n "$link_static_flag"; then
4122 dlopen_self=$dlopen_self_static
4123 fi
4124 prefer_static_libs=yes
4125 ;;
4126 -static)
4127 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4128 dlopen_self=$dlopen_self_static
4129 fi
4130 prefer_static_libs=built
4131 ;;
4132 -static-libtool-libs)
4133 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4134 dlopen_self=$dlopen_self_static
4135 fi
4136 prefer_static_libs=yes
4137 ;;
4138 esac
4139 build_libtool_libs=no
4140 build_old_libs=yes
4141 break
4142 ;;
4143 esac
4144 done
4145
4146 # See if our shared archives depend on static archives.
4147 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4148
4149 # Go through the arguments, transforming them on the way.
4150 while test "$#" -gt 0; do
4151 arg="$1"
4152 shift
4153 func_quote_for_eval "$arg"
4154 qarg=$func_quote_for_eval_unquoted_result
4155 func_append libtool_args " $func_quote_for_eval_result"
4156
4157 # If the previous option needs an argument, assign it.
4158 if test -n "$prev"; then
4159 case $prev in
4160 output)
4161 func_append compile_command " @OUTPUT@"
4162 func_append finalize_command " @OUTPUT@"
4163 ;;
4164 esac
4165
4166 case $prev in
4167 dlfiles|dlprefiles)
4168 if test "$preload" = no; then
4169 # Add the symbol object into the linking commands.
4170 func_append compile_command " @SYMFILE@"
4171 func_append finalize_command " @SYMFILE@"
4172 preload=yes
4173 fi
4174 case $arg in
4175 *.la | *.lo) ;; # We handle these cases below.
4176 force)
4177 if test "$dlself" = no; then
4178 dlself=needless
4179 export_dynamic=yes
4180 fi
4181 prev=
4182 continue
4183 ;;
4184 self)
4185 if test "$prev" = dlprefiles; then
4186 dlself=yes
4187 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4188 dlself=yes
4189 else
4190 dlself=needless
4191 export_dynamic=yes
4192 fi
4193 prev=
4194 continue
4195 ;;
4196 *)
4197 if test "$prev" = dlfiles; then
4198 dlfiles="$dlfiles $arg"
4199 else
4200 dlprefiles="$dlprefiles $arg"
4201 fi
4202 prev=
4203 continue
4204 ;;
4205 esac
4206 ;;
4207 expsyms)
4208 export_symbols="$arg"
4209 test -f "$arg" \
4210 || func_fatal_error "symbol file \`$arg' does not exist"
4211 prev=
4212 continue
4213 ;;
4214 expsyms_regex)
4215 export_symbols_regex="$arg"
4216 prev=
4217 continue
4218 ;;
4219 framework)
4220 case $host in
4221 *-*-darwin*)
4222 case "$deplibs " in
4223 *" $qarg.ltframework "*) ;;
4224 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4225 ;;
4226 esac
4227 ;;
4228 esac
4229 prev=
4230 continue
4231 ;;
4232 inst_prefix)
4233 inst_prefix_dir="$arg"
4234 prev=
4235 continue
4236 ;;
4237 objectlist)
4238 if test -f "$arg"; then
4239 save_arg=$arg
4240 moreargs=
4241 for fil in `cat "$save_arg"`
4242 do
4243# moreargs="$moreargs $fil"
4244 arg=$fil
4245 # A libtool-controlled object.
4246
4247 # Check to see that this really is a libtool object.
4248 if func_lalib_unsafe_p "$arg"; then
4249 pic_object=
4250 non_pic_object=
4251
4252 # Read the .lo file
4253 func_source "$arg"
4254
4255 if test -z "$pic_object" ||
4256 test -z "$non_pic_object" ||
4257 test "$pic_object" = none &&
4258 test "$non_pic_object" = none; then
4259 func_fatal_error "cannot find name of object for \`$arg'"
4260 fi
4261
4262 # Extract subdirectory from the argument.
4263 func_dirname "$arg" "/" ""
4264 xdir="$func_dirname_result"
4265
4266 if test "$pic_object" != none; then
4267 # Prepend the subdirectory the object is found in.
4268 pic_object="$xdir$pic_object"
4269
4270 if test "$prev" = dlfiles; then
4271 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4272 dlfiles="$dlfiles $pic_object"
4273 prev=
4274 continue
4275 else
4276 # If libtool objects are unsupported, then we need to preload.
4277 prev=dlprefiles
4278 fi
4279 fi
4280
4281 # CHECK ME: I think I busted this. -Ossama
4282 if test "$prev" = dlprefiles; then
4283 # Preload the old-style object.
4284 dlprefiles="$dlprefiles $pic_object"
4285 prev=
4286 fi
4287
4288 # A PIC object.
4289 func_append libobjs " $pic_object"
4290 arg="$pic_object"
4291 fi
4292
4293 # Non-PIC object.
4294 if test "$non_pic_object" != none; then
4295 # Prepend the subdirectory the object is found in.
4296 non_pic_object="$xdir$non_pic_object"
4297
4298 # A standard non-PIC object
4299 func_append non_pic_objects " $non_pic_object"
4300 if test -z "$pic_object" || test "$pic_object" = none ; then
4301 arg="$non_pic_object"
4302 fi
4303 else
4304 # If the PIC object exists, use it instead.
4305 # $xdir was prepended to $pic_object above.
4306 non_pic_object="$pic_object"
4307 func_append non_pic_objects " $non_pic_object"
4308 fi
4309 else
4310 # Only an error if not doing a dry-run.
4311 if $opt_dry_run; then
4312 # Extract subdirectory from the argument.
4313 func_dirname "$arg" "/" ""
4314 xdir="$func_dirname_result"
4315
4316 func_lo2o "$arg"
4317 pic_object=$xdir$objdir/$func_lo2o_result
4318 non_pic_object=$xdir$func_lo2o_result
4319 func_append libobjs " $pic_object"
4320 func_append non_pic_objects " $non_pic_object"
4321 else
4322 func_fatal_error "\`$arg' is not a valid libtool object"
4323 fi
4324 fi
4325 done
4326 else
4327 func_fatal_error "link input file \`$arg' does not exist"
4328 fi
4329 arg=$save_arg
4330 prev=
4331 continue
4332 ;;
4333 precious_regex)
4334 precious_files_regex="$arg"
4335 prev=
4336 continue
4337 ;;
4338 release)
4339 release="-$arg"
4340 prev=
4341 continue
4342 ;;
4343 rpath | xrpath)
4344 # We need an absolute path.
4345 case $arg in
4346 [\\/]* | [A-Za-z]:[\\/]*) ;;
4347 *)
4348 func_fatal_error "only absolute run-paths are allowed"
4349 ;;
4350 esac
4351 if test "$prev" = rpath; then
4352 case "$rpath " in
4353 *" $arg "*) ;;
4354 *) rpath="$rpath $arg" ;;
4355 esac
4356 else
4357 case "$xrpath " in
4358 *" $arg "*) ;;
4359 *) xrpath="$xrpath $arg" ;;
4360 esac
4361 fi
4362 prev=
4363 continue
4364 ;;
4365 shrext)
4366 shrext_cmds="$arg"
4367 prev=
4368 continue
4369 ;;
4370 weak)
4371 weak_libs="$weak_libs $arg"
4372 prev=
4373 continue
4374 ;;
4375 xcclinker)
4376 linker_flags="$linker_flags $qarg"
4377 compiler_flags="$compiler_flags $qarg"
4378 prev=
4379 func_append compile_command " $qarg"
4380 func_append finalize_command " $qarg"
4381 continue
4382 ;;
4383 xcompiler)
4384 compiler_flags="$compiler_flags $qarg"
4385 prev=
4386 func_append compile_command " $qarg"
4387 func_append finalize_command " $qarg"
4388 continue
4389 ;;
4390 xlinker)
4391 linker_flags="$linker_flags $qarg"
4392 compiler_flags="$compiler_flags $wl$qarg"
4393 prev=
4394 func_append compile_command " $wl$qarg"
4395 func_append finalize_command " $wl$qarg"
4396 continue
4397 ;;
4398 *)
4399 eval "$prev=\"\$arg\""
4400 prev=
4401 continue
4402 ;;
4403 esac
4404 fi # test -n "$prev"
4405
4406 prevarg="$arg"
4407
4408 case $arg in
4409 -all-static)
4410 if test -n "$link_static_flag"; then
4411 # See comment for -static flag below, for more details.
4412 func_append compile_command " $link_static_flag"
4413 func_append finalize_command " $link_static_flag"
4414 fi
4415 continue
4416 ;;
4417
4418 -allow-undefined)
4419 # FIXME: remove this flag sometime in the future.
4420 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4421 ;;
4422
4423 -avoid-version)
4424 avoid_version=yes
4425 continue
4426 ;;
4427
4428 -dlopen)
4429 prev=dlfiles
4430 continue
4431 ;;
4432
4433 -dlpreopen)
4434 prev=dlprefiles
4435 continue
4436 ;;
4437
4438 -export-dynamic)
4439 export_dynamic=yes
4440 continue
4441 ;;
4442
4443 -export-symbols | -export-symbols-regex)
4444 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4445 func_fatal_error "more than one -exported-symbols argument is not allowed"
4446 fi
4447 if test "X$arg" = "X-export-symbols"; then
4448 prev=expsyms
4449 else
4450 prev=expsyms_regex
4451 fi
4452 continue
4453 ;;
4454
4455 -framework)
4456 prev=framework
4457 continue
4458 ;;
4459
4460 -inst-prefix-dir)
4461 prev=inst_prefix
4462 continue
4463 ;;
4464
4465 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4466 # so, if we see these flags be careful not to treat them like -L
4467 -L[A-Z][A-Z]*:*)
4468 case $with_gcc/$host in
4469 no/*-*-irix* | /*-*-irix*)
4470 func_append compile_command " $arg"
4471 func_append finalize_command " $arg"
4472 ;;
4473 esac
4474 continue
4475 ;;
4476
4477 -L*)
4478 func_stripname '-L' '' "$arg"
4479 dir=$func_stripname_result
4480 if test -z "$dir"; then
4481 if test "$#" -gt 0; then
4482 func_fatal_error "require no space between \`-L' and \`$1'"
4483 else
4484 func_fatal_error "need path for \`-L' option"
4485 fi
4486 fi
4487 # We need an absolute path.
4488 case $dir in
4489 [\\/]* | [A-Za-z]:[\\/]*) ;;
4490 *)
4491 absdir=`cd "$dir" && pwd`
4492 test -z "$absdir" && \
4493 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4494 dir="$absdir"
4495 ;;
4496 esac
4497 case "$deplibs " in
4498 *" -L$dir "*) ;;
4499 *)
4500 deplibs="$deplibs -L$dir"
4501 lib_search_path="$lib_search_path $dir"
4502 ;;
4503 esac
4504 case $host in
4505 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4506 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4507 case :$dllsearchpath: in
4508 *":$dir:"*) ;;
4509 ::) dllsearchpath=$dir;;
4510 *) dllsearchpath="$dllsearchpath:$dir";;
4511 esac
4512 case :$dllsearchpath: in
4513 *":$testbindir:"*) ;;
4514 ::) dllsearchpath=$testbindir;;
4515 *) dllsearchpath="$dllsearchpath:$testbindir";;
4516 esac
4517 ;;
4518 esac
4519 continue
4520 ;;
4521
4522 -l*)
4523 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4524 case $host in
4525 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
4526 # These systems don't actually have a C or math library (as such)
4527 continue
4528 ;;
4529 *-*-os2*)
4530 # These systems don't actually have a C library (as such)
4531 test "X$arg" = "X-lc" && continue
4532 ;;
4533 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4534 # Do not include libc due to us having libc/libc_r.
4535 test "X$arg" = "X-lc" && continue
4536 ;;
4537 *-*-rhapsody* | *-*-darwin1.[012])
4538 # Rhapsody C and math libraries are in the System framework
4539 deplibs="$deplibs System.ltframework"
4540 continue
4541 ;;
4542 *-*-sco3.2v5* | *-*-sco5v6*)
4543 # Causes problems with __ctype
4544 test "X$arg" = "X-lc" && continue
4545 ;;
4546 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4547 # Compiler inserts libc in the correct place for threads to work
4548 test "X$arg" = "X-lc" && continue
4549 ;;
4550 esac
4551 elif test "X$arg" = "X-lc_r"; then
4552 case $host in
4553 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4554 # Do not include libc_r directly, use -pthread flag.
4555 continue
4556 ;;
4557 esac
4558 fi
4559 deplibs="$deplibs $arg"
4560 continue
4561 ;;
4562
4563 -module)
4564 module=yes
4565 continue
4566 ;;
4567
4568 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4569 # classes, name mangling, and exception handling.
4570 # Darwin uses the -arch flag to determine output architecture.
4571 -model|-arch|-isysroot)
4572 compiler_flags="$compiler_flags $arg"
4573 func_append compile_command " $arg"
4574 func_append finalize_command " $arg"
4575 prev=xcompiler
4576 continue
4577 ;;
4578
4579 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4580 compiler_flags="$compiler_flags $arg"
4581 func_append compile_command " $arg"
4582 func_append finalize_command " $arg"
4583 case "$new_inherited_linker_flags " in
4584 *" $arg "*) ;;
4585 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4586 esac
4587 continue
4588 ;;
4589
4590 -multi_module)
4591 single_module="${wl}-multi_module"
4592 continue
4593 ;;
4594
4595 -no-fast-install)
4596 fast_install=no
4597 continue
4598 ;;
4599
4600 -no-install)
4601 case $host in
4602 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4603 # The PATH hackery in wrapper scripts is required on Windows
4604 # and Darwin in order for the loader to find any dlls it needs.
4605 func_warning "\`-no-install' is ignored for $host"
4606 func_warning "assuming \`-no-fast-install' instead"
4607 fast_install=no
4608 ;;
4609 *) no_install=yes ;;
4610 esac
4611 continue
4612 ;;
4613
4614 -no-undefined)
4615 allow_undefined=no
4616 continue
4617 ;;
4618
4619 -objectlist)
4620 prev=objectlist
4621 continue
4622 ;;
4623
4624 -o) prev=output ;;
4625
4626 -precious-files-regex)
4627 prev=precious_regex
4628 continue
4629 ;;
4630
4631 -release)
4632 prev=release
4633 continue
4634 ;;
4635
4636 -rpath)
4637 prev=rpath
4638 continue
4639 ;;
4640
4641 -R)
4642 prev=xrpath
4643 continue
4644 ;;
4645
4646 -R*)
4647 func_stripname '-R' '' "$arg"
4648 dir=$func_stripname_result
4649 # We need an absolute path.
4650 case $dir in
4651 [\\/]* | [A-Za-z]:[\\/]*) ;;
4652 *)
4653 func_fatal_error "only absolute run-paths are allowed"
4654 ;;
4655 esac
4656 case "$xrpath " in
4657 *" $dir "*) ;;
4658 *) xrpath="$xrpath $dir" ;;
4659 esac
4660 continue
4661 ;;
4662
4663 -shared)
4664 # The effects of -shared are defined in a previous loop.
4665 continue
4666 ;;
4667
4668 -shrext)
4669 prev=shrext
4670 continue
4671 ;;
4672
4673 -static | -static-libtool-libs)
4674 # The effects of -static are defined in a previous loop.
4675 # We used to do the same as -all-static on platforms that
4676 # didn't have a PIC flag, but the assumption that the effects
4677 # would be equivalent was wrong. It would break on at least
4678 # Digital Unix and AIX.
4679 continue
4680 ;;
4681
4682 -thread-safe)
4683 thread_safe=yes
4684 continue
4685 ;;
4686
4687 -version-info)
4688 prev=vinfo
4689 continue
4690 ;;
4691
4692 -version-number)
4693 prev=vinfo
4694 vinfo_number=yes
4695 continue
4696 ;;
4697
4698 -weak)
4699 prev=weak
4700 continue
4701 ;;
4702
4703 -Wc,*)
4704 func_stripname '-Wc,' '' "$arg"
4705 args=$func_stripname_result
4706 arg=
4707 save_ifs="$IFS"; IFS=','
4708 for flag in $args; do
4709 IFS="$save_ifs"
4710 func_quote_for_eval "$flag"
4711 arg="$arg $wl$func_quote_for_eval_result"
4712 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4713 done
4714 IFS="$save_ifs"
4715 func_stripname ' ' '' "$arg"
4716 arg=$func_stripname_result
4717 ;;
4718
4719 -Wl,*)
4720 func_stripname '-Wl,' '' "$arg"
4721 args=$func_stripname_result
4722 arg=
4723 save_ifs="$IFS"; IFS=','
4724 for flag in $args; do
4725 IFS="$save_ifs"
4726 func_quote_for_eval "$flag"
4727 arg="$arg $wl$func_quote_for_eval_result"
4728 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4729 linker_flags="$linker_flags $func_quote_for_eval_result"
4730 done
4731 IFS="$save_ifs"
4732 func_stripname ' ' '' "$arg"
4733 arg=$func_stripname_result
4734 ;;
4735
4736 -Xcompiler)
4737 prev=xcompiler
4738 continue
4739 ;;
4740
4741 -Xlinker)
4742 prev=xlinker
4743 continue
4744 ;;
4745
4746 -XCClinker)
4747 prev=xcclinker
4748 continue
4749 ;;
4750
4751 # -msg_* for osf cc
4752 -msg_*)
4753 func_quote_for_eval "$arg"
4754 arg="$func_quote_for_eval_result"
4755 ;;
4756
4757 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4758 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4759 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4760 # +DA*, +DD* enable 64-bit mode on the HP compiler
4761 # -q* pass through compiler args for the IBM compiler
4762 # -m*, -t[45]*, -txscale* pass through architecture-specific
4763 # compiler args for GCC
4764 # -F/path gives path to uninstalled frameworks, gcc on darwin
4765 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4766 # @file GCC response files
4767 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4768 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4769 func_quote_for_eval "$arg"
4770 arg="$func_quote_for_eval_result"
4771 func_append compile_command " $arg"
4772 func_append finalize_command " $arg"
4773 compiler_flags="$compiler_flags $arg"
4774 continue
4775 ;;
4776
4777 # Some other compiler flag.
4778 -* | +*)
4779 func_quote_for_eval "$arg"
4780 arg="$func_quote_for_eval_result"
4781 ;;
4782
4783 *.$objext)
4784 # A standard object.
4785 objs="$objs $arg"
4786 ;;
4787
4788 *.lo)
4789 # A libtool-controlled object.
4790
4791 # Check to see that this really is a libtool object.
4792 if func_lalib_unsafe_p "$arg"; then
4793 pic_object=
4794 non_pic_object=
4795
4796 # Read the .lo file
4797 func_source "$arg"
4798
4799 if test -z "$pic_object" ||
4800 test -z "$non_pic_object" ||
4801 test "$pic_object" = none &&
4802 test "$non_pic_object" = none; then
4803 func_fatal_error "cannot find name of object for \`$arg'"
4804 fi
4805
4806 # Extract subdirectory from the argument.
4807 func_dirname "$arg" "/" ""
4808 xdir="$func_dirname_result"
4809
4810 if test "$pic_object" != none; then
4811 # Prepend the subdirectory the object is found in.
4812 pic_object="$xdir$pic_object"
4813
4814 if test "$prev" = dlfiles; then
4815 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4816 dlfiles="$dlfiles $pic_object"
4817 prev=
4818 continue
4819 else
4820 # If libtool objects are unsupported, then we need to preload.
4821 prev=dlprefiles
4822 fi
4823 fi
4824
4825 # CHECK ME: I think I busted this. -Ossama
4826 if test "$prev" = dlprefiles; then
4827 # Preload the old-style object.
4828 dlprefiles="$dlprefiles $pic_object"
4829 prev=
4830 fi
4831
4832 # A PIC object.
4833 func_append libobjs " $pic_object"
4834 arg="$pic_object"
4835 fi
4836
4837 # Non-PIC object.
4838 if test "$non_pic_object" != none; then
4839 # Prepend the subdirectory the object is found in.
4840 non_pic_object="$xdir$non_pic_object"
4841
4842 # A standard non-PIC object
4843 func_append non_pic_objects " $non_pic_object"
4844 if test -z "$pic_object" || test "$pic_object" = none ; then
4845 arg="$non_pic_object"
4846 fi
4847 else
4848 # If the PIC object exists, use it instead.
4849 # $xdir was prepended to $pic_object above.
4850 non_pic_object="$pic_object"
4851 func_append non_pic_objects " $non_pic_object"
4852 fi
4853 else
4854 # Only an error if not doing a dry-run.
4855 if $opt_dry_run; then
4856 # Extract subdirectory from the argument.
4857 func_dirname "$arg" "/" ""
4858 xdir="$func_dirname_result"
4859
4860 func_lo2o "$arg"
4861 pic_object=$xdir$objdir/$func_lo2o_result
4862 non_pic_object=$xdir$func_lo2o_result
4863 func_append libobjs " $pic_object"
4864 func_append non_pic_objects " $non_pic_object"
4865 else
4866 func_fatal_error "\`$arg' is not a valid libtool object"
4867 fi
4868 fi
4869 ;;
4870
4871 *.$libext)
4872 # An archive.
4873 deplibs="$deplibs $arg"
4874 old_deplibs="$old_deplibs $arg"
4875 continue
4876 ;;
4877
4878 *.la)
4879 # A libtool-controlled library.
4880
4881 if test "$prev" = dlfiles; then
4882 # This library was specified with -dlopen.
4883 dlfiles="$dlfiles $arg"
4884 prev=
4885 elif test "$prev" = dlprefiles; then
4886 # The library was specified with -dlpreopen.
4887 dlprefiles="$dlprefiles $arg"
4888 prev=
4889 else
4890 deplibs="$deplibs $arg"
4891 fi
4892 continue
4893 ;;
4894
4895 # Some other compiler argument.
4896 *)
4897 # Unknown arguments in both finalize_command and compile_command need
4898 # to be aesthetically quoted because they are evaled later.
4899 func_quote_for_eval "$arg"
4900 arg="$func_quote_for_eval_result"
4901 ;;
4902 esac # arg
4903
4904 # Now actually substitute the argument into the commands.
4905 if test -n "$arg"; then
4906 func_append compile_command " $arg"
4907 func_append finalize_command " $arg"
4908 fi
4909 done # argument parsing loop
4910
4911 test -n "$prev" && \
4912 func_fatal_help "the \`$prevarg' option requires an argument"
4913
4914 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4915 eval arg=\"$export_dynamic_flag_spec\"
4916 func_append compile_command " $arg"
4917 func_append finalize_command " $arg"
4918 fi
4919
4920 oldlibs=
4921 # calculate the name of the file, without its directory
4922 func_basename "$output"
4923 outputname="$func_basename_result"
4924 libobjs_save="$libobjs"
4925
4926 if test -n "$shlibpath_var"; then
4927 # get the directories listed in $shlibpath_var
4928 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4929 else
4930 shlib_search_path=
4931 fi
4932 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4933 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4934
4935 func_dirname "$output" "/" ""
4936 output_objdir="$func_dirname_result$objdir"
4937 # Create the object directory.
4938 func_mkdir_p "$output_objdir"
4939
4940 # Determine the type of output
4941 case $output in
4942 "")
4943 func_fatal_help "you must specify an output file"
4944 ;;
4945 *.$libext) linkmode=oldlib ;;
4946 *.lo | *.$objext) linkmode=obj ;;
4947 *.la) linkmode=lib ;;
4948 *) linkmode=prog ;; # Anything else should be a program.
4949 esac
4950
4951 specialdeplibs=
4952
4953 libs=
4954 # Find all interdependent deplibs by searching for libraries
4955 # that are linked more than once (e.g. -la -lb -la)
4956 for deplib in $deplibs; do
4957 if $opt_duplicate_deps ; then
4958 case "$libs " in
4959 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4960 esac
4961 fi
4962 libs="$libs $deplib"
4963 done
4964
4965 if test "$linkmode" = lib; then
4966 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4967
4968 # Compute libraries that are listed more than once in $predeps
4969 # $postdeps and mark them as special (i.e., whose duplicates are
4970 # not to be eliminated).
4971 pre_post_deps=
4972 if $opt_duplicate_compiler_generated_deps; then
4973 for pre_post_dep in $predeps $postdeps; do
4974 case "$pre_post_deps " in
4975 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4976 esac
4977 pre_post_deps="$pre_post_deps $pre_post_dep"
4978 done
4979 fi
4980 pre_post_deps=
4981 fi
4982
4983 deplibs=
4984 newdependency_libs=
4985 newlib_search_path=
4986 need_relink=no # whether we're linking any uninstalled libtool libraries
4987 notinst_deplibs= # not-installed libtool libraries
4988 notinst_path= # paths that contain not-installed libtool libraries
4989
4990 case $linkmode in
4991 lib)
4992 passes="conv dlpreopen link"
4993 for file in $dlfiles $dlprefiles; do
4994 case $file in
4995 *.la) ;;
4996 *)
4997 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4998 ;;
4999 esac
5000 done
5001 ;;
5002 prog)
5003 compile_deplibs=
5004 finalize_deplibs=
5005 alldeplibs=no
5006 newdlfiles=
5007 newdlprefiles=
5008 passes="conv scan dlopen dlpreopen link"
5009 ;;
5010 *) passes="conv"
5011 ;;
5012 esac
5013
5014 for pass in $passes; do
5015 # The preopen pass in lib mode reverses $deplibs; put it back here
5016 # so that -L comes before libs that need it for instance...
5017 if test "$linkmode,$pass" = "lib,link"; then
5018 ## FIXME: Find the place where the list is rebuilt in the wrong
5019 ## order, and fix it there properly
5020 tmp_deplibs=
5021 for deplib in $deplibs; do
5022 tmp_deplibs="$deplib $tmp_deplibs"
5023 done
5024 deplibs="$tmp_deplibs"
5025 fi
5026
5027 if test "$linkmode,$pass" = "lib,link" ||
5028 test "$linkmode,$pass" = "prog,scan"; then
5029 libs="$deplibs"
5030 deplibs=
5031 fi
5032 if test "$linkmode" = prog; then
5033 case $pass in
5034 dlopen) libs="$dlfiles" ;;
5035 dlpreopen) libs="$dlprefiles" ;;
5036 link)
5037 libs="$deplibs %DEPLIBS%"
5038 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
5039 ;;
5040 esac
5041 fi
5042 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5043 # Collect and forward deplibs of preopened libtool libs
5044 for lib in $dlprefiles; do
5045 # Ignore non-libtool-libs
5046 dependency_libs=
5047 case $lib in
5048 *.la) func_source "$lib" ;;
5049 esac
5050
5051 # Collect preopened libtool deplibs, except any this library
5052 # has declared as weak libs
5053 for deplib in $dependency_libs; do
5054 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5055 case " $weak_libs " in
5056 *" $deplib_base "*) ;;
5057 *) deplibs="$deplibs $deplib" ;;
5058 esac
5059 done
5060 done
5061 libs="$dlprefiles"
5062 fi
5063 if test "$pass" = dlopen; then
5064 # Collect dlpreopened libraries
5065 save_deplibs="$deplibs"
5066 deplibs=
5067 fi
5068
5069 for deplib in $libs; do
5070 lib=
5071 found=no
5072 case $deplib in
5073 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5074 if test "$linkmode,$pass" = "prog,link"; then
5075 compile_deplibs="$deplib $compile_deplibs"
5076 finalize_deplibs="$deplib $finalize_deplibs"
5077 else
5078 compiler_flags="$compiler_flags $deplib"
5079 if test "$linkmode" = lib ; then
5080 case "$new_inherited_linker_flags " in
5081 *" $deplib "*) ;;
5082 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5083 esac
5084 fi
5085 fi
5086 continue
5087 ;;
5088 -l*)
5089 if test "$linkmode" != lib && test "$linkmode" != prog; then
5090 func_warning "\`-l' is ignored for archives/objects"
5091 continue
5092 fi
5093 func_stripname '-l' '' "$deplib"
5094 name=$func_stripname_result
5095 if test "$linkmode" = lib; then
5096 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5097 else
5098 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5099 fi
5100 for searchdir in $searchdirs; do
5101 for search_ext in .la $std_shrext .so .a; do
5102 # Search the libtool library
5103 lib="$searchdir/lib${name}${search_ext}"
5104 if test -f "$lib"; then
5105 if test "$search_ext" = ".la"; then
5106 found=yes
5107 else
5108 found=no
5109 fi
5110 break 2
5111 fi
5112 done
5113 done
5114 if test "$found" != yes; then
5115 # deplib doesn't seem to be a libtool library
5116 if test "$linkmode,$pass" = "prog,link"; then
5117 compile_deplibs="$deplib $compile_deplibs"
5118 finalize_deplibs="$deplib $finalize_deplibs"
5119 else
5120 deplibs="$deplib $deplibs"
5121 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5122 fi
5123 continue
5124 else # deplib is a libtool library
5125 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5126 # We need to do some special things here, and not later.
5127 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5128 case " $predeps $postdeps " in
5129 *" $deplib "*)
5130 if func_lalib_p "$lib"; then
5131 library_names=
5132 old_library=
5133 func_source "$lib"
5134 for l in $old_library $library_names; do
5135 ll="$l"
5136 done
5137 if test "X$ll" = "X$old_library" ; then # only static version available
5138 found=no
5139 func_dirname "$lib" "" "."
5140 ladir="$func_dirname_result"
5141 lib=$ladir/$old_library
5142 if test "$linkmode,$pass" = "prog,link"; then
5143 compile_deplibs="$deplib $compile_deplibs"
5144 finalize_deplibs="$deplib $finalize_deplibs"
5145 else
5146 deplibs="$deplib $deplibs"
5147 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5148 fi
5149 continue
5150 fi
5151 fi
5152 ;;
5153 *) ;;
5154 esac
5155 fi
5156 fi
5157 ;; # -l
5158 *.ltframework)
5159 if test "$linkmode,$pass" = "prog,link"; then
5160 compile_deplibs="$deplib $compile_deplibs"
5161 finalize_deplibs="$deplib $finalize_deplibs"
5162 else
5163 deplibs="$deplib $deplibs"
5164 if test "$linkmode" = lib ; then
5165 case "$new_inherited_linker_flags " in
5166 *" $deplib "*) ;;
5167 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5168 esac
5169 fi
5170 fi
5171 continue
5172 ;;
5173 -L*)
5174 case $linkmode in
5175 lib)
5176 deplibs="$deplib $deplibs"
5177 test "$pass" = conv && continue
5178 newdependency_libs="$deplib $newdependency_libs"
5179 func_stripname '-L' '' "$deplib"
5180 newlib_search_path="$newlib_search_path $func_stripname_result"
5181 ;;
5182 prog)
5183 if test "$pass" = conv; then
5184 deplibs="$deplib $deplibs"
5185 continue
5186 fi
5187 if test "$pass" = scan; then
5188 deplibs="$deplib $deplibs"
5189 else
5190 compile_deplibs="$deplib $compile_deplibs"
5191 finalize_deplibs="$deplib $finalize_deplibs"
5192 fi
5193 func_stripname '-L' '' "$deplib"
5194 newlib_search_path="$newlib_search_path $func_stripname_result"
5195 ;;
5196 *)
5197 func_warning "\`-L' is ignored for archives/objects"
5198 ;;
5199 esac # linkmode
5200 continue
5201 ;; # -L
5202 -R*)
5203 if test "$pass" = link; then
5204 func_stripname '-R' '' "$deplib"
5205 dir=$func_stripname_result
5206 # Make sure the xrpath contains only unique directories.
5207 case "$xrpath " in
5208 *" $dir "*) ;;
5209 *) xrpath="$xrpath $dir" ;;
5210 esac
5211 fi
5212 deplibs="$deplib $deplibs"
5213 continue
5214 ;;
5215 *.la) lib="$deplib" ;;
5216 *.$libext)
5217 if test "$pass" = conv; then
5218 deplibs="$deplib $deplibs"
5219 continue
5220 fi
5221 case $linkmode in
5222 lib)
5223 # Linking convenience modules into shared libraries is allowed,
5224 # but linking other static libraries is non-portable.
5225 case " $dlpreconveniencelibs " in
5226 *" $deplib "*) ;;
5227 *)
5228 valid_a_lib=no
5229 case $deplibs_check_method in
5230 match_pattern*)
5231 set dummy $deplibs_check_method; shift
5232 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5233 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5234 | $EGREP "$match_pattern_regex" > /dev/null; then
5235 valid_a_lib=yes
5236 fi
5237 ;;
5238 pass_all)
5239 valid_a_lib=yes
5240 ;;
5241 esac
5242 if test "$valid_a_lib" != yes; then
5243 $ECHO
5244 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5245 $ECHO "*** I have the capability to make that library automatically link in when"
5246 $ECHO "*** you link to this library. But I can only do this if you have a"
5247 $ECHO "*** shared version of the library, which you do not appear to have"
5248 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5249 $ECHO "*** that it is just a static archive that I should not use here."
5250 else
5251 $ECHO
5252 $ECHO "*** Warning: Linking the shared library $output against the"
5253 $ECHO "*** static library $deplib is not portable!"
5254 deplibs="$deplib $deplibs"
5255 fi
5256 ;;
5257 esac
5258 continue
5259 ;;
5260 prog)
5261 if test "$pass" != link; then
5262 deplibs="$deplib $deplibs"
5263 else
5264 compile_deplibs="$deplib $compile_deplibs"
5265 finalize_deplibs="$deplib $finalize_deplibs"
5266 fi
5267 continue
5268 ;;
5269 esac # linkmode
5270 ;; # *.$libext
5271 *.lo | *.$objext)
5272 if test "$pass" = conv; then
5273 deplibs="$deplib $deplibs"
5274 elif test "$linkmode" = prog; then
5275 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5276 # If there is no dlopen support or we're linking statically,
5277 # we need to preload.
5278 newdlprefiles="$newdlprefiles $deplib"
5279 compile_deplibs="$deplib $compile_deplibs"
5280 finalize_deplibs="$deplib $finalize_deplibs"
5281 else
5282 newdlfiles="$newdlfiles $deplib"
5283 fi
5284 fi
5285 continue
5286 ;;
5287 %DEPLIBS%)
5288 alldeplibs=yes
5289 continue
5290 ;;
5291 esac # case $deplib
5292
5293 if test "$found" = yes || test -f "$lib"; then :
5294 else
5295 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5296 fi
5297
5298 # Check to see that this really is a libtool archive.
5299 func_lalib_unsafe_p "$lib" \
5300 || func_fatal_error "\`$lib' is not a valid libtool archive"
5301
5302 func_dirname "$lib" "" "."
5303 ladir="$func_dirname_result"
5304
5305 dlname=
5306 dlopen=
5307 dlpreopen=
5308 libdir=
5309 library_names=
5310 old_library=
5311 inherited_linker_flags=
5312 # If the library was installed with an old release of libtool,
5313 # it will not redefine variables installed, or shouldnotlink
5314 installed=yes
5315 shouldnotlink=no
5316 avoidtemprpath=
5317
5318
5319 # Read the .la file
5320 func_source "$lib"
5321
5322 # Convert "-framework foo" to "foo.ltframework"
5323 if test -n "$inherited_linker_flags"; then
5324 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5325 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5326 case " $new_inherited_linker_flags " in
5327 *" $tmp_inherited_linker_flag "*) ;;
5328 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5329 esac
5330 done
5331 fi
5332 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5333 if test "$linkmode,$pass" = "lib,link" ||
5334 test "$linkmode,$pass" = "prog,scan" ||
5335 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5336 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5337 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5338 fi
5339
5340 if test "$pass" = conv; then
5341 # Only check for convenience libraries
5342 deplibs="$lib $deplibs"
5343 if test -z "$libdir"; then
5344 if test -z "$old_library"; then
5345 func_fatal_error "cannot find name of link library for \`$lib'"
5346 fi
5347 # It is a libtool convenience library, so add in its objects.
5348 convenience="$convenience $ladir/$objdir/$old_library"
5349 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5350 tmp_libs=
5351 for deplib in $dependency_libs; do
5352 deplibs="$deplib $deplibs"
5353 if $opt_duplicate_deps ; then
5354 case "$tmp_libs " in
5355 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5356 esac
5357 fi
5358 tmp_libs="$tmp_libs $deplib"
5359 done
5360 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5361 func_fatal_error "\`$lib' is not a convenience library"
5362 fi
5363 continue
5364 fi # $pass = conv
5365
5366
5367 # Get the name of the library we link against.
5368 linklib=
5369 for l in $old_library $library_names; do
5370 linklib="$l"
5371 done
5372 if test -z "$linklib"; then
5373 func_fatal_error "cannot find name of link library for \`$lib'"
5374 fi
5375
5376 # This library was specified with -dlopen.
5377 if test "$pass" = dlopen; then
5378 if test -z "$libdir"; then
5379 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5380 fi
5381 if test -z "$dlname" ||
5382 test "$dlopen_support" != yes ||
5383 test "$build_libtool_libs" = no; then
5384 # If there is no dlname, no dlopen support or we're linking
5385 # statically, we need to preload. We also need to preload any
5386 # dependent libraries so libltdl's deplib preloader doesn't
5387 # bomb out in the load deplibs phase.
5388 dlprefiles="$dlprefiles $lib $dependency_libs"
5389 else
5390 newdlfiles="$newdlfiles $lib"
5391 fi
5392 continue
5393 fi # $pass = dlopen
5394
5395 # We need an absolute path.
5396 case $ladir in
5397 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5398 *)
5399 abs_ladir=`cd "$ladir" && pwd`
5400 if test -z "$abs_ladir"; then
5401 func_warning "cannot determine absolute directory name of \`$ladir'"
5402 func_warning "passing it literally to the linker, although it might fail"
5403 abs_ladir="$ladir"
5404 fi
5405 ;;
5406 esac
5407 func_basename "$lib"
5408 laname="$func_basename_result"
5409
5410 # Find the relevant object directory and library name.
5411 if test "X$installed" = Xyes; then
5412 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5413 func_warning "library \`$lib' was moved."
5414 dir="$ladir"
5415 absdir="$abs_ladir"
5416 libdir="$abs_ladir"
5417 else
5418 dir="$libdir"
5419 absdir="$libdir"
5420 fi
5421 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5422 else
5423 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5424 dir="$ladir"
5425 absdir="$abs_ladir"
5426 # Remove this search path later
5427 notinst_path="$notinst_path $abs_ladir"
5428 else
5429 dir="$ladir/$objdir"
5430 absdir="$abs_ladir/$objdir"
5431 # Remove this search path later
5432 notinst_path="$notinst_path $abs_ladir"
5433 fi
5434 fi # $installed = yes
5435 func_stripname 'lib' '.la' "$laname"
5436 name=$func_stripname_result
5437
5438 # This library was specified with -dlpreopen.
5439 if test "$pass" = dlpreopen; then
5440 if test -z "$libdir" && test "$linkmode" = prog; then
5441 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5442 fi
5443 # Prefer using a static library (so that no silly _DYNAMIC symbols
5444 # are required to link).
5445 if test -n "$old_library"; then
5446 newdlprefiles="$newdlprefiles $dir/$old_library"
5447 # Keep a list of preopened convenience libraries to check
5448 # that they are being used correctly in the link pass.
5449 test -z "$libdir" && \
5450 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5451 # Otherwise, use the dlname, so that lt_dlopen finds it.
5452 elif test -n "$dlname"; then
5453 newdlprefiles="$newdlprefiles $dir/$dlname"
5454 else
5455 newdlprefiles="$newdlprefiles $dir/$linklib"
5456 fi
5457 fi # $pass = dlpreopen
5458
5459 if test -z "$libdir"; then
5460 # Link the convenience library
5461 if test "$linkmode" = lib; then
5462 deplibs="$dir/$old_library $deplibs"
5463 elif test "$linkmode,$pass" = "prog,link"; then
5464 compile_deplibs="$dir/$old_library $compile_deplibs"
5465 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5466 else
5467 deplibs="$lib $deplibs" # used for prog,scan pass
5468 fi
5469 continue
5470 fi
5471
5472
5473 if test "$linkmode" = prog && test "$pass" != link; then
5474 newlib_search_path="$newlib_search_path $ladir"
5475 deplibs="$lib $deplibs"
5476
5477 linkalldeplibs=no
5478 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5479 test "$build_libtool_libs" = no; then
5480 linkalldeplibs=yes
5481 fi
5482
5483 tmp_libs=
5484 for deplib in $dependency_libs; do
5485 case $deplib in
5486 -L*) func_stripname '-L' '' "$deplib"
5487 newlib_search_path="$newlib_search_path $func_stripname_result"
5488 ;;
5489 esac
5490 # Need to link against all dependency_libs?
5491 if test "$linkalldeplibs" = yes; then
5492 deplibs="$deplib $deplibs"
5493 else
5494 # Need to hardcode shared library paths
5495 # or/and link against static libraries
5496 newdependency_libs="$deplib $newdependency_libs"
5497 fi
5498 if $opt_duplicate_deps ; then
5499 case "$tmp_libs " in
5500 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5501 esac
5502 fi
5503 tmp_libs="$tmp_libs $deplib"
5504 done # for deplib
5505 continue
5506 fi # $linkmode = prog...
5507
5508 if test "$linkmode,$pass" = "prog,link"; then
5509 if test -n "$library_names" &&
5510 { { test "$prefer_static_libs" = no ||
5511 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5512 test -z "$old_library"; }; then
5513 # We need to hardcode the library path
5514 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5515 # Make sure the rpath contains only unique directories.
5516 case "$temp_rpath:" in
5517 *"$absdir:"*) ;;
5518 *) temp_rpath="$temp_rpath$absdir:" ;;
5519 esac
5520 fi
5521
5522 # Hardcode the library path.
5523 # Skip directories that are in the system default run-time
5524 # search path.
5525 case " $sys_lib_dlsearch_path " in
5526 *" $absdir "*) ;;
5527 *)
5528 case "$compile_rpath " in
5529 *" $absdir "*) ;;
5530 *) compile_rpath="$compile_rpath $absdir"
5531 esac
5532 ;;
5533 esac
5534 case " $sys_lib_dlsearch_path " in
5535 *" $libdir "*) ;;
5536 *)
5537 case "$finalize_rpath " in
5538 *" $libdir "*) ;;
5539 *) finalize_rpath="$finalize_rpath $libdir"
5540 esac
5541 ;;
5542 esac
5543 fi # $linkmode,$pass = prog,link...
5544
5545 if test "$alldeplibs" = yes &&
5546 { test "$deplibs_check_method" = pass_all ||
5547 { test "$build_libtool_libs" = yes &&
5548 test -n "$library_names"; }; }; then
5549 # We only need to search for static libraries
5550 continue
5551 fi
5552 fi
5553
5554 link_static=no # Whether the deplib will be linked statically
5555 use_static_libs=$prefer_static_libs
5556 if test "$use_static_libs" = built && test "$installed" = yes; then
5557 use_static_libs=no
5558 fi
5559 if test -n "$library_names" &&
5560 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5561 case $host in
5562 *cygwin* | *mingw* | *cegcc*)
5563 # No point in relinking DLLs because paths are not encoded
5564 notinst_deplibs="$notinst_deplibs $lib"
5565 need_relink=no
5566 ;;
5567 *)
5568 if test "$installed" = no; then
5569 notinst_deplibs="$notinst_deplibs $lib"
5570 need_relink=yes
5571 fi
5572 ;;
5573 esac
5574 # This is a shared library
5575
5576 # Warn about portability, can't link against -module's on some
5577 # systems (darwin). Don't bleat about dlopened modules though!
5578 dlopenmodule=""
5579 for dlpremoduletest in $dlprefiles; do
5580 if test "X$dlpremoduletest" = "X$lib"; then
5581 dlopenmodule="$dlpremoduletest"
5582 break
5583 fi
5584 done
5585 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5586 $ECHO
5587 if test "$linkmode" = prog; then
5588 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5589 else
5590 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5591 fi
5592 $ECHO "*** $linklib is not portable!"
5593 fi
5594 if test "$linkmode" = lib &&
5595 test "$hardcode_into_libs" = yes; then
5596 # Hardcode the library path.
5597 # Skip directories that are in the system default run-time
5598 # search path.
5599 case " $sys_lib_dlsearch_path " in
5600 *" $absdir "*) ;;
5601 *)
5602 case "$compile_rpath " in
5603 *" $absdir "*) ;;
5604 *) compile_rpath="$compile_rpath $absdir"
5605 esac
5606 ;;
5607 esac
5608 case " $sys_lib_dlsearch_path " in
5609 *" $libdir "*) ;;
5610 *)
5611 case "$finalize_rpath " in
5612 *" $libdir "*) ;;
5613 *) finalize_rpath="$finalize_rpath $libdir"
5614 esac
5615 ;;
5616 esac
5617 fi
5618
5619 if test -n "$old_archive_from_expsyms_cmds"; then
5620 # figure out the soname
5621 set dummy $library_names
5622 shift
5623 realname="$1"
5624 shift
5625 libname=`eval "\\$ECHO \"$libname_spec\""`
5626 # use dlname if we got it. it's perfectly good, no?
5627 if test -n "$dlname"; then
5628 soname="$dlname"
5629 elif test -n "$soname_spec"; then
5630 # bleh windows
5631 case $host in
5632 *cygwin* | mingw* | *cegcc*)
5633 func_arith $current - $age
5634 major=$func_arith_result
5635 versuffix="-$major"
5636 ;;
5637 esac
5638 eval soname=\"$soname_spec\"
5639 else
5640 soname="$realname"
5641 fi
5642
5643 # Make a new name for the extract_expsyms_cmds to use
5644 soroot="$soname"
5645 func_basename "$soroot"
5646 soname="$func_basename_result"
5647 func_stripname 'lib' '.dll' "$soname"
5648 newlib=libimp-$func_stripname_result.a
5649
5650 # If the library has no export list, then create one now
5651 if test -f "$output_objdir/$soname-def"; then :
5652 else
5653 func_verbose "extracting exported symbol list from \`$soname'"
5654 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5655 fi
5656
5657 # Create $newlib
5658 if test -f "$output_objdir/$newlib"; then :; else
5659 func_verbose "generating import library for \`$soname'"
5660 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5661 fi
5662 # make sure the library variables are pointing to the new library
5663 dir=$output_objdir
5664 linklib=$newlib
5665 fi # test -n "$old_archive_from_expsyms_cmds"
5666
5667 if test "$linkmode" = prog || test "$mode" != relink; then
5668 add_shlibpath=
5669 add_dir=
5670 add=
5671 lib_linked=yes
5672 case $hardcode_action in
5673 immediate | unsupported)
5674 if test "$hardcode_direct" = no; then
5675 add="$dir/$linklib"
5676 case $host in
5677 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5678 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5679 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5680 *-*-unixware7*) add_dir="-L$dir" ;;
5681 *-*-darwin* )
5682 # if the lib is a (non-dlopened) module then we can not
5683 # link against it, someone is ignoring the earlier warnings
5684 if /usr/bin/file -L $add 2> /dev/null |
5685 $GREP ": [^:]* bundle" >/dev/null ; then
5686 if test "X$dlopenmodule" != "X$lib"; then
5687 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5688 if test -z "$old_library" ; then
5689 $ECHO
5690 $ECHO "*** And there doesn't seem to be a static archive available"
5691 $ECHO "*** The link will probably fail, sorry"
5692 else
5693 add="$dir/$old_library"
5694 fi
5695 elif test -n "$old_library"; then
5696 add="$dir/$old_library"
5697 fi
5698 fi
5699 esac
5700 elif test "$hardcode_minus_L" = no; then
5701 case $host in
5702 *-*-sunos*) add_shlibpath="$dir" ;;
5703 esac
5704 add_dir="-L$dir"
5705 add="-l$name"
5706 elif test "$hardcode_shlibpath_var" = no; then
5707 add_shlibpath="$dir"
5708 add="-l$name"
5709 else
5710 lib_linked=no
5711 fi
5712 ;;
5713 relink)
5714 if test "$hardcode_direct" = yes &&
5715 test "$hardcode_direct_absolute" = no; then
5716 add="$dir/$linklib"
5717 elif test "$hardcode_minus_L" = yes; then
5718 add_dir="-L$dir"
5719 # Try looking first in the location we're being installed to.
5720 if test -n "$inst_prefix_dir"; then
5721 case $libdir in
5722 [\\/]*)
5723 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5724 ;;
5725 esac
5726 fi
5727 add="-l$name"
5728 elif test "$hardcode_shlibpath_var" = yes; then
5729 add_shlibpath="$dir"
5730 add="-l$name"
5731 else
5732 lib_linked=no
5733 fi
5734 ;;
5735 *) lib_linked=no ;;
5736 esac
5737
5738 if test "$lib_linked" != yes; then
5739 func_fatal_configuration "unsupported hardcode properties"
5740 fi
5741
5742 if test -n "$add_shlibpath"; then
5743 case :$compile_shlibpath: in
5744 *":$add_shlibpath:"*) ;;
5745 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5746 esac
5747 fi
5748 if test "$linkmode" = prog; then
5749 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5750 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5751 else
5752 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5753 test -n "$add" && deplibs="$add $deplibs"
5754 if test "$hardcode_direct" != yes &&
5755 test "$hardcode_minus_L" != yes &&
5756 test "$hardcode_shlibpath_var" = yes; then
5757 case :$finalize_shlibpath: in
5758 *":$libdir:"*) ;;
5759 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5760 esac
5761 fi
5762 fi
5763 fi
5764
5765 if test "$linkmode" = prog || test "$mode" = relink; then
5766 add_shlibpath=
5767 add_dir=
5768 add=
5769 # Finalize command for both is simple: just hardcode it.
5770 if test "$hardcode_direct" = yes &&
5771 test "$hardcode_direct_absolute" = no; then
5772 add="$libdir/$linklib"
5773 elif test "$hardcode_minus_L" = yes; then
5774 add_dir="-L$libdir"
5775 add="-l$name"
5776 elif test "$hardcode_shlibpath_var" = yes; then
5777 case :$finalize_shlibpath: in
5778 *":$libdir:"*) ;;
5779 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5780 esac
5781 add="-l$name"
5782 elif test "$hardcode_automatic" = yes; then
5783 if test -n "$inst_prefix_dir" &&
5784 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5785 add="$inst_prefix_dir$libdir/$linklib"
5786 else
5787 add="$libdir/$linklib"
5788 fi
5789 else
5790 # We cannot seem to hardcode it, guess we'll fake it.
5791 add_dir="-L$libdir"
5792 # Try looking first in the location we're being installed to.
5793 if test -n "$inst_prefix_dir"; then
5794 case $libdir in
5795 [\\/]*)
5796 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5797 ;;
5798 esac
5799 fi
5800 add="-l$name"
5801 fi
5802
5803 if test "$linkmode" = prog; then
5804 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5805 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5806 else
5807 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5808 test -n "$add" && deplibs="$add $deplibs"
5809 fi
5810 fi
5811 elif test "$linkmode" = prog; then
5812 # Here we assume that one of hardcode_direct or hardcode_minus_L
5813 # is not unsupported. This is valid on all known static and
5814 # shared platforms.
5815 if test "$hardcode_direct" != unsupported; then
5816 test -n "$old_library" && linklib="$old_library"
5817 compile_deplibs="$dir/$linklib $compile_deplibs"
5818 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5819 else
5820 compile_deplibs="-l$name -L$dir $compile_deplibs"
5821 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5822 fi
5823 elif test "$build_libtool_libs" = yes; then
5824 # Not a shared library
5825 if test "$deplibs_check_method" != pass_all; then
5826 # We're trying link a shared library against a static one
5827 # but the system doesn't support it.
5828
5829 # Just print a warning and add the library to dependency_libs so
5830 # that the program can be linked against the static library.
5831 $ECHO
5832 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5833 $ECHO "*** I have the capability to make that library automatically link in when"
5834 $ECHO "*** you link to this library. But I can only do this if you have a"
5835 $ECHO "*** shared version of the library, which you do not appear to have."
5836 if test "$module" = yes; then
5837 $ECHO "*** But as you try to build a module library, libtool will still create "
5838 $ECHO "*** a static module, that should work as long as the dlopening application"
5839 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5840 if test -z "$global_symbol_pipe"; then
5841 $ECHO
5842 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5843 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5844 $ECHO "*** not find such a program. So, this module is probably useless."
5845 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5846 fi
5847 if test "$build_old_libs" = no; then
5848 build_libtool_libs=module
5849 build_old_libs=yes
5850 else
5851 build_libtool_libs=no
5852 fi
5853 fi
5854 else
5855 deplibs="$dir/$old_library $deplibs"
5856 link_static=yes
5857 fi
5858 fi # link shared/static library?
5859
5860 if test "$linkmode" = lib; then
5861 if test -n "$dependency_libs" &&
5862 { test "$hardcode_into_libs" != yes ||
5863 test "$build_old_libs" = yes ||
5864 test "$link_static" = yes; }; then
5865 # Extract -R from dependency_libs
5866 temp_deplibs=
5867 for libdir in $dependency_libs; do
5868 case $libdir in
5869 -R*) func_stripname '-R' '' "$libdir"
5870 temp_xrpath=$func_stripname_result
5871 case " $xrpath " in
5872 *" $temp_xrpath "*) ;;
5873 *) xrpath="$xrpath $temp_xrpath";;
5874 esac;;
5875 *) temp_deplibs="$temp_deplibs $libdir";;
5876 esac
5877 done
5878 dependency_libs="$temp_deplibs"
5879 fi
5880
5881 newlib_search_path="$newlib_search_path $absdir"
5882 # Link against this library
5883 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5884 # ... and its dependency_libs
5885 tmp_libs=
5886 for deplib in $dependency_libs; do
5887 newdependency_libs="$deplib $newdependency_libs"
5888 if $opt_duplicate_deps ; then
5889 case "$tmp_libs " in
5890 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5891 esac
5892 fi
5893 tmp_libs="$tmp_libs $deplib"
5894 done
5895
5896 if test "$link_all_deplibs" != no; then
5897 # Add the search paths of all dependency libraries
5898 for deplib in $dependency_libs; do
5899 path=
5900 case $deplib in
5901 -L*) path="$deplib" ;;
5902 *.la)
5903 func_dirname "$deplib" "" "."
5904 dir="$func_dirname_result"
5905 # We need an absolute path.
5906 case $dir in
5907 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5908 *)
5909 absdir=`cd "$dir" && pwd`
5910 if test -z "$absdir"; then
5911 func_warning "cannot determine absolute directory name of \`$dir'"
5912 absdir="$dir"
5913 fi
5914 ;;
5915 esac
5916 if $GREP "^installed=no" $deplib > /dev/null; then
5917 case $host in
5918 *-*-darwin*)
5919 depdepl=
5920 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5921 if test -n "$deplibrary_names" ; then
5922 for tmp in $deplibrary_names ; do
5923 depdepl=$tmp
5924 done
5925 if test -f "$absdir/$objdir/$depdepl" ; then
5926 depdepl="$absdir/$objdir/$depdepl"
5927 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5928 if test -z "$darwin_install_name"; then
5929 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5930 fi
5931 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5932 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5933 path=
5934 fi
5935 fi
5936 ;;
5937 *)
5938 path="-L$absdir/$objdir"
5939 ;;
5940 esac
5941 else
5942 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5943 test -z "$libdir" && \
5944 func_fatal_error "\`$deplib' is not a valid libtool archive"
5945 test "$absdir" != "$libdir" && \
5946 func_warning "\`$deplib' seems to be moved"
5947
5948 path="-L$absdir"
5949 fi
5950 ;;
5951 esac
5952 case " $deplibs " in
5953 *" $path "*) ;;
5954 *) deplibs="$path $deplibs" ;;
5955 esac
5956 done
5957 fi # link_all_deplibs != no
5958 fi # linkmode = lib
5959 done # for deplib in $libs
5960 if test "$pass" = link; then
5961 if test "$linkmode" = "prog"; then
5962 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5963 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5964 else
5965 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5966 fi
5967 fi
5968 dependency_libs="$newdependency_libs"
5969 if test "$pass" = dlpreopen; then
5970 # Link the dlpreopened libraries before other libraries
5971 for deplib in $save_deplibs; do
5972 deplibs="$deplib $deplibs"
5973 done
5974 fi
5975 if test "$pass" != dlopen; then
5976 if test "$pass" != conv; then
5977 # Make sure lib_search_path contains only unique directories.
5978 lib_search_path=
5979 for dir in $newlib_search_path; do
5980 case "$lib_search_path " in
5981 *" $dir "*) ;;
5982 *) lib_search_path="$lib_search_path $dir" ;;
5983 esac
5984 done
5985 newlib_search_path=
5986 fi
5987
5988 if test "$linkmode,$pass" != "prog,link"; then
5989 vars="deplibs"
5990 else
5991 vars="compile_deplibs finalize_deplibs"
5992 fi
5993 for var in $vars dependency_libs; do
5994 # Add libraries to $var in reverse order
5995 eval tmp_libs=\"\$$var\"
5996 new_libs=
5997 for deplib in $tmp_libs; do
5998 # FIXME: Pedantically, this is the right thing to do, so
5999 # that some nasty dependency loop isn't accidentally
6000 # broken:
6001 #new_libs="$deplib $new_libs"
6002 # Pragmatically, this seems to cause very few problems in
6003 # practice:
6004 case $deplib in
6005 -L*) new_libs="$deplib $new_libs" ;;
6006 -R*) ;;
6007 *)
6008 # And here is the reason: when a library appears more
6009 # than once as an explicit dependence of a library, or
6010 # is implicitly linked in more than once by the
6011 # compiler, it is considered special, and multiple
6012 # occurrences thereof are not removed. Compare this
6013 # with having the same library being listed as a
6014 # dependency of multiple other libraries: in this case,
6015 # we know (pedantically, we assume) the library does not
6016 # need to be listed more than once, so we keep only the
6017 # last copy. This is not always right, but it is rare
6018 # enough that we require users that really mean to play
6019 # such unportable linking tricks to link the library
6020 # using -Wl,-lname, so that libtool does not consider it
6021 # for duplicate removal.
6022 case " $specialdeplibs " in
6023 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6024 *)
6025 case " $new_libs " in
6026 *" $deplib "*) ;;
6027 *) new_libs="$deplib $new_libs" ;;
6028 esac
6029 ;;
6030 esac
6031 ;;
6032 esac
6033 done
6034 tmp_libs=
6035 for deplib in $new_libs; do
6036 case $deplib in
6037 -L*)
6038 case " $tmp_libs " in
6039 *" $deplib "*) ;;
6040 *) tmp_libs="$tmp_libs $deplib" ;;
6041 esac
6042 ;;
6043 *) tmp_libs="$tmp_libs $deplib" ;;
6044 esac
6045 done
6046 eval $var=\"$tmp_libs\"
6047 done # for var
6048 fi
6049 # Last step: remove runtime libs from dependency_libs
6050 # (they stay in deplibs)
6051 tmp_libs=
6052 for i in $dependency_libs ; do
6053 case " $predeps $postdeps $compiler_lib_search_path " in
6054 *" $i "*)
6055 i=""
6056 ;;
6057 esac
6058 if test -n "$i" ; then
6059 tmp_libs="$tmp_libs $i"
6060 fi
6061 done
6062 dependency_libs=$tmp_libs
6063 done # for pass
6064 if test "$linkmode" = prog; then
6065 dlfiles="$newdlfiles"
6066 fi
6067 if test "$linkmode" = prog || test "$linkmode" = lib; then
6068 dlprefiles="$newdlprefiles"
6069 fi
6070
6071 case $linkmode in
6072 oldlib)
6073 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6074 func_warning "\`-dlopen' is ignored for archives"
6075 fi
6076
6077 case " $deplibs" in
6078 *\ -l* | *\ -L*)
6079 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6080 esac
6081
6082 test -n "$rpath" && \
6083 func_warning "\`-rpath' is ignored for archives"
6084
6085 test -n "$xrpath" && \
6086 func_warning "\`-R' is ignored for archives"
6087
6088 test -n "$vinfo" && \
6089 func_warning "\`-version-info/-version-number' is ignored for archives"
6090
6091 test -n "$release" && \
6092 func_warning "\`-release' is ignored for archives"
6093
6094 test -n "$export_symbols$export_symbols_regex" && \
6095 func_warning "\`-export-symbols' is ignored for archives"
6096
6097 # Now set the variables for building old libraries.
6098 build_libtool_libs=no
6099 oldlibs="$output"
6100 objs="$objs$old_deplibs"
6101 ;;
6102
6103 lib)
6104 # Make sure we only generate libraries of the form `libNAME.la'.
6105 case $outputname in
6106 lib*)
6107 func_stripname 'lib' '.la' "$outputname"
6108 name=$func_stripname_result
6109 eval shared_ext=\"$shrext_cmds\"
6110 eval libname=\"$libname_spec\"
6111 ;;
6112 *)
6113 test "$module" = no && \
6114 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6115
6116 if test "$need_lib_prefix" != no; then
6117 # Add the "lib" prefix for modules if required
6118 func_stripname '' '.la' "$outputname"
6119 name=$func_stripname_result
6120 eval shared_ext=\"$shrext_cmds\"
6121 eval libname=\"$libname_spec\"
6122 else
6123 func_stripname '' '.la' "$outputname"
6124 libname=$func_stripname_result
6125 fi
6126 ;;
6127 esac
6128
6129 if test -n "$objs"; then
6130 if test "$deplibs_check_method" != pass_all; then
6131 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6132 else
6133 $ECHO
6134 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6135 $ECHO "*** objects $objs is not portable!"
6136 libobjs="$libobjs $objs"
6137 fi
6138 fi
6139
6140 test "$dlself" != no && \
6141 func_warning "\`-dlopen self' is ignored for libtool libraries"
6142
6143 set dummy $rpath
6144 shift
6145 test "$#" -gt 1 && \
6146 func_warning "ignoring multiple \`-rpath's for a libtool library"
6147
6148 install_libdir="$1"
6149
6150 oldlibs=
6151 if test -z "$rpath"; then
6152 if test "$build_libtool_libs" = yes; then
6153 # Building a libtool convenience library.
6154 # Some compilers have problems with a `.al' extension so
6155 # convenience libraries should have the same extension an
6156 # archive normally would.
6157 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6158 build_libtool_libs=convenience
6159 build_old_libs=yes
6160 fi
6161
6162 test -n "$vinfo" && \
6163 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6164
6165 test -n "$release" && \
6166 func_warning "\`-release' is ignored for convenience libraries"
6167 else
6168
6169 # Parse the version information argument.
6170 save_ifs="$IFS"; IFS=':'
6171 set dummy $vinfo 0 0 0
6172 shift
6173 IFS="$save_ifs"
6174
6175 test -n "$7" && \
6176 func_fatal_help "too many parameters to \`-version-info'"
6177
6178 # convert absolute version numbers to libtool ages
6179 # this retains compatibility with .la files and attempts
6180 # to make the code below a bit more comprehensible
6181
6182 case $vinfo_number in
6183 yes)
6184 number_major="$1"
6185 number_minor="$2"
6186 number_revision="$3"
6187 #
6188 # There are really only two kinds -- those that
6189 # use the current revision as the major version
6190 # and those that subtract age and use age as
6191 # a minor version. But, then there is irix
6192 # which has an extra 1 added just for fun
6193 #
6194 case $version_type in
6195 darwin|linux|osf|windows|none)
6196 func_arith $number_major + $number_minor
6197 current=$func_arith_result
6198 age="$number_minor"
6199 revision="$number_revision"
6200 ;;
6201 freebsd-aout|freebsd-elf|sunos)
6202 current="$number_major"
6203 revision="$number_minor"
6204 age="0"
6205 ;;
6206 irix|nonstopux)
6207 func_arith $number_major + $number_minor
6208 current=$func_arith_result
6209 age="$number_minor"
6210 revision="$number_minor"
6211 lt_irix_increment=no
6212 ;;
6213 *)
6214 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
6215 ;;
6216 esac
6217 ;;
6218 no)
6219 current="$1"
6220 revision="$2"
6221 age="$3"
6222 ;;
6223 esac
6224
6225 # Check that each of the things are valid numbers.
6226 case $current in
6227 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6228 *)
6229 func_error "CURRENT \`$current' must be a nonnegative integer"
6230 func_fatal_error "\`$vinfo' is not valid version information"
6231 ;;
6232 esac
6233
6234 case $revision in
6235 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6236 *)
6237 func_error "REVISION \`$revision' must be a nonnegative integer"
6238 func_fatal_error "\`$vinfo' is not valid version information"
6239 ;;
6240 esac
6241
6242 case $age in
6243 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6244 *)
6245 func_error "AGE \`$age' must be a nonnegative integer"
6246 func_fatal_error "\`$vinfo' is not valid version information"
6247 ;;
6248 esac
6249
6250 if test "$age" -gt "$current"; then
6251 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6252 func_fatal_error "\`$vinfo' is not valid version information"
6253 fi
6254
6255 # Calculate the version variables.
6256 major=
6257 versuffix=
6258 verstring=
6259 case $version_type in
6260 none) ;;
6261
6262 darwin)
6263 # Like Linux, but with the current version available in
6264 # verstring for coding it into the library header
6265 func_arith $current - $age
6266 major=.$func_arith_result
6267 versuffix="$major.$age.$revision"
6268 # Darwin ld doesn't like 0 for these options...
6269 func_arith $current + 1
6270 minor_current=$func_arith_result
6271 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6272 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6273 ;;
6274
6275 freebsd-aout)
6276 major=".$current"
6277 versuffix=".$current.$revision";
6278 ;;
6279
6280 freebsd-elf)
6281 major=".$current"
6282 versuffix=".$current"
6283 ;;
6284
6285 irix | nonstopux)
6286 if test "X$lt_irix_increment" = "Xno"; then
6287 func_arith $current - $age
6288 else
6289 func_arith $current - $age + 1
6290 fi
6291 major=$func_arith_result
6292
6293 case $version_type in
6294 nonstopux) verstring_prefix=nonstopux ;;
6295 *) verstring_prefix=sgi ;;
6296 esac
6297 verstring="$verstring_prefix$major.$revision"
6298
6299 # Add in all the interfaces that we are compatible with.
6300 loop=$revision
6301 while test "$loop" -ne 0; do
6302 func_arith $revision - $loop
6303 iface=$func_arith_result
6304 func_arith $loop - 1
6305 loop=$func_arith_result
6306 verstring="$verstring_prefix$major.$iface:$verstring"
6307 done
6308
6309 # Before this point, $major must not contain `.'.
6310 major=.$major
6311 versuffix="$major.$revision"
6312 ;;
6313
6314 linux)
6315 func_arith $current - $age
6316 major=.$func_arith_result
6317 versuffix="$major.$age.$revision"
6318 ;;
6319
6320 osf)
6321 func_arith $current - $age
6322 major=.$func_arith_result
6323 versuffix=".$current.$age.$revision"
6324 verstring="$current.$age.$revision"
6325
6326 # Add in all the interfaces that we are compatible with.
6327 loop=$age
6328 while test "$loop" -ne 0; do
6329 func_arith $current - $loop
6330 iface=$func_arith_result
6331 func_arith $loop - 1
6332 loop=$func_arith_result
6333 verstring="$verstring:${iface}.0"
6334 done
6335
6336 # Make executables depend on our current version.
6337 verstring="$verstring:${current}.0"
6338 ;;
6339
6340 qnx)
6341 major=".$current"
6342 versuffix=".$current"
6343 ;;
6344
6345 sunos)
6346 major=".$current"
6347 versuffix=".$current.$revision"
6348 ;;
6349
6350 windows)
6351 # Use '-' rather than '.', since we only want one
6352 # extension on DOS 8.3 filesystems.
6353 func_arith $current - $age
6354 major=$func_arith_result
6355 versuffix="-$major"
6356 ;;
6357
6358 *)
6359 func_fatal_configuration "unknown library version type \`$version_type'"
6360 ;;
6361 esac
6362
6363 # Clear the version info if we defaulted, and they specified a release.
6364 if test -z "$vinfo" && test -n "$release"; then
6365 major=
6366 case $version_type in
6367 darwin)
6368 # we can't check for "0.0" in archive_cmds due to quoting
6369 # problems, so we reset it completely
6370 verstring=
6371 ;;
6372 *)
6373 verstring="0.0"
6374 ;;
6375 esac
6376 if test "$need_version" = no; then
6377 versuffix=
6378 else
6379 versuffix=".0.0"
6380 fi
6381 fi
6382
6383 # Remove version info from name if versioning should be avoided
6384 if test "$avoid_version" = yes && test "$need_version" = no; then
6385 major=
6386 versuffix=
6387 verstring=""
6388 fi
6389
6390 # Check to see if the archive will have undefined symbols.
6391 if test "$allow_undefined" = yes; then
6392 if test "$allow_undefined_flag" = unsupported; then
6393 func_warning "undefined symbols not allowed in $host shared libraries"
6394 build_libtool_libs=no
6395 build_old_libs=yes
6396 fi
6397 else
6398 # Don't allow undefined symbols.
6399 allow_undefined_flag="$no_undefined_flag"
6400 fi
6401
6402 fi
6403
6404 func_generate_dlsyms "$libname" "$libname" "yes"
6405 libobjs="$libobjs $symfileobj"
6406 test "X$libobjs" = "X " && libobjs=
6407
6408 if test "$mode" != relink; then
6409 # Remove our outputs, but don't remove object files since they
6410 # may have been created when compiling PIC objects.
6411 removelist=
6412 tempremovelist=`$ECHO "$output_objdir/*"`
6413 for p in $tempremovelist; do
6414 case $p in
6415 *.$objext | *.gcno)
6416 ;;
6417 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6418 if test "X$precious_files_regex" != "X"; then
6419 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6420 then
6421 continue
6422 fi
6423 fi
6424 removelist="$removelist $p"
6425 ;;
6426 *) ;;
6427 esac
6428 done
6429 test -n "$removelist" && \
6430 func_show_eval "${RM}r \$removelist"
6431 fi
6432
6433 # Now set the variables for building old libraries.
6434 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6435 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6436
6437 # Transform .lo files to .o files.
6438 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6439 fi
6440
6441 # Eliminate all temporary directories.
6442 #for path in $notinst_path; do
6443 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6444 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6445 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6446 #done
6447
6448 if test -n "$xrpath"; then
6449 # If the user specified any rpath flags, then add them.
6450 temp_xrpath=
6451 for libdir in $xrpath; do
6452 temp_xrpath="$temp_xrpath -R$libdir"
6453 case "$finalize_rpath " in
6454 *" $libdir "*) ;;
6455 *) finalize_rpath="$finalize_rpath $libdir" ;;
6456 esac
6457 done
6458 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6459 dependency_libs="$temp_xrpath $dependency_libs"
6460 fi
6461 fi
6462
6463 # Make sure dlfiles contains only unique files that won't be dlpreopened
6464 old_dlfiles="$dlfiles"
6465 dlfiles=
6466 for lib in $old_dlfiles; do
6467 case " $dlprefiles $dlfiles " in
6468 *" $lib "*) ;;
6469 *) dlfiles="$dlfiles $lib" ;;
6470 esac
6471 done
6472
6473 # Make sure dlprefiles contains only unique files
6474 old_dlprefiles="$dlprefiles"
6475 dlprefiles=
6476 for lib in $old_dlprefiles; do
6477 case "$dlprefiles " in
6478 *" $lib "*) ;;
6479 *) dlprefiles="$dlprefiles $lib" ;;
6480 esac
6481 done
6482
6483 if test "$build_libtool_libs" = yes; then
6484 if test -n "$rpath"; then
6485 case $host in
6486 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
6487 # these systems don't actually have a c library (as such)!
6488 ;;
6489 *-*-rhapsody* | *-*-darwin1.[012])
6490 # Rhapsody C library is in the System framework
6491 deplibs="$deplibs System.ltframework"
6492 ;;
6493 *-*-netbsd*)
6494 # Don't link with libc until the a.out ld.so is fixed.
6495 ;;
6496 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6497 # Do not include libc due to us having libc/libc_r.
6498 ;;
6499 *-*-sco3.2v5* | *-*-sco5v6*)
6500 # Causes problems with __ctype
6501 ;;
6502 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6503 # Compiler inserts libc in the correct place for threads to work
6504 ;;
6505 *)
6506 # Add libc to deplibs on all other systems if necessary.
6507 if test "$build_libtool_need_lc" = "yes"; then
6508 deplibs="$deplibs -lc"
6509 fi
6510 ;;
6511 esac
6512 fi
6513
6514 # Transform deplibs into only deplibs that can be linked in shared.
6515 name_save=$name
6516 libname_save=$libname
6517 release_save=$release
6518 versuffix_save=$versuffix
6519 major_save=$major
6520 # I'm not sure if I'm treating the release correctly. I think
6521 # release should show up in the -l (ie -lgmp5) so we don't want to
6522 # add it in twice. Is that correct?
6523 release=""
6524 versuffix=""
6525 major=""
6526 newdeplibs=
6527 droppeddeps=no
6528 case $deplibs_check_method in
6529 pass_all)
6530 # Don't check for shared/static. Everything works.
6531 # This might be a little naive. We might want to check
6532 # whether the library exists or not. But this is on
6533 # osf3 & osf4 and I'm not really sure... Just
6534 # implementing what was already the behavior.
6535 newdeplibs=$deplibs
6536 ;;
6537 test_compile)
6538 # This code stresses the "libraries are programs" paradigm to its
6539 # limits. Maybe even breaks it. We compile a program, linking it
6540 # against the deplibs as a proxy for the library. Then we can check
6541 # whether they linked in statically or dynamically with ldd.
6542 $opt_dry_run || $RM conftest.c
6543 cat > conftest.c <<EOF
6544 int main() { return 0; }
6545EOF
6546 $opt_dry_run || $RM conftest
6547 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6548 ldd_output=`ldd conftest`
6549 for i in $deplibs; do
6550 case $i in
6551 -l*)
6552 func_stripname -l '' "$i"
6553 name=$func_stripname_result
6554 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6555 case " $predeps $postdeps " in
6556 *" $i "*)
6557 newdeplibs="$newdeplibs $i"
6558 i=""
6559 ;;
6560 esac
6561 fi
6562 if test -n "$i" ; then
6563 libname=`eval "\\$ECHO \"$libname_spec\""`
6564 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6565 set dummy $deplib_matches; shift
6566 deplib_match=$1
6567 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6568 newdeplibs="$newdeplibs $i"
6569 else
6570 droppeddeps=yes
6571 $ECHO
6572 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6573 $ECHO "*** I have the capability to make that library automatically link in when"
6574 $ECHO "*** you link to this library. But I can only do this if you have a"
6575 $ECHO "*** shared version of the library, which I believe you do not have"
6576 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6577 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6578 fi
6579 fi
6580 ;;
6581 *)
6582 newdeplibs="$newdeplibs $i"
6583 ;;
6584 esac
6585 done
6586 else
6587 # Error occurred in the first compile. Let's try to salvage
6588 # the situation: Compile a separate program for each library.
6589 for i in $deplibs; do
6590 case $i in
6591 -l*)
6592 func_stripname -l '' "$i"
6593 name=$func_stripname_result
6594 $opt_dry_run || $RM conftest
6595 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6596 ldd_output=`ldd conftest`
6597 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6598 case " $predeps $postdeps " in
6599 *" $i "*)
6600 newdeplibs="$newdeplibs $i"
6601 i=""
6602 ;;
6603 esac
6604 fi
6605 if test -n "$i" ; then
6606 libname=`eval "\\$ECHO \"$libname_spec\""`
6607 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6608 set dummy $deplib_matches; shift
6609 deplib_match=$1
6610 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6611 newdeplibs="$newdeplibs $i"
6612 else
6613 droppeddeps=yes
6614 $ECHO
6615 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6616 $ECHO "*** I have the capability to make that library automatically link in when"
6617 $ECHO "*** you link to this library. But I can only do this if you have a"
6618 $ECHO "*** shared version of the library, which you do not appear to have"
6619 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6620 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6621 fi
6622 fi
6623 else
6624 droppeddeps=yes
6625 $ECHO
6626 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6627 $ECHO "*** make it link in! You will probably need to install it or some"
6628 $ECHO "*** library that it depends on before this library will be fully"
6629 $ECHO "*** functional. Installing it before continuing would be even better."
6630 fi
6631 ;;
6632 *)
6633 newdeplibs="$newdeplibs $i"
6634 ;;
6635 esac
6636 done
6637 fi
6638 ;;
6639 file_magic*)
6640 set dummy $deplibs_check_method; shift
6641 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6642 for a_deplib in $deplibs; do
6643 case $a_deplib in
6644 -l*)
6645 func_stripname -l '' "$a_deplib"
6646 name=$func_stripname_result
6647 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6648 case " $predeps $postdeps " in
6649 *" $a_deplib "*)
6650 newdeplibs="$newdeplibs $a_deplib"
6651 a_deplib=""
6652 ;;
6653 esac
6654 fi
6655 if test -n "$a_deplib" ; then
6656 libname=`eval "\\$ECHO \"$libname_spec\""`
6657 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6658 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6659 for potent_lib in $potential_libs; do
6660 # Follow soft links.
6661 if ls -lLd "$potent_lib" 2>/dev/null |
6662 $GREP " -> " >/dev/null; then
6663 continue
6664 fi
6665 # The statement above tries to avoid entering an
6666 # endless loop below, in case of cyclic links.
6667 # We might still enter an endless loop, since a link
6668 # loop can be closed while we follow links,
6669 # but so what?
6670 potlib="$potent_lib"
6671 while test -h "$potlib" 2>/dev/null; do
6672 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6673 case $potliblink in
6674 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6675 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6676 esac
6677 done
6678 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6679 $SED -e 10q |
6680 $EGREP "$file_magic_regex" > /dev/null; then
6681 newdeplibs="$newdeplibs $a_deplib"
6682 a_deplib=""
6683 break 2
6684 fi
6685 done
6686 done
6687 fi
6688 if test -n "$a_deplib" ; then
6689 droppeddeps=yes
6690 $ECHO
6691 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6692 $ECHO "*** I have the capability to make that library automatically link in when"
6693 $ECHO "*** you link to this library. But I can only do this if you have a"
6694 $ECHO "*** shared version of the library, which you do not appear to have"
6695 $ECHO "*** because I did check the linker path looking for a file starting"
6696 if test -z "$potlib" ; then
6697 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6698 else
6699 $ECHO "*** with $libname and none of the candidates passed a file format test"
6700 $ECHO "*** using a file magic. Last file checked: $potlib"
6701 fi
6702 fi
6703 ;;
6704 *)
6705 # Add a -L argument.
6706 newdeplibs="$newdeplibs $a_deplib"
6707 ;;
6708 esac
6709 done # Gone through all deplibs.
6710 ;;
6711 match_pattern*)
6712 set dummy $deplibs_check_method; shift
6713 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6714 for a_deplib in $deplibs; do
6715 case $a_deplib in
6716 -l*)
6717 func_stripname -l '' "$a_deplib"
6718 name=$func_stripname_result
6719 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6720 case " $predeps $postdeps " in
6721 *" $a_deplib "*)
6722 newdeplibs="$newdeplibs $a_deplib"
6723 a_deplib=""
6724 ;;
6725 esac
6726 fi
6727 if test -n "$a_deplib" ; then
6728 libname=`eval "\\$ECHO \"$libname_spec\""`
6729 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6730 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6731 for potent_lib in $potential_libs; do
6732 potlib="$potent_lib" # see symlink-check above in file_magic test
6733 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6734 $EGREP "$match_pattern_regex" > /dev/null; then
6735 newdeplibs="$newdeplibs $a_deplib"
6736 a_deplib=""
6737 break 2
6738 fi
6739 done
6740 done
6741 fi
6742 if test -n "$a_deplib" ; then
6743 droppeddeps=yes
6744 $ECHO
6745 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6746 $ECHO "*** I have the capability to make that library automatically link in when"
6747 $ECHO "*** you link to this library. But I can only do this if you have a"
6748 $ECHO "*** shared version of the library, which you do not appear to have"
6749 $ECHO "*** because I did check the linker path looking for a file starting"
6750 if test -z "$potlib" ; then
6751 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6752 else
6753 $ECHO "*** with $libname and none of the candidates passed a file format test"
6754 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6755 fi
6756 fi
6757 ;;
6758 *)
6759 # Add a -L argument.
6760 newdeplibs="$newdeplibs $a_deplib"
6761 ;;
6762 esac
6763 done # Gone through all deplibs.
6764 ;;
6765 none | unknown | *)
6766 newdeplibs=""
6767 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6768 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6769 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6770 for i in $predeps $postdeps ; do
6771 # can't use Xsed below, because $i might contain '/'
6772 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6773 done
6774 fi
6775 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6776 $GREP . >/dev/null; then
6777 $ECHO
6778 if test "X$deplibs_check_method" = "Xnone"; then
6779 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6780 else
6781 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6782 fi
6783 $ECHO "*** All declared inter-library dependencies are being dropped."
6784 droppeddeps=yes
6785 fi
6786 ;;
6787 esac
6788 versuffix=$versuffix_save
6789 major=$major_save
6790 release=$release_save
6791 libname=$libname_save
6792 name=$name_save
6793
6794 case $host in
6795 *-*-rhapsody* | *-*-darwin1.[012])
6796 # On Rhapsody replace the C library with the System framework
6797 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6798 ;;
6799 esac
6800
6801 if test "$droppeddeps" = yes; then
6802 if test "$module" = yes; then
6803 $ECHO
6804 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6805 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6806 $ECHO "*** a static module, that should work as long as the dlopening"
6807 $ECHO "*** application is linked with the -dlopen flag."
6808 if test -z "$global_symbol_pipe"; then
6809 $ECHO
6810 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6811 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6812 $ECHO "*** not find such a program. So, this module is probably useless."
6813 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6814 fi
6815 if test "$build_old_libs" = no; then
6816 oldlibs="$output_objdir/$libname.$libext"
6817 build_libtool_libs=module
6818 build_old_libs=yes
6819 else
6820 build_libtool_libs=no
6821 fi
6822 else
6823 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6824 $ECHO "*** automatically added whenever a program is linked with this library"
6825 $ECHO "*** or is declared to -dlopen it."
6826
6827 if test "$allow_undefined" = no; then
6828 $ECHO
6829 $ECHO "*** Since this library must not contain undefined symbols,"
6830 $ECHO "*** because either the platform does not support them or"
6831 $ECHO "*** it was explicitly requested with -no-undefined,"
6832 $ECHO "*** libtool will only create a static version of it."
6833 if test "$build_old_libs" = no; then
6834 oldlibs="$output_objdir/$libname.$libext"
6835 build_libtool_libs=module
6836 build_old_libs=yes
6837 else
6838 build_libtool_libs=no
6839 fi
6840 fi
6841 fi
6842 fi
6843 # Done checking deplibs!
6844 deplibs=$newdeplibs
6845 fi
6846 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6847 case $host in
6848 *-*-darwin*)
6849 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6850 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6851 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6852 ;;
6853 esac
6854
6855 # move library search paths that coincide with paths to not yet
6856 # installed libraries to the beginning of the library search list
6857 new_libs=
6858 for path in $notinst_path; do
6859 case " $new_libs " in
6860 *" -L$path/$objdir "*) ;;
6861 *)
6862 case " $deplibs " in
6863 *" -L$path/$objdir "*)
6864 new_libs="$new_libs -L$path/$objdir" ;;
6865 esac
6866 ;;
6867 esac
6868 done
6869 for deplib in $deplibs; do
6870 case $deplib in
6871 -L*)
6872 case " $new_libs " in
6873 *" $deplib "*) ;;
6874 *) new_libs="$new_libs $deplib" ;;
6875 esac
6876 ;;
6877 *) new_libs="$new_libs $deplib" ;;
6878 esac
6879 done
6880 deplibs="$new_libs"
6881
6882 # All the library-specific variables (install_libdir is set above).
6883 library_names=
6884 old_library=
6885 dlname=
6886
6887 # Test again, we may have decided not to build it any more
6888 if test "$build_libtool_libs" = yes; then
6889 if test "$hardcode_into_libs" = yes; then
6890 # Hardcode the library paths
6891 hardcode_libdirs=
6892 dep_rpath=
6893 rpath="$finalize_rpath"
6894 test "$mode" != relink && rpath="$compile_rpath$rpath"
6895 for libdir in $rpath; do
6896 if test -n "$hardcode_libdir_flag_spec"; then
6897 if test -n "$hardcode_libdir_separator"; then
6898 if test -z "$hardcode_libdirs"; then
6899 hardcode_libdirs="$libdir"
6900 else
6901 # Just accumulate the unique libdirs.
6902 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6903 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6904 ;;
6905 *)
6906 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6907 ;;
6908 esac
6909 fi
6910 else
6911 eval flag=\"$hardcode_libdir_flag_spec\"
6912 dep_rpath="$dep_rpath $flag"
6913 fi
6914 elif test -n "$runpath_var"; then
6915 case "$perm_rpath " in
6916 *" $libdir "*) ;;
6917 *) perm_rpath="$perm_rpath $libdir" ;;
6918 esac
6919 fi
6920 done
6921 # Substitute the hardcoded libdirs into the rpath.
6922 if test -n "$hardcode_libdir_separator" &&
6923 test -n "$hardcode_libdirs"; then
6924 libdir="$hardcode_libdirs"
6925 if test -n "$hardcode_libdir_flag_spec_ld"; then
6926 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6927 else
6928 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6929 fi
6930 fi
6931 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6932 # We should set the runpath_var.
6933 rpath=
6934 for dir in $perm_rpath; do
6935 rpath="$rpath$dir:"
6936 done
6937 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6938 fi
6939 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6940 fi
6941
6942 shlibpath="$finalize_shlibpath"
6943 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6944 if test -n "$shlibpath"; then
6945 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6946 fi
6947
6948 # Get the real and link names of the library.
6949 eval shared_ext=\"$shrext_cmds\"
6950 eval library_names=\"$library_names_spec\"
6951 set dummy $library_names
6952 shift
6953 realname="$1"
6954 shift
6955
6956 if test -n "$soname_spec"; then
6957 eval soname=\"$soname_spec\"
6958 else
6959 soname="$realname"
6960 fi
6961 if test -z "$dlname"; then
6962 dlname=$soname
6963 fi
6964
6965 lib="$output_objdir/$realname"
6966 linknames=
6967 for link
6968 do
6969 linknames="$linknames $link"
6970 done
6971
6972 # Use standard objects if they are pic
6973 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6974 test "X$libobjs" = "X " && libobjs=
6975
6976 delfiles=
6977 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6978 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6979 export_symbols="$output_objdir/$libname.uexp"
6980 delfiles="$delfiles $export_symbols"
6981 fi
6982
6983 orig_export_symbols=
6984 case $host_os in
6985 cygwin* | mingw* | cegcc*)
6986 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6987 # exporting using user supplied symfile
6988 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6989 # and it's NOT already a .def file. Must figure out
6990 # which of the given symbols are data symbols and tag
6991 # them as such. So, trigger use of export_symbols_cmds.
6992 # export_symbols gets reassigned inside the "prepare
6993 # the list of exported symbols" if statement, so the
6994 # include_expsyms logic still works.
6995 orig_export_symbols="$export_symbols"
6996 export_symbols=
6997 always_export_symbols=yes
6998 fi
6999 fi
7000 ;;
7001 esac
7002
7003 # Prepare the list of exported symbols
7004 if test -z "$export_symbols"; then
7005 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
7006 func_verbose "generating symbol list for \`$libname.la'"
7007 export_symbols="$output_objdir/$libname.exp"
7008 $opt_dry_run || $RM $export_symbols
7009 cmds=$export_symbols_cmds
7010 save_ifs="$IFS"; IFS='~'
7011 for cmd in $cmds; do
7012 IFS="$save_ifs"
7013 eval cmd=\"$cmd\"
7014 func_len " $cmd"
7015 len=$func_len_result
7016 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7017 func_show_eval "$cmd" 'exit $?'
7018 skipped_export=false
7019 else
7020 # The command line is too long to execute in one step.
7021 func_verbose "using reloadable object file for export list..."
7022 skipped_export=:
7023 # Break out early, otherwise skipped_export may be
7024 # set to false by a later but shorter cmd.
7025 break
7026 fi
7027 done
7028 IFS="$save_ifs"
7029 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7030 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7031 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7032 fi
7033 fi
7034 fi
7035
7036 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7037 tmp_export_symbols="$export_symbols"
7038 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7039 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7040 fi
7041
7042 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7043 # The given exports_symbols file has to be filtered, so filter it.
7044 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7045 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7046 # 's' commands which not all seds can handle. GNU sed should be fine
7047 # though. Also, the filter scales superlinearly with the number of
7048 # global variables. join(1) would be nice here, but unfortunately
7049 # isn't a blessed tool.
7050 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7051 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7052 export_symbols=$output_objdir/$libname.def
7053 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7054 fi
7055
7056 tmp_deplibs=
7057 for test_deplib in $deplibs; do
7058 case " $convenience " in
7059 *" $test_deplib "*) ;;
7060 *)
7061 tmp_deplibs="$tmp_deplibs $test_deplib"
7062 ;;
7063 esac
7064 done
7065 deplibs="$tmp_deplibs"
7066
7067 if test -n "$convenience"; then
7068 if test -n "$whole_archive_flag_spec" &&
7069 test "$compiler_needs_object" = yes &&
7070 test -z "$libobjs"; then
7071 # extract the archives, so we have objects to list.
7072 # TODO: could optimize this to just extract one archive.
7073 whole_archive_flag_spec=
7074 fi
7075 if test -n "$whole_archive_flag_spec"; then
7076 save_libobjs=$libobjs
7077 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7078 test "X$libobjs" = "X " && libobjs=
7079 else
7080 gentop="$output_objdir/${outputname}x"
7081 generated="$generated $gentop"
7082
7083 func_extract_archives $gentop $convenience
7084 libobjs="$libobjs $func_extract_archives_result"
7085 test "X$libobjs" = "X " && libobjs=
7086 fi
7087 fi
7088
7089 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7090 eval flag=\"$thread_safe_flag_spec\"
7091 linker_flags="$linker_flags $flag"
7092 fi
7093
7094 # Make a backup of the uninstalled library when relinking
7095 if test "$mode" = relink; then
7096 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7097 fi
7098
7099 # Do each of the archive commands.
7100 if test "$module" = yes && test -n "$module_cmds" ; then
7101 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7102 eval test_cmds=\"$module_expsym_cmds\"
7103 cmds=$module_expsym_cmds
7104 else
7105 eval test_cmds=\"$module_cmds\"
7106 cmds=$module_cmds
7107 fi
7108 else
7109 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7110 eval test_cmds=\"$archive_expsym_cmds\"
7111 cmds=$archive_expsym_cmds
7112 else
7113 eval test_cmds=\"$archive_cmds\"
7114 cmds=$archive_cmds
7115 fi
7116 fi
7117
7118 if test "X$skipped_export" != "X:" &&
7119 func_len " $test_cmds" &&
7120 len=$func_len_result &&
7121 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7122 :
7123 else
7124 # The command line is too long to link in one step, link piecewise
7125 # or, if using GNU ld and skipped_export is not :, use a linker
7126 # script.
7127
7128 # Save the value of $output and $libobjs because we want to
7129 # use them later. If we have whole_archive_flag_spec, we
7130 # want to use save_libobjs as it was before
7131 # whole_archive_flag_spec was expanded, because we can't
7132 # assume the linker understands whole_archive_flag_spec.
7133 # This may have to be revisited, in case too many
7134 # convenience libraries get linked in and end up exceeding
7135 # the spec.
7136 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7137 save_libobjs=$libobjs
7138 fi
7139 save_output=$output
7140 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7141
7142 # Clear the reloadable object creation command queue and
7143 # initialize k to one.
7144 test_cmds=
7145 concat_cmds=
7146 objlist=
7147 last_robj=
7148 k=1
7149
7150 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7151 output=${output_objdir}/${output_la}.lnkscript
7152 func_verbose "creating GNU ld script: $output"
7153 $ECHO 'INPUT (' > $output
7154 for obj in $save_libobjs
7155 do
7156 $ECHO "$obj" >> $output
7157 done
7158 $ECHO ')' >> $output
7159 delfiles="$delfiles $output"
7160 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7161 output=${output_objdir}/${output_la}.lnk
7162 func_verbose "creating linker input file list: $output"
7163 : > $output
7164 set x $save_libobjs
7165 shift
7166 firstobj=
7167 if test "$compiler_needs_object" = yes; then
7168 firstobj="$1 "
7169 shift
7170 fi
7171 for obj
7172 do
7173 $ECHO "$obj" >> $output
7174 done
7175 delfiles="$delfiles $output"
7176 output=$firstobj\"$file_list_spec$output\"
7177 else
7178 if test -n "$save_libobjs"; then
7179 func_verbose "creating reloadable object files..."
7180 output=$output_objdir/$output_la-${k}.$objext
7181 eval test_cmds=\"$reload_cmds\"
7182 func_len " $test_cmds"
7183 len0=$func_len_result
7184 len=$len0
7185
7186 # Loop over the list of objects to be linked.
7187 for obj in $save_libobjs
7188 do
7189 func_len " $obj"
7190 func_arith $len + $func_len_result
7191 len=$func_arith_result
7192 if test "X$objlist" = X ||
7193 test "$len" -lt "$max_cmd_len"; then
7194 func_append objlist " $obj"
7195 else
7196 # The command $test_cmds is almost too long, add a
7197 # command to the queue.
7198 if test "$k" -eq 1 ; then
7199 # The first file doesn't have a previous command to add.
7200 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7201 else
7202 # All subsequent reloadable object files will link in
7203 # the last one created.
7204 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7205 fi
7206 last_robj=$output_objdir/$output_la-${k}.$objext
7207 func_arith $k + 1
7208 k=$func_arith_result
7209 output=$output_objdir/$output_la-${k}.$objext
7210 objlist=$obj
7211 func_len " $last_robj"
7212 func_arith $len0 + $func_len_result
7213 len=$func_arith_result
7214 fi
7215 done
7216 # Handle the remaining objects by creating one last
7217 # reloadable object file. All subsequent reloadable object
7218 # files will link in the last one created.
7219 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7220 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7221 if test -n "$last_robj"; then
7222 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7223 fi
7224 delfiles="$delfiles $output"
7225
7226 else
7227 output=
7228 fi
7229
7230 if ${skipped_export-false}; then
7231 func_verbose "generating symbol list for \`$libname.la'"
7232 export_symbols="$output_objdir/$libname.exp"
7233 $opt_dry_run || $RM $export_symbols
7234 libobjs=$output
7235 # Append the command to create the export file.
7236 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7237 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7238 if test -n "$last_robj"; then
7239 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7240 fi
7241 fi
7242
7243 test -n "$save_libobjs" &&
7244 func_verbose "creating a temporary reloadable object file: $output"
7245
7246 # Loop through the commands generated above and execute them.
7247 save_ifs="$IFS"; IFS='~'
7248 for cmd in $concat_cmds; do
7249 IFS="$save_ifs"
7250 $opt_silent || {
7251 func_quote_for_expand "$cmd"
7252 eval "func_echo $func_quote_for_expand_result"
7253 }
7254 $opt_dry_run || eval "$cmd" || {
7255 lt_exit=$?
7256
7257 # Restore the uninstalled library and exit
7258 if test "$mode" = relink; then
7259 ( cd "$output_objdir" && \
7260 $RM "${realname}T" && \
7261 $MV "${realname}U" "$realname" )
7262 fi
7263
7264 exit $lt_exit
7265 }
7266 done
7267 IFS="$save_ifs"
7268
7269 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7270 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7271 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7272 fi
7273 fi
7274
7275 if ${skipped_export-false}; then
7276 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7277 tmp_export_symbols="$export_symbols"
7278 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7279 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7280 fi
7281
7282 if test -n "$orig_export_symbols"; then
7283 # The given exports_symbols file has to be filtered, so filter it.
7284 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7285 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7286 # 's' commands which not all seds can handle. GNU sed should be fine
7287 # though. Also, the filter scales superlinearly with the number of
7288 # global variables. join(1) would be nice here, but unfortunately
7289 # isn't a blessed tool.
7290 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7291 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7292 export_symbols=$output_objdir/$libname.def
7293 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7294 fi
7295 fi
7296
7297 libobjs=$output
7298 # Restore the value of output.
7299 output=$save_output
7300
7301 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7302 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7303 test "X$libobjs" = "X " && libobjs=
7304 fi
7305 # Expand the library linking commands again to reset the
7306 # value of $libobjs for piecewise linking.
7307
7308 # Do each of the archive commands.
7309 if test "$module" = yes && test -n "$module_cmds" ; then
7310 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7311 cmds=$module_expsym_cmds
7312 else
7313 cmds=$module_cmds
7314 fi
7315 else
7316 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7317 cmds=$archive_expsym_cmds
7318 else
7319 cmds=$archive_cmds
7320 fi
7321 fi
7322 fi
7323
7324 if test -n "$delfiles"; then
7325 # Append the command to remove temporary files to $cmds.
7326 eval cmds=\"\$cmds~\$RM $delfiles\"
7327 fi
7328
7329 # Add any objects from preloaded convenience libraries
7330 if test -n "$dlprefiles"; then
7331 gentop="$output_objdir/${outputname}x"
7332 generated="$generated $gentop"
7333
7334 func_extract_archives $gentop $dlprefiles
7335 libobjs="$libobjs $func_extract_archives_result"
7336 test "X$libobjs" = "X " && libobjs=
7337 fi
7338
7339 save_ifs="$IFS"; IFS='~'
7340 for cmd in $cmds; do
7341 IFS="$save_ifs"
7342 eval cmd=\"$cmd\"
7343 $opt_silent || {
7344 func_quote_for_expand "$cmd"
7345 eval "func_echo $func_quote_for_expand_result"
7346 }
7347 $opt_dry_run || eval "$cmd" || {
7348 lt_exit=$?
7349
7350 # Restore the uninstalled library and exit
7351 if test "$mode" = relink; then
7352 ( cd "$output_objdir" && \
7353 $RM "${realname}T" && \
7354 $MV "${realname}U" "$realname" )
7355 fi
7356
7357 exit $lt_exit
7358 }
7359 done
7360 IFS="$save_ifs"
7361
7362 # Restore the uninstalled library and exit
7363 if test "$mode" = relink; then
7364 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7365
7366 if test -n "$convenience"; then
7367 if test -z "$whole_archive_flag_spec"; then
7368 func_show_eval '${RM}r "$gentop"'
7369 fi
7370 fi
7371
7372 exit $EXIT_SUCCESS
7373 fi
7374
7375 # Create links to the real library.
7376 for linkname in $linknames; do
7377 if test "$realname" != "$linkname"; then
7378 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7379 fi
7380 done
7381
7382 # If -module or -export-dynamic was specified, set the dlname.
7383 if test "$module" = yes || test "$export_dynamic" = yes; then
7384 # On all known operating systems, these are identical.
7385 dlname="$soname"
7386 fi
7387 fi
7388 ;;
7389
7390 obj)
7391 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7392 func_warning "\`-dlopen' is ignored for objects"
7393 fi
7394
7395 case " $deplibs" in
7396 *\ -l* | *\ -L*)
7397 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7398 esac
7399
7400 test -n "$rpath" && \
7401 func_warning "\`-rpath' is ignored for objects"
7402
7403 test -n "$xrpath" && \
7404 func_warning "\`-R' is ignored for objects"
7405
7406 test -n "$vinfo" && \
7407 func_warning "\`-version-info' is ignored for objects"
7408
7409 test -n "$release" && \
7410 func_warning "\`-release' is ignored for objects"
7411
7412 case $output in
7413 *.lo)
7414 test -n "$objs$old_deplibs" && \
7415 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7416
7417 libobj=$output
7418 func_lo2o "$libobj"
7419 obj=$func_lo2o_result
7420 ;;
7421 *)
7422 libobj=
7423 obj="$output"
7424 ;;
7425 esac
7426
7427 # Delete the old objects.
7428 $opt_dry_run || $RM $obj $libobj
7429
7430 # Objects from convenience libraries. This assumes
7431 # single-version convenience libraries. Whenever we create
7432 # different ones for PIC/non-PIC, this we'll have to duplicate
7433 # the extraction.
7434 reload_conv_objs=
7435 gentop=
7436 # reload_cmds runs $LD directly, so let us get rid of
7437 # -Wl from whole_archive_flag_spec and hope we can get by with
7438 # turning comma into space..
7439 wl=
7440
7441 if test -n "$convenience"; then
7442 if test -n "$whole_archive_flag_spec"; then
7443 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7444 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7445 else
7446 gentop="$output_objdir/${obj}x"
7447 generated="$generated $gentop"
7448
7449 func_extract_archives $gentop $convenience
7450 reload_conv_objs="$reload_objs $func_extract_archives_result"
7451 fi
7452 fi
7453
7454 # Create the old-style object.
7455 reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7456
7457 output="$obj"
7458 func_execute_cmds "$reload_cmds" 'exit $?'
7459
7460 # Exit if we aren't doing a library object file.
7461 if test -z "$libobj"; then
7462 if test -n "$gentop"; then
7463 func_show_eval '${RM}r "$gentop"'
7464 fi
7465
7466 exit $EXIT_SUCCESS
7467 fi
7468
7469 if test "$build_libtool_libs" != yes; then
7470 if test -n "$gentop"; then
7471 func_show_eval '${RM}r "$gentop"'
7472 fi
7473
7474 # Create an invalid libtool object if no PIC, so that we don't
7475 # accidentally link it into a program.
7476 # $show "echo timestamp > $libobj"
7477 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7478 exit $EXIT_SUCCESS
7479 fi
7480
7481 if test -n "$pic_flag" || test "$pic_mode" != default; then
7482 # Only do commands if we really have different PIC objects.
7483 reload_objs="$libobjs $reload_conv_objs"
7484 output="$libobj"
7485 func_execute_cmds "$reload_cmds" 'exit $?'
7486 fi
7487
7488 if test -n "$gentop"; then
7489 func_show_eval '${RM}r "$gentop"'
7490 fi
7491
7492 exit $EXIT_SUCCESS
7493 ;;
7494
7495 prog)
7496 case $host in
7497 *cygwin*) func_stripname '' '.exe' "$output"
7498 output=$func_stripname_result.exe;;
7499 esac
7500 test -n "$vinfo" && \
7501 func_warning "\`-version-info' is ignored for programs"
7502
7503 test -n "$release" && \
7504 func_warning "\`-release' is ignored for programs"
7505
7506 test "$preload" = yes \
7507 && test "$dlopen_support" = unknown \
7508 && test "$dlopen_self" = unknown \
7509 && test "$dlopen_self_static" = unknown && \
7510 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7511
7512 case $host in
7513 *-*-rhapsody* | *-*-darwin1.[012])
7514 # On Rhapsody replace the C library is the System framework
7515 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7516 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7517 ;;
7518 esac
7519
7520 case $host in
7521 *-*-darwin*)
7522 # Don't allow lazy linking, it breaks C++ global constructors
7523 # But is supposedly fixed on 10.4 or later (yay!).
7524 if test "$tagname" = CXX ; then
7525 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7526 10.[0123])
7527 compile_command="$compile_command ${wl}-bind_at_load"
7528 finalize_command="$finalize_command ${wl}-bind_at_load"
7529 ;;
7530 esac
7531 fi
7532 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7533 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7534 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7535 ;;
7536 esac
7537
7538
7539 # move library search paths that coincide with paths to not yet
7540 # installed libraries to the beginning of the library search list
7541 new_libs=
7542 for path in $notinst_path; do
7543 case " $new_libs " in
7544 *" -L$path/$objdir "*) ;;
7545 *)
7546 case " $compile_deplibs " in
7547 *" -L$path/$objdir "*)
7548 new_libs="$new_libs -L$path/$objdir" ;;
7549 esac
7550 ;;
7551 esac
7552 done
7553 for deplib in $compile_deplibs; do
7554 case $deplib in
7555 -L*)
7556 case " $new_libs " in
7557 *" $deplib "*) ;;
7558 *) new_libs="$new_libs $deplib" ;;
7559 esac
7560 ;;
7561 *) new_libs="$new_libs $deplib" ;;
7562 esac
7563 done
7564 compile_deplibs="$new_libs"
7565
7566
7567 compile_command="$compile_command $compile_deplibs"
7568 finalize_command="$finalize_command $finalize_deplibs"
7569
7570 if test -n "$rpath$xrpath"; then
7571 # If the user specified any rpath flags, then add them.
7572 for libdir in $rpath $xrpath; do
7573 # This is the magic to use -rpath.
7574 case "$finalize_rpath " in
7575 *" $libdir "*) ;;
7576 *) finalize_rpath="$finalize_rpath $libdir" ;;
7577 esac
7578 done
7579 fi
7580
7581 # Now hardcode the library paths
7582 rpath=
7583 hardcode_libdirs=
7584 for libdir in $compile_rpath $finalize_rpath; do
7585 if test -n "$hardcode_libdir_flag_spec"; then
7586 if test -n "$hardcode_libdir_separator"; then
7587 if test -z "$hardcode_libdirs"; then
7588 hardcode_libdirs="$libdir"
7589 else
7590 # Just accumulate the unique libdirs.
7591 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7592 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7593 ;;
7594 *)
7595 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7596 ;;
7597 esac
7598 fi
7599 else
7600 eval flag=\"$hardcode_libdir_flag_spec\"
7601 rpath="$rpath $flag"
7602 fi
7603 elif test -n "$runpath_var"; then
7604 case "$perm_rpath " in
7605 *" $libdir "*) ;;
7606 *) perm_rpath="$perm_rpath $libdir" ;;
7607 esac
7608 fi
7609 case $host in
7610 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7611 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7612 case :$dllsearchpath: in
7613 *":$libdir:"*) ;;
7614 ::) dllsearchpath=$libdir;;
7615 *) dllsearchpath="$dllsearchpath:$libdir";;
7616 esac
7617 case :$dllsearchpath: in
7618 *":$testbindir:"*) ;;
7619 ::) dllsearchpath=$testbindir;;
7620 *) dllsearchpath="$dllsearchpath:$testbindir";;
7621 esac
7622 ;;
7623 esac
7624 done
7625 # Substitute the hardcoded libdirs into the rpath.
7626 if test -n "$hardcode_libdir_separator" &&
7627 test -n "$hardcode_libdirs"; then
7628 libdir="$hardcode_libdirs"
7629 eval rpath=\" $hardcode_libdir_flag_spec\"
7630 fi
7631 compile_rpath="$rpath"
7632
7633 rpath=
7634 hardcode_libdirs=
7635 for libdir in $finalize_rpath; do
7636 if test -n "$hardcode_libdir_flag_spec"; then
7637 if test -n "$hardcode_libdir_separator"; then
7638 if test -z "$hardcode_libdirs"; then
7639 hardcode_libdirs="$libdir"
7640 else
7641 # Just accumulate the unique libdirs.
7642 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7643 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7644 ;;
7645 *)
7646 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7647 ;;
7648 esac
7649 fi
7650 else
7651 eval flag=\"$hardcode_libdir_flag_spec\"
7652 rpath="$rpath $flag"
7653 fi
7654 elif test -n "$runpath_var"; then
7655 case "$finalize_perm_rpath " in
7656 *" $libdir "*) ;;
7657 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7658 esac
7659 fi
7660 done
7661 # Substitute the hardcoded libdirs into the rpath.
7662 if test -n "$hardcode_libdir_separator" &&
7663 test -n "$hardcode_libdirs"; then
7664 libdir="$hardcode_libdirs"
7665 eval rpath=\" $hardcode_libdir_flag_spec\"
7666 fi
7667 finalize_rpath="$rpath"
7668
7669 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7670 # Transform all the library objects into standard objects.
7671 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7672 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7673 fi
7674
7675 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7676
7677 # template prelinking step
7678 if test -n "$prelink_cmds"; then
7679 func_execute_cmds "$prelink_cmds" 'exit $?'
7680 fi
7681
7682 wrappers_required=yes
7683 case $host in
7684 *cygwin* | *mingw* )
7685 if test "$build_libtool_libs" != yes; then
7686 wrappers_required=no
7687 fi
7688 ;;
7689 *cegcc)
7690 # Disable wrappers for cegcc, we are cross compiling anyway.
7691 wrappers_required=no
7692 ;;
7693 *)
7694 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7695 wrappers_required=no
7696 fi
7697 ;;
7698 esac
7699 if test "$wrappers_required" = no; then
7700 # Replace the output file specification.
7701 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7702 link_command="$compile_command$compile_rpath"
7703
7704 # We have no uninstalled library dependencies, so finalize right now.
7705 exit_status=0
7706 func_show_eval "$link_command" 'exit_status=$?'
7707
7708 # Delete the generated files.
7709 if test -f "$output_objdir/${outputname}S.${objext}"; then
7710 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7711 fi
7712
7713 exit $exit_status
7714 fi
7715
7716 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7717 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7718 fi
7719 if test -n "$finalize_shlibpath"; then
7720 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7721 fi
7722
7723 compile_var=
7724 finalize_var=
7725 if test -n "$runpath_var"; then
7726 if test -n "$perm_rpath"; then
7727 # We should set the runpath_var.
7728 rpath=
7729 for dir in $perm_rpath; do
7730 rpath="$rpath$dir:"
7731 done
7732 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7733 fi
7734 if test -n "$finalize_perm_rpath"; then
7735 # We should set the runpath_var.
7736 rpath=
7737 for dir in $finalize_perm_rpath; do
7738 rpath="$rpath$dir:"
7739 done
7740 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7741 fi
7742 fi
7743
7744 if test "$no_install" = yes; then
7745 # We don't need to create a wrapper script.
7746 link_command="$compile_var$compile_command$compile_rpath"
7747 # Replace the output file specification.
7748 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7749 # Delete the old output file.
7750 $opt_dry_run || $RM $output
7751 # Link the executable and exit
7752 func_show_eval "$link_command" 'exit $?'
7753 exit $EXIT_SUCCESS
7754 fi
7755
7756 if test "$hardcode_action" = relink; then
7757 # Fast installation is not supported
7758 link_command="$compile_var$compile_command$compile_rpath"
7759 relink_command="$finalize_var$finalize_command$finalize_rpath"
7760
7761 func_warning "this platform does not like uninstalled shared libraries"
7762 func_warning "\`$output' will be relinked during installation"
7763 else
7764 if test "$fast_install" != no; then
7765 link_command="$finalize_var$compile_command$finalize_rpath"
7766 if test "$fast_install" = yes; then
7767 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7768 else
7769 # fast_install is set to needless
7770 relink_command=
7771 fi
7772 else
7773 link_command="$compile_var$compile_command$compile_rpath"
7774 relink_command="$finalize_var$finalize_command$finalize_rpath"
7775 fi
7776 fi
7777
7778 # Replace the output file specification.
7779 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7780
7781 # Delete the old output files.
7782 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7783
7784 func_show_eval "$link_command" 'exit $?'
7785
7786 # Now create the wrapper script.
7787 func_verbose "creating $output"
7788
7789 # Quote the relink command for shipping.
7790 if test -n "$relink_command"; then
7791 # Preserve any variables that may affect compiler behavior
7792 for var in $variables_saved_for_relink; do
7793 if eval test -z \"\${$var+set}\"; then
7794 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7795 elif eval var_value=\$$var; test -z "$var_value"; then
7796 relink_command="$var=; export $var; $relink_command"
7797 else
7798 func_quote_for_eval "$var_value"
7799 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7800 fi
7801 done
7802 relink_command="(cd `pwd`; $relink_command)"
7803 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7804 fi
7805
7806 # Quote $ECHO for shipping.
7807 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7808 case $progpath in
7809 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7810 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7811 esac
7812 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7813 else
7814 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7815 fi
7816
7817 # Only actually do things if not in dry run mode.
7818 $opt_dry_run || {
7819 # win32 will think the script is a binary if it has
7820 # a .exe suffix, so we strip it off here.
7821 case $output in
7822 *.exe) func_stripname '' '.exe' "$output"
7823 output=$func_stripname_result ;;
7824 esac
7825 # test for cygwin because mv fails w/o .exe extensions
7826 case $host in
7827 *cygwin*)
7828 exeext=.exe
7829 func_stripname '' '.exe' "$outputname"
7830 outputname=$func_stripname_result ;;
7831 *) exeext= ;;
7832 esac
7833 case $host in
7834 *cygwin* | *mingw* )
7835 func_dirname_and_basename "$output" "" "."
7836 output_name=$func_basename_result
7837 output_path=$func_dirname_result
7838 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7839 cwrapper="$output_path/$output_name.exe"
7840 $RM $cwrappersource $cwrapper
7841 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7842
7843 func_emit_cwrapperexe_src > $cwrappersource
7844
7845 # The wrapper executable is built using the $host compiler,
7846 # because it contains $host paths and files. If cross-
7847 # compiling, it, like the target executable, must be
7848 # executed on the $host or under an emulation environment.
7849 $opt_dry_run || {
7850 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7851 $STRIP $cwrapper
7852 }
7853
7854 # Now, create the wrapper script for func_source use:
7855 func_ltwrapper_scriptname $cwrapper
7856 $RM $func_ltwrapper_scriptname_result
7857 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7858 $opt_dry_run || {
7859 # note: this script will not be executed, so do not chmod.
7860 if test "x$build" = "x$host" ; then
7861 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7862 else
7863 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7864 fi
7865 }
7866 ;;
7867 * )
7868 $RM $output
7869 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7870
7871 func_emit_wrapper no > $output
7872 chmod +x $output
7873 ;;
7874 esac
7875 }
7876 exit $EXIT_SUCCESS
7877 ;;
7878 esac
7879
7880 # See if we need to build an old-fashioned archive.
7881 for oldlib in $oldlibs; do
7882
7883 if test "$build_libtool_libs" = convenience; then
7884 oldobjs="$libobjs_save $symfileobj"
7885 addlibs="$convenience"
7886 build_libtool_libs=no
7887 else
7888 if test "$build_libtool_libs" = module; then
7889 oldobjs="$libobjs_save"
7890 build_libtool_libs=no
7891 else
7892 oldobjs="$old_deplibs $non_pic_objects"
7893 if test "$preload" = yes && test -f "$symfileobj"; then
7894 oldobjs="$oldobjs $symfileobj"
7895 fi
7896 fi
7897 addlibs="$old_convenience"
7898 fi
7899
7900 if test -n "$addlibs"; then
7901 gentop="$output_objdir/${outputname}x"
7902 generated="$generated $gentop"
7903
7904 func_extract_archives $gentop $addlibs
7905 oldobjs="$oldobjs $func_extract_archives_result"
7906 fi
7907
7908 # Do each command in the archive commands.
7909 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7910 cmds=$old_archive_from_new_cmds
7911 else
7912
7913 # Add any objects from preloaded convenience libraries
7914 if test -n "$dlprefiles"; then
7915 gentop="$output_objdir/${outputname}x"
7916 generated="$generated $gentop"
7917
7918 func_extract_archives $gentop $dlprefiles
7919 oldobjs="$oldobjs $func_extract_archives_result"
7920 fi
7921
7922 # POSIX demands no paths to be encoded in archives. We have
7923 # to avoid creating archives with duplicate basenames if we
7924 # might have to extract them afterwards, e.g., when creating a
7925 # static archive out of a convenience library, or when linking
7926 # the entirety of a libtool archive into another (currently
7927 # not supported by libtool).
7928 if (for obj in $oldobjs
7929 do
7930 func_basename "$obj"
7931 $ECHO "$func_basename_result"
7932 done | sort | sort -uc >/dev/null 2>&1); then
7933 :
7934 else
7935 $ECHO "copying selected object files to avoid basename conflicts..."
7936 gentop="$output_objdir/${outputname}x"
7937 generated="$generated $gentop"
7938 func_mkdir_p "$gentop"
7939 save_oldobjs=$oldobjs
7940 oldobjs=
7941 counter=1
7942 for obj in $save_oldobjs
7943 do
7944 func_basename "$obj"
7945 objbase="$func_basename_result"
7946 case " $oldobjs " in
7947 " ") oldobjs=$obj ;;
7948 *[\ /]"$objbase "*)
7949 while :; do
7950 # Make sure we don't pick an alternate name that also
7951 # overlaps.
7952 newobj=lt$counter-$objbase
7953 func_arith $counter + 1
7954 counter=$func_arith_result
7955 case " $oldobjs " in
7956 *[\ /]"$newobj "*) ;;
7957 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7958 esac
7959 done
7960 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7961 oldobjs="$oldobjs $gentop/$newobj"
7962 ;;
7963 *) oldobjs="$oldobjs $obj" ;;
7964 esac
7965 done
7966 fi
7967 eval cmds=\"$old_archive_cmds\"
7968
7969 func_len " $cmds"
7970 len=$func_len_result
7971 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7972 cmds=$old_archive_cmds
7973 else
7974 # the command line is too long to link in one step, link in parts
7975 func_verbose "using piecewise archive linking..."
7976 save_RANLIB=$RANLIB
7977 RANLIB=:
7978 objlist=
7979 concat_cmds=
7980 save_oldobjs=$oldobjs
7981 oldobjs=
7982 # Is there a better way of finding the last object in the list?
7983 for obj in $save_oldobjs
7984 do
7985 last_oldobj=$obj
7986 done
7987 eval test_cmds=\"$old_archive_cmds\"
7988 func_len " $test_cmds"
7989 len0=$func_len_result
7990 len=$len0
7991 for obj in $save_oldobjs
7992 do
7993 func_len " $obj"
7994 func_arith $len + $func_len_result
7995 len=$func_arith_result
7996 func_append objlist " $obj"
7997 if test "$len" -lt "$max_cmd_len"; then
7998 :
7999 else
8000 # the above command should be used before it gets too long
8001 oldobjs=$objlist
8002 if test "$obj" = "$last_oldobj" ; then
8003 RANLIB=$save_RANLIB
8004 fi
8005 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8006 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
8007 objlist=
8008 len=$len0
8009 fi
8010 done
8011 RANLIB=$save_RANLIB
8012 oldobjs=$objlist
8013 if test "X$oldobjs" = "X" ; then
8014 eval cmds=\"\$concat_cmds\"
8015 else
8016 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8017 fi
8018 fi
8019 fi
8020 func_execute_cmds "$cmds" 'exit $?'
8021 done
8022
8023 test -n "$generated" && \
8024 func_show_eval "${RM}r$generated"
8025
8026 # Now create the libtool archive.
8027 case $output in
8028 *.la)
8029 old_library=
8030 test "$build_old_libs" = yes && old_library="$libname.$libext"
8031 func_verbose "creating $output"
8032
8033 # Preserve any variables that may affect compiler behavior
8034 for var in $variables_saved_for_relink; do
8035 if eval test -z \"\${$var+set}\"; then
8036 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8037 elif eval var_value=\$$var; test -z "$var_value"; then
8038 relink_command="$var=; export $var; $relink_command"
8039 else
8040 func_quote_for_eval "$var_value"
8041 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8042 fi
8043 done
8044 # Quote the link command for shipping.
8045 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8046 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8047 if test "$hardcode_automatic" = yes ; then
8048 relink_command=
8049 fi
8050
8051 # Only create the output if not a dry run.
8052 $opt_dry_run || {
8053 for installed in no yes; do
8054 if test "$installed" = yes; then
8055 if test -z "$install_libdir"; then
8056 break
8057 fi
8058 output="$output_objdir/$outputname"i
8059 # Replace all uninstalled libtool libraries with the installed ones
8060 newdependency_libs=
8061 for deplib in $dependency_libs; do
8062 case $deplib in
8063 *.la)
8064 func_basename "$deplib"
8065 name="$func_basename_result"
8066 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8067 test -z "$libdir" && \
8068 func_fatal_error "\`$deplib' is not a valid libtool archive"
8069 newdependency_libs="$newdependency_libs $libdir/$name"
8070 ;;
8071 *) newdependency_libs="$newdependency_libs $deplib" ;;
8072 esac
8073 done
8074 dependency_libs="$newdependency_libs"
8075 newdlfiles=
8076
8077 for lib in $dlfiles; do
8078 case $lib in
8079 *.la)
8080 func_basename "$lib"
8081 name="$func_basename_result"
8082 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8083 test -z "$libdir" && \
8084 func_fatal_error "\`$lib' is not a valid libtool archive"
8085 newdlfiles="$newdlfiles $libdir/$name"
8086 ;;
8087 *) newdlfiles="$newdlfiles $lib" ;;
8088 esac
8089 done
8090 dlfiles="$newdlfiles"
8091 newdlprefiles=
8092 for lib in $dlprefiles; do
8093 case $lib in
8094 *.la)
8095 # Only pass preopened files to the pseudo-archive (for
8096 # eventual linking with the app. that links it) if we
8097 # didn't already link the preopened objects directly into
8098 # the library:
8099 func_basename "$lib"
8100 name="$func_basename_result"
8101 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8102 test -z "$libdir" && \
8103 func_fatal_error "\`$lib' is not a valid libtool archive"
8104 newdlprefiles="$newdlprefiles $libdir/$name"
8105 ;;
8106 esac
8107 done
8108 dlprefiles="$newdlprefiles"
8109 else
8110 newdlfiles=
8111 for lib in $dlfiles; do
8112 case $lib in
8113 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8114 *) abs=`pwd`"/$lib" ;;
8115 esac
8116 newdlfiles="$newdlfiles $abs"
8117 done
8118 dlfiles="$newdlfiles"
8119 newdlprefiles=
8120 for lib in $dlprefiles; do
8121 case $lib in
8122 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8123 *) abs=`pwd`"/$lib" ;;
8124 esac
8125 newdlprefiles="$newdlprefiles $abs"
8126 done
8127 dlprefiles="$newdlprefiles"
8128 fi
8129 $RM $output
8130 # place dlname in correct position for cygwin
8131 tdlname=$dlname
8132 case $host,$output,$installed,$module,$dlname in
8133 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8134 esac
8135 $ECHO > $output "\
8136# $outputname - a libtool library file
8137# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8138#
8139# Please DO NOT delete this file!
8140# It is necessary for linking the library.
8141
8142# The name that we can dlopen(3).
8143dlname='$tdlname'
8144
8145# Names of this library.
8146library_names='$library_names'
8147
8148# The name of the static archive.
8149old_library='$old_library'
8150
8151# Linker flags that can not go in dependency_libs.
8152inherited_linker_flags='$new_inherited_linker_flags'
8153
8154# Libraries that this one depends upon.
8155dependency_libs='$dependency_libs'
8156
8157# Names of additional weak libraries provided by this library
8158weak_library_names='$weak_libs'
8159
8160# Version information for $libname.
8161current=$current
8162age=$age
8163revision=$revision
8164
8165# Is this an already installed library?
8166installed=$installed
8167
8168# Should we warn about portability when linking against -modules?
8169shouldnotlink=$module
8170
8171# Files to dlopen/dlpreopen
8172dlopen='$dlfiles'
8173dlpreopen='$dlprefiles'
8174
8175# Directory that this library needs to be installed in:
8176libdir='$install_libdir'"
8177 if test "$installed" = no && test "$need_relink" = yes; then
8178 $ECHO >> $output "\
8179relink_command=\"$relink_command\""
8180 fi
8181 done
8182 }
8183
8184 # Do a symbolic link so that the libtool archive can be found in
8185 # LD_LIBRARY_PATH before the program is installed.
8186 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8187 ;;
8188 esac
8189 exit $EXIT_SUCCESS
8190}
8191
8192{ test "$mode" = link || test "$mode" = relink; } &&
8193 func_mode_link ${1+"$@"}
8194
8195
8196# func_mode_uninstall arg...
8197func_mode_uninstall ()
8198{
8199 $opt_debug
8200 RM="$nonopt"
8201 files=
8202 rmforce=
8203 exit_status=0
8204
8205 # This variable tells wrapper scripts just to set variables rather
8206 # than running their programs.
8207 libtool_install_magic="$magic"
8208
8209 for arg
8210 do
8211 case $arg in
8212 -f) RM="$RM $arg"; rmforce=yes ;;
8213 -*) RM="$RM $arg" ;;
8214 *) files="$files $arg" ;;
8215 esac
8216 done
8217
8218 test -z "$RM" && \
8219 func_fatal_help "you must specify an RM program"
8220
8221 rmdirs=
8222
8223 origobjdir="$objdir"
8224 for file in $files; do
8225 func_dirname "$file" "" "."
8226 dir="$func_dirname_result"
8227 if test "X$dir" = X.; then
8228 objdir="$origobjdir"
8229 else
8230 objdir="$dir/$origobjdir"
8231 fi
8232 func_basename "$file"
8233 name="$func_basename_result"
8234 test "$mode" = uninstall && objdir="$dir"
8235
8236 # Remember objdir for removal later, being careful to avoid duplicates
8237 if test "$mode" = clean; then
8238 case " $rmdirs " in
8239 *" $objdir "*) ;;
8240 *) rmdirs="$rmdirs $objdir" ;;
8241 esac
8242 fi
8243
8244 # Don't error if the file doesn't exist and rm -f was used.
8245 if { test -L "$file"; } >/dev/null 2>&1 ||
8246 { test -h "$file"; } >/dev/null 2>&1 ||
8247 test -f "$file"; then
8248 :
8249 elif test -d "$file"; then
8250 exit_status=1
8251 continue
8252 elif test "$rmforce" = yes; then
8253 continue
8254 fi
8255
8256 rmfiles="$file"
8257
8258 case $name in
8259 *.la)
8260 # Possibly a libtool archive, so verify it.
8261 if func_lalib_p "$file"; then
8262 func_source $dir/$name
8263
8264 # Delete the libtool libraries and symlinks.
8265 for n in $library_names; do
8266 rmfiles="$rmfiles $objdir/$n"
8267 done
8268 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8269
8270 case "$mode" in
8271 clean)
8272 case " $library_names " in
8273 # " " in the beginning catches empty $dlname
8274 *" $dlname "*) ;;
8275 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8276 esac
8277 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8278 ;;
8279 uninstall)
8280 if test -n "$library_names"; then
8281 # Do each command in the postuninstall commands.
8282 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8283 fi
8284
8285 if test -n "$old_library"; then
8286 # Do each command in the old_postuninstall commands.
8287 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8288 fi
8289 # FIXME: should reinstall the best remaining shared library.
8290 ;;
8291 esac
8292 fi
8293 ;;
8294
8295 *.lo)
8296 # Possibly a libtool object, so verify it.
8297 if func_lalib_p "$file"; then
8298
8299 # Read the .lo file
8300 func_source $dir/$name
8301
8302 # Add PIC object to the list of files to remove.
8303 if test -n "$pic_object" &&
8304 test "$pic_object" != none; then
8305 rmfiles="$rmfiles $dir/$pic_object"
8306 fi
8307
8308 # Add non-PIC object to the list of files to remove.
8309 if test -n "$non_pic_object" &&
8310 test "$non_pic_object" != none; then
8311 rmfiles="$rmfiles $dir/$non_pic_object"
8312 fi
8313 fi
8314 ;;
8315
8316 *)
8317 if test "$mode" = clean ; then
8318 noexename=$name
8319 case $file in
8320 *.exe)
8321 func_stripname '' '.exe' "$file"
8322 file=$func_stripname_result
8323 func_stripname '' '.exe' "$name"
8324 noexename=$func_stripname_result
8325 # $file with .exe has already been added to rmfiles,
8326 # add $file without .exe
8327 rmfiles="$rmfiles $file"
8328 ;;
8329 esac
8330 # Do a test to see if this is a libtool program.
8331 if func_ltwrapper_p "$file"; then
8332 if func_ltwrapper_executable_p "$file"; then
8333 func_ltwrapper_scriptname "$file"
8334 relink_command=
8335 func_source $func_ltwrapper_scriptname_result
8336 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8337 else
8338 relink_command=
8339 func_source $dir/$noexename
8340 fi
8341
8342 # note $name still contains .exe if it was in $file originally
8343 # as does the version of $file that was added into $rmfiles
8344 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8345 if test "$fast_install" = yes && test -n "$relink_command"; then
8346 rmfiles="$rmfiles $objdir/lt-$name"
8347 fi
8348 if test "X$noexename" != "X$name" ; then
8349 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8350 fi
8351 fi
8352 fi
8353 ;;
8354 esac
8355 func_show_eval "$RM $rmfiles" 'exit_status=1'
8356 done
8357 objdir="$origobjdir"
8358
8359 # Try to remove the ${objdir}s in the directories where we deleted files
8360 for dir in $rmdirs; do
8361 if test -d "$dir"; then
8362 func_show_eval "rmdir $dir >/dev/null 2>&1"
8363 fi
8364 done
8365
8366 exit $exit_status
8367}
8368
8369{ test "$mode" = uninstall || test "$mode" = clean; } &&
8370 func_mode_uninstall ${1+"$@"}
8371
8372test -z "$mode" && {
8373 help="$generic_help"
8374 func_fatal_help "you must specify a MODE"
8375}
8376
8377test -z "$exec_cmd" && \
8378 func_fatal_help "invalid operation mode \`$mode'"
8379
8380if test -n "$exec_cmd"; then
8381 eval exec "$exec_cmd"
8382 exit $EXIT_FAILURE
8383fi
8384
8385exit $exit_status
8386
8387
8388# The TAGs below are defined such that we never get into a situation
8389# in which we disable both kinds of libraries. Given conflicting
8390# choices, we go for a static library, that is the most portable,
8391# since we can't tell whether shared libraries were disabled because
8392# the user asked for that or because the platform doesn't support
8393# them. This is particularly important on AIX, because we don't
8394# support having both static and shared libraries enabled at the same
8395# time on that platform, so we default to a shared-only configuration.
8396# If a disable-shared tag is given, we'll fallback to a static-only
8397# configuration. But we'll never go from static-only to shared-only.
8398
8399# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8400build_libtool_libs=no
8401build_old_libs=yes
8402# ### END LIBTOOL TAG CONFIG: disable-shared
8403
8404# ### BEGIN LIBTOOL TAG CONFIG: disable-static
8405build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8406# ### END LIBTOOL TAG CONFIG: disable-static
8407
8408# Local Variables:
8409# mode:shell-script
8410# sh-indentation:2
8411# End:
8412# vi:sw=2
8413
diff --git a/libraries/embryo/m4/ac_attribute.m4 b/libraries/embryo/m4/ac_attribute.m4
new file mode 100644
index 0000000..23479a9
--- /dev/null
+++ b/libraries/embryo/m4/ac_attribute.m4
@@ -0,0 +1,47 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )])
35
36AC_MSG_RESULT($ac_cv___attribute__)
37
38if test "x${ac_cv___attribute__}" = "xyes" ; then
39 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
40 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
41 else
42 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
43fi
44
45])
46
47dnl End of ac_attribute.m4
diff --git a/libraries/embryo/m4/efl_binary.m4 b/libraries/embryo/m4/efl_binary.m4
new file mode 100644
index 0000000..93d6934
--- /dev/null
+++ b/libraries/embryo/m4/efl_binary.m4
@@ -0,0 +1,44 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if a binary is built or not
5
6dnl Usage: EFL_ENABLE_BIN(binary)
7dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
8dnl Define have_binary (- is transformed into _)
9dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
10
11AC_DEFUN([EFL_ENABLE_BIN],
12[
13
14m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
16
17have_[]m4_defn([DOWN])="yes"
18
19dnl configure option
20
21AC_ARG_ENABLE([$1],
22 [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
23 [
24 if test "x${enableval}" = "xyes" ; then
25 have_[]m4_defn([DOWN])="yes"
26 else
27 have_[]m4_defn([DOWN])="no"
28 fi
29 ])
30
31AC_MSG_CHECKING([whether to build ]DOWN[ binary])
32AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
33
34if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
35 UP[]_PRG=DOWN[${EXEEXT}]
36fi
37
38AC_SUBST(UP[]_PRG)
39
40AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
41
42AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
43
44])
diff --git a/libraries/embryo/m4/efl_doxygen.m4 b/libraries/embryo/m4/efl_doxygen.m4
new file mode 100644
index 0000000..d83ed68
--- /dev/null
+++ b/libraries/embryo/m4/efl_doxygen.m4
@@ -0,0 +1,97 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if doxygen is available or not.
5
6dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Test for the doxygen program
8dnl Defines efl_doxygen
9dnl Defines the automake conditionnal EFL_BUILD_DOC
10dnl
11AC_DEFUN([EFL_CHECK_DOXYGEN],
12[
13
14dnl
15dnl Disable the build of the documentation
16dnl
17AC_ARG_ENABLE([doc],
18 [AC_HELP_STRING(
19 [--disable-doc],
20 [Disable documentation build @<:@default=enabled@:>@])],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 efl_enable_doc="yes"
24 else
25 efl_enable_doc="no"
26 fi
27 ],
28 [efl_enable_doc="yes"])
29
30AC_MSG_CHECKING([whether to build documentation])
31AC_MSG_RESULT([${efl_enable_doc}])
32
33if test "x${efl_enable_doc}" = "xyes" ; then
34
35dnl Specify the file name, without path
36
37 efl_doxygen="doxygen"
38
39 AC_ARG_WITH([doxygen],
40 [AC_HELP_STRING(
41 [--with-doxygen=FILE],
42 [doxygen program to use @<:@default=doxygen@:>@])],
43
44dnl Check the given doxygen program.
45
46 [efl_doxygen=${withval}
47 AC_CHECK_PROG([efl_have_doxygen],
48 [${efl_doxygen}],
49 [yes],
50 [no])
51 if test "x${efl_have_doxygen}" = "xno" ; then
52 echo "WARNING:"
53 echo "The doxygen program you specified:"
54 echo "${efl_doxygen}"
55 echo "was not found. Please check the path and make sure "
56 echo "the program exists and is executable."
57 AC_MSG_WARN([no doxygen detected. Documentation will not be built])
58 fi
59 ],
60 [AC_CHECK_PROG([efl_have_doxygen],
61 [${efl_doxygen}],
62 [yes],
63 [no])
64 if test "x${efl_have_doxygen}" = "xno" ; then
65 echo "WARNING:"
66 echo "The doxygen program was not found in your execute path."
67 echo "You may have doxygen installed somewhere not covered by your path."
68 echo ""
69 echo "If this is the case make sure you have the packages installed, AND"
70 echo "that the doxygen program is in your execute path (see your"
71 echo "shell manual page on setting the \$PATH environment variable), OR"
72 echo "alternatively, specify the program to use with --with-doxygen."
73 AC_MSG_WARN([no doxygen detected. Documentation will not be built])
74 fi
75 ])
76fi
77
78dnl
79dnl Substitution
80dnl
81AC_SUBST([efl_doxygen])
82
83if ! test "x${efl_have_doxygen}" = "xyes" ; then
84 efl_enable_doc="no"
85fi
86
87AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes")
88
89if test "x${efl_enable_doc}" = "xyes" ; then
90 m4_default([$1], [:])
91else
92 m4_default([$2], [:])
93fi
94
95])
96
97dnl End of efl_doxygen.m4
diff --git a/libraries/embryo/m4/efl_fnmatch.m4 b/libraries/embryo/m4/efl_fnmatch.m4
new file mode 100644
index 0000000..a92ac6b
--- /dev/null
+++ b/libraries/embryo/m4/efl_fnmatch.m4
@@ -0,0 +1,31 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if fnmatch functions are available or not.
5
6dnl Usage: EFL_CHECK_FNMATCH([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(EFL_FNMATCH_LIBS)
8
9AC_DEFUN([EFL_CHECK_FNMATCH],
10[
11
12AC_CHECK_HEADER([fnmatch.h], [_efl_have_fnmatch="yes"], [_efl_have_fnmatch="no"])
13
14if test "x${_efl_have_fnmatch}" = "xyes" ; then
15 AC_SEARCH_LIBS([fnmatch],
16 [fnmatch evil iberty],
17 [_efl_have_fnmatch="yes"],
18 [_efl_have_fnmatch="no"])
19fi
20
21EFL_FNMATCH_LIBS=""
22
23if (! test "x${ac_cv_search_fnmatch}" = "xnone required") && (! test "x${ac_cv_search_fnmatch}" = "xno") && (! test "x${ac_cv_search_fnmatch}" = "x-levil") ; then
24 EFL_FNMATCH_LIBS=${ac_cv_search_fnmatch}
25fi
26
27AC_SUBST(EFL_FNMATCH_LIBS)
28
29AS_IF([test "x$_efl_have_fnmatch" = "xyes"], [$1], [$2])
30
31])
diff --git a/libraries/embryo/m4/efl_path_max.m4 b/libraries/embryo/m4/efl_path_max.m4
new file mode 100644
index 0000000..f57bfd2
--- /dev/null
+++ b/libraries/embryo/m4/efl_path_max.m4
@@ -0,0 +1,36 @@
1dnl Check for PATH_MAX in limits.h, and define a default value if not found
2dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
3
4dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
5dnl
6dnl If PATH_MAX is not defined in <limits.h>, defines it
7dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
8dnl to using 4096
9
10AC_DEFUN([EFL_CHECK_PATH_MAX],
11[
12
13default_max=m4_default([$1], "4096")
14AC_LANG_PUSH([C])
15
16AC_MSG_CHECKING([for PATH_MAX in limits.h])
17AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[
20#include <limits.h>
21 ]],
22 [[
23int i = PATH_MAX;
24 ]])],
25 [AC_MSG_RESULT([yes])],
26 [
27 AC_DEFINE_UNQUOTED([PATH_MAX],
28 [${default_max}],
29 [default value since PATH_MAX is not defined])
30 AC_MSG_RESULT([no: using ${default_max}])
31 ])
32
33AC_LANG_POP([C])
34
35])
36dnl end of efl_path_max.m4
diff --git a/libraries/embryo/m4/libtool.m4 b/libraries/embryo/m4/libtool.m4
new file mode 100644
index 0000000..a3fee53
--- /dev/null
+++ b/libraries/embryo/m4/libtool.m4
@@ -0,0 +1,7377 @@
1# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2#
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4# 2006, 2007, 2008 Free Software Foundation, Inc.
5# Written by Gordon Matzigkeit, 1996
6#
7# This file is free software; the Free Software Foundation gives
8# unlimited permission to copy and/or distribute it, with or without
9# modifications, as long as this notice is preserved.
10
11m4_define([_LT_COPYING], [dnl
12# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
13# 2006, 2007, 2008 Free Software Foundation, Inc.
14# Written by Gordon Matzigkeit, 1996
15#
16# This file is part of GNU Libtool.
17#
18# GNU Libtool is free software; you can redistribute it and/or
19# modify it under the terms of the GNU General Public License as
20# published by the Free Software Foundation; either version 2 of
21# the License, or (at your option) any later version.
22#
23# As a special exception to the GNU General Public License,
24# if you distribute this file as part of a program or library that
25# is built using GNU Libtool, you may include this file under the
26# same distribution terms that you use for the rest of that program.
27#
28# GNU Libtool is distributed in the hope that it will be useful,
29# but WITHOUT ANY WARRANTY; without even the implied warranty of
30# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31# GNU General Public License for more details.
32#
33# You should have received a copy of the GNU General Public License
34# along with GNU Libtool; see the file COPYING. If not, a copy
35# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
36# obtained by writing to the Free Software Foundation, Inc.,
37# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
38])
39
40# serial 56 LT_INIT
41
42
43# LT_PREREQ(VERSION)
44# ------------------
45# Complain and exit if this libtool version is less that VERSION.
46m4_defun([LT_PREREQ],
47[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
48 [m4_default([$3],
49 [m4_fatal([Libtool version $1 or higher is required],
50 63)])],
51 [$2])])
52
53
54# _LT_CHECK_BUILDDIR
55# ------------------
56# Complain if the absolute build directory name contains unusual characters
57m4_defun([_LT_CHECK_BUILDDIR],
58[case `pwd` in
59 *\ * | *\ *)
60 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
61esac
62])
63
64
65# LT_INIT([OPTIONS])
66# ------------------
67AC_DEFUN([LT_INIT],
68[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
69AC_BEFORE([$0], [LT_LANG])dnl
70AC_BEFORE([$0], [LT_OUTPUT])dnl
71AC_BEFORE([$0], [LTDL_INIT])dnl
72m4_require([_LT_CHECK_BUILDDIR])dnl
73
74dnl Autoconf doesn't catch unexpanded LT_ macros by default:
75m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
76m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
77dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
78dnl unless we require an AC_DEFUNed macro:
79AC_REQUIRE([LTOPTIONS_VERSION])dnl
80AC_REQUIRE([LTSUGAR_VERSION])dnl
81AC_REQUIRE([LTVERSION_VERSION])dnl
82AC_REQUIRE([LTOBSOLETE_VERSION])dnl
83m4_require([_LT_PROG_LTMAIN])dnl
84
85dnl Parse OPTIONS
86_LT_SET_OPTIONS([$0], [$1])
87
88# This can be used to rebuild libtool when needed
89LIBTOOL_DEPS="$ltmain"
90
91# Always use our own libtool.
92LIBTOOL='$(SHELL) $(top_builddir)/libtool'
93AC_SUBST(LIBTOOL)dnl
94
95_LT_SETUP
96
97# Only expand once:
98m4_define([LT_INIT])
99])# LT_INIT
100
101# Old names:
102AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
103AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
104dnl aclocal-1.4 backwards compatibility:
105dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
106dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
107
108
109# _LT_CC_BASENAME(CC)
110# -------------------
111# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
112m4_defun([_LT_CC_BASENAME],
113[for cc_temp in $1""; do
114 case $cc_temp in
115 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
116 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
117 \-*) ;;
118 *) break;;
119 esac
120done
121cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
122])
123
124
125# _LT_FILEUTILS_DEFAULTS
126# ----------------------
127# It is okay to use these file commands and assume they have been set
128# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
129m4_defun([_LT_FILEUTILS_DEFAULTS],
130[: ${CP="cp -f"}
131: ${MV="mv -f"}
132: ${RM="rm -f"}
133])# _LT_FILEUTILS_DEFAULTS
134
135
136# _LT_SETUP
137# ---------
138m4_defun([_LT_SETUP],
139[AC_REQUIRE([AC_CANONICAL_HOST])dnl
140AC_REQUIRE([AC_CANONICAL_BUILD])dnl
141_LT_DECL([], [host_alias], [0], [The host system])dnl
142_LT_DECL([], [host], [0])dnl
143_LT_DECL([], [host_os], [0])dnl
144dnl
145_LT_DECL([], [build_alias], [0], [The build system])dnl
146_LT_DECL([], [build], [0])dnl
147_LT_DECL([], [build_os], [0])dnl
148dnl
149AC_REQUIRE([AC_PROG_CC])dnl
150AC_REQUIRE([LT_PATH_LD])dnl
151AC_REQUIRE([LT_PATH_NM])dnl
152dnl
153AC_REQUIRE([AC_PROG_LN_S])dnl
154test -z "$LN_S" && LN_S="ln -s"
155_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
156dnl
157AC_REQUIRE([LT_CMD_MAX_LEN])dnl
158_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
159_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
160dnl
161m4_require([_LT_FILEUTILS_DEFAULTS])dnl
162m4_require([_LT_CHECK_SHELL_FEATURES])dnl
163m4_require([_LT_CMD_RELOAD])dnl
164m4_require([_LT_CHECK_MAGIC_METHOD])dnl
165m4_require([_LT_CMD_OLD_ARCHIVE])dnl
166m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
167
168_LT_CONFIG_LIBTOOL_INIT([
169# See if we are running on zsh, and set the options which allow our
170# commands through without removal of \ escapes INIT.
171if test -n "\${ZSH_VERSION+set}" ; then
172 setopt NO_GLOB_SUBST
173fi
174])
175if test -n "${ZSH_VERSION+set}" ; then
176 setopt NO_GLOB_SUBST
177fi
178
179_LT_CHECK_OBJDIR
180
181m4_require([_LT_TAG_COMPILER])dnl
182_LT_PROG_ECHO_BACKSLASH
183
184case $host_os in
185aix3*)
186 # AIX sometimes has problems with the GCC collect2 program. For some
187 # reason, if we set the COLLECT_NAMES environment variable, the problems
188 # vanish in a puff of smoke.
189 if test "X${COLLECT_NAMES+set}" != Xset; then
190 COLLECT_NAMES=
191 export COLLECT_NAMES
192 fi
193 ;;
194esac
195
196# Sed substitution that helps us do robust quoting. It backslashifies
197# metacharacters that are still active within double-quoted strings.
198sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
199
200# Same as above, but do not quote variable references.
201double_quote_subst='s/\([["`\\]]\)/\\\1/g'
202
203# Sed substitution to delay expansion of an escaped shell variable in a
204# double_quote_subst'ed string.
205delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
206
207# Sed substitution to delay expansion of an escaped single quote.
208delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
209
210# Sed substitution to avoid accidental globbing in evaled expressions
211no_glob_subst='s/\*/\\\*/g'
212
213# Global variables:
214ofile=libtool
215can_build_shared=yes
216
217# All known linkers require a `.a' archive for static linking (except MSVC,
218# which needs '.lib').
219libext=a
220
221with_gnu_ld="$lt_cv_prog_gnu_ld"
222
223old_CC="$CC"
224old_CFLAGS="$CFLAGS"
225
226# Set sane defaults for various variables
227test -z "$CC" && CC=cc
228test -z "$LTCC" && LTCC=$CC
229test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
230test -z "$LD" && LD=ld
231test -z "$ac_objext" && ac_objext=o
232
233_LT_CC_BASENAME([$compiler])
234
235# Only perform the check for file, if the check method requires it
236test -z "$MAGIC_CMD" && MAGIC_CMD=file
237case $deplibs_check_method in
238file_magic*)
239 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
240 _LT_PATH_MAGIC
241 fi
242 ;;
243esac
244
245# Use C for the default configuration in the libtool script
246LT_SUPPORTED_TAG([CC])
247_LT_LANG_C_CONFIG
248_LT_LANG_DEFAULT_CONFIG
249_LT_CONFIG_COMMANDS
250])# _LT_SETUP
251
252
253# _LT_PROG_LTMAIN
254# ---------------
255# Note that this code is called both from `configure', and `config.status'
256# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
257# `config.status' has no value for ac_aux_dir unless we are using Automake,
258# so we pass a copy along to make sure it has a sensible value anyway.
259m4_defun([_LT_PROG_LTMAIN],
260[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
261_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
262ltmain="$ac_aux_dir/ltmain.sh"
263])# _LT_PROG_LTMAIN
264
265
266## ------------------------------------- ##
267## Accumulate code for creating libtool. ##
268## ------------------------------------- ##
269
270# So that we can recreate a full libtool script including additional
271# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
272# in macros and then make a single call at the end using the `libtool'
273# label.
274
275
276# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
277# ----------------------------------------
278# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
279m4_define([_LT_CONFIG_LIBTOOL_INIT],
280[m4_ifval([$1],
281 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
282 [$1
283])])])
284
285# Initialize.
286m4_define([_LT_OUTPUT_LIBTOOL_INIT])
287
288
289# _LT_CONFIG_LIBTOOL([COMMANDS])
290# ------------------------------
291# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
292m4_define([_LT_CONFIG_LIBTOOL],
293[m4_ifval([$1],
294 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
295 [$1
296])])])
297
298# Initialize.
299m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
300
301
302# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
303# -----------------------------------------------------
304m4_defun([_LT_CONFIG_SAVE_COMMANDS],
305[_LT_CONFIG_LIBTOOL([$1])
306_LT_CONFIG_LIBTOOL_INIT([$2])
307])
308
309
310# _LT_FORMAT_COMMENT([COMMENT])
311# -----------------------------
312# Add leading comment marks to the start of each line, and a trailing
313# full-stop to the whole comment if one is not present already.
314m4_define([_LT_FORMAT_COMMENT],
315[m4_ifval([$1], [
316m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
317 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
318)])
319
320
321
322## ------------------------ ##
323## FIXME: Eliminate VARNAME ##
324## ------------------------ ##
325
326
327# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
328# -------------------------------------------------------------------
329# CONFIGNAME is the name given to the value in the libtool script.
330# VARNAME is the (base) name used in the configure script.
331# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
332# VARNAME. Any other value will be used directly.
333m4_define([_LT_DECL],
334[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
335 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
336 [m4_ifval([$1], [$1], [$2])])
337 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
338 m4_ifval([$4],
339 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
340 lt_dict_add_subkey([lt_decl_dict], [$2],
341 [tagged?], [m4_ifval([$5], [yes], [no])])])
342])
343
344
345# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
346# --------------------------------------------------------
347m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
348
349
350# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
351# ------------------------------------------------
352m4_define([lt_decl_tag_varnames],
353[_lt_decl_filter([tagged?], [yes], $@)])
354
355
356# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
357# ---------------------------------------------------------
358m4_define([_lt_decl_filter],
359[m4_case([$#],
360 [0], [m4_fatal([$0: too few arguments: $#])],
361 [1], [m4_fatal([$0: too few arguments: $#: $1])],
362 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
363 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
364 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
365])
366
367
368# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
369# --------------------------------------------------
370m4_define([lt_decl_quote_varnames],
371[_lt_decl_filter([value], [1], $@)])
372
373
374# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
375# ---------------------------------------------------
376m4_define([lt_decl_dquote_varnames],
377[_lt_decl_filter([value], [2], $@)])
378
379
380# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
381# ---------------------------------------------------
382m4_define([lt_decl_varnames_tagged],
383[m4_assert([$# <= 2])dnl
384_$0(m4_quote(m4_default([$1], [[, ]])),
385 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
386 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
387m4_define([_lt_decl_varnames_tagged],
388[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
389
390
391# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
392# ------------------------------------------------
393m4_define([lt_decl_all_varnames],
394[_$0(m4_quote(m4_default([$1], [[, ]])),
395 m4_if([$2], [],
396 m4_quote(lt_decl_varnames),
397 m4_quote(m4_shift($@))))[]dnl
398])
399m4_define([_lt_decl_all_varnames],
400[lt_join($@, lt_decl_varnames_tagged([$1],
401 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
402])
403
404
405# _LT_CONFIG_STATUS_DECLARE([VARNAME])
406# ------------------------------------
407# Quote a variable value, and forward it to `config.status' so that its
408# declaration there will have the same value as in `configure'. VARNAME
409# must have a single quote delimited value for this to work.
410m4_define([_LT_CONFIG_STATUS_DECLARE],
411[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
412
413
414# _LT_CONFIG_STATUS_DECLARATIONS
415# ------------------------------
416# We delimit libtool config variables with single quotes, so when
417# we write them to config.status, we have to be sure to quote all
418# embedded single quotes properly. In configure, this macro expands
419# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
420#
421# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
422m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
423[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
424 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
425
426
427# _LT_LIBTOOL_TAGS
428# ----------------
429# Output comment and list of tags supported by the script
430m4_defun([_LT_LIBTOOL_TAGS],
431[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
432available_tags="_LT_TAGS"dnl
433])
434
435
436# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
437# -----------------------------------
438# Extract the dictionary values for VARNAME (optionally with TAG) and
439# expand to a commented shell variable setting:
440#
441# # Some comment about what VAR is for.
442# visible_name=$lt_internal_name
443m4_define([_LT_LIBTOOL_DECLARE],
444[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
445 [description])))[]dnl
446m4_pushdef([_libtool_name],
447 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
448m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
449 [0], [_libtool_name=[$]$1],
450 [1], [_libtool_name=$lt_[]$1],
451 [2], [_libtool_name=$lt_[]$1],
452 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
453m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
454])
455
456
457# _LT_LIBTOOL_CONFIG_VARS
458# -----------------------
459# Produce commented declarations of non-tagged libtool config variables
460# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
461# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
462# section) are produced by _LT_LIBTOOL_TAG_VARS.
463m4_defun([_LT_LIBTOOL_CONFIG_VARS],
464[m4_foreach([_lt_var],
465 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
466 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
467
468
469# _LT_LIBTOOL_TAG_VARS(TAG)
470# -------------------------
471m4_define([_LT_LIBTOOL_TAG_VARS],
472[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
473 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
474
475
476# _LT_TAGVAR(VARNAME, [TAGNAME])
477# ------------------------------
478m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
479
480
481# _LT_CONFIG_COMMANDS
482# -------------------
483# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
484# variables for single and double quote escaping we saved from calls
485# to _LT_DECL, we can put quote escaped variables declarations
486# into `config.status', and then the shell code to quote escape them in
487# for loops in `config.status'. Finally, any additional code accumulated
488# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
489m4_defun([_LT_CONFIG_COMMANDS],
490[AC_PROVIDE_IFELSE([LT_OUTPUT],
491 dnl If the libtool generation code has been placed in $CONFIG_LT,
492 dnl instead of duplicating it all over again into config.status,
493 dnl then we will have config.status run $CONFIG_LT later, so it
494 dnl needs to know what name is stored there:
495 [AC_CONFIG_COMMANDS([libtool],
496 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
497 dnl If the libtool generation code is destined for config.status,
498 dnl expand the accumulated commands and init code now:
499 [AC_CONFIG_COMMANDS([libtool],
500 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
501])#_LT_CONFIG_COMMANDS
502
503
504# Initialize.
505m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
506[
507
508# The HP-UX ksh and POSIX shell print the target directory to stdout
509# if CDPATH is set.
510(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
511
512sed_quote_subst='$sed_quote_subst'
513double_quote_subst='$double_quote_subst'
514delay_variable_subst='$delay_variable_subst'
515_LT_CONFIG_STATUS_DECLARATIONS
516LTCC='$LTCC'
517LTCFLAGS='$LTCFLAGS'
518compiler='$compiler_DEFAULT'
519
520# Quote evaled strings.
521for var in lt_decl_all_varnames([[ \
522]], lt_decl_quote_varnames); do
523 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
524 *[[\\\\\\\`\\"\\\$]]*)
525 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
526 ;;
527 *)
528 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
529 ;;
530 esac
531done
532
533# Double-quote double-evaled strings.
534for var in lt_decl_all_varnames([[ \
535]], lt_decl_dquote_varnames); do
536 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
537 *[[\\\\\\\`\\"\\\$]]*)
538 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
539 ;;
540 *)
541 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
542 ;;
543 esac
544done
545
546# Fix-up fallback echo if it was mangled by the above quoting rules.
547case \$lt_ECHO in
548*'\\\[$]0 --fallback-echo"')dnl "
549 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
550 ;;
551esac
552
553_LT_OUTPUT_LIBTOOL_INIT
554])
555
556
557# LT_OUTPUT
558# ---------
559# This macro allows early generation of the libtool script (before
560# AC_OUTPUT is called), incase it is used in configure for compilation
561# tests.
562AC_DEFUN([LT_OUTPUT],
563[: ${CONFIG_LT=./config.lt}
564AC_MSG_NOTICE([creating $CONFIG_LT])
565cat >"$CONFIG_LT" <<_LTEOF
566#! $SHELL
567# Generated by $as_me.
568# Run this file to recreate a libtool stub with the current configuration.
569
570lt_cl_silent=false
571SHELL=\${CONFIG_SHELL-$SHELL}
572_LTEOF
573
574cat >>"$CONFIG_LT" <<\_LTEOF
575AS_SHELL_SANITIZE
576_AS_PREPARE
577
578exec AS_MESSAGE_FD>&1
579exec AS_MESSAGE_LOG_FD>>config.log
580{
581 echo
582 AS_BOX([Running $as_me.])
583} >&AS_MESSAGE_LOG_FD
584
585lt_cl_help="\
586\`$as_me' creates a local libtool stub from the current configuration,
587for use in further configure time tests before the real libtool is
588generated.
589
590Usage: $[0] [[OPTIONS]]
591
592 -h, --help print this help, then exit
593 -V, --version print version number, then exit
594 -q, --quiet do not print progress messages
595 -d, --debug don't remove temporary files
596
597Report bugs to <bug-libtool@gnu.org>."
598
599lt_cl_version="\
600m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
601m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
602configured by $[0], generated by m4_PACKAGE_STRING.
603
604Copyright (C) 2008 Free Software Foundation, Inc.
605This config.lt script is free software; the Free Software Foundation
606gives unlimited permision to copy, distribute and modify it."
607
608while test $[#] != 0
609do
610 case $[1] in
611 --version | --v* | -V )
612 echo "$lt_cl_version"; exit 0 ;;
613 --help | --h* | -h )
614 echo "$lt_cl_help"; exit 0 ;;
615 --debug | --d* | -d )
616 debug=: ;;
617 --quiet | --q* | --silent | --s* | -q )
618 lt_cl_silent=: ;;
619
620 -*) AC_MSG_ERROR([unrecognized option: $[1]
621Try \`$[0] --help' for more information.]) ;;
622
623 *) AC_MSG_ERROR([unrecognized argument: $[1]
624Try \`$[0] --help' for more information.]) ;;
625 esac
626 shift
627done
628
629if $lt_cl_silent; then
630 exec AS_MESSAGE_FD>/dev/null
631fi
632_LTEOF
633
634cat >>"$CONFIG_LT" <<_LTEOF
635_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
636_LTEOF
637
638cat >>"$CONFIG_LT" <<\_LTEOF
639AC_MSG_NOTICE([creating $ofile])
640_LT_OUTPUT_LIBTOOL_COMMANDS
641AS_EXIT(0)
642_LTEOF
643chmod +x "$CONFIG_LT"
644
645# configure is writing to config.log, but config.lt does its own redirection,
646# appending to config.log, which fails on DOS, as config.log is still kept
647# open by configure. Here we exec the FD to /dev/null, effectively closing
648# config.log, so it can be properly (re)opened and appended to by config.lt.
649if test "$no_create" != yes; then
650 lt_cl_success=:
651 test "$silent" = yes &&
652 lt_config_lt_args="$lt_config_lt_args --quiet"
653 exec AS_MESSAGE_LOG_FD>/dev/null
654 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
655 exec AS_MESSAGE_LOG_FD>>config.log
656 $lt_cl_success || AS_EXIT(1)
657fi
658])# LT_OUTPUT
659
660
661# _LT_CONFIG(TAG)
662# ---------------
663# If TAG is the built-in tag, create an initial libtool script with a
664# default configuration from the untagged config vars. Otherwise add code
665# to config.status for appending the configuration named by TAG from the
666# matching tagged config vars.
667m4_defun([_LT_CONFIG],
668[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
669_LT_CONFIG_SAVE_COMMANDS([
670 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
671 m4_if(_LT_TAG, [C], [
672 # See if we are running on zsh, and set the options which allow our
673 # commands through without removal of \ escapes.
674 if test -n "${ZSH_VERSION+set}" ; then
675 setopt NO_GLOB_SUBST
676 fi
677
678 cfgfile="${ofile}T"
679 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
680 $RM "$cfgfile"
681
682 cat <<_LT_EOF >> "$cfgfile"
683#! $SHELL
684
685# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
686# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
687# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
688# NOTE: Changes made to this file will be lost: look at ltmain.sh.
689#
690_LT_COPYING
691_LT_LIBTOOL_TAGS
692
693# ### BEGIN LIBTOOL CONFIG
694_LT_LIBTOOL_CONFIG_VARS
695_LT_LIBTOOL_TAG_VARS
696# ### END LIBTOOL CONFIG
697
698_LT_EOF
699
700 case $host_os in
701 aix3*)
702 cat <<\_LT_EOF >> "$cfgfile"
703# AIX sometimes has problems with the GCC collect2 program. For some
704# reason, if we set the COLLECT_NAMES environment variable, the problems
705# vanish in a puff of smoke.
706if test "X${COLLECT_NAMES+set}" != Xset; then
707 COLLECT_NAMES=
708 export COLLECT_NAMES
709fi
710_LT_EOF
711 ;;
712 esac
713
714 _LT_PROG_LTMAIN
715
716 # We use sed instead of cat because bash on DJGPP gets confused if
717 # if finds mixed CR/LF and LF-only lines. Since sed operates in
718 # text mode, it properly converts lines to CR/LF. This bash problem
719 # is reportedly fixed, but why not run on old versions too?
720 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
721 || (rm -f "$cfgfile"; exit 1)
722
723 _LT_PROG_XSI_SHELLFNS
724
725 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
726 || (rm -f "$cfgfile"; exit 1)
727
728 mv -f "$cfgfile" "$ofile" ||
729 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
730 chmod +x "$ofile"
731],
732[cat <<_LT_EOF >> "$ofile"
733
734dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
735dnl in a comment (ie after a #).
736# ### BEGIN LIBTOOL TAG CONFIG: $1
737_LT_LIBTOOL_TAG_VARS(_LT_TAG)
738# ### END LIBTOOL TAG CONFIG: $1
739_LT_EOF
740])dnl /m4_if
741],
742[m4_if([$1], [], [
743 PACKAGE='$PACKAGE'
744 VERSION='$VERSION'
745 TIMESTAMP='$TIMESTAMP'
746 RM='$RM'
747 ofile='$ofile'], [])
748])dnl /_LT_CONFIG_SAVE_COMMANDS
749])# _LT_CONFIG
750
751
752# LT_SUPPORTED_TAG(TAG)
753# ---------------------
754# Trace this macro to discover what tags are supported by the libtool
755# --tag option, using:
756# autoconf --trace 'LT_SUPPORTED_TAG:$1'
757AC_DEFUN([LT_SUPPORTED_TAG], [])
758
759
760# C support is built-in for now
761m4_define([_LT_LANG_C_enabled], [])
762m4_define([_LT_TAGS], [])
763
764
765# LT_LANG(LANG)
766# -------------
767# Enable libtool support for the given language if not already enabled.
768AC_DEFUN([LT_LANG],
769[AC_BEFORE([$0], [LT_OUTPUT])dnl
770m4_case([$1],
771 [C], [_LT_LANG(C)],
772 [C++], [_LT_LANG(CXX)],
773 [Java], [_LT_LANG(GCJ)],
774 [Fortran 77], [_LT_LANG(F77)],
775 [Fortran], [_LT_LANG(FC)],
776 [Windows Resource], [_LT_LANG(RC)],
777 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
778 [_LT_LANG($1)],
779 [m4_fatal([$0: unsupported language: "$1"])])])dnl
780])# LT_LANG
781
782
783# _LT_LANG(LANGNAME)
784# ------------------
785m4_defun([_LT_LANG],
786[m4_ifdef([_LT_LANG_]$1[_enabled], [],
787 [LT_SUPPORTED_TAG([$1])dnl
788 m4_append([_LT_TAGS], [$1 ])dnl
789 m4_define([_LT_LANG_]$1[_enabled], [])dnl
790 _LT_LANG_$1_CONFIG($1)])dnl
791])# _LT_LANG
792
793
794# _LT_LANG_DEFAULT_CONFIG
795# -----------------------
796m4_defun([_LT_LANG_DEFAULT_CONFIG],
797[AC_PROVIDE_IFELSE([AC_PROG_CXX],
798 [LT_LANG(CXX)],
799 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
800
801AC_PROVIDE_IFELSE([AC_PROG_F77],
802 [LT_LANG(F77)],
803 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
804
805AC_PROVIDE_IFELSE([AC_PROG_FC],
806 [LT_LANG(FC)],
807 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
808
809dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
810dnl pulling things in needlessly.
811AC_PROVIDE_IFELSE([AC_PROG_GCJ],
812 [LT_LANG(GCJ)],
813 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
814 [LT_LANG(GCJ)],
815 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
816 [LT_LANG(GCJ)],
817 [m4_ifdef([AC_PROG_GCJ],
818 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
819 m4_ifdef([A][M_PROG_GCJ],
820 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
821 m4_ifdef([LT_PROG_GCJ],
822 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
823
824AC_PROVIDE_IFELSE([LT_PROG_RC],
825 [LT_LANG(RC)],
826 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
827])# _LT_LANG_DEFAULT_CONFIG
828
829# Obsolete macros:
830AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
831AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
832AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
833AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
834dnl aclocal-1.4 backwards compatibility:
835dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
836dnl AC_DEFUN([AC_LIBTOOL_F77], [])
837dnl AC_DEFUN([AC_LIBTOOL_FC], [])
838dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
839
840
841# _LT_TAG_COMPILER
842# ----------------
843m4_defun([_LT_TAG_COMPILER],
844[AC_REQUIRE([AC_PROG_CC])dnl
845
846_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
847_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
848_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
849_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
850
851# If no C compiler was specified, use CC.
852LTCC=${LTCC-"$CC"}
853
854# If no C compiler flags were specified, use CFLAGS.
855LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
856
857# Allow CC to be a program name with arguments.
858compiler=$CC
859])# _LT_TAG_COMPILER
860
861
862# _LT_COMPILER_BOILERPLATE
863# ------------------------
864# Check for compiler boilerplate output or warnings with
865# the simple compiler test code.
866m4_defun([_LT_COMPILER_BOILERPLATE],
867[m4_require([_LT_DECL_SED])dnl
868ac_outfile=conftest.$ac_objext
869echo "$lt_simple_compile_test_code" >conftest.$ac_ext
870eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
871_lt_compiler_boilerplate=`cat conftest.err`
872$RM conftest*
873])# _LT_COMPILER_BOILERPLATE
874
875
876# _LT_LINKER_BOILERPLATE
877# ----------------------
878# Check for linker boilerplate output or warnings with
879# the simple link test code.
880m4_defun([_LT_LINKER_BOILERPLATE],
881[m4_require([_LT_DECL_SED])dnl
882ac_outfile=conftest.$ac_objext
883echo "$lt_simple_link_test_code" >conftest.$ac_ext
884eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
885_lt_linker_boilerplate=`cat conftest.err`
886$RM -r conftest*
887])# _LT_LINKER_BOILERPLATE
888
889# _LT_REQUIRED_DARWIN_CHECKS
890# -------------------------
891m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
892 case $host_os in
893 rhapsody* | darwin*)
894 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
895 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
896 AC_CHECK_TOOL([LIPO], [lipo], [:])
897 AC_CHECK_TOOL([OTOOL], [otool], [:])
898 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
899 _LT_DECL([], [DSYMUTIL], [1],
900 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
901 _LT_DECL([], [NMEDIT], [1],
902 [Tool to change global to local symbols on Mac OS X])
903 _LT_DECL([], [LIPO], [1],
904 [Tool to manipulate fat objects and archives on Mac OS X])
905 _LT_DECL([], [OTOOL], [1],
906 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
907 _LT_DECL([], [OTOOL64], [1],
908 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
909
910 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
911 [lt_cv_apple_cc_single_mod=no
912 if test -z "${LT_MULTI_MODULE}"; then
913 # By default we will add the -single_module flag. You can override
914 # by either setting the environment variable LT_MULTI_MODULE
915 # non-empty at configure time, or by adding -multi_module to the
916 # link flags.
917 rm -rf libconftest.dylib*
918 echo "int foo(void){return 1;}" > conftest.c
919 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
920-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
921 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
922 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
923 _lt_result=$?
924 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
925 lt_cv_apple_cc_single_mod=yes
926 else
927 cat conftest.err >&AS_MESSAGE_LOG_FD
928 fi
929 rm -rf libconftest.dylib*
930 rm -f conftest.*
931 fi])
932 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
933 [lt_cv_ld_exported_symbols_list],
934 [lt_cv_ld_exported_symbols_list=no
935 save_LDFLAGS=$LDFLAGS
936 echo "_main" > conftest.sym
937 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
938 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
939 [lt_cv_ld_exported_symbols_list=yes],
940 [lt_cv_ld_exported_symbols_list=no])
941 LDFLAGS="$save_LDFLAGS"
942 ])
943 case $host_os in
944 rhapsody* | darwin1.[[012]])
945 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
946 darwin1.*)
947 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
948 darwin*) # darwin 5.x on
949 # if running on 10.5 or later, the deployment target defaults
950 # to the OS version, if on x86, and 10.4, the deployment
951 # target defaults to 10.4. Don't you love it?
952 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
953 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
954 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
955 10.[[012]]*)
956 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
957 10.*)
958 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
959 esac
960 ;;
961 esac
962 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
963 _lt_dar_single_mod='$single_module'
964 fi
965 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
966 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
967 else
968 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
969 fi
970 if test "$DSYMUTIL" != ":"; then
971 _lt_dsymutil='~$DSYMUTIL $lib || :'
972 else
973 _lt_dsymutil=
974 fi
975 ;;
976 esac
977])
978
979
980# _LT_DARWIN_LINKER_FEATURES
981# --------------------------
982# Checks for linker and compiler features on darwin
983m4_defun([_LT_DARWIN_LINKER_FEATURES],
984[
985 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
986 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
987 _LT_TAGVAR(hardcode_direct, $1)=no
988 _LT_TAGVAR(hardcode_automatic, $1)=yes
989 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
990 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
991 _LT_TAGVAR(link_all_deplibs, $1)=yes
992 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
993 case $cc_basename in
994 ifort*) _lt_dar_can_shared=yes ;;
995 *) _lt_dar_can_shared=$GCC ;;
996 esac
997 if test "$_lt_dar_can_shared" = "yes"; then
998 output_verbose_link_cmd=echo
999 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1000 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1001 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1002 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1003 m4_if([$1], [CXX],
1004[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1005 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1006 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1007 fi
1008],[])
1009 else
1010 _LT_TAGVAR(ld_shlibs, $1)=no
1011 fi
1012])
1013
1014# _LT_SYS_MODULE_PATH_AIX
1015# -----------------------
1016# Links a minimal program and checks the executable
1017# for the system default hardcoded library path. In most cases,
1018# this is /usr/lib:/lib, but when the MPI compilers are used
1019# the location of the communication and MPI libs are included too.
1020# If we don't find anything, use the default library path according
1021# to the aix ld manual.
1022m4_defun([_LT_SYS_MODULE_PATH_AIX],
1023[m4_require([_LT_DECL_SED])dnl
1024AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1025lt_aix_libpath_sed='
1026 /Import File Strings/,/^$/ {
1027 /^0/ {
1028 s/^0 *\(.*\)$/\1/
1029 p
1030 }
1031 }'
1032aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1033# Check for a 64-bit object if we didn't find anything.
1034if test -z "$aix_libpath"; then
1035 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1036fi],[])
1037if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1038])# _LT_SYS_MODULE_PATH_AIX
1039
1040
1041# _LT_SHELL_INIT(ARG)
1042# -------------------
1043m4_define([_LT_SHELL_INIT],
1044[ifdef([AC_DIVERSION_NOTICE],
1045 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1046 [AC_DIVERT_PUSH(NOTICE)])
1047$1
1048AC_DIVERT_POP
1049])# _LT_SHELL_INIT
1050
1051
1052# _LT_PROG_ECHO_BACKSLASH
1053# -----------------------
1054# Add some code to the start of the generated configure script which
1055# will find an echo command which doesn't interpret backslashes.
1056m4_defun([_LT_PROG_ECHO_BACKSLASH],
1057[_LT_SHELL_INIT([
1058# Check that we are running under the correct shell.
1059SHELL=${CONFIG_SHELL-/bin/sh}
1060
1061case X$lt_ECHO in
1062X*--fallback-echo)
1063 # Remove one level of quotation (which was required for Make).
1064 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1065 ;;
1066esac
1067
1068ECHO=${lt_ECHO-echo}
1069if test "X[$]1" = X--no-reexec; then
1070 # Discard the --no-reexec flag, and continue.
1071 shift
1072elif test "X[$]1" = X--fallback-echo; then
1073 # Avoid inline document here, it may be left over
1074 :
1075elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1076 # Yippee, $ECHO works!
1077 :
1078else
1079 # Restart under the correct shell.
1080 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1081fi
1082
1083if test "X[$]1" = X--fallback-echo; then
1084 # used as fallback echo
1085 shift
1086 cat <<_LT_EOF
1087[$]*
1088_LT_EOF
1089 exit 0
1090fi
1091
1092# The HP-UX ksh and POSIX shell print the target directory to stdout
1093# if CDPATH is set.
1094(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1095
1096if test -z "$lt_ECHO"; then
1097 if test "X${echo_test_string+set}" != Xset; then
1098 # find a string as large as possible, as long as the shell can cope with it
1099 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1100 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1101 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1102 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1103 then
1104 break
1105 fi
1106 done
1107 fi
1108
1109 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1110 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1111 test "X$echo_testing_string" = "X$echo_test_string"; then
1112 :
1113 else
1114 # The Solaris, AIX, and Digital Unix default echo programs unquote
1115 # backslashes. This makes it impossible to quote backslashes using
1116 # echo "$something" | sed 's/\\/\\\\/g'
1117 #
1118 # So, first we look for a working echo in the user's PATH.
1119
1120 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1121 for dir in $PATH /usr/ucb; do
1122 IFS="$lt_save_ifs"
1123 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1124 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1125 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1126 test "X$echo_testing_string" = "X$echo_test_string"; then
1127 ECHO="$dir/echo"
1128 break
1129 fi
1130 done
1131 IFS="$lt_save_ifs"
1132
1133 if test "X$ECHO" = Xecho; then
1134 # We didn't find a better echo, so look for alternatives.
1135 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1136 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1137 test "X$echo_testing_string" = "X$echo_test_string"; then
1138 # This shell has a builtin print -r that does the trick.
1139 ECHO='print -r'
1140 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1141 test "X$CONFIG_SHELL" != X/bin/ksh; then
1142 # If we have ksh, try running configure again with it.
1143 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1144 export ORIGINAL_CONFIG_SHELL
1145 CONFIG_SHELL=/bin/ksh
1146 export CONFIG_SHELL
1147 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1148 else
1149 # Try using printf.
1150 ECHO='printf %s\n'
1151 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1152 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1153 test "X$echo_testing_string" = "X$echo_test_string"; then
1154 # Cool, printf works
1155 :
1156 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1157 test "X$echo_testing_string" = 'X\t' &&
1158 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1159 test "X$echo_testing_string" = "X$echo_test_string"; then
1160 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1161 export CONFIG_SHELL
1162 SHELL="$CONFIG_SHELL"
1163 export SHELL
1164 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1165 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1166 test "X$echo_testing_string" = 'X\t' &&
1167 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1168 test "X$echo_testing_string" = "X$echo_test_string"; then
1169 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1170 else
1171 # maybe with a smaller string...
1172 prev=:
1173
1174 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1175 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1176 then
1177 break
1178 fi
1179 prev="$cmd"
1180 done
1181
1182 if test "$prev" != 'sed 50q "[$]0"'; then
1183 echo_test_string=`eval $prev`
1184 export echo_test_string
1185 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1186 else
1187 # Oops. We lost completely, so just stick with echo.
1188 ECHO=echo
1189 fi
1190 fi
1191 fi
1192 fi
1193 fi
1194fi
1195
1196# Copy echo and quote the copy suitably for passing to libtool from
1197# the Makefile, instead of quoting the original, which is used later.
1198lt_ECHO=$ECHO
1199if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1200 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1201fi
1202
1203AC_SUBST(lt_ECHO)
1204])
1205_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1206_LT_DECL([], [ECHO], [1],
1207 [An echo program that does not interpret backslashes])
1208])# _LT_PROG_ECHO_BACKSLASH
1209
1210
1211# _LT_ENABLE_LOCK
1212# ---------------
1213m4_defun([_LT_ENABLE_LOCK],
1214[AC_ARG_ENABLE([libtool-lock],
1215 [AS_HELP_STRING([--disable-libtool-lock],
1216 [avoid locking (might break parallel builds)])])
1217test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1218
1219# Some flags need to be propagated to the compiler or linker for good
1220# libtool support.
1221case $host in
1222ia64-*-hpux*)
1223 # Find out which ABI we are using.
1224 echo 'int i;' > conftest.$ac_ext
1225 if AC_TRY_EVAL(ac_compile); then
1226 case `/usr/bin/file conftest.$ac_objext` in
1227 *ELF-32*)
1228 HPUX_IA64_MODE="32"
1229 ;;
1230 *ELF-64*)
1231 HPUX_IA64_MODE="64"
1232 ;;
1233 esac
1234 fi
1235 rm -rf conftest*
1236 ;;
1237*-*-irix6*)
1238 # Find out which ABI we are using.
1239 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1240 if AC_TRY_EVAL(ac_compile); then
1241 if test "$lt_cv_prog_gnu_ld" = yes; then
1242 case `/usr/bin/file conftest.$ac_objext` in
1243 *32-bit*)
1244 LD="${LD-ld} -melf32bsmip"
1245 ;;
1246 *N32*)
1247 LD="${LD-ld} -melf32bmipn32"
1248 ;;
1249 *64-bit*)
1250 LD="${LD-ld} -melf64bmip"
1251 ;;
1252 esac
1253 else
1254 case `/usr/bin/file conftest.$ac_objext` in
1255 *32-bit*)
1256 LD="${LD-ld} -32"
1257 ;;
1258 *N32*)
1259 LD="${LD-ld} -n32"
1260 ;;
1261 *64-bit*)
1262 LD="${LD-ld} -64"
1263 ;;
1264 esac
1265 fi
1266 fi
1267 rm -rf conftest*
1268 ;;
1269
1270x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1271s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1272 # Find out which ABI we are using.
1273 echo 'int i;' > conftest.$ac_ext
1274 if AC_TRY_EVAL(ac_compile); then
1275 case `/usr/bin/file conftest.o` in
1276 *32-bit*)
1277 case $host in
1278 x86_64-*kfreebsd*-gnu)
1279 LD="${LD-ld} -m elf_i386_fbsd"
1280 ;;
1281 x86_64-*linux*)
1282 LD="${LD-ld} -m elf_i386"
1283 ;;
1284 ppc64-*linux*|powerpc64-*linux*)
1285 LD="${LD-ld} -m elf32ppclinux"
1286 ;;
1287 s390x-*linux*)
1288 LD="${LD-ld} -m elf_s390"
1289 ;;
1290 sparc64-*linux*)
1291 LD="${LD-ld} -m elf32_sparc"
1292 ;;
1293 esac
1294 ;;
1295 *64-bit*)
1296 case $host in
1297 x86_64-*kfreebsd*-gnu)
1298 LD="${LD-ld} -m elf_x86_64_fbsd"
1299 ;;
1300 x86_64-*linux*)
1301 LD="${LD-ld} -m elf_x86_64"
1302 ;;
1303 ppc*-*linux*|powerpc*-*linux*)
1304 LD="${LD-ld} -m elf64ppc"
1305 ;;
1306 s390*-*linux*|s390*-*tpf*)
1307 LD="${LD-ld} -m elf64_s390"
1308 ;;
1309 sparc*-*linux*)
1310 LD="${LD-ld} -m elf64_sparc"
1311 ;;
1312 esac
1313 ;;
1314 esac
1315 fi
1316 rm -rf conftest*
1317 ;;
1318
1319*-*-sco3.2v5*)
1320 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1321 SAVE_CFLAGS="$CFLAGS"
1322 CFLAGS="$CFLAGS -belf"
1323 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1324 [AC_LANG_PUSH(C)
1325 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1326 AC_LANG_POP])
1327 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1328 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1329 CFLAGS="$SAVE_CFLAGS"
1330 fi
1331 ;;
1332sparc*-*solaris*)
1333 # Find out which ABI we are using.
1334 echo 'int i;' > conftest.$ac_ext
1335 if AC_TRY_EVAL(ac_compile); then
1336 case `/usr/bin/file conftest.o` in
1337 *64-bit*)
1338 case $lt_cv_prog_gnu_ld in
1339 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1340 *)
1341 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1342 LD="${LD-ld} -64"
1343 fi
1344 ;;
1345 esac
1346 ;;
1347 esac
1348 fi
1349 rm -rf conftest*
1350 ;;
1351esac
1352
1353need_locks="$enable_libtool_lock"
1354])# _LT_ENABLE_LOCK
1355
1356
1357# _LT_CMD_OLD_ARCHIVE
1358# -------------------
1359m4_defun([_LT_CMD_OLD_ARCHIVE],
1360[AC_CHECK_TOOL(AR, ar, false)
1361test -z "$AR" && AR=ar
1362test -z "$AR_FLAGS" && AR_FLAGS=cru
1363_LT_DECL([], [AR], [1], [The archiver])
1364_LT_DECL([], [AR_FLAGS], [1])
1365
1366AC_CHECK_TOOL(STRIP, strip, :)
1367test -z "$STRIP" && STRIP=:
1368_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1369
1370AC_CHECK_TOOL(RANLIB, ranlib, :)
1371test -z "$RANLIB" && RANLIB=:
1372_LT_DECL([], [RANLIB], [1],
1373 [Commands used to install an old-style archive])
1374
1375# Determine commands to create old-style static archives.
1376old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1377old_postinstall_cmds='chmod 644 $oldlib'
1378old_postuninstall_cmds=
1379
1380if test -n "$RANLIB"; then
1381 case $host_os in
1382 openbsd*)
1383 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1384 ;;
1385 *)
1386 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1387 ;;
1388 esac
1389 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1390fi
1391_LT_DECL([], [old_postinstall_cmds], [2])
1392_LT_DECL([], [old_postuninstall_cmds], [2])
1393_LT_TAGDECL([], [old_archive_cmds], [2],
1394 [Commands used to build an old-style archive])
1395])# _LT_CMD_OLD_ARCHIVE
1396
1397
1398# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1399# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1400# ----------------------------------------------------------------
1401# Check whether the given compiler option works
1402AC_DEFUN([_LT_COMPILER_OPTION],
1403[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1404m4_require([_LT_DECL_SED])dnl
1405AC_CACHE_CHECK([$1], [$2],
1406 [$2=no
1407 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1408 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1409 lt_compiler_flag="$3"
1410 # Insert the option either (1) after the last *FLAGS variable, or
1411 # (2) before a word containing "conftest.", or (3) at the end.
1412 # Note that $ac_compile itself does not contain backslashes and begins
1413 # with a dollar sign (not a hyphen), so the echo should work correctly.
1414 # The option is referenced via a variable to avoid confusing sed.
1415 lt_compile=`echo "$ac_compile" | $SED \
1416 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1417 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1418 -e 's:$: $lt_compiler_flag:'`
1419 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1420 (eval "$lt_compile" 2>conftest.err)
1421 ac_status=$?
1422 cat conftest.err >&AS_MESSAGE_LOG_FD
1423 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1424 if (exit $ac_status) && test -s "$ac_outfile"; then
1425 # The compiler can only warn and ignore the option if not recognized
1426 # So say no if there are warnings other than the usual output.
1427 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1428 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1429 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1430 $2=yes
1431 fi
1432 fi
1433 $RM conftest*
1434])
1435
1436if test x"[$]$2" = xyes; then
1437 m4_if([$5], , :, [$5])
1438else
1439 m4_if([$6], , :, [$6])
1440fi
1441])# _LT_COMPILER_OPTION
1442
1443# Old name:
1444AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1445dnl aclocal-1.4 backwards compatibility:
1446dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1447
1448
1449# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1450# [ACTION-SUCCESS], [ACTION-FAILURE])
1451# ----------------------------------------------------
1452# Check whether the given linker option works
1453AC_DEFUN([_LT_LINKER_OPTION],
1454[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1455m4_require([_LT_DECL_SED])dnl
1456AC_CACHE_CHECK([$1], [$2],
1457 [$2=no
1458 save_LDFLAGS="$LDFLAGS"
1459 LDFLAGS="$LDFLAGS $3"
1460 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1461 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1462 # The linker can only warn and ignore the option if not recognized
1463 # So say no if there are warnings
1464 if test -s conftest.err; then
1465 # Append any errors to the config.log.
1466 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1467 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1468 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1469 if diff conftest.exp conftest.er2 >/dev/null; then
1470 $2=yes
1471 fi
1472 else
1473 $2=yes
1474 fi
1475 fi
1476 $RM -r conftest*
1477 LDFLAGS="$save_LDFLAGS"
1478])
1479
1480if test x"[$]$2" = xyes; then
1481 m4_if([$4], , :, [$4])
1482else
1483 m4_if([$5], , :, [$5])
1484fi
1485])# _LT_LINKER_OPTION
1486
1487# Old name:
1488AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1489dnl aclocal-1.4 backwards compatibility:
1490dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1491
1492
1493# LT_CMD_MAX_LEN
1494#---------------
1495AC_DEFUN([LT_CMD_MAX_LEN],
1496[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1497# find the maximum length of command line arguments
1498AC_MSG_CHECKING([the maximum length of command line arguments])
1499AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1500 i=0
1501 teststring="ABCD"
1502
1503 case $build_os in
1504 msdosdjgpp*)
1505 # On DJGPP, this test can blow up pretty badly due to problems in libc
1506 # (any single argument exceeding 2000 bytes causes a buffer overrun
1507 # during glob expansion). Even if it were fixed, the result of this
1508 # check would be larger than it should be.
1509 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1510 ;;
1511
1512 gnu*)
1513 # Under GNU Hurd, this test is not required because there is
1514 # no limit to the length of command line arguments.
1515 # Libtool will interpret -1 as no limit whatsoever
1516 lt_cv_sys_max_cmd_len=-1;
1517 ;;
1518
1519 cygwin* | mingw* | cegcc*)
1520 # On Win9x/ME, this test blows up -- it succeeds, but takes
1521 # about 5 minutes as the teststring grows exponentially.
1522 # Worse, since 9x/ME are not pre-emptively multitasking,
1523 # you end up with a "frozen" computer, even though with patience
1524 # the test eventually succeeds (with a max line length of 256k).
1525 # Instead, let's just punt: use the minimum linelength reported by
1526 # all of the supported platforms: 8192 (on NT/2K/XP).
1527 lt_cv_sys_max_cmd_len=8192;
1528 ;;
1529
1530 amigaos*)
1531 # On AmigaOS with pdksh, this test takes hours, literally.
1532 # So we just punt and use a minimum line length of 8192.
1533 lt_cv_sys_max_cmd_len=8192;
1534 ;;
1535
1536 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1537 # This has been around since 386BSD, at least. Likely further.
1538 if test -x /sbin/sysctl; then
1539 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1540 elif test -x /usr/sbin/sysctl; then
1541 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1542 else
1543 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1544 fi
1545 # And add a safety zone
1546 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1547 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1548 ;;
1549
1550 interix*)
1551 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1552 lt_cv_sys_max_cmd_len=196608
1553 ;;
1554
1555 osf*)
1556 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1557 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1558 # nice to cause kernel panics so lets avoid the loop below.
1559 # First set a reasonable default.
1560 lt_cv_sys_max_cmd_len=16384
1561 #
1562 if test -x /sbin/sysconfig; then
1563 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1564 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1565 esac
1566 fi
1567 ;;
1568 sco3.2v5*)
1569 lt_cv_sys_max_cmd_len=102400
1570 ;;
1571 sysv5* | sco5v6* | sysv4.2uw2*)
1572 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1573 if test -n "$kargmax"; then
1574 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1575 else
1576 lt_cv_sys_max_cmd_len=32768
1577 fi
1578 ;;
1579 *)
1580 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1581 if test -n "$lt_cv_sys_max_cmd_len"; then
1582 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1583 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1584 else
1585 # Make teststring a little bigger before we do anything with it.
1586 # a 1K string should be a reasonable start.
1587 for i in 1 2 3 4 5 6 7 8 ; do
1588 teststring=$teststring$teststring
1589 done
1590 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1591 # If test is not a shell built-in, we'll probably end up computing a
1592 # maximum length that is only half of the actual maximum length, but
1593 # we can't tell.
1594 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1595 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1596 test $i != 17 # 1/2 MB should be enough
1597 do
1598 i=`expr $i + 1`
1599 teststring=$teststring$teststring
1600 done
1601 # Only check the string length outside the loop.
1602 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1603 teststring=
1604 # Add a significant safety factor because C++ compilers can tack on
1605 # massive amounts of additional arguments before passing them to the
1606 # linker. It appears as though 1/2 is a usable value.
1607 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1608 fi
1609 ;;
1610 esac
1611])
1612if test -n $lt_cv_sys_max_cmd_len ; then
1613 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1614else
1615 AC_MSG_RESULT(none)
1616fi
1617max_cmd_len=$lt_cv_sys_max_cmd_len
1618_LT_DECL([], [max_cmd_len], [0],
1619 [What is the maximum length of a command?])
1620])# LT_CMD_MAX_LEN
1621
1622# Old name:
1623AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1624dnl aclocal-1.4 backwards compatibility:
1625dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1626
1627
1628# _LT_HEADER_DLFCN
1629# ----------------
1630m4_defun([_LT_HEADER_DLFCN],
1631[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1632])# _LT_HEADER_DLFCN
1633
1634
1635# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1636# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1637# ----------------------------------------------------------------
1638m4_defun([_LT_TRY_DLOPEN_SELF],
1639[m4_require([_LT_HEADER_DLFCN])dnl
1640if test "$cross_compiling" = yes; then :
1641 [$4]
1642else
1643 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1644 lt_status=$lt_dlunknown
1645 cat > conftest.$ac_ext <<_LT_EOF
1646[#line __oline__ "configure"
1647#include "confdefs.h"
1648
1649#if HAVE_DLFCN_H
1650#include <dlfcn.h>
1651#endif
1652
1653#include <stdio.h>
1654
1655#ifdef RTLD_GLOBAL
1656# define LT_DLGLOBAL RTLD_GLOBAL
1657#else
1658# ifdef DL_GLOBAL
1659# define LT_DLGLOBAL DL_GLOBAL
1660# else
1661# define LT_DLGLOBAL 0
1662# endif
1663#endif
1664
1665/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1666 find out it does not work in some platform. */
1667#ifndef LT_DLLAZY_OR_NOW
1668# ifdef RTLD_LAZY
1669# define LT_DLLAZY_OR_NOW RTLD_LAZY
1670# else
1671# ifdef DL_LAZY
1672# define LT_DLLAZY_OR_NOW DL_LAZY
1673# else
1674# ifdef RTLD_NOW
1675# define LT_DLLAZY_OR_NOW RTLD_NOW
1676# else
1677# ifdef DL_NOW
1678# define LT_DLLAZY_OR_NOW DL_NOW
1679# else
1680# define LT_DLLAZY_OR_NOW 0
1681# endif
1682# endif
1683# endif
1684# endif
1685#endif
1686
1687void fnord() { int i=42;}
1688int main ()
1689{
1690 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1691 int status = $lt_dlunknown;
1692
1693 if (self)
1694 {
1695 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1696 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1697 /* dlclose (self); */
1698 }
1699 else
1700 puts (dlerror ());
1701
1702 return status;
1703}]
1704_LT_EOF
1705 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1706 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1707 lt_status=$?
1708 case x$lt_status in
1709 x$lt_dlno_uscore) $1 ;;
1710 x$lt_dlneed_uscore) $2 ;;
1711 x$lt_dlunknown|x*) $3 ;;
1712 esac
1713 else :
1714 # compilation failed
1715 $3
1716 fi
1717fi
1718rm -fr conftest*
1719])# _LT_TRY_DLOPEN_SELF
1720
1721
1722# LT_SYS_DLOPEN_SELF
1723# ------------------
1724AC_DEFUN([LT_SYS_DLOPEN_SELF],
1725[m4_require([_LT_HEADER_DLFCN])dnl
1726if test "x$enable_dlopen" != xyes; then
1727 enable_dlopen=unknown
1728 enable_dlopen_self=unknown
1729 enable_dlopen_self_static=unknown
1730else
1731 lt_cv_dlopen=no
1732 lt_cv_dlopen_libs=
1733
1734 case $host_os in
1735 beos*)
1736 lt_cv_dlopen="load_add_on"
1737 lt_cv_dlopen_libs=
1738 lt_cv_dlopen_self=yes
1739 ;;
1740
1741 mingw* | pw32* | cegcc*)
1742 lt_cv_dlopen="LoadLibrary"
1743 lt_cv_dlopen_libs=
1744 ;;
1745
1746 cygwin*)
1747 lt_cv_dlopen="dlopen"
1748 lt_cv_dlopen_libs=
1749 ;;
1750
1751 darwin*)
1752 # if libdl is installed we need to link against it
1753 AC_CHECK_LIB([dl], [dlopen],
1754 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1755 lt_cv_dlopen="dyld"
1756 lt_cv_dlopen_libs=
1757 lt_cv_dlopen_self=yes
1758 ])
1759 ;;
1760
1761 *)
1762 AC_CHECK_FUNC([shl_load],
1763 [lt_cv_dlopen="shl_load"],
1764 [AC_CHECK_LIB([dld], [shl_load],
1765 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1766 [AC_CHECK_FUNC([dlopen],
1767 [lt_cv_dlopen="dlopen"],
1768 [AC_CHECK_LIB([dl], [dlopen],
1769 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1770 [AC_CHECK_LIB([svld], [dlopen],
1771 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1772 [AC_CHECK_LIB([dld], [dld_link],
1773 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1774 ])
1775 ])
1776 ])
1777 ])
1778 ])
1779 ;;
1780 esac
1781
1782 if test "x$lt_cv_dlopen" != xno; then
1783 enable_dlopen=yes
1784 else
1785 enable_dlopen=no
1786 fi
1787
1788 case $lt_cv_dlopen in
1789 dlopen)
1790 save_CPPFLAGS="$CPPFLAGS"
1791 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1792
1793 save_LDFLAGS="$LDFLAGS"
1794 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1795
1796 save_LIBS="$LIBS"
1797 LIBS="$lt_cv_dlopen_libs $LIBS"
1798
1799 AC_CACHE_CHECK([whether a program can dlopen itself],
1800 lt_cv_dlopen_self, [dnl
1801 _LT_TRY_DLOPEN_SELF(
1802 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1803 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1804 ])
1805
1806 if test "x$lt_cv_dlopen_self" = xyes; then
1807 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1808 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1809 lt_cv_dlopen_self_static, [dnl
1810 _LT_TRY_DLOPEN_SELF(
1811 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1812 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1813 ])
1814 fi
1815
1816 CPPFLAGS="$save_CPPFLAGS"
1817 LDFLAGS="$save_LDFLAGS"
1818 LIBS="$save_LIBS"
1819 ;;
1820 esac
1821
1822 case $lt_cv_dlopen_self in
1823 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1824 *) enable_dlopen_self=unknown ;;
1825 esac
1826
1827 case $lt_cv_dlopen_self_static in
1828 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1829 *) enable_dlopen_self_static=unknown ;;
1830 esac
1831fi
1832_LT_DECL([dlopen_support], [enable_dlopen], [0],
1833 [Whether dlopen is supported])
1834_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1835 [Whether dlopen of programs is supported])
1836_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1837 [Whether dlopen of statically linked programs is supported])
1838])# LT_SYS_DLOPEN_SELF
1839
1840# Old name:
1841AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1842dnl aclocal-1.4 backwards compatibility:
1843dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1844
1845
1846# _LT_COMPILER_C_O([TAGNAME])
1847# ---------------------------
1848# Check to see if options -c and -o are simultaneously supported by compiler.
1849# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1850m4_defun([_LT_COMPILER_C_O],
1851[m4_require([_LT_DECL_SED])dnl
1852m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1853m4_require([_LT_TAG_COMPILER])dnl
1854AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1855 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1856 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1857 $RM -r conftest 2>/dev/null
1858 mkdir conftest
1859 cd conftest
1860 mkdir out
1861 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1862
1863 lt_compiler_flag="-o out/conftest2.$ac_objext"
1864 # Insert the option either (1) after the last *FLAGS variable, or
1865 # (2) before a word containing "conftest.", or (3) at the end.
1866 # Note that $ac_compile itself does not contain backslashes and begins
1867 # with a dollar sign (not a hyphen), so the echo should work correctly.
1868 lt_compile=`echo "$ac_compile" | $SED \
1869 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1870 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1871 -e 's:$: $lt_compiler_flag:'`
1872 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1873 (eval "$lt_compile" 2>out/conftest.err)
1874 ac_status=$?
1875 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1876 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1877 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1878 then
1879 # The compiler can only warn and ignore the option if not recognized
1880 # So say no if there are warnings
1881 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1882 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1883 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1884 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1885 fi
1886 fi
1887 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1888 $RM conftest*
1889 # SGI C++ compiler will create directory out/ii_files/ for
1890 # template instantiation
1891 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1892 $RM out/* && rmdir out
1893 cd ..
1894 $RM -r conftest
1895 $RM conftest*
1896])
1897_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1898 [Does compiler simultaneously support -c and -o options?])
1899])# _LT_COMPILER_C_O
1900
1901
1902# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1903# ----------------------------------
1904# Check to see if we can do hard links to lock some files if needed
1905m4_defun([_LT_COMPILER_FILE_LOCKS],
1906[m4_require([_LT_ENABLE_LOCK])dnl
1907m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1908_LT_COMPILER_C_O([$1])
1909
1910hard_links="nottested"
1911if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1912 # do not overwrite the value of need_locks provided by the user
1913 AC_MSG_CHECKING([if we can lock with hard links])
1914 hard_links=yes
1915 $RM conftest*
1916 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1917 touch conftest.a
1918 ln conftest.a conftest.b 2>&5 || hard_links=no
1919 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1920 AC_MSG_RESULT([$hard_links])
1921 if test "$hard_links" = no; then
1922 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1923 need_locks=warn
1924 fi
1925else
1926 need_locks=no
1927fi
1928_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1929])# _LT_COMPILER_FILE_LOCKS
1930
1931
1932# _LT_CHECK_OBJDIR
1933# ----------------
1934m4_defun([_LT_CHECK_OBJDIR],
1935[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1936[rm -f .libs 2>/dev/null
1937mkdir .libs 2>/dev/null
1938if test -d .libs; then
1939 lt_cv_objdir=.libs
1940else
1941 # MS-DOS does not allow filenames that begin with a dot.
1942 lt_cv_objdir=_libs
1943fi
1944rmdir .libs 2>/dev/null])
1945objdir=$lt_cv_objdir
1946_LT_DECL([], [objdir], [0],
1947 [The name of the directory that contains temporary libtool files])dnl
1948m4_pattern_allow([LT_OBJDIR])dnl
1949AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1950 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1951])# _LT_CHECK_OBJDIR
1952
1953
1954# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1955# --------------------------------------
1956# Check hardcoding attributes.
1957m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1958[AC_MSG_CHECKING([how to hardcode library paths into programs])
1959_LT_TAGVAR(hardcode_action, $1)=
1960if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1961 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1962 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1963
1964 # We can hardcode non-existent directories.
1965 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1966 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1967 # have to relink, otherwise we might link with an installed library
1968 # when we should be linking with a yet-to-be-installed one
1969 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1970 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1971 # Linking always hardcodes the temporary library directory.
1972 _LT_TAGVAR(hardcode_action, $1)=relink
1973 else
1974 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1975 _LT_TAGVAR(hardcode_action, $1)=immediate
1976 fi
1977else
1978 # We cannot hardcode anything, or else we can only hardcode existing
1979 # directories.
1980 _LT_TAGVAR(hardcode_action, $1)=unsupported
1981fi
1982AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1983
1984if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1985 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1986 # Fast installation is not supported
1987 enable_fast_install=no
1988elif test "$shlibpath_overrides_runpath" = yes ||
1989 test "$enable_shared" = no; then
1990 # Fast installation is not necessary
1991 enable_fast_install=needless
1992fi
1993_LT_TAGDECL([], [hardcode_action], [0],
1994 [How to hardcode a shared library path into an executable])
1995])# _LT_LINKER_HARDCODE_LIBPATH
1996
1997
1998# _LT_CMD_STRIPLIB
1999# ----------------
2000m4_defun([_LT_CMD_STRIPLIB],
2001[m4_require([_LT_DECL_EGREP])
2002striplib=
2003old_striplib=
2004AC_MSG_CHECKING([whether stripping libraries is possible])
2005if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2006 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2007 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2008 AC_MSG_RESULT([yes])
2009else
2010# FIXME - insert some real tests, host_os isn't really good enough
2011 case $host_os in
2012 darwin*)
2013 if test -n "$STRIP" ; then
2014 striplib="$STRIP -x"
2015 old_striplib="$STRIP -S"
2016 AC_MSG_RESULT([yes])
2017 else
2018 AC_MSG_RESULT([no])
2019 fi
2020 ;;
2021 *)
2022 AC_MSG_RESULT([no])
2023 ;;
2024 esac
2025fi
2026_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2027_LT_DECL([], [striplib], [1])
2028])# _LT_CMD_STRIPLIB
2029
2030
2031# _LT_SYS_DYNAMIC_LINKER([TAG])
2032# -----------------------------
2033# PORTME Fill in your ld.so characteristics
2034m4_defun([_LT_SYS_DYNAMIC_LINKER],
2035[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2036m4_require([_LT_DECL_EGREP])dnl
2037m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2038m4_require([_LT_DECL_OBJDUMP])dnl
2039m4_require([_LT_DECL_SED])dnl
2040AC_MSG_CHECKING([dynamic linker characteristics])
2041m4_if([$1],
2042 [], [
2043if test "$GCC" = yes; then
2044 case $host_os in
2045 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2046 *) lt_awk_arg="/^libraries:/" ;;
2047 esac
2048 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2049 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2050 # if the path contains ";" then we assume it to be the separator
2051 # otherwise default to the standard path separator (i.e. ":") - it is
2052 # assumed that no part of a normal pathname contains ";" but that should
2053 # okay in the real world where ";" in dirpaths is itself problematic.
2054 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2055 else
2056 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2057 fi
2058 # Ok, now we have the path, separated by spaces, we can step through it
2059 # and add multilib dir if necessary.
2060 lt_tmp_lt_search_path_spec=
2061 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2062 for lt_sys_path in $lt_search_path_spec; do
2063 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2064 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2065 else
2066 test -d "$lt_sys_path" && \
2067 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2068 fi
2069 done
2070 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2071BEGIN {RS=" "; FS="/|\n";} {
2072 lt_foo="";
2073 lt_count=0;
2074 for (lt_i = NF; lt_i > 0; lt_i--) {
2075 if ($lt_i != "" && $lt_i != ".") {
2076 if ($lt_i == "..") {
2077 lt_count++;
2078 } else {
2079 if (lt_count == 0) {
2080 lt_foo="/" $lt_i lt_foo;
2081 } else {
2082 lt_count--;
2083 }
2084 }
2085 }
2086 }
2087 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2088 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2089}'`
2090 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2091else
2092 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2093fi])
2094library_names_spec=
2095libname_spec='lib$name'
2096soname_spec=
2097shrext_cmds=".so"
2098postinstall_cmds=
2099postuninstall_cmds=
2100finish_cmds=
2101finish_eval=
2102shlibpath_var=
2103shlibpath_overrides_runpath=unknown
2104version_type=none
2105dynamic_linker="$host_os ld.so"
2106sys_lib_dlsearch_path_spec="/lib /usr/lib"
2107need_lib_prefix=unknown
2108hardcode_into_libs=no
2109
2110# when you set need_version to no, make sure it does not cause -set_version
2111# flags to be left without arguments
2112need_version=unknown
2113
2114case $host_os in
2115aix3*)
2116 version_type=linux
2117 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2118 shlibpath_var=LIBPATH
2119
2120 # AIX 3 has no versioning support, so we append a major version to the name.
2121 soname_spec='${libname}${release}${shared_ext}$major'
2122 ;;
2123
2124aix[[4-9]]*)
2125 version_type=linux
2126 need_lib_prefix=no
2127 need_version=no
2128 hardcode_into_libs=yes
2129 if test "$host_cpu" = ia64; then
2130 # AIX 5 supports IA64
2131 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2132 shlibpath_var=LD_LIBRARY_PATH
2133 else
2134 # With GCC up to 2.95.x, collect2 would create an import file
2135 # for dependence libraries. The import file would start with
2136 # the line `#! .'. This would cause the generated library to
2137 # depend on `.', always an invalid library. This was fixed in
2138 # development snapshots of GCC prior to 3.0.
2139 case $host_os in
2140 aix4 | aix4.[[01]] | aix4.[[01]].*)
2141 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2142 echo ' yes '
2143 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2144 :
2145 else
2146 can_build_shared=no
2147 fi
2148 ;;
2149 esac
2150 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2151 # soname into executable. Probably we can add versioning support to
2152 # collect2, so additional links can be useful in future.
2153 if test "$aix_use_runtimelinking" = yes; then
2154 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2155 # instead of lib<name>.a to let people know that these are not
2156 # typical AIX shared libraries.
2157 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2158 else
2159 # We preserve .a as extension for shared libraries through AIX4.2
2160 # and later when we are not doing run time linking.
2161 library_names_spec='${libname}${release}.a $libname.a'
2162 soname_spec='${libname}${release}${shared_ext}$major'
2163 fi
2164 shlibpath_var=LIBPATH
2165 fi
2166 ;;
2167
2168amigaos*)
2169 case $host_cpu in
2170 powerpc)
2171 # Since July 2007 AmigaOS4 officially supports .so libraries.
2172 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2173 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2174 ;;
2175 m68k)
2176 library_names_spec='$libname.ixlibrary $libname.a'
2177 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2178 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2179 ;;
2180 esac
2181 ;;
2182
2183beos*)
2184 library_names_spec='${libname}${shared_ext}'
2185 dynamic_linker="$host_os ld.so"
2186 shlibpath_var=LIBRARY_PATH
2187 ;;
2188
2189bsdi[[45]]*)
2190 version_type=linux
2191 need_version=no
2192 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2193 soname_spec='${libname}${release}${shared_ext}$major'
2194 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2195 shlibpath_var=LD_LIBRARY_PATH
2196 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2197 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2198 # the default ld.so.conf also contains /usr/contrib/lib and
2199 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2200 # libtool to hard-code these into programs
2201 ;;
2202
2203cygwin* | mingw* | pw32* | cegcc*)
2204 version_type=windows
2205 shrext_cmds=".dll"
2206 need_version=no
2207 need_lib_prefix=no
2208
2209 case $GCC,$host_os in
2210 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2211 library_names_spec='$libname.dll.a'
2212 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2213 postinstall_cmds='base_file=`basename \${file}`~
2214 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2215 dldir=$destdir/`dirname \$dlpath`~
2216 test -d \$dldir || mkdir -p \$dldir~
2217 $install_prog $dir/$dlname \$dldir/$dlname~
2218 chmod a+x \$dldir/$dlname~
2219 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2220 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2221 fi'
2222 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2223 dlpath=$dir/\$dldll~
2224 $RM \$dlpath'
2225 shlibpath_overrides_runpath=yes
2226
2227 case $host_os in
2228 cygwin*)
2229 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2230 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2231 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2232 ;;
2233 mingw* | cegcc*)
2234 # MinGW DLLs use traditional 'lib' prefix
2235 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2236 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2237 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2238 # It is most probably a Windows format PATH printed by
2239 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2240 # path with ; separators, and with drive letters. We can handle the
2241 # drive letters (cygwin fileutils understands them), so leave them,
2242 # especially as we might pass files found there to a mingw objdump,
2243 # which wouldn't understand a cygwinified path. Ahh.
2244 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2245 else
2246 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2247 fi
2248 ;;
2249 pw32*)
2250 # pw32 DLLs use 'pw' prefix rather than 'lib'
2251 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2252 ;;
2253 esac
2254 ;;
2255
2256 *)
2257 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2258 ;;
2259 esac
2260 dynamic_linker='Win32 ld.exe'
2261 # FIXME: first we should search . and the directory the executable is in
2262 shlibpath_var=PATH
2263 ;;
2264
2265darwin* | rhapsody*)
2266 dynamic_linker="$host_os dyld"
2267 version_type=darwin
2268 need_lib_prefix=no
2269 need_version=no
2270 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2271 soname_spec='${libname}${release}${major}$shared_ext'
2272 shlibpath_overrides_runpath=yes
2273 shlibpath_var=DYLD_LIBRARY_PATH
2274 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2275m4_if([$1], [],[
2276 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2277 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2278 ;;
2279
2280dgux*)
2281 version_type=linux
2282 need_lib_prefix=no
2283 need_version=no
2284 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2285 soname_spec='${libname}${release}${shared_ext}$major'
2286 shlibpath_var=LD_LIBRARY_PATH
2287 ;;
2288
2289freebsd1*)
2290 dynamic_linker=no
2291 ;;
2292
2293freebsd* | dragonfly*)
2294 # DragonFly does not have aout. When/if they implement a new
2295 # versioning mechanism, adjust this.
2296 if test -x /usr/bin/objformat; then
2297 objformat=`/usr/bin/objformat`
2298 else
2299 case $host_os in
2300 freebsd[[123]]*) objformat=aout ;;
2301 *) objformat=elf ;;
2302 esac
2303 fi
2304 version_type=freebsd-$objformat
2305 case $version_type in
2306 freebsd-elf*)
2307 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2308 need_version=no
2309 need_lib_prefix=no
2310 ;;
2311 freebsd-*)
2312 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2313 need_version=yes
2314 ;;
2315 esac
2316 shlibpath_var=LD_LIBRARY_PATH
2317 case $host_os in
2318 freebsd2*)
2319 shlibpath_overrides_runpath=yes
2320 ;;
2321 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2322 shlibpath_overrides_runpath=yes
2323 hardcode_into_libs=yes
2324 ;;
2325 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2326 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2327 shlibpath_overrides_runpath=no
2328 hardcode_into_libs=yes
2329 ;;
2330 *) # from 4.6 on, and DragonFly
2331 shlibpath_overrides_runpath=yes
2332 hardcode_into_libs=yes
2333 ;;
2334 esac
2335 ;;
2336
2337gnu*)
2338 version_type=linux
2339 need_lib_prefix=no
2340 need_version=no
2341 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2342 soname_spec='${libname}${release}${shared_ext}$major'
2343 shlibpath_var=LD_LIBRARY_PATH
2344 hardcode_into_libs=yes
2345 ;;
2346
2347hpux9* | hpux10* | hpux11*)
2348 # Give a soname corresponding to the major version so that dld.sl refuses to
2349 # link against other versions.
2350 version_type=sunos
2351 need_lib_prefix=no
2352 need_version=no
2353 case $host_cpu in
2354 ia64*)
2355 shrext_cmds='.so'
2356 hardcode_into_libs=yes
2357 dynamic_linker="$host_os dld.so"
2358 shlibpath_var=LD_LIBRARY_PATH
2359 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2360 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2361 soname_spec='${libname}${release}${shared_ext}$major'
2362 if test "X$HPUX_IA64_MODE" = X32; then
2363 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2364 else
2365 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2366 fi
2367 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2368 ;;
2369 hppa*64*)
2370 shrext_cmds='.sl'
2371 hardcode_into_libs=yes
2372 dynamic_linker="$host_os dld.sl"
2373 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2374 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376 soname_spec='${libname}${release}${shared_ext}$major'
2377 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2378 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2379 ;;
2380 *)
2381 shrext_cmds='.sl'
2382 dynamic_linker="$host_os dld.sl"
2383 shlibpath_var=SHLIB_PATH
2384 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2385 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2386 soname_spec='${libname}${release}${shared_ext}$major'
2387 ;;
2388 esac
2389 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2390 postinstall_cmds='chmod 555 $lib'
2391 ;;
2392
2393interix[[3-9]]*)
2394 version_type=linux
2395 need_lib_prefix=no
2396 need_version=no
2397 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2398 soname_spec='${libname}${release}${shared_ext}$major'
2399 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2400 shlibpath_var=LD_LIBRARY_PATH
2401 shlibpath_overrides_runpath=no
2402 hardcode_into_libs=yes
2403 ;;
2404
2405irix5* | irix6* | nonstopux*)
2406 case $host_os in
2407 nonstopux*) version_type=nonstopux ;;
2408 *)
2409 if test "$lt_cv_prog_gnu_ld" = yes; then
2410 version_type=linux
2411 else
2412 version_type=irix
2413 fi ;;
2414 esac
2415 need_lib_prefix=no
2416 need_version=no
2417 soname_spec='${libname}${release}${shared_ext}$major'
2418 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2419 case $host_os in
2420 irix5* | nonstopux*)
2421 libsuff= shlibsuff=
2422 ;;
2423 *)
2424 case $LD in # libtool.m4 will add one of these switches to LD
2425 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2426 libsuff= shlibsuff= libmagic=32-bit;;
2427 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2428 libsuff=32 shlibsuff=N32 libmagic=N32;;
2429 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2430 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2431 *) libsuff= shlibsuff= libmagic=never-match;;
2432 esac
2433 ;;
2434 esac
2435 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2436 shlibpath_overrides_runpath=no
2437 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2438 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2439 hardcode_into_libs=yes
2440 ;;
2441
2442# No shared lib support for Linux oldld, aout, or coff.
2443linux*oldld* | linux*aout* | linux*coff*)
2444 dynamic_linker=no
2445 ;;
2446
2447# This must be Linux ELF.
2448linux* | k*bsd*-gnu | kopensolaris*-gnu)
2449 version_type=linux
2450 need_lib_prefix=no
2451 need_version=no
2452 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2453 soname_spec='${libname}${release}${shared_ext}$major'
2454 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2455 shlibpath_var=LD_LIBRARY_PATH
2456 shlibpath_overrides_runpath=no
2457 # Some binutils ld are patched to set DT_RUNPATH
2458 save_LDFLAGS=$LDFLAGS
2459 save_libdir=$libdir
2460 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2461 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2462 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2463 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2464 [shlibpath_overrides_runpath=yes])])
2465 LDFLAGS=$save_LDFLAGS
2466 libdir=$save_libdir
2467
2468 # This implies no fast_install, which is unacceptable.
2469 # Some rework will be needed to allow for fast_install
2470 # before this can be enabled.
2471 hardcode_into_libs=yes
2472
2473 # Append ld.so.conf contents to the search path
2474 if test -f /etc/ld.so.conf; then
2475 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2476 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2477 fi
2478
2479 # We used to test for /lib/ld.so.1 and disable shared libraries on
2480 # powerpc, because MkLinux only supported shared libraries with the
2481 # GNU dynamic linker. Since this was broken with cross compilers,
2482 # most powerpc-linux boxes support dynamic linking these days and
2483 # people can always --disable-shared, the test was removed, and we
2484 # assume the GNU/Linux dynamic linker is in use.
2485 dynamic_linker='GNU/Linux ld.so'
2486 ;;
2487
2488netbsdelf*-gnu)
2489 version_type=linux
2490 need_lib_prefix=no
2491 need_version=no
2492 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2493 soname_spec='${libname}${release}${shared_ext}$major'
2494 shlibpath_var=LD_LIBRARY_PATH
2495 shlibpath_overrides_runpath=no
2496 hardcode_into_libs=yes
2497 dynamic_linker='NetBSD ld.elf_so'
2498 ;;
2499
2500netbsd*)
2501 version_type=sunos
2502 need_lib_prefix=no
2503 need_version=no
2504 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2505 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2506 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2507 dynamic_linker='NetBSD (a.out) ld.so'
2508 else
2509 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2510 soname_spec='${libname}${release}${shared_ext}$major'
2511 dynamic_linker='NetBSD ld.elf_so'
2512 fi
2513 shlibpath_var=LD_LIBRARY_PATH
2514 shlibpath_overrides_runpath=yes
2515 hardcode_into_libs=yes
2516 ;;
2517
2518newsos6)
2519 version_type=linux
2520 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2521 shlibpath_var=LD_LIBRARY_PATH
2522 shlibpath_overrides_runpath=yes
2523 ;;
2524
2525*nto* | *qnx*)
2526 version_type=qnx
2527 need_lib_prefix=no
2528 need_version=no
2529 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2530 soname_spec='${libname}${release}${shared_ext}$major'
2531 shlibpath_var=LD_LIBRARY_PATH
2532 shlibpath_overrides_runpath=no
2533 hardcode_into_libs=yes
2534 dynamic_linker='ldqnx.so'
2535 ;;
2536
2537openbsd*)
2538 version_type=sunos
2539 sys_lib_dlsearch_path_spec="/usr/lib"
2540 need_lib_prefix=no
2541 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2542 case $host_os in
2543 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2544 *) need_version=no ;;
2545 esac
2546 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2547 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2548 shlibpath_var=LD_LIBRARY_PATH
2549 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2550 case $host_os in
2551 openbsd2.[[89]] | openbsd2.[[89]].*)
2552 shlibpath_overrides_runpath=no
2553 ;;
2554 *)
2555 shlibpath_overrides_runpath=yes
2556 ;;
2557 esac
2558 else
2559 shlibpath_overrides_runpath=yes
2560 fi
2561 ;;
2562
2563os2*)
2564 libname_spec='$name'
2565 shrext_cmds=".dll"
2566 need_lib_prefix=no
2567 library_names_spec='$libname${shared_ext} $libname.a'
2568 dynamic_linker='OS/2 ld.exe'
2569 shlibpath_var=LIBPATH
2570 ;;
2571
2572osf3* | osf4* | osf5*)
2573 version_type=osf
2574 need_lib_prefix=no
2575 need_version=no
2576 soname_spec='${libname}${release}${shared_ext}$major'
2577 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2578 shlibpath_var=LD_LIBRARY_PATH
2579 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2580 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2581 ;;
2582
2583rdos*)
2584 dynamic_linker=no
2585 ;;
2586
2587solaris*)
2588 version_type=linux
2589 need_lib_prefix=no
2590 need_version=no
2591 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2592 soname_spec='${libname}${release}${shared_ext}$major'
2593 shlibpath_var=LD_LIBRARY_PATH
2594 shlibpath_overrides_runpath=yes
2595 hardcode_into_libs=yes
2596 # ldd complains unless libraries are executable
2597 postinstall_cmds='chmod +x $lib'
2598 ;;
2599
2600sunos4*)
2601 version_type=sunos
2602 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2603 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2604 shlibpath_var=LD_LIBRARY_PATH
2605 shlibpath_overrides_runpath=yes
2606 if test "$with_gnu_ld" = yes; then
2607 need_lib_prefix=no
2608 fi
2609 need_version=yes
2610 ;;
2611
2612sysv4 | sysv4.3*)
2613 version_type=linux
2614 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2615 soname_spec='${libname}${release}${shared_ext}$major'
2616 shlibpath_var=LD_LIBRARY_PATH
2617 case $host_vendor in
2618 sni)
2619 shlibpath_overrides_runpath=no
2620 need_lib_prefix=no
2621 runpath_var=LD_RUN_PATH
2622 ;;
2623 siemens)
2624 need_lib_prefix=no
2625 ;;
2626 motorola)
2627 need_lib_prefix=no
2628 need_version=no
2629 shlibpath_overrides_runpath=no
2630 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2631 ;;
2632 esac
2633 ;;
2634
2635sysv4*MP*)
2636 if test -d /usr/nec ;then
2637 version_type=linux
2638 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2639 soname_spec='$libname${shared_ext}.$major'
2640 shlibpath_var=LD_LIBRARY_PATH
2641 fi
2642 ;;
2643
2644sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2645 version_type=freebsd-elf
2646 need_lib_prefix=no
2647 need_version=no
2648 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2649 soname_spec='${libname}${release}${shared_ext}$major'
2650 shlibpath_var=LD_LIBRARY_PATH
2651 shlibpath_overrides_runpath=yes
2652 hardcode_into_libs=yes
2653 if test "$with_gnu_ld" = yes; then
2654 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2655 else
2656 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2657 case $host_os in
2658 sco3.2v5*)
2659 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2660 ;;
2661 esac
2662 fi
2663 sys_lib_dlsearch_path_spec='/usr/lib'
2664 ;;
2665
2666tpf*)
2667 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2668 version_type=linux
2669 need_lib_prefix=no
2670 need_version=no
2671 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2672 shlibpath_var=LD_LIBRARY_PATH
2673 shlibpath_overrides_runpath=no
2674 hardcode_into_libs=yes
2675 ;;
2676
2677uts4*)
2678 version_type=linux
2679 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2680 soname_spec='${libname}${release}${shared_ext}$major'
2681 shlibpath_var=LD_LIBRARY_PATH
2682 ;;
2683
2684*)
2685 dynamic_linker=no
2686 ;;
2687esac
2688AC_MSG_RESULT([$dynamic_linker])
2689test "$dynamic_linker" = no && can_build_shared=no
2690
2691variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2692if test "$GCC" = yes; then
2693 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2694fi
2695
2696if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2697 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2698fi
2699if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2700 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2701fi
2702
2703_LT_DECL([], [variables_saved_for_relink], [1],
2704 [Variables whose values should be saved in libtool wrapper scripts and
2705 restored at link time])
2706_LT_DECL([], [need_lib_prefix], [0],
2707 [Do we need the "lib" prefix for modules?])
2708_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2709_LT_DECL([], [version_type], [0], [Library versioning type])
2710_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2711_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2712_LT_DECL([], [shlibpath_overrides_runpath], [0],
2713 [Is shlibpath searched before the hard-coded library search path?])
2714_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2715_LT_DECL([], [library_names_spec], [1],
2716 [[List of archive names. First name is the real one, the rest are links.
2717 The last name is the one that the linker finds with -lNAME]])
2718_LT_DECL([], [soname_spec], [1],
2719 [[The coded name of the library, if different from the real name]])
2720_LT_DECL([], [postinstall_cmds], [2],
2721 [Command to use after installation of a shared archive])
2722_LT_DECL([], [postuninstall_cmds], [2],
2723 [Command to use after uninstallation of a shared archive])
2724_LT_DECL([], [finish_cmds], [2],
2725 [Commands used to finish a libtool library installation in a directory])
2726_LT_DECL([], [finish_eval], [1],
2727 [[As "finish_cmds", except a single script fragment to be evaled but
2728 not shown]])
2729_LT_DECL([], [hardcode_into_libs], [0],
2730 [Whether we should hardcode library paths into libraries])
2731_LT_DECL([], [sys_lib_search_path_spec], [2],
2732 [Compile-time system search path for libraries])
2733_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2734 [Run-time system search path for libraries])
2735])# _LT_SYS_DYNAMIC_LINKER
2736
2737
2738# _LT_PATH_TOOL_PREFIX(TOOL)
2739# --------------------------
2740# find a file program which can recognize shared library
2741AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2742[m4_require([_LT_DECL_EGREP])dnl
2743AC_MSG_CHECKING([for $1])
2744AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2745[case $MAGIC_CMD in
2746[[\\/*] | ?:[\\/]*])
2747 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2748 ;;
2749*)
2750 lt_save_MAGIC_CMD="$MAGIC_CMD"
2751 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2752dnl $ac_dummy forces splitting on constant user-supplied paths.
2753dnl POSIX.2 word splitting is done only on the output of word expansions,
2754dnl not every word. This closes a longstanding sh security hole.
2755 ac_dummy="m4_if([$2], , $PATH, [$2])"
2756 for ac_dir in $ac_dummy; do
2757 IFS="$lt_save_ifs"
2758 test -z "$ac_dir" && ac_dir=.
2759 if test -f $ac_dir/$1; then
2760 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2761 if test -n "$file_magic_test_file"; then
2762 case $deplibs_check_method in
2763 "file_magic "*)
2764 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2765 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2766 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2767 $EGREP "$file_magic_regex" > /dev/null; then
2768 :
2769 else
2770 cat <<_LT_EOF 1>&2
2771
2772*** Warning: the command libtool uses to detect shared libraries,
2773*** $file_magic_cmd, produces output that libtool cannot recognize.
2774*** The result is that libtool may fail to recognize shared libraries
2775*** as such. This will affect the creation of libtool libraries that
2776*** depend on shared libraries, but programs linked with such libtool
2777*** libraries will work regardless of this problem. Nevertheless, you
2778*** may want to report the problem to your system manager and/or to
2779*** bug-libtool@gnu.org
2780
2781_LT_EOF
2782 fi ;;
2783 esac
2784 fi
2785 break
2786 fi
2787 done
2788 IFS="$lt_save_ifs"
2789 MAGIC_CMD="$lt_save_MAGIC_CMD"
2790 ;;
2791esac])
2792MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2793if test -n "$MAGIC_CMD"; then
2794 AC_MSG_RESULT($MAGIC_CMD)
2795else
2796 AC_MSG_RESULT(no)
2797fi
2798_LT_DECL([], [MAGIC_CMD], [0],
2799 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2800])# _LT_PATH_TOOL_PREFIX
2801
2802# Old name:
2803AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2804dnl aclocal-1.4 backwards compatibility:
2805dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2806
2807
2808# _LT_PATH_MAGIC
2809# --------------
2810# find a file program which can recognize a shared library
2811m4_defun([_LT_PATH_MAGIC],
2812[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2813if test -z "$lt_cv_path_MAGIC_CMD"; then
2814 if test -n "$ac_tool_prefix"; then
2815 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2816 else
2817 MAGIC_CMD=:
2818 fi
2819fi
2820])# _LT_PATH_MAGIC
2821
2822
2823# LT_PATH_LD
2824# ----------
2825# find the pathname to the GNU or non-GNU linker
2826AC_DEFUN([LT_PATH_LD],
2827[AC_REQUIRE([AC_PROG_CC])dnl
2828AC_REQUIRE([AC_CANONICAL_HOST])dnl
2829AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2830m4_require([_LT_DECL_SED])dnl
2831m4_require([_LT_DECL_EGREP])dnl
2832
2833AC_ARG_WITH([gnu-ld],
2834 [AS_HELP_STRING([--with-gnu-ld],
2835 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2836 [test "$withval" = no || with_gnu_ld=yes],
2837 [with_gnu_ld=no])dnl
2838
2839ac_prog=ld
2840if test "$GCC" = yes; then
2841 # Check if gcc -print-prog-name=ld gives a path.
2842 AC_MSG_CHECKING([for ld used by $CC])
2843 case $host in
2844 *-*-mingw*)
2845 # gcc leaves a trailing carriage return which upsets mingw
2846 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2847 *)
2848 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2849 esac
2850 case $ac_prog in
2851 # Accept absolute paths.
2852 [[\\/]]* | ?:[[\\/]]*)
2853 re_direlt='/[[^/]][[^/]]*/\.\./'
2854 # Canonicalize the pathname of ld
2855 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2856 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2857 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2858 done
2859 test -z "$LD" && LD="$ac_prog"
2860 ;;
2861 "")
2862 # If it fails, then pretend we aren't using GCC.
2863 ac_prog=ld
2864 ;;
2865 *)
2866 # If it is relative, then search for the first ld in PATH.
2867 with_gnu_ld=unknown
2868 ;;
2869 esac
2870elif test "$with_gnu_ld" = yes; then
2871 AC_MSG_CHECKING([for GNU ld])
2872else
2873 AC_MSG_CHECKING([for non-GNU ld])
2874fi
2875AC_CACHE_VAL(lt_cv_path_LD,
2876[if test -z "$LD"; then
2877 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2878 for ac_dir in $PATH; do
2879 IFS="$lt_save_ifs"
2880 test -z "$ac_dir" && ac_dir=.
2881 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2882 lt_cv_path_LD="$ac_dir/$ac_prog"
2883 # Check to see if the program is GNU ld. I'd rather use --version,
2884 # but apparently some variants of GNU ld only accept -v.
2885 # Break only if it was the GNU/non-GNU ld that we prefer.
2886 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2887 *GNU* | *'with BFD'*)
2888 test "$with_gnu_ld" != no && break
2889 ;;
2890 *)
2891 test "$with_gnu_ld" != yes && break
2892 ;;
2893 esac
2894 fi
2895 done
2896 IFS="$lt_save_ifs"
2897else
2898 lt_cv_path_LD="$LD" # Let the user override the test with a path.
2899fi])
2900LD="$lt_cv_path_LD"
2901if test -n "$LD"; then
2902 AC_MSG_RESULT($LD)
2903else
2904 AC_MSG_RESULT(no)
2905fi
2906test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2907_LT_PATH_LD_GNU
2908AC_SUBST([LD])
2909
2910_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2911])# LT_PATH_LD
2912
2913# Old names:
2914AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2915AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2916dnl aclocal-1.4 backwards compatibility:
2917dnl AC_DEFUN([AM_PROG_LD], [])
2918dnl AC_DEFUN([AC_PROG_LD], [])
2919
2920
2921# _LT_PATH_LD_GNU
2922#- --------------
2923m4_defun([_LT_PATH_LD_GNU],
2924[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2925[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2926case `$LD -v 2>&1 </dev/null` in
2927*GNU* | *'with BFD'*)
2928 lt_cv_prog_gnu_ld=yes
2929 ;;
2930*)
2931 lt_cv_prog_gnu_ld=no
2932 ;;
2933esac])
2934with_gnu_ld=$lt_cv_prog_gnu_ld
2935])# _LT_PATH_LD_GNU
2936
2937
2938# _LT_CMD_RELOAD
2939# --------------
2940# find reload flag for linker
2941# -- PORTME Some linkers may need a different reload flag.
2942m4_defun([_LT_CMD_RELOAD],
2943[AC_CACHE_CHECK([for $LD option to reload object files],
2944 lt_cv_ld_reload_flag,
2945 [lt_cv_ld_reload_flag='-r'])
2946reload_flag=$lt_cv_ld_reload_flag
2947case $reload_flag in
2948"" | " "*) ;;
2949*) reload_flag=" $reload_flag" ;;
2950esac
2951reload_cmds='$LD$reload_flag -o $output$reload_objs'
2952case $host_os in
2953 darwin*)
2954 if test "$GCC" = yes; then
2955 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2956 else
2957 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2958 fi
2959 ;;
2960esac
2961_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2962_LT_DECL([], [reload_cmds], [2])dnl
2963])# _LT_CMD_RELOAD
2964
2965
2966# _LT_CHECK_MAGIC_METHOD
2967# ----------------------
2968# how to check for library dependencies
2969# -- PORTME fill in with the dynamic library characteristics
2970m4_defun([_LT_CHECK_MAGIC_METHOD],
2971[m4_require([_LT_DECL_EGREP])
2972m4_require([_LT_DECL_OBJDUMP])
2973AC_CACHE_CHECK([how to recognize dependent libraries],
2974lt_cv_deplibs_check_method,
2975[lt_cv_file_magic_cmd='$MAGIC_CMD'
2976lt_cv_file_magic_test_file=
2977lt_cv_deplibs_check_method='unknown'
2978# Need to set the preceding variable on all platforms that support
2979# interlibrary dependencies.
2980# 'none' -- dependencies not supported.
2981# `unknown' -- same as none, but documents that we really don't know.
2982# 'pass_all' -- all dependencies passed with no checks.
2983# 'test_compile' -- check by making test program.
2984# 'file_magic [[regex]]' -- check by looking for files in library path
2985# which responds to the $file_magic_cmd with a given extended regex.
2986# If you have `file' or equivalent on your system and you're not sure
2987# whether `pass_all' will *always* work, you probably want this one.
2988
2989case $host_os in
2990aix[[4-9]]*)
2991 lt_cv_deplibs_check_method=pass_all
2992 ;;
2993
2994beos*)
2995 lt_cv_deplibs_check_method=pass_all
2996 ;;
2997
2998bsdi[[45]]*)
2999 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3000 lt_cv_file_magic_cmd='/usr/bin/file -L'
3001 lt_cv_file_magic_test_file=/shlib/libc.so
3002 ;;
3003
3004cygwin*)
3005 # func_win32_libid is a shell function defined in ltmain.sh
3006 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3007 lt_cv_file_magic_cmd='func_win32_libid'
3008 ;;
3009
3010mingw* | pw32*)
3011 # Base MSYS/MinGW do not provide the 'file' command needed by
3012 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3013 # unless we find 'file', for example because we are cross-compiling.
3014 if ( file / ) >/dev/null 2>&1; then
3015 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3016 lt_cv_file_magic_cmd='func_win32_libid'
3017 else
3018 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3019 lt_cv_file_magic_cmd='$OBJDUMP -f'
3020 fi
3021 ;;
3022
3023cegcc)
3024 # use the weaker test based on 'objdump'. See mingw*.
3025 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3026 lt_cv_file_magic_cmd='$OBJDUMP -f'
3027 ;;
3028
3029darwin* | rhapsody*)
3030 lt_cv_deplibs_check_method=pass_all
3031 ;;
3032
3033freebsd* | dragonfly*)
3034 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3035 case $host_cpu in
3036 i*86 )
3037 # Not sure whether the presence of OpenBSD here was a mistake.
3038 # Let's accept both of them until this is cleared up.
3039 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3040 lt_cv_file_magic_cmd=/usr/bin/file
3041 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3042 ;;
3043 esac
3044 else
3045 lt_cv_deplibs_check_method=pass_all
3046 fi
3047 ;;
3048
3049gnu*)
3050 lt_cv_deplibs_check_method=pass_all
3051 ;;
3052
3053hpux10.20* | hpux11*)
3054 lt_cv_file_magic_cmd=/usr/bin/file
3055 case $host_cpu in
3056 ia64*)
3057 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3058 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3059 ;;
3060 hppa*64*)
3061 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3062 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3063 ;;
3064 *)
3065 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3066 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3067 ;;
3068 esac
3069 ;;
3070
3071interix[[3-9]]*)
3072 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3073 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3074 ;;
3075
3076irix5* | irix6* | nonstopux*)
3077 case $LD in
3078 *-32|*"-32 ") libmagic=32-bit;;
3079 *-n32|*"-n32 ") libmagic=N32;;
3080 *-64|*"-64 ") libmagic=64-bit;;
3081 *) libmagic=never-match;;
3082 esac
3083 lt_cv_deplibs_check_method=pass_all
3084 ;;
3085
3086# This must be Linux ELF.
3087linux* | k*bsd*-gnu | kopensolaris*-gnu)
3088 lt_cv_deplibs_check_method=pass_all
3089 ;;
3090
3091netbsd* | netbsdelf*-gnu)
3092 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3093 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3094 else
3095 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3096 fi
3097 ;;
3098
3099newos6*)
3100 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3101 lt_cv_file_magic_cmd=/usr/bin/file
3102 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3103 ;;
3104
3105*nto* | *qnx*)
3106 lt_cv_deplibs_check_method=pass_all
3107 ;;
3108
3109openbsd*)
3110 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3111 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3112 else
3113 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3114 fi
3115 ;;
3116
3117osf3* | osf4* | osf5*)
3118 lt_cv_deplibs_check_method=pass_all
3119 ;;
3120
3121rdos*)
3122 lt_cv_deplibs_check_method=pass_all
3123 ;;
3124
3125solaris*)
3126 lt_cv_deplibs_check_method=pass_all
3127 ;;
3128
3129sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3130 lt_cv_deplibs_check_method=pass_all
3131 ;;
3132
3133sysv4 | sysv4.3*)
3134 case $host_vendor in
3135 motorola)
3136 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3137 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3138 ;;
3139 ncr)
3140 lt_cv_deplibs_check_method=pass_all
3141 ;;
3142 sequent)
3143 lt_cv_file_magic_cmd='/bin/file'
3144 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3145 ;;
3146 sni)
3147 lt_cv_file_magic_cmd='/bin/file'
3148 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3149 lt_cv_file_magic_test_file=/lib/libc.so
3150 ;;
3151 siemens)
3152 lt_cv_deplibs_check_method=pass_all
3153 ;;
3154 pc)
3155 lt_cv_deplibs_check_method=pass_all
3156 ;;
3157 esac
3158 ;;
3159
3160tpf*)
3161 lt_cv_deplibs_check_method=pass_all
3162 ;;
3163esac
3164])
3165file_magic_cmd=$lt_cv_file_magic_cmd
3166deplibs_check_method=$lt_cv_deplibs_check_method
3167test -z "$deplibs_check_method" && deplibs_check_method=unknown
3168
3169_LT_DECL([], [deplibs_check_method], [1],
3170 [Method to check whether dependent libraries are shared objects])
3171_LT_DECL([], [file_magic_cmd], [1],
3172 [Command to use when deplibs_check_method == "file_magic"])
3173])# _LT_CHECK_MAGIC_METHOD
3174
3175
3176# LT_PATH_NM
3177# ----------
3178# find the pathname to a BSD- or MS-compatible name lister
3179AC_DEFUN([LT_PATH_NM],
3180[AC_REQUIRE([AC_PROG_CC])dnl
3181AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3182[if test -n "$NM"; then
3183 # Let the user override the test.
3184 lt_cv_path_NM="$NM"
3185else
3186 lt_nm_to_check="${ac_tool_prefix}nm"
3187 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3188 lt_nm_to_check="$lt_nm_to_check nm"
3189 fi
3190 for lt_tmp_nm in $lt_nm_to_check; do
3191 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3192 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3193 IFS="$lt_save_ifs"
3194 test -z "$ac_dir" && ac_dir=.
3195 tmp_nm="$ac_dir/$lt_tmp_nm"
3196 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3197 # Check to see if the nm accepts a BSD-compat flag.
3198 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3199 # nm: unknown option "B" ignored
3200 # Tru64's nm complains that /dev/null is an invalid object file
3201 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3202 */dev/null* | *'Invalid file or object type'*)
3203 lt_cv_path_NM="$tmp_nm -B"
3204 break
3205 ;;
3206 *)
3207 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3208 */dev/null*)
3209 lt_cv_path_NM="$tmp_nm -p"
3210 break
3211 ;;
3212 *)
3213 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3214 continue # so that we can try to find one that supports BSD flags
3215 ;;
3216 esac
3217 ;;
3218 esac
3219 fi
3220 done
3221 IFS="$lt_save_ifs"
3222 done
3223 : ${lt_cv_path_NM=no}
3224fi])
3225if test "$lt_cv_path_NM" != "no"; then
3226 NM="$lt_cv_path_NM"
3227else
3228 # Didn't find any BSD compatible name lister, look for dumpbin.
3229 AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3230 AC_SUBST([DUMPBIN])
3231 if test "$DUMPBIN" != ":"; then
3232 NM="$DUMPBIN"
3233 fi
3234fi
3235test -z "$NM" && NM=nm
3236AC_SUBST([NM])
3237_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3238
3239AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3240 [lt_cv_nm_interface="BSD nm"
3241 echo "int some_variable = 0;" > conftest.$ac_ext
3242 (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3243 (eval "$ac_compile" 2>conftest.err)
3244 cat conftest.err >&AS_MESSAGE_LOG_FD
3245 (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3246 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3247 cat conftest.err >&AS_MESSAGE_LOG_FD
3248 (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3249 cat conftest.out >&AS_MESSAGE_LOG_FD
3250 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3251 lt_cv_nm_interface="MS dumpbin"
3252 fi
3253 rm -f conftest*])
3254])# LT_PATH_NM
3255
3256# Old names:
3257AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3258AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3259dnl aclocal-1.4 backwards compatibility:
3260dnl AC_DEFUN([AM_PROG_NM], [])
3261dnl AC_DEFUN([AC_PROG_NM], [])
3262
3263
3264# LT_LIB_M
3265# --------
3266# check for math library
3267AC_DEFUN([LT_LIB_M],
3268[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3269LIBM=
3270case $host in
3271*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3272 # These system don't have libm, or don't need it
3273 ;;
3274*-ncr-sysv4.3*)
3275 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3276 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3277 ;;
3278*)
3279 AC_CHECK_LIB(m, cos, LIBM="-lm")
3280 ;;
3281esac
3282AC_SUBST([LIBM])
3283])# LT_LIB_M
3284
3285# Old name:
3286AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3287dnl aclocal-1.4 backwards compatibility:
3288dnl AC_DEFUN([AC_CHECK_LIBM], [])
3289
3290
3291# _LT_COMPILER_NO_RTTI([TAGNAME])
3292# -------------------------------
3293m4_defun([_LT_COMPILER_NO_RTTI],
3294[m4_require([_LT_TAG_COMPILER])dnl
3295
3296_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3297
3298if test "$GCC" = yes; then
3299 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3300
3301 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3302 lt_cv_prog_compiler_rtti_exceptions,
3303 [-fno-rtti -fno-exceptions], [],
3304 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3305fi
3306_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3307 [Compiler flag to turn off builtin functions])
3308])# _LT_COMPILER_NO_RTTI
3309
3310
3311# _LT_CMD_GLOBAL_SYMBOLS
3312# ----------------------
3313m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3314[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3315AC_REQUIRE([AC_PROG_CC])dnl
3316AC_REQUIRE([LT_PATH_NM])dnl
3317AC_REQUIRE([LT_PATH_LD])dnl
3318m4_require([_LT_DECL_SED])dnl
3319m4_require([_LT_DECL_EGREP])dnl
3320m4_require([_LT_TAG_COMPILER])dnl
3321
3322# Check for command to grab the raw symbol name followed by C symbol from nm.
3323AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3324AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3325[
3326# These are sane defaults that work on at least a few old systems.
3327# [They come from Ultrix. What could be older than Ultrix?!! ;)]
3328
3329# Character class describing NM global symbol codes.
3330symcode='[[BCDEGRST]]'
3331
3332# Regexp to match symbols that can be accessed directly from C.
3333sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3334
3335# Define system-specific variables.
3336case $host_os in
3337aix*)
3338 symcode='[[BCDT]]'
3339 ;;
3340cygwin* | mingw* | pw32* | cegcc*)
3341 symcode='[[ABCDGISTW]]'
3342 ;;
3343hpux*)
3344 if test "$host_cpu" = ia64; then
3345 symcode='[[ABCDEGRST]]'
3346 fi
3347 ;;
3348irix* | nonstopux*)
3349 symcode='[[BCDEGRST]]'
3350 ;;
3351osf*)
3352 symcode='[[BCDEGQRST]]'
3353 ;;
3354solaris*)
3355 symcode='[[BDRT]]'
3356 ;;
3357sco3.2v5*)
3358 symcode='[[DT]]'
3359 ;;
3360sysv4.2uw2*)
3361 symcode='[[DT]]'
3362 ;;
3363sysv5* | sco5v6* | unixware* | OpenUNIX*)
3364 symcode='[[ABDT]]'
3365 ;;
3366sysv4)
3367 symcode='[[DFNSTU]]'
3368 ;;
3369esac
3370
3371# If we're using GNU nm, then use its standard symbol codes.
3372case `$NM -V 2>&1` in
3373*GNU* | *'with BFD'*)
3374 symcode='[[ABCDGIRSTW]]' ;;
3375esac
3376
3377# Transform an extracted symbol line into a proper C declaration.
3378# Some systems (esp. on ia64) link data and code symbols differently,
3379# so use this general approach.
3380lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3381
3382# Transform an extracted symbol line into symbol name and symbol address
3383lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3384lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3385
3386# Handle CRLF in mingw tool chain
3387opt_cr=
3388case $build_os in
3389mingw*)
3390 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3391 ;;
3392esac
3393
3394# Try without a prefix underscore, then with it.
3395for ac_symprfx in "" "_"; do
3396
3397 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3398 symxfrm="\\1 $ac_symprfx\\2 \\2"
3399
3400 # Write the raw and C identifiers.
3401 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3402 # Fake it for dumpbin and say T for any non-static function
3403 # and D for any global variable.
3404 # Also find C++ and __fastcall symbols from MSVC++,
3405 # which start with @ or ?.
3406 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3407" {last_section=section; section=\$ 3};"\
3408" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3409" \$ 0!~/External *\|/{next};"\
3410" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3411" {if(hide[section]) next};"\
3412" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3413" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3414" s[1]~/^[@?]/{print s[1], s[1]; next};"\
3415" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3416" ' prfx=^$ac_symprfx]"
3417 else
3418 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3419 fi
3420
3421 # Check to see that the pipe works correctly.
3422 pipe_works=no
3423
3424 rm -f conftest*
3425 cat > conftest.$ac_ext <<_LT_EOF
3426#ifdef __cplusplus
3427extern "C" {
3428#endif
3429char nm_test_var;
3430void nm_test_func(void);
3431void nm_test_func(void){}
3432#ifdef __cplusplus
3433}
3434#endif
3435int main(){nm_test_var='a';nm_test_func();return(0);}
3436_LT_EOF
3437
3438 if AC_TRY_EVAL(ac_compile); then
3439 # Now try to grab the symbols.
3440 nlist=conftest.nm
3441 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3442 # Try sorting and uniquifying the output.
3443 if sort "$nlist" | uniq > "$nlist"T; then
3444 mv -f "$nlist"T "$nlist"
3445 else
3446 rm -f "$nlist"T
3447 fi
3448
3449 # Make sure that we snagged all the symbols we need.
3450 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3451 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3452 cat <<_LT_EOF > conftest.$ac_ext
3453#ifdef __cplusplus
3454extern "C" {
3455#endif
3456
3457_LT_EOF
3458 # Now generate the symbol file.
3459 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3460
3461 cat <<_LT_EOF >> conftest.$ac_ext
3462
3463/* The mapping between symbol names and symbols. */
3464const struct {
3465 const char *name;
3466 void *address;
3467}
3468lt__PROGRAM__LTX_preloaded_symbols[[]] =
3469{
3470 { "@PROGRAM@", (void *) 0 },
3471_LT_EOF
3472 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3473 cat <<\_LT_EOF >> conftest.$ac_ext
3474 {0, (void *) 0}
3475};
3476
3477/* This works around a problem in FreeBSD linker */
3478#ifdef FREEBSD_WORKAROUND
3479static const void *lt_preloaded_setup() {
3480 return lt__PROGRAM__LTX_preloaded_symbols;
3481}
3482#endif
3483
3484#ifdef __cplusplus
3485}
3486#endif
3487_LT_EOF
3488 # Now try linking the two files.
3489 mv conftest.$ac_objext conftstm.$ac_objext
3490 lt_save_LIBS="$LIBS"
3491 lt_save_CFLAGS="$CFLAGS"
3492 LIBS="conftstm.$ac_objext"
3493 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3494 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3495 pipe_works=yes
3496 fi
3497 LIBS="$lt_save_LIBS"
3498 CFLAGS="$lt_save_CFLAGS"
3499 else
3500 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3501 fi
3502 else
3503 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3504 fi
3505 else
3506 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3507 fi
3508 else
3509 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3510 cat conftest.$ac_ext >&5
3511 fi
3512 rm -rf conftest* conftst*
3513
3514 # Do not use the global_symbol_pipe unless it works.
3515 if test "$pipe_works" = yes; then
3516 break
3517 else
3518 lt_cv_sys_global_symbol_pipe=
3519 fi
3520done
3521])
3522if test -z "$lt_cv_sys_global_symbol_pipe"; then
3523 lt_cv_sys_global_symbol_to_cdecl=
3524fi
3525if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3526 AC_MSG_RESULT(failed)
3527else
3528 AC_MSG_RESULT(ok)
3529fi
3530
3531_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3532 [Take the output of nm and produce a listing of raw symbols and C names])
3533_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3534 [Transform the output of nm in a proper C declaration])
3535_LT_DECL([global_symbol_to_c_name_address],
3536 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3537 [Transform the output of nm in a C name address pair])
3538_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3539 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3540 [Transform the output of nm in a C name address pair when lib prefix is needed])
3541]) # _LT_CMD_GLOBAL_SYMBOLS
3542
3543
3544# _LT_COMPILER_PIC([TAGNAME])
3545# ---------------------------
3546m4_defun([_LT_COMPILER_PIC],
3547[m4_require([_LT_TAG_COMPILER])dnl
3548_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3549_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3550_LT_TAGVAR(lt_prog_compiler_static, $1)=
3551
3552AC_MSG_CHECKING([for $compiler option to produce PIC])
3553m4_if([$1], [CXX], [
3554 # C++ specific cases for pic, static, wl, etc.
3555 if test "$GXX" = yes; then
3556 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3557 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3558
3559 case $host_os in
3560 aix*)
3561 # All AIX code is PIC.
3562 if test "$host_cpu" = ia64; then
3563 # AIX 5 now supports IA64 processor
3564 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3565 fi
3566 ;;
3567
3568 amigaos*)
3569 case $host_cpu in
3570 powerpc)
3571 # see comment about AmigaOS4 .so support
3572 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3573 ;;
3574 m68k)
3575 # FIXME: we need at least 68020 code to build shared libraries, but
3576 # adding the `-m68020' flag to GCC prevents building anything better,
3577 # like `-m68040'.
3578 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3579 ;;
3580 esac
3581 ;;
3582
3583 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3584 # PIC is the default for these OSes.
3585 ;;
3586 mingw* | cygwin* | os2* | pw32* | cegcc*)
3587 # This hack is so that the source file can tell whether it is being
3588 # built for inclusion in a dll (and should export symbols for example).
3589 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3590 # (--disable-auto-import) libraries
3591 m4_if([$1], [GCJ], [],
3592 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3593 ;;
3594 darwin* | rhapsody*)
3595 # PIC is the default on this platform
3596 # Common symbols not allowed in MH_DYLIB files
3597 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3598 ;;
3599 *djgpp*)
3600 # DJGPP does not support shared libraries at all
3601 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3602 ;;
3603 interix[[3-9]]*)
3604 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3605 # Instead, we relocate shared libraries at runtime.
3606 ;;
3607 sysv4*MP*)
3608 if test -d /usr/nec; then
3609 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3610 fi
3611 ;;
3612 hpux*)
3613 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3614 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3615 # sets the default TLS model and affects inlining.
3616 case $host_cpu in
3617 hppa*64*)
3618 ;;
3619 *)
3620 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3621 ;;
3622 esac
3623 ;;
3624 *qnx* | *nto*)
3625 # QNX uses GNU C++, but need to define -shared option too, otherwise
3626 # it will coredump.
3627 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3628 ;;
3629 *)
3630 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3631 ;;
3632 esac
3633 else
3634 case $host_os in
3635 aix[[4-9]]*)
3636 # All AIX code is PIC.
3637 if test "$host_cpu" = ia64; then
3638 # AIX 5 now supports IA64 processor
3639 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3640 else
3641 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3642 fi
3643 ;;
3644 chorus*)
3645 case $cc_basename in
3646 cxch68*)
3647 # Green Hills C++ Compiler
3648 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
3649 ;;
3650 esac
3651 ;;
3652 dgux*)
3653 case $cc_basename in
3654 ec++*)
3655 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3656 ;;
3657 ghcx*)
3658 # Green Hills C++ Compiler
3659 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3660 ;;
3661 *)
3662 ;;
3663 esac
3664 ;;
3665 freebsd* | dragonfly*)
3666 # FreeBSD uses GNU C++
3667 ;;
3668 hpux9* | hpux10* | hpux11*)
3669 case $cc_basename in
3670 CC*)
3671 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3672 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3673 if test "$host_cpu" != ia64; then
3674 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3675 fi
3676 ;;
3677 aCC*)
3678 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3679 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3680 case $host_cpu in
3681 hppa*64*|ia64*)
3682 # +Z the default
3683 ;;
3684 *)
3685 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3686 ;;
3687 esac
3688 ;;
3689 *)
3690 ;;
3691 esac
3692 ;;
3693 interix*)
3694 # This is c89, which is MS Visual C++ (no shared libs)
3695 # Anyone wants to do a port?
3696 ;;
3697 irix5* | irix6* | nonstopux*)
3698 case $cc_basename in
3699 CC*)
3700 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3701 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3702 # CC pic flag -KPIC is the default.
3703 ;;
3704 *)
3705 ;;
3706 esac
3707 ;;
3708 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3709 case $cc_basename in
3710 KCC*)
3711 # KAI C++ Compiler
3712 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3713 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3714 ;;
3715 ecpc* )
3716 # old Intel C++ for x86_64 which still supported -KPIC.
3717 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3718 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3719 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3720 ;;
3721 icpc* )
3722 # Intel C++, used to be incompatible with GCC.
3723 # ICC 10 doesn't accept -KPIC any more.
3724 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3725 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3726 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3727 ;;
3728 pgCC* | pgcpp*)
3729 # Portland Group C++ compiler
3730 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3731 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3732 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3733 ;;
3734 cxx*)
3735 # Compaq C++
3736 # Make sure the PIC flag is empty. It appears that all Alpha
3737 # Linux and Compaq Tru64 Unix objects are PIC.
3738 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3739 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3740 ;;
3741 xlc* | xlC*)
3742 # IBM XL 8.0 on PPC
3743 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3744 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3745 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3746 ;;
3747 *)
3748 case `$CC -V 2>&1 | sed 5q` in
3749 *Sun\ C*)
3750 # Sun C++ 5.9
3751 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3752 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3753 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3754 ;;
3755 esac
3756 ;;
3757 esac
3758 ;;
3759 lynxos*)
3760 ;;
3761 m88k*)
3762 ;;
3763 mvs*)
3764 case $cc_basename in
3765 cxx*)
3766 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3767 ;;
3768 *)
3769 ;;
3770 esac
3771 ;;
3772 netbsd* | netbsdelf*-gnu)
3773 ;;
3774 *qnx* | *nto*)
3775 # QNX uses GNU C++, but need to define -shared option too, otherwise
3776 # it will coredump.
3777 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3778 ;;
3779 osf3* | osf4* | osf5*)
3780 case $cc_basename in
3781 KCC*)
3782 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3783 ;;
3784 RCC*)
3785 # Rational C++ 2.4.1
3786 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3787 ;;
3788 cxx*)
3789 # Digital/Compaq C++
3790 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3791 # Make sure the PIC flag is empty. It appears that all Alpha
3792 # Linux and Compaq Tru64 Unix objects are PIC.
3793 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3794 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3795 ;;
3796 *)
3797 ;;
3798 esac
3799 ;;
3800 psos*)
3801 ;;
3802 solaris*)
3803 case $cc_basename in
3804 CC*)
3805 # Sun C++ 4.2, 5.x and Centerline C++
3806 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3807 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3808 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3809 ;;
3810 gcx*)
3811 # Green Hills C++ Compiler
3812 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3813 ;;
3814 *)
3815 ;;
3816 esac
3817 ;;
3818 sunos4*)
3819 case $cc_basename in
3820 CC*)
3821 # Sun C++ 4.x
3822 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3823 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3824 ;;
3825 lcc*)
3826 # Lucid
3827 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3828 ;;
3829 *)
3830 ;;
3831 esac
3832 ;;
3833 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3834 case $cc_basename in
3835 CC*)
3836 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3837 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3838 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3839 ;;
3840 esac
3841 ;;
3842 tandem*)
3843 case $cc_basename in
3844 NCC*)
3845 # NonStop-UX NCC 3.20
3846 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3847 ;;
3848 *)
3849 ;;
3850 esac
3851 ;;
3852 vxworks*)
3853 ;;
3854 *)
3855 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3856 ;;
3857 esac
3858 fi
3859],
3860[
3861 if test "$GCC" = yes; then
3862 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3863 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3864
3865 case $host_os in
3866 aix*)
3867 # All AIX code is PIC.
3868 if test "$host_cpu" = ia64; then
3869 # AIX 5 now supports IA64 processor
3870 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3871 fi
3872 ;;
3873
3874 amigaos*)
3875 case $host_cpu in
3876 powerpc)
3877 # see comment about AmigaOS4 .so support
3878 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3879 ;;
3880 m68k)
3881 # FIXME: we need at least 68020 code to build shared libraries, but
3882 # adding the `-m68020' flag to GCC prevents building anything better,
3883 # like `-m68040'.
3884 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3885 ;;
3886 esac
3887 ;;
3888
3889 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3890 # PIC is the default for these OSes.
3891 ;;
3892
3893 mingw* | cygwin* | pw32* | os2* | cegcc*)
3894 # This hack is so that the source file can tell whether it is being
3895 # built for inclusion in a dll (and should export symbols for example).
3896 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3897 # (--disable-auto-import) libraries
3898 m4_if([$1], [GCJ], [],
3899 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3900 ;;
3901
3902 darwin* | rhapsody*)
3903 # PIC is the default on this platform
3904 # Common symbols not allowed in MH_DYLIB files
3905 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3906 ;;
3907
3908 hpux*)
3909 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3910 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3911 # sets the default TLS model and affects inlining.
3912 case $host_cpu in
3913 hppa*64*)
3914 # +Z the default
3915 ;;
3916 *)
3917 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3918 ;;
3919 esac
3920 ;;
3921
3922 interix[[3-9]]*)
3923 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3924 # Instead, we relocate shared libraries at runtime.
3925 ;;
3926
3927 msdosdjgpp*)
3928 # Just because we use GCC doesn't mean we suddenly get shared libraries
3929 # on systems that don't support them.
3930 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3931 enable_shared=no
3932 ;;
3933
3934 *nto* | *qnx*)
3935 # QNX uses GNU C++, but need to define -shared option too, otherwise
3936 # it will coredump.
3937 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3938 ;;
3939
3940 sysv4*MP*)
3941 if test -d /usr/nec; then
3942 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3943 fi
3944 ;;
3945
3946 *)
3947 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3948 ;;
3949 esac
3950 else
3951 # PORTME Check for flag to pass linker flags through the system compiler.
3952 case $host_os in
3953 aix*)
3954 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3955 if test "$host_cpu" = ia64; then
3956 # AIX 5 now supports IA64 processor
3957 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3958 else
3959 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3960 fi
3961 ;;
3962
3963 mingw* | cygwin* | pw32* | os2* | cegcc*)
3964 # This hack is so that the source file can tell whether it is being
3965 # built for inclusion in a dll (and should export symbols for example).
3966 m4_if([$1], [GCJ], [],
3967 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3968 ;;
3969
3970 hpux9* | hpux10* | hpux11*)
3971 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3972 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3973 # not for PA HP-UX.
3974 case $host_cpu in
3975 hppa*64*|ia64*)
3976 # +Z the default
3977 ;;
3978 *)
3979 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3980 ;;
3981 esac
3982 # Is there a better lt_prog_compiler_static that works with the bundled CC?
3983 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3984 ;;
3985
3986 irix5* | irix6* | nonstopux*)
3987 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3988 # PIC (with -KPIC) is the default.
3989 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3990 ;;
3991
3992 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3993 case $cc_basename in
3994 # old Intel for x86_64 which still supported -KPIC.
3995 ecc*)
3996 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3997 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3998 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3999 ;;
4000 # icc used to be incompatible with GCC.
4001 # ICC 10 doesn't accept -KPIC any more.
4002 icc* | ifort*)
4003 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4004 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4005 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4006 ;;
4007 # Lahey Fortran 8.1.
4008 lf95*)
4009 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4010 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4011 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4012 ;;
4013 pgcc* | pgf77* | pgf90* | pgf95*)
4014 # Portland Group compilers (*not* the Pentium gcc compiler,
4015 # which looks to be a dead project)
4016 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4017 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4018 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4019 ;;
4020 ccc*)
4021 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4022 # All Alpha code is PIC.
4023 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4024 ;;
4025 xl*)
4026 # IBM XL C 8.0/Fortran 10.1 on PPC
4027 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4029 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4030 ;;
4031 *)
4032 case `$CC -V 2>&1 | sed 5q` in
4033 *Sun\ C*)
4034 # Sun C 5.9
4035 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4036 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4037 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4038 ;;
4039 *Sun\ F*)
4040 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4041 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4042 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4043 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4044 ;;
4045 esac
4046 ;;
4047 esac
4048 ;;
4049
4050 newsos6)
4051 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4052 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4053 ;;
4054
4055 *nto* | *qnx*)
4056 # QNX uses GNU C++, but need to define -shared option too, otherwise
4057 # it will coredump.
4058 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4059 ;;
4060
4061 osf3* | osf4* | osf5*)
4062 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4063 # All OSF/1 code is PIC.
4064 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4065 ;;
4066
4067 rdos*)
4068 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4069 ;;
4070
4071 solaris*)
4072 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4073 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4074 case $cc_basename in
4075 f77* | f90* | f95*)
4076 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4077 *)
4078 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4079 esac
4080 ;;
4081
4082 sunos4*)
4083 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4084 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4085 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4086 ;;
4087
4088 sysv4 | sysv4.2uw2* | sysv4.3*)
4089 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4090 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4091 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092 ;;
4093
4094 sysv4*MP*)
4095 if test -d /usr/nec ;then
4096 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4097 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4098 fi
4099 ;;
4100
4101 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4102 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4103 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4104 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4105 ;;
4106
4107 unicos*)
4108 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4109 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4110 ;;
4111
4112 uts4*)
4113 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4114 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4115 ;;
4116
4117 *)
4118 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4119 ;;
4120 esac
4121 fi
4122])
4123case $host_os in
4124 # For platforms which do not support PIC, -DPIC is meaningless:
4125 *djgpp*)
4126 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4127 ;;
4128 *)
4129 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4130 ;;
4131esac
4132AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4133_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4134 [How to pass a linker flag through the compiler])
4135
4136#
4137# Check to make sure the PIC flag actually works.
4138#
4139if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4140 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4141 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4142 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4143 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4144 "" | " "*) ;;
4145 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4146 esac],
4147 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4148 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4149fi
4150_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4151 [Additional compiler flags for building library objects])
4152
4153#
4154# Check to make sure the static flag actually works.
4155#
4156wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4157_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4158 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4159 $lt_tmp_static_flag,
4160 [],
4161 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4162_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4163 [Compiler flag to prevent dynamic linking])
4164])# _LT_COMPILER_PIC
4165
4166
4167# _LT_LINKER_SHLIBS([TAGNAME])
4168# ----------------------------
4169# See if the linker supports building shared libraries.
4170m4_defun([_LT_LINKER_SHLIBS],
4171[AC_REQUIRE([LT_PATH_LD])dnl
4172AC_REQUIRE([LT_PATH_NM])dnl
4173m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4174m4_require([_LT_DECL_EGREP])dnl
4175m4_require([_LT_DECL_SED])dnl
4176m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4177m4_require([_LT_TAG_COMPILER])dnl
4178AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4179m4_if([$1], [CXX], [
4180 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4181 case $host_os in
4182 aix[[4-9]]*)
4183 # If we're using GNU nm, then we don't want the "-C" option.
4184 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4185 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4186 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4187 else
4188 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4189 fi
4190 ;;
4191 pw32*)
4192 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4193 ;;
4194 cygwin* | mingw* | cegcc*)
4195 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4196 ;;
4197 linux* | k*bsd*-gnu)
4198 _LT_TAGVAR(link_all_deplibs, $1)=no
4199 ;;
4200 *)
4201 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4202 ;;
4203 esac
4204 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4205], [
4206 runpath_var=
4207 _LT_TAGVAR(allow_undefined_flag, $1)=
4208 _LT_TAGVAR(always_export_symbols, $1)=no
4209 _LT_TAGVAR(archive_cmds, $1)=
4210 _LT_TAGVAR(archive_expsym_cmds, $1)=
4211 _LT_TAGVAR(compiler_needs_object, $1)=no
4212 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4213 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4214 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4215 _LT_TAGVAR(hardcode_automatic, $1)=no
4216 _LT_TAGVAR(hardcode_direct, $1)=no
4217 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4218 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4219 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4220 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4221 _LT_TAGVAR(hardcode_minus_L, $1)=no
4222 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4223 _LT_TAGVAR(inherit_rpath, $1)=no
4224 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4225 _LT_TAGVAR(module_cmds, $1)=
4226 _LT_TAGVAR(module_expsym_cmds, $1)=
4227 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4228 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4229 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4230 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4231 # include_expsyms should be a list of space-separated symbols to be *always*
4232 # included in the symbol list
4233 _LT_TAGVAR(include_expsyms, $1)=
4234 # exclude_expsyms can be an extended regexp of symbols to exclude
4235 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4236 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4237 # as well as any symbol that contains `d'.
4238 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4239 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4240 # platforms (ab)use it in PIC code, but their linkers get confused if
4241 # the symbol is explicitly referenced. Since portable code cannot
4242 # rely on this symbol name, it's probably fine to never include it in
4243 # preloaded symbol tables.
4244 # Exclude shared library initialization/finalization symbols.
4245dnl Note also adjust exclude_expsyms for C++ above.
4246 extract_expsyms_cmds=
4247
4248 case $host_os in
4249 cygwin* | mingw* | pw32* | cegcc*)
4250 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4251 # When not using gcc, we currently assume that we are using
4252 # Microsoft Visual C++.
4253 if test "$GCC" != yes; then
4254 with_gnu_ld=no
4255 fi
4256 ;;
4257 interix*)
4258 # we just hope/assume this is gcc and not c89 (= MSVC++)
4259 with_gnu_ld=yes
4260 ;;
4261 openbsd*)
4262 with_gnu_ld=no
4263 ;;
4264 linux* | k*bsd*-gnu)
4265 _LT_TAGVAR(link_all_deplibs, $1)=no
4266 ;;
4267 esac
4268
4269 _LT_TAGVAR(ld_shlibs, $1)=yes
4270 if test "$with_gnu_ld" = yes; then
4271 # If archive_cmds runs LD, not CC, wlarc should be empty
4272 wlarc='${wl}'
4273
4274 # Set some defaults for GNU ld with shared library support. These
4275 # are reset later if shared libraries are not supported. Putting them
4276 # here allows them to be overridden if necessary.
4277 runpath_var=LD_RUN_PATH
4278 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4279 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4280 # ancient GNU ld didn't support --whole-archive et. al.
4281 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4282 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4283 else
4284 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4285 fi
4286 supports_anon_versioning=no
4287 case `$LD -v 2>&1` in
4288 *GNU\ gold*) supports_anon_versioning=yes ;;
4289 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4290 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4291 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4292 *\ 2.11.*) ;; # other 2.11 versions
4293 *) supports_anon_versioning=yes ;;
4294 esac
4295
4296 # See if GNU ld supports shared libraries.
4297 case $host_os in
4298 aix[[3-9]]*)
4299 # On AIX/PPC, the GNU linker is very broken
4300 if test "$host_cpu" != ia64; then
4301 _LT_TAGVAR(ld_shlibs, $1)=no
4302 cat <<_LT_EOF 1>&2
4303
4304*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4305*** to be unable to reliably create shared libraries on AIX.
4306*** Therefore, libtool is disabling shared libraries support. If you
4307*** really care for shared libraries, you may want to modify your PATH
4308*** so that a non-GNU linker is found, and then restart.
4309
4310_LT_EOF
4311 fi
4312 ;;
4313
4314 amigaos*)
4315 case $host_cpu in
4316 powerpc)
4317 # see comment about AmigaOS4 .so support
4318 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4319 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4320 ;;
4321 m68k)
4322 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4323 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4324 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4325 ;;
4326 esac
4327 ;;
4328
4329 beos*)
4330 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4331 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4332 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4333 # support --undefined. This deserves some investigation. FIXME
4334 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4335 else
4336 _LT_TAGVAR(ld_shlibs, $1)=no
4337 fi
4338 ;;
4339
4340 cygwin* | mingw* | pw32* | cegcc*)
4341 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4342 # as there is no search path for DLLs.
4343 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4344 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4345 _LT_TAGVAR(always_export_symbols, $1)=no
4346 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4347 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
4348
4349 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4350 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4351 # If the export-symbols file already is a .def file (1st line
4352 # is EXPORTS), use it as is; otherwise, prepend...
4353 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4354 cp $export_symbols $output_objdir/$soname.def;
4355 else
4356 echo EXPORTS > $output_objdir/$soname.def;
4357 cat $export_symbols >> $output_objdir/$soname.def;
4358 fi~
4359 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4360 else
4361 _LT_TAGVAR(ld_shlibs, $1)=no
4362 fi
4363 ;;
4364
4365 interix[[3-9]]*)
4366 _LT_TAGVAR(hardcode_direct, $1)=no
4367 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4368 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4369 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4370 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4371 # Instead, shared libraries are loaded at an image base (0x10000000 by
4372 # default) and relocated if they conflict, which is a slow very memory
4373 # consuming and fragmenting process. To avoid this, we pick a random,
4374 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4375 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4376 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4377 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4378 ;;
4379
4380 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4381 tmp_diet=no
4382 if test "$host_os" = linux-dietlibc; then
4383 case $cc_basename in
4384 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
4385 esac
4386 fi
4387 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4388 && test "$tmp_diet" = no
4389 then
4390 tmp_addflag=
4391 tmp_sharedflag='-shared'
4392 case $cc_basename,$host_cpu in
4393 pgcc*) # Portland Group C compiler
4394 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4395 tmp_addflag=' $pic_flag'
4396 ;;
4397 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
4398 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4399 tmp_addflag=' $pic_flag -Mnomain' ;;
4400 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
4401 tmp_addflag=' -i_dynamic' ;;
4402 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
4403 tmp_addflag=' -i_dynamic -nofor_main' ;;
4404 ifc* | ifort*) # Intel Fortran compiler
4405 tmp_addflag=' -nofor_main' ;;
4406 lf95*) # Lahey Fortran 8.1
4407 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4408 tmp_sharedflag='--shared' ;;
4409 xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4410 tmp_sharedflag='-qmkshrobj'
4411 tmp_addflag= ;;
4412 esac
4413 case `$CC -V 2>&1 | sed 5q` in
4414 *Sun\ C*) # Sun C 5.9
4415 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4416 _LT_TAGVAR(compiler_needs_object, $1)=yes
4417 tmp_sharedflag='-G' ;;
4418 *Sun\ F*) # Sun Fortran 8.3
4419 tmp_sharedflag='-G' ;;
4420 esac
4421 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4422
4423 if test "x$supports_anon_versioning" = xyes; then
4424 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4425 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4426 echo "local: *; };" >> $output_objdir/$libname.ver~
4427 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4428 fi
4429
4430 case $cc_basename in
4431 xlf*)
4432 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4433 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4434 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4435 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4436 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4437 if test "x$supports_anon_versioning" = xyes; then
4438 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4439 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4440 echo "local: *; };" >> $output_objdir/$libname.ver~
4441 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4442 fi
4443 ;;
4444 esac
4445 else
4446 _LT_TAGVAR(ld_shlibs, $1)=no
4447 fi
4448 ;;
4449
4450 netbsd* | netbsdelf*-gnu)
4451 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4452 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4453 wlarc=
4454 else
4455 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4456 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4457 fi
4458 ;;
4459
4460 solaris*)
4461 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4462 _LT_TAGVAR(ld_shlibs, $1)=no
4463 cat <<_LT_EOF 1>&2
4464
4465*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4466*** create shared libraries on Solaris systems. Therefore, libtool
4467*** is disabling shared libraries support. We urge you to upgrade GNU
4468*** binutils to release 2.9.1 or newer. Another option is to modify
4469*** your PATH or compiler configuration so that the native linker is
4470*** used, and then restart.
4471
4472_LT_EOF
4473 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4474 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4475 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4476 else
4477 _LT_TAGVAR(ld_shlibs, $1)=no
4478 fi
4479 ;;
4480
4481 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4482 case `$LD -v 2>&1` in
4483 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4484 _LT_TAGVAR(ld_shlibs, $1)=no
4485 cat <<_LT_EOF 1>&2
4486
4487*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4488*** reliably create shared libraries on SCO systems. Therefore, libtool
4489*** is disabling shared libraries support. We urge you to upgrade GNU
4490*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
4491*** your PATH or compiler configuration so that the native linker is
4492*** used, and then restart.
4493
4494_LT_EOF
4495 ;;
4496 *)
4497 # For security reasons, it is highly recommended that you always
4498 # use absolute paths for naming shared libraries, and exclude the
4499 # DT_RUNPATH tag from executables and libraries. But doing so
4500 # requires that you compile everything twice, which is a pain.
4501 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4502 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4503 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4504 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4505 else
4506 _LT_TAGVAR(ld_shlibs, $1)=no
4507 fi
4508 ;;
4509 esac
4510 ;;
4511
4512 sunos4*)
4513 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4514 wlarc=
4515 _LT_TAGVAR(hardcode_direct, $1)=yes
4516 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4517 ;;
4518
4519 *)
4520 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4521 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4522 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4523 else
4524 _LT_TAGVAR(ld_shlibs, $1)=no
4525 fi
4526 ;;
4527 esac
4528
4529 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4530 runpath_var=
4531 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4532 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4533 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4534 fi
4535 else
4536 # PORTME fill in a description of your system's linker (not GNU ld)
4537 case $host_os in
4538 aix3*)
4539 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4540 _LT_TAGVAR(always_export_symbols, $1)=yes
4541 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
4542 # Note: this linker hardcodes the directories in LIBPATH if there
4543 # are no directories specified by -L.
4544 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4545 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4546 # Neither direct hardcoding nor static linking is supported with a
4547 # broken collect2.
4548 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4549 fi
4550 ;;
4551
4552 aix[[4-9]]*)
4553 if test "$host_cpu" = ia64; then
4554 # On IA64, the linker does run time linking by default, so we don't
4555 # have to do anything special.
4556 aix_use_runtimelinking=no
4557 exp_sym_flag='-Bexport'
4558 no_entry_flag=""
4559 else
4560 # If we're using GNU nm, then we don't want the "-C" option.
4561 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4562 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4563 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4564 else
4565 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4566 fi
4567 aix_use_runtimelinking=no
4568
4569 # Test if we are trying to use run time linking or normal
4570 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4571 # need to do runtime linking.
4572 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4573 for ld_flag in $LDFLAGS; do
4574 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4575 aix_use_runtimelinking=yes
4576 break
4577 fi
4578 done
4579 ;;
4580 esac
4581
4582 exp_sym_flag='-bexport'
4583 no_entry_flag='-bnoentry'
4584 fi
4585
4586 # When large executables or shared objects are built, AIX ld can
4587 # have problems creating the table of contents. If linking a library
4588 # or program results in "error TOC overflow" add -mminimal-toc to
4589 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
4590 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4591
4592 _LT_TAGVAR(archive_cmds, $1)=''
4593 _LT_TAGVAR(hardcode_direct, $1)=yes
4594 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4595 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4596 _LT_TAGVAR(link_all_deplibs, $1)=yes
4597 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4598
4599 if test "$GCC" = yes; then
4600 case $host_os in aix4.[[012]]|aix4.[[012]].*)
4601 # We only want to do this on AIX 4.2 and lower, the check
4602 # below for broken collect2 doesn't work under 4.3+
4603 collect2name=`${CC} -print-prog-name=collect2`
4604 if test -f "$collect2name" &&
4605 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4606 then
4607 # We have reworked collect2
4608 :
4609 else
4610 # We have old collect2
4611 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4612 # It fails to find uninstalled libraries when the uninstalled
4613 # path is not listed in the libpath. Setting hardcode_minus_L
4614 # to unsupported forces relinking
4615 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4616 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4617 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4618 fi
4619 ;;
4620 esac
4621 shared_flag='-shared'
4622 if test "$aix_use_runtimelinking" = yes; then
4623 shared_flag="$shared_flag "'${wl}-G'
4624 fi
4625 _LT_TAGVAR(link_all_deplibs, $1)=no
4626 else
4627 # not using gcc
4628 if test "$host_cpu" = ia64; then
4629 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4630 # chokes on -Wl,-G. The following line is correct:
4631 shared_flag='-G'
4632 else
4633 if test "$aix_use_runtimelinking" = yes; then
4634 shared_flag='${wl}-G'
4635 else
4636 shared_flag='${wl}-bM:SRE'
4637 fi
4638 fi
4639 fi
4640
4641 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4642 # It seems that -bexpall does not export symbols beginning with
4643 # underscore (_), so it is better to generate a list of symbols to export.
4644 _LT_TAGVAR(always_export_symbols, $1)=yes
4645 if test "$aix_use_runtimelinking" = yes; then
4646 # Warning - without using the other runtime loading flags (-brtl),
4647 # -berok will link without error, but may produce a broken library.
4648 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4649 # Determine the default libpath from the value encoded in an
4650 # empty executable.
4651 _LT_SYS_MODULE_PATH_AIX
4652 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4653 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4654 else
4655 if test "$host_cpu" = ia64; then
4656 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4657 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4658 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
4659 else
4660 # Determine the default libpath from the value encoded in an
4661 # empty executable.
4662 _LT_SYS_MODULE_PATH_AIX
4663 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4664 # Warning - without using the other run time loading flags,
4665 # -berok will link without error, but may produce a broken library.
4666 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4667 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4668 # Exported symbols can be pulled into shared objects from archives
4669 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4670 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4671 # This is similar to how AIX traditionally builds its shared libraries.
4672 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
4673 fi
4674 fi
4675 ;;
4676
4677 amigaos*)
4678 case $host_cpu in
4679 powerpc)
4680 # see comment about AmigaOS4 .so support
4681 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4682 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4683 ;;
4684 m68k)
4685 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4686 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4687 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4688 ;;
4689 esac
4690 ;;
4691
4692 bsdi[[45]]*)
4693 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4694 ;;
4695
4696 cygwin* | mingw* | pw32* | cegcc*)
4697 # When not using gcc, we currently assume that we are using
4698 # Microsoft Visual C++.
4699 # hardcode_libdir_flag_spec is actually meaningless, as there is
4700 # no search path for DLLs.
4701 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4702 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4703 # Tell ltmain to make .lib files, not .a files.
4704 libext=lib
4705 # Tell ltmain to make .dll files, not .so files.
4706 shrext_cmds=".dll"
4707 # FIXME: Setting linknames here is a bad hack.
4708 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4709 # The linker will automatically build a .lib file if we build a DLL.
4710 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4711 # FIXME: Should let the user specify the lib program.
4712 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4713 _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4714 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4715 ;;
4716
4717 darwin* | rhapsody*)
4718 _LT_DARWIN_LINKER_FEATURES($1)
4719 ;;
4720
4721 dgux*)
4722 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4723 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4724 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4725 ;;
4726
4727 freebsd1*)
4728 _LT_TAGVAR(ld_shlibs, $1)=no
4729 ;;
4730
4731 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4732 # support. Future versions do this automatically, but an explicit c++rt0.o
4733 # does not break anything, and helps significantly (at the cost of a little
4734 # extra space).
4735 freebsd2.2*)
4736 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4737 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4738 _LT_TAGVAR(hardcode_direct, $1)=yes
4739 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4740 ;;
4741
4742 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4743 freebsd2*)
4744 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4745 _LT_TAGVAR(hardcode_direct, $1)=yes
4746 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4747 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4748 ;;
4749
4750 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4751 freebsd* | dragonfly*)
4752 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4753 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4754 _LT_TAGVAR(hardcode_direct, $1)=yes
4755 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4756 ;;
4757
4758 hpux9*)
4759 if test "$GCC" = yes; then
4760 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4761 else
4762 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4763 fi
4764 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4765 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4766 _LT_TAGVAR(hardcode_direct, $1)=yes
4767
4768 # hardcode_minus_L: Not really in the search PATH,
4769 # but as the default location of the library.
4770 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4771 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4772 ;;
4773
4774 hpux10*)
4775 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4776 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4777 else
4778 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4779 fi
4780 if test "$with_gnu_ld" = no; then
4781 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4782 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4783 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4784 _LT_TAGVAR(hardcode_direct, $1)=yes
4785 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4786 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4787 # hardcode_minus_L: Not really in the search PATH,
4788 # but as the default location of the library.
4789 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4790 fi
4791 ;;
4792
4793 hpux11*)
4794 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4795 case $host_cpu in
4796 hppa*64*)
4797 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4798 ;;
4799 ia64*)
4800 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4801 ;;
4802 *)
4803 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4804 ;;
4805 esac
4806 else
4807 case $host_cpu in
4808 hppa*64*)
4809 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4810 ;;
4811 ia64*)
4812 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4813 ;;
4814 *)
4815 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4816 ;;
4817 esac
4818 fi
4819 if test "$with_gnu_ld" = no; then
4820 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4821 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4822
4823 case $host_cpu in
4824 hppa*64*|ia64*)
4825 _LT_TAGVAR(hardcode_direct, $1)=no
4826 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4827 ;;
4828 *)
4829 _LT_TAGVAR(hardcode_direct, $1)=yes
4830 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4831 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4832
4833 # hardcode_minus_L: Not really in the search PATH,
4834 # but as the default location of the library.
4835 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4836 ;;
4837 esac
4838 fi
4839 ;;
4840
4841 irix5* | irix6* | nonstopux*)
4842 if test "$GCC" = yes; then
4843 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4844 # Try to use the -exported_symbol ld option, if it does not
4845 # work, assume that -exports_file does not work either and
4846 # implicitly export all symbols.
4847 save_LDFLAGS="$LDFLAGS"
4848 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4849 AC_LINK_IFELSE(int foo(void) {},
4850 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4851 )
4852 LDFLAGS="$save_LDFLAGS"
4853 else
4854 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4855 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4856 fi
4857 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4858 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4859 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4860 _LT_TAGVAR(inherit_rpath, $1)=yes
4861 _LT_TAGVAR(link_all_deplibs, $1)=yes
4862 ;;
4863
4864 netbsd* | netbsdelf*-gnu)
4865 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4866 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
4867 else
4868 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
4869 fi
4870 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4871 _LT_TAGVAR(hardcode_direct, $1)=yes
4872 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4873 ;;
4874
4875 newsos6)
4876 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4877 _LT_TAGVAR(hardcode_direct, $1)=yes
4878 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4879 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4880 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4881 ;;
4882
4883 *nto* | *qnx*)
4884 ;;
4885
4886 openbsd*)
4887 if test -f /usr/libexec/ld.so; then
4888 _LT_TAGVAR(hardcode_direct, $1)=yes
4889 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4890 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4891 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4892 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4893 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4894 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4895 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4896 else
4897 case $host_os in
4898 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4899 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4900 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4901 ;;
4902 *)
4903 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4904 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4905 ;;
4906 esac
4907 fi
4908 else
4909 _LT_TAGVAR(ld_shlibs, $1)=no
4910 fi
4911 ;;
4912
4913 os2*)
4914 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4915 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4916 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4917 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
4918 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4919 ;;
4920
4921 osf3*)
4922 if test "$GCC" = yes; then
4923 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4924 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4925 else
4926 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4927 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4928 fi
4929 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4930 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4931 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4932 ;;
4933
4934 osf4* | osf5*) # as osf3* with the addition of -msym flag
4935 if test "$GCC" = yes; then
4936 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4937 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4938 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4939 else
4940 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4941 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4942 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
4943 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4944
4945 # Both c and cxx compiler support -rpath directly
4946 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4947 fi
4948 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4949 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4950 ;;
4951
4952 solaris*)
4953 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4954 if test "$GCC" = yes; then
4955 wlarc='${wl}'
4956 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4957 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4958 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4959 else
4960 case `$CC -V 2>&1` in
4961 *"Compilers 5.0"*)
4962 wlarc=''
4963 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4964 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4965 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4966 ;;
4967 *)
4968 wlarc='${wl}'
4969 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4970 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4971 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4972 ;;
4973 esac
4974 fi
4975 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4976 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4977 case $host_os in
4978 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4979 *)
4980 # The compiler driver will combine and reorder linker options,
4981 # but understands `-z linker_flag'. GCC discards it without `$wl',
4982 # but is careful enough not to reorder.
4983 # Supported since Solaris 2.6 (maybe 2.5.1?)
4984 if test "$GCC" = yes; then
4985 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4986 else
4987 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4988 fi
4989 ;;
4990 esac
4991 _LT_TAGVAR(link_all_deplibs, $1)=yes
4992 ;;
4993
4994 sunos4*)
4995 if test "x$host_vendor" = xsequent; then
4996 # Use $CC to link under sequent, because it throws in some extra .o
4997 # files that make .init and .fini sections work.
4998 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4999 else
5000 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5001 fi
5002 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5003 _LT_TAGVAR(hardcode_direct, $1)=yes
5004 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5005 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5006 ;;
5007
5008 sysv4)
5009 case $host_vendor in
5010 sni)
5011 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5012 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5013 ;;
5014 siemens)
5015 ## LD is ld it makes a PLAMLIB
5016 ## CC just makes a GrossModule.
5017 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5018 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5019 _LT_TAGVAR(hardcode_direct, $1)=no
5020 ;;
5021 motorola)
5022 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5023 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5024 ;;
5025 esac
5026 runpath_var='LD_RUN_PATH'
5027 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5028 ;;
5029
5030 sysv4.3*)
5031 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5032 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5033 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5034 ;;
5035
5036 sysv4*MP*)
5037 if test -d /usr/nec; then
5038 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5039 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5040 runpath_var=LD_RUN_PATH
5041 hardcode_runpath_var=yes
5042 _LT_TAGVAR(ld_shlibs, $1)=yes
5043 fi
5044 ;;
5045
5046 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5047 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5048 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5049 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5050 runpath_var='LD_RUN_PATH'
5051
5052 if test "$GCC" = yes; then
5053 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5054 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055 else
5056 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5057 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5058 fi
5059 ;;
5060
5061 sysv5* | sco3.2v5* | sco5v6*)
5062 # Note: We can NOT use -z defs as we might desire, because we do not
5063 # link with -lc, and that would cause any symbols used from libc to
5064 # always be unresolved, which means just about no library would
5065 # ever link correctly. If we're not using GNU ld we use -z text
5066 # though, which does catch some bad symbols but isn't as heavy-handed
5067 # as -z defs.
5068 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5069 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5070 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5071 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5072 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5073 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5074 _LT_TAGVAR(link_all_deplibs, $1)=yes
5075 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5076 runpath_var='LD_RUN_PATH'
5077
5078 if test "$GCC" = yes; then
5079 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5080 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081 else
5082 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5083 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5084 fi
5085 ;;
5086
5087 uts4*)
5088 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5089 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5090 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5091 ;;
5092
5093 *)
5094 _LT_TAGVAR(ld_shlibs, $1)=no
5095 ;;
5096 esac
5097
5098 if test x$host_vendor = xsni; then
5099 case $host in
5100 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5101 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5102 ;;
5103 esac
5104 fi
5105 fi
5106])
5107AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5108test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5109
5110_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5111
5112_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5113_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5114_LT_DECL([], [extract_expsyms_cmds], [2],
5115 [The commands to extract the exported symbol list from a shared archive])
5116
5117#
5118# Do we need to explicitly link libc?
5119#
5120case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5121x|xyes)
5122 # Assume -lc should be added
5123 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5124
5125 if test "$enable_shared" = yes && test "$GCC" = yes; then
5126 case $_LT_TAGVAR(archive_cmds, $1) in
5127 *'~'*)
5128 # FIXME: we may have to deal with multi-command sequences.
5129 ;;
5130 '$CC '*)
5131 # Test whether the compiler implicitly links with -lc since on some
5132 # systems, -lgcc has to come before -lc. If gcc already passes -lc
5133 # to ld, don't add -lc before -lgcc.
5134 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5135 $RM conftest*
5136 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5137
5138 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5139 soname=conftest
5140 lib=conftest
5141 libobjs=conftest.$ac_objext
5142 deplibs=
5143 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5144 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5145 compiler_flags=-v
5146 linker_flags=-v
5147 verstring=
5148 output_objdir=.
5149 libname=conftest
5150 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5151 _LT_TAGVAR(allow_undefined_flag, $1)=
5152 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5153 then
5154 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5155 else
5156 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5157 fi
5158 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5159 else
5160 cat conftest.err 1>&5
5161 fi
5162 $RM conftest*
5163 AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5164 ;;
5165 esac
5166 fi
5167 ;;
5168esac
5169
5170_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5171 [Whether or not to add -lc for building shared libraries])
5172_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5173 [enable_shared_with_static_runtimes], [0],
5174 [Whether or not to disallow shared libs when runtime libs are static])
5175_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5176 [Compiler flag to allow reflexive dlopens])
5177_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5178 [Compiler flag to generate shared objects directly from archives])
5179_LT_TAGDECL([], [compiler_needs_object], [1],
5180 [Whether the compiler copes with passing no objects directly])
5181_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5182 [Create an old-style archive from a shared archive])
5183_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5184 [Create a temporary old-style archive to link instead of a shared archive])
5185_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5186_LT_TAGDECL([], [archive_expsym_cmds], [2])
5187_LT_TAGDECL([], [module_cmds], [2],
5188 [Commands used to build a loadable module if different from building
5189 a shared archive.])
5190_LT_TAGDECL([], [module_expsym_cmds], [2])
5191_LT_TAGDECL([], [with_gnu_ld], [1],
5192 [Whether we are building with GNU ld or not])
5193_LT_TAGDECL([], [allow_undefined_flag], [1],
5194 [Flag that allows shared libraries with undefined symbols to be built])
5195_LT_TAGDECL([], [no_undefined_flag], [1],
5196 [Flag that enforces no undefined symbols])
5197_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5198 [Flag to hardcode $libdir into a binary during linking.
5199 This must work even if $libdir does not exist])
5200_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5201 [[If ld is used when linking, flag to hardcode $libdir into a binary
5202 during linking. This must work even if $libdir does not exist]])
5203_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5204 [Whether we need a single "-rpath" flag with a separated argument])
5205_LT_TAGDECL([], [hardcode_direct], [0],
5206 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5207 DIR into the resulting binary])
5208_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5209 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5210 DIR into the resulting binary and the resulting library dependency is
5211 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5212 library is relocated])
5213_LT_TAGDECL([], [hardcode_minus_L], [0],
5214 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5215 into the resulting binary])
5216_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5217 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5218 into the resulting binary])
5219_LT_TAGDECL([], [hardcode_automatic], [0],
5220 [Set to "yes" if building a shared library automatically hardcodes DIR
5221 into the library and all subsequent libraries and executables linked
5222 against it])
5223_LT_TAGDECL([], [inherit_rpath], [0],
5224 [Set to yes if linker adds runtime paths of dependent libraries
5225 to runtime path list])
5226_LT_TAGDECL([], [link_all_deplibs], [0],
5227 [Whether libtool must link a program against all its dependency libraries])
5228_LT_TAGDECL([], [fix_srcfile_path], [1],
5229 [Fix the shell variable $srcfile for the compiler])
5230_LT_TAGDECL([], [always_export_symbols], [0],
5231 [Set to "yes" if exported symbols are required])
5232_LT_TAGDECL([], [export_symbols_cmds], [2],
5233 [The commands to list exported symbols])
5234_LT_TAGDECL([], [exclude_expsyms], [1],
5235 [Symbols that should not be listed in the preloaded symbols])
5236_LT_TAGDECL([], [include_expsyms], [1],
5237 [Symbols that must always be exported])
5238_LT_TAGDECL([], [prelink_cmds], [2],
5239 [Commands necessary for linking programs (against libraries) with templates])
5240_LT_TAGDECL([], [file_list_spec], [1],
5241 [Specify filename containing input files])
5242dnl FIXME: Not yet implemented
5243dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5244dnl [Compiler flag to generate thread safe objects])
5245])# _LT_LINKER_SHLIBS
5246
5247
5248# _LT_LANG_C_CONFIG([TAG])
5249# ------------------------
5250# Ensure that the configuration variables for a C compiler are suitably
5251# defined. These variables are subsequently used by _LT_CONFIG to write
5252# the compiler configuration to `libtool'.
5253m4_defun([_LT_LANG_C_CONFIG],
5254[m4_require([_LT_DECL_EGREP])dnl
5255lt_save_CC="$CC"
5256AC_LANG_PUSH(C)
5257
5258# Source file extension for C test sources.
5259ac_ext=c
5260
5261# Object file extension for compiled C test sources.
5262objext=o
5263_LT_TAGVAR(objext, $1)=$objext
5264
5265# Code to be used in simple compile tests
5266lt_simple_compile_test_code="int some_variable = 0;"
5267
5268# Code to be used in simple link tests
5269lt_simple_link_test_code='int main(){return(0);}'
5270
5271_LT_TAG_COMPILER
5272# Save the default compiler, since it gets overwritten when the other
5273# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5274compiler_DEFAULT=$CC
5275
5276# save warnings/boilerplate of simple test code
5277_LT_COMPILER_BOILERPLATE
5278_LT_LINKER_BOILERPLATE
5279
5280## CAVEAT EMPTOR:
5281## There is no encapsulation within the following macros, do not change
5282## the running order or otherwise move them around unless you know exactly
5283## what you are doing...
5284if test -n "$compiler"; then
5285 _LT_COMPILER_NO_RTTI($1)
5286 _LT_COMPILER_PIC($1)
5287 _LT_COMPILER_C_O($1)
5288 _LT_COMPILER_FILE_LOCKS($1)
5289 _LT_LINKER_SHLIBS($1)
5290 _LT_SYS_DYNAMIC_LINKER($1)
5291 _LT_LINKER_HARDCODE_LIBPATH($1)
5292 LT_SYS_DLOPEN_SELF
5293 _LT_CMD_STRIPLIB
5294
5295 # Report which library types will actually be built
5296 AC_MSG_CHECKING([if libtool supports shared libraries])
5297 AC_MSG_RESULT([$can_build_shared])
5298
5299 AC_MSG_CHECKING([whether to build shared libraries])
5300 test "$can_build_shared" = "no" && enable_shared=no
5301
5302 # On AIX, shared libraries and static libraries use the same namespace, and
5303 # are all built from PIC.
5304 case $host_os in
5305 aix3*)
5306 test "$enable_shared" = yes && enable_static=no
5307 if test -n "$RANLIB"; then
5308 archive_cmds="$archive_cmds~\$RANLIB \$lib"
5309 postinstall_cmds='$RANLIB $lib'
5310 fi
5311 ;;
5312
5313 aix[[4-9]]*)
5314 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5315 test "$enable_shared" = yes && enable_static=no
5316 fi
5317 ;;
5318 esac
5319 AC_MSG_RESULT([$enable_shared])
5320
5321 AC_MSG_CHECKING([whether to build static libraries])
5322 # Make sure either enable_shared or enable_static is yes.
5323 test "$enable_shared" = yes || enable_static=yes
5324 AC_MSG_RESULT([$enable_static])
5325
5326 _LT_CONFIG($1)
5327fi
5328AC_LANG_POP
5329CC="$lt_save_CC"
5330])# _LT_LANG_C_CONFIG
5331
5332
5333# _LT_PROG_CXX
5334# ------------
5335# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5336# compiler, we have our own version here.
5337m4_defun([_LT_PROG_CXX],
5338[
5339pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5340AC_PROG_CXX
5341if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5342 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5343 (test "X$CXX" != "Xg++"))) ; then
5344 AC_PROG_CXXCPP
5345else
5346 _lt_caught_CXX_error=yes
5347fi
5348popdef([AC_MSG_ERROR])
5349])# _LT_PROG_CXX
5350
5351dnl aclocal-1.4 backwards compatibility:
5352dnl AC_DEFUN([_LT_PROG_CXX], [])
5353
5354
5355# _LT_LANG_CXX_CONFIG([TAG])
5356# --------------------------
5357# Ensure that the configuration variables for a C++ compiler are suitably
5358# defined. These variables are subsequently used by _LT_CONFIG to write
5359# the compiler configuration to `libtool'.
5360m4_defun([_LT_LANG_CXX_CONFIG],
5361[AC_REQUIRE([_LT_PROG_CXX])dnl
5362m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5363m4_require([_LT_DECL_EGREP])dnl
5364
5365AC_LANG_PUSH(C++)
5366_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5367_LT_TAGVAR(allow_undefined_flag, $1)=
5368_LT_TAGVAR(always_export_symbols, $1)=no
5369_LT_TAGVAR(archive_expsym_cmds, $1)=
5370_LT_TAGVAR(compiler_needs_object, $1)=no
5371_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5372_LT_TAGVAR(hardcode_direct, $1)=no
5373_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5374_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5375_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5376_LT_TAGVAR(hardcode_libdir_separator, $1)=
5377_LT_TAGVAR(hardcode_minus_L, $1)=no
5378_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5379_LT_TAGVAR(hardcode_automatic, $1)=no
5380_LT_TAGVAR(inherit_rpath, $1)=no
5381_LT_TAGVAR(module_cmds, $1)=
5382_LT_TAGVAR(module_expsym_cmds, $1)=
5383_LT_TAGVAR(link_all_deplibs, $1)=unknown
5384_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5385_LT_TAGVAR(no_undefined_flag, $1)=
5386_LT_TAGVAR(whole_archive_flag_spec, $1)=
5387_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5388
5389# Source file extension for C++ test sources.
5390ac_ext=cpp
5391
5392# Object file extension for compiled C++ test sources.
5393objext=o
5394_LT_TAGVAR(objext, $1)=$objext
5395
5396# No sense in running all these tests if we already determined that
5397# the CXX compiler isn't working. Some variables (like enable_shared)
5398# are currently assumed to apply to all compilers on this platform,
5399# and will be corrupted by setting them based on a non-working compiler.
5400if test "$_lt_caught_CXX_error" != yes; then
5401 # Code to be used in simple compile tests
5402 lt_simple_compile_test_code="int some_variable = 0;"
5403
5404 # Code to be used in simple link tests
5405 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5406
5407 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5408 _LT_TAG_COMPILER
5409
5410 # save warnings/boilerplate of simple test code
5411 _LT_COMPILER_BOILERPLATE
5412 _LT_LINKER_BOILERPLATE
5413
5414 # Allow CC to be a program name with arguments.
5415 lt_save_CC=$CC
5416 lt_save_LD=$LD
5417 lt_save_GCC=$GCC
5418 GCC=$GXX
5419 lt_save_with_gnu_ld=$with_gnu_ld
5420 lt_save_path_LD=$lt_cv_path_LD
5421 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5422 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5423 else
5424 $as_unset lt_cv_prog_gnu_ld
5425 fi
5426 if test -n "${lt_cv_path_LDCXX+set}"; then
5427 lt_cv_path_LD=$lt_cv_path_LDCXX
5428 else
5429 $as_unset lt_cv_path_LD
5430 fi
5431 test -z "${LDCXX+set}" || LD=$LDCXX
5432 CC=${CXX-"c++"}
5433 compiler=$CC
5434 _LT_TAGVAR(compiler, $1)=$CC
5435 _LT_CC_BASENAME([$compiler])
5436
5437 if test -n "$compiler"; then
5438 # We don't want -fno-exception when compiling C++ code, so set the
5439 # no_builtin_flag separately
5440 if test "$GXX" = yes; then
5441 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5442 else
5443 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5444 fi
5445
5446 if test "$GXX" = yes; then
5447 # Set up default GNU C++ configuration
5448
5449 LT_PATH_LD
5450
5451 # Check if GNU C++ uses GNU ld as the underlying linker, since the
5452 # archiving commands below assume that GNU ld is being used.
5453 if test "$with_gnu_ld" = yes; then
5454 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5455 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5456
5457 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5458 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5459
5460 # If archive_cmds runs LD, not CC, wlarc should be empty
5461 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5462 # investigate it a little bit more. (MM)
5463 wlarc='${wl}'
5464
5465 # ancient GNU ld didn't support --whole-archive et. al.
5466 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5467 $GREP 'no-whole-archive' > /dev/null; then
5468 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5469 else
5470 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5471 fi
5472 else
5473 with_gnu_ld=no
5474 wlarc=
5475
5476 # A generic and very simple default shared library creation
5477 # command for GNU C++ for the case where it uses the native
5478 # linker, instead of GNU ld. If possible, this setting should
5479 # overridden to take advantage of the native linker features on
5480 # the platform it is being used on.
5481 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5482 fi
5483
5484 # Commands to make compiler produce verbose output that lists
5485 # what "hidden" libraries, object files and flags are used when
5486 # linking a shared library.
5487 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5488
5489 else
5490 GXX=no
5491 with_gnu_ld=no
5492 wlarc=
5493 fi
5494
5495 # PORTME: fill in a description of your system's C++ link characteristics
5496 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5497 _LT_TAGVAR(ld_shlibs, $1)=yes
5498 case $host_os in
5499 aix3*)
5500 # FIXME: insert proper C++ library support
5501 _LT_TAGVAR(ld_shlibs, $1)=no
5502 ;;
5503 aix[[4-9]]*)
5504 if test "$host_cpu" = ia64; then
5505 # On IA64, the linker does run time linking by default, so we don't
5506 # have to do anything special.
5507 aix_use_runtimelinking=no
5508 exp_sym_flag='-Bexport'
5509 no_entry_flag=""
5510 else
5511 aix_use_runtimelinking=no
5512
5513 # Test if we are trying to use run time linking or normal
5514 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5515 # need to do runtime linking.
5516 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5517 for ld_flag in $LDFLAGS; do
5518 case $ld_flag in
5519 *-brtl*)
5520 aix_use_runtimelinking=yes
5521 break
5522 ;;
5523 esac
5524 done
5525 ;;
5526 esac
5527
5528 exp_sym_flag='-bexport'
5529 no_entry_flag='-bnoentry'
5530 fi
5531
5532 # When large executables or shared objects are built, AIX ld can
5533 # have problems creating the table of contents. If linking a library
5534 # or program results in "error TOC overflow" add -mminimal-toc to
5535 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5536 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5537
5538 _LT_TAGVAR(archive_cmds, $1)=''
5539 _LT_TAGVAR(hardcode_direct, $1)=yes
5540 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5541 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5542 _LT_TAGVAR(link_all_deplibs, $1)=yes
5543 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5544
5545 if test "$GXX" = yes; then
5546 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5547 # We only want to do this on AIX 4.2 and lower, the check
5548 # below for broken collect2 doesn't work under 4.3+
5549 collect2name=`${CC} -print-prog-name=collect2`
5550 if test -f "$collect2name" &&
5551 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5552 then
5553 # We have reworked collect2
5554 :
5555 else
5556 # We have old collect2
5557 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5558 # It fails to find uninstalled libraries when the uninstalled
5559 # path is not listed in the libpath. Setting hardcode_minus_L
5560 # to unsupported forces relinking
5561 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5562 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5563 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5564 fi
5565 esac
5566 shared_flag='-shared'
5567 if test "$aix_use_runtimelinking" = yes; then
5568 shared_flag="$shared_flag "'${wl}-G'
5569 fi
5570 else
5571 # not using gcc
5572 if test "$host_cpu" = ia64; then
5573 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5574 # chokes on -Wl,-G. The following line is correct:
5575 shared_flag='-G'
5576 else
5577 if test "$aix_use_runtimelinking" = yes; then
5578 shared_flag='${wl}-G'
5579 else
5580 shared_flag='${wl}-bM:SRE'
5581 fi
5582 fi
5583 fi
5584
5585 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5586 # It seems that -bexpall does not export symbols beginning with
5587 # underscore (_), so it is better to generate a list of symbols to
5588 # export.
5589 _LT_TAGVAR(always_export_symbols, $1)=yes
5590 if test "$aix_use_runtimelinking" = yes; then
5591 # Warning - without using the other runtime loading flags (-brtl),
5592 # -berok will link without error, but may produce a broken library.
5593 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5594 # Determine the default libpath from the value encoded in an empty
5595 # executable.
5596 _LT_SYS_MODULE_PATH_AIX
5597 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5598
5599 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5600 else
5601 if test "$host_cpu" = ia64; then
5602 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5603 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5604 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5605 else
5606 # Determine the default libpath from the value encoded in an
5607 # empty executable.
5608 _LT_SYS_MODULE_PATH_AIX
5609 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5610 # Warning - without using the other run time loading flags,
5611 # -berok will link without error, but may produce a broken library.
5612 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5613 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5614 # Exported symbols can be pulled into shared objects from archives
5615 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5616 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5617 # This is similar to how AIX traditionally builds its shared
5618 # libraries.
5619 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5620 fi
5621 fi
5622 ;;
5623
5624 beos*)
5625 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5626 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5627 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5628 # support --undefined. This deserves some investigation. FIXME
5629 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5630 else
5631 _LT_TAGVAR(ld_shlibs, $1)=no
5632 fi
5633 ;;
5634
5635 chorus*)
5636 case $cc_basename in
5637 *)
5638 # FIXME: insert proper C++ library support
5639 _LT_TAGVAR(ld_shlibs, $1)=no
5640 ;;
5641 esac
5642 ;;
5643
5644 cygwin* | mingw* | pw32* | cegcc*)
5645 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5646 # as there is no search path for DLLs.
5647 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5648 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5649 _LT_TAGVAR(always_export_symbols, $1)=no
5650 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5651
5652 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5653 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5654 # If the export-symbols file already is a .def file (1st line
5655 # is EXPORTS), use it as is; otherwise, prepend...
5656 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5657 cp $export_symbols $output_objdir/$soname.def;
5658 else
5659 echo EXPORTS > $output_objdir/$soname.def;
5660 cat $export_symbols >> $output_objdir/$soname.def;
5661 fi~
5662 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5663 else
5664 _LT_TAGVAR(ld_shlibs, $1)=no
5665 fi
5666 ;;
5667 darwin* | rhapsody*)
5668 _LT_DARWIN_LINKER_FEATURES($1)
5669 ;;
5670
5671 dgux*)
5672 case $cc_basename in
5673 ec++*)
5674 # FIXME: insert proper C++ library support
5675 _LT_TAGVAR(ld_shlibs, $1)=no
5676 ;;
5677 ghcx*)
5678 # Green Hills C++ Compiler
5679 # FIXME: insert proper C++ library support
5680 _LT_TAGVAR(ld_shlibs, $1)=no
5681 ;;
5682 *)
5683 # FIXME: insert proper C++ library support
5684 _LT_TAGVAR(ld_shlibs, $1)=no
5685 ;;
5686 esac
5687 ;;
5688
5689 freebsd[[12]]*)
5690 # C++ shared libraries reported to be fairly broken before
5691 # switch to ELF
5692 _LT_TAGVAR(ld_shlibs, $1)=no
5693 ;;
5694
5695 freebsd-elf*)
5696 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5697 ;;
5698
5699 freebsd* | dragonfly*)
5700 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5701 # conventions
5702 _LT_TAGVAR(ld_shlibs, $1)=yes
5703 ;;
5704
5705 gnu*)
5706 ;;
5707
5708 hpux9*)
5709 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5710 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5711 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5712 _LT_TAGVAR(hardcode_direct, $1)=yes
5713 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5714 # but as the default
5715 # location of the library.
5716
5717 case $cc_basename in
5718 CC*)
5719 # FIXME: insert proper C++ library support
5720 _LT_TAGVAR(ld_shlibs, $1)=no
5721 ;;
5722 aCC*)
5723 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5724 # Commands to make compiler produce verbose output that lists
5725 # what "hidden" libraries, object files and flags are used when
5726 # linking a shared library.
5727 #
5728 # There doesn't appear to be a way to prevent this compiler from
5729 # explicitly linking system object files so we need to strip them
5730 # from the output so that they don't get included in the library
5731 # dependencies.
5732 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5733 ;;
5734 *)
5735 if test "$GXX" = yes; then
5736 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5737 else
5738 # FIXME: insert proper C++ library support
5739 _LT_TAGVAR(ld_shlibs, $1)=no
5740 fi
5741 ;;
5742 esac
5743 ;;
5744
5745 hpux10*|hpux11*)
5746 if test $with_gnu_ld = no; then
5747 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5748 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5749
5750 case $host_cpu in
5751 hppa*64*|ia64*)
5752 ;;
5753 *)
5754 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5755 ;;
5756 esac
5757 fi
5758 case $host_cpu in
5759 hppa*64*|ia64*)
5760 _LT_TAGVAR(hardcode_direct, $1)=no
5761 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5762 ;;
5763 *)
5764 _LT_TAGVAR(hardcode_direct, $1)=yes
5765 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5766 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5767 # but as the default
5768 # location of the library.
5769 ;;
5770 esac
5771
5772 case $cc_basename in
5773 CC*)
5774 # FIXME: insert proper C++ library support
5775 _LT_TAGVAR(ld_shlibs, $1)=no
5776 ;;
5777 aCC*)
5778 case $host_cpu in
5779 hppa*64*)
5780 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5781 ;;
5782 ia64*)
5783 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5784 ;;
5785 *)
5786 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5787 ;;
5788 esac
5789 # Commands to make compiler produce verbose output that lists
5790 # what "hidden" libraries, object files and flags are used when
5791 # linking a shared library.
5792 #
5793 # There doesn't appear to be a way to prevent this compiler from
5794 # explicitly linking system object files so we need to strip them
5795 # from the output so that they don't get included in the library
5796 # dependencies.
5797 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5798 ;;
5799 *)
5800 if test "$GXX" = yes; then
5801 if test $with_gnu_ld = no; then
5802 case $host_cpu in
5803 hppa*64*)
5804 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5805 ;;
5806 ia64*)
5807 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5808 ;;
5809 *)
5810 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5811 ;;
5812 esac
5813 fi
5814 else
5815 # FIXME: insert proper C++ library support
5816 _LT_TAGVAR(ld_shlibs, $1)=no
5817 fi
5818 ;;
5819 esac
5820 ;;
5821
5822 interix[[3-9]]*)
5823 _LT_TAGVAR(hardcode_direct, $1)=no
5824 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5825 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5826 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5827 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5828 # Instead, shared libraries are loaded at an image base (0x10000000 by
5829 # default) and relocated if they conflict, which is a slow very memory
5830 # consuming and fragmenting process. To avoid this, we pick a random,
5831 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5832 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5833 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5834 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5835 ;;
5836 irix5* | irix6*)
5837 case $cc_basename in
5838 CC*)
5839 # SGI C++
5840 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5841
5842 # Archives containing C++ object files must be created using
5843 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
5844 # necessary to make sure instantiated templates are included
5845 # in the archive.
5846 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5847 ;;
5848 *)
5849 if test "$GXX" = yes; then
5850 if test "$with_gnu_ld" = no; then
5851 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5852 else
5853 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5854 fi
5855 fi
5856 _LT_TAGVAR(link_all_deplibs, $1)=yes
5857 ;;
5858 esac
5859 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5860 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5861 _LT_TAGVAR(inherit_rpath, $1)=yes
5862 ;;
5863
5864 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5865 case $cc_basename in
5866 KCC*)
5867 # Kuck and Associates, Inc. (KAI) C++ Compiler
5868
5869 # KCC will only create a shared library if the output file
5870 # ends with ".so" (or ".sl" for HP-UX), so rename the library
5871 # to its proper name (with version) after linking.
5872 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5873 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
5874 # Commands to make compiler produce verbose output that lists
5875 # what "hidden" libraries, object files and flags are used when
5876 # linking a shared library.
5877 #
5878 # There doesn't appear to be a way to prevent this compiler from
5879 # explicitly linking system object files so we need to strip them
5880 # from the output so that they don't get included in the library
5881 # dependencies.
5882 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5883
5884 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5885 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5886
5887 # Archives containing C++ object files must be created using
5888 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5889 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5890 ;;
5891 icpc* | ecpc* )
5892 # Intel C++
5893 with_gnu_ld=yes
5894 # version 8.0 and above of icpc choke on multiply defined symbols
5895 # if we add $predep_objects and $postdep_objects, however 7.1 and
5896 # earlier do not add the objects themselves.
5897 case `$CC -V 2>&1` in
5898 *"Version 7."*)
5899 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5900 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5901 ;;
5902 *) # Version 8.0 or newer
5903 tmp_idyn=
5904 case $host_cpu in
5905 ia64*) tmp_idyn=' -i_dynamic';;
5906 esac
5907 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5908 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5909 ;;
5910 esac
5911 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5912 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5913 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5914 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5915 ;;
5916 pgCC* | pgcpp*)
5917 # Portland Group C++ compiler
5918 case `$CC -V` in
5919 *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5920 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5921 rm -rf $tpldir~
5922 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5923 compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5924 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5925 rm -rf $tpldir~
5926 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5927 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5928 $RANLIB $oldlib'
5929 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5930 rm -rf $tpldir~
5931 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5932 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5933 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5934 rm -rf $tpldir~
5935 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5936 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5937 ;;
5938 *) # Version 6 will use weak symbols
5939 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5940 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5941 ;;
5942 esac
5943
5944 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5945 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5946 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5947 ;;
5948 cxx*)
5949 # Compaq C++
5950 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5951 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
5952
5953 runpath_var=LD_RUN_PATH
5954 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5955 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5956
5957 # Commands to make compiler produce verbose output that lists
5958 # what "hidden" libraries, object files and flags are used when
5959 # linking a shared library.
5960 #
5961 # There doesn't appear to be a way to prevent this compiler from
5962 # explicitly linking system object files so we need to strip them
5963 # from the output so that they don't get included in the library
5964 # dependencies.
5965 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5966 ;;
5967 xl*)
5968 # IBM XL 8.0 on PPC, with GNU ld
5969 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5970 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5971 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5972 if test "x$supports_anon_versioning" = xyes; then
5973 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5974 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5975 echo "local: *; };" >> $output_objdir/$libname.ver~
5976 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5977 fi
5978 ;;
5979 *)
5980 case `$CC -V 2>&1 | sed 5q` in
5981 *Sun\ C*)
5982 # Sun C++ 5.9
5983 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5984 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5985 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
5986 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5987 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5988 _LT_TAGVAR(compiler_needs_object, $1)=yes
5989
5990 # Not sure whether something based on
5991 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5992 # would be better.
5993 output_verbose_link_cmd='echo'
5994
5995 # Archives containing C++ object files must be created using
5996 # "CC -xar", where "CC" is the Sun C++ compiler. This is
5997 # necessary to make sure instantiated templates are included
5998 # in the archive.
5999 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6000 ;;
6001 esac
6002 ;;
6003 esac
6004 ;;
6005
6006 lynxos*)
6007 # FIXME: insert proper C++ library support
6008 _LT_TAGVAR(ld_shlibs, $1)=no
6009 ;;
6010
6011 m88k*)
6012 # FIXME: insert proper C++ library support
6013 _LT_TAGVAR(ld_shlibs, $1)=no
6014 ;;
6015
6016 mvs*)
6017 case $cc_basename in
6018 cxx*)
6019 # FIXME: insert proper C++ library support
6020 _LT_TAGVAR(ld_shlibs, $1)=no
6021 ;;
6022 *)
6023 # FIXME: insert proper C++ library support
6024 _LT_TAGVAR(ld_shlibs, $1)=no
6025 ;;
6026 esac
6027 ;;
6028
6029 netbsd*)
6030 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6031 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6032 wlarc=
6033 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6034 _LT_TAGVAR(hardcode_direct, $1)=yes
6035 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6036 fi
6037 # Workaround some broken pre-1.5 toolchains
6038 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6039 ;;
6040
6041 *nto* | *qnx*)
6042 _LT_TAGVAR(ld_shlibs, $1)=yes
6043 ;;
6044
6045 openbsd2*)
6046 # C++ shared libraries are fairly broken
6047 _LT_TAGVAR(ld_shlibs, $1)=no
6048 ;;
6049
6050 openbsd*)
6051 if test -f /usr/libexec/ld.so; then
6052 _LT_TAGVAR(hardcode_direct, $1)=yes
6053 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6054 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6055 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6056 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6057 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6058 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6059 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6060 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6061 fi
6062 output_verbose_link_cmd=echo
6063 else
6064 _LT_TAGVAR(ld_shlibs, $1)=no
6065 fi
6066 ;;
6067
6068 osf3* | osf4* | osf5*)
6069 case $cc_basename in
6070 KCC*)
6071 # Kuck and Associates, Inc. (KAI) C++ Compiler
6072
6073 # KCC will only create a shared library if the output file
6074 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6075 # to its proper name (with version) after linking.
6076 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6077
6078 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6079 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6080
6081 # Archives containing C++ object files must be created using
6082 # the KAI C++ compiler.
6083 case $host in
6084 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6085 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6086 esac
6087 ;;
6088 RCC*)
6089 # Rational C++ 2.4.1
6090 # FIXME: insert proper C++ library support
6091 _LT_TAGVAR(ld_shlibs, $1)=no
6092 ;;
6093 cxx*)
6094 case $host in
6095 osf3*)
6096 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6097 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6098 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6099 ;;
6100 *)
6101 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6102 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6103 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6104 echo "-hidden">> $lib.exp~
6105 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6106 $RM $lib.exp'
6107 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6108 ;;
6109 esac
6110
6111 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6112
6113 # Commands to make compiler produce verbose output that lists
6114 # what "hidden" libraries, object files and flags are used when
6115 # linking a shared library.
6116 #
6117 # There doesn't appear to be a way to prevent this compiler from
6118 # explicitly linking system object files so we need to strip them
6119 # from the output so that they don't get included in the library
6120 # dependencies.
6121 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6122 ;;
6123 *)
6124 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6125 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6126 case $host in
6127 osf3*)
6128 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6129 ;;
6130 *)
6131 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6132 ;;
6133 esac
6134
6135 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6136 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6137
6138 # Commands to make compiler produce verbose output that lists
6139 # what "hidden" libraries, object files and flags are used when
6140 # linking a shared library.
6141 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6142
6143 else
6144 # FIXME: insert proper C++ library support
6145 _LT_TAGVAR(ld_shlibs, $1)=no
6146 fi
6147 ;;
6148 esac
6149 ;;
6150
6151 psos*)
6152 # FIXME: insert proper C++ library support
6153 _LT_TAGVAR(ld_shlibs, $1)=no
6154 ;;
6155
6156 sunos4*)
6157 case $cc_basename in
6158 CC*)
6159 # Sun C++ 4.x
6160 # FIXME: insert proper C++ library support
6161 _LT_TAGVAR(ld_shlibs, $1)=no
6162 ;;
6163 lcc*)
6164 # Lucid
6165 # FIXME: insert proper C++ library support
6166 _LT_TAGVAR(ld_shlibs, $1)=no
6167 ;;
6168 *)
6169 # FIXME: insert proper C++ library support
6170 _LT_TAGVAR(ld_shlibs, $1)=no
6171 ;;
6172 esac
6173 ;;
6174
6175 solaris*)
6176 case $cc_basename in
6177 CC*)
6178 # Sun C++ 4.2, 5.x and Centerline C++
6179 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6180 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6181 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6182 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6183 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6184
6185 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6186 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6187 case $host_os in
6188 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6189 *)
6190 # The compiler driver will combine and reorder linker options,
6191 # but understands `-z linker_flag'.
6192 # Supported since Solaris 2.6 (maybe 2.5.1?)
6193 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6194 ;;
6195 esac
6196 _LT_TAGVAR(link_all_deplibs, $1)=yes
6197
6198 output_verbose_link_cmd='echo'
6199
6200 # Archives containing C++ object files must be created using
6201 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6202 # necessary to make sure instantiated templates are included
6203 # in the archive.
6204 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6205 ;;
6206 gcx*)
6207 # Green Hills C++ Compiler
6208 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6209
6210 # The C++ compiler must be used to create the archive.
6211 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6212 ;;
6213 *)
6214 # GNU C++ compiler with Solaris linker
6215 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6216 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6217 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6218 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6219 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6220 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6221
6222 # Commands to make compiler produce verbose output that lists
6223 # what "hidden" libraries, object files and flags are used when
6224 # linking a shared library.
6225 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6226 else
6227 # g++ 2.7 appears to require `-G' NOT `-shared' on this
6228 # platform.
6229 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6230 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6231 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6232
6233 # Commands to make compiler produce verbose output that lists
6234 # what "hidden" libraries, object files and flags are used when
6235 # linking a shared library.
6236 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6237 fi
6238
6239 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6240 case $host_os in
6241 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6242 *)
6243 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6244 ;;
6245 esac
6246 fi
6247 ;;
6248 esac
6249 ;;
6250
6251 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6252 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6253 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6254 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6255 runpath_var='LD_RUN_PATH'
6256
6257 case $cc_basename in
6258 CC*)
6259 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6260 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6261 ;;
6262 *)
6263 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6264 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6265 ;;
6266 esac
6267 ;;
6268
6269 sysv5* | sco3.2v5* | sco5v6*)
6270 # Note: We can NOT use -z defs as we might desire, because we do not
6271 # link with -lc, and that would cause any symbols used from libc to
6272 # always be unresolved, which means just about no library would
6273 # ever link correctly. If we're not using GNU ld we use -z text
6274 # though, which does catch some bad symbols but isn't as heavy-handed
6275 # as -z defs.
6276 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6277 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6278 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6279 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6280 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6281 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6282 _LT_TAGVAR(link_all_deplibs, $1)=yes
6283 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6284 runpath_var='LD_RUN_PATH'
6285
6286 case $cc_basename in
6287 CC*)
6288 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6289 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6290 ;;
6291 *)
6292 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6293 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6294 ;;
6295 esac
6296 ;;
6297
6298 tandem*)
6299 case $cc_basename in
6300 NCC*)
6301 # NonStop-UX NCC 3.20
6302 # FIXME: insert proper C++ library support
6303 _LT_TAGVAR(ld_shlibs, $1)=no
6304 ;;
6305 *)
6306 # FIXME: insert proper C++ library support
6307 _LT_TAGVAR(ld_shlibs, $1)=no
6308 ;;
6309 esac
6310 ;;
6311
6312 vxworks*)
6313 # FIXME: insert proper C++ library support
6314 _LT_TAGVAR(ld_shlibs, $1)=no
6315 ;;
6316
6317 *)
6318 # FIXME: insert proper C++ library support
6319 _LT_TAGVAR(ld_shlibs, $1)=no
6320 ;;
6321 esac
6322
6323 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6324 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6325
6326 _LT_TAGVAR(GCC, $1)="$GXX"
6327 _LT_TAGVAR(LD, $1)="$LD"
6328
6329 ## CAVEAT EMPTOR:
6330 ## There is no encapsulation within the following macros, do not change
6331 ## the running order or otherwise move them around unless you know exactly
6332 ## what you are doing...
6333 _LT_SYS_HIDDEN_LIBDEPS($1)
6334 _LT_COMPILER_PIC($1)
6335 _LT_COMPILER_C_O($1)
6336 _LT_COMPILER_FILE_LOCKS($1)
6337 _LT_LINKER_SHLIBS($1)
6338 _LT_SYS_DYNAMIC_LINKER($1)
6339 _LT_LINKER_HARDCODE_LIBPATH($1)
6340
6341 _LT_CONFIG($1)
6342 fi # test -n "$compiler"
6343
6344 CC=$lt_save_CC
6345 LDCXX=$LD
6346 LD=$lt_save_LD
6347 GCC=$lt_save_GCC
6348 with_gnu_ld=$lt_save_with_gnu_ld
6349 lt_cv_path_LDCXX=$lt_cv_path_LD
6350 lt_cv_path_LD=$lt_save_path_LD
6351 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6352 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6353fi # test "$_lt_caught_CXX_error" != yes
6354
6355AC_LANG_POP
6356])# _LT_LANG_CXX_CONFIG
6357
6358
6359# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6360# ---------------------------------
6361# Figure out "hidden" library dependencies from verbose
6362# compiler output when linking a shared library.
6363# Parse the compiler output and extract the necessary
6364# objects, libraries and library flags.
6365m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6366[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6367# Dependencies to place before and after the object being linked:
6368_LT_TAGVAR(predep_objects, $1)=
6369_LT_TAGVAR(postdep_objects, $1)=
6370_LT_TAGVAR(predeps, $1)=
6371_LT_TAGVAR(postdeps, $1)=
6372_LT_TAGVAR(compiler_lib_search_path, $1)=
6373
6374dnl we can't use the lt_simple_compile_test_code here,
6375dnl because it contains code intended for an executable,
6376dnl not a library. It's possible we should let each
6377dnl tag define a new lt_????_link_test_code variable,
6378dnl but it's only used here...
6379m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6380int a;
6381void foo (void) { a = 0; }
6382_LT_EOF
6383], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6384class Foo
6385{
6386public:
6387 Foo (void) { a = 0; }
6388private:
6389 int a;
6390};
6391_LT_EOF
6392], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6393 subroutine foo
6394 implicit none
6395 integer*4 a
6396 a=0
6397 return
6398 end
6399_LT_EOF
6400], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6401 subroutine foo
6402 implicit none
6403 integer a
6404 a=0
6405 return
6406 end
6407_LT_EOF
6408], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6409public class foo {
6410 private int a;
6411 public void bar (void) {
6412 a = 0;
6413 }
6414};
6415_LT_EOF
6416])
6417dnl Parse the compiler output and extract the necessary
6418dnl objects, libraries and library flags.
6419if AC_TRY_EVAL(ac_compile); then
6420 # Parse the compiler output and extract the necessary
6421 # objects, libraries and library flags.
6422
6423 # Sentinel used to keep track of whether or not we are before
6424 # the conftest object file.
6425 pre_test_object_deps_done=no
6426
6427 for p in `eval "$output_verbose_link_cmd"`; do
6428 case $p in
6429
6430 -L* | -R* | -l*)
6431 # Some compilers place space between "-{L,R}" and the path.
6432 # Remove the space.
6433 if test $p = "-L" ||
6434 test $p = "-R"; then
6435 prev=$p
6436 continue
6437 else
6438 prev=
6439 fi
6440
6441 if test "$pre_test_object_deps_done" = no; then
6442 case $p in
6443 -L* | -R*)
6444 # Internal compiler library paths should come after those
6445 # provided the user. The postdeps already come after the
6446 # user supplied libs so there is no need to process them.
6447 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6448 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6449 else
6450 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6451 fi
6452 ;;
6453 # The "-l" case would never come before the object being
6454 # linked, so don't bother handling this case.
6455 esac
6456 else
6457 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6458 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6459 else
6460 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6461 fi
6462 fi
6463 ;;
6464
6465 *.$objext)
6466 # This assumes that the test object file only shows up
6467 # once in the compiler output.
6468 if test "$p" = "conftest.$objext"; then
6469 pre_test_object_deps_done=yes
6470 continue
6471 fi
6472
6473 if test "$pre_test_object_deps_done" = no; then
6474 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6475 _LT_TAGVAR(predep_objects, $1)="$p"
6476 else
6477 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6478 fi
6479 else
6480 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6481 _LT_TAGVAR(postdep_objects, $1)="$p"
6482 else
6483 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6484 fi
6485 fi
6486 ;;
6487
6488 *) ;; # Ignore the rest.
6489
6490 esac
6491 done
6492
6493 # Clean up.
6494 rm -f a.out a.exe
6495else
6496 echo "libtool.m4: error: problem compiling $1 test program"
6497fi
6498
6499$RM -f confest.$objext
6500
6501# PORTME: override above test on systems where it is broken
6502m4_if([$1], [CXX],
6503[case $host_os in
6504interix[[3-9]]*)
6505 # Interix 3.5 installs completely hosed .la files for C++, so rather than
6506 # hack all around it, let's just trust "g++" to DTRT.
6507 _LT_TAGVAR(predep_objects,$1)=
6508 _LT_TAGVAR(postdep_objects,$1)=
6509 _LT_TAGVAR(postdeps,$1)=
6510 ;;
6511
6512linux*)
6513 case `$CC -V 2>&1 | sed 5q` in
6514 *Sun\ C*)
6515 # Sun C++ 5.9
6516
6517 # The more standards-conforming stlport4 library is
6518 # incompatible with the Cstd library. Avoid specifying
6519 # it if it's in CXXFLAGS. Ignore libCrun as
6520 # -library=stlport4 depends on it.
6521 case " $CXX $CXXFLAGS " in
6522 *" -library=stlport4 "*)
6523 solaris_use_stlport4=yes
6524 ;;
6525 esac
6526
6527 if test "$solaris_use_stlport4" != yes; then
6528 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6529 fi
6530 ;;
6531 esac
6532 ;;
6533
6534solaris*)
6535 case $cc_basename in
6536 CC*)
6537 # The more standards-conforming stlport4 library is
6538 # incompatible with the Cstd library. Avoid specifying
6539 # it if it's in CXXFLAGS. Ignore libCrun as
6540 # -library=stlport4 depends on it.
6541 case " $CXX $CXXFLAGS " in
6542 *" -library=stlport4 "*)
6543 solaris_use_stlport4=yes
6544 ;;
6545 esac
6546
6547 # Adding this requires a known-good setup of shared libraries for
6548 # Sun compiler versions before 5.6, else PIC objects from an old
6549 # archive will be linked into the output, leading to subtle bugs.
6550 if test "$solaris_use_stlport4" != yes; then
6551 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6552 fi
6553 ;;
6554 esac
6555 ;;
6556esac
6557])
6558
6559case " $_LT_TAGVAR(postdeps, $1) " in
6560*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6561esac
6562 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6563if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6564 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6565fi
6566_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6567 [The directories searched by this compiler when creating a shared library])
6568_LT_TAGDECL([], [predep_objects], [1],
6569 [Dependencies to place before and after the objects being linked to
6570 create a shared library])
6571_LT_TAGDECL([], [postdep_objects], [1])
6572_LT_TAGDECL([], [predeps], [1])
6573_LT_TAGDECL([], [postdeps], [1])
6574_LT_TAGDECL([], [compiler_lib_search_path], [1],
6575 [The library search path used internally by the compiler when linking
6576 a shared library])
6577])# _LT_SYS_HIDDEN_LIBDEPS
6578
6579
6580# _LT_PROG_F77
6581# ------------
6582# Since AC_PROG_F77 is broken, in that it returns the empty string
6583# if there is no fortran compiler, we have our own version here.
6584m4_defun([_LT_PROG_F77],
6585[
6586pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6587AC_PROG_F77
6588if test -z "$F77" || test "X$F77" = "Xno"; then
6589 _lt_disable_F77=yes
6590fi
6591popdef([AC_MSG_ERROR])
6592])# _LT_PROG_F77
6593
6594dnl aclocal-1.4 backwards compatibility:
6595dnl AC_DEFUN([_LT_PROG_F77], [])
6596
6597
6598# _LT_LANG_F77_CONFIG([TAG])
6599# --------------------------
6600# Ensure that the configuration variables for a Fortran 77 compiler are
6601# suitably defined. These variables are subsequently used by _LT_CONFIG
6602# to write the compiler configuration to `libtool'.
6603m4_defun([_LT_LANG_F77_CONFIG],
6604[AC_REQUIRE([_LT_PROG_F77])dnl
6605AC_LANG_PUSH(Fortran 77)
6606
6607_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6608_LT_TAGVAR(allow_undefined_flag, $1)=
6609_LT_TAGVAR(always_export_symbols, $1)=no
6610_LT_TAGVAR(archive_expsym_cmds, $1)=
6611_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6612_LT_TAGVAR(hardcode_direct, $1)=no
6613_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6614_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6615_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6616_LT_TAGVAR(hardcode_libdir_separator, $1)=
6617_LT_TAGVAR(hardcode_minus_L, $1)=no
6618_LT_TAGVAR(hardcode_automatic, $1)=no
6619_LT_TAGVAR(inherit_rpath, $1)=no
6620_LT_TAGVAR(module_cmds, $1)=
6621_LT_TAGVAR(module_expsym_cmds, $1)=
6622_LT_TAGVAR(link_all_deplibs, $1)=unknown
6623_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6624_LT_TAGVAR(no_undefined_flag, $1)=
6625_LT_TAGVAR(whole_archive_flag_spec, $1)=
6626_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6627
6628# Source file extension for f77 test sources.
6629ac_ext=f
6630
6631# Object file extension for compiled f77 test sources.
6632objext=o
6633_LT_TAGVAR(objext, $1)=$objext
6634
6635# No sense in running all these tests if we already determined that
6636# the F77 compiler isn't working. Some variables (like enable_shared)
6637# are currently assumed to apply to all compilers on this platform,
6638# and will be corrupted by setting them based on a non-working compiler.
6639if test "$_lt_disable_F77" != yes; then
6640 # Code to be used in simple compile tests
6641 lt_simple_compile_test_code="\
6642 subroutine t
6643 return
6644 end
6645"
6646
6647 # Code to be used in simple link tests
6648 lt_simple_link_test_code="\
6649 program t
6650 end
6651"
6652
6653 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6654 _LT_TAG_COMPILER
6655
6656 # save warnings/boilerplate of simple test code
6657 _LT_COMPILER_BOILERPLATE
6658 _LT_LINKER_BOILERPLATE
6659
6660 # Allow CC to be a program name with arguments.
6661 lt_save_CC="$CC"
6662 lt_save_GCC=$GCC
6663 CC=${F77-"f77"}
6664 compiler=$CC
6665 _LT_TAGVAR(compiler, $1)=$CC
6666 _LT_CC_BASENAME([$compiler])
6667 GCC=$G77
6668 if test -n "$compiler"; then
6669 AC_MSG_CHECKING([if libtool supports shared libraries])
6670 AC_MSG_RESULT([$can_build_shared])
6671
6672 AC_MSG_CHECKING([whether to build shared libraries])
6673 test "$can_build_shared" = "no" && enable_shared=no
6674
6675 # On AIX, shared libraries and static libraries use the same namespace, and
6676 # are all built from PIC.
6677 case $host_os in
6678 aix3*)
6679 test "$enable_shared" = yes && enable_static=no
6680 if test -n "$RANLIB"; then
6681 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6682 postinstall_cmds='$RANLIB $lib'
6683 fi
6684 ;;
6685 aix[[4-9]]*)
6686 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6687 test "$enable_shared" = yes && enable_static=no
6688 fi
6689 ;;
6690 esac
6691 AC_MSG_RESULT([$enable_shared])
6692
6693 AC_MSG_CHECKING([whether to build static libraries])
6694 # Make sure either enable_shared or enable_static is yes.
6695 test "$enable_shared" = yes || enable_static=yes
6696 AC_MSG_RESULT([$enable_static])
6697
6698 _LT_TAGVAR(GCC, $1)="$G77"
6699 _LT_TAGVAR(LD, $1)="$LD"
6700
6701 ## CAVEAT EMPTOR:
6702 ## There is no encapsulation within the following macros, do not change
6703 ## the running order or otherwise move them around unless you know exactly
6704 ## what you are doing...
6705 _LT_COMPILER_PIC($1)
6706 _LT_COMPILER_C_O($1)
6707 _LT_COMPILER_FILE_LOCKS($1)
6708 _LT_LINKER_SHLIBS($1)
6709 _LT_SYS_DYNAMIC_LINKER($1)
6710 _LT_LINKER_HARDCODE_LIBPATH($1)
6711
6712 _LT_CONFIG($1)
6713 fi # test -n "$compiler"
6714
6715 GCC=$lt_save_GCC
6716 CC="$lt_save_CC"
6717fi # test "$_lt_disable_F77" != yes
6718
6719AC_LANG_POP
6720])# _LT_LANG_F77_CONFIG
6721
6722
6723# _LT_PROG_FC
6724# -----------
6725# Since AC_PROG_FC is broken, in that it returns the empty string
6726# if there is no fortran compiler, we have our own version here.
6727m4_defun([_LT_PROG_FC],
6728[
6729pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6730AC_PROG_FC
6731if test -z "$FC" || test "X$FC" = "Xno"; then
6732 _lt_disable_FC=yes
6733fi
6734popdef([AC_MSG_ERROR])
6735])# _LT_PROG_FC
6736
6737dnl aclocal-1.4 backwards compatibility:
6738dnl AC_DEFUN([_LT_PROG_FC], [])
6739
6740
6741# _LT_LANG_FC_CONFIG([TAG])
6742# -------------------------
6743# Ensure that the configuration variables for a Fortran compiler are
6744# suitably defined. These variables are subsequently used by _LT_CONFIG
6745# to write the compiler configuration to `libtool'.
6746m4_defun([_LT_LANG_FC_CONFIG],
6747[AC_REQUIRE([_LT_PROG_FC])dnl
6748AC_LANG_PUSH(Fortran)
6749
6750_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6751_LT_TAGVAR(allow_undefined_flag, $1)=
6752_LT_TAGVAR(always_export_symbols, $1)=no
6753_LT_TAGVAR(archive_expsym_cmds, $1)=
6754_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6755_LT_TAGVAR(hardcode_direct, $1)=no
6756_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6757_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6758_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6759_LT_TAGVAR(hardcode_libdir_separator, $1)=
6760_LT_TAGVAR(hardcode_minus_L, $1)=no
6761_LT_TAGVAR(hardcode_automatic, $1)=no
6762_LT_TAGVAR(inherit_rpath, $1)=no
6763_LT_TAGVAR(module_cmds, $1)=
6764_LT_TAGVAR(module_expsym_cmds, $1)=
6765_LT_TAGVAR(link_all_deplibs, $1)=unknown
6766_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6767_LT_TAGVAR(no_undefined_flag, $1)=
6768_LT_TAGVAR(whole_archive_flag_spec, $1)=
6769_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6770
6771# Source file extension for fc test sources.
6772ac_ext=${ac_fc_srcext-f}
6773
6774# Object file extension for compiled fc test sources.
6775objext=o
6776_LT_TAGVAR(objext, $1)=$objext
6777
6778# No sense in running all these tests if we already determined that
6779# the FC compiler isn't working. Some variables (like enable_shared)
6780# are currently assumed to apply to all compilers on this platform,
6781# and will be corrupted by setting them based on a non-working compiler.
6782if test "$_lt_disable_FC" != yes; then
6783 # Code to be used in simple compile tests
6784 lt_simple_compile_test_code="\
6785 subroutine t
6786 return
6787 end
6788"
6789
6790 # Code to be used in simple link tests
6791 lt_simple_link_test_code="\
6792 program t
6793 end
6794"
6795
6796 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6797 _LT_TAG_COMPILER
6798
6799 # save warnings/boilerplate of simple test code
6800 _LT_COMPILER_BOILERPLATE
6801 _LT_LINKER_BOILERPLATE
6802
6803 # Allow CC to be a program name with arguments.
6804 lt_save_CC="$CC"
6805 lt_save_GCC=$GCC
6806 CC=${FC-"f95"}
6807 compiler=$CC
6808 GCC=$ac_cv_fc_compiler_gnu
6809
6810 _LT_TAGVAR(compiler, $1)=$CC
6811 _LT_CC_BASENAME([$compiler])
6812
6813 if test -n "$compiler"; then
6814 AC_MSG_CHECKING([if libtool supports shared libraries])
6815 AC_MSG_RESULT([$can_build_shared])
6816
6817 AC_MSG_CHECKING([whether to build shared libraries])
6818 test "$can_build_shared" = "no" && enable_shared=no
6819
6820 # On AIX, shared libraries and static libraries use the same namespace, and
6821 # are all built from PIC.
6822 case $host_os in
6823 aix3*)
6824 test "$enable_shared" = yes && enable_static=no
6825 if test -n "$RANLIB"; then
6826 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6827 postinstall_cmds='$RANLIB $lib'
6828 fi
6829 ;;
6830 aix[[4-9]]*)
6831 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6832 test "$enable_shared" = yes && enable_static=no
6833 fi
6834 ;;
6835 esac
6836 AC_MSG_RESULT([$enable_shared])
6837
6838 AC_MSG_CHECKING([whether to build static libraries])
6839 # Make sure either enable_shared or enable_static is yes.
6840 test "$enable_shared" = yes || enable_static=yes
6841 AC_MSG_RESULT([$enable_static])
6842
6843 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6844 _LT_TAGVAR(LD, $1)="$LD"
6845
6846 ## CAVEAT EMPTOR:
6847 ## There is no encapsulation within the following macros, do not change
6848 ## the running order or otherwise move them around unless you know exactly
6849 ## what you are doing...
6850 _LT_SYS_HIDDEN_LIBDEPS($1)
6851 _LT_COMPILER_PIC($1)
6852 _LT_COMPILER_C_O($1)
6853 _LT_COMPILER_FILE_LOCKS($1)
6854 _LT_LINKER_SHLIBS($1)
6855 _LT_SYS_DYNAMIC_LINKER($1)
6856 _LT_LINKER_HARDCODE_LIBPATH($1)
6857
6858 _LT_CONFIG($1)
6859 fi # test -n "$compiler"
6860
6861 GCC=$lt_save_GCC
6862 CC="$lt_save_CC"
6863fi # test "$_lt_disable_FC" != yes
6864
6865AC_LANG_POP
6866])# _LT_LANG_FC_CONFIG
6867
6868
6869# _LT_LANG_GCJ_CONFIG([TAG])
6870# --------------------------
6871# Ensure that the configuration variables for the GNU Java Compiler compiler
6872# are suitably defined. These variables are subsequently used by _LT_CONFIG
6873# to write the compiler configuration to `libtool'.
6874m4_defun([_LT_LANG_GCJ_CONFIG],
6875[AC_REQUIRE([LT_PROG_GCJ])dnl
6876AC_LANG_SAVE
6877
6878# Source file extension for Java test sources.
6879ac_ext=java
6880
6881# Object file extension for compiled Java test sources.
6882objext=o
6883_LT_TAGVAR(objext, $1)=$objext
6884
6885# Code to be used in simple compile tests
6886lt_simple_compile_test_code="class foo {}"
6887
6888# Code to be used in simple link tests
6889lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6890
6891# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6892_LT_TAG_COMPILER
6893
6894# save warnings/boilerplate of simple test code
6895_LT_COMPILER_BOILERPLATE
6896_LT_LINKER_BOILERPLATE
6897
6898# Allow CC to be a program name with arguments.
6899lt_save_CC="$CC"
6900lt_save_GCC=$GCC
6901GCC=yes
6902CC=${GCJ-"gcj"}
6903compiler=$CC
6904_LT_TAGVAR(compiler, $1)=$CC
6905_LT_TAGVAR(LD, $1)="$LD"
6906_LT_CC_BASENAME([$compiler])
6907
6908# GCJ did not exist at the time GCC didn't implicitly link libc in.
6909_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6910
6911_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6912
6913## CAVEAT EMPTOR:
6914## There is no encapsulation within the following macros, do not change
6915## the running order or otherwise move them around unless you know exactly
6916## what you are doing...
6917if test -n "$compiler"; then
6918 _LT_COMPILER_NO_RTTI($1)
6919 _LT_COMPILER_PIC($1)
6920 _LT_COMPILER_C_O($1)
6921 _LT_COMPILER_FILE_LOCKS($1)
6922 _LT_LINKER_SHLIBS($1)
6923 _LT_LINKER_HARDCODE_LIBPATH($1)
6924
6925 _LT_CONFIG($1)
6926fi
6927
6928AC_LANG_RESTORE
6929
6930GCC=$lt_save_GCC
6931CC="$lt_save_CC"
6932])# _LT_LANG_GCJ_CONFIG
6933
6934
6935# _LT_LANG_RC_CONFIG([TAG])
6936# -------------------------
6937# Ensure that the configuration variables for the Windows resource compiler
6938# are suitably defined. These variables are subsequently used by _LT_CONFIG
6939# to write the compiler configuration to `libtool'.
6940m4_defun([_LT_LANG_RC_CONFIG],
6941[AC_REQUIRE([LT_PROG_RC])dnl
6942AC_LANG_SAVE
6943
6944# Source file extension for RC test sources.
6945ac_ext=rc
6946
6947# Object file extension for compiled RC test sources.
6948objext=o
6949_LT_TAGVAR(objext, $1)=$objext
6950
6951# Code to be used in simple compile tests
6952lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6953
6954# Code to be used in simple link tests
6955lt_simple_link_test_code="$lt_simple_compile_test_code"
6956
6957# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6958_LT_TAG_COMPILER
6959
6960# save warnings/boilerplate of simple test code
6961_LT_COMPILER_BOILERPLATE
6962_LT_LINKER_BOILERPLATE
6963
6964# Allow CC to be a program name with arguments.
6965lt_save_CC="$CC"
6966lt_save_GCC=$GCC
6967GCC=
6968CC=${RC-"windres"}
6969compiler=$CC
6970_LT_TAGVAR(compiler, $1)=$CC
6971_LT_CC_BASENAME([$compiler])
6972_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6973
6974if test -n "$compiler"; then
6975 :
6976 _LT_CONFIG($1)
6977fi
6978
6979GCC=$lt_save_GCC
6980AC_LANG_RESTORE
6981CC="$lt_save_CC"
6982])# _LT_LANG_RC_CONFIG
6983
6984
6985# LT_PROG_GCJ
6986# -----------
6987AC_DEFUN([LT_PROG_GCJ],
6988[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6989 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6990 [AC_CHECK_TOOL(GCJ, gcj,)
6991 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6992 AC_SUBST(GCJFLAGS)])])[]dnl
6993])
6994
6995# Old name:
6996AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6997dnl aclocal-1.4 backwards compatibility:
6998dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6999
7000
7001# LT_PROG_RC
7002# ----------
7003AC_DEFUN([LT_PROG_RC],
7004[AC_CHECK_TOOL(RC, windres,)
7005])
7006
7007# Old name:
7008AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7009dnl aclocal-1.4 backwards compatibility:
7010dnl AC_DEFUN([LT_AC_PROG_RC], [])
7011
7012
7013# _LT_DECL_EGREP
7014# --------------
7015# If we don't have a new enough Autoconf to choose the best grep
7016# available, choose the one first in the user's PATH.
7017m4_defun([_LT_DECL_EGREP],
7018[AC_REQUIRE([AC_PROG_EGREP])dnl
7019AC_REQUIRE([AC_PROG_FGREP])dnl
7020test -z "$GREP" && GREP=grep
7021_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7022_LT_DECL([], [EGREP], [1], [An ERE matcher])
7023_LT_DECL([], [FGREP], [1], [A literal string matcher])
7024dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7025AC_SUBST([GREP])
7026])
7027
7028
7029# _LT_DECL_OBJDUMP
7030# --------------
7031# If we don't have a new enough Autoconf to choose the best objdump
7032# available, choose the one first in the user's PATH.
7033m4_defun([_LT_DECL_OBJDUMP],
7034[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7035test -z "$OBJDUMP" && OBJDUMP=objdump
7036_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7037AC_SUBST([OBJDUMP])
7038])
7039
7040
7041# _LT_DECL_SED
7042# ------------
7043# Check for a fully-functional sed program, that truncates
7044# as few characters as possible. Prefer GNU sed if found.
7045m4_defun([_LT_DECL_SED],
7046[AC_PROG_SED
7047test -z "$SED" && SED=sed
7048Xsed="$SED -e 1s/^X//"
7049_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7050_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7051 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7052])# _LT_DECL_SED
7053
7054m4_ifndef([AC_PROG_SED], [
7055############################################################
7056# NOTE: This macro has been submitted for inclusion into #
7057# GNU Autoconf as AC_PROG_SED. When it is available in #
7058# a released version of Autoconf we should remove this #
7059# macro and use it instead. #
7060############################################################
7061
7062m4_defun([AC_PROG_SED],
7063[AC_MSG_CHECKING([for a sed that does not truncate output])
7064AC_CACHE_VAL(lt_cv_path_SED,
7065[# Loop through the user's path and test for sed and gsed.
7066# Then use that list of sed's as ones to test for truncation.
7067as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7068for as_dir in $PATH
7069do
7070 IFS=$as_save_IFS
7071 test -z "$as_dir" && as_dir=.
7072 for lt_ac_prog in sed gsed; do
7073 for ac_exec_ext in '' $ac_executable_extensions; do
7074 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7075 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7076 fi
7077 done
7078 done
7079done
7080IFS=$as_save_IFS
7081lt_ac_max=0
7082lt_ac_count=0
7083# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7084# along with /bin/sed that truncates output.
7085for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7086 test ! -f $lt_ac_sed && continue
7087 cat /dev/null > conftest.in
7088 lt_ac_count=0
7089 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7090 # Check for GNU sed and select it if it is found.
7091 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7092 lt_cv_path_SED=$lt_ac_sed
7093 break
7094 fi
7095 while true; do
7096 cat conftest.in conftest.in >conftest.tmp
7097 mv conftest.tmp conftest.in
7098 cp conftest.in conftest.nl
7099 echo >>conftest.nl
7100 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7101 cmp -s conftest.out conftest.nl || break
7102 # 10000 chars as input seems more than enough
7103 test $lt_ac_count -gt 10 && break
7104 lt_ac_count=`expr $lt_ac_count + 1`
7105 if test $lt_ac_count -gt $lt_ac_max; then
7106 lt_ac_max=$lt_ac_count
7107 lt_cv_path_SED=$lt_ac_sed
7108 fi
7109 done
7110done
7111])
7112SED=$lt_cv_path_SED
7113AC_SUBST([SED])
7114AC_MSG_RESULT([$SED])
7115])#AC_PROG_SED
7116])#m4_ifndef
7117
7118# Old name:
7119AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7120dnl aclocal-1.4 backwards compatibility:
7121dnl AC_DEFUN([LT_AC_PROG_SED], [])
7122
7123
7124# _LT_CHECK_SHELL_FEATURES
7125# ------------------------
7126# Find out whether the shell is Bourne or XSI compatible,
7127# or has some other useful features.
7128m4_defun([_LT_CHECK_SHELL_FEATURES],
7129[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7130# Try some XSI features
7131xsi_shell=no
7132( _lt_dummy="a/b/c"
7133 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7134 = c,a/b,, \
7135 && eval 'test $(( 1 + 1 )) -eq 2 \
7136 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7137 && xsi_shell=yes
7138AC_MSG_RESULT([$xsi_shell])
7139_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7140
7141AC_MSG_CHECKING([whether the shell understands "+="])
7142lt_shell_append=no
7143( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7144 >/dev/null 2>&1 \
7145 && lt_shell_append=yes
7146AC_MSG_RESULT([$lt_shell_append])
7147_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7148
7149if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7150 lt_unset=unset
7151else
7152 lt_unset=false
7153fi
7154_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7155
7156# test EBCDIC or ASCII
7157case `echo X|tr X '\101'` in
7158 A) # ASCII based system
7159 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7160 lt_SP2NL='tr \040 \012'
7161 lt_NL2SP='tr \015\012 \040\040'
7162 ;;
7163 *) # EBCDIC based system
7164 lt_SP2NL='tr \100 \n'
7165 lt_NL2SP='tr \r\n \100\100'
7166 ;;
7167esac
7168_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7169_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7170])# _LT_CHECK_SHELL_FEATURES
7171
7172
7173# _LT_PROG_XSI_SHELLFNS
7174# ---------------------
7175# Bourne and XSI compatible variants of some useful shell functions.
7176m4_defun([_LT_PROG_XSI_SHELLFNS],
7177[case $xsi_shell in
7178 yes)
7179 cat << \_LT_EOF >> "$cfgfile"
7180
7181# func_dirname file append nondir_replacement
7182# Compute the dirname of FILE. If nonempty, add APPEND to the result,
7183# otherwise set result to NONDIR_REPLACEMENT.
7184func_dirname ()
7185{
7186 case ${1} in
7187 */*) func_dirname_result="${1%/*}${2}" ;;
7188 * ) func_dirname_result="${3}" ;;
7189 esac
7190}
7191
7192# func_basename file
7193func_basename ()
7194{
7195 func_basename_result="${1##*/}"
7196}
7197
7198# func_dirname_and_basename file append nondir_replacement
7199# perform func_basename and func_dirname in a single function
7200# call:
7201# dirname: Compute the dirname of FILE. If nonempty,
7202# add APPEND to the result, otherwise set result
7203# to NONDIR_REPLACEMENT.
7204# value returned in "$func_dirname_result"
7205# basename: Compute filename of FILE.
7206# value retuned in "$func_basename_result"
7207# Implementation must be kept synchronized with func_dirname
7208# and func_basename. For efficiency, we do not delegate to
7209# those functions but instead duplicate the functionality here.
7210func_dirname_and_basename ()
7211{
7212 case ${1} in
7213 */*) func_dirname_result="${1%/*}${2}" ;;
7214 * ) func_dirname_result="${3}" ;;
7215 esac
7216 func_basename_result="${1##*/}"
7217}
7218
7219# func_stripname prefix suffix name
7220# strip PREFIX and SUFFIX off of NAME.
7221# PREFIX and SUFFIX must not contain globbing or regex special
7222# characters, hashes, percent signs, but SUFFIX may contain a leading
7223# dot (in which case that matches only a dot).
7224func_stripname ()
7225{
7226 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7227 # positional parameters, so assign one to ordinary parameter first.
7228 func_stripname_result=${3}
7229 func_stripname_result=${func_stripname_result#"${1}"}
7230 func_stripname_result=${func_stripname_result%"${2}"}
7231}
7232
7233# func_opt_split
7234func_opt_split ()
7235{
7236 func_opt_split_opt=${1%%=*}
7237 func_opt_split_arg=${1#*=}
7238}
7239
7240# func_lo2o object
7241func_lo2o ()
7242{
7243 case ${1} in
7244 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7245 *) func_lo2o_result=${1} ;;
7246 esac
7247}
7248
7249# func_xform libobj-or-source
7250func_xform ()
7251{
7252 func_xform_result=${1%.*}.lo
7253}
7254
7255# func_arith arithmetic-term...
7256func_arith ()
7257{
7258 func_arith_result=$(( $[*] ))
7259}
7260
7261# func_len string
7262# STRING may not start with a hyphen.
7263func_len ()
7264{
7265 func_len_result=${#1}
7266}
7267
7268_LT_EOF
7269 ;;
7270 *) # Bourne compatible functions.
7271 cat << \_LT_EOF >> "$cfgfile"
7272
7273# func_dirname file append nondir_replacement
7274# Compute the dirname of FILE. If nonempty, add APPEND to the result,
7275# otherwise set result to NONDIR_REPLACEMENT.
7276func_dirname ()
7277{
7278 # Extract subdirectory from the argument.
7279 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7280 if test "X$func_dirname_result" = "X${1}"; then
7281 func_dirname_result="${3}"
7282 else
7283 func_dirname_result="$func_dirname_result${2}"
7284 fi
7285}
7286
7287# func_basename file
7288func_basename ()
7289{
7290 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7291}
7292
7293dnl func_dirname_and_basename
7294dnl A portable version of this function is already defined in general.m4sh
7295dnl so there is no need for it here.
7296
7297# func_stripname prefix suffix name
7298# strip PREFIX and SUFFIX off of NAME.
7299# PREFIX and SUFFIX must not contain globbing or regex special
7300# characters, hashes, percent signs, but SUFFIX may contain a leading
7301# dot (in which case that matches only a dot).
7302# func_strip_suffix prefix name
7303func_stripname ()
7304{
7305 case ${2} in
7306 .*) func_stripname_result=`$ECHO "X${3}" \
7307 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7308 *) func_stripname_result=`$ECHO "X${3}" \
7309 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7310 esac
7311}
7312
7313# sed scripts:
7314my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7315my_sed_long_arg='1s/^-[[^=]]*=//'
7316
7317# func_opt_split
7318func_opt_split ()
7319{
7320 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7321 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7322}
7323
7324# func_lo2o object
7325func_lo2o ()
7326{
7327 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7328}
7329
7330# func_xform libobj-or-source
7331func_xform ()
7332{
7333 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7334}
7335
7336# func_arith arithmetic-term...
7337func_arith ()
7338{
7339 func_arith_result=`expr "$[@]"`
7340}
7341
7342# func_len string
7343# STRING may not start with a hyphen.
7344func_len ()
7345{
7346 func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7347}
7348
7349_LT_EOF
7350esac
7351
7352case $lt_shell_append in
7353 yes)
7354 cat << \_LT_EOF >> "$cfgfile"
7355
7356# func_append var value
7357# Append VALUE to the end of shell variable VAR.
7358func_append ()
7359{
7360 eval "$[1]+=\$[2]"
7361}
7362_LT_EOF
7363 ;;
7364 *)
7365 cat << \_LT_EOF >> "$cfgfile"
7366
7367# func_append var value
7368# Append VALUE to the end of shell variable VAR.
7369func_append ()
7370{
7371 eval "$[1]=\$$[1]\$[2]"
7372}
7373
7374_LT_EOF
7375 ;;
7376 esac
7377])
diff --git a/libraries/embryo/m4/ltoptions.m4 b/libraries/embryo/m4/ltoptions.m4
new file mode 100644
index 0000000..34151a3
--- /dev/null
+++ b/libraries/embryo/m4/ltoptions.m4
@@ -0,0 +1,368 @@
1# Helper functions for option handling. -*- Autoconf -*-
2#
3# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
4# Written by Gary V. Vaughan, 2004
5#
6# This file is free software; the Free Software Foundation gives
7# unlimited permission to copy and/or distribute it, with or without
8# modifications, as long as this notice is preserved.
9
10# serial 6 ltoptions.m4
11
12# This is to help aclocal find these macros, as it can't see m4_define.
13AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
14
15
16# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
17# ------------------------------------------
18m4_define([_LT_MANGLE_OPTION],
19[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
20
21
22# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
23# ---------------------------------------
24# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
25# matching handler defined, dispatch to it. Other OPTION-NAMEs are
26# saved as a flag.
27m4_define([_LT_SET_OPTION],
28[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
29m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
30 _LT_MANGLE_DEFUN([$1], [$2]),
31 [m4_warning([Unknown $1 option `$2'])])[]dnl
32])
33
34
35# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
36# ------------------------------------------------------------
37# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
38m4_define([_LT_IF_OPTION],
39[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
40
41
42# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
43# -------------------------------------------------------
44# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
45# are set.
46m4_define([_LT_UNLESS_OPTIONS],
47[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
48 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
49 [m4_define([$0_found])])])[]dnl
50m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
51])[]dnl
52])
53
54
55# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
56# ----------------------------------------
57# OPTION-LIST is a space-separated list of Libtool options associated
58# with MACRO-NAME. If any OPTION has a matching handler declared with
59# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
60# the unknown option and exit.
61m4_defun([_LT_SET_OPTIONS],
62[# Set options
63m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
64 [_LT_SET_OPTION([$1], _LT_Option)])
65
66m4_if([$1],[LT_INIT],[
67 dnl
68 dnl Simply set some default values (i.e off) if boolean options were not
69 dnl specified:
70 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
71 ])
72 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
73 ])
74 dnl
75 dnl If no reference was made to various pairs of opposing options, then
76 dnl we run the default mode handler for the pair. For example, if neither
77 dnl `shared' nor `disable-shared' was passed, we enable building of shared
78 dnl archives by default:
79 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
81 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
82 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
83 [_LT_ENABLE_FAST_INSTALL])
84 ])
85])# _LT_SET_OPTIONS
86
87
88## --------------------------------- ##
89## Macros to handle LT_INIT options. ##
90## --------------------------------- ##
91
92# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
93# -----------------------------------------
94m4_define([_LT_MANGLE_DEFUN],
95[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
96
97
98# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
99# -----------------------------------------------
100m4_define([LT_OPTION_DEFINE],
101[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
102])# LT_OPTION_DEFINE
103
104
105# dlopen
106# ------
107LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
108])
109
110AU_DEFUN([AC_LIBTOOL_DLOPEN],
111[_LT_SET_OPTION([LT_INIT], [dlopen])
112AC_DIAGNOSE([obsolete],
113[$0: Remove this warning and the call to _LT_SET_OPTION when you
114put the `dlopen' option into LT_INIT's first parameter.])
115])
116
117dnl aclocal-1.4 backwards compatibility:
118dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
119
120
121# win32-dll
122# ---------
123# Declare package support for building win32 dll's.
124LT_OPTION_DEFINE([LT_INIT], [win32-dll],
125[enable_win32_dll=yes
126
127case $host in
128*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
129 AC_CHECK_TOOL(AS, as, false)
130 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
131 AC_CHECK_TOOL(OBJDUMP, objdump, false)
132 ;;
133esac
134
135test -z "$AS" && AS=as
136_LT_DECL([], [AS], [0], [Assembler program])dnl
137
138test -z "$DLLTOOL" && DLLTOOL=dlltool
139_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
140
141test -z "$OBJDUMP" && OBJDUMP=objdump
142_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
143])# win32-dll
144
145AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
146[AC_REQUIRE([AC_CANONICAL_HOST])dnl
147_LT_SET_OPTION([LT_INIT], [win32-dll])
148AC_DIAGNOSE([obsolete],
149[$0: Remove this warning and the call to _LT_SET_OPTION when you
150put the `win32-dll' option into LT_INIT's first parameter.])
151])
152
153dnl aclocal-1.4 backwards compatibility:
154dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
155
156
157# _LT_ENABLE_SHARED([DEFAULT])
158# ----------------------------
159# implement the --enable-shared flag, and supports the `shared' and
160# `disable-shared' LT_INIT options.
161# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
162m4_define([_LT_ENABLE_SHARED],
163[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
164AC_ARG_ENABLE([shared],
165 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
166 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
167 [p=${PACKAGE-default}
168 case $enableval in
169 yes) enable_shared=yes ;;
170 no) enable_shared=no ;;
171 *)
172 enable_shared=no
173 # Look at the argument we got. We use all the common list separators.
174 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
175 for pkg in $enableval; do
176 IFS="$lt_save_ifs"
177 if test "X$pkg" = "X$p"; then
178 enable_shared=yes
179 fi
180 done
181 IFS="$lt_save_ifs"
182 ;;
183 esac],
184 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
185
186 _LT_DECL([build_libtool_libs], [enable_shared], [0],
187 [Whether or not to build shared libraries])
188])# _LT_ENABLE_SHARED
189
190LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
191LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
192
193# Old names:
194AC_DEFUN([AC_ENABLE_SHARED],
195[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
196])
197
198AC_DEFUN([AC_DISABLE_SHARED],
199[_LT_SET_OPTION([LT_INIT], [disable-shared])
200])
201
202AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
203AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
204
205dnl aclocal-1.4 backwards compatibility:
206dnl AC_DEFUN([AM_ENABLE_SHARED], [])
207dnl AC_DEFUN([AM_DISABLE_SHARED], [])
208
209
210
211# _LT_ENABLE_STATIC([DEFAULT])
212# ----------------------------
213# implement the --enable-static flag, and support the `static' and
214# `disable-static' LT_INIT options.
215# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
216m4_define([_LT_ENABLE_STATIC],
217[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
218AC_ARG_ENABLE([static],
219 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
220 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
221 [p=${PACKAGE-default}
222 case $enableval in
223 yes) enable_static=yes ;;
224 no) enable_static=no ;;
225 *)
226 enable_static=no
227 # Look at the argument we got. We use all the common list separators.
228 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
229 for pkg in $enableval; do
230 IFS="$lt_save_ifs"
231 if test "X$pkg" = "X$p"; then
232 enable_static=yes
233 fi
234 done
235 IFS="$lt_save_ifs"
236 ;;
237 esac],
238 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
239
240 _LT_DECL([build_old_libs], [enable_static], [0],
241 [Whether or not to build static libraries])
242])# _LT_ENABLE_STATIC
243
244LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
245LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
246
247# Old names:
248AC_DEFUN([AC_ENABLE_STATIC],
249[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
250])
251
252AC_DEFUN([AC_DISABLE_STATIC],
253[_LT_SET_OPTION([LT_INIT], [disable-static])
254])
255
256AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
257AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
258
259dnl aclocal-1.4 backwards compatibility:
260dnl AC_DEFUN([AM_ENABLE_STATIC], [])
261dnl AC_DEFUN([AM_DISABLE_STATIC], [])
262
263
264
265# _LT_ENABLE_FAST_INSTALL([DEFAULT])
266# ----------------------------------
267# implement the --enable-fast-install flag, and support the `fast-install'
268# and `disable-fast-install' LT_INIT options.
269# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
270m4_define([_LT_ENABLE_FAST_INSTALL],
271[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
272AC_ARG_ENABLE([fast-install],
273 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
274 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
275 [p=${PACKAGE-default}
276 case $enableval in
277 yes) enable_fast_install=yes ;;
278 no) enable_fast_install=no ;;
279 *)
280 enable_fast_install=no
281 # Look at the argument we got. We use all the common list separators.
282 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
283 for pkg in $enableval; do
284 IFS="$lt_save_ifs"
285 if test "X$pkg" = "X$p"; then
286 enable_fast_install=yes
287 fi
288 done
289 IFS="$lt_save_ifs"
290 ;;
291 esac],
292 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
293
294_LT_DECL([fast_install], [enable_fast_install], [0],
295 [Whether or not to optimize for fast installation])dnl
296])# _LT_ENABLE_FAST_INSTALL
297
298LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
299LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
300
301# Old names:
302AU_DEFUN([AC_ENABLE_FAST_INSTALL],
303[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
304AC_DIAGNOSE([obsolete],
305[$0: Remove this warning and the call to _LT_SET_OPTION when you put
306the `fast-install' option into LT_INIT's first parameter.])
307])
308
309AU_DEFUN([AC_DISABLE_FAST_INSTALL],
310[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
311AC_DIAGNOSE([obsolete],
312[$0: Remove this warning and the call to _LT_SET_OPTION when you put
313the `disable-fast-install' option into LT_INIT's first parameter.])
314])
315
316dnl aclocal-1.4 backwards compatibility:
317dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
318dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
319
320
321# _LT_WITH_PIC([MODE])
322# --------------------
323# implement the --with-pic flag, and support the `pic-only' and `no-pic'
324# LT_INIT options.
325# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
326m4_define([_LT_WITH_PIC],
327[AC_ARG_WITH([pic],
328 [AS_HELP_STRING([--with-pic],
329 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
330 [pic_mode="$withval"],
331 [pic_mode=default])
332
333test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
334
335_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
336])# _LT_WITH_PIC
337
338LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
339LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
340
341# Old name:
342AU_DEFUN([AC_LIBTOOL_PICMODE],
343[_LT_SET_OPTION([LT_INIT], [pic-only])
344AC_DIAGNOSE([obsolete],
345[$0: Remove this warning and the call to _LT_SET_OPTION when you
346put the `pic-only' option into LT_INIT's first parameter.])
347])
348
349dnl aclocal-1.4 backwards compatibility:
350dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
351
352## ----------------- ##
353## LTDL_INIT Options ##
354## ----------------- ##
355
356m4_define([_LTDL_MODE], [])
357LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
358 [m4_define([_LTDL_MODE], [nonrecursive])])
359LT_OPTION_DEFINE([LTDL_INIT], [recursive],
360 [m4_define([_LTDL_MODE], [recursive])])
361LT_OPTION_DEFINE([LTDL_INIT], [subproject],
362 [m4_define([_LTDL_MODE], [subproject])])
363
364m4_define([_LTDL_TYPE], [])
365LT_OPTION_DEFINE([LTDL_INIT], [installable],
366 [m4_define([_LTDL_TYPE], [installable])])
367LT_OPTION_DEFINE([LTDL_INIT], [convenience],
368 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/libraries/embryo/m4/ltsugar.m4 b/libraries/embryo/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/libraries/embryo/m4/ltsugar.m4
@@ -0,0 +1,123 @@
1# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
2#
3# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
4# Written by Gary V. Vaughan, 2004
5#
6# This file is free software; the Free Software Foundation gives
7# unlimited permission to copy and/or distribute it, with or without
8# modifications, as long as this notice is preserved.
9
10# serial 6 ltsugar.m4
11
12# This is to help aclocal find these macros, as it can't see m4_define.
13AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
14
15
16# lt_join(SEP, ARG1, [ARG2...])
17# -----------------------------
18# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
19# associated separator.
20# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
21# versions in m4sugar had bugs.
22m4_define([lt_join],
23[m4_if([$#], [1], [],
24 [$#], [2], [[$2]],
25 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
26m4_define([_lt_join],
27[m4_if([$#$2], [2], [],
28 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
29
30
31# lt_car(LIST)
32# lt_cdr(LIST)
33# ------------
34# Manipulate m4 lists.
35# These macros are necessary as long as will still need to support
36# Autoconf-2.59 which quotes differently.
37m4_define([lt_car], [[$1]])
38m4_define([lt_cdr],
39[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
40 [$#], 1, [],
41 [m4_dquote(m4_shift($@))])])
42m4_define([lt_unquote], $1)
43
44
45# lt_append(MACRO-NAME, STRING, [SEPARATOR])
46# ------------------------------------------
47# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
48# Note that neither SEPARATOR nor STRING are expanded; they are appended
49# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
50# No SEPARATOR is output if MACRO-NAME was previously undefined (different
51# than defined and empty).
52#
53# This macro is needed until we can rely on Autoconf 2.62, since earlier
54# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
55m4_define([lt_append],
56[m4_define([$1],
57 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
58
59
60
61# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
62# ----------------------------------------------------------
63# Produce a SEP delimited list of all paired combinations of elements of
64# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
65# has the form PREFIXmINFIXSUFFIXn.
66# Needed until we can rely on m4_combine added in Autoconf 2.62.
67m4_define([lt_combine],
68[m4_if(m4_eval([$# > 3]), [1],
69 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
70[[m4_foreach([_Lt_prefix], [$2],
71 [m4_foreach([_Lt_suffix],
72 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
73 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
74
75
76# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
77# -----------------------------------------------------------------------
78# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
79# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
80m4_define([lt_if_append_uniq],
81[m4_ifdef([$1],
82 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
83 [lt_append([$1], [$2], [$3])$4],
84 [$5])],
85 [lt_append([$1], [$2], [$3])$4])])
86
87
88# lt_dict_add(DICT, KEY, VALUE)
89# -----------------------------
90m4_define([lt_dict_add],
91[m4_define([$1($2)], [$3])])
92
93
94# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
95# --------------------------------------------
96m4_define([lt_dict_add_subkey],
97[m4_define([$1($2:$3)], [$4])])
98
99
100# lt_dict_fetch(DICT, KEY, [SUBKEY])
101# ----------------------------------
102m4_define([lt_dict_fetch],
103[m4_ifval([$3],
104 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
105 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
106
107
108# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
109# -----------------------------------------------------------------
110m4_define([lt_if_dict_fetch],
111[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
112 [$5],
113 [$6])])
114
115
116# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
117# --------------------------------------------------------------
118m4_define([lt_dict_filter],
119[m4_if([$5], [], [],
120 [lt_join(m4_quote(m4_default([$4], [[, ]])),
121 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
122 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
123])
diff --git a/libraries/embryo/m4/ltversion.m4 b/libraries/embryo/m4/ltversion.m4
new file mode 100644
index 0000000..f3c5309
--- /dev/null
+++ b/libraries/embryo/m4/ltversion.m4
@@ -0,0 +1,23 @@
1# ltversion.m4 -- version numbers -*- Autoconf -*-
2#
3# Copyright (C) 2004 Free Software Foundation, Inc.
4# Written by Scott James Remnant, 2004
5#
6# This file is free software; the Free Software Foundation gives
7# unlimited permission to copy and/or distribute it, with or without
8# modifications, as long as this notice is preserved.
9
10# Generated from ltversion.in.
11
12# serial 3017 ltversion.m4
13# This file is part of GNU Libtool
14
15m4_define([LT_PACKAGE_VERSION], [2.2.6b])
16m4_define([LT_PACKAGE_REVISION], [1.3017])
17
18AC_DEFUN([LTVERSION_VERSION],
19[macro_version='2.2.6b'
20macro_revision='1.3017'
21_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
22_LT_DECL(, macro_revision, 0)
23])
diff --git a/libraries/embryo/m4/lt~obsolete.m4 b/libraries/embryo/m4/lt~obsolete.m4
new file mode 100644
index 0000000..637bb20
--- /dev/null
+++ b/libraries/embryo/m4/lt~obsolete.m4
@@ -0,0 +1,92 @@
1# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
2#
3# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
4# Written by Scott James Remnant, 2004.
5#
6# This file is free software; the Free Software Foundation gives
7# unlimited permission to copy and/or distribute it, with or without
8# modifications, as long as this notice is preserved.
9
10# serial 4 lt~obsolete.m4
11
12# These exist entirely to fool aclocal when bootstrapping libtool.
13#
14# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
15# which have later been changed to m4_define as they aren't part of the
16# exported API, or moved to Autoconf or Automake where they belong.
17#
18# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
19# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
20# using a macro with the same name in our local m4/libtool.m4 it'll
21# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
22# and doesn't know about Autoconf macros at all.)
23#
24# So we provide this file, which has a silly filename so it's always
25# included after everything else. This provides aclocal with the
26# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
27# because those macros already exist, or will be overwritten later.
28# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
29#
30# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
31# Yes, that means every name once taken will need to remain here until
32# we give up compatibility with versions before 1.7, at which point
33# we need to keep only those names which we still refer to.
34
35# This is to help aclocal find these macros, as it can't see m4_define.
36AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
37
38m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
39m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
40m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
41m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
42m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
43m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
44m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
45m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
46m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
47m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
48m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
49m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
50m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
51m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
52m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
53m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
54m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
55m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
56m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
57m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
58m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
59m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
60m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
61m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
62m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
63m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
64m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
65m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
66m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
67m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
68m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
69m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
70m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
71m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
72m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
73m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
74m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
75m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
76m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
77m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
78m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
79m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
80m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
81m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
82m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
83m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
84m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
85m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
86m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
87m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
88m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
89m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
91m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
92m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/libraries/embryo/missing b/libraries/embryo/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/libraries/embryo/missing
@@ -0,0 +1,376 @@
1#! /bin/sh
2# Common stub for a few missing GNU programs while installing.
3
4scriptversion=2009-04-28.21; # UTC
5
6# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
7# 2008, 2009 Free Software Foundation, Inc.
8# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28if test $# -eq 0; then
29 echo 1>&2 "Try \`$0 --help' for more information"
30 exit 1
31fi
32
33run=:
34sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
35sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
36
37# In the cases where this matters, `missing' is being run in the
38# srcdir already.
39if test -f configure.ac; then
40 configure_ac=configure.ac
41else
42 configure_ac=configure.in
43fi
44
45msg="missing on your system"
46
47case $1 in
48--run)
49 # Try to run requested program, and just exit if it succeeds.
50 run=
51 shift
52 "$@" && exit 0
53 # Exit code 63 means version mismatch. This often happens
54 # when the user try to use an ancient version of a tool on
55 # a file that requires a minimum version. In this case we
56 # we should proceed has if the program had been absent, or
57 # if --run hadn't been passed.
58 if test $? = 63; then
59 run=:
60 msg="probably too old"
61 fi
62 ;;
63
64 -h|--h|--he|--hel|--help)
65 echo "\
66$0 [OPTION]... PROGRAM [ARGUMENT]...
67
68Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
69error status if there is no known handling for PROGRAM.
70
71Options:
72 -h, --help display this help and exit
73 -v, --version output version information and exit
74 --run try to run the given command, and emulate it if it fails
75
76Supported PROGRAM values:
77 aclocal touch file \`aclocal.m4'
78 autoconf touch file \`configure'
79 autoheader touch file \`config.h.in'
80 autom4te touch the output file, or create a stub one
81 automake touch all \`Makefile.in' files
82 bison create \`y.tab.[ch]', if possible, from existing .[ch]
83 flex create \`lex.yy.c', if possible, from existing .c
84 help2man touch the output file
85 lex create \`lex.yy.c', if possible, from existing .c
86 makeinfo touch the output file
87 tar try tar, gnutar, gtar, then tar without non-portable flags
88 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
89
90Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
91\`g' are ignored when checking the name.
92
93Send bug reports to <bug-automake@gnu.org>."
94 exit $?
95 ;;
96
97 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
98 echo "missing $scriptversion (GNU Automake)"
99 exit $?
100 ;;
101
102 -*)
103 echo 1>&2 "$0: Unknown \`$1' option"
104 echo 1>&2 "Try \`$0 --help' for more information"
105 exit 1
106 ;;
107
108esac
109
110# normalize program name to check for.
111program=`echo "$1" | sed '
112 s/^gnu-//; t
113 s/^gnu//; t
114 s/^g//; t'`
115
116# Now exit if we have it, but it failed. Also exit now if we
117# don't have it and --version was passed (most likely to detect
118# the program). This is about non-GNU programs, so use $1 not
119# $program.
120case $1 in
121 lex*|yacc*)
122 # Not GNU programs, they don't have --version.
123 ;;
124
125 tar*)
126 if test -n "$run"; then
127 echo 1>&2 "ERROR: \`tar' requires --run"
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 exit 1
131 fi
132 ;;
133
134 *)
135 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
136 # We have it, but it failed.
137 exit 1
138 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
139 # Could not run --version or --help. This is probably someone
140 # running `$TOOL --version' or `$TOOL --help' to check whether
141 # $TOOL exists and not knowing $TOOL uses missing.
142 exit 1
143 fi
144 ;;
145esac
146
147# If it does not exist, or fails to run (possibly an outdated version),
148# try to emulate it.
149case $program in
150 aclocal*)
151 echo 1>&2 "\
152WARNING: \`$1' is $msg. You should only need it if
153 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
154 to install the \`Automake' and \`Perl' packages. Grab them from
155 any GNU archive site."
156 touch aclocal.m4
157 ;;
158
159 autoconf*)
160 echo 1>&2 "\
161WARNING: \`$1' is $msg. You should only need it if
162 you modified \`${configure_ac}'. You might want to install the
163 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
164 archive site."
165 touch configure
166 ;;
167
168 autoheader*)
169 echo 1>&2 "\
170WARNING: \`$1' is $msg. You should only need it if
171 you modified \`acconfig.h' or \`${configure_ac}'. You might want
172 to install the \`Autoconf' and \`GNU m4' packages. Grab them
173 from any GNU archive site."
174 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
175 test -z "$files" && files="config.h"
176 touch_files=
177 for f in $files; do
178 case $f in
179 *:*) touch_files="$touch_files "`echo "$f" |
180 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
181 *) touch_files="$touch_files $f.in";;
182 esac
183 done
184 touch $touch_files
185 ;;
186
187 automake*)
188 echo 1>&2 "\
189WARNING: \`$1' is $msg. You should only need it if
190 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
191 You might want to install the \`Automake' and \`Perl' packages.
192 Grab them from any GNU archive site."
193 find . -type f -name Makefile.am -print |
194 sed 's/\.am$/.in/' |
195 while read f; do touch "$f"; done
196 ;;
197
198 autom4te*)
199 echo 1>&2 "\
200WARNING: \`$1' is needed, but is $msg.
201 You might have modified some files without having the
202 proper tools for further handling them.
203 You can get \`$1' as part of \`Autoconf' from any GNU
204 archive site."
205
206 file=`echo "$*" | sed -n "$sed_output"`
207 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
208 if test -f "$file"; then
209 touch $file
210 else
211 test -z "$file" || exec >$file
212 echo "#! /bin/sh"
213 echo "# Created by GNU Automake missing as a replacement of"
214 echo "# $ $@"
215 echo "exit 0"
216 chmod +x $file
217 exit 1
218 fi
219 ;;
220
221 bison*|yacc*)
222 echo 1>&2 "\
223WARNING: \`$1' $msg. You should only need it if
224 you modified a \`.y' file. You may need the \`Bison' package
225 in order for those modifications to take effect. You can get
226 \`Bison' from any GNU archive site."
227 rm -f y.tab.c y.tab.h
228 if test $# -ne 1; then
229 eval LASTARG="\${$#}"
230 case $LASTARG in
231 *.y)
232 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
233 if test -f "$SRCFILE"; then
234 cp "$SRCFILE" y.tab.c
235 fi
236 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
237 if test -f "$SRCFILE"; then
238 cp "$SRCFILE" y.tab.h
239 fi
240 ;;
241 esac
242 fi
243 if test ! -f y.tab.h; then
244 echo >y.tab.h
245 fi
246 if test ! -f y.tab.c; then
247 echo 'main() { return 0; }' >y.tab.c
248 fi
249 ;;
250
251 lex*|flex*)
252 echo 1>&2 "\
253WARNING: \`$1' is $msg. You should only need it if
254 you modified a \`.l' file. You may need the \`Flex' package
255 in order for those modifications to take effect. You can get
256 \`Flex' from any GNU archive site."
257 rm -f lex.yy.c
258 if test $# -ne 1; then
259 eval LASTARG="\${$#}"
260 case $LASTARG in
261 *.l)
262 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
263 if test -f "$SRCFILE"; then
264 cp "$SRCFILE" lex.yy.c
265 fi
266 ;;
267 esac
268 fi
269 if test ! -f lex.yy.c; then
270 echo 'main() { return 0; }' >lex.yy.c
271 fi
272 ;;
273
274 help2man*)
275 echo 1>&2 "\
276WARNING: \`$1' is $msg. You should only need it if
277 you modified a dependency of a manual page. You may need the
278 \`Help2man' package in order for those modifications to take
279 effect. You can get \`Help2man' from any GNU archive site."
280
281 file=`echo "$*" | sed -n "$sed_output"`
282 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
283 if test -f "$file"; then
284 touch $file
285 else
286 test -z "$file" || exec >$file
287 echo ".ab help2man is required to generate this page"
288 exit $?
289 fi
290 ;;
291
292 makeinfo*)
293 echo 1>&2 "\
294WARNING: \`$1' is $msg. You should only need it if
295 you modified a \`.texi' or \`.texinfo' file, or any other file
296 indirectly affecting the aspect of the manual. The spurious
297 call might also be the consequence of using a buggy \`make' (AIX,
298 DU, IRIX). You might want to install the \`Texinfo' package or
299 the \`GNU make' package. Grab either from any GNU archive site."
300 # The file to touch is that specified with -o ...
301 file=`echo "$*" | sed -n "$sed_output"`
302 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
303 if test -z "$file"; then
304 # ... or it is the one specified with @setfilename ...
305 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
306 file=`sed -n '
307 /^@setfilename/{
308 s/.* \([^ ]*\) *$/\1/
309 p
310 q
311 }' $infile`
312 # ... or it is derived from the source name (dir/f.texi becomes f.info)
313 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
314 fi
315 # If the file does not exist, the user really needs makeinfo;
316 # let's fail without touching anything.
317 test -f $file || exit 1
318 touch $file
319 ;;
320
321 tar*)
322 shift
323
324 # We have already tried tar in the generic part.
325 # Look for gnutar/gtar before invocation to avoid ugly error
326 # messages.
327 if (gnutar --version > /dev/null 2>&1); then
328 gnutar "$@" && exit 0
329 fi
330 if (gtar --version > /dev/null 2>&1); then
331 gtar "$@" && exit 0
332 fi
333 firstarg="$1"
334 if shift; then
335 case $firstarg in
336 *o*)
337 firstarg=`echo "$firstarg" | sed s/o//`
338 tar "$firstarg" "$@" && exit 0
339 ;;
340 esac
341 case $firstarg in
342 *h*)
343 firstarg=`echo "$firstarg" | sed s/h//`
344 tar "$firstarg" "$@" && exit 0
345 ;;
346 esac
347 fi
348
349 echo 1>&2 "\
350WARNING: I can't seem to be able to run \`tar' with the given arguments.
351 You may want to install GNU tar or Free paxutils, or check the
352 command line arguments."
353 exit 1
354 ;;
355
356 *)
357 echo 1>&2 "\
358WARNING: \`$1' is needed, and is $msg.
359 You might have modified some files without having the
360 proper tools for further handling them. Check the \`README' file,
361 it often tells you about the needed prerequisites for installing
362 this package. You may also peek at any GNU archive site, in case
363 some other package would contain this missing \`$1' program."
364 exit 1
365 ;;
366esac
367
368exit 0
369
370# Local variables:
371# eval: (add-hook 'write-file-hooks 'time-stamp)
372# time-stamp-start: "scriptversion="
373# time-stamp-format: "%:y-%02m-%02d.%02H"
374# time-stamp-time-zone: "UTC"
375# time-stamp-end: "; # UTC"
376# End:
diff --git a/libraries/embryo/sha1-for-source.txt b/libraries/embryo/sha1-for-source.txt
new file mode 100644
index 0000000..16ae5f0
--- /dev/null
+++ b/libraries/embryo/sha1-for-source.txt
@@ -0,0 +1 @@
f76404fa37f1580cbad2bbc747be9c6d68b7bef3
diff --git a/libraries/embryo/src/Makefile.am b/libraries/embryo/src/Makefile.am
new file mode 100644
index 0000000..a8590b2
--- /dev/null
+++ b/libraries/embryo/src/Makefile.am
@@ -0,0 +1,3 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = lib bin
diff --git a/libraries/embryo/src/Makefile.in b/libraries/embryo/src/Makefile.in
new file mode 100644
index 0000000..7eb44dd
--- /dev/null
+++ b/libraries/embryo/src/Makefile.in
@@ -0,0 +1,589 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
40 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
41 $(top_srcdir)/m4/efl_fnmatch.m4 \
42 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
43 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
44 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
45 $(top_srcdir)/configure.ac
46am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
47 $(ACLOCAL_M4)
48mkinstalldirs = $(install_sh) -d
49CONFIG_HEADER = $(top_builddir)/config.h
50CONFIG_CLEAN_FILES =
51CONFIG_CLEAN_VPATH_FILES =
52AM_V_GEN = $(am__v_GEN_$(V))
53am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
54am__v_GEN_0 = @echo " GEN " $@;
55AM_V_at = $(am__v_at_$(V))
56am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
57am__v_at_0 = @
58SOURCES =
59DIST_SOURCES =
60RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
61 html-recursive info-recursive install-data-recursive \
62 install-dvi-recursive install-exec-recursive \
63 install-html-recursive install-info-recursive \
64 install-pdf-recursive install-ps-recursive install-recursive \
65 installcheck-recursive installdirs-recursive pdf-recursive \
66 ps-recursive uninstall-recursive
67RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
68 distclean-recursive maintainer-clean-recursive
69AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
70 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
71 distdir
72ETAGS = etags
73CTAGS = ctags
74DIST_SUBDIRS = $(SUBDIRS)
75DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
76am__relativize = \
77 dir0=`pwd`; \
78 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
79 sed_rest='s,^[^/]*/*,,'; \
80 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
81 sed_butlast='s,/*[^/]*$$,,'; \
82 while test -n "$$dir1"; do \
83 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
84 if test "$$first" != "."; then \
85 if test "$$first" = ".."; then \
86 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
87 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
88 else \
89 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
90 if test "$$first2" = "$$first"; then \
91 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
92 else \
93 dir2="../$$dir2"; \
94 fi; \
95 dir0="$$dir0"/"$$first"; \
96 fi; \
97 fi; \
98 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
99 done; \
100 reldir="$$dir2"
101ACLOCAL = @ACLOCAL@
102ALLOCA = @ALLOCA@
103AMTAR = @AMTAR@
104AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
105AR = @AR@
106AS = @AS@
107AUTOCONF = @AUTOCONF@
108AUTOHEADER = @AUTOHEADER@
109AUTOMAKE = @AUTOMAKE@
110AWK = @AWK@
111CC = @CC@
112CCDEPMODE = @CCDEPMODE@
113CFLAGS = @CFLAGS@
114CPP = @CPP@
115CPPFLAGS = @CPPFLAGS@
116CYGPATH_W = @CYGPATH_W@
117DEFS = @DEFS@
118DEPDIR = @DEPDIR@
119DLLTOOL = @DLLTOOL@
120DSYMUTIL = @DSYMUTIL@
121DUMPBIN = @DUMPBIN@
122ECHO_C = @ECHO_C@
123ECHO_N = @ECHO_N@
124ECHO_T = @ECHO_T@
125EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
126EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
127EGREP = @EGREP@
128EINA_CFLAGS = @EINA_CFLAGS@
129EINA_LIBS = @EINA_LIBS@
130EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
131EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
132EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
133EVIL_CFLAGS = @EVIL_CFLAGS@
134EVIL_LIBS = @EVIL_LIBS@
135EXEEXT = @EXEEXT@
136FGREP = @FGREP@
137GREP = @GREP@
138INSTALL = @INSTALL@
139INSTALL_DATA = @INSTALL_DATA@
140INSTALL_PROGRAM = @INSTALL_PROGRAM@
141INSTALL_SCRIPT = @INSTALL_SCRIPT@
142INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
143LD = @LD@
144LDFLAGS = @LDFLAGS@
145LIBOBJS = @LIBOBJS@
146LIBS = @LIBS@
147LIBTOOL = @LIBTOOL@
148LIPO = @LIPO@
149LN_S = @LN_S@
150LTLIBOBJS = @LTLIBOBJS@
151MAKEINFO = @MAKEINFO@
152MKDIR_P = @MKDIR_P@
153NM = @NM@
154NMEDIT = @NMEDIT@
155OBJDUMP = @OBJDUMP@
156OBJEXT = @OBJEXT@
157OTOOL = @OTOOL@
158OTOOL64 = @OTOOL64@
159PACKAGE = @PACKAGE@
160PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
161PACKAGE_NAME = @PACKAGE_NAME@
162PACKAGE_STRING = @PACKAGE_STRING@
163PACKAGE_TARNAME = @PACKAGE_TARNAME@
164PACKAGE_URL = @PACKAGE_URL@
165PACKAGE_VERSION = @PACKAGE_VERSION@
166PATH_SEPARATOR = @PATH_SEPARATOR@
167PKG_CONFIG = @PKG_CONFIG@
168PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
169PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
170RANLIB = @RANLIB@
171SED = @SED@
172SET_MAKE = @SET_MAKE@
173SHELL = @SHELL@
174STRIP = @STRIP@
175VERSION = @VERSION@
176VMAJ = @VMAJ@
177abs_builddir = @abs_builddir@
178abs_srcdir = @abs_srcdir@
179abs_top_builddir = @abs_top_builddir@
180abs_top_srcdir = @abs_top_srcdir@
181ac_ct_CC = @ac_ct_CC@
182ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
183am__include = @am__include@
184am__leading_dot = @am__leading_dot@
185am__quote = @am__quote@
186am__tar = @am__tar@
187am__untar = @am__untar@
188bindir = @bindir@
189build = @build@
190build_alias = @build_alias@
191build_cpu = @build_cpu@
192build_os = @build_os@
193build_vendor = @build_vendor@
194builddir = @builddir@
195datadir = @datadir@
196datarootdir = @datarootdir@
197docdir = @docdir@
198dvidir = @dvidir@
199efl_doxygen = @efl_doxygen@
200efl_have_doxygen = @efl_have_doxygen@
201embryoincludedir = @embryoincludedir@
202exec_prefix = @exec_prefix@
203host = @host@
204host_alias = @host_alias@
205host_cpu = @host_cpu@
206host_os = @host_os@
207host_vendor = @host_vendor@
208htmldir = @htmldir@
209includedir = @includedir@
210infodir = @infodir@
211install_sh = @install_sh@
212libdir = @libdir@
213libexecdir = @libexecdir@
214localedir = @localedir@
215localstatedir = @localstatedir@
216lt_ECHO = @lt_ECHO@
217lt_enable_auto_import = @lt_enable_auto_import@
218mandir = @mandir@
219mkdir_p = @mkdir_p@
220oldincludedir = @oldincludedir@
221pdfdir = @pdfdir@
222pkgconfig_requires_private = @pkgconfig_requires_private@
223prefix = @prefix@
224program_transform_name = @program_transform_name@
225psdir = @psdir@
226release_info = @release_info@
227requirement_embryo = @requirement_embryo@
228sbindir = @sbindir@
229sharedstatedir = @sharedstatedir@
230srcdir = @srcdir@
231sysconfdir = @sysconfdir@
232target_alias = @target_alias@
233top_build_prefix = @top_build_prefix@
234top_builddir = @top_builddir@
235top_srcdir = @top_srcdir@
236version_info = @version_info@
237MAINTAINERCLEANFILES = Makefile.in
238SUBDIRS = lib bin
239all: all-recursive
240
241.SUFFIXES:
242$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
243 @for dep in $?; do \
244 case '$(am__configure_deps)' in \
245 *$$dep*) \
246 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
247 && { if test -f $@; then exit 0; else break; fi; }; \
248 exit 1;; \
249 esac; \
250 done; \
251 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
252 $(am__cd) $(top_srcdir) && \
253 $(AUTOMAKE) --gnu src/Makefile
254.PRECIOUS: Makefile
255Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
256 @case '$?' in \
257 *config.status*) \
258 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
259 *) \
260 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
261 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
262 esac;
263
264$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
265 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
266
267$(top_srcdir)/configure: $(am__configure_deps)
268 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
269$(ACLOCAL_M4): $(am__aclocal_m4_deps)
270 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
271$(am__aclocal_m4_deps):
272
273mostlyclean-libtool:
274 -rm -f *.lo
275
276clean-libtool:
277 -rm -rf .libs _libs
278
279# This directory's subdirectories are mostly independent; you can cd
280# into them and run `make' without going through this Makefile.
281# To change the values of `make' variables: instead of editing Makefiles,
282# (1) if the variable is set in `config.status', edit `config.status'
283# (which will cause the Makefiles to be regenerated when you run `make');
284# (2) otherwise, pass the desired values on the `make' command line.
285$(RECURSIVE_TARGETS):
286 @fail= failcom='exit 1'; \
287 for f in x $$MAKEFLAGS; do \
288 case $$f in \
289 *=* | --[!k]*);; \
290 *k*) failcom='fail=yes';; \
291 esac; \
292 done; \
293 dot_seen=no; \
294 target=`echo $@ | sed s/-recursive//`; \
295 list='$(SUBDIRS)'; for subdir in $$list; do \
296 echo "Making $$target in $$subdir"; \
297 if test "$$subdir" = "."; then \
298 dot_seen=yes; \
299 local_target="$$target-am"; \
300 else \
301 local_target="$$target"; \
302 fi; \
303 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
304 || eval $$failcom; \
305 done; \
306 if test "$$dot_seen" = "no"; then \
307 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
308 fi; test -z "$$fail"
309
310$(RECURSIVE_CLEAN_TARGETS):
311 @fail= failcom='exit 1'; \
312 for f in x $$MAKEFLAGS; do \
313 case $$f in \
314 *=* | --[!k]*);; \
315 *k*) failcom='fail=yes';; \
316 esac; \
317 done; \
318 dot_seen=no; \
319 case "$@" in \
320 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
321 *) list='$(SUBDIRS)' ;; \
322 esac; \
323 rev=''; for subdir in $$list; do \
324 if test "$$subdir" = "."; then :; else \
325 rev="$$subdir $$rev"; \
326 fi; \
327 done; \
328 rev="$$rev ."; \
329 target=`echo $@ | sed s/-recursive//`; \
330 for subdir in $$rev; do \
331 echo "Making $$target in $$subdir"; \
332 if test "$$subdir" = "."; then \
333 local_target="$$target-am"; \
334 else \
335 local_target="$$target"; \
336 fi; \
337 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
338 || eval $$failcom; \
339 done && test -z "$$fail"
340tags-recursive:
341 list='$(SUBDIRS)'; for subdir in $$list; do \
342 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
343 done
344ctags-recursive:
345 list='$(SUBDIRS)'; for subdir in $$list; do \
346 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
347 done
348
349ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
350 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
351 unique=`for i in $$list; do \
352 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
353 done | \
354 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
355 END { if (nonempty) { for (i in files) print i; }; }'`; \
356 mkid -fID $$unique
357tags: TAGS
358
359TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
360 $(TAGS_FILES) $(LISP)
361 set x; \
362 here=`pwd`; \
363 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
364 include_option=--etags-include; \
365 empty_fix=.; \
366 else \
367 include_option=--include; \
368 empty_fix=; \
369 fi; \
370 list='$(SUBDIRS)'; for subdir in $$list; do \
371 if test "$$subdir" = .; then :; else \
372 test ! -f $$subdir/TAGS || \
373 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
374 fi; \
375 done; \
376 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
377 unique=`for i in $$list; do \
378 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
379 done | \
380 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
381 END { if (nonempty) { for (i in files) print i; }; }'`; \
382 shift; \
383 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
384 test -n "$$unique" || unique=$$empty_fix; \
385 if test $$# -gt 0; then \
386 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
387 "$$@" $$unique; \
388 else \
389 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
390 $$unique; \
391 fi; \
392 fi
393ctags: CTAGS
394CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
395 $(TAGS_FILES) $(LISP)
396 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
397 unique=`for i in $$list; do \
398 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
399 done | \
400 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
401 END { if (nonempty) { for (i in files) print i; }; }'`; \
402 test -z "$(CTAGS_ARGS)$$unique" \
403 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
404 $$unique
405
406GTAGS:
407 here=`$(am__cd) $(top_builddir) && pwd` \
408 && $(am__cd) $(top_srcdir) \
409 && gtags -i $(GTAGS_ARGS) "$$here"
410
411distclean-tags:
412 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
413
414distdir: $(DISTFILES)
415 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
416 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
417 list='$(DISTFILES)'; \
418 dist_files=`for file in $$list; do echo $$file; done | \
419 sed -e "s|^$$srcdirstrip/||;t" \
420 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
421 case $$dist_files in \
422 */*) $(MKDIR_P) `echo "$$dist_files" | \
423 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
424 sort -u` ;; \
425 esac; \
426 for file in $$dist_files; do \
427 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
428 if test -d $$d/$$file; then \
429 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
430 if test -d "$(distdir)/$$file"; then \
431 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
432 fi; \
433 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
434 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
435 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
436 fi; \
437 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
438 else \
439 test -f "$(distdir)/$$file" \
440 || cp -p $$d/$$file "$(distdir)/$$file" \
441 || exit 1; \
442 fi; \
443 done
444 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
445 if test "$$subdir" = .; then :; else \
446 test -d "$(distdir)/$$subdir" \
447 || $(MKDIR_P) "$(distdir)/$$subdir" \
448 || exit 1; \
449 fi; \
450 done
451 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
452 if test "$$subdir" = .; then :; else \
453 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
454 $(am__relativize); \
455 new_distdir=$$reldir; \
456 dir1=$$subdir; dir2="$(top_distdir)"; \
457 $(am__relativize); \
458 new_top_distdir=$$reldir; \
459 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
460 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
461 ($(am__cd) $$subdir && \
462 $(MAKE) $(AM_MAKEFLAGS) \
463 top_distdir="$$new_top_distdir" \
464 distdir="$$new_distdir" \
465 am__remove_distdir=: \
466 am__skip_length_check=: \
467 am__skip_mode_fix=: \
468 distdir) \
469 || exit 1; \
470 fi; \
471 done
472check-am: all-am
473check: check-recursive
474all-am: Makefile
475installdirs: installdirs-recursive
476installdirs-am:
477install: install-recursive
478install-exec: install-exec-recursive
479install-data: install-data-recursive
480uninstall: uninstall-recursive
481
482install-am: all-am
483 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
484
485installcheck: installcheck-recursive
486install-strip:
487 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
488 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
489 `test -z '$(STRIP)' || \
490 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
491mostlyclean-generic:
492
493clean-generic:
494
495distclean-generic:
496 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
497 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
498
499maintainer-clean-generic:
500 @echo "This command is intended for maintainers to use"
501 @echo "it deletes files that may require special tools to rebuild."
502 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
503clean: clean-recursive
504
505clean-am: clean-generic clean-libtool mostlyclean-am
506
507distclean: distclean-recursive
508 -rm -f Makefile
509distclean-am: clean-am distclean-generic distclean-tags
510
511dvi: dvi-recursive
512
513dvi-am:
514
515html: html-recursive
516
517html-am:
518
519info: info-recursive
520
521info-am:
522
523install-data-am:
524
525install-dvi: install-dvi-recursive
526
527install-dvi-am:
528
529install-exec-am:
530
531install-html: install-html-recursive
532
533install-html-am:
534
535install-info: install-info-recursive
536
537install-info-am:
538
539install-man:
540
541install-pdf: install-pdf-recursive
542
543install-pdf-am:
544
545install-ps: install-ps-recursive
546
547install-ps-am:
548
549installcheck-am:
550
551maintainer-clean: maintainer-clean-recursive
552 -rm -f Makefile
553maintainer-clean-am: distclean-am maintainer-clean-generic
554
555mostlyclean: mostlyclean-recursive
556
557mostlyclean-am: mostlyclean-generic mostlyclean-libtool
558
559pdf: pdf-recursive
560
561pdf-am:
562
563ps: ps-recursive
564
565ps-am:
566
567uninstall-am:
568
569.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
570 install-am install-strip tags-recursive
571
572.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
573 all all-am check check-am clean clean-generic clean-libtool \
574 ctags ctags-recursive distclean distclean-generic \
575 distclean-libtool distclean-tags distdir dvi dvi-am html \
576 html-am info info-am install install-am install-data \
577 install-data-am install-dvi install-dvi-am install-exec \
578 install-exec-am install-html install-html-am install-info \
579 install-info-am install-man install-pdf install-pdf-am \
580 install-ps install-ps-am install-strip installcheck \
581 installcheck-am installdirs installdirs-am maintainer-clean \
582 maintainer-clean-generic mostlyclean mostlyclean-generic \
583 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
584 uninstall uninstall-am
585
586
587# Tell versions [3.59,3.63) of GNU make to not export all variables.
588# Otherwise a system limit (for SysV at least) may be exceeded.
589.NOEXPORT:
diff --git a/libraries/embryo/src/bin/Makefile.am b/libraries/embryo/src/bin/Makefile.am
new file mode 100644
index 0000000..09f6ffd
--- /dev/null
+++ b/libraries/embryo/src/bin/Makefile.am
@@ -0,0 +1,40 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir) \
8-I$(top_builddir) \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@ \
13@EVIL_CFLAGS@
14
15bin_PROGRAMS = @EMBRYO_CC_PRG@
16EXTRA_PROGRAMS = embryo_cc
17
18embryo_cc_SOURCES = \
19embryo_cc_amx.h \
20embryo_cc_sc.h \
21embryo_cc_sc1.c \
22embryo_cc_sc2.c \
23embryo_cc_sc3.c \
24embryo_cc_sc4.c \
25embryo_cc_sc5.c \
26embryo_cc_sc6.c \
27embryo_cc_sc7.c \
28embryo_cc_scexpand.c \
29embryo_cc_sclist.c \
30embryo_cc_scvars.c \
31embryo_cc_prefix.c \
32embryo_cc_prefix.h
33
34embryo_cc_CFLAGS = @EMBRYO_CFLAGS@
35embryo_cc_LDADD = $(top_builddir)/src/lib/libembryo.la @EVIL_LIBS@ @EINA_LIBS@ -lm
36embryo_cc_LDFLAGS = @lt_enable_auto_import@
37
38EXTRA_DIST = \
39embryo_cc_sc5.scp \
40embryo_cc_sc7.scp
diff --git a/libraries/embryo/src/bin/Makefile.in b/libraries/embryo/src/bin/Makefile.in
new file mode 100644
index 0000000..40d0ef9
--- /dev/null
+++ b/libraries/embryo/src/bin/Makefile.in
@@ -0,0 +1,787 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37EXTRA_PROGRAMS = embryo_cc$(EXEEXT)
38subdir = src/bin
39DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
42 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
45 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
46 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
47 $(top_srcdir)/configure.ac
48am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
49 $(ACLOCAL_M4)
50mkinstalldirs = $(install_sh) -d
51CONFIG_HEADER = $(top_builddir)/config.h
52CONFIG_CLEAN_FILES =
53CONFIG_CLEAN_VPATH_FILES =
54am__installdirs = "$(DESTDIR)$(bindir)"
55PROGRAMS = $(bin_PROGRAMS)
56am_embryo_cc_OBJECTS = embryo_cc-embryo_cc_sc1.$(OBJEXT) \
57 embryo_cc-embryo_cc_sc2.$(OBJEXT) \
58 embryo_cc-embryo_cc_sc3.$(OBJEXT) \
59 embryo_cc-embryo_cc_sc4.$(OBJEXT) \
60 embryo_cc-embryo_cc_sc5.$(OBJEXT) \
61 embryo_cc-embryo_cc_sc6.$(OBJEXT) \
62 embryo_cc-embryo_cc_sc7.$(OBJEXT) \
63 embryo_cc-embryo_cc_scexpand.$(OBJEXT) \
64 embryo_cc-embryo_cc_sclist.$(OBJEXT) \
65 embryo_cc-embryo_cc_scvars.$(OBJEXT) \
66 embryo_cc-embryo_cc_prefix.$(OBJEXT)
67embryo_cc_OBJECTS = $(am_embryo_cc_OBJECTS)
68embryo_cc_DEPENDENCIES = $(top_builddir)/src/lib/libembryo.la
69AM_V_lt = $(am__v_lt_$(V))
70am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
71am__v_lt_0 = --silent
72embryo_cc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
73 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(embryo_cc_CFLAGS) \
74 $(CFLAGS) $(embryo_cc_LDFLAGS) $(LDFLAGS) -o $@
75DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
76depcomp = $(SHELL) $(top_srcdir)/depcomp
77am__depfiles_maybe = depfiles
78am__mv = mv -f
79COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
80 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
81LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
82 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
83 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
84 $(AM_CFLAGS) $(CFLAGS)
85AM_V_CC = $(am__v_CC_$(V))
86am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
87am__v_CC_0 = @echo " CC " $@;
88AM_V_at = $(am__v_at_$(V))
89am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
90am__v_at_0 = @
91CCLD = $(CC)
92LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
93 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
94 $(AM_LDFLAGS) $(LDFLAGS) -o $@
95AM_V_CCLD = $(am__v_CCLD_$(V))
96am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
97am__v_CCLD_0 = @echo " CCLD " $@;
98AM_V_GEN = $(am__v_GEN_$(V))
99am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
100am__v_GEN_0 = @echo " GEN " $@;
101SOURCES = $(embryo_cc_SOURCES)
102DIST_SOURCES = $(embryo_cc_SOURCES)
103ETAGS = etags
104CTAGS = ctags
105DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
106ACLOCAL = @ACLOCAL@
107ALLOCA = @ALLOCA@
108AMTAR = @AMTAR@
109AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
110AR = @AR@
111AS = @AS@
112AUTOCONF = @AUTOCONF@
113AUTOHEADER = @AUTOHEADER@
114AUTOMAKE = @AUTOMAKE@
115AWK = @AWK@
116CC = @CC@
117CCDEPMODE = @CCDEPMODE@
118CFLAGS = @CFLAGS@
119CPP = @CPP@
120CPPFLAGS = @CPPFLAGS@
121CYGPATH_W = @CYGPATH_W@
122DEFS = @DEFS@
123DEPDIR = @DEPDIR@
124DLLTOOL = @DLLTOOL@
125DSYMUTIL = @DSYMUTIL@
126DUMPBIN = @DUMPBIN@
127ECHO_C = @ECHO_C@
128ECHO_N = @ECHO_N@
129ECHO_T = @ECHO_T@
130EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
131EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
132EGREP = @EGREP@
133EINA_CFLAGS = @EINA_CFLAGS@
134EINA_LIBS = @EINA_LIBS@
135EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
136EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
137EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
138EVIL_CFLAGS = @EVIL_CFLAGS@
139EVIL_LIBS = @EVIL_LIBS@
140EXEEXT = @EXEEXT@
141FGREP = @FGREP@
142GREP = @GREP@
143INSTALL = @INSTALL@
144INSTALL_DATA = @INSTALL_DATA@
145INSTALL_PROGRAM = @INSTALL_PROGRAM@
146INSTALL_SCRIPT = @INSTALL_SCRIPT@
147INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
148LD = @LD@
149LDFLAGS = @LDFLAGS@
150LIBOBJS = @LIBOBJS@
151LIBS = @LIBS@
152LIBTOOL = @LIBTOOL@
153LIPO = @LIPO@
154LN_S = @LN_S@
155LTLIBOBJS = @LTLIBOBJS@
156MAKEINFO = @MAKEINFO@
157MKDIR_P = @MKDIR_P@
158NM = @NM@
159NMEDIT = @NMEDIT@
160OBJDUMP = @OBJDUMP@
161OBJEXT = @OBJEXT@
162OTOOL = @OTOOL@
163OTOOL64 = @OTOOL64@
164PACKAGE = @PACKAGE@
165PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
166PACKAGE_NAME = @PACKAGE_NAME@
167PACKAGE_STRING = @PACKAGE_STRING@
168PACKAGE_TARNAME = @PACKAGE_TARNAME@
169PACKAGE_URL = @PACKAGE_URL@
170PACKAGE_VERSION = @PACKAGE_VERSION@
171PATH_SEPARATOR = @PATH_SEPARATOR@
172PKG_CONFIG = @PKG_CONFIG@
173PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
174PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
175RANLIB = @RANLIB@
176SED = @SED@
177SET_MAKE = @SET_MAKE@
178SHELL = @SHELL@
179STRIP = @STRIP@
180VERSION = @VERSION@
181VMAJ = @VMAJ@
182abs_builddir = @abs_builddir@
183abs_srcdir = @abs_srcdir@
184abs_top_builddir = @abs_top_builddir@
185abs_top_srcdir = @abs_top_srcdir@
186ac_ct_CC = @ac_ct_CC@
187ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
188am__include = @am__include@
189am__leading_dot = @am__leading_dot@
190am__quote = @am__quote@
191am__tar = @am__tar@
192am__untar = @am__untar@
193bindir = @bindir@
194build = @build@
195build_alias = @build_alias@
196build_cpu = @build_cpu@
197build_os = @build_os@
198build_vendor = @build_vendor@
199builddir = @builddir@
200datadir = @datadir@
201datarootdir = @datarootdir@
202docdir = @docdir@
203dvidir = @dvidir@
204efl_doxygen = @efl_doxygen@
205efl_have_doxygen = @efl_have_doxygen@
206embryoincludedir = @embryoincludedir@
207exec_prefix = @exec_prefix@
208host = @host@
209host_alias = @host_alias@
210host_cpu = @host_cpu@
211host_os = @host_os@
212host_vendor = @host_vendor@
213htmldir = @htmldir@
214includedir = @includedir@
215infodir = @infodir@
216install_sh = @install_sh@
217libdir = @libdir@
218libexecdir = @libexecdir@
219localedir = @localedir@
220localstatedir = @localstatedir@
221lt_ECHO = @lt_ECHO@
222lt_enable_auto_import = @lt_enable_auto_import@
223mandir = @mandir@
224mkdir_p = @mkdir_p@
225oldincludedir = @oldincludedir@
226pdfdir = @pdfdir@
227pkgconfig_requires_private = @pkgconfig_requires_private@
228prefix = @prefix@
229program_transform_name = @program_transform_name@
230psdir = @psdir@
231release_info = @release_info@
232requirement_embryo = @requirement_embryo@
233sbindir = @sbindir@
234sharedstatedir = @sharedstatedir@
235srcdir = @srcdir@
236sysconfdir = @sysconfdir@
237target_alias = @target_alias@
238top_build_prefix = @top_build_prefix@
239top_builddir = @top_builddir@
240top_srcdir = @top_srcdir@
241version_info = @version_info@
242MAINTAINERCLEANFILES = Makefile.in
243AM_CPPFLAGS = \
244-I. \
245-I$(top_srcdir)/src/lib \
246-I$(top_srcdir) \
247-I$(top_builddir) \
248-DPACKAGE_BIN_DIR=\"$(bindir)\" \
249-DPACKAGE_LIB_DIR=\"$(libdir)\" \
250-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
251@EINA_CFLAGS@ \
252@EVIL_CFLAGS@
253
254bin_PROGRAMS = @EMBRYO_CC_PRG@
255embryo_cc_SOURCES = \
256embryo_cc_amx.h \
257embryo_cc_sc.h \
258embryo_cc_sc1.c \
259embryo_cc_sc2.c \
260embryo_cc_sc3.c \
261embryo_cc_sc4.c \
262embryo_cc_sc5.c \
263embryo_cc_sc6.c \
264embryo_cc_sc7.c \
265embryo_cc_scexpand.c \
266embryo_cc_sclist.c \
267embryo_cc_scvars.c \
268embryo_cc_prefix.c \
269embryo_cc_prefix.h
270
271embryo_cc_CFLAGS = @EMBRYO_CFLAGS@
272embryo_cc_LDADD = $(top_builddir)/src/lib/libembryo.la @EVIL_LIBS@ @EINA_LIBS@ -lm
273embryo_cc_LDFLAGS = @lt_enable_auto_import@
274EXTRA_DIST = \
275embryo_cc_sc5.scp \
276embryo_cc_sc7.scp
277
278all: all-am
279
280.SUFFIXES:
281.SUFFIXES: .c .lo .o .obj
282$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
283 @for dep in $?; do \
284 case '$(am__configure_deps)' in \
285 *$$dep*) \
286 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
287 && { if test -f $@; then exit 0; else break; fi; }; \
288 exit 1;; \
289 esac; \
290 done; \
291 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bin/Makefile'; \
292 $(am__cd) $(top_srcdir) && \
293 $(AUTOMAKE) --gnu src/bin/Makefile
294.PRECIOUS: Makefile
295Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
296 @case '$?' in \
297 *config.status*) \
298 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
299 *) \
300 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
301 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
302 esac;
303
304$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
305 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
306
307$(top_srcdir)/configure: $(am__configure_deps)
308 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
309$(ACLOCAL_M4): $(am__aclocal_m4_deps)
310 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
311$(am__aclocal_m4_deps):
312install-binPROGRAMS: $(bin_PROGRAMS)
313 @$(NORMAL_INSTALL)
314 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
315 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
316 for p in $$list; do echo "$$p $$p"; done | \
317 sed 's/$(EXEEXT)$$//' | \
318 while read p p1; do if test -f $$p || test -f $$p1; \
319 then echo "$$p"; echo "$$p"; else :; fi; \
320 done | \
321 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
322 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
323 sed 'N;N;N;s,\n, ,g' | \
324 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
325 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
326 if ($$2 == $$4) files[d] = files[d] " " $$1; \
327 else { print "f", $$3 "/" $$4, $$1; } } \
328 END { for (d in files) print "f", d, files[d] }' | \
329 while read type dir files; do \
330 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
331 test -z "$$files" || { \
332 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
333 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
334 } \
335 ; done
336
337uninstall-binPROGRAMS:
338 @$(NORMAL_UNINSTALL)
339 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
340 files=`for p in $$list; do echo "$$p"; done | \
341 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
342 -e 's/$$/$(EXEEXT)/' `; \
343 test -n "$$list" || exit 0; \
344 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
345 cd "$(DESTDIR)$(bindir)" && rm -f $$files
346
347clean-binPROGRAMS:
348 @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
349 echo " rm -f" $$list; \
350 rm -f $$list || exit $$?; \
351 test -n "$(EXEEXT)" || exit 0; \
352 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
353 echo " rm -f" $$list; \
354 rm -f $$list
355embryo_cc$(EXEEXT): $(embryo_cc_OBJECTS) $(embryo_cc_DEPENDENCIES)
356 @rm -f embryo_cc$(EXEEXT)
357 $(AM_V_CCLD)$(embryo_cc_LINK) $(embryo_cc_OBJECTS) $(embryo_cc_LDADD) $(LIBS)
358
359mostlyclean-compile:
360 -rm -f *.$(OBJEXT)
361
362distclean-compile:
363 -rm -f *.tab.c
364
365@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_prefix.Po@am__quote@
366@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc1.Po@am__quote@
367@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc2.Po@am__quote@
368@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc3.Po@am__quote@
369@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc4.Po@am__quote@
370@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc5.Po@am__quote@
371@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc6.Po@am__quote@
372@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sc7.Po@am__quote@
373@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_scexpand.Po@am__quote@
374@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_sclist.Po@am__quote@
375@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embryo_cc-embryo_cc_scvars.Po@am__quote@
376
377.c.o:
378@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
379@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
380@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
381@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
382@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
383@am__fastdepCC_FALSE@ $(COMPILE) -c $<
384
385.c.obj:
386@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
387@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
388@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
389@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
390@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
391@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
392
393.c.lo:
394@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
395@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
396@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
397@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
398@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
399@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
400
401embryo_cc-embryo_cc_sc1.o: embryo_cc_sc1.c
402@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc1.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc1.Tpo -c -o embryo_cc-embryo_cc_sc1.o `test -f 'embryo_cc_sc1.c' || echo '$(srcdir)/'`embryo_cc_sc1.c
403@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc1.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc1.Po
404@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
405@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc1.c' object='embryo_cc-embryo_cc_sc1.o' libtool=no @AMDEPBACKSLASH@
406@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
407@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc1.o `test -f 'embryo_cc_sc1.c' || echo '$(srcdir)/'`embryo_cc_sc1.c
408
409embryo_cc-embryo_cc_sc1.obj: embryo_cc_sc1.c
410@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc1.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc1.Tpo -c -o embryo_cc-embryo_cc_sc1.obj `if test -f 'embryo_cc_sc1.c'; then $(CYGPATH_W) 'embryo_cc_sc1.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc1.c'; fi`
411@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc1.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc1.Po
412@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
413@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc1.c' object='embryo_cc-embryo_cc_sc1.obj' libtool=no @AMDEPBACKSLASH@
414@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
415@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc1.obj `if test -f 'embryo_cc_sc1.c'; then $(CYGPATH_W) 'embryo_cc_sc1.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc1.c'; fi`
416
417embryo_cc-embryo_cc_sc2.o: embryo_cc_sc2.c
418@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc2.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc2.Tpo -c -o embryo_cc-embryo_cc_sc2.o `test -f 'embryo_cc_sc2.c' || echo '$(srcdir)/'`embryo_cc_sc2.c
419@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc2.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc2.Po
420@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
421@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc2.c' object='embryo_cc-embryo_cc_sc2.o' libtool=no @AMDEPBACKSLASH@
422@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
423@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc2.o `test -f 'embryo_cc_sc2.c' || echo '$(srcdir)/'`embryo_cc_sc2.c
424
425embryo_cc-embryo_cc_sc2.obj: embryo_cc_sc2.c
426@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc2.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc2.Tpo -c -o embryo_cc-embryo_cc_sc2.obj `if test -f 'embryo_cc_sc2.c'; then $(CYGPATH_W) 'embryo_cc_sc2.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc2.c'; fi`
427@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc2.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc2.Po
428@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
429@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc2.c' object='embryo_cc-embryo_cc_sc2.obj' libtool=no @AMDEPBACKSLASH@
430@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
431@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc2.obj `if test -f 'embryo_cc_sc2.c'; then $(CYGPATH_W) 'embryo_cc_sc2.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc2.c'; fi`
432
433embryo_cc-embryo_cc_sc3.o: embryo_cc_sc3.c
434@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc3.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc3.Tpo -c -o embryo_cc-embryo_cc_sc3.o `test -f 'embryo_cc_sc3.c' || echo '$(srcdir)/'`embryo_cc_sc3.c
435@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc3.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc3.Po
436@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
437@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc3.c' object='embryo_cc-embryo_cc_sc3.o' libtool=no @AMDEPBACKSLASH@
438@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
439@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc3.o `test -f 'embryo_cc_sc3.c' || echo '$(srcdir)/'`embryo_cc_sc3.c
440
441embryo_cc-embryo_cc_sc3.obj: embryo_cc_sc3.c
442@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc3.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc3.Tpo -c -o embryo_cc-embryo_cc_sc3.obj `if test -f 'embryo_cc_sc3.c'; then $(CYGPATH_W) 'embryo_cc_sc3.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc3.c'; fi`
443@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc3.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc3.Po
444@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
445@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc3.c' object='embryo_cc-embryo_cc_sc3.obj' libtool=no @AMDEPBACKSLASH@
446@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
447@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc3.obj `if test -f 'embryo_cc_sc3.c'; then $(CYGPATH_W) 'embryo_cc_sc3.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc3.c'; fi`
448
449embryo_cc-embryo_cc_sc4.o: embryo_cc_sc4.c
450@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc4.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc4.Tpo -c -o embryo_cc-embryo_cc_sc4.o `test -f 'embryo_cc_sc4.c' || echo '$(srcdir)/'`embryo_cc_sc4.c
451@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc4.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc4.Po
452@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
453@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc4.c' object='embryo_cc-embryo_cc_sc4.o' libtool=no @AMDEPBACKSLASH@
454@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
455@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc4.o `test -f 'embryo_cc_sc4.c' || echo '$(srcdir)/'`embryo_cc_sc4.c
456
457embryo_cc-embryo_cc_sc4.obj: embryo_cc_sc4.c
458@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc4.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc4.Tpo -c -o embryo_cc-embryo_cc_sc4.obj `if test -f 'embryo_cc_sc4.c'; then $(CYGPATH_W) 'embryo_cc_sc4.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc4.c'; fi`
459@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc4.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc4.Po
460@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
461@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc4.c' object='embryo_cc-embryo_cc_sc4.obj' libtool=no @AMDEPBACKSLASH@
462@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
463@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc4.obj `if test -f 'embryo_cc_sc4.c'; then $(CYGPATH_W) 'embryo_cc_sc4.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc4.c'; fi`
464
465embryo_cc-embryo_cc_sc5.o: embryo_cc_sc5.c
466@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc5.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc5.Tpo -c -o embryo_cc-embryo_cc_sc5.o `test -f 'embryo_cc_sc5.c' || echo '$(srcdir)/'`embryo_cc_sc5.c
467@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc5.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc5.Po
468@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc5.c' object='embryo_cc-embryo_cc_sc5.o' libtool=no @AMDEPBACKSLASH@
470@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc5.o `test -f 'embryo_cc_sc5.c' || echo '$(srcdir)/'`embryo_cc_sc5.c
472
473embryo_cc-embryo_cc_sc5.obj: embryo_cc_sc5.c
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc5.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc5.Tpo -c -o embryo_cc-embryo_cc_sc5.obj `if test -f 'embryo_cc_sc5.c'; then $(CYGPATH_W) 'embryo_cc_sc5.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc5.c'; fi`
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc5.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc5.Po
476@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc5.c' object='embryo_cc-embryo_cc_sc5.obj' libtool=no @AMDEPBACKSLASH@
478@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc5.obj `if test -f 'embryo_cc_sc5.c'; then $(CYGPATH_W) 'embryo_cc_sc5.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc5.c'; fi`
480
481embryo_cc-embryo_cc_sc6.o: embryo_cc_sc6.c
482@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc6.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc6.Tpo -c -o embryo_cc-embryo_cc_sc6.o `test -f 'embryo_cc_sc6.c' || echo '$(srcdir)/'`embryo_cc_sc6.c
483@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc6.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc6.Po
484@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
485@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc6.c' object='embryo_cc-embryo_cc_sc6.o' libtool=no @AMDEPBACKSLASH@
486@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
487@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc6.o `test -f 'embryo_cc_sc6.c' || echo '$(srcdir)/'`embryo_cc_sc6.c
488
489embryo_cc-embryo_cc_sc6.obj: embryo_cc_sc6.c
490@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc6.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc6.Tpo -c -o embryo_cc-embryo_cc_sc6.obj `if test -f 'embryo_cc_sc6.c'; then $(CYGPATH_W) 'embryo_cc_sc6.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc6.c'; fi`
491@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc6.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc6.Po
492@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
493@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc6.c' object='embryo_cc-embryo_cc_sc6.obj' libtool=no @AMDEPBACKSLASH@
494@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
495@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc6.obj `if test -f 'embryo_cc_sc6.c'; then $(CYGPATH_W) 'embryo_cc_sc6.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc6.c'; fi`
496
497embryo_cc-embryo_cc_sc7.o: embryo_cc_sc7.c
498@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc7.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc7.Tpo -c -o embryo_cc-embryo_cc_sc7.o `test -f 'embryo_cc_sc7.c' || echo '$(srcdir)/'`embryo_cc_sc7.c
499@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc7.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc7.Po
500@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
501@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc7.c' object='embryo_cc-embryo_cc_sc7.o' libtool=no @AMDEPBACKSLASH@
502@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
503@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc7.o `test -f 'embryo_cc_sc7.c' || echo '$(srcdir)/'`embryo_cc_sc7.c
504
505embryo_cc-embryo_cc_sc7.obj: embryo_cc_sc7.c
506@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sc7.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sc7.Tpo -c -o embryo_cc-embryo_cc_sc7.obj `if test -f 'embryo_cc_sc7.c'; then $(CYGPATH_W) 'embryo_cc_sc7.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc7.c'; fi`
507@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sc7.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sc7.Po
508@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
509@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sc7.c' object='embryo_cc-embryo_cc_sc7.obj' libtool=no @AMDEPBACKSLASH@
510@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
511@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sc7.obj `if test -f 'embryo_cc_sc7.c'; then $(CYGPATH_W) 'embryo_cc_sc7.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sc7.c'; fi`
512
513embryo_cc-embryo_cc_scexpand.o: embryo_cc_scexpand.c
514@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_scexpand.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Tpo -c -o embryo_cc-embryo_cc_scexpand.o `test -f 'embryo_cc_scexpand.c' || echo '$(srcdir)/'`embryo_cc_scexpand.c
515@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Tpo $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Po
516@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
517@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_scexpand.c' object='embryo_cc-embryo_cc_scexpand.o' libtool=no @AMDEPBACKSLASH@
518@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
519@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_scexpand.o `test -f 'embryo_cc_scexpand.c' || echo '$(srcdir)/'`embryo_cc_scexpand.c
520
521embryo_cc-embryo_cc_scexpand.obj: embryo_cc_scexpand.c
522@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_scexpand.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Tpo -c -o embryo_cc-embryo_cc_scexpand.obj `if test -f 'embryo_cc_scexpand.c'; then $(CYGPATH_W) 'embryo_cc_scexpand.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_scexpand.c'; fi`
523@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Tpo $(DEPDIR)/embryo_cc-embryo_cc_scexpand.Po
524@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
525@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_scexpand.c' object='embryo_cc-embryo_cc_scexpand.obj' libtool=no @AMDEPBACKSLASH@
526@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
527@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_scexpand.obj `if test -f 'embryo_cc_scexpand.c'; then $(CYGPATH_W) 'embryo_cc_scexpand.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_scexpand.c'; fi`
528
529embryo_cc-embryo_cc_sclist.o: embryo_cc_sclist.c
530@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sclist.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sclist.Tpo -c -o embryo_cc-embryo_cc_sclist.o `test -f 'embryo_cc_sclist.c' || echo '$(srcdir)/'`embryo_cc_sclist.c
531@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sclist.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sclist.Po
532@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
533@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sclist.c' object='embryo_cc-embryo_cc_sclist.o' libtool=no @AMDEPBACKSLASH@
534@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
535@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sclist.o `test -f 'embryo_cc_sclist.c' || echo '$(srcdir)/'`embryo_cc_sclist.c
536
537embryo_cc-embryo_cc_sclist.obj: embryo_cc_sclist.c
538@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_sclist.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_sclist.Tpo -c -o embryo_cc-embryo_cc_sclist.obj `if test -f 'embryo_cc_sclist.c'; then $(CYGPATH_W) 'embryo_cc_sclist.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sclist.c'; fi`
539@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_sclist.Tpo $(DEPDIR)/embryo_cc-embryo_cc_sclist.Po
540@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
541@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_sclist.c' object='embryo_cc-embryo_cc_sclist.obj' libtool=no @AMDEPBACKSLASH@
542@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
543@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_sclist.obj `if test -f 'embryo_cc_sclist.c'; then $(CYGPATH_W) 'embryo_cc_sclist.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_sclist.c'; fi`
544
545embryo_cc-embryo_cc_scvars.o: embryo_cc_scvars.c
546@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_scvars.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_scvars.Tpo -c -o embryo_cc-embryo_cc_scvars.o `test -f 'embryo_cc_scvars.c' || echo '$(srcdir)/'`embryo_cc_scvars.c
547@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_scvars.Tpo $(DEPDIR)/embryo_cc-embryo_cc_scvars.Po
548@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
549@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_scvars.c' object='embryo_cc-embryo_cc_scvars.o' libtool=no @AMDEPBACKSLASH@
550@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
551@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_scvars.o `test -f 'embryo_cc_scvars.c' || echo '$(srcdir)/'`embryo_cc_scvars.c
552
553embryo_cc-embryo_cc_scvars.obj: embryo_cc_scvars.c
554@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_scvars.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_scvars.Tpo -c -o embryo_cc-embryo_cc_scvars.obj `if test -f 'embryo_cc_scvars.c'; then $(CYGPATH_W) 'embryo_cc_scvars.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_scvars.c'; fi`
555@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_scvars.Tpo $(DEPDIR)/embryo_cc-embryo_cc_scvars.Po
556@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
557@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_scvars.c' object='embryo_cc-embryo_cc_scvars.obj' libtool=no @AMDEPBACKSLASH@
558@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
559@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_scvars.obj `if test -f 'embryo_cc_scvars.c'; then $(CYGPATH_W) 'embryo_cc_scvars.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_scvars.c'; fi`
560
561embryo_cc-embryo_cc_prefix.o: embryo_cc_prefix.c
562@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_prefix.o -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_prefix.Tpo -c -o embryo_cc-embryo_cc_prefix.o `test -f 'embryo_cc_prefix.c' || echo '$(srcdir)/'`embryo_cc_prefix.c
563@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_prefix.Tpo $(DEPDIR)/embryo_cc-embryo_cc_prefix.Po
564@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
565@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_prefix.c' object='embryo_cc-embryo_cc_prefix.o' libtool=no @AMDEPBACKSLASH@
566@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
567@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_prefix.o `test -f 'embryo_cc_prefix.c' || echo '$(srcdir)/'`embryo_cc_prefix.c
568
569embryo_cc-embryo_cc_prefix.obj: embryo_cc_prefix.c
570@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -MT embryo_cc-embryo_cc_prefix.obj -MD -MP -MF $(DEPDIR)/embryo_cc-embryo_cc_prefix.Tpo -c -o embryo_cc-embryo_cc_prefix.obj `if test -f 'embryo_cc_prefix.c'; then $(CYGPATH_W) 'embryo_cc_prefix.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_prefix.c'; fi`
571@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/embryo_cc-embryo_cc_prefix.Tpo $(DEPDIR)/embryo_cc-embryo_cc_prefix.Po
572@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
573@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_cc_prefix.c' object='embryo_cc-embryo_cc_prefix.obj' libtool=no @AMDEPBACKSLASH@
574@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
575@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(embryo_cc_CFLAGS) $(CFLAGS) -c -o embryo_cc-embryo_cc_prefix.obj `if test -f 'embryo_cc_prefix.c'; then $(CYGPATH_W) 'embryo_cc_prefix.c'; else $(CYGPATH_W) '$(srcdir)/embryo_cc_prefix.c'; fi`
576
577mostlyclean-libtool:
578 -rm -f *.lo
579
580clean-libtool:
581 -rm -rf .libs _libs
582
583ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
584 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
585 unique=`for i in $$list; do \
586 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
587 done | \
588 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
589 END { if (nonempty) { for (i in files) print i; }; }'`; \
590 mkid -fID $$unique
591tags: TAGS
592
593TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
594 $(TAGS_FILES) $(LISP)
595 set x; \
596 here=`pwd`; \
597 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
598 unique=`for i in $$list; do \
599 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
600 done | \
601 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
602 END { if (nonempty) { for (i in files) print i; }; }'`; \
603 shift; \
604 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
605 test -n "$$unique" || unique=$$empty_fix; \
606 if test $$# -gt 0; then \
607 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
608 "$$@" $$unique; \
609 else \
610 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
611 $$unique; \
612 fi; \
613 fi
614ctags: CTAGS
615CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
616 $(TAGS_FILES) $(LISP)
617 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
618 unique=`for i in $$list; do \
619 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
620 done | \
621 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
622 END { if (nonempty) { for (i in files) print i; }; }'`; \
623 test -z "$(CTAGS_ARGS)$$unique" \
624 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
625 $$unique
626
627GTAGS:
628 here=`$(am__cd) $(top_builddir) && pwd` \
629 && $(am__cd) $(top_srcdir) \
630 && gtags -i $(GTAGS_ARGS) "$$here"
631
632distclean-tags:
633 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
634
635distdir: $(DISTFILES)
636 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
637 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
638 list='$(DISTFILES)'; \
639 dist_files=`for file in $$list; do echo $$file; done | \
640 sed -e "s|^$$srcdirstrip/||;t" \
641 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
642 case $$dist_files in \
643 */*) $(MKDIR_P) `echo "$$dist_files" | \
644 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
645 sort -u` ;; \
646 esac; \
647 for file in $$dist_files; do \
648 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
649 if test -d $$d/$$file; then \
650 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
651 if test -d "$(distdir)/$$file"; then \
652 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
653 fi; \
654 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
655 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
656 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
657 fi; \
658 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
659 else \
660 test -f "$(distdir)/$$file" \
661 || cp -p $$d/$$file "$(distdir)/$$file" \
662 || exit 1; \
663 fi; \
664 done
665check-am: all-am
666check: check-am
667all-am: Makefile $(PROGRAMS)
668installdirs:
669 for dir in "$(DESTDIR)$(bindir)"; do \
670 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
671 done
672install: install-am
673install-exec: install-exec-am
674install-data: install-data-am
675uninstall: uninstall-am
676
677install-am: all-am
678 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
679
680installcheck: installcheck-am
681install-strip:
682 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
683 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
684 `test -z '$(STRIP)' || \
685 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
686mostlyclean-generic:
687
688clean-generic:
689
690distclean-generic:
691 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
692 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
693
694maintainer-clean-generic:
695 @echo "This command is intended for maintainers to use"
696 @echo "it deletes files that may require special tools to rebuild."
697 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
698clean: clean-am
699
700clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
701
702distclean: distclean-am
703 -rm -rf ./$(DEPDIR)
704 -rm -f Makefile
705distclean-am: clean-am distclean-compile distclean-generic \
706 distclean-tags
707
708dvi: dvi-am
709
710dvi-am:
711
712html: html-am
713
714html-am:
715
716info: info-am
717
718info-am:
719
720install-data-am:
721
722install-dvi: install-dvi-am
723
724install-dvi-am:
725
726install-exec-am: install-binPROGRAMS
727
728install-html: install-html-am
729
730install-html-am:
731
732install-info: install-info-am
733
734install-info-am:
735
736install-man:
737
738install-pdf: install-pdf-am
739
740install-pdf-am:
741
742install-ps: install-ps-am
743
744install-ps-am:
745
746installcheck-am:
747
748maintainer-clean: maintainer-clean-am
749 -rm -rf ./$(DEPDIR)
750 -rm -f Makefile
751maintainer-clean-am: distclean-am maintainer-clean-generic
752
753mostlyclean: mostlyclean-am
754
755mostlyclean-am: mostlyclean-compile mostlyclean-generic \
756 mostlyclean-libtool
757
758pdf: pdf-am
759
760pdf-am:
761
762ps: ps-am
763
764ps-am:
765
766uninstall-am: uninstall-binPROGRAMS
767
768.MAKE: install-am install-strip
769
770.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
771 clean-generic clean-libtool ctags distclean distclean-compile \
772 distclean-generic distclean-libtool distclean-tags distdir dvi \
773 dvi-am html html-am info info-am install install-am \
774 install-binPROGRAMS install-data install-data-am install-dvi \
775 install-dvi-am install-exec install-exec-am install-html \
776 install-html-am install-info install-info-am install-man \
777 install-pdf install-pdf-am install-ps install-ps-am \
778 install-strip installcheck installcheck-am installdirs \
779 maintainer-clean maintainer-clean-generic mostlyclean \
780 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
781 pdf pdf-am ps ps-am tags uninstall uninstall-am \
782 uninstall-binPROGRAMS
783
784
785# Tell versions [3.59,3.63) of GNU make to not export all variables.
786# Otherwise a system limit (for SysV at least) may be exceeded.
787.NOEXPORT:
diff --git a/libraries/embryo/src/bin/embryo_cc_amx.h b/libraries/embryo/src/bin/embryo_cc_amx.h
new file mode 100644
index 0000000..c31b1cd
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_amx.h
@@ -0,0 +1,226 @@
1/* Abstract Machine for the Small compiler
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_amx.h 51650 2010-08-26 01:34:13Z lucas $
22 */
23
24#ifndef EMBRYO_CC_AMX_H
25#define EMBRYO_CC_AMX_H
26
27#include <sys/types.h>
28
29/* calling convention for all interface functions and callback functions */
30
31/* File format version Required AMX version
32 * 0 (original version) 0
33 * 1 (opcodes JUMP.pri, SWITCH and CASETBL) 1
34 * 2 (compressed files) 2
35 * 3 (public variables) 2
36 * 4 (opcodes SWAP.pri/alt and PUSHADDR) 4
37 * 5 (tagnames table) 4
38 * 6 (reformatted header) 6
39 * 7 (name table, opcodes SYMTAG & SYSREQ.D) 7
40 */
41#define CUR_FILE_VERSION 7 /* current file version; also the current AMX version */
42#define MIN_FILE_VERSION 6 /* lowest supported file format version for the current AMX version */
43#define MIN_AMX_VERSION 7 /* minimum AMX version needed to support the current file format */
44
45#if !defined CELL_TYPE
46#define CELL_TYPE
47 typedef unsigned int ucell;
48 typedef int cell;
49#endif
50
51 struct tagAMX;
52 typedef cell(*AMX_NATIVE) (struct tagAMX * amx,
53 cell * params);
54 typedef int (* AMX_CALLBACK) (struct tagAMX * amx, cell index,
55 cell * result, cell * params);
56 typedef int (* AMX_DEBUG) (struct tagAMX * amx);
57
58 typedef struct
59 {
60 char *name;
61 AMX_NATIVE func ;
62 } AMX_NATIVE_INFO ;
63
64#define AMX_USERNUM 4
65#define sEXPMAX 19 /* maximum name length for file version <= 6 */
66#define sNAMEMAX 31 /* maximum name length of symbol name */
67
68#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100)
69# pragma pack(1)
70# define EMBRYO_STRUCT_PACKED
71#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100)
72# define EMBRYO_STRUCT_PACKED __attribute__((packed))
73#else
74# define EMBRYO_STRUCT_PACKED
75#endif
76
77 typedef struct tagAMX_FUNCSTUB
78 {
79 unsigned int address;
80 char name[sEXPMAX + 1];
81 } EMBRYO_STRUCT_PACKED AMX_FUNCSTUB;
82
83/* The AMX structure is the internal structure for many functions. Not all
84 * fields are valid at all times; many fields are cached in local variables.
85 */
86 typedef struct tagAMX
87 {
88 unsigned char *base; /* points to the AMX header ("amxhdr") plus the code, optionally also the data */
89 unsigned char *data; /* points to separate data+stack+heap, may be NULL */
90 AMX_CALLBACK callback;
91 AMX_DEBUG debug ; /* debug callback */
92 /* for external functions a few registers must be accessible from the outside */
93 cell cip ; /* instruction pointer: relative to base + amxhdr->cod */
94 cell frm ; /* stack frame base: relative to base + amxhdr->dat */
95 cell hea ; /* top of the heap: relative to base + amxhdr->dat */
96 cell hlw ; /* bottom of the heap: relative to base + amxhdr->dat */
97 cell stk ; /* stack pointer: relative to base + amxhdr->dat */
98 cell stp ; /* top of the stack: relative to base + amxhdr->dat */
99 int flags ; /* current status, see amx_Flags() */
100 /* for assertions and debug hook */
101 cell curline ;
102 cell curfile ;
103 int dbgcode ;
104 cell dbgaddr ;
105 cell dbgparam ;
106 char *dbgname;
107 /* user data */
108 long usertags[AMX_USERNUM];
109 void *userdata[AMX_USERNUM];
110 /* native functions can raise an error */
111 int error ;
112 /* the sleep opcode needs to store the full AMX status */
113 cell pri ;
114 cell alt ;
115 cell reset_stk ;
116 cell reset_hea ;
117 cell *syscall_d; /* relocated value/address for the SYSCALL.D opcode */
118 } EMBRYO_STRUCT_PACKED AMX;
119
120/* The AMX_HEADER structure is both the memory format as the file format. The
121 * structure is used internaly.
122 */
123 typedef struct tagAMX_HEADER
124 {
125 int size ; /* size of the "file" */
126 unsigned short magic ; /* signature */
127 char file_version ; /* file format version */
128 char amx_version ; /* required version of the AMX */
129 unsigned short flags ;
130 unsigned short defsize ; /* size of a definition record */
131 int cod ; /* initial value of COD - code block */
132 int dat ; /* initial value of DAT - data block */
133 int hea ; /* initial value of HEA - start of the heap */
134 int stp ; /* initial value of STP - stack top */
135 int cip ; /* initial value of CIP - the instruction pointer */
136 int publics ; /* offset to the "public functions" table */
137 int natives ; /* offset to the "native functions" table */
138 int libraries ; /* offset to the table of libraries */
139 int pubvars ; /* the "public variables" table */
140 int tags ; /* the "public tagnames" table */
141 int nametable ; /* name table, file version 7 only */
142 } EMBRYO_STRUCT_PACKED AMX_HEADER;
143
144#if defined _MSC_VER || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100)
145# pragma pack()
146#endif
147
148#define AMX_MAGIC 0xf1e0
149
150 enum
151 {
152 AMX_ERR_NONE,
153 /* reserve the first 15 error codes for exit codes of the abstract machine */
154 AMX_ERR_EXIT, /* forced exit */
155 AMX_ERR_ASSERT, /* assertion failed */
156 AMX_ERR_STACKERR, /* stack/heap collision */
157 AMX_ERR_BOUNDS, /* index out of bounds */
158 AMX_ERR_MEMACCESS, /* invalid memory access */
159 AMX_ERR_INVINSTR, /* invalid instruction */
160 AMX_ERR_STACKLOW, /* stack underflow */
161 AMX_ERR_HEAPLOW, /* heap underflow */
162 AMX_ERR_CALLBACK, /* no callback, or invalid callback */
163 AMX_ERR_NATIVE, /* native function failed */
164 AMX_ERR_DIVIDE, /* divide by zero */
165 AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */
166
167 AMX_ERR_MEMORY = 16, /* out of memory */
168 AMX_ERR_FORMAT, /* invalid file format */
169 AMX_ERR_VERSION, /* file is for a newer version of the AMX */
170 AMX_ERR_NOTFOUND, /* function not found */
171 AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */
172 AMX_ERR_DEBUG, /* debugger cannot run */
173 AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */
174 AMX_ERR_USERDATA, /* unable to set user data field (table full) */
175 AMX_ERR_INIT_JIT, /* cannot initialize the JIT */
176 AMX_ERR_PARAMS, /* parameter error */
177 AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
178 };
179
180 enum
181 {
182 DBG_INIT, /* query/initialize */
183 DBG_FILE, /* file number in curfile, filename in name */
184 DBG_LINE, /* line number in curline, file number in curfile */
185 DBG_SYMBOL, /* address in dbgaddr, class/type in dbgparam */
186 DBG_CLRSYM, /* stack address below which locals should be removed. stack address in stk */
187 DBG_CALL, /* function call, address jumped to in dbgaddr */
188 DBG_RETURN, /* function returns */
189 DBG_TERMINATE, /* program ends, code address in dbgaddr, reason in dbgparam */
190 DBG_SRANGE, /* symbol size and dimensions (arrays); level in dbgaddr (!); length in dbgparam */
191 DBG_SYMTAG, /* tag of the most recent symbol (if non-zero), tag in dbgparam */
192 };
193
194#define AMX_FLAG_CHAR16 0x01 /* characters are 16-bit */
195#define AMX_FLAG_DEBUG 0x02 /* symbolic info. available */
196#define AMX_FLAG_COMPACT 0x04 /* compact encoding */
197#define AMX_FLAG_BIGENDIAN 0x08 /* big endian encoding */
198#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking */
199#define AMX_FLAG_BROWSE 0x4000 /* browsing/relocating or executing */
200#define AMX_FLAG_RELOC 0x8000 /* jump/call addresses relocated */
201
202#define AMX_EXEC_MAIN -1 /* start at program entry point */
203#define AMX_EXEC_CONT -2 /* continue from last address */
204
205#define AMX_USERTAG(a,b,c,d) ((a) | ((b)<<8) | ((long)(c)<<16) | ((long)(d)<<24))
206
207#define AMX_EXPANDMARGIN 64
208
209/* for native functions that use floating point parameters, the following
210 * two macros are convenient for casting a "cell" into a "float" type _without_
211 * changing the bit pattern
212 */
213#define amx_ftoc(f) ( * ((cell*)&f) ) /* float to cell */
214#define amx_ctof(c) ( * ((float*)&c) ) /* cell to float */
215
216#define amx_StrParam(amx,param,result) { \
217 cell *amx_cstr_; int amx_length_; \
218 amx_GetAddr((amx), (param), &amx_cstr_); \
219 amx_StrLen(amx_cstr_, &amx_length_); \
220 if (amx_length_ > 0 && \
221 ((result) = (char *)alloca(amx_length_ + 1))) \
222 amx_GetString((result), amx_cstr_); \
223 else (result) = NULL; \
224}
225
226#endif /* __AMX_H */
diff --git a/libraries/embryo/src/bin/embryo_cc_prefix.c b/libraries/embryo/src/bin/embryo_cc_prefix.c
new file mode 100644
index 0000000..9b57704
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_prefix.c
@@ -0,0 +1,61 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Eina.h>
6
7#include "embryo_cc_prefix.h"
8
9/* local subsystem functions */
10
11/* local subsystem globals */
12
13static Eina_Prefix *pfx = NULL;
14
15/* externally accessible functions */
16int
17e_prefix_determine(char *argv0)
18{
19 if (pfx) return 1;
20 eina_init();
21 pfx = eina_prefix_new(argv0, e_prefix_determine,
22 "EMBRYO", "embryo", "include/default.inc",
23 PACKAGE_BIN_DIR,
24 PACKAGE_LIB_DIR,
25 PACKAGE_DATA_DIR,
26 PACKAGE_DATA_DIR);
27 if (!pfx) return 0;
28 return 1;
29}
30
31void
32e_prefix_shutdown(void)
33{
34 eina_prefix_free(pfx);
35 pfx = NULL;
36 eina_shutdown();
37}
38
39const char *
40e_prefix_get(void)
41{
42 return eina_prefix_get(pfx);
43}
44
45const char *
46e_prefix_bin_get(void)
47{
48 return eina_prefix_bin_get(pfx);
49}
50
51const char *
52e_prefix_data_get(void)
53{
54 return eina_prefix_data_get(pfx);
55}
56
57const char *
58e_prefix_lib_get(void)
59{
60 return eina_prefix_lib_get(pfx);
61}
diff --git a/libraries/embryo/src/bin/embryo_cc_prefix.h b/libraries/embryo/src/bin/embryo_cc_prefix.h
new file mode 100644
index 0000000..d6dc7b2
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_prefix.h
@@ -0,0 +1,6 @@
1int e_prefix_determine(char *argv0);
2void e_prefix_shutdown(void);
3const char *e_prefix_get(void);
4const char *e_prefix_bin_get(void);
5const char *e_prefix_data_get(void);
6const char *e_prefix_lib_get(void);
diff --git a/libraries/embryo/src/bin/embryo_cc_sc.h b/libraries/embryo/src/bin/embryo_cc_sc.h
new file mode 100644
index 0000000..e62cbc3
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc.h
@@ -0,0 +1,667 @@
1/* Small compiler
2 *
3 * Drafted after the Small-C compiler Version 2.01, originally created
4 * by Ron Cain, july 1980, and enhanced by James E. Hendrix.
5 *
6 * This version comes close to a complete rewrite.
7 *
8 * Copyright R. Cain, 1980
9 * Copyright J.E. Hendrix, 1982, 1983
10 * Copyright T. Riemersma, 1997-2003
11 *
12 * Version: $Id: embryo_cc_sc.h 59489 2011-05-18 08:37:38Z raster $
13 *
14 * This software is provided "as-is", without any express or implied warranty.
15 * In no event will the authors be held liable for any damages arising from
16 * the use of this software.
17 *
18 * Permission is granted to anyone to use this software for any purpose,
19 * including commercial applications, and to alter it and redistribute it
20 * freely, subject to the following restrictions:
21 *
22 * 1. The origin of this software must not be misrepresented; you must not
23 * claim that you wrote the original software. If you use this software in
24 * a product, an acknowledgment in the product documentation would be
25 * appreciated but is not required.
26 * 2. Altered source versions must be plainly marked as such, and must not be
27 * misrepresented as being the original software.
28 * 3. This notice may not be removed or altered from any source distribution.
29 */
30
31#ifndef EMBRYO_CC_SC_H
32#define EMBRYO_CC_SC_H
33
34#include <limits.h>
35#include <stdarg.h>
36#include <stdio.h>
37#include <setjmp.h>
38
39#ifndef _MSC_VER
40# include <stdint.h>
41#else
42# include <stddef.h>
43# include <Evil.h>
44#endif
45
46#include "embryo_cc_amx.h"
47
48/* Note: the "cell" and "ucell" types are defined in AMX.H */
49
50#define PUBLIC_CHAR '@' /* character that defines a function "public" */
51#define CTRL_CHAR '\\' /* default control character */
52
53#define DIRSEP_CHAR '/' /* directory separator character */
54
55#define sDIMEN_MAX 2 /* maximum number of array dimensions */
56#define sDEF_LITMAX 500 /* initial size of the literal pool, in "cells" */
57#define sLINEMAX (640 * 1024) /* input line length (in characters) */
58#define sDEF_AMXSTACK 4096 /* default stack size for AMX files */
59#define sSTKMAX 80 /* stack for nested #includes and other uses */
60#define PREPROC_TERM '\x7f' /* termination character for preprocessor expressions (the "DEL" code) */
61#define sDEF_PREFIX "default.inc" /* default prefix filename */
62
63typedef intptr_t stkitem; /* type of items stored on the stack */
64
65typedef struct __s_arginfo
66{ /* function argument info */
67 char name[sNAMEMAX + 1];
68 char ident; /* iVARIABLE, iREFERENCE, iREFARRAY or iVARARGS */
69 char usage; /* uCONST */
70 int *tags; /* argument tag id. list */
71 int numtags; /* number of tags in the tag list */
72 int dim[sDIMEN_MAX];
73 int numdim; /* number of dimensions */
74 unsigned char hasdefault; /* bit0: is there a default value? bit6: "tagof"; bit7: "sizeof" */
75 union
76 {
77 cell val; /* default value */
78 struct
79 {
80 char *symname; /* name of another symbol */
81 short level; /* indirection level for that symbol */
82 } size; /* used for "sizeof" default value */
83 struct
84 {
85 cell *data; /* values of default array */
86 int size; /* complete length of default array */
87 int arraysize; /* size to reserve on the heap */
88 cell addr; /* address of the default array in the data segment */
89 } array;
90 } defvalue; /* default value, or pointer to default array */
91 int defvalue_tag; /* tag of the default value */
92} arginfo;
93
94/* Equate table, tagname table, library table */
95typedef struct __s_constvalue
96{
97 struct __s_constvalue *next;
98 char name[sNAMEMAX + 1];
99 cell value;
100 short index;
101} constvalue;
102
103/* Symbol table format
104 *
105 * The symbol name read from the input file is stored in "name", the
106 * value of "addr" is written to the output file. The address in "addr"
107 * depends on the class of the symbol:
108 * global offset into the data segment
109 * local offset relative to the stack frame
110 * label generated hexadecimal number
111 * function offset into code segment
112 */
113typedef struct __s_symbol
114{
115 struct __s_symbol *next;
116 struct __s_symbol *parent; /* hierarchical types (multi-dimensional arrays) */
117 char name[sNAMEMAX + 1];
118 unsigned int hash; /* value derived from name, for quicker searching */
119 cell addr; /* address or offset (or value for constant, index for native function) */
120 char vclass; /* sLOCAL if "addr" refers to a local symbol */
121 char ident; /* see below for possible values */
122 char usage; /* see below for possible values */
123 int compound; /* compound level (braces nesting level) */
124 int tag; /* tagname id */
125 union
126 {
127 int declared; /* label: how many local variables are declared */
128 int idxtag; /* array: tag of array indices */
129 constvalue *lib; /* native function: library it is part of *///??? use "stringlist"
130 } x; /* 'x' for 'extra' */
131 union
132 {
133 arginfo *arglist; /* types of all parameters for functions */
134 struct
135 {
136 cell length; /* arrays: length (size) */
137 short level; /* number of dimensions below this level */
138 } array;
139 } dim; /* for 'dimension', both functions and arrays */
140 int fnumber; /* static global variables: file number in which the declaration is visible */
141 struct __s_symbol **refer; /* referrer list, functions that "use" this symbol */
142 int numrefers; /* number of entries in the referrer list */
143} symbol;
144
145/* Possible entries for "ident". These are used in the "symbol", "value"
146 * and arginfo structures. Not every constant is valid for every use.
147 * In an argument list, the list is terminated with a "zero" ident; labels
148 * cannot be passed as function arguments, so the value 0 is overloaded.
149 */
150#define iLABEL 0
151#define iVARIABLE 1 /* cell that has an address and that can be fetched directly (lvalue) */
152#define iREFERENCE 2 /* iVARIABLE, but must be dereferenced */
153#define iARRAY 3
154#define iREFARRAY 4 /* an array passed by reference (i.e. a pointer) */
155#define iARRAYCELL 5 /* array element, cell that must be fetched indirectly */
156#define iARRAYCHAR 6 /* array element, character from cell from array */
157#define iEXPRESSION 7 /* expression result, has no address (rvalue) */
158#define iCONSTEXPR 8 /* constant expression (or constant symbol) */
159#define iFUNCTN 9
160#define iREFFUNC 10 /* function passed as a parameter */
161#define iVARARGS 11 /* function specified ... as argument(s) */
162
163/* Possible entries for "usage"
164 *
165 * This byte is used as a serie of bits, the syntax is different for
166 * functions and other symbols:
167 *
168 * VARIABLE
169 * bits: 0 (uDEFINE) the variable is defined in the source file
170 * 1 (uREAD) the variable is "read" (accessed) in the source file
171 * 2 (uWRITTEN) the variable is altered (assigned a value)
172 * 3 (uCONST) the variable is constant (may not be assigned to)
173 * 4 (uPUBLIC) the variable is public
174 * 6 (uSTOCK) the variable is discardable (without warning)
175 *
176 * FUNCTION
177 * bits: 0 (uDEFINE) the function is defined ("implemented") in the source file
178 * 1 (uREAD) the function is invoked in the source file
179 * 2 (uRETVALUE) the function returns a value (or should return a value)
180 * 3 (uPROTOTYPED) the function was prototyped
181 * 4 (uPUBLIC) the function is public
182 * 5 (uNATIVE) the function is native
183 * 6 (uSTOCK) the function is discardable (without warning)
184 * 7 (uMISSING) the function is not implemented in this source file
185 *
186 * CONSTANT
187 * bits: 0 (uDEFINE) the symbol is defined in the source file
188 * 1 (uREAD) the constant is "read" (accessed) in the source file
189 * 3 (uPREDEF) the constant is pre-defined and should be kept between passes
190 */
191#define uDEFINE 0x01
192#define uREAD 0x02
193#define uWRITTEN 0x04
194#define uRETVALUE 0x04 /* function returns (or should return) a value */
195#define uCONST 0x08
196#define uPROTOTYPED 0x08
197#define uPREDEF 0x08 /* constant is pre-defined */
198#define uPUBLIC 0x10
199#define uNATIVE 0x20
200#define uSTOCK 0x40
201#define uMISSING 0x80
202/* uRETNONE is not stored in the "usage" field of a symbol. It is
203 * used during parsing a function, to detect a mix of "return;" and
204 * "return value;" in a few special cases.
205 */
206#define uRETNONE 0x10
207
208#define uTAGOF 0x40 /* set in the "hasdefault" field of the arginfo struct */
209#define uSIZEOF 0x80 /* set in the "hasdefault" field of the arginfo struct */
210
211#define uMAINFUNC "main"
212
213#define sGLOBAL 0 /* global/local variable/constant class */
214#define sLOCAL 1
215#define sSTATIC 2 /* global life, local scope */
216
217typedef struct
218{
219 symbol *sym; /* symbol in symbol table, NULL for (constant) expression */
220 cell constval; /* value of the constant expression (if ident==iCONSTEXPR)
221 * also used for the size of a literal array */
222 int tag; /* tagname id (of the expression) */
223 char ident; /* iCONSTEXPR, iVARIABLE, iARRAY, iARRAYCELL,
224 * iEXPRESSION or iREFERENCE */
225 char boolresult; /* boolean result for relational operators */
226 cell *arrayidx; /* last used array indices, for checking self assignment */
227} value;
228
229/* "while" statement queue (also used for "for" and "do - while" loops) */
230enum
231{
232 wqBRK, /* used to restore stack for "break" */
233 wqCONT, /* used to restore stack for "continue" */
234 wqLOOP, /* loop start label number */
235 wqEXIT, /* loop exit label number (jump if false) */
236 /* --- */
237 wqSIZE /* "while queue" size */
238};
239
240#define wqTABSZ (24*wqSIZE) /* 24 nested loop statements */
241
242enum
243{
244 statIDLE, /* not compiling yet */
245 statFIRST, /* first pass */
246 statWRITE, /* writing output */
247 statSKIP, /* skipping output */
248};
249
250typedef struct __s_stringlist
251{
252 struct __s_stringlist *next;
253 char *line;
254} stringlist;
255
256typedef struct __s_stringpair
257{
258 struct __s_stringpair *next;
259 char *first;
260 char *second;
261 int matchlength;
262} stringpair;
263
264/* macros for code generation */
265#define opcodes(n) ((n)*sizeof(cell)) /* opcode size */
266#define opargs(n) ((n)*sizeof(cell)) /* size of typical argument */
267
268/* Tokens recognized by lex()
269 * Some of these constants are assigned as well to the variable "lastst"
270 */
271#define tFIRST 256 /* value of first multi-character operator */
272#define tMIDDLE 279 /* value of last multi-character operator */
273#define tLAST 320 /* value of last multi-character match-able token */
274/* multi-character operators */
275#define taMULT 256 /* *= */
276#define taDIV 257 /* /= */
277#define taMOD 258 /* %= */
278#define taADD 259 /* += */
279#define taSUB 260 /* -= */
280#define taSHL 261 /* <<= */
281#define taSHRU 262 /* >>>= */
282#define taSHR 263 /* >>= */
283#define taAND 264 /* &= */
284#define taXOR 265 /* ^= */
285#define taOR 266 /* |= */
286#define tlOR 267 /* || */
287#define tlAND 268 /* && */
288#define tlEQ 269 /* == */
289#define tlNE 270 /* != */
290#define tlLE 271 /* <= */
291#define tlGE 272 /* >= */
292#define tSHL 273 /* << */
293#define tSHRU 274 /* >>> */
294#define tSHR 275 /* >> */
295#define tINC 276 /* ++ */
296#define tDEC 277 /* -- */
297#define tELLIPS 278 /* ... */
298#define tDBLDOT 279 /* .. */
299/* reserved words (statements) */
300#define tASSERT 280
301#define tBREAK 281
302#define tCASE 282
303#define tCHAR 283
304#define tCONST 284
305#define tCONTINUE 285
306#define tDEFAULT 286
307#define tDEFINED 287
308#define tDO 288
309#define tELSE 289
310#define tENUM 290
311#define tEXIT 291
312#define tFOR 292
313#define tFORWARD 293
314#define tGOTO 294
315#define tIF 295
316#define tNATIVE 296
317#define tNEW 297
318#define tOPERATOR 298
319#define tPUBLIC 299
320#define tRETURN 300
321#define tSIZEOF 301
322#define tSLEEP 302
323#define tSTATIC 303
324#define tSTOCK 304
325#define tSWITCH 305
326#define tTAGOF 306
327#define tWHILE 307
328/* compiler directives */
329#define tpASSERT 308 /* #assert */
330#define tpDEFINE 309
331#define tpELSE 310 /* #else */
332#define tpEMIT 311
333#define tpENDIF 312
334#define tpENDINPUT 313
335#define tpENDSCRPT 314
336#define tpFILE 315
337#define tpIF 316 /* #if */
338#define tINCLUDE 317
339#define tpLINE 318
340#define tpPRAGMA 319
341#define tpUNDEF 320
342/* semicolon is a special case, because it can be optional */
343#define tTERM 321 /* semicolon or newline */
344#define tENDEXPR 322 /* forced end of expression */
345/* other recognized tokens */
346#define tNUMBER 323 /* integer number */
347#define tRATIONAL 324 /* rational number */
348#define tSYMBOL 325
349#define tLABEL 326
350#define tSTRING 327
351#define tEXPR 328 /* for assigment to "lastst" only */
352
353/* (reversed) evaluation of staging buffer */
354#define sSTARTREORDER 1
355#define sENDREORDER 2
356#define sEXPRSTART 0xc0 /* top 2 bits set, rest is free */
357#define sMAXARGS 64 /* relates to the bit pattern of sEXPRSTART */
358
359/* codes for ffabort() */
360#define xEXIT 1 /* exit code in PRI */
361#define xASSERTION 2 /* abort caused by failing assertion */
362#define xSTACKERROR 3 /* stack/heap overflow */
363#define xBOUNDSERROR 4 /* array index out of bounds */
364#define xMEMACCESS 5 /* data access error */
365#define xINVINSTR 6 /* invalid instruction */
366#define xSTACKUNDERFLOW 7 /* stack underflow */
367#define xHEAPUNDERFLOW 8 /* heap underflow */
368#define xCALLBACKERR 9 /* no, or invalid, callback */
369#define xSLEEP 12 /* sleep, exit code in PRI, tag in ALT */
370
371/* Miscellaneous */
372#if !defined TRUE
373#define FALSE 0
374#define TRUE 1
375#endif
376#define sIN_CSEG 1 /* if parsing CODE */
377#define sIN_DSEG 2 /* if parsing DATA */
378#define sCHKBOUNDS 1 /* bit position in "debug" variable: check bounds */
379#define sSYMBOLIC 2 /* bit position in "debug" variable: symbolic info */
380#define sNOOPTIMIZE 4 /* bit position in "debug" variable: no optimization */
381#define sRESET 0 /* reset error flag */
382#define sFORCESET 1 /* force error flag on */
383#define sEXPRMARK 2 /* mark start of expression */
384#define sEXPRRELEASE 3 /* mark end of expression */
385
386#if INT_MAX<0x8000u
387#define PUBLICTAG 0x8000u
388#define FIXEDTAG 0x4000u
389#else
390#define PUBLICTAG 0x80000000Lu
391#define FIXEDTAG 0x40000000Lu
392#endif
393#define TAGMASK (~PUBLICTAG)
394
395
396/*
397 * Functions you call from the "driver" program
398 */
399 int sc_compile(int argc, char **argv);
400 int sc_addconstant(char *name, cell value, int tag);
401 int sc_addtag(char *name);
402
403/*
404 * Functions called from the compiler (to be implemented by you)
405 */
406
407/* general console output */
408 int sc_printf(const char *message, ...);
409
410/* error report function */
411 int sc_error(int number, char *message, char *filename,
412 int firstline, int lastline, va_list argptr);
413
414/* input from source file */
415 void *sc_opensrc(char *filename); /* reading only */
416 void sc_closesrc(void *handle); /* never delete */
417 void sc_resetsrc(void *handle, void *position); /* reset to a position marked earlier */
418 char *sc_readsrc(void *handle, char *target, int maxchars);
419 void *sc_getpossrc(void *handle); /* mark the current position */
420 int sc_eofsrc(void *handle);
421
422/* output to intermediate (.ASM) file */
423 void *sc_openasm(int fd); /* read/write */
424 void sc_closeasm(void *handle);
425 void sc_resetasm(void *handle);
426 int sc_writeasm(void *handle, char *str);
427 char *sc_readasm(void *handle, char *target, int maxchars);
428
429/* output to binary (.AMX) file */
430 void *sc_openbin(char *filename);
431 void sc_closebin(void *handle, int deletefile);
432 void sc_resetbin(void *handle);
433 int sc_writebin(void *handle, void *buffer, int size);
434 long sc_lengthbin(void *handle); /* return the length of the file */
435
436/* function prototypes in SC1.C */
437symbol *fetchfunc(char *name, int tag);
438char *operator_symname(char *symname, char *opername, int tag1,
439 int tag2, int numtags, int resulttag);
440char *funcdisplayname(char *dest, char *funcname);
441int constexpr(cell * val, int *tag);
442constvalue *append_constval(constvalue * table, char *name, cell val,
443 short index);
444constvalue *find_constval(constvalue * table, char *name, short index);
445void delete_consttable(constvalue * table);
446void add_constant(char *name, cell val, int vclass, int tag);
447void exporttag(int tag);
448
449/* function prototypes in SC2.C */
450void pushstk(stkitem val);
451stkitem popstk(void);
452int plungequalifiedfile(char *name); /* explicit path included */
453int plungefile(char *name, int try_currentpath, int try_includepaths); /* search through "include" paths */
454void preprocess(void);
455void lexinit(void);
456int lex(cell * lexvalue, char **lexsym);
457void lexpush(void);
458void lexclr(int clreol);
459int matchtoken(int token);
460int tokeninfo(cell * val, char **str);
461int needtoken(int token);
462void stowlit(cell value);
463int alphanum(char c);
464void delete_symbol(symbol * root, symbol * sym);
465void delete_symbols(symbol * root, int level, int del_labels,
466 int delete_functions);
467int refer_symbol(symbol * entry, symbol * bywhom);
468void markusage(symbol * sym, int usage);
469unsigned int namehash(char *name);
470symbol *findglb(char *name);
471symbol *findloc(char *name);
472symbol *findconst(char *name);
473symbol *finddepend(symbol * parent);
474symbol *addsym(char *name, cell addr, int ident, int vclass,
475 int tag, int usage);
476symbol *addvariable(char *name, cell addr, int ident, int vclass,
477 int tag, int dim[], int numdim, int idxtag[]);
478int getlabel(void);
479char *itoh(ucell val);
480
481/* function prototypes in SC3.C */
482int check_userop(void (*oper) (void), int tag1, int tag2,
483 int numparam, value * lval, int *resulttag);
484int matchtag(int formaltag, int actualtag, int allowcoerce);
485int expression(int *constant, cell * val, int *tag,
486 int chkfuncresult);
487int hier14(value * lval1); /* the highest expression level */
488
489/* function prototypes in SC4.C */
490void writeleader(void);
491void writetrailer(void);
492void begcseg(void);
493void begdseg(void);
494void setactivefile(int fnumber);
495cell nameincells(char *name);
496void setfile(char *name, int fileno);
497void setline(int line, int fileno);
498void setlabel(int index);
499void endexpr(int fullexpr);
500void startfunc(char *fname);
501void endfunc(void);
502void alignframe(int numbytes);
503void defsymbol(char *name, int ident, int vclass, cell offset,
504 int tag);
505void symbolrange(int level, cell size);
506void rvalue(value * lval);
507void address(symbol * ptr);
508void store(value * lval);
509void memcopy(cell size);
510void copyarray(symbol * sym, cell size);
511void fillarray(symbol * sym, cell size, cell value);
512void const1(cell val);
513void const2(cell val);
514void moveto1(void);
515void push1(void);
516void push2(void);
517void pushval(cell val);
518void pop1(void);
519void pop2(void);
520void swap1(void);
521void ffswitch(int label);
522void ffcase(cell value, char *labelname, int newtable);
523void ffcall(symbol * sym, int numargs);
524void ffret(void);
525void ffabort(int reason);
526void ffbounds(cell size);
527void jumplabel(int number);
528void defstorage(void);
529void modstk(int delta);
530void setstk(cell value);
531void modheap(int delta);
532void setheap_pri(void);
533void setheap(cell value);
534void cell2addr(void);
535void cell2addr_alt(void);
536void addr2cell(void);
537void char2addr(void);
538void charalign(void);
539void addconst(cell value);
540
541/* Code generation functions for arithmetic operators.
542 *
543 * Syntax: o[u|s|b]_name
544 * | | | +--- name of operator
545 * | | +----- underscore
546 * | +--------- "u"nsigned operator, "s"igned operator or "b"oth
547 * +------------- "o"perator
548 */
549void os_mult(void); /* multiplication (signed) */
550void os_div(void); /* division (signed) */
551void os_mod(void); /* modulus (signed) */
552void ob_add(void); /* addition */
553void ob_sub(void); /* subtraction */
554void ob_sal(void); /* shift left (arithmetic) */
555void os_sar(void); /* shift right (arithmetic, signed) */
556void ou_sar(void); /* shift right (logical, unsigned) */
557void ob_or(void); /* bitwise or */
558void ob_xor(void); /* bitwise xor */
559void ob_and(void); /* bitwise and */
560void ob_eq(void); /* equality */
561void ob_ne(void); /* inequality */
562void relop_prefix(void);
563void relop_suffix(void);
564void os_le(void); /* less or equal (signed) */
565void os_ge(void); /* greater or equal (signed) */
566void os_lt(void); /* less (signed) */
567void os_gt(void); /* greater (signed) */
568
569void lneg(void);
570void neg(void);
571void invert(void);
572void nooperation(void);
573void inc(value * lval);
574void dec(value * lval);
575void jmp_ne0(int number);
576void jmp_eq0(int number);
577void outval(cell val, int newline);
578
579/* function prototypes in SC5.C */
580int error(int number, ...);
581void errorset(int code);
582
583/* function prototypes in SC6.C */
584void assemble(FILE * fout, FILE * fin);
585
586/* function prototypes in SC7.C */
587void stgbuffer_cleanup(void);
588void stgmark(char mark);
589void stgwrite(char *st);
590void stgout(int index);
591void stgdel(int index, cell code_index);
592int stgget(int *index, cell * code_index);
593void stgset(int onoff);
594int phopt_init(void);
595int phopt_cleanup(void);
596
597/* function prototypes in SCLIST.C */
598stringpair *insert_alias(char *name, char *alias);
599stringpair *find_alias(char *name);
600int lookup_alias(char *target, char *name);
601void delete_aliastable(void);
602stringlist *insert_path(char *path);
603char *get_path(int index);
604void delete_pathtable(void);
605stringpair *insert_subst(char *pattern, char *substitution,
606 int prefixlen);
607int get_subst(int index, char **pattern, char **substitution);
608stringpair *find_subst(char *name, int length);
609int delete_subst(char *name, int length);
610void delete_substtable(void);
611
612/* external variables (defined in scvars.c) */
613extern symbol loctab; /* local symbol table */
614extern symbol glbtab; /* global symbol table */
615extern cell *litq; /* the literal queue */
616extern char pline[]; /* the line read from the input file */
617extern char *lptr; /* points to the current position in "pline" */
618extern constvalue tagname_tab; /* tagname table */
619extern constvalue libname_tab; /* library table (#pragma library "..." syntax) *///??? use "stringlist" type
620extern constvalue *curlibrary; /* current library */
621extern symbol *curfunc; /* pointer to current function */
622extern char *inpfname; /* name of the file currently read from */
623extern char outfname[]; /* output file name */
624extern char sc_ctrlchar; /* the control character (or escape character) */
625extern int litidx; /* index to literal table */
626extern int litmax; /* current size of the literal table */
627extern int stgidx; /* index to the staging buffer */
628extern int labnum; /* number of (internal) labels */
629extern int staging; /* true if staging output */
630extern cell declared; /* number of local cells declared */
631extern cell glb_declared; /* number of global cells declared */
632extern cell code_idx; /* number of bytes with generated code */
633extern int ntv_funcid; /* incremental number of native function */
634extern int errnum; /* number of errors */
635extern int warnnum; /* number of warnings */
636extern int sc_debug; /* debug/optimization options (bit field) */
637extern int charbits; /* number of bits for a character */
638extern int sc_packstr; /* strings are packed by default? */
639extern int sc_asmfile; /* create .ASM file? */
640extern int sc_listing; /* create .LST file? */
641extern int sc_compress; /* compress bytecode? */
642extern int sc_needsemicolon; /* semicolon required to terminate expressions? */
643extern int sc_dataalign; /* data alignment value */
644extern int sc_alignnext; /* must frame of the next function be aligned? */
645extern int curseg; /* 1 if currently parsing CODE, 2 if parsing DATA */
646extern cell sc_stksize; /* stack size */
647extern int freading; /* is there an input file ready for reading? */
648extern int fline; /* the line number in the current file */
649extern int fnumber; /* number of files in the file table (debugging) */
650extern int fcurrent; /* current file being processed (debugging) */
651extern int intest; /* true if inside a test */
652extern int sideeffect; /* true if an expression causes a side-effect */
653extern int stmtindent; /* current indent of the statement */
654extern int indent_nowarn; /* skip warning "217 loose indentation" */
655extern int sc_tabsize; /* number of spaces that a TAB represents */
656extern int sc_allowtags; /* allow/detect tagnames in lex() */
657extern int sc_status; /* read/write status */
658extern int sc_rationaltag; /* tag for rational numbers */
659extern int rational_digits; /* number of fractional digits */
660
661extern FILE *inpf; /* file read from (source or include) */
662extern FILE *inpf_org; /* main source file */
663extern FILE *outf; /* file written to */
664
665extern jmp_buf errbuf; /* target of longjmp() on a fatal error */
666
667#endif
diff --git a/libraries/embryo/src/bin/embryo_cc_sc1.c b/libraries/embryo/src/bin/embryo_cc_sc1.c
new file mode 100644
index 0000000..b28b6f3
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc1.c
@@ -0,0 +1,4079 @@
1/* Small compiler
2 * Function and variable definition and declaration, statement parser.
3 *
4 * Copyright (c) ITB CompuPhase, 1997-2003
5 *
6 * This software is provided "as-is", without any express or implied
7 * warranty. In no event will the authors be held liable for any
8 * damages arising from the use of this software. Permission is granted
9 * to anyone to use this software for any purpose, including commercial
10 * applications, and to alter it and redistribute it freely, subject to
11 * the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented;
14 * you must not claim that you wrote the original software.
15 * If you use this software in a product, an acknowledgment in the
16 * product documentation would be appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and
18 * must not be misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source
20 * distribution.
21 * Version: $Id: embryo_cc_sc1.c 61433 2011-07-16 23:19:02Z caro $
22 */
23
24
25#ifdef HAVE_CONFIG_H
26# include <config.h>
27#endif
28
29#include <assert.h>
30#include <ctype.h>
31#include <limits.h>
32#include <stdarg.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36
37#ifdef HAVE_UNISTD_H
38# include <unistd.h>
39#endif
40
41#ifdef HAVE_EVIL
42# include <Evil.h>
43#endif /* HAVE_EVIL */
44
45#include "embryo_cc_sc.h"
46#include "embryo_cc_prefix.h"
47
48#define VERSION_STR "2.4"
49#define VERSION_INT 240
50
51static void resetglobals(void);
52static void initglobals(void);
53static void setopt(int argc, char **argv,
54 char *iname, char *oname,
55 char *pname, char *rname);
56static void setconfig(char *root);
57static void about(void);
58static void setconstants(void);
59static void parse(void);
60static void dumplits(void);
61static void dumpzero(int count);
62static void declfuncvar(int tok, char *symname,
63 int tag, int fpublic,
64 int fstatic, int fstock, int fconst);
65static void declglb(char *firstname, int firsttag,
66 int fpublic, int fstatic, int stock, int fconst);
67static int declloc(int fstatic);
68static void decl_const(int table);
69static void decl_enum(int table);
70static cell needsub(int *tag);
71static void initials(int ident, int tag,
72 cell * size, int dim[], int numdim);
73static cell initvector(int ident, int tag, cell size, int fillzero);
74static cell init(int ident, int *tag);
75static void funcstub(int native);
76static int newfunc(char *firstname, int firsttag,
77 int fpublic, int fstatic, int stock);
78static int declargs(symbol * sym);
79static void doarg(char *name, int ident, int offset,
80 int tags[], int numtags,
81 int fpublic, int fconst, arginfo * arg);
82static void reduce_referrers(symbol * root);
83static int testsymbols(symbol * root, int level,
84 int testlabs, int testconst);
85static void destructsymbols(symbol * root, int level);
86static constvalue *find_constval_byval(constvalue * table, cell val);
87static void statement(int *lastindent, int allow_decl);
88static void compound(void);
89static void doexpr(int comma, int chkeffect,
90 int allowarray, int mark_endexpr,
91 int *tag, int chkfuncresult);
92static void doassert(void);
93static void doexit(void);
94static void test(int label, int parens, int invert);
95static void doif(void);
96static void dowhile(void);
97static void dodo(void);
98static void dofor(void);
99static void doswitch(void);
100static void dogoto(void);
101static void dolabel(void);
102static symbol *fetchlab(char *name);
103static void doreturn(void);
104static void dobreak(void);
105static void docont(void);
106static void dosleep(void);
107static void addwhile(int *ptr);
108static void delwhile(void);
109static int *readwhile(void);
110
111static int lastst = 0; /* last executed statement type */
112static int nestlevel = 0; /* number of active (open) compound statements */
113static int rettype = 0; /* the type that a "return" expression should have */
114static int skipinput = 0; /* number of lines to skip from the first input file */
115static int wq[wqTABSZ]; /* "while queue", internal stack for nested loops */
116static int *wqptr; /* pointer to next entry */
117static char binfname[PATH_MAX]; /* binary file name */
118
119int
120main(int argc, char *argv[], char *env[] __UNUSED__)
121{
122 e_prefix_determine(argv[0]);
123 return sc_compile(argc, argv);
124}
125
126int
127sc_error(int number, char *message, char *filename, int firstline,
128 int lastline, va_list argptr)
129{
130 static char *prefix[3] = { "error", "fatal error", "warning" };
131
132 if (number != 0)
133 {
134 char *pre;
135
136 pre = prefix[number / 100];
137 if (firstline >= 0)
138 fprintf(stderr, "%s(%d -- %d) : %s %03d: ", filename, firstline,
139 lastline, pre, number);
140 else
141 fprintf(stderr, "%s(%d) : %s %03d: ", filename, lastline, pre,
142 number);
143 } /* if */
144 vfprintf(stderr, message, argptr);
145 fflush(stderr);
146 return 0;
147}
148
149void *
150sc_opensrc(char *filename)
151{
152 return fopen(filename, "rb");
153}
154
155void
156sc_closesrc(void *handle)
157{
158 assert(handle != NULL);
159 fclose((FILE *) handle);
160}
161
162void
163sc_resetsrc(void *handle, void *position)
164{
165 assert(handle != NULL);
166 fsetpos((FILE *) handle, (fpos_t *) position);
167}
168
169char *
170sc_readsrc(void *handle, char *target, int maxchars)
171{
172 return fgets(target, maxchars, (FILE *) handle);
173}
174
175void *
176sc_getpossrc(void *handle)
177{
178 static fpos_t lastpos; /* may need to have a LIFO stack of
179 * such positions */
180
181 fgetpos((FILE *) handle, &lastpos);
182 return &lastpos;
183}
184
185int
186sc_eofsrc(void *handle)
187{
188 return feof((FILE *) handle);
189}
190
191void *
192sc_openasm(int fd)
193{
194 return fdopen(fd, "w+");
195}
196
197void
198sc_closeasm(void *handle)
199{
200 if (handle)
201 fclose((FILE *) handle);
202}
203
204void
205sc_resetasm(void *handle)
206{
207 fflush((FILE *) handle);
208 fseek((FILE *) handle, 0, SEEK_SET);
209}
210
211int
212sc_writeasm(void *handle, char *st)
213{
214 return fputs(st, (FILE *) handle) >= 0;
215}
216
217char *
218sc_readasm(void *handle, char *target, int maxchars)
219{
220 return fgets(target, maxchars, (FILE *) handle);
221}
222
223void *
224sc_openbin(char *filename)
225{
226 return fopen(filename, "wb");
227}
228
229void
230sc_closebin(void *handle, int deletefile)
231{
232 fclose((FILE *) handle);
233 if (deletefile)
234 unlink(binfname);
235}
236
237void
238sc_resetbin(void *handle)
239{
240 fflush((FILE *) handle);
241 fseek((FILE *) handle, 0, SEEK_SET);
242}
243
244int
245sc_writebin(void *handle, void *buffer, int size)
246{
247 return (int)fwrite(buffer, 1, size, (FILE *) handle) == size;
248}
249
250long
251sc_lengthbin(void *handle)
252{
253 return ftell((FILE *) handle);
254}
255
256/* "main" of the compiler
257 */
258int
259sc_compile(int argc, char *argv[])
260{
261 int entry, i, jmpcode, fd_out;
262 int retcode;
263 char incfname[PATH_MAX];
264 char reportname[PATH_MAX];
265 FILE *binf;
266 void *inpfmark;
267 char lcl_ctrlchar;
268 int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
269 char *tmpdir;
270
271 /* set global variables to their initial value */
272 binf = NULL;
273 initglobals();
274 errorset(sRESET);
275 errorset(sEXPRRELEASE);
276 lexinit();
277
278 /* make sure that we clean up on a fatal error; do this before the
279 * first call to error(). */
280 if ((jmpcode = setjmp(errbuf)) != 0)
281 goto cleanup;
282
283 /* allocate memory for fixed tables */
284 inpfname = (char *)malloc(PATH_MAX);
285 litq = (cell *) malloc(litmax * sizeof(cell));
286 if (!litq)
287 error(103); /* insufficient memory */
288 if (!phopt_init())
289 error(103); /* insufficient memory */
290
291 setopt(argc, argv, inpfname, binfname, incfname, reportname);
292
293 /* open the output file */
294
295#ifndef HAVE_EVIL
296 tmpdir = getenv("TMPDIR");
297 if (!tmpdir) tmpdir = "/tmp";
298#else
299 tmpdir = (char *)evil_tmpdir_get();
300#endif /* ! HAVE_EVIL */
301
302 snprintf(outfname, PATH_MAX, "%s/embryo_cc.asm-tmp-XXXXXX", tmpdir);
303 fd_out = mkstemp(outfname);
304 if (fd_out < 0)
305 error(101, outfname);
306
307 setconfig(argv[0]); /* the path to the include files */
308 lcl_ctrlchar = sc_ctrlchar;
309 lcl_packstr = sc_packstr;
310 lcl_needsemicolon = sc_needsemicolon;
311 lcl_tabsize = sc_tabsize;
312 inpf = inpf_org = (FILE *) sc_opensrc(inpfname);
313 if (!inpf)
314 error(100, inpfname);
315 freading = TRUE;
316 outf = (FILE *) sc_openasm(fd_out); /* first write to assembler
317 * file (may be temporary) */
318 if (!outf)
319 error(101, outfname);
320 /* immediately open the binary file, for other programs to check */
321 binf = (FILE *) sc_openbin(binfname);
322 if (!binf)
323 error(101, binfname);
324 setconstants(); /* set predefined constants and tagnames */
325 for (i = 0; i < skipinput; i++) /* skip lines in the input file */
326 if (sc_readsrc(inpf, pline, sLINEMAX))
327 fline++; /* keep line number up to date */
328 skipinput = fline;
329 sc_status = statFIRST;
330 /* do the first pass through the file */
331 inpfmark = sc_getpossrc(inpf);
332 if (incfname[0] != '\0')
333 {
334 if (strcmp(incfname, sDEF_PREFIX) == 0)
335 {
336 plungefile(incfname, FALSE, TRUE); /* parse "default.inc" */
337 }
338 else
339 {
340 if (!plungequalifiedfile(incfname)) /* parse "prefix" include
341 * file */
342 error(100, incfname); /* cannot read from ... (fatal error) */
343 } /* if */
344 } /* if */
345 preprocess(); /* fetch first line */
346 parse(); /* process all input */
347
348 /* second pass */
349 sc_status = statWRITE; /* set, to enable warnings */
350
351 /* ??? for re-parsing the listing file instead of the original source
352 * file (and doing preprocessing twice):
353 * - close input file, close listing file
354 * - re-open listing file for reading (inpf)
355 * - open assembler file (outf)
356 */
357
358 /* reset "defined" flag of all functions and global variables */
359 reduce_referrers(&glbtab);
360 delete_symbols(&glbtab, 0, TRUE, FALSE);
361#if !defined NO_DEFINE
362 delete_substtable();
363#endif
364 resetglobals();
365 sc_ctrlchar = lcl_ctrlchar;
366 sc_packstr = lcl_packstr;
367 sc_needsemicolon = lcl_needsemicolon;
368 sc_tabsize = lcl_tabsize;
369 errorset(sRESET);
370 /* reset the source file */
371 inpf = inpf_org;
372 freading = TRUE;
373 sc_resetsrc(inpf, inpfmark); /* reset file position */
374 fline = skipinput; /* reset line number */
375 lexinit(); /* clear internal flags of lex() */
376 sc_status = statWRITE; /* allow to write --this variable was reset
377 * by resetglobals() */
378 writeleader();
379 setfile(inpfname, fnumber);
380 if (incfname[0] != '\0')
381 {
382 if (strcmp(incfname, sDEF_PREFIX) == 0)
383 plungefile(incfname, FALSE, TRUE); /* parse "default.inc" (again) */
384 else
385 plungequalifiedfile(incfname); /* parse implicit include
386 * file (again) */
387 } /* if */
388 preprocess(); /* fetch first line */
389 parse(); /* process all input */
390 /* inpf is already closed when readline() attempts to pop of a file */
391 writetrailer(); /* write remaining stuff */
392
393 entry = testsymbols(&glbtab, 0, TRUE, FALSE); /* test for unused
394 * or undefined functions and variables */
395 if (!entry)
396 error(13); /* no entry point (no public functions) */
397
398 cleanup:
399 if (inpf) /* main source file is not closed, do it now */
400 sc_closesrc(inpf);
401 /* write the binary file (the file is already open) */
402 if (errnum == 0 && jmpcode == 0)
403 {
404 assert(binf != NULL);
405 sc_resetasm(outf); /* flush and loop back, for reading */
406 assemble(binf, outf); /* assembler file is now input */
407 } /* if */
408 if (outf)
409 sc_closeasm(outf);
410 unlink (outfname);
411 if (binf)
412 sc_closebin(binf, errnum != 0);
413
414 if (inpfname)
415 free(inpfname);
416 if (litq)
417 free(litq);
418 phopt_cleanup();
419 stgbuffer_cleanup();
420 assert(jmpcode != 0 || loctab.next == NULL); /* on normal flow,
421 * local symbols
422 * should already have been deleted */
423 delete_symbols(&loctab, 0, TRUE, TRUE); /* delete local variables
424 * if not yet done (i.e.
425 * on a fatal error) */
426 delete_symbols(&glbtab, 0, TRUE, TRUE);
427 delete_consttable(&tagname_tab);
428 delete_consttable(&libname_tab);
429 delete_aliastable();
430 delete_pathtable();
431#if !defined NO_DEFINE
432 delete_substtable();
433#endif
434 if (errnum != 0)
435 {
436 printf("\n%d Error%s.\n", errnum, (errnum > 1) ? "s" : "");
437 retcode = 2;
438 }
439 else if (warnnum != 0)
440 {
441 printf("\n%d Warning%s.\n", warnnum, (warnnum > 1) ? "s" : "");
442 retcode = 1;
443 }
444 else
445 {
446 retcode = jmpcode;
447 } /* if */
448 return retcode;
449}
450
451int
452sc_addconstant(char *name, cell value, int tag)
453{
454 errorset(sFORCESET); /* make sure error engine is silenced */
455 sc_status = statIDLE;
456 add_constant(name, value, sGLOBAL, tag);
457 return 1;
458}
459
460int
461sc_addtag(char *name)
462{
463 cell val;
464 constvalue *ptr;
465 int last, tag;
466
467 if (!name)
468 {
469 /* no tagname was given, check for one */
470 if (lex(&val, &name) != tLABEL)
471 {
472 lexpush();
473 return 0; /* untagged */
474 } /* if */
475 } /* if */
476
477 last = 0;
478 ptr = tagname_tab.next;
479 while (ptr)
480 {
481 tag = (int)(ptr->value & TAGMASK);
482 if (strcmp(name, ptr->name) == 0)
483 return tag; /* tagname is known, return its sequence number */
484 tag &= (int)~FIXEDTAG;
485 if (tag > last)
486 last = tag;
487 ptr = ptr->next;
488 } /* while */
489
490 /* tagname currently unknown, add it */
491 tag = last + 1; /* guaranteed not to exist already */
492 if (isupper(*name))
493 tag |= (int)FIXEDTAG;
494 append_constval(&tagname_tab, name, (cell) tag, 0);
495 return tag;
496}
497
498static void
499resetglobals(void)
500{
501 /* reset the subset of global variables that is modified by the
502 * first pass */
503 curfunc = NULL; /* pointer to current function */
504 lastst = 0; /* last executed statement type */
505 nestlevel = 0; /* number of active (open) compound statements */
506 rettype = 0; /* the type that a "return" expression should have */
507 litidx = 0; /* index to literal table */
508 stgidx = 0; /* index to the staging buffer */
509 labnum = 0; /* number of (internal) labels */
510 staging = 0; /* true if staging output */
511 declared = 0; /* number of local cells declared */
512 glb_declared = 0; /* number of global cells declared */
513 code_idx = 0; /* number of bytes with generated code */
514 ntv_funcid = 0; /* incremental number of native function */
515 curseg = 0; /* 1 if currently parsing CODE, 2 if parsing DATA */
516 freading = FALSE; /* no input file ready yet */
517 fline = 0; /* the line number in the current file */
518 fnumber = 0; /* the file number in the file table (debugging) */
519 fcurrent = 0; /* current file being processed (debugging) */
520 intest = 0; /* true if inside a test */
521 sideeffect = 0; /* true if an expression causes a side-effect */
522 stmtindent = 0; /* current indent of the statement */
523 indent_nowarn = TRUE; /* do not skip warning "217 loose indentation" */
524 sc_allowtags = TRUE; /* allow/detect tagnames */
525 sc_status = statIDLE;
526}
527
528static void
529initglobals(void)
530{
531 resetglobals();
532
533 skipinput = 0; /* number of lines to skip from the first
534 * input file */
535 sc_ctrlchar = CTRL_CHAR; /* the escape character */
536 litmax = sDEF_LITMAX; /* current size of the literal table */
537 errnum = 0; /* number of errors */
538 warnnum = 0; /* number of warnings */
539/* sc_debug=sCHKBOUNDS; by default: bounds checking+assertions */
540 sc_debug = 0; /* by default: no debug */
541 charbits = 8; /* a "char" is 8 bits */
542 sc_packstr = FALSE; /* strings are unpacked by default */
543/* sc_compress=TRUE; compress output bytecodes */
544 sc_compress = FALSE; /* compress output bytecodes */
545 sc_needsemicolon = FALSE; /* semicolon required to terminate
546 * expressions? */
547 sc_dataalign = 4;
548 sc_stksize = sDEF_AMXSTACK; /* default stack size */
549 sc_tabsize = 8; /* assume a TAB is 8 spaces */
550 sc_rationaltag = 0; /* assume no support for rational numbers */
551 rational_digits = 0; /* number of fractional digits */
552
553 outfname[0] = '\0'; /* output file name */
554 inpf = NULL; /* file read from */
555 inpfname = NULL; /* pointer to name of the file currently
556 * read from */
557 outf = NULL; /* file written to */
558 litq = NULL; /* the literal queue */
559 glbtab.next = NULL; /* clear global variables/constants table */
560 loctab.next = NULL; /* " local " / " " */
561 tagname_tab.next = NULL; /* tagname table */
562 libname_tab.next = NULL; /* library table (#pragma library "..."
563 * syntax) */
564
565 pline[0] = '\0'; /* the line read from the input file */
566 lptr = NULL; /* points to the current position in "pline" */
567 curlibrary = NULL; /* current library */
568 inpf_org = NULL; /* main source file */
569
570 wqptr = wq; /* initialize while queue pointer */
571
572}
573
574static void
575parseoptions(int argc, char **argv, char *iname, char *oname,
576 char *pname __UNUSED__, char *rname __UNUSED__)
577{
578 char str[PATH_MAX];
579 int i, stack_size;
580 size_t len;
581
582 /* use embryo include dir always */
583 snprintf(str, sizeof(str), "%s/include/", e_prefix_data_get());
584 insert_path(str);
585 insert_path("./");
586
587 for (i = 1; i < argc; i++)
588 {
589 if (!strcmp (argv[i], "-i") && (i + 1 < argc) && *argv[i + 1])
590 {
591 /* include directory */
592 i++;
593 strncpy(str, argv[i], sizeof(str));
594
595 len = strlen(str);
596 if (str[len - 1] != DIRSEP_CHAR)
597 {
598 str[len] = DIRSEP_CHAR;
599 str[len + 1] = '\0';
600 }
601
602 insert_path(str);
603 }
604 else if (!strcmp (argv[i], "-o") && (i + 1 < argc) && *argv[i + 1])
605 {
606 /* output file */
607 i++;
608 strcpy(oname, argv[i]); /* FIXME */
609 }
610 else if (!strcmp (argv[i], "-S") && (i + 1 < argc) && *argv[i + 1])
611 {
612 /* stack size */
613 i++;
614 stack_size = atoi(argv[i]);
615
616 if (stack_size > 64)
617 sc_stksize = (cell) stack_size;
618 else
619 about();
620 }
621 else if (!*iname)
622 {
623 /* input file */
624 strcpy(iname, argv[i]); /* FIXME */
625 }
626 else
627 {
628 /* only allow one input filename */
629 about();
630 }
631 }
632}
633
634static void
635setopt(int argc, char **argv, char *iname, char *oname,
636 char *pname, char *rname)
637{
638 *iname = '\0';
639 *oname = '\0';
640 *pname = '\0';
641 *rname = '\0';
642 strcpy(pname, sDEF_PREFIX);
643
644 parseoptions(argc, argv, iname, oname, pname, rname);
645 if (iname[0] == '\0')
646 about();
647}
648
649static void
650setconfig(char *root)
651{
652 char path[PATH_MAX];
653 char *ptr;
654 int len;
655
656 /* add the default "include" directory */
657 if (root)
658 {
659 /* path + filename (hopefully) */
660 strncpy(path, root, sizeof(path) - 1);
661 path[sizeof(path) - 1] = 0;
662 }
663/* terminate just behind last \ or : */
664 if ((ptr = strrchr(path, DIRSEP_CHAR))
665 || (ptr = strchr(path, ':')))
666 {
667 /* If there was no terminating "\" or ":",
668 * the filename probably does not
669 * contain the path; so we just don't add it
670 * to the list in that case
671 */
672 *(ptr + 1) = '\0';
673 if (strlen(path) < (sizeof(path) - 1 - 7))
674 {
675 strcat(path, "include");
676 }
677 len = strlen(path);
678 path[len] = DIRSEP_CHAR;
679 path[len + 1] = '\0';
680 insert_path(path);
681 } /* if */
682}
683
684static void
685about(void)
686{
687 printf("Usage: embryo_cc <filename> [options]\n\n");
688 printf("Options:\n");
689#if 0
690 printf
691 (" -A<num> alignment in bytes of the data segment and the\
692 stack\n");
693
694 printf
695 (" -a output assembler code (skip code generation\
696 pass)\n");
697
698 printf
699 (" -C[+/-] compact encoding for output file (default=%c)\n",
700 sc_compress ? '+' : '-');
701 printf(" -c8 [default] a character is 8-bits\
702 (ASCII/ISO Latin-1)\n");
703
704 printf(" -c16 a character is 16-bits (Unicode)\n");
705#if defined dos_setdrive
706 printf(" -Dpath active directory path\n");
707#endif
708 printf
709 (" -d0 no symbolic information, no run-time checks\n");
710 printf(" -d1 [default] run-time checks, no symbolic\
711 information\n");
712 printf
713 (" -d2 full debug information and dynamic checking\n");
714 printf(" -d3 full debug information, dynamic checking,\
715 no optimization\n");
716#endif
717 printf(" -i <name> path for include files\n");
718#if 0
719 printf(" -l create list file (preprocess only)\n");
720#endif
721 printf(" -o <name> set base name of output file\n");
722#if 0
723 printf
724 (" -P[+/-] strings are \"packed\" by default (default=%c)\n",
725 sc_packstr ? '+' : '-');
726 printf(" -p<name> set name of \"prefix\" file\n");
727 if (!waitkey())
728 longjmp(errbuf, 3);
729#endif
730 printf
731 (" -S <num> stack/heap size in cells (default=%d, min=65)\n",
732 (int)sc_stksize);
733#if 0
734 printf(" -s<num> skip lines from the input file\n");
735 printf
736 (" -t<num> TAB indent size (in character positions)\n");
737 printf(" -\\ use '\\' for escape characters\n");
738 printf(" -^ use '^' for escape characters\n");
739 printf(" -;[+/-] require a semicolon to end each statement\
740 (default=%c)\n", sc_needsemicolon ? '+' : '-');
741
742 printf
743 (" sym=val define constant \"sym\" with value \"val\"\n");
744 printf(" sym= define constant \"sym\" with value 0\n");
745#endif
746 longjmp(errbuf, 3); /* user abort */
747}
748
749static void
750setconstants(void)
751{
752 int debug;
753
754 assert(sc_status == statIDLE);
755 append_constval(&tagname_tab, "_", 0, 0); /* "untagged" */
756 append_constval(&tagname_tab, "bool", 1, 0);
757
758 add_constant("true", 1, sGLOBAL, 1); /* boolean flags */
759 add_constant("false", 0, sGLOBAL, 1);
760 add_constant("EOS", 0, sGLOBAL, 0); /* End Of String, or '\0' */
761 add_constant("cellbits", 32, sGLOBAL, 0);
762 add_constant("cellmax", INT_MAX, sGLOBAL, 0);
763 add_constant("cellmin", INT_MIN, sGLOBAL, 0);
764 add_constant("charbits", charbits, sGLOBAL, 0);
765 add_constant("charmin", 0, sGLOBAL, 0);
766 add_constant("charmax", (charbits == 16) ? 0xffff : 0xff, sGLOBAL, 0);
767
768 add_constant("__Small", VERSION_INT, sGLOBAL, 0);
769
770 debug = 0;
771 if ((sc_debug & (sCHKBOUNDS | sSYMBOLIC)) == (sCHKBOUNDS | sSYMBOLIC))
772 debug = 2;
773 else if ((sc_debug & sCHKBOUNDS) == sCHKBOUNDS)
774 debug = 1;
775 add_constant("debug", debug, sGLOBAL, 0);
776}
777
778/* parse - process all input text
779 *
780 * At this level, only static declarations and function definitions
781 * are legal.
782 */
783static void
784parse(void)
785{
786 int tok, tag, fconst, fstock, fstatic;
787 cell val;
788 char *str;
789
790 while (freading)
791 {
792 /* first try whether a declaration possibly is native or public */
793 tok = lex(&val, &str); /* read in (new) token */
794 switch (tok)
795 {
796 case 0:
797 /* ignore zero's */
798 break;
799 case tNEW:
800 fconst = matchtoken(tCONST);
801 declglb(NULL, 0, FALSE, FALSE, FALSE, fconst);
802 break;
803 case tSTATIC:
804 /* This can be a static function or a static global variable;
805 * we know which of the two as soon as we have parsed up to the
806 * point where an opening parenthesis of a function would be
807 * expected. To back out after deciding it was a declaration of
808 * a static variable after all, we have to store the symbol name
809 * and tag.
810 */
811 fstock = matchtoken(tSTOCK);
812 fconst = matchtoken(tCONST);
813 tag = sc_addtag(NULL);
814 tok = lex(&val, &str);
815 if (tok == tNATIVE || tok == tPUBLIC)
816 {
817 error(42); /* invalid combination of class specifiers */
818 break;
819 } /* if */
820 declfuncvar(tok, str, tag, FALSE, TRUE, fstock, fconst);
821 break;
822 case tCONST:
823 decl_const(sGLOBAL);
824 break;
825 case tENUM:
826 decl_enum(sGLOBAL);
827 break;
828 case tPUBLIC:
829 /* This can be a public function or a public variable;
830 * see the comment above (for static functions/variables)
831 * for details.
832 */
833 fconst = matchtoken(tCONST);
834 tag = sc_addtag(NULL);
835 tok = lex(&val, &str);
836 if (tok == tNATIVE || tok == tSTOCK || tok == tSTATIC)
837 {
838 error(42); /* invalid combination of class specifiers */
839 break;
840 } /* if */
841 declfuncvar(tok, str, tag, TRUE, FALSE, FALSE, fconst);
842 break;
843 case tSTOCK:
844 /* This can be a stock function or a stock *global) variable;
845 * see the comment above (for static functions/variables) for
846 * details.
847 */
848 fstatic = matchtoken(tSTATIC);
849 fconst = matchtoken(tCONST);
850 tag = sc_addtag(NULL);
851 tok = lex(&val, &str);
852 if (tok == tNATIVE || tok == tPUBLIC)
853 {
854 error(42); /* invalid combination of class specifiers */
855 break;
856 } /* if */
857 declfuncvar(tok, str, tag, FALSE, fstatic, TRUE, fconst);
858 break;
859 case tLABEL:
860 case tSYMBOL:
861 case tOPERATOR:
862 lexpush();
863 if (!newfunc(NULL, -1, FALSE, FALSE, FALSE))
864 {
865 error(10); /* illegal function or declaration */
866 lexclr(TRUE); /* drop the rest of the line */
867 } /* if */
868 break;
869 case tNATIVE:
870 funcstub(TRUE); /* create a dummy function */
871 break;
872 case tFORWARD:
873 funcstub(FALSE);
874 break;
875 case '}':
876 error(54); /* unmatched closing brace */
877 break;
878 case '{':
879 error(55); /* start of function body without function header */
880 break;
881 default:
882 if (freading)
883 {
884 error(10); /* illegal function or declaration */
885 lexclr(TRUE); /* drop the rest of the line */
886 } /* if */
887 } /* switch */
888 } /* while */
889}
890
891/* dumplits
892 *
893 * Dump the literal pool (strings etc.)
894 *
895 * Global references: litidx (referred to only)
896 */
897static void
898dumplits(void)
899{
900 int j, k;
901
902 k = 0;
903 while (k < litidx)
904 {
905 /* should be in the data segment */
906 assert(curseg == 2);
907 defstorage();
908 j = 16; /* 16 values per line */
909 while (j && k < litidx)
910 {
911 outval(litq[k], FALSE);
912 stgwrite(" ");
913 k++;
914 j--;
915 if (j == 0 || k >= litidx)
916 stgwrite("\n"); /* force a newline after 10 dumps */
917 /* Note: stgwrite() buffers a line until it is complete. It recognizes
918 * the end of line as a sequence of "\n\0", so something like "\n\t"
919 * so should not be passed to stgwrite().
920 */
921 } /* while */
922 } /* while */
923}
924
925/* dumpzero
926 *
927 * Dump zero's for default initial values
928 */
929static void
930dumpzero(int count)
931{
932 int i;
933
934 if (count <= 0)
935 return;
936 assert(curseg == 2);
937 defstorage();
938 i = 0;
939 while (count-- > 0)
940 {
941 outval(0, FALSE);
942 i = (i + 1) % 16;
943 stgwrite((i == 0 || count == 0) ? "\n" : " ");
944 if (i == 0 && count > 0)
945 defstorage();
946 } /* while */
947}
948
949static void
950aligndata(int numbytes)
951{
952 if ((((glb_declared + litidx) * sizeof(cell)) % numbytes) != 0)
953 {
954 while ((((glb_declared + litidx) * sizeof(cell)) % numbytes) != 0)
955 stowlit(0);
956 } /* if */
957
958}
959
960static void
961declfuncvar(int tok, char *symname, int tag, int fpublic, int fstatic,
962 int fstock, int fconst)
963{
964 char name[sNAMEMAX + 1];
965
966 if (tok != tSYMBOL && tok != tOPERATOR)
967 {
968 if (freading)
969 error(20, symname); /* invalid symbol name */
970 return;
971 } /* if */
972 if (tok == tOPERATOR)
973 {
974 lexpush();
975 if (!newfunc(NULL, tag, fpublic, fstatic, fstock))
976 error(10); /* illegal function or declaration */
977 }
978 else
979 {
980 assert(strlen(symname) <= sNAMEMAX);
981 strcpy(name, symname);
982 if (fconst || !newfunc(name, tag, fpublic, fstatic, fstock))
983 declglb(name, tag, fpublic, fstatic, fstock, fconst);
984 /* if not a static function, try a static variable */
985 } /* if */
986}
987
988/* declglb - declare global symbols
989 *
990 * Declare a static (global) variable. Global variables are stored in
991 * the DATA segment.
992 *
993 * global references: glb_declared (altered)
994 */
995static void
996declglb(char *firstname, int firsttag, int fpublic, int fstatic,
997 int stock, int fconst)
998{
999 int ident, tag, ispublic;
1000 int idxtag[sDIMEN_MAX];
1001 char name[sNAMEMAX + 1];
1002 cell val, size, cidx;
1003 char *str;
1004 int dim[sDIMEN_MAX];
1005 int numdim, level;
1006 int filenum;
1007 symbol *sym;
1008
1009#if !defined NDEBUG
1010 cell glbdecl = 0;
1011#endif
1012
1013 filenum = fcurrent; /* save file number at the start of the
1014 * declaration */
1015 do
1016 {
1017 size = 1; /* single size (no array) */
1018 numdim = 0; /* no dimensions */
1019 ident = iVARIABLE;
1020 if (firstname)
1021 {
1022 assert(strlen(firstname) <= sNAMEMAX);
1023 strcpy(name, firstname); /* save symbol name */
1024 tag = firsttag;
1025 firstname = NULL;
1026 }
1027 else
1028 {
1029 tag = sc_addtag(NULL);
1030 if (lex(&val, &str) != tSYMBOL) /* read in (new) token */
1031 error(20, str); /* invalid symbol name */
1032 assert(strlen(str) <= sNAMEMAX);
1033 strcpy(name, str); /* save symbol name */
1034 } /* if */
1035 sym = findglb(name);
1036 if (!sym)
1037 sym = findconst(name);
1038 if (sym && (sym->usage & uDEFINE) != 0)
1039 error(21, name); /* symbol already defined */
1040 ispublic = fpublic;
1041 if (name[0] == PUBLIC_CHAR)
1042 {
1043 ispublic = TRUE; /* implicitly public variable */
1044 if (stock || fstatic)
1045 error(42); /* invalid combination of class specifiers */
1046 } /* if */
1047 while (matchtoken('['))
1048 {
1049 ident = iARRAY;
1050 if (numdim == sDIMEN_MAX)
1051 {
1052 error(53); /* exceeding maximum number of dimensions */
1053 return;
1054 } /* if */
1055 if (numdim > 0 && dim[numdim - 1] == 0)
1056 error(52); /* only last dimension may be variable length */
1057 size = needsub(&idxtag[numdim]); /* get size; size==0 for
1058 * "var[]" */
1059#if INT_MAX < LONG_MAX
1060 if (size > INT_MAX)
1061 error(105); /* overflow, exceeding capacity */
1062#endif
1063 if (ispublic)
1064 error(56, name); /* arrays cannot be public */
1065 dim[numdim++] = (int)size;
1066 } /* while */
1067 /* if this variable is never used (which can be detected only in
1068 * the second stage), shut off code generation; make an exception
1069 * for public variables
1070 */
1071 cidx = 0; /* only to avoid a compiler warning */
1072 if (sc_status == statWRITE && sym
1073 && (sym->usage & (uREAD | uWRITTEN | uPUBLIC)) == 0)
1074 {
1075 sc_status = statSKIP;
1076 cidx = code_idx;
1077#if !defined NDEBUG
1078 glbdecl = glb_declared;
1079#endif
1080 } /* if */
1081 defsymbol(name, ident, sGLOBAL, sizeof(cell) * glb_declared, tag);
1082 begdseg(); /* real (initialized) data in data segment */
1083 assert(litidx == 0); /* literal queue should be empty */
1084 if (sc_alignnext)
1085 {
1086 litidx = 0;
1087 aligndata(sc_dataalign);
1088 dumplits(); /* dump the literal queue */
1089 sc_alignnext = FALSE;
1090 litidx = 0; /* global initial data is dumped, so restart at zero */
1091 } /* if */
1092 initials(ident, tag, &size, dim, numdim); /* stores values in
1093 * the literal queue */
1094 if (numdim == 1)
1095 dim[0] = (int)size;
1096 dumplits(); /* dump the literal queue */
1097 dumpzero((int)size - litidx);
1098 litidx = 0;
1099 if (!sym)
1100 { /* define only if not yet defined */
1101 sym =
1102 addvariable(name, sizeof(cell) * glb_declared, ident, sGLOBAL,
1103 tag, dim, numdim, idxtag);
1104 }
1105 else
1106 { /* if declared but not yet defined, adjust the
1107 * variable's address */
1108 sym->addr = sizeof(cell) * glb_declared;
1109 sym->usage |= uDEFINE;
1110 } /* if */
1111 if (ispublic)
1112 sym->usage |= uPUBLIC;
1113 if (fconst)
1114 sym->usage |= uCONST;
1115 if (stock)
1116 sym->usage |= uSTOCK;
1117 if (fstatic)
1118 sym->fnumber = filenum;
1119 if (ident == iARRAY)
1120 for (level = 0; level < numdim; level++)
1121 symbolrange(level, dim[level]);
1122 if (sc_status == statSKIP)
1123 {
1124 sc_status = statWRITE;
1125 code_idx = cidx;
1126 assert(glb_declared == glbdecl);
1127 }
1128 else
1129 {
1130 glb_declared += (int)size; /* add total number of cells */
1131 } /* if */
1132 }
1133 while (matchtoken(',')); /* enddo *//* more? */
1134 needtoken(tTERM); /* if not comma, must be semicolumn */
1135}
1136
1137/* declloc - declare local symbols
1138 *
1139 * Declare local (automatic) variables. Since these variables are
1140 * relative to the STACK, there is no switch to the DATA segment.
1141 * These variables cannot be initialized either.
1142 *
1143 * global references: declared (altered)
1144 * funcstatus (referred to only)
1145 */
1146static int
1147declloc(int fstatic)
1148{
1149 int ident, tag;
1150 int idxtag[sDIMEN_MAX];
1151 char name[sNAMEMAX + 1];
1152 symbol *sym;
1153 cell val, size;
1154 char *str;
1155 value lval = { NULL, 0, 0, 0, 0, NULL };
1156 int cur_lit = 0;
1157 int dim[sDIMEN_MAX];
1158 int numdim, level;
1159 int fconst;
1160
1161 fconst = matchtoken(tCONST);
1162 do
1163 {
1164 ident = iVARIABLE;
1165 size = 1;
1166 numdim = 0; /* no dimensions */
1167 tag = sc_addtag(NULL);
1168 if (lex(&val, &str) != tSYMBOL) /* read in (new) token */
1169 error(20, str); /* invalid symbol name */
1170 assert(strlen(str) <= sNAMEMAX);
1171 strcpy(name, str); /* save symbol name */
1172 if (name[0] == PUBLIC_CHAR)
1173 error(56, name); /* local variables cannot be public */
1174 /* Note: block locals may be named identical to locals at higher
1175 * compound blocks (as with standard C); so we must check (and add)
1176 * the "nesting level" of local variables to verify the
1177 * multi-definition of symbols.
1178 */
1179 if ((sym = findloc(name)) && sym->compound == nestlevel)
1180 error(21, name); /* symbol already defined */
1181 /* Although valid, a local variable whose name is equal to that
1182 * of a global variable or to that of a local variable at a lower
1183 * level might indicate a bug.
1184 */
1185 if (((sym = findloc(name)) && sym->compound != nestlevel)
1186 || findglb(name))
1187 error(219, name); /* variable shadows another symbol */
1188 while (matchtoken('['))
1189 {
1190 ident = iARRAY;
1191 if (numdim == sDIMEN_MAX)
1192 {
1193 error(53); /* exceeding maximum number of dimensions */
1194 return ident;
1195 } /* if */
1196 if (numdim > 0 && dim[numdim - 1] == 0)
1197 error(52); /* only last dimension may be variable length */
1198 size = needsub(&idxtag[numdim]); /* get size; size==0 for "var[]" */
1199#if INT_MAX < LONG_MAX
1200 if (size > INT_MAX)
1201 error(105); /* overflow, exceeding capacity */
1202#endif
1203 dim[numdim++] = (int)size;
1204 } /* while */
1205 if (ident == iARRAY || fstatic)
1206 {
1207 if (sc_alignnext)
1208 {
1209 aligndata(sc_dataalign);
1210 sc_alignnext = FALSE;
1211 } /* if */
1212 cur_lit = litidx; /* save current index in the literal table */
1213 initials(ident, tag, &size, dim, numdim);
1214 if (size == 0)
1215 return ident; /* error message already given */
1216 if (numdim == 1)
1217 dim[0] = (int)size;
1218 } /* if */
1219 /* reserve memory (on the stack) for the variable */
1220 if (fstatic)
1221 {
1222 /* write zeros for uninitialized fields */
1223 while (litidx < cur_lit + size)
1224 stowlit(0);
1225 sym =
1226 addvariable(name, (cur_lit + glb_declared) * sizeof(cell),
1227 ident, sSTATIC, tag, dim, numdim, idxtag);
1228 defsymbol(name, ident, sSTATIC,
1229 (cur_lit + glb_declared) * sizeof(cell), tag);
1230 }
1231 else
1232 {
1233 declared += (int)size; /* variables are put on stack,
1234 * adjust "declared" */
1235 sym =
1236 addvariable(name, -declared * sizeof(cell), ident, sLOCAL, tag,
1237 dim, numdim, idxtag);
1238 defsymbol(name, ident, sLOCAL, -declared * sizeof(cell), tag);
1239 modstk(-(int)size * sizeof(cell));
1240 } /* if */
1241 /* now that we have reserved memory for the variable, we can
1242 * proceed to initialize it */
1243 sym->compound = nestlevel; /* for multiple declaration/shadowing */
1244 if (fconst)
1245 sym->usage |= uCONST;
1246 if (ident == iARRAY)
1247 for (level = 0; level < numdim; level++)
1248 symbolrange(level, dim[level]);
1249 if (!fstatic)
1250 { /* static variables already initialized */
1251 if (ident == iVARIABLE)
1252 {
1253 /* simple variable, also supports initialization */
1254 int ctag = tag; /* set to "tag" by default */
1255 int explicit_init = FALSE; /* is the variable explicitly
1256 * initialized? */
1257 if (matchtoken('='))
1258 {
1259 doexpr(FALSE, FALSE, FALSE, FALSE, &ctag, TRUE);
1260 explicit_init = TRUE;
1261 }
1262 else
1263 {
1264 const1(0); /* uninitialized variable, set to zero */
1265 } /* if */
1266 /* now try to save the value (still in PRI) in the variable */
1267 lval.sym = sym;
1268 lval.ident = iVARIABLE;
1269 lval.constval = 0;
1270 lval.tag = tag;
1271 check_userop(NULL, ctag, lval.tag, 2, NULL, &ctag);
1272 store(&lval);
1273 endexpr(TRUE); /* full expression ends after the store */
1274 if (!matchtag(tag, ctag, TRUE))
1275 error(213); /* tag mismatch */
1276 /* if the variable was not explicitly initialized, reset the
1277 * "uWRITTEN" flag that store() set */
1278 if (!explicit_init)
1279 sym->usage &= ~uWRITTEN;
1280 }
1281 else
1282 {
1283 /* an array */
1284 if (litidx - cur_lit < size)
1285 fillarray(sym, size * sizeof(cell), 0);
1286 if (cur_lit < litidx)
1287 {
1288 /* check whether the complete array is set to a single value;
1289 * if it is, more compact code can be generated */
1290 cell first = litq[cur_lit];
1291 int i;
1292
1293 for (i = cur_lit; i < litidx && litq[i] == first; i++)
1294 /* nothing */ ;
1295 if (i == litidx)
1296 {
1297 /* all values are the same */
1298 fillarray(sym, (litidx - cur_lit) * sizeof(cell),
1299 first);
1300 litidx = cur_lit; /* reset literal table */
1301 }
1302 else
1303 {
1304 /* copy the literals to the array */
1305 const1((cur_lit + glb_declared) * sizeof(cell));
1306 copyarray(sym, (litidx - cur_lit) * sizeof(cell));
1307 } /* if */
1308 } /* if */
1309 } /* if */
1310 } /* if */
1311 }
1312 while (matchtoken(',')); /* enddo *//* more? */
1313 needtoken(tTERM); /* if not comma, must be semicolumn */
1314 return ident;
1315}
1316
1317static cell
1318calc_arraysize(int dim[], int numdim, int cur)
1319{
1320 if (cur == numdim)
1321 return 0;
1322 return dim[cur] + (dim[cur] * calc_arraysize(dim, numdim, cur + 1));
1323}
1324
1325/* initials
1326 *
1327 * Initialize global objects and local arrays.
1328 * size==array cells (count), if 0 on input, the routine counts
1329 * the number of elements
1330 * tag==required tagname id (not the returned tag)
1331 *
1332 * Global references: litidx (altered)
1333 */
1334static void
1335initials(int ident, int tag, cell * size, int dim[], int numdim)
1336{
1337 int ctag;
1338 int curlit = litidx;
1339 int d;
1340
1341 if (!matchtoken('='))
1342 {
1343 if (ident == iARRAY && dim[numdim - 1] == 0)
1344 {
1345 /* declared as "myvar[];" which is senseless (note: this *does* make
1346 * sense in the case of a iREFARRAY, which is a function parameter)
1347 */
1348 error(9); /* array has zero length -> invalid size */
1349 } /* if */
1350 if (numdim > 1)
1351 {
1352 /* initialize the indirection tables */
1353#if sDIMEN_MAX>2
1354#error Array algorithms for more than 2 dimensions are not implemented
1355#endif
1356 assert(numdim == 2);
1357 *size = calc_arraysize(dim, numdim, 0);
1358 for (d = 0; d < dim[0]; d++)
1359 stowlit((dim[0] + d * (dim[1] - 1)) * sizeof(cell));
1360 } /* if */
1361 return;
1362 } /* if */
1363
1364 if (ident == iVARIABLE)
1365 {
1366 assert(*size == 1);
1367 init(ident, &ctag);
1368 if (!matchtag(tag, ctag, TRUE))
1369 error(213); /* tag mismatch */
1370 }
1371 else
1372 {
1373 assert(numdim > 0);
1374 if (numdim == 1)
1375 {
1376 *size = initvector(ident, tag, dim[0], FALSE);
1377 }
1378 else
1379 {
1380 cell offs, dsize;
1381
1382 /* The simple algorithm below only works for arrays with one or
1383 * two dimensions. This should be some recursive algorithm.
1384 */
1385 if (dim[numdim - 1] != 0)
1386 /* set size to (known) full size */
1387 *size = calc_arraysize(dim, numdim, 0);
1388 /* dump indirection tables */
1389 for (d = 0; d < dim[0]; d++)
1390 stowlit(0);
1391 /* now dump individual vectors */
1392 needtoken('{');
1393 offs = dim[0];
1394 for (d = 0; d < dim[0]; d++)
1395 {
1396 litq[curlit + d] = offs * sizeof(cell);
1397 dsize = initvector(ident, tag, dim[1], TRUE);
1398 offs += dsize - 1;
1399 if (d + 1 < dim[0])
1400 needtoken(',');
1401 if (matchtoken('{') || matchtoken(tSTRING))
1402 /* expect a '{' or a string */
1403 lexpush();
1404 else
1405 break;
1406 } /* for */
1407 matchtoken(',');
1408 needtoken('}');
1409 } /* if */
1410 } /* if */
1411
1412 if (*size == 0)
1413 *size = litidx - curlit; /* number of elements defined */
1414}
1415
1416/* initvector
1417 * Initialize a single dimensional array
1418 */
1419static cell
1420initvector(int ident, int tag, cell size, int fillzero)
1421{
1422 cell prev1 = 0, prev2 = 0;
1423 int ctag;
1424 int ellips = FALSE;
1425 int curlit = litidx;
1426
1427 assert(ident == iARRAY || ident == iREFARRAY);
1428 if (matchtoken('{'))
1429 {
1430 do
1431 {
1432 if (matchtoken('}'))
1433 { /* to allow for trailing ',' after the initialization */
1434 lexpush();
1435 break;
1436 } /* if */
1437 if ((ellips = matchtoken(tELLIPS)) != 0)
1438 break;
1439 prev2 = prev1;
1440 prev1 = init(ident, &ctag);
1441 if (!matchtag(tag, ctag, TRUE))
1442 error(213); /* tag mismatch */
1443 }
1444 while (matchtoken(',')); /* do */
1445 needtoken('}');
1446 }
1447 else
1448 {
1449 init(ident, &ctag);
1450 if (!matchtag(tag, ctag, TRUE))
1451 error(213); /* tagname mismatch */
1452 } /* if */
1453 /* fill up the literal queue with a series */
1454 if (ellips)
1455 {
1456 cell step =
1457 ((litidx - curlit) == 1) ? (cell) 0 : prev1 - prev2;
1458 if (size == 0 || (litidx - curlit) == 0)
1459 error(41); /* invalid ellipsis, array size unknown */
1460 else if ((litidx - curlit) == (int)size)
1461 error(18); /* initialisation data exceeds declared size */
1462 while ((litidx - curlit) < (int)size)
1463 {
1464 prev1 += step;
1465 stowlit(prev1);
1466 } /* while */
1467 } /* if */
1468 if (fillzero && size > 0)
1469 {
1470 while ((litidx - curlit) < (int)size)
1471 stowlit(0);
1472 } /* if */
1473 if (size == 0)
1474 {
1475 size = litidx - curlit; /* number of elements defined */
1476 }
1477 else if (litidx - curlit > (int)size)
1478 { /* e.g. "myvar[3]={1,2,3,4};" */
1479 error(18); /* initialisation data exceeds declared size */
1480 litidx = (int)size + curlit; /* avoid overflow in memory moves */
1481 } /* if */
1482 return size;
1483}
1484
1485/* init
1486 *
1487 * Evaluate one initializer.
1488 */
1489static cell
1490init(int ident, int *tag)
1491{
1492 cell i = 0;
1493
1494 if (matchtoken(tSTRING))
1495 {
1496 /* lex() automatically stores strings in the literal table (and
1497 * increases "litidx") */
1498 if (ident == iVARIABLE)
1499 {
1500 error(6); /* must be assigned to an array */
1501 litidx = 1; /* reset literal queue */
1502 } /* if */
1503 *tag = 0;
1504 }
1505 else if (constexpr(&i, tag))
1506 {
1507 stowlit(i); /* store expression result in literal table */
1508 } /* if */
1509 return i;
1510}
1511
1512/* needsub
1513 *
1514 * Get required array size
1515 */
1516static cell
1517needsub(int *tag)
1518{
1519 cell val;
1520
1521 *tag = 0;
1522 if (matchtoken(']')) /* we've already seen "[" */
1523 return 0; /* null size (like "char msg[]") */
1524 constexpr(&val, tag); /* get value (must be constant expression) */
1525 if (val < 0)
1526 {
1527 error(9); /* negative array size is invalid; assumed zero */
1528 val = 0;
1529 } /* if */
1530 needtoken(']');
1531 return val; /* return array size */
1532}
1533
1534/* decl_const - declare a single constant
1535 *
1536 */
1537static void
1538decl_const(int vclass)
1539{
1540 char constname[sNAMEMAX + 1];
1541 cell val;
1542 char *str;
1543 int tag, exprtag;
1544 int symbolline;
1545
1546 tag = sc_addtag(NULL);
1547 if (lex(&val, &str) != tSYMBOL) /* read in (new) token */
1548 error(20, str); /* invalid symbol name */
1549 symbolline = fline; /* save line where symbol was found */
1550 strcpy(constname, str); /* save symbol name */
1551 needtoken('=');
1552 constexpr(&val, &exprtag); /* get value */
1553 needtoken(tTERM);
1554 /* add_constant() checks for duplicate definitions */
1555 if (!matchtag(tag, exprtag, FALSE))
1556 {
1557 /* temporarily reset the line number to where the symbol was
1558 * defined */
1559 int orgfline = fline;
1560
1561 fline = symbolline;
1562 error(213); /* tagname mismatch */
1563 fline = orgfline;
1564 } /* if */
1565 add_constant(constname, val, vclass, tag);
1566}
1567
1568/* decl_enum - declare enumerated constants
1569 *
1570 */
1571static void
1572decl_enum(int vclass)
1573{
1574 char enumname[sNAMEMAX + 1], constname[sNAMEMAX + 1];
1575 cell val, value, size;
1576 char *str;
1577 int tok, tag, explicittag;
1578 cell increment, multiplier;
1579
1580 /* get an explicit tag, if any (we need to remember whether an
1581 * explicit tag was passed, even if that explicit tag was "_:", so we
1582 * cannot call sc_addtag() here
1583 */
1584 if (lex(&val, &str) == tLABEL)
1585 {
1586 tag = sc_addtag(str);
1587 explicittag = TRUE;
1588 }
1589 else
1590 {
1591 lexpush();
1592 tag = 0;
1593 explicittag = FALSE;
1594 } /* if */
1595
1596 /* get optional enum name (also serves as a tag if no explicit
1597 * tag was set) */
1598 if (lex(&val, &str) == tSYMBOL)
1599 { /* read in (new) token */
1600 strcpy(enumname, str); /* save enum name (last constant) */
1601 if (!explicittag)
1602 tag = sc_addtag(enumname);
1603 }
1604 else
1605 {
1606 lexpush(); /* analyze again */
1607 enumname[0] = '\0';
1608 } /* if */
1609
1610 /* get increment and multiplier */
1611 increment = 1;
1612 multiplier = 1;
1613 if (matchtoken('('))
1614 {
1615 if (matchtoken(taADD))
1616 {
1617 constexpr(&increment, NULL);
1618 }
1619 else if (matchtoken(taMULT))
1620 {
1621 constexpr(&multiplier, NULL);
1622 }
1623 else if (matchtoken(taSHL))
1624 {
1625 constexpr(&val, NULL);
1626 while (val-- > 0)
1627 multiplier *= 2;
1628 } /* if */
1629 needtoken(')');
1630 } /* if */
1631
1632 needtoken('{');
1633 /* go through all constants */
1634 value = 0; /* default starting value */
1635 do
1636 {
1637 if (matchtoken('}'))
1638 { /* quick exit if '}' follows ',' */
1639 lexpush();
1640 break;
1641 } /* if */
1642 tok = lex(&val, &str); /* read in (new) token */
1643 if (tok != tSYMBOL && tok != tLABEL)
1644 error(20, str); /* invalid symbol name */
1645 strcpy(constname, str); /* save symbol name */
1646 size = increment; /* default increment of 'val' */
1647 if (tok == tLABEL || matchtoken(':'))
1648 constexpr(&size, NULL); /* get size */
1649 if (matchtoken('='))
1650 constexpr(&value, NULL); /* get value */
1651 /* add_constant() checks whether a variable (global or local) or
1652 * a constant with the same name already exists */
1653 add_constant(constname, value, vclass, tag);
1654 if (multiplier == 1)
1655 value += size;
1656 else
1657 value *= size * multiplier;
1658 }
1659 while (matchtoken(','));
1660 needtoken('}'); /* terminates the constant list */
1661 matchtoken(';'); /* eat an optional ; */
1662
1663 /* set the enum name to the last value plus one */
1664 if (enumname[0] != '\0')
1665 add_constant(enumname, value, vclass, tag);
1666}
1667
1668/*
1669 * Finds a function in the global symbol table or creates a new entry.
1670 * It does some basic processing and error checking.
1671 */
1672symbol *
1673fetchfunc(char *name, int tag)
1674{
1675 symbol *sym;
1676 cell offset;
1677
1678 offset = code_idx;
1679 if ((sc_debug & sSYMBOLIC) != 0)
1680 {
1681 offset += opcodes(1) + opargs(3) + nameincells(name);
1682 /* ^^^ The address for the symbol is the code address. But the
1683 * "symbol" instruction itself generates code. Therefore the
1684 * offset is pre-adjusted to the value it will have after the
1685 * symbol instruction.
1686 */
1687 } /* if */
1688 if ((sym = findglb(name)))
1689 { /* already in symbol table? */
1690 if (sym->ident != iFUNCTN)
1691 {
1692 error(21, name); /* yes, but not as a function */
1693 return NULL; /* make sure the old symbol is not damaged */
1694 }
1695 else if ((sym->usage & uDEFINE) != 0)
1696 {
1697 error(21, name); /* yes, and it's already defined */
1698 }
1699 else if ((sym->usage & uNATIVE) != 0)
1700 {
1701 error(21, name); /* yes, and it is an native */
1702 } /* if */
1703 assert(sym->vclass == sGLOBAL);
1704 if ((sym->usage & uDEFINE) == 0)
1705 {
1706 /* as long as the function stays undefined, update the address
1707 * and the tag */
1708 sym->addr = offset;
1709 sym->tag = tag;
1710 } /* if */
1711 }
1712 else
1713 {
1714 /* don't set the "uDEFINE" flag; it may be a prototype */
1715 sym = addsym(name, offset, iFUNCTN, sGLOBAL, tag, 0);
1716 /* assume no arguments */
1717 sym->dim.arglist = (arginfo *) malloc(1 * sizeof(arginfo));
1718 sym->dim.arglist[0].ident = 0;
1719 /* set library ID to NULL (only for native functions) */
1720 sym->x.lib = NULL;
1721 } /* if */
1722 return sym;
1723}
1724
1725/* This routine adds symbolic information for each argument.
1726 */
1727static void
1728define_args(void)
1729{
1730 symbol *sym;
1731
1732 /* At this point, no local variables have been declared. All
1733 * local symbols are function arguments.
1734 */
1735 sym = loctab.next;
1736 while (sym)
1737 {
1738 assert(sym->ident != iLABEL);
1739 assert(sym->vclass == sLOCAL);
1740 defsymbol(sym->name, sym->ident, sLOCAL, sym->addr, sym->tag);
1741 if (sym->ident == iREFARRAY)
1742 {
1743 symbol *sub = sym;
1744
1745 while (sub)
1746 {
1747 symbolrange(sub->dim.array.level, sub->dim.array.length);
1748 sub = finddepend(sub);
1749 } /* while */
1750 } /* if */
1751 sym = sym->next;
1752 } /* while */
1753}
1754
1755static int
1756operatorname(char *name)
1757{
1758 int opertok;
1759 char *str;
1760 cell val;
1761
1762 assert(name != NULL);
1763
1764 /* check the operator */
1765 opertok = lex(&val, &str);
1766 switch (opertok)
1767 {
1768 case '+':
1769 case '-':
1770 case '*':
1771 case '/':
1772 case '%':
1773 case '>':
1774 case '<':
1775 case '!':
1776 case '~':
1777 case '=':
1778 name[0] = (char)opertok;
1779 name[1] = '\0';
1780 break;
1781 case tINC:
1782 strcpy(name, "++");
1783 break;
1784 case tDEC:
1785 strcpy(name, "--");
1786 break;
1787 case tlEQ:
1788 strcpy(name, "==");
1789 break;
1790 case tlNE:
1791 strcpy(name, "!=");
1792 break;
1793 case tlLE:
1794 strcpy(name, "<=");
1795 break;
1796 case tlGE:
1797 strcpy(name, ">=");
1798 break;
1799 default:
1800 name[0] = '\0';
1801 error(61); /* operator cannot be redefined
1802 * (or bad operator name) */
1803 return 0;
1804 } /* switch */
1805
1806 return opertok;
1807}
1808
1809static int
1810operatoradjust(int opertok, symbol * sym, char *opername, int resulttag)
1811{
1812 int tags[2] = { 0, 0 };
1813 int count = 0;
1814 arginfo *arg;
1815 char tmpname[sNAMEMAX + 1];
1816 symbol *oldsym;
1817
1818 if (opertok == 0)
1819 return TRUE;
1820
1821 /* count arguments and save (first two) tags */
1822 while (arg = &sym->dim.arglist[count], arg->ident != 0)
1823 {
1824 if (count < 2)
1825 {
1826 if (arg->numtags > 1)
1827 error(65, count + 1); /* function argument may only have
1828 * a single tag */
1829 else if (arg->numtags == 1)
1830 tags[count] = arg->tags[0];
1831 } /* if */
1832 if (opertok == '~' && count == 0)
1833 {
1834 if (arg->ident != iREFARRAY)
1835 error(73, arg->name); /* must be an array argument */
1836 }
1837 else
1838 {
1839 if (arg->ident != iVARIABLE)
1840 error(66, arg->name); /* must be non-reference argument */
1841 } /* if */
1842 if (arg->hasdefault)
1843 error(59, arg->name); /* arguments of an operator may not
1844 * have a default value */
1845 count++;
1846 } /* while */
1847
1848 /* for '!', '++' and '--', count must be 1
1849 * for '-', count may be 1 or 2
1850 * for '=', count must be 1, and the resulttag is also important
1851 * for all other (binary) operators and the special '~'
1852 * operator, count must be 2
1853 */
1854 switch (opertok)
1855 {
1856 case '!':
1857 case '=':
1858 case tINC:
1859 case tDEC:
1860 if (count != 1)
1861 error(62); /* number or placement of the operands does
1862 * not fit the operator */
1863 break;
1864 case '-':
1865 if (count != 1 && count != 2)
1866 error(62); /* number or placement of the operands does
1867 * not fit the operator */
1868 break;
1869 default:
1870 if (count != 2)
1871 error(62); /* number or placement of the operands does
1872 * not fit the operator */
1873 } /* switch */
1874
1875 if (tags[0] == 0
1876 && ((opertok != '=' && tags[1] == 0) || (opertok == '=' && resulttag == 0)))
1877 error(64); /* cannot change predefined operators */
1878
1879 /* change the operator name */
1880 assert(opername[0] != '\0');
1881 operator_symname(tmpname, opername, tags[0], tags[1], count, resulttag);
1882 if ((oldsym = findglb(tmpname)))
1883 {
1884 int i;
1885
1886 if ((oldsym->usage & uDEFINE) != 0)
1887 {
1888 char errname[2 * sNAMEMAX + 16];
1889
1890 funcdisplayname(errname, tmpname);
1891 error(21, errname); /* symbol already defined */
1892 } /* if */
1893 sym->usage |= oldsym->usage; /* copy flags from the previous
1894 * definition */
1895 for (i = 0; i < oldsym->numrefers; i++)
1896 if (oldsym->refer[i])
1897 refer_symbol(sym, oldsym->refer[i]);
1898 delete_symbol(&glbtab, oldsym);
1899 } /* if */
1900 if ((sc_debug & sSYMBOLIC) != 0)
1901 sym->addr += nameincells(tmpname) - nameincells(sym->name);
1902 strcpy(sym->name, tmpname);
1903 sym->hash = namehash(sym->name); /* calculate new hash */
1904
1905 /* operators should return a value, except the '~' operator */
1906 if (opertok != '~')
1907 sym->usage |= uRETVALUE;
1908
1909 return TRUE;
1910}
1911
1912static int
1913check_operatortag(int opertok, int resulttag, char *opername)
1914{
1915 assert(opername != NULL && opername[0] != '\0');
1916 switch (opertok)
1917 {
1918 case '!':
1919 case '<':
1920 case '>':
1921 case tlEQ:
1922 case tlNE:
1923 case tlLE:
1924 case tlGE:
1925 if (resulttag != sc_addtag("bool"))
1926 {
1927 error(63, opername, "bool:"); /* operator X requires
1928 * a "bool:" result tag */
1929 return FALSE;
1930 } /* if */
1931 break;
1932 case '~':
1933 if (resulttag != 0)
1934 {
1935 error(63, opername, "_:"); /* operator "~" requires
1936 * a "_:" result tag */
1937 return FALSE;
1938 } /* if */
1939 break;
1940 } /* switch */
1941 return TRUE;
1942}
1943
1944static char *
1945tag2str(char *dest, int tag)
1946{
1947 tag &= TAGMASK;
1948 assert(tag >= 0);
1949 sprintf(dest, "0%x", tag);
1950 return isdigit(dest[1]) ? &dest[1] : dest;
1951}
1952
1953char *
1954operator_symname(char *symname, char *opername, int tag1, int tag2,
1955 int numtags, int resulttag)
1956{
1957 char tagstr1[10], tagstr2[10];
1958 int opertok;
1959
1960 assert(numtags >= 1 && numtags <= 2);
1961 opertok = (opername[1] == '\0') ? opername[0] : 0;
1962 if (opertok == '=')
1963 sprintf(symname, "%s%s%s", tag2str(tagstr1, resulttag), opername,
1964 tag2str(tagstr2, tag1));
1965 else if (numtags == 1 || opertok == '~')
1966 sprintf(symname, "%s%s", opername, tag2str(tagstr1, tag1));
1967 else
1968 sprintf(symname, "%s%s%s", tag2str(tagstr1, tag1), opername,
1969 tag2str(tagstr2, tag2));
1970 return symname;
1971}
1972
1973static int
1974parse_funcname(char *fname, int *tag1, int *tag2, char *opname)
1975{
1976 char *ptr, *name;
1977 int unary;
1978
1979 /* tags are only positive, so if the function name starts with a '-',
1980 * the operator is an unary '-' or '--' operator.
1981 */
1982 if (*fname == '-')
1983 {
1984 *tag1 = 0;
1985 unary = TRUE;
1986 ptr = fname;
1987 }
1988 else
1989 {
1990 *tag1 = (int)strtol(fname, &ptr, 16);
1991 unary = ptr == fname; /* unary operator if it doesn't start
1992 * with a tag name */
1993 } /* if */
1994 assert(!unary || *tag1 == 0);
1995 assert(*ptr != '\0');
1996 for (name = opname; !isdigit(*ptr);)
1997 *name++ = *ptr++;
1998 *name = '\0';
1999 *tag2 = (int)strtol(ptr, NULL, 16);
2000 return unary;
2001}
2002
2003char *
2004funcdisplayname(char *dest, char *funcname)
2005{
2006 int tags[2];
2007 char opname[10];
2008 constvalue *tagsym[2];
2009 int unary;
2010
2011 if (isalpha(*funcname) || *funcname == '_' || *funcname == PUBLIC_CHAR
2012 || *funcname == '\0')
2013 {
2014 if (dest != funcname)
2015 strcpy(dest, funcname);
2016 return dest;
2017 } /* if */
2018
2019 unary = parse_funcname(funcname, &tags[0], &tags[1], opname);
2020 tagsym[1] = find_constval_byval(&tagname_tab, tags[1]);
2021 assert(tagsym[1] != NULL);
2022 if (unary)
2023 {
2024 sprintf(dest, "operator%s(%s:)", opname, tagsym[1]->name);
2025 }
2026 else
2027 {
2028 tagsym[0] = find_constval_byval(&tagname_tab, tags[0]);
2029 /* special case: the assignment operator has the return value
2030 * as the 2nd tag */
2031 if (opname[0] == '=' && opname[1] == '\0')
2032 sprintf(dest, "%s:operator%s(%s:)", tagsym[0]->name, opname,
2033 tagsym[1]->name);
2034 else
2035 sprintf(dest, "operator%s(%s:,%s:)", opname, tagsym[0]->name,
2036 tagsym[1]->name);
2037 } /* if */
2038 return dest;
2039}
2040
2041static void
2042funcstub(int native)
2043{
2044 int tok, tag;
2045 char *str;
2046 cell val;
2047 char symbolname[sNAMEMAX + 1];
2048 symbol *sym;
2049 int opertok;
2050
2051 opertok = 0;
2052 lastst = 0;
2053 litidx = 0; /* clear the literal pool */
2054
2055 tag = sc_addtag(NULL);
2056 tok = lex(&val, &str);
2057 if (native)
2058 {
2059 if (tok == tPUBLIC || tok == tSTOCK || tok == tSTATIC ||
2060 (tok == tSYMBOL && *str == PUBLIC_CHAR))
2061 error(42); /* invalid combination of class specifiers */
2062 }
2063 else
2064 {
2065 if (tok == tPUBLIC || tok == tSTATIC)
2066 tok = lex(&val, &str);
2067 } /* if */
2068 if (tok == tOPERATOR)
2069 {
2070 opertok = operatorname(symbolname);
2071 if (opertok == 0)
2072 return; /* error message already given */
2073 check_operatortag(opertok, tag, symbolname);
2074 }
2075 else
2076 {
2077 if (tok != tSYMBOL && freading)
2078 {
2079 error(10); /* illegal function or declaration */
2080 return;
2081 } /* if */
2082 strcpy(symbolname, str);
2083 } /* if */
2084 needtoken('('); /* only functions may be native/forward */
2085
2086 sym = fetchfunc(symbolname, tag); /* get a pointer to the
2087 * function entry */
2088 if (!sym)
2089 return;
2090 if (native)
2091 {
2092 sym->usage = uNATIVE | uRETVALUE | uDEFINE;
2093 sym->x.lib = curlibrary;
2094 } /* if */
2095
2096 declargs(sym);
2097 /* "declargs()" found the ")" */
2098 if (!operatoradjust(opertok, sym, symbolname, tag))
2099 sym->usage &= ~uDEFINE;
2100 /* for a native operator, also need to specify an "exported"
2101 * function name; for a native function, this is optional
2102 */
2103 if (native)
2104 {
2105 if (opertok != 0)
2106 {
2107 needtoken('=');
2108 lexpush(); /* push back, for matchtoken() to retrieve again */
2109 } /* if */
2110 if (matchtoken('='))
2111 {
2112 /* allow number or symbol */
2113 if (matchtoken(tSYMBOL))
2114 {
2115 tokeninfo(&val, &str);
2116 if (strlen(str) > sEXPMAX)
2117 {
2118 error(220, str, sEXPMAX);
2119 str[sEXPMAX] = '\0';
2120 } /* if */
2121 insert_alias(sym->name, str);
2122 }
2123 else
2124 {
2125 constexpr(&val, NULL);
2126 sym->addr = val;
2127 /*
2128 * ?? Must mark this address, so that it won't be generated again
2129 * and it won't be written to the output file. At the moment,
2130 * I have assumed that this syntax is only valid if val < 0.
2131 * To properly mix "normal" native functions and indexed native
2132 * functions, one should use negative indices anyway.
2133 * Special code for a negative index in sym->addr exists in
2134 * SC4.C (ffcall()) and in SC6.C (the loops for counting the
2135 * number of native variables and for writing them).
2136 */
2137 } /* if */
2138 } /* if */
2139 } /* if */
2140 needtoken(tTERM);
2141
2142 litidx = 0; /* clear the literal pool */
2143 /* clear local variables queue */
2144 delete_symbols(&loctab, 0, TRUE, TRUE);
2145}
2146
2147/* newfunc - begin a function
2148 *
2149 * This routine is called from "parse" and tries to make a function
2150 * out of the following text
2151 *
2152 * Global references: funcstatus,lastst,litidx
2153 * rettype (altered)
2154 * curfunc (altered)
2155 * declared (altered)
2156 * glb_declared (altered)
2157 * sc_alignnext (altered)
2158 */
2159static int
2160newfunc(char *firstname, int firsttag, int fpublic, int fstatic, int stock)
2161{
2162 symbol *sym;
2163 int argcnt, tok, tag, funcline;
2164 int opertok, opererror;
2165 char symbolname[sNAMEMAX + 1];
2166 char *str;
2167 cell val, cidx, glbdecl;
2168 int filenum;
2169
2170 litidx = 0; /* clear the literal pool ??? */
2171 opertok = 0;
2172 lastst = 0; /* no statement yet */
2173 cidx = 0; /* just to avoid compiler warnings */
2174 glbdecl = 0;
2175 filenum = fcurrent; /* save file number at start of declaration */
2176
2177 if (firstname)
2178 {
2179 assert(strlen(firstname) <= sNAMEMAX);
2180 strcpy(symbolname, firstname); /* save symbol name */
2181 tag = firsttag;
2182 }
2183 else
2184 {
2185 tag = (firsttag >= 0) ? firsttag : sc_addtag(NULL);
2186 tok = lex(&val, &str);
2187 assert(!fpublic);
2188 if (tok == tNATIVE || (tok == tPUBLIC && stock))
2189 error(42); /* invalid combination of class specifiers */
2190 if (tok == tOPERATOR)
2191 {
2192 opertok = operatorname(symbolname);
2193 if (opertok == 0)
2194 return TRUE; /* error message already given */
2195 check_operatortag(opertok, tag, symbolname);
2196 }
2197 else
2198 {
2199 if (tok != tSYMBOL && freading)
2200 {
2201 error(20, str); /* invalid symbol name */
2202 return FALSE;
2203 } /* if */
2204 assert(strlen(str) <= sNAMEMAX);
2205 strcpy(symbolname, str);
2206 } /* if */
2207 } /* if */
2208 /* check whether this is a function or a variable declaration */
2209 if (!matchtoken('('))
2210 return FALSE;
2211 /* so it is a function, proceed */
2212 funcline = fline; /* save line at which the function is defined */
2213 if (symbolname[0] == PUBLIC_CHAR)
2214 {
2215 fpublic = TRUE; /* implicitly public function */
2216 if (stock)
2217 error(42); /* invalid combination of class specifiers */
2218 } /* if */
2219 sym = fetchfunc(symbolname, tag); /* get a pointer to the
2220 * function entry */
2221 if (!sym)
2222 return TRUE;
2223 if (fpublic)
2224 sym->usage |= uPUBLIC;
2225 if (fstatic)
2226 sym->fnumber = filenum;
2227 /* declare all arguments */
2228 argcnt = declargs(sym);
2229 opererror = !operatoradjust(opertok, sym, symbolname, tag);
2230 if (strcmp(symbolname, uMAINFUNC) == 0)
2231 {
2232 if (argcnt > 0)
2233 error(5); /* "main()" function may not have any arguments */
2234 sym->usage |= uREAD; /* "main()" is the program's entry point:
2235 * always used */
2236 } /* if */
2237 /* "declargs()" found the ")"; if a ";" appears after this, it was a
2238 * prototype */
2239 if (matchtoken(';'))
2240 {
2241 if (!sc_needsemicolon)
2242 error(218); /* old style prototypes used with optional
2243 * semicolumns */
2244 delete_symbols(&loctab, 0, TRUE, TRUE); /* prototype is done;
2245 * forget everything */
2246 return TRUE;
2247 } /* if */
2248 /* so it is not a prototype, proceed */
2249 /* if this is a function that is not referred to (this can only be
2250 * detected in the second stage), shut code generation off */
2251 if (sc_status == statWRITE && (sym->usage & uREAD) == 0)
2252 {
2253 sc_status = statSKIP;
2254 cidx = code_idx;
2255 glbdecl = glb_declared;
2256 } /* if */
2257 begcseg();
2258 sym->usage |= uDEFINE; /* set the definition flag */
2259 if (fpublic)
2260 sym->usage |= uREAD; /* public functions are always "used" */
2261 if (stock)
2262 sym->usage |= uSTOCK;
2263 if (opertok != 0 && opererror)
2264 sym->usage &= ~uDEFINE;
2265 defsymbol(sym->name, iFUNCTN, sGLOBAL,
2266 code_idx + opcodes(1) + opargs(3) + nameincells(sym->name), tag);
2267 /* ^^^ The address for the symbol is the code address. But the
2268 * "symbol" instruction itself generates code. Therefore the
2269 * offset is pre-adjusted to the value it will have after the
2270 * symbol instruction.
2271 */
2272 startfunc(sym->name); /* creates stack frame */
2273 if ((sc_debug & sSYMBOLIC) != 0)
2274 setline(funcline, fcurrent);
2275 if (sc_alignnext)
2276 {
2277 alignframe(sc_dataalign);
2278 sc_alignnext = FALSE;
2279 } /* if */
2280 declared = 0; /* number of local cells */
2281 rettype = (sym->usage & uRETVALUE); /* set "return type" variable */
2282 curfunc = sym;
2283 define_args(); /* add the symbolic info for the function arguments */
2284 statement(NULL, FALSE);
2285 if ((rettype & uRETVALUE) != 0)
2286 sym->usage |= uRETVALUE;
2287 if (declared != 0)
2288 {
2289 /* This happens only in a very special (and useless) case, where a
2290 * function has only a single statement in its body (no compound
2291 * block) and that statement declares a new variable
2292 */
2293 modstk((int)declared * sizeof(cell)); /* remove all local
2294 * variables */
2295 declared = 0;
2296 } /* if */
2297 if ((lastst != tRETURN) && (lastst != tGOTO))
2298 {
2299 const1(0);
2300 ffret();
2301 if ((sym->usage & uRETVALUE) != 0)
2302 {
2303 char symname[2 * sNAMEMAX + 16]; /* allow space for user
2304 * defined operators */
2305 funcdisplayname(symname, sym->name);
2306 error(209, symname); /* function should return a value */
2307 } /* if */
2308 } /* if */
2309 endfunc();
2310 if (litidx)
2311 { /* if there are literals defined */
2312 glb_declared += litidx;
2313 begdseg(); /* flip to DATA segment */
2314 dumplits(); /* dump literal strings */
2315 litidx = 0;
2316 } /* if */
2317 testsymbols(&loctab, 0, TRUE, TRUE); /* test for unused arguments
2318 * and labels */
2319 delete_symbols(&loctab, 0, TRUE, TRUE); /* clear local variables
2320 * queue */
2321 assert(loctab.next == NULL);
2322 curfunc = NULL;
2323 if (sc_status == statSKIP)
2324 {
2325 sc_status = statWRITE;
2326 code_idx = cidx;
2327 glb_declared = glbdecl;
2328 } /* if */
2329 return TRUE;
2330}
2331
2332static int
2333argcompare(arginfo * a1, arginfo * a2)
2334{
2335 int result, level;
2336
2337 result = strcmp(a1->name, a2->name) == 0;
2338 if (result)
2339 result = a1->ident == a2->ident;
2340 if (result)
2341 result = a1->usage == a2->usage;
2342 if (result)
2343 result = a1->numtags == a2->numtags;
2344 if (result)
2345 {
2346 int i;
2347
2348 for (i = 0; i < a1->numtags && result; i++)
2349 result = a1->tags[i] == a2->tags[i];
2350 } /* if */
2351 if (result)
2352 result = a1->hasdefault == a2->hasdefault;
2353 if (a1->hasdefault)
2354 {
2355 if (a1->ident == iREFARRAY)
2356 {
2357 if (result)
2358 result = a1->defvalue.array.size == a2->defvalue.array.size;
2359 if (result)
2360 result =
2361 a1->defvalue.array.arraysize == a2->defvalue.array.arraysize;
2362 /* also check the dimensions of both arrays */
2363 if (result)
2364 result = a1->numdim == a2->numdim;
2365 for (level = 0; result && level < a1->numdim; level++)
2366 result = a1->dim[level] == a2->dim[level];
2367 /* ??? should also check contents of the default array
2368 * (these troubles go away in a 2-pass compiler that forbids
2369 * double declarations, but Small currently does not forbid them)
2370 */
2371 }
2372 else
2373 {
2374 if (result)
2375 {
2376 if ((a1->hasdefault & uSIZEOF) != 0
2377 || (a1->hasdefault & uTAGOF) != 0)
2378 result = a1->hasdefault == a2->hasdefault
2379 && strcmp(a1->defvalue.size.symname,
2380 a2->defvalue.size.symname) == 0
2381 && a1->defvalue.size.level == a2->defvalue.size.level;
2382 else
2383 result = a1->defvalue.val == a2->defvalue.val;
2384 } /* if */
2385 } /* if */
2386 if (result)
2387 result = a1->defvalue_tag == a2->defvalue_tag;
2388 } /* if */
2389 return result;
2390}
2391
2392/* declargs()
2393 *
2394 * This routine adds an entry in the local symbol table for each
2395 * argument found in the argument list.
2396 * It returns the number of arguments.
2397 */
2398static int
2399declargs(symbol * sym)
2400{
2401#define MAXTAGS 16
2402 char *ptr;
2403 int argcnt, oldargcnt, tok, tags[MAXTAGS], numtags;
2404 cell val;
2405 arginfo arg, *arglist;
2406 char name[sNAMEMAX + 1];
2407 int ident, fpublic, fconst;
2408 int idx;
2409
2410 /* if the function is already defined earlier, get the number of
2411 * arguments of the existing definition
2412 */
2413 oldargcnt = 0;
2414 if ((sym->usage & uPROTOTYPED) != 0)
2415 while (sym->dim.arglist[oldargcnt].ident != 0)
2416 oldargcnt++;
2417 argcnt = 0; /* zero aruments up to now */
2418 ident = iVARIABLE;
2419 numtags = 0;
2420 fconst = FALSE;
2421 fpublic = (sym->usage & uPUBLIC) != 0;
2422 /* the '(' parantheses has already been parsed */
2423 if (!matchtoken(')'))
2424 {
2425 do
2426 { /* there are arguments; process them */
2427 /* any legal name increases argument count (and stack offset) */
2428 tok = lex(&val, &ptr);
2429 switch (tok)
2430 {
2431 case 0:
2432 /* nothing */
2433 break;
2434 case '&':
2435 if (ident != iVARIABLE || numtags > 0)
2436 error(1, "-identifier-", "&");
2437 ident = iREFERENCE;
2438 break;
2439 case tCONST:
2440 if (ident != iVARIABLE || numtags > 0)
2441 error(1, "-identifier-", "const");
2442 fconst = TRUE;
2443 break;
2444 case tLABEL:
2445 if (numtags > 0)
2446 error(1, "-identifier-", "-tagname-");
2447 tags[0] = sc_addtag(ptr);
2448 numtags = 1;
2449 break;
2450 case '{':
2451 if (numtags > 0)
2452 error(1, "-identifier-", "-tagname-");
2453 numtags = 0;
2454 while (numtags < MAXTAGS)
2455 {
2456 if (!matchtoken('_') && !needtoken(tSYMBOL))
2457 break;
2458 tokeninfo(&val, &ptr);
2459 tags[numtags++] = sc_addtag(ptr);
2460 if (matchtoken('}'))
2461 break;
2462 needtoken(',');
2463 } /* for */
2464 needtoken(':');
2465 tok = tLABEL; /* for outer loop:
2466 * flag that we have seen a tagname */
2467 break;
2468 case tSYMBOL:
2469 if (argcnt >= sMAXARGS)
2470 error(45); /* too many function arguments */
2471 strcpy(name, ptr); /* save symbol name */
2472 if (name[0] == PUBLIC_CHAR)
2473 error(56, name); /* function arguments cannot be public */
2474 if (numtags == 0)
2475 tags[numtags++] = 0; /* default tag */
2476 /* Stack layout:
2477 * base + 0*sizeof(cell) == previous "base"
2478 * base + 1*sizeof(cell) == function return address
2479 * base + 2*sizeof(cell) == number of arguments
2480 * base + 3*sizeof(cell) == first argument of the function
2481 * So the offset of each argument is:
2482 * "(argcnt+3) * sizeof(cell)".
2483 */
2484 doarg(name, ident, (argcnt + 3) * sizeof(cell), tags, numtags,
2485 fpublic, fconst, &arg);
2486 if (fpublic && arg.hasdefault)
2487 error(59, name); /* arguments of a public function may not
2488 * have a default value */
2489 if ((sym->usage & uPROTOTYPED) == 0)
2490 {
2491 /* redimension the argument list, add the entry */
2492 sym->dim.arglist =
2493 (arginfo *) realloc(sym->dim.arglist,
2494 (argcnt + 2) * sizeof(arginfo));
2495 if (!sym->dim.arglist)
2496 error(103); /* insufficient memory */
2497 sym->dim.arglist[argcnt] = arg;
2498 sym->dim.arglist[argcnt + 1].ident = 0; /* keep the list
2499 * terminated */
2500 }
2501 else
2502 {
2503 /* check the argument with the earlier definition */
2504 if (argcnt > oldargcnt
2505 || !argcompare(&sym->dim.arglist[argcnt], &arg))
2506 error(25); /* function definition does not match prototype */
2507 /* may need to free default array argument and the tag list */
2508 if (arg.ident == iREFARRAY && arg.hasdefault)
2509 free(arg.defvalue.array.data);
2510 else if (arg.ident == iVARIABLE
2511 && ((arg.hasdefault & uSIZEOF) != 0
2512 || (arg.hasdefault & uTAGOF) != 0))
2513 free(arg.defvalue.size.symname);
2514 free(arg.tags);
2515 } /* if */
2516 argcnt++;
2517 ident = iVARIABLE;
2518 numtags = 0;
2519 fconst = FALSE;
2520 break;
2521 case tELLIPS:
2522 if (ident != iVARIABLE)
2523 error(10); /* illegal function or declaration */
2524 if (numtags == 0)
2525 tags[numtags++] = 0; /* default tag */
2526 if ((sym->usage & uPROTOTYPED) == 0)
2527 {
2528 /* redimension the argument list, add the entry iVARARGS */
2529 sym->dim.arglist =
2530 (arginfo *) realloc(sym->dim.arglist,
2531 (argcnt + 2) * sizeof(arginfo));
2532 if (!sym->dim.arglist)
2533 error(103); /* insufficient memory */
2534 sym->dim.arglist[argcnt + 1].ident = 0; /* keep the list
2535 * terminated */
2536 sym->dim.arglist[argcnt].ident = iVARARGS;
2537 sym->dim.arglist[argcnt].hasdefault = FALSE;
2538 sym->dim.arglist[argcnt].defvalue.val = 0;
2539 sym->dim.arglist[argcnt].defvalue_tag = 0;
2540 sym->dim.arglist[argcnt].numtags = numtags;
2541 sym->dim.arglist[argcnt].tags =
2542 (int *)malloc(numtags * sizeof tags[0]);
2543 if (!sym->dim.arglist[argcnt].tags)
2544 error(103); /* insufficient memory */
2545 memcpy(sym->dim.arglist[argcnt].tags, tags,
2546 numtags * sizeof tags[0]);
2547 }
2548 else
2549 {
2550 if (argcnt > oldargcnt
2551 || sym->dim.arglist[argcnt].ident != iVARARGS)
2552 error(25); /* function definition does not match prototype */
2553 } /* if */
2554 argcnt++;
2555 break;
2556 default:
2557 error(10); /* illegal function or declaration */
2558 } /* switch */
2559 }
2560 while (tok == '&' || tok == tLABEL || tok == tCONST || (tok != tELLIPS && matchtoken(','))); /* more? */
2561 /* if the next token is not ",", it should be ")" */
2562 needtoken(')');
2563 } /* if */
2564 /* resolve any "sizeof" arguments (now that all arguments are known) */
2565 assert(sym->dim.arglist != NULL);
2566 arglist = sym->dim.arglist;
2567 for (idx = 0; idx < argcnt && arglist[idx].ident != 0; idx++)
2568 {
2569 if ((arglist[idx].hasdefault & uSIZEOF) != 0
2570 || (arglist[idx].hasdefault & uTAGOF) != 0)
2571 {
2572 int altidx;
2573
2574 /* Find the argument with the name mentioned after the "sizeof".
2575 * Note that we cannot use findloc here because we need the
2576 * arginfo struct, not the symbol.
2577 */
2578 ptr = arglist[idx].defvalue.size.symname;
2579 for (altidx = 0;
2580 altidx < argcnt && strcmp(ptr, arglist[altidx].name) != 0;
2581 altidx++)
2582 /* nothing */ ;
2583 if (altidx >= argcnt)
2584 {
2585 error(17, ptr); /* undefined symbol */
2586 }
2587 else
2588 {
2589 /* check the level against the number of dimensions */
2590 /* the level must be zero for "tagof" values */
2591 assert(arglist[idx].defvalue.size.level == 0
2592 || (arglist[idx].hasdefault & uSIZEOF) != 0);
2593 if (arglist[idx].defvalue.size.level > 0
2594 && arglist[idx].defvalue.size.level >=
2595 arglist[altidx].numdim)
2596 error(28); /* invalid subscript */
2597 if (arglist[altidx].ident != iREFARRAY)
2598 {
2599 assert(arglist[altidx].ident == iVARIABLE
2600 || arglist[altidx].ident == iREFERENCE);
2601 error(223, ptr); /* redundant sizeof */
2602 } /* if */
2603 } /* if */
2604 } /* if */
2605 } /* for */
2606
2607 sym->usage |= uPROTOTYPED;
2608 errorset(sRESET); /* reset error flag (clear the "panic mode") */
2609 return argcnt;
2610}
2611
2612/* doarg - declare one argument type
2613 *
2614 * this routine is called from "declargs()" and adds an entry in the
2615 * local symbol table for one argument. "fpublic" indicates whether
2616 * the function for this argument list is public.
2617 * The arguments themselves are never public.
2618 */
2619static void
2620doarg(char *name, int ident, int offset, int tags[], int numtags,
2621 int fpublic, int fconst, arginfo * arg)
2622{
2623 symbol *argsym;
2624 cell size;
2625 int idxtag[sDIMEN_MAX];
2626
2627 strcpy(arg->name, name);
2628 arg->hasdefault = FALSE; /* preset (most common case) */
2629 arg->defvalue.val = 0; /* clear */
2630 arg->defvalue_tag = 0;
2631 arg->numdim = 0;
2632 if (matchtoken('['))
2633 {
2634 if (ident == iREFERENCE)
2635 error(67, name); /*illegal declaration ("&name[]" is unsupported) */
2636 do
2637 {
2638 if (arg->numdim == sDIMEN_MAX)
2639 {
2640 error(53); /* exceeding maximum number of dimensions */
2641 return;
2642 } /* if */
2643 /* there is no check for non-zero major dimensions here, only if
2644 * the array parameter has a default value, we enforce that all
2645 * array dimensions, except the last, are non-zero
2646 */
2647 size = needsub(&idxtag[arg->numdim]); /* may be zero here,
2648 *it is a pointer anyway */
2649#if INT_MAX < LONG_MAX
2650 if (size > INT_MAX)
2651 error(105); /* overflow, exceeding capacity */
2652#endif
2653 arg->dim[arg->numdim] = (int)size;
2654 arg->numdim += 1;
2655 }
2656 while (matchtoken('['));
2657 ident = iREFARRAY; /* "reference to array" (is a pointer) */
2658 if (matchtoken('='))
2659 {
2660 int level;
2661
2662 lexpush(); /* initials() needs the "=" token again */
2663 assert(numtags > 0);
2664 /* for the moment, when a default value is given for the array,
2665 * all dimension sizes, except the last, must be non-zero
2666 * (function initials() requires to know the major dimensions)
2667 */
2668 for (level = 0; level < arg->numdim - 1; level++)
2669 if (arg->dim[level] == 0)
2670 error(52); /* only last dimension may be variable length */
2671 initials(ident, tags[0], &size, arg->dim, arg->numdim);
2672 assert(size >= litidx);
2673 /* allocate memory to hold the initial values */
2674 arg->defvalue.array.data = (cell *) malloc(litidx * sizeof(cell));
2675 if (arg->defvalue.array.data)
2676 {
2677 int i;
2678
2679 memcpy(arg->defvalue.array.data, litq, litidx * sizeof(cell));
2680 arg->hasdefault = TRUE; /* argument has default value */
2681 arg->defvalue.array.size = litidx;
2682 arg->defvalue.array.addr = -1;
2683 /* calculate size to reserve on the heap */
2684 arg->defvalue.array.arraysize = 1;
2685 for (i = 0; i < arg->numdim; i++)
2686 arg->defvalue.array.arraysize *= arg->dim[i];
2687 if (arg->defvalue.array.arraysize < arg->defvalue.array.size)
2688 arg->defvalue.array.arraysize = arg->defvalue.array.size;
2689 } /* if */
2690 litidx = 0; /* reset */
2691 } /* if */
2692 }
2693 else
2694 {
2695 if (matchtoken('='))
2696 {
2697 unsigned char size_tag_token;
2698
2699 assert(ident == iVARIABLE || ident == iREFERENCE);
2700 arg->hasdefault = TRUE; /* argument has a default value */
2701 size_tag_token =
2702 (unsigned char)(matchtoken(tSIZEOF) ? uSIZEOF : 0);
2703 if (size_tag_token == 0)
2704 size_tag_token =
2705 (unsigned char)(matchtoken(tTAGOF) ? uTAGOF : 0);
2706 if (size_tag_token != 0)
2707 {
2708 int paranthese;
2709
2710 if (ident == iREFERENCE)
2711 error(66, name); /* argument may not be a reference */
2712 paranthese = 0;
2713 while (matchtoken('('))
2714 paranthese++;
2715 if (needtoken(tSYMBOL))
2716 {
2717 /* save the name of the argument whose size id to take */
2718 char *name;
2719 cell val;
2720
2721 tokeninfo(&val, &name);
2722 if (!(arg->defvalue.size.symname = strdup(name)))
2723 error(103); /* insufficient memory */
2724 arg->defvalue.size.level = 0;
2725 if (size_tag_token == uSIZEOF)
2726 {
2727 while (matchtoken('['))
2728 {
2729 arg->defvalue.size.level += (short)1;
2730 needtoken(']');
2731 } /* while */
2732 } /* if */
2733 if (ident == iVARIABLE) /* make sure we set this only if
2734 * not a reference */
2735 arg->hasdefault |= size_tag_token; /* uSIZEOF or uTAGOF */
2736 } /* if */
2737 while (paranthese--)
2738 needtoken(')');
2739 }
2740 else
2741 {
2742 constexpr(&arg->defvalue.val, &arg->defvalue_tag);
2743 assert(numtags > 0);
2744 if (!matchtag(tags[0], arg->defvalue_tag, TRUE))
2745 error(213); /* tagname mismatch */
2746 } /* if */
2747 } /* if */
2748 } /* if */
2749 arg->ident = (char)ident;
2750 arg->usage = (char)(fconst ? uCONST : 0);
2751 arg->numtags = numtags;
2752 arg->tags = (int *)malloc(numtags * sizeof tags[0]);
2753 if (!arg->tags)
2754 error(103); /* insufficient memory */
2755 memcpy(arg->tags, tags, numtags * sizeof tags[0]);
2756 argsym = findloc(name);
2757 if (argsym)
2758 {
2759 error(21, name); /* symbol already defined */
2760 }
2761 else
2762 {
2763 if ((argsym = findglb(name)) && argsym->ident != iFUNCTN)
2764 error(219, name); /* variable shadows another symbol */
2765 /* add details of type and address */
2766 assert(numtags > 0);
2767 argsym = addvariable(name, offset, ident, sLOCAL, tags[0],
2768 arg->dim, arg->numdim, idxtag);
2769 argsym->compound = 0;
2770 if (ident == iREFERENCE)
2771 argsym->usage |= uREAD; /* because references are passed back */
2772 if (fpublic)
2773 argsym->usage |= uREAD; /* arguments of public functions
2774 * are always "used" */
2775 if (fconst)
2776 argsym->usage |= uCONST;
2777 } /* if */
2778}
2779
2780static int
2781count_referrers(symbol * entry)
2782{
2783 int i, count;
2784
2785 count = 0;
2786 for (i = 0; i < entry->numrefers; i++)
2787 if (entry->refer[i])
2788 count++;
2789 return count;
2790}
2791
2792/* Every symbol has a referrer list, that contains the functions that
2793 * use the symbol. Now, if function "apple" is accessed by functions
2794 * "banana" and "citron", but neither function "banana" nor "citron" are
2795 * used by anyone else, then, by inference, function "apple" is not used
2796 * either. */
2797static void
2798reduce_referrers(symbol * root)
2799{
2800 int i, restart;
2801 symbol *sym, *ref;
2802
2803 do
2804 {
2805 restart = 0;
2806 for (sym = root->next; sym; sym = sym->next)
2807 {
2808 if (sym->parent)
2809 continue; /* hierarchical data type */
2810 if (sym->ident == iFUNCTN
2811 && (sym->usage & uNATIVE) == 0
2812 && (sym->usage & uPUBLIC) == 0
2813 && strcmp(sym->name, uMAINFUNC) != 0
2814 && count_referrers(sym) == 0)
2815 {
2816 sym->usage &= ~(uREAD | uWRITTEN); /* erase usage bits if
2817 * there is no referrer */
2818 /* find all symbols that are referred by this symbol */
2819 for (ref = root->next; ref; ref = ref->next)
2820 {
2821 if (ref->parent)
2822 continue; /* hierarchical data type */
2823 assert(ref->refer != NULL);
2824 for (i = 0; i < ref->numrefers && ref->refer[i] != sym;
2825 i++)
2826 /* nothing */ ;
2827 if (i < ref->numrefers)
2828 {
2829 assert(ref->refer[i] == sym);
2830 ref->refer[i] = NULL;
2831 restart++;
2832 } /* if */
2833 } /* for */
2834 }
2835 else if ((sym->ident == iVARIABLE || sym->ident == iARRAY)
2836 && (sym->usage & uPUBLIC) == 0
2837 && !sym->parent && count_referrers(sym) == 0)
2838 {
2839 sym->usage &= ~(uREAD | uWRITTEN); /* erase usage bits if
2840 * there is no referrer */
2841 } /* if */
2842 } /* for */
2843 /* after removing a symbol, check whether more can be removed */
2844 }
2845 while (restart > 0);
2846}
2847
2848/* testsymbols - test for unused local or global variables
2849 *
2850 * "Public" functions are excluded from the check, since these
2851 * may be exported to other object modules.
2852 * Labels are excluded from the check if the argument 'testlabs'
2853 * is 0. Thus, labels are not tested until the end of the function.
2854 * Constants may also be excluded (convenient for global constants).
2855 *
2856 * When the nesting level drops below "level", the check stops.
2857 *
2858 * The function returns whether there is an "entry" point for the file.
2859 * This flag will only be 1 when browsing the global symbol table.
2860 */
2861static int
2862testsymbols(symbol * root, int level, int testlabs, int testconst)
2863{
2864 char symname[2 * sNAMEMAX + 16];
2865 int entry = FALSE;
2866
2867 symbol *sym = root->next;
2868
2869 while (sym && sym->compound >= level)
2870 {
2871 switch (sym->ident)
2872 {
2873 case iLABEL:
2874 if (testlabs)
2875 {
2876 if ((sym->usage & uDEFINE) == 0)
2877 error(19, sym->name); /* not a label: ... */
2878 else if ((sym->usage & uREAD) == 0)
2879 error(203, sym->name); /* symbol isn't used: ... */
2880 } /* if */
2881 break;
2882 case iFUNCTN:
2883 if ((sym->usage & (uDEFINE | uREAD | uNATIVE | uSTOCK)) == uDEFINE)
2884 {
2885 funcdisplayname(symname, sym->name);
2886 if (symname[0] != '\0')
2887 error(203, symname); /* symbol isn't used ...
2888 * (and not native/stock) */
2889 } /* if */
2890 if ((sym->usage & uPUBLIC) != 0
2891 || strcmp(sym->name, uMAINFUNC) == 0)
2892 entry = TRUE; /* there is an entry point */
2893 break;
2894 case iCONSTEXPR:
2895 if (testconst && (sym->usage & uREAD) == 0)
2896 error(203, sym->name); /* symbol isn't used: ... */
2897 break;
2898 default:
2899 /* a variable */
2900 if (sym->parent)
2901 break; /* hierarchical data type */
2902 if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC)) == 0)
2903 error(203, sym->name); /* symbol isn't used (and not stock
2904 * or public) */
2905 else if ((sym->usage & (uREAD | uSTOCK | uPUBLIC)) == 0)
2906 error(204, sym->name); /* value assigned to symbol is
2907 * never used */
2908#if 0 /*// ??? not sure whether it is a good idea to
2909 * force people use "const" */
2910 else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST)) == 0
2911 && sym->ident == iREFARRAY)
2912 error(214, sym->name); /* make array argument "const" */
2913#endif
2914 } /* if */
2915 sym = sym->next;
2916 } /* while */
2917
2918 return entry;
2919}
2920
2921static cell
2922calc_array_datasize(symbol * sym, cell * offset)
2923{
2924 cell length;
2925
2926 assert(sym != NULL);
2927 assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
2928 length = sym->dim.array.length;
2929 if (sym->dim.array.level > 0)
2930 {
2931 cell sublength =
2932 calc_array_datasize(finddepend(sym), offset);
2933 if (offset)
2934 *offset = length * (*offset + sizeof(cell));
2935 if (sublength > 0)
2936 length *= length * sublength;
2937 else
2938 length = 0;
2939 }
2940 else
2941 {
2942 if (offset)
2943 *offset = 0;
2944 } /* if */
2945 return length;
2946}
2947
2948static void
2949destructsymbols(symbol * root, int level)
2950{
2951 cell offset = 0;
2952 int savepri = FALSE;
2953 symbol *sym = root->next;
2954
2955 while (sym && sym->compound >= level)
2956 {
2957 if (sym->ident == iVARIABLE || sym->ident == iARRAY)
2958 {
2959 char symbolname[16];
2960 symbol *opsym;
2961 cell elements;
2962
2963 /* check that the '~' operator is defined for this tag */
2964 operator_symname(symbolname, "~", sym->tag, 0, 1, 0);
2965 if ((opsym = findglb(symbolname)))
2966 {
2967 /* save PRI, in case of a return statement */
2968 if (!savepri)
2969 {
2970 push1(); /* right-hand operand is in PRI */
2971 savepri = TRUE;
2972 } /* if */
2973 /* if the variable is an array, get the number of elements */
2974 if (sym->ident == iARRAY)
2975 {
2976 elements = calc_array_datasize(sym, &offset);
2977 /* "elements" can be zero when the variable is declared like
2978 * new mytag: myvar[2][] = { {1, 2}, {3, 4} }
2979 * one should declare all dimensions!
2980 */
2981 if (elements == 0)
2982 error(46, sym->name); /* array size is unknown */
2983 }
2984 else
2985 {
2986 elements = 1;
2987 offset = 0;
2988 } /* if */
2989 pushval(elements);
2990 /* call the '~' operator */
2991 address(sym);
2992 addconst(offset); /*add offset to array data to the address */
2993 push1();
2994 pushval(2 * sizeof(cell)); /* 2 parameters */
2995 ffcall(opsym, 1);
2996 if (sc_status != statSKIP)
2997 markusage(opsym, uREAD); /* do not mark as "used" when this
2998 * call itself is skipped */
2999 if (opsym->x.lib)
3000 opsym->x.lib->value += 1; /* increment "usage count"
3001 * of the library */
3002 } /* if */
3003 } /* if */
3004 sym = sym->next;
3005 } /* while */
3006 /* restore PRI, if it was saved */
3007 if (savepri)
3008 pop1();
3009}
3010
3011static constvalue *
3012insert_constval(constvalue * prev, constvalue * next, char *name,
3013 cell val, short index)
3014{
3015 constvalue *cur;
3016
3017 if (!(cur = (constvalue *)malloc(sizeof(constvalue))))
3018 error(103); /* insufficient memory (fatal error) */
3019 memset(cur, 0, sizeof(constvalue));
3020 strcpy(cur->name, name);
3021 cur->value = val;
3022 cur->index = index;
3023 cur->next = next;
3024 prev->next = cur;
3025 return cur;
3026}
3027
3028constvalue *
3029append_constval(constvalue * table, char *name, cell val, short index)
3030{
3031 constvalue *cur, *prev;
3032
3033 /* find the end of the constant table */
3034 for (prev = table, cur = table->next; cur;
3035 prev = cur, cur = cur->next)
3036 /* nothing */ ;
3037 return insert_constval(prev, NULL, name, val, index);
3038}
3039
3040constvalue *
3041find_constval(constvalue * table, char *name, short index)
3042{
3043 constvalue *ptr = table->next;
3044
3045 while (ptr)
3046 {
3047 if (strcmp(name, ptr->name) == 0 && ptr->index == index)
3048 return ptr;
3049 ptr = ptr->next;
3050 } /* while */
3051 return NULL;
3052}
3053
3054static constvalue *
3055find_constval_byval(constvalue * table, cell val)
3056{
3057 constvalue *ptr = table->next;
3058
3059 while (ptr)
3060 {
3061 if (ptr->value == val)
3062 return ptr;
3063 ptr = ptr->next;
3064 } /* while */
3065 return NULL;
3066}
3067
3068#if 0 /* never used */
3069static int
3070delete_constval(constvalue * table, char *name)
3071{
3072 constvalue *prev = table;
3073 constvalue *cur = prev->next;
3074
3075 while (cur != NULL)
3076 {
3077 if (strcmp(name, cur->name) == 0)
3078 {
3079 prev->next = cur->next;
3080 free(cur);
3081 return TRUE;
3082 } /* if */
3083 prev = cur;
3084 cur = cur->next;
3085 } /* while */
3086 return FALSE;
3087}
3088#endif
3089
3090void
3091delete_consttable(constvalue * table)
3092{
3093 constvalue *cur = table->next, *next;
3094
3095 while (cur)
3096 {
3097 next = cur->next;
3098 free(cur);
3099 cur = next;
3100 } /* while */
3101 memset(table, 0, sizeof(constvalue));
3102}
3103
3104/* add_constant
3105 *
3106 * Adds a symbol to the #define symbol table.
3107 */
3108void
3109add_constant(char *name, cell val, int vclass, int tag)
3110{
3111 symbol *sym;
3112
3113 /* Test whether a global or local symbol with the same name exists. Since
3114 * constants are stored in the symbols table, this also finds previously
3115 * defind constants. */
3116 sym = findglb(name);
3117 if (!sym)
3118 sym = findloc(name);
3119 if (sym)
3120 {
3121 /* silently ignore redefinitions of constants with the same value */
3122 if (sym->ident == iCONSTEXPR)
3123 {
3124 if (sym->addr != val)
3125 error(201, name); /* redefinition of constant (different value) */
3126 }
3127 else
3128 {
3129 error(21, name); /* symbol already defined */
3130 } /* if */
3131 return;
3132 } /* if */
3133
3134 /* constant doesn't exist yet, an entry must be created */
3135 sym = addsym(name, val, iCONSTEXPR, vclass, tag, uDEFINE);
3136 if (sc_status == statIDLE)
3137 sym->usage |= uPREDEF;
3138}
3139
3140/* statement - The Statement Parser
3141 *
3142 * This routine is called whenever the parser needs to know what
3143 * statement it encounters (i.e. whenever program syntax requires a
3144 * statement).
3145 */
3146static void
3147statement(int *lastindent, int allow_decl)
3148{
3149 int tok;
3150 cell val;
3151 char *st;
3152
3153 if (!freading)
3154 {
3155 error(36); /* empty statement */
3156 return;
3157 } /* if */
3158 errorset(sRESET);
3159
3160 tok = lex(&val, &st);
3161 if (tok != '{')
3162 setline(fline, fcurrent);
3163 /* lex() has set stmtindent */
3164 if (lastindent && tok != tLABEL)
3165 {
3166#if 0
3167 if (*lastindent >= 0 && *lastindent != stmtindent &&
3168 !indent_nowarn && sc_tabsize > 0)
3169 error(217); /* loose indentation */
3170#endif
3171 *lastindent = stmtindent;
3172 indent_nowarn = TRUE; /* if warning was blocked, re-enable it */
3173 } /* if */
3174 switch (tok)
3175 {
3176 case 0:
3177 /* nothing */
3178 break;
3179 case tNEW:
3180 if (allow_decl)
3181 {
3182 declloc(FALSE);
3183 lastst = tNEW;
3184 }
3185 else
3186 {
3187 error(3); /* declaration only valid in a block */
3188 } /* if */
3189 break;
3190 case tSTATIC:
3191 if (allow_decl)
3192 {
3193 declloc(TRUE);
3194 lastst = tNEW;
3195 }
3196 else
3197 {
3198 error(3); /* declaration only valid in a block */
3199 } /* if */
3200 break;
3201 case '{':
3202 if (!matchtoken('}')) /* {} is the empty statement */
3203 compound();
3204 /* lastst (for "last statement") does not change */
3205 break;
3206 case ';':
3207 error(36); /* empty statement */
3208 break;
3209 case tIF:
3210 doif();
3211 lastst = tIF;
3212 break;
3213 case tWHILE:
3214 dowhile();
3215 lastst = tWHILE;
3216 break;
3217 case tDO:
3218 dodo();
3219 lastst = tDO;
3220 break;
3221 case tFOR:
3222 dofor();
3223 lastst = tFOR;
3224 break;
3225 case tSWITCH:
3226 doswitch();
3227 lastst = tSWITCH;
3228 break;
3229 case tCASE:
3230 case tDEFAULT:
3231 error(14); /* not in switch */
3232 break;
3233 case tGOTO:
3234 dogoto();
3235 lastst = tGOTO;
3236 break;
3237 case tLABEL:
3238 dolabel();
3239 lastst = tLABEL;
3240 break;
3241 case tRETURN:
3242 doreturn();
3243 lastst = tRETURN;
3244 break;
3245 case tBREAK:
3246 dobreak();
3247 lastst = tBREAK;
3248 break;
3249 case tCONTINUE:
3250 docont();
3251 lastst = tCONTINUE;
3252 break;
3253 case tEXIT:
3254 doexit();
3255 lastst = tEXIT;
3256 break;
3257 case tASSERT:
3258 doassert();
3259 lastst = tASSERT;
3260 break;
3261 case tSLEEP:
3262 dosleep();
3263 lastst = tSLEEP;
3264 break;
3265 case tCONST:
3266 decl_const(sLOCAL);
3267 break;
3268 case tENUM:
3269 decl_enum(sLOCAL);
3270 break;
3271 default: /* non-empty expression */
3272 lexpush(); /* analyze token later */
3273 doexpr(TRUE, TRUE, TRUE, TRUE, NULL, FALSE);
3274 needtoken(tTERM);
3275 lastst = tEXPR;
3276 } /* switch */
3277}
3278
3279static void
3280compound(void)
3281{
3282 int indent = -1;
3283 cell save_decl = declared;
3284 int count_stmt = 0;
3285
3286 nestlevel += 1; /* increase compound statement level */
3287 while (matchtoken('}') == 0)
3288 { /* repeat until compound statement is closed */
3289 if (!freading)
3290 {
3291 needtoken('}'); /* gives error: "expected token }" */
3292 break;
3293 }
3294 else
3295 {
3296 if (count_stmt > 0
3297 && (lastst == tRETURN || lastst == tBREAK
3298 || lastst == tCONTINUE))
3299 error(225); /* unreachable code */
3300 statement(&indent, TRUE); /* do a statement */
3301 count_stmt++;
3302 } /* if */
3303 } /* while */
3304 if (lastst != tRETURN)
3305 destructsymbols(&loctab, nestlevel);
3306 if (lastst != tRETURN && lastst != tGOTO)
3307 /* delete local variable space */
3308 modstk((int)(declared - save_decl) * sizeof(cell));
3309
3310 testsymbols(&loctab, nestlevel, FALSE, TRUE); /* look for unused
3311 * block locals */
3312 declared = save_decl;
3313 delete_symbols(&loctab, nestlevel, FALSE, TRUE);
3314 /* erase local symbols, but
3315 * retain block local labels
3316 * (within the function) */
3317
3318 nestlevel -= 1; /* decrease compound statement level */
3319}
3320
3321/* doexpr
3322 *
3323 * Global references: stgidx (referred to only)
3324 */
3325static void
3326doexpr(int comma, int chkeffect, int allowarray, int mark_endexpr,
3327 int *tag, int chkfuncresult)
3328{
3329 int constant, index, ident;
3330 int localstaging = FALSE;
3331 cell val;
3332
3333 if (!staging)
3334 {
3335 stgset(TRUE); /* start stage-buffering */
3336 localstaging = TRUE;
3337 assert(stgidx == 0);
3338 } /* if */
3339 index = stgidx;
3340 errorset(sEXPRMARK);
3341 do
3342 {
3343 /* on second round through, mark the end of the previous expression */
3344 if (index != stgidx)
3345 endexpr(TRUE);
3346 sideeffect = FALSE;
3347 ident = expression(&constant, &val, tag, chkfuncresult);
3348 if (!allowarray && (ident == iARRAY || ident == iREFARRAY))
3349 error(33, "-unknown-"); /* array must be indexed */
3350 if (chkeffect && !sideeffect)
3351 error(215); /* expression has no effect */
3352 }
3353 while (comma && matchtoken(',')); /* more? */
3354 if (mark_endexpr)
3355 endexpr(TRUE); /* optionally, mark the end of the expression */
3356 errorset(sEXPRRELEASE);
3357 if (localstaging)
3358 {
3359 stgout(index);
3360 stgset(FALSE); /* stop staging */
3361 } /* if */
3362}
3363
3364/* constexpr
3365 */
3366int
3367constexpr(cell * val, int *tag)
3368{
3369 int constant, index;
3370 cell cidx;
3371
3372 stgset(TRUE); /* start stage-buffering */
3373 stgget(&index, &cidx); /* mark position in code generator */
3374 errorset(sEXPRMARK);
3375 expression(&constant, val, tag, FALSE);
3376 stgdel(index, cidx); /* scratch generated code */
3377 stgset(FALSE); /* stop stage-buffering */
3378 if (constant == 0)
3379 error(8); /* must be constant expression */
3380 errorset(sEXPRRELEASE);
3381 return constant;
3382}
3383
3384/* test
3385 *
3386 * In the case a "simple assignment" operator ("=") is used within a
3387 * test, * the warning "possibly unintended assignment" is displayed.
3388 * This routine sets the global variable "intest" to true, it is
3389 * restored upon termination. In the case the assignment was intended,
3390 * use parantheses around the expression to avoid the warning;
3391 * primary() sets "intest" to 0.
3392 *
3393 * Global references: intest (altered, but restored upon termination)
3394 */
3395static void
3396test(int label, int parens, int invert)
3397{
3398 int index, tok;
3399 cell cidx;
3400 value lval = { NULL, 0, 0, 0, 0, NULL };
3401 int localstaging = FALSE;
3402
3403 if (!staging)
3404 {
3405 stgset(TRUE); /* start staging */
3406 localstaging = TRUE;
3407#if !defined NDEBUG
3408 stgget(&index, &cidx); /* should start at zero if started
3409 * locally */
3410 assert(index == 0);
3411#endif
3412 } /* if */
3413
3414 pushstk((stkitem) intest);
3415 intest = 1;
3416 if (parens)
3417 needtoken('(');
3418 do
3419 {
3420 stgget(&index, &cidx); /* mark position (of last expression) in
3421 * code generator */
3422 if (hier14(&lval))
3423 rvalue(&lval);
3424 tok = matchtoken(',');
3425 if (tok)
3426 endexpr(TRUE);
3427 }
3428 while (tok); /* do */
3429 if (parens)
3430 needtoken(')');
3431 if (lval.ident == iARRAY || lval.ident == iREFARRAY)
3432 {
3433 char *ptr =
3434 (lval.sym->name) ? lval.sym->name : "-unknown-";
3435 error(33, ptr); /* array must be indexed */
3436 } /* if */
3437 if (lval.ident == iCONSTEXPR)
3438 { /* constant expression */
3439 intest = (int)(long)popstk(); /* restore stack */
3440 stgdel(index, cidx);
3441 if (lval.constval)
3442 { /* code always executed */
3443 error(206); /* redundant test: always non-zero */
3444 }
3445 else
3446 {
3447 error(205); /* redundant code: never executed */
3448 jumplabel(label);
3449 } /* if */
3450 if (localstaging)
3451 {
3452 stgout(0); /* write "jumplabel" code */
3453 stgset(FALSE); /* stop staging */
3454 } /* if */
3455 return;
3456 } /* if */
3457 if (lval.tag != 0 && lval.tag != sc_addtag("bool"))
3458 if (check_userop(lneg, lval.tag, 0, 1, NULL, &lval.tag))
3459 invert = !invert; /* user-defined ! operator inverted result */
3460 if (invert)
3461 jmp_ne0(label); /* jump to label if true (different from 0) */
3462 else
3463 jmp_eq0(label); /* jump to label if false (equal to 0) */
3464 endexpr(TRUE); /* end expression (give optimizer a chance) */
3465 intest = (int)(long)popstk(); /* double typecast to avoid warning
3466 * with Microsoft C */
3467 if (localstaging)
3468 {
3469 stgout(0); /* output queue from the very beginning (see
3470 * assert() when localstaging is set to TRUE) */
3471 stgset(FALSE); /* stop staging */
3472 } /* if */
3473}
3474
3475static void
3476doif(void)
3477{
3478 int flab1, flab2;
3479 int ifindent;
3480
3481 ifindent = stmtindent; /* save the indent of the "if" instruction */
3482 flab1 = getlabel(); /* get label number for false branch */
3483 test(flab1, TRUE, FALSE); /*get expression, branch to flab1 if false */
3484 statement(NULL, FALSE); /* if true, do a statement */
3485 if (matchtoken(tELSE) == 0)
3486 { /* if...else ? */
3487 setlabel(flab1); /* no, simple if..., print false label */
3488 }
3489 else
3490 {
3491 /* to avoid the "dangling else" error, we want a warning if the "else"
3492 * has a lower indent than the matching "if" */
3493#if 0
3494 if (stmtindent < ifindent && sc_tabsize > 0)
3495 error(217); /* loose indentation */
3496#endif
3497 flab2 = getlabel();
3498 if ((lastst != tRETURN) && (lastst != tGOTO))
3499 jumplabel(flab2);
3500 setlabel(flab1); /* print false label */
3501 statement(NULL, FALSE); /* do "else" clause */
3502 setlabel(flab2); /* print true label */
3503 } /* endif */
3504}
3505
3506static void
3507dowhile(void)
3508{
3509 int wq[wqSIZE]; /* allocate local queue */
3510
3511 addwhile(wq); /* add entry to queue for "break" */
3512 setlabel(wq[wqLOOP]); /* loop label */
3513 /* The debugger uses the "line" opcode to be able to "break" out of
3514 * a loop. To make sure that each loop has a line opcode, even for the
3515 * tiniest loop, set it below the top of the loop */
3516 setline(fline, fcurrent);
3517 test(wq[wqEXIT], TRUE, FALSE); /* branch to wq[wqEXIT] if false */
3518 statement(NULL, FALSE); /* if so, do a statement */
3519 jumplabel(wq[wqLOOP]); /* and loop to "while" start */
3520 setlabel(wq[wqEXIT]); /* exit label */
3521 delwhile(); /* delete queue entry */
3522}
3523
3524/*
3525 * Note that "continue" will in this case not jump to the top of the
3526 * loop, but to the end: just before the TRUE-or-FALSE testing code.
3527 */
3528static void
3529dodo(void)
3530{
3531 int wq[wqSIZE], top;
3532
3533 addwhile(wq); /* see "dowhile" for more info */
3534 top = getlabel(); /* make a label first */
3535 setlabel(top); /* loop label */
3536 statement(NULL, FALSE);
3537 needtoken(tWHILE);
3538 setlabel(wq[wqLOOP]); /* "continue" always jumps to WQLOOP. */
3539 setline(fline, fcurrent);
3540 test(wq[wqEXIT], TRUE, FALSE);
3541 jumplabel(top);
3542 setlabel(wq[wqEXIT]);
3543 delwhile();
3544 needtoken(tTERM);
3545}
3546
3547static void
3548dofor(void)
3549{
3550 int wq[wqSIZE], skiplab;
3551 cell save_decl;
3552 int save_nestlevel, index;
3553 int *ptr;
3554
3555 save_decl = declared;
3556 save_nestlevel = nestlevel;
3557
3558 addwhile(wq);
3559 skiplab = getlabel();
3560 needtoken('(');
3561 if (matchtoken(';') == 0)
3562 {
3563 /* new variable declarations are allowed here */
3564 if (matchtoken(tNEW))
3565 {
3566 /* The variable in expr1 of the for loop is at a
3567 * 'compound statement' level of it own.
3568 */
3569 nestlevel++;
3570 declloc(FALSE); /* declare local variable */
3571 }
3572 else
3573 {
3574 doexpr(TRUE, TRUE, TRUE, TRUE, NULL, FALSE); /* expression 1 */
3575 needtoken(';');
3576 } /* if */
3577 } /* if */
3578 /* Adjust the "declared" field in the "while queue", in case that
3579 * local variables were declared in the first expression of the
3580 * "for" loop. These are deleted in separately, so a "break" or a
3581 * "continue" must ignore these fields.
3582 */
3583 ptr = readwhile();
3584 assert(ptr != NULL);
3585 ptr[wqBRK] = (int)declared;
3586 ptr[wqCONT] = (int)declared;
3587 jumplabel(skiplab); /* skip expression 3 1st time */
3588 setlabel(wq[wqLOOP]); /* "continue" goes to this label: expr3 */
3589 setline(fline, fcurrent);
3590 /* Expressions 2 and 3 are reversed in the generated code:
3591 * expression 3 precedes expression 2.
3592 * When parsing, the code is buffered and marks for
3593 * the start of each expression are insterted in the buffer.
3594 */
3595 assert(!staging);
3596 stgset(TRUE); /* start staging */
3597 assert(stgidx == 0);
3598 index = stgidx;
3599 stgmark(sSTARTREORDER);
3600 stgmark((char)(sEXPRSTART + 0)); /* mark start of 2nd expression
3601 * in stage */
3602 setlabel(skiplab); /*jump to this point after 1st expression */
3603 if (matchtoken(';') == 0)
3604 {
3605 test(wq[wqEXIT], FALSE, FALSE); /* expression 2
3606 *(jump to wq[wqEXIT] if false) */
3607 needtoken(';');
3608 } /* if */
3609 stgmark((char)(sEXPRSTART + 1)); /* mark start of 3th expression
3610 * in stage */
3611 if (matchtoken(')') == 0)
3612 {
3613 doexpr(TRUE, TRUE, TRUE, TRUE, NULL, FALSE); /* expression 3 */
3614 needtoken(')');
3615 } /* if */
3616 stgmark(sENDREORDER); /* mark end of reversed evaluation */
3617 stgout(index);
3618 stgset(FALSE); /* stop staging */
3619 statement(NULL, FALSE);
3620 jumplabel(wq[wqLOOP]);
3621 setlabel(wq[wqEXIT]);
3622 delwhile();
3623
3624 assert(nestlevel >= save_nestlevel);
3625 if (nestlevel > save_nestlevel)
3626 {
3627 /* Clean up the space and the symbol table for the local
3628 * variable in "expr1".
3629 */
3630 destructsymbols(&loctab, nestlevel);
3631 modstk((int)(declared - save_decl) * sizeof(cell));
3632 declared = save_decl;
3633 delete_symbols(&loctab, nestlevel, FALSE, TRUE);
3634 nestlevel = save_nestlevel; /* reset 'compound statement'
3635 * nesting level */
3636 } /* if */
3637}
3638
3639/* The switch statement is incompatible with its C sibling:
3640 * 1. the cases are not drop through
3641 * 2. only one instruction may appear below each case, use a compound
3642 * instruction to execute multiple instructions
3643 * 3. the "case" keyword accepts a comma separated list of values to
3644 * match, it also accepts a range using the syntax "1 .. 4"
3645 *
3646 * SWITCH param
3647 * PRI = expression result
3648 * param = table offset (code segment)
3649 *
3650 */
3651static void
3652doswitch(void)
3653{
3654 int lbl_table, lbl_exit, lbl_case;
3655 int tok, swdefault, casecount;
3656 cell val;
3657 char *str;
3658 constvalue caselist = { NULL, "", 0, 0 }; /*case list starts empty */
3659 constvalue *cse, *csp;
3660 char labelname[sNAMEMAX + 1];
3661
3662 needtoken('(');
3663 doexpr(TRUE, FALSE, FALSE, TRUE, NULL, FALSE); /* evaluate
3664 * switch expression */
3665 needtoken(')');
3666 /* generate the code for the switch statement, the label is the
3667 * address of the case table (to be generated later).
3668 */
3669 lbl_table = getlabel();
3670 lbl_case = 0; /* just to avoid a compiler warning */
3671 ffswitch(lbl_table);
3672
3673 needtoken('{');
3674 lbl_exit = getlabel(); /*get label number for jumping out of switch */
3675 swdefault = FALSE;
3676 casecount = 0;
3677 do
3678 {
3679 tok = lex(&val, &str); /* read in (new) token */
3680 switch (tok)
3681 {
3682 case tCASE:
3683 if (swdefault != FALSE)
3684 error(15); /* "default" case must be last in switch
3685 * statement */
3686 lbl_case = getlabel();
3687 sc_allowtags = FALSE; /* do not allow tagnames here */
3688 do
3689 {
3690 casecount++;
3691
3692 /* ??? enforce/document that, in a switch, a statement cannot
3693 * start an opening brace (marks the start of a compound
3694 * statement) and search for the right-most colon before that
3695 * statement.
3696 * Now, by replacing the ':' by a special COLON token, you can
3697 * parse all expressions until that special token.
3698 */
3699
3700 constexpr(&val, NULL);
3701 /* Search the insertion point (the table is kept in sorted
3702 * order, so that advanced abstract machines can sift the
3703 * case table with a binary search). Check for duplicate
3704 * case values at the same time.
3705 */
3706 for (csp = &caselist, cse = caselist.next;
3707 cse && cse->value < val;
3708 csp = cse, cse = cse->next)
3709 /* nothing */ ;
3710 if (cse && cse->value == val)
3711 error(40, val); /* duplicate "case" label */
3712 /* Since the label is stored as a string in the
3713 * "constvalue", the size of an identifier must
3714 * be at least 8, as there are 8
3715 * hexadecimal digits in a 32-bit number.
3716 */
3717#if sNAMEMAX < 8
3718#error Length of identifier (sNAMEMAX) too small.
3719#endif
3720 insert_constval(csp, cse, itoh(lbl_case), val, 0);
3721 if (matchtoken(tDBLDOT))
3722 {
3723 cell end;
3724
3725 constexpr(&end, NULL);
3726 if (end <= val)
3727 error(50); /* invalid range */
3728 while (++val <= end)
3729 {
3730 casecount++;
3731 /* find the new insertion point */
3732 for (csp = &caselist, cse = caselist.next;
3733 cse && cse->value < val;
3734 csp = cse, cse = cse->next)
3735 /* nothing */ ;
3736 if (cse && cse->value == val)
3737 error(40, val); /* duplicate "case" label */
3738 insert_constval(csp, cse, itoh(lbl_case), val, 0);
3739 } /* if */
3740 } /* if */
3741 }
3742 while (matchtoken(','));
3743 needtoken(':'); /* ':' ends the case */
3744 sc_allowtags = TRUE; /* reset */
3745 setlabel(lbl_case);
3746 statement(NULL, FALSE);
3747 jumplabel(lbl_exit);
3748 break;
3749 case tDEFAULT:
3750 if (swdefault != FALSE)
3751 error(16); /* multiple defaults in switch */
3752 lbl_case = getlabel();
3753 setlabel(lbl_case);
3754 needtoken(':');
3755 swdefault = TRUE;
3756 statement(NULL, FALSE);
3757 /* Jump to lbl_exit, even thouh this is the last clause in the
3758 *switch, because the jump table is generated between the last
3759 * clause of the switch and the exit label.
3760 */
3761 jumplabel(lbl_exit);
3762 break;
3763 case '}':
3764 /* nothing, but avoid dropping into "default" */
3765 break;
3766 default:
3767 error(2);
3768 indent_nowarn = TRUE; /* disable this check */
3769 tok = '}'; /* break out of the loop after an error */
3770 } /* switch */
3771 }
3772 while (tok != '}');
3773
3774#if !defined NDEBUG
3775 /* verify that the case table is sorted (unfortunately, duplicates can
3776 * occur; there really shouldn't be duplicate cases, but the compiler
3777 * may not crash or drop into an assertion for a user error). */
3778 for (cse = caselist.next; cse && cse->next; cse = cse->next)
3779 ; /* empty. no idea whether this is correct, but we MUST NOT do
3780 * the setlabel(lbl_table) call in the loop body. doing so breaks
3781 * switch statements that only have one case statement following.
3782 */
3783#endif
3784
3785 /* generate the table here, before lbl_exit (general jump target) */
3786 setlabel(lbl_table);
3787
3788 if (swdefault == FALSE)
3789 {
3790 /* store lbl_exit as the "none-matched" label in the switch table */
3791 strcpy(labelname, itoh(lbl_exit));
3792 }
3793 else
3794 {
3795 /* lbl_case holds the label of the "default" clause */
3796 strcpy(labelname, itoh(lbl_case));
3797 } /* if */
3798 ffcase(casecount, labelname, TRUE);
3799 /* generate the rest of the table */
3800 for (cse = caselist.next; cse; cse = cse->next)
3801 ffcase(cse->value, cse->name, FALSE);
3802
3803 setlabel(lbl_exit);
3804 delete_consttable(&caselist); /* clear list of case labels */
3805}
3806
3807static void
3808doassert(void)
3809{
3810 int flab1, index;
3811 cell cidx;
3812 value lval = { NULL, 0, 0, 0, 0, NULL };
3813
3814 if ((sc_debug & sCHKBOUNDS) != 0)
3815 {
3816 flab1 = getlabel(); /* get label number for "OK" branch */
3817 test(flab1, FALSE, TRUE); /* get expression and branch
3818 * to flab1 if true */
3819 setline(fline, fcurrent); /* make sure we abort on the correct
3820 * line number */
3821 ffabort(xASSERTION);
3822 setlabel(flab1);
3823 }
3824 else
3825 {
3826 stgset(TRUE); /* start staging */
3827 stgget(&index, &cidx); /* mark position in code generator */
3828 do
3829 {
3830 if (hier14(&lval))
3831 rvalue(&lval);
3832 stgdel(index, cidx); /* just scrap the code */
3833 }
3834 while (matchtoken(','));
3835 stgset(FALSE); /* stop staging */
3836 } /* if */
3837 needtoken(tTERM);
3838}
3839
3840static void
3841dogoto(void)
3842{
3843 char *st;
3844 cell val;
3845 symbol *sym;
3846
3847 if (lex(&val, &st) == tSYMBOL)
3848 {
3849 sym = fetchlab(st);
3850 jumplabel((int)sym->addr);
3851 sym->usage |= uREAD; /* set "uREAD" bit */
3852 /*
3853 * // ??? if the label is defined (check sym->usage & uDEFINE), check
3854 * // sym->compound (nesting level of the label) against nestlevel;
3855 * // if sym->compound < nestlevel, call the destructor operator
3856 */
3857 }
3858 else
3859 {
3860 error(20, st); /* illegal symbol name */
3861 } /* if */
3862 needtoken(tTERM);
3863}
3864
3865static void
3866dolabel(void)
3867{
3868 char *st;
3869 cell val;
3870 symbol *sym;
3871
3872 tokeninfo(&val, &st); /* retrieve label name again */
3873 if (find_constval(&tagname_tab, st, 0))
3874 error(221, st); /* label name shadows tagname */
3875 sym = fetchlab(st);
3876 setlabel((int)sym->addr);
3877 /* since one can jump around variable declarations or out of compound
3878 * blocks, the stack must be manually adjusted
3879 */
3880 setstk(-declared * sizeof(cell));
3881 sym->usage |= uDEFINE; /* label is now defined */
3882}
3883
3884/* fetchlab
3885 *
3886 * Finds a label from the (local) symbol table or adds one to it.
3887 * Labels are local in scope.
3888 *
3889 * Note: The "_usage" bit is set to zero. The routines that call
3890 * "fetchlab()" must set this bit accordingly.
3891 */
3892static symbol *
3893fetchlab(char *name)
3894{
3895 symbol *sym;
3896
3897 sym = findloc(name); /* labels are local in scope */
3898 if (sym)
3899 {
3900 if (sym->ident != iLABEL)
3901 error(19, sym->name); /* not a label: ... */
3902 }
3903 else
3904 {
3905 sym = addsym(name, getlabel(), iLABEL, sLOCAL, 0, 0);
3906 sym->x.declared = (int)declared;
3907 sym->compound = nestlevel;
3908 } /* if */
3909 return sym;
3910}
3911
3912/* doreturn
3913 *
3914 * Global references: rettype (altered)
3915 */
3916static void
3917doreturn(void)
3918{
3919 int tag;
3920
3921 if (matchtoken(tTERM) == 0)
3922 {
3923 if ((rettype & uRETNONE) != 0)
3924 error(208); /* mix "return;" and "return value;" */
3925 doexpr(TRUE, FALSE, FALSE, TRUE, &tag, FALSE);
3926 needtoken(tTERM);
3927 rettype |= uRETVALUE; /* function returns a value */
3928 /* check tagname with function tagname */
3929 assert(curfunc != NULL);
3930 if (!matchtag(curfunc->tag, tag, TRUE))
3931 error(213); /* tagname mismatch */
3932 }
3933 else
3934 {
3935 /* this return statement contains no expression */
3936 const1(0);
3937 if ((rettype & uRETVALUE) != 0)
3938 {
3939 char symname[2 * sNAMEMAX + 16]; /* allow space for user
3940 * defined operators */
3941 assert(curfunc != NULL);
3942 funcdisplayname(symname, curfunc->name);
3943 error(209, symname); /* function should return a value */
3944 } /* if */
3945 rettype |= uRETNONE; /* function does not return anything */
3946 } /* if */
3947 destructsymbols(&loctab, 0); /*call destructor for *all* locals */
3948 modstk((int)declared * sizeof(cell)); /* end of function, remove
3949 *all* * local variables*/
3950 ffret();
3951}
3952
3953static void
3954dobreak(void)
3955{
3956 int *ptr;
3957
3958 ptr = readwhile(); /* readwhile() gives an error if not in loop */
3959 needtoken(tTERM);
3960 if (!ptr)
3961 return;
3962 destructsymbols(&loctab, nestlevel);
3963 modstk(((int)declared - ptr[wqBRK]) * sizeof(cell));
3964 jumplabel(ptr[wqEXIT]);
3965}
3966
3967static void
3968docont(void)
3969{
3970 int *ptr;
3971
3972 ptr = readwhile(); /* readwhile() gives an error if not in loop */
3973 needtoken(tTERM);
3974 if (!ptr)
3975 return;
3976 destructsymbols(&loctab, nestlevel);
3977 modstk(((int)declared - ptr[wqCONT]) * sizeof(cell));
3978 jumplabel(ptr[wqLOOP]);
3979}
3980
3981void
3982exporttag(int tag)
3983{
3984 /* find the tag by value in the table, then set the top bit to mark it
3985 * "public"
3986 */
3987 if (tag != 0)
3988 {
3989 constvalue *ptr;
3990
3991 assert((tag & PUBLICTAG) == 0);
3992 for (ptr = tagname_tab.next;
3993 ptr && tag != (int)(ptr->value & TAGMASK); ptr = ptr->next)
3994 /* nothing */ ;
3995 if (ptr)
3996 ptr->value |= PUBLICTAG;
3997 } /* if */
3998}
3999
4000static void
4001doexit(void)
4002{
4003 int tag = 0;
4004
4005 if (matchtoken(tTERM) == 0)
4006 {
4007 doexpr(TRUE, FALSE, FALSE, TRUE, &tag, FALSE);
4008 needtoken(tTERM);
4009 }
4010 else
4011 {
4012 const1(0);
4013 } /* if */
4014 const2(tag);
4015 exporttag(tag);
4016 destructsymbols(&loctab, 0); /* call destructor for *all* locals */
4017 ffabort(xEXIT);
4018}
4019
4020static void
4021dosleep(void)
4022{
4023 int tag = 0;
4024
4025 if (matchtoken(tTERM) == 0)
4026 {
4027 doexpr(TRUE, FALSE, FALSE, TRUE, &tag, FALSE);
4028 needtoken(tTERM);
4029 }
4030 else
4031 {
4032 const1(0);
4033 } /* if */
4034 const2(tag);
4035 exporttag(tag);
4036 ffabort(xSLEEP);
4037}
4038
4039static void
4040addwhile(int *ptr)
4041{
4042 int k;
4043
4044 ptr[wqBRK] = (int)declared; /* stack pointer (for "break") */
4045 ptr[wqCONT] = (int)declared; /* for "continue", possibly adjusted later */
4046 ptr[wqLOOP] = getlabel();
4047 ptr[wqEXIT] = getlabel();
4048 if (wqptr >= (wq + wqTABSZ - wqSIZE))
4049 error(102, "loop table"); /* loop table overflow (too many active loops) */
4050 k = 0;
4051 while (k < wqSIZE)
4052 { /* copy "ptr" to while queue table */
4053 *wqptr = *ptr;
4054 wqptr += 1;
4055 ptr += 1;
4056 k += 1;
4057 } /* while */
4058}
4059
4060static void
4061delwhile(void)
4062{
4063 if (wqptr > wq)
4064 wqptr -= wqSIZE;
4065}
4066
4067static int *
4068readwhile(void)
4069{
4070 if (wqptr <= wq)
4071 {
4072 error(24); /* out of context */
4073 return NULL;
4074 }
4075 else
4076 {
4077 return (wqptr - wqSIZE);
4078 } /* if */
4079}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc2.c b/libraries/embryo/src/bin/embryo_cc_sc2.c
new file mode 100644
index 0000000..b3f4fae
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc2.c
@@ -0,0 +1,2779 @@
1/* Small compiler - File input, preprocessing and lexical analysis functions
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_sc2.c 62382 2011-08-12 12:39:29Z billiob $
22 */
23
24
25#ifdef HAVE_CONFIG_H
26# include <config.h>
27#endif
28
29#include <assert.h>
30#include <stdio.h>
31#include <stdlib.h>
32#include <string.h>
33#include <ctype.h>
34#include <math.h>
35#include "embryo_cc_sc.h"
36#include "Embryo.h"
37
38static int match(char *st, int end);
39static cell litchar(char **lptr, int rawmode);
40static int alpha(char c);
41
42static int icomment; /* currently in multiline comment? */
43static int iflevel; /* nesting level if #if/#else/#endif */
44static int skiplevel; /* level at which we started skipping */
45static int elsedone; /* level at which we have seen an #else */
46static char term_expr[] = "";
47static int listline = -1; /* "current line" for the list file */
48
49/* pushstk & popstk
50 *
51 * Uses a LIFO stack to store information. The stack is used by doinclude(),
52 * doswitch() (to hold the state of "swactive") and some other routines.
53 *
54 * Porting note: I made the bold assumption that an integer will not be
55 * larger than a pointer (it may be smaller). That is, the stack element
56 * is typedef'ed as a pointer type, but I also store integers on it. See
57 * SC.H for "stkitem"
58 *
59 * Global references: stack,stkidx (private to pushstk() and popstk())
60 */
61static stkitem stack[sSTKMAX];
62static int stkidx;
63void
64pushstk(stkitem val)
65{
66 if (stkidx >= sSTKMAX)
67 error(102, "parser stack"); /* stack overflow (recursive include?) */
68 stack[stkidx] = val;
69 stkidx += 1;
70}
71
72stkitem
73popstk(void)
74{
75 if (stkidx == 0)
76 return (stkitem) - 1; /* stack is empty */
77 stkidx -= 1;
78 return stack[stkidx];
79}
80
81int
82plungequalifiedfile(char *name)
83{
84 static char *extensions[] = { ".inc", ".sma", ".small" };
85 FILE *fp;
86 char *ext;
87 int ext_idx;
88
89 ext_idx = 0;
90 do
91 {
92 fp = (FILE *) sc_opensrc(name);
93 ext = strchr(name, '\0'); /* save position */
94 if (!fp)
95 {
96 /* try to append an extension */
97 strcpy(ext, extensions[ext_idx]);
98 fp = (FILE *) sc_opensrc(name);
99 if (!fp)
100 *ext = '\0'; /* on failure, restore filename */
101 } /* if */
102 ext_idx++;
103 }
104 while ((!fp) &&
105 (ext_idx < (int)(sizeof extensions / sizeof extensions[0])));
106 if (!fp)
107 {
108 *ext = '\0'; /* restore filename */
109 return FALSE;
110 } /* if */
111 pushstk((stkitem) inpf);
112 pushstk((stkitem) inpfname); /* pointer to current file name */
113 pushstk((stkitem) curlibrary);
114 pushstk((stkitem) iflevel);
115 assert(skiplevel == 0);
116 pushstk((stkitem) icomment);
117 pushstk((stkitem) fcurrent);
118 pushstk((stkitem) fline);
119 inpfname = strdup(name); /* set name of include file */
120 if (!inpfname)
121 error(103); /* insufficient memory */
122 inpf = fp; /* set input file pointer to include file */
123 fnumber++;
124 fline = 0; /* set current line number to 0 */
125 fcurrent = fnumber;
126 icomment = FALSE;
127 setfile(inpfname, fcurrent);
128 listline = -1; /* force a #line directive when changing the file */
129 setactivefile(fcurrent);
130 return TRUE;
131}
132
133int
134plungefile(char *name, int try_currentpath, int try_includepaths)
135{
136 int result = FALSE;
137 int i;
138 char *ptr;
139
140 if (try_currentpath)
141 result = plungequalifiedfile(name);
142
143 if (try_includepaths && name[0] != DIRSEP_CHAR)
144 {
145 for (i = 0; !result && (ptr = get_path(i)); i++)
146 {
147 char path[PATH_MAX];
148
149 strncpy(path, ptr, sizeof path);
150 path[sizeof path - 1] = '\0'; /* force '\0' termination */
151 strncat(path, name, sizeof(path) - strlen(path));
152 path[sizeof path - 1] = '\0';
153 result = plungequalifiedfile(path);
154 } /* while */
155 } /* if */
156 return result;
157}
158
159static void
160check_empty(char *lptr)
161{
162 /* verifies that the string contains only whitespace */
163 while (*lptr <= ' ' && *lptr != '\0')
164 lptr++;
165 if (*lptr != '\0')
166 error(38); /* extra characters on line */
167}
168
169/* doinclude
170 *
171 * Gets the name of an include file, pushes the old file on the stack and
172 * sets some options. This routine doesn't use lex(), since lex() doesn't
173 * recognize file names (and directories).
174 *
175 * Global references: inpf (altered)
176 * inpfname (altered)
177 * fline (altered)
178 * lptr (altered)
179 */
180static void
181doinclude(void)
182{
183 char name[PATH_MAX], c;
184 int i, result;
185
186 while (*lptr <= ' ' && *lptr != 0) /* skip leading whitespace */
187 lptr++;
188 if (*lptr == '<' || *lptr == '\"')
189 {
190 c = (char)((*lptr == '\"') ? '\"' : '>'); /* termination character */
191 lptr++;
192 while (*lptr <= ' ' && *lptr != 0) /* skip whitespace after quote */
193 lptr++;
194 }
195 else
196 {
197 c = '\0';
198 } /* if */
199
200 i = 0;
201 while ((*lptr != c) && (*lptr != '\0') && (i < (int)(sizeof(name) - 1))) /* find the end of the string */
202 name[i++] = *lptr++;
203 while (i > 0 && name[i - 1] <= ' ')
204 i--; /* strip trailing whitespace */
205 assert((i >= 0) && (i < (int)(sizeof(name))));
206 name[i] = '\0'; /* zero-terminate the string */
207
208 if (*lptr != c)
209 { /* verify correct string termination */
210 error(37); /* invalid string */
211 return;
212 } /* if */
213 if (c != '\0')
214 check_empty(lptr + 1); /* verify that the rest of the line is whitespace */
215
216 /* Include files between "..." or without quotes are read from the current
217 * directory, or from a list of "include directories". Include files
218 * between <...> are only read from the list of include directories.
219 */
220 result = plungefile(name, (c != '>'), TRUE);
221 if (!result)
222 error(100, name); /* cannot read from ... (fatal error) */
223}
224
225/* readline
226 *
227 * Reads in a new line from the input file pointed to by "inpf". readline()
228 * concatenates lines that end with a \ with the next line. If no more data
229 * can be read from the file, readline() attempts to pop off the previous file
230 * from the stack. If that fails too, it sets "freading" to 0.
231 *
232 * Global references: inpf,fline,inpfname,freading,icomment (altered)
233 */
234static void
235readline(char *line)
236{
237 int i, num, cont;
238 char *ptr;
239
240 if (lptr == term_expr)
241 return;
242 num = sLINEMAX;
243 cont = FALSE;
244 do
245 {
246 if (!inpf || sc_eofsrc(inpf))
247 {
248 if (cont)
249 error(49); /* invalid line continuation */
250 if (inpf && inpf != inpf_org)
251 sc_closesrc(inpf);
252 i = (int)(long)popstk();
253 if (i == -1)
254 { /* All's done; popstk() returns "stack is empty" */
255 freading = FALSE;
256 *line = '\0';
257 /* when there is nothing more to read, the #if/#else stack should
258 * be empty and we should not be in a comment
259 */
260 assert(iflevel >= 0);
261 if (iflevel > 0)
262 error(1, "#endif", "-end of file-");
263 else if (icomment)
264 error(1, "*/", "-end of file-");
265 return;
266 } /* if */
267 fline = i;
268 fcurrent = (int)(long)popstk();
269 icomment = (int)(long)popstk();
270 assert(skiplevel == 0); /* skiplevel was not stored on stack, because it should always be zero at this point */
271 iflevel = (int)(long)popstk();
272 curlibrary = (constvalue *) popstk();
273 free(inpfname); /* return memory allocated for the include file name */
274 inpfname = (char *)popstk();
275 inpf = (FILE *) popstk();
276 setactivefile(fcurrent);
277 listline = -1; /* force a #line directive when changing the file */
278 elsedone = 0;
279 } /* if */
280
281 if (!sc_readsrc(inpf, line, num))
282 {
283 *line = '\0'; /* delete line */
284 cont = FALSE;
285 }
286 else
287 {
288 /* check whether to erase leading spaces */
289 if (cont)
290 {
291 char *ptr = line;
292
293 while (*ptr == ' ' || *ptr == '\t')
294 ptr++;
295 if (ptr != line)
296 memmove(line, ptr, strlen(ptr) + 1);
297 } /* if */
298 cont = FALSE;
299 /* check whether a full line was read */
300 if (!strchr(line, '\n') && !sc_eofsrc(inpf))
301 error(75); /* line too long */
302 /* check if the next line must be concatenated to this line */
303 if ((ptr = strchr(line, '\n')) && ptr > line)
304 {
305 assert(*(ptr + 1) == '\0'); /* '\n' should be last in the string */
306 while (ptr > line
307 && (*ptr == '\n' || *ptr == ' ' || *ptr == '\t'))
308 ptr--; /* skip trailing whitespace */
309 if (*ptr == '\\')
310 {
311 cont = TRUE;
312 /* set '\a' at the position of '\\' to make it possible to check
313 * for a line continuation in a single line comment (error 49)
314 */
315 *ptr++ = '\a';
316 *ptr = '\0'; /* erase '\n' (and any trailing whitespace) */
317 } /* if */
318 } /* if */
319 num -= strlen(line);
320 line += strlen(line);
321 } /* if */
322 fline += 1;
323 }
324 while (num >= 0 && cont);
325}
326
327/* stripcom
328 *
329 * Replaces all comments from the line by space characters. It updates
330 * a global variable ("icomment") for multiline comments.
331 *
332 * This routine also supports the C++ extension for single line comments.
333 * These comments are started with "//" and end at the end of the line.
334 *
335 * Global references: icomment (private to "stripcom")
336 */
337static void
338stripcom(char *line)
339{
340 char c;
341
342 while (*line)
343 {
344 if (icomment)
345 {
346 if (*line == '*' && *(line + 1) == '/')
347 {
348 icomment = FALSE; /* comment has ended */
349 *line = ' '; /* replace '*' and '/' characters by spaces */
350 *(line + 1) = ' ';
351 line += 2;
352 }
353 else
354 {
355 if (*line == '/' && *(line + 1) == '*')
356 error(216); /* nested comment */
357 *line = ' '; /* replace comments by spaces */
358 line += 1;
359 } /* if */
360 }
361 else
362 {
363 if (*line == '/' && *(line + 1) == '*')
364 {
365 icomment = TRUE; /* start comment */
366 *line = ' '; /* replace '/' and '*' characters by spaces */
367 *(line + 1) = ' ';
368 line += 2;
369 }
370 else if (*line == '/' && *(line + 1) == '/')
371 { /* comment to end of line */
372 if (strchr(line, '\a'))
373 error(49); /* invalid line continuation */
374 *line++ = '\n'; /* put "newline" at first slash */
375 *line = '\0'; /* put "zero-terminator" at second slash */
376 }
377 else
378 {
379 if (*line == '\"' || *line == '\'')
380 { /* leave literals unaltered */
381 c = *line; /* ending quote, single or double */
382 line += 1;
383 while ((*line != c || *(line - 1) == '\\')
384 && *line != '\0')
385 line += 1;
386 line += 1; /* skip final quote */
387 }
388 else
389 {
390 line += 1;
391 } /* if */
392 } /* if */
393 } /* if */
394 } /* while */
395}
396
397/* btoi
398 *
399 * Attempts to interpret a numeric symbol as a boolean value. On success
400 * it returns the number of characters processed (so the line pointer can be
401 * adjusted) and the value is stored in "val". Otherwise it returns 0 and
402 * "val" is garbage.
403 *
404 * A boolean value must start with "0b"
405 */
406static int
407btoi(cell * val, char *curptr)
408{
409 char *ptr;
410
411 *val = 0;
412 ptr = curptr;
413 if (*ptr == '0' && *(ptr + 1) == 'b')
414 {
415 ptr += 2;
416 while (*ptr == '0' || *ptr == '1' || *ptr == '_')
417 {
418 if (*ptr != '_')
419 *val = (*val << 1) | (*ptr - '0');
420 ptr++;
421 } /* while */
422 }
423 else
424 {
425 return 0;
426 } /* if */
427 if (alphanum(*ptr)) /* number must be delimited by non-alphanumeric char */
428 return 0;
429 else
430 return (int)(ptr - curptr);
431}
432
433/* dtoi
434 *
435 * Attempts to interpret a numeric symbol as a decimal value. On success
436 * it returns the number of characters processed and the value is stored in
437 * "val". Otherwise it returns 0 and "val" is garbage.
438 */
439static int
440dtoi(cell * val, char *curptr)
441{
442 char *ptr;
443
444 *val = 0;
445 ptr = curptr;
446 if (!isdigit(*ptr)) /* should start with digit */
447 return 0;
448 while (isdigit(*ptr) || *ptr == '_')
449 {
450 if (*ptr != '_')
451 *val = (*val * 10) + (*ptr - '0');
452 ptr++;
453 } /* while */
454 if (alphanum(*ptr)) /* number must be delimited by non-alphanumerical */
455 return 0;
456 if (*ptr == '.' && isdigit(*(ptr + 1)))
457 return 0; /* but a fractional part must not be present */
458 return (int)(ptr - curptr);
459}
460
461/* htoi
462 *
463 * Attempts to interpret a numeric symbol as a hexadecimal value. On
464 * success it returns the number of characters processed and the value is
465 * stored in "val". Otherwise it return 0 and "val" is garbage.
466 */
467static int
468htoi(cell * val, char *curptr)
469{
470 char *ptr;
471
472 *val = 0;
473 ptr = curptr;
474 if (!isdigit(*ptr)) /* should start with digit */
475 return 0;
476 if (*ptr == '0' && *(ptr + 1) == 'x')
477 { /* C style hexadecimal notation */
478 ptr += 2;
479 while (isxdigit(*ptr) || *ptr == '_')
480 {
481 if (*ptr != '_')
482 {
483 assert(isxdigit(*ptr));
484 *val = *val << 4;
485 if (isdigit(*ptr))
486 *val += (*ptr - '0');
487 else
488 *val += (tolower(*ptr) - 'a' + 10);
489 } /* if */
490 ptr++;
491 } /* while */
492 }
493 else
494 {
495 return 0;
496 } /* if */
497 if (alphanum(*ptr))
498 return 0;
499 else
500 return (int)(ptr - curptr);
501}
502
503#if defined LINUX
504static double
505pow10(int value)
506{
507 double res = 1.0;
508
509 while (value >= 4)
510 {
511 res *= 10000.0;
512 value -= 5;
513 } /* while */
514 while (value >= 2)
515 {
516 res *= 100.0;
517 value -= 2;
518 } /* while */
519 while (value >= 1)
520 {
521 res *= 10.0;
522 value -= 1;
523 } /* while */
524 return res;
525}
526#endif
527
528/* ftoi
529 *
530 * Attempts to interpret a numeric symbol as a rational number, either as
531 * IEEE 754 single precision floating point or as a fixed point integer.
532 * On success it returns the number of characters processed and the value is
533 * stored in "val". Otherwise it returns 0 and "val" is unchanged.
534 *
535 * Small has stricter definition for floating point numbers than most:
536 * o the value must start with a digit; ".5" is not a valid number, you
537 * should write "0.5"
538 * o a period must appear in the value, even if an exponent is given; "2e3"
539 * is not a valid number, you should write "2.0e3"
540 * o at least one digit must follow the period; "6." is not a valid number,
541 * you should write "6.0"
542 */
543static int
544ftoi(cell * val, char *curptr)
545{
546 char *ptr;
547 double fnum, ffrac, fmult;
548 unsigned long dnum, dbase;
549 int i, ignore;
550
551 assert(rational_digits >= 0 && rational_digits < 9);
552 for (i = 0, dbase = 1; i < rational_digits; i++)
553 dbase *= 10;
554 fnum = 0.0;
555 dnum = 0L;
556 ptr = curptr;
557 if (!isdigit(*ptr)) /* should start with digit */
558 return 0;
559 while (isdigit(*ptr) || *ptr == '_')
560 {
561 if (*ptr != '_')
562 {
563 fnum = (fnum * 10.0) + (*ptr - '0');
564 dnum = (dnum * 10L) + (*ptr - '0') * dbase;
565 } /* if */
566 ptr++;
567 } /* while */
568 if (*ptr != '.')
569 return 0; /* there must be a period */
570 ptr++;
571 if (!isdigit(*ptr)) /* there must be at least one digit after the dot */
572 return 0;
573 ffrac = 0.0;
574 fmult = 1.0;
575 ignore = FALSE;
576 while (isdigit(*ptr) || *ptr == '_')
577 {
578 if (*ptr != '_')
579 {
580 ffrac = (ffrac * 10.0) + (*ptr - '0');
581 fmult = fmult / 10.0;
582 dbase /= 10L;
583 dnum += (*ptr - '0') * dbase;
584 if (dbase == 0L && sc_rationaltag && rational_digits > 0
585 && !ignore)
586 {
587 error(222); /* number of digits exceeds rational number precision */
588 ignore = TRUE;
589 } /* if */
590 } /* if */
591 ptr++;
592 } /* while */
593 fnum += ffrac * fmult; /* form the number so far */
594 if (*ptr == 'e')
595 { /* optional fractional part */
596 int exp, sign;
597
598 ptr++;
599 if (*ptr == '-')
600 {
601 sign = -1;
602 ptr++;
603 }
604 else
605 {
606 sign = 1;
607 } /* if */
608 if (!isdigit(*ptr)) /* 'e' should be followed by a digit */
609 return 0;
610 exp = 0;
611 while (isdigit(*ptr))
612 {
613 exp = (exp * 10) + (*ptr - '0');
614 ptr++;
615 } /* while */
616#if defined LINUX
617 fmult = pow10(exp * sign);
618#else
619 fmult = pow(10, exp * sign);
620#endif
621 fnum *= fmult;
622 dnum *= (unsigned long)(fmult + 0.5);
623 } /* if */
624
625 /* decide how to store the number */
626 if (sc_rationaltag == 0)
627 {
628 error(70); /* rational number support was not enabled */
629 *val = 0;
630 }
631 else if (rational_digits == 0)
632 {
633 float f = (float) fnum;
634 /* floating point */
635 *val = EMBRYO_FLOAT_TO_CELL(f);
636#if !defined NDEBUG
637 /* I assume that the C/C++ compiler stores "float" values in IEEE 754
638 * format (as mandated in the ANSI standard). Test this assumption anyway.
639 */
640 {
641 float test1 = 0.0, test2 = 50.0;
642 Embryo_Cell c1 = EMBRYO_FLOAT_TO_CELL(test1);
643 Embryo_Cell c2 = EMBRYO_FLOAT_TO_CELL(test2);
644
645 if (c1 != 0x00000000L)
646 {
647 fprintf(stderr,
648 "embryo_cc: WARNING! you compiler does not SEEM to interpret IEEE floating\n"
649 "point math as embryo expects. this could be bad.\n"
650 "\n"
651 "(float 0.0 != 0x00000000 bitpattern, 0x%08x instead)\n"
652 "\n"
653 "this could be an issue with you compiling embryo with gcc 3.2.x that seems\n"
654 "to trigger this sanity check. we are not sure why yet, but gcc 3.3.x works\n"
655 , c1);
656 }
657 else if (c2 != 0x42480000L)
658 {
659 fprintf(stderr,
660 "embryo_cc: WARNING! you compiler does not SEEM to interpret IEEE floating\n"
661 "point math as embryo expects. This could be bad.\n"
662 "\n"
663 "(float 50.0 != 0x42480000 bitpattern, 0x%08x instead)\n"
664 "\n"
665 "this could be an issue with you compiling embryo with gcc 3.2.x that seems\n"
666 "to trigger this sanity check. we are not sure why yet, but gcc 3.3.x works\n"
667 , c2);
668 }
669 }
670#endif
671 }
672 else
673 {
674 /* fixed point */
675 *val = (cell) dnum;
676 } /* if */
677
678 return (int)(ptr - curptr);
679}
680
681/* number
682 *
683 * Reads in a number (binary, decimal or hexadecimal). It returns the number
684 * of characters processed or 0 if the symbol couldn't be interpreted as a
685 * number (in this case the argument "val" remains unchanged). This routine
686 * relies on the 'early dropout' implementation of the logical or (||)
687 * operator.
688 *
689 * Note: the routine doesn't check for a sign (+ or -). The - is checked
690 * for at "hier2()" (in fact, it is viewed as an operator, not as a
691 * sign) and the + is invalid (as in K&R C, and unlike ANSI C).
692 */
693static int
694number(cell * val, char *curptr)
695{
696 int i;
697 cell value;
698
699 if ((i = btoi(&value, curptr)) != 0 /* binary? */
700 || (i = htoi(&value, curptr)) != 0 /* hexadecimal? */
701 || (i = dtoi(&value, curptr)) != 0) /* decimal? */
702 {
703 *val = value;
704 return i;
705 }
706 else
707 {
708 return 0; /* else not a number */
709 } /* if */
710}
711
712static void
713chrcat(char *str, char chr)
714{
715 str = strchr(str, '\0');
716 *str++ = chr;
717 *str = '\0';
718}
719
720static int
721preproc_expr(cell * val, int *tag)
722{
723 int result;
724 int index;
725 cell code_index;
726 char *term;
727
728 /* Disable staging; it should be disabled already because
729 * expressions may not be cut off half-way between conditional
730 * compilations. Reset the staging index, but keep the code
731 * index.
732 */
733 if (stgget(&index, &code_index))
734 {
735 error(57); /* unfinished expression */
736 stgdel(0, code_index);
737 stgset(FALSE);
738 } /* if */
739 /* append a special symbol to the string, so the expression
740 * analyzer won't try to read a next line when it encounters
741 * an end-of-line
742 */
743 assert(strlen(pline) < sLINEMAX);
744 term = strchr(pline, '\0');
745 assert(term != NULL);
746 chrcat(pline, PREPROC_TERM); /* the "DEL" code (see SC.H) */
747 result = constexpr(val, tag); /* get value (or 0 on error) */
748 *term = '\0'; /* erase the token (if still present) */
749 lexclr(FALSE); /* clear any "pushed" tokens */
750 return result;
751}
752
753/* getstring
754 * Returns returns a pointer behind the closing quote or to the other
755 * character that caused the input to be ended.
756 */
757static char *
758getstring(char *dest, int max)
759{
760 assert(dest != NULL);
761 *dest = '\0';
762 while (*lptr <= ' ' && *lptr != '\0')
763 lptr++; /* skip whitespace */
764 if (*lptr != '"')
765 {
766 error(37); /* invalid string */
767 }
768 else
769 {
770 int len = 0;
771
772 lptr++; /* skip " */
773 while (*lptr != '"' && *lptr != '\0')
774 {
775 if (len < max - 1)
776 dest[len++] = *lptr;
777 lptr++;
778 } /* if */
779 dest[len] = '\0';
780 if (*lptr == '"')
781 lptr++; /* skip closing " */
782 else
783 error(37); /* invalid string */
784 } /* if */
785 return lptr;
786}
787
788enum
789{
790 CMD_NONE,
791 CMD_TERM,
792 CMD_EMPTYLINE,
793 CMD_CONDFALSE,
794 CMD_INCLUDE,
795 CMD_DEFINE,
796 CMD_IF,
797 CMD_DIRECTIVE,
798};
799
800/* command
801 *
802 * Recognizes the compiler directives. The function returns:
803 * CMD_NONE the line must be processed
804 * CMD_TERM a pending expression must be completed before processing further lines
805 * Other value: the line must be skipped, because:
806 * CMD_CONDFALSE false "#if.." code
807 * CMD_EMPTYLINE line is empty
808 * CMD_INCLUDE the line contains a #include directive
809 * CMD_DEFINE the line contains a #subst directive
810 * CMD_IF the line contains a #if/#else/#endif directive
811 * CMD_DIRECTIVE the line contains some other compiler directive
812 *
813 * Global variables: iflevel, skiplevel, elsedone (altered)
814 * lptr (altered)
815 */
816static int
817command(void)
818{
819 int tok, ret;
820 cell val;
821 char *str;
822 int index;
823 cell code_index;
824
825 while (*lptr <= ' ' && *lptr != '\0')
826 lptr += 1;
827 if (*lptr == '\0')
828 return CMD_EMPTYLINE; /* empty line */
829 if (*lptr != '#')
830 return skiplevel > 0 ? CMD_CONDFALSE : CMD_NONE; /* it is not a compiler directive */
831 /* compiler directive found */
832 indent_nowarn = TRUE; /* allow loose indentation" */
833 lexclr(FALSE); /* clear any "pushed" tokens */
834 /* on a pending expression, force to return a silent ';' token and force to
835 * re-read the line
836 */
837 if (!sc_needsemicolon && stgget(&index, &code_index))
838 {
839 lptr = term_expr;
840 return CMD_TERM;
841 } /* if */
842 tok = lex(&val, &str);
843 ret = skiplevel > 0 ? CMD_CONDFALSE : CMD_DIRECTIVE; /* preset 'ret' to CMD_DIRECTIVE (most common case) */
844 switch (tok)
845 {
846 case tpIF: /* conditional compilation */
847 ret = CMD_IF;
848 iflevel += 1;
849 if (skiplevel)
850 break; /* break out of switch */
851 preproc_expr(&val, NULL); /* get value (or 0 on error) */
852 if (!val)
853 skiplevel = iflevel;
854 check_empty(lptr);
855 break;
856 case tpELSE:
857 ret = CMD_IF;
858 if (iflevel == 0 && skiplevel == 0)
859 {
860 error(26); /* no matching #if */
861 errorset(sRESET);
862 }
863 else
864 {
865 if (elsedone == iflevel)
866 error(60); /* multiple #else directives between #if ... #endif */
867 elsedone = iflevel;
868 if (skiplevel == iflevel)
869 skiplevel = 0;
870 else if (skiplevel == 0)
871 skiplevel = iflevel;
872 } /* if */
873 check_empty(lptr);
874 break;
875#if 0 /* ??? *really* need to use a stack here */
876 case tpELSEIF:
877 ret = CMD_IF;
878 if (iflevel == 0 && skiplevel == 0)
879 {
880 error(26); /* no matching #if */
881 errorset(sRESET);
882 }
883 else if (elsedone == iflevel)
884 {
885 error(61); /* #elseif directive may not follow an #else */
886 errorset(sRESET);
887 }
888 else
889 {
890 preproc_expr(&val, NULL); /* get value (or 0 on error) */
891 if (skiplevel == 0)
892 skiplevel = iflevel; /* we weren't skipping, start skipping now */
893 else if (val)
894 skiplevel = 0; /* we were skipping, condition is valid -> stop skipping */
895 /* else: we were skipping and condition is invalid -> keep skipping */
896 check_empty(lptr);
897 } /* if */
898 break;
899#endif
900 case tpENDIF:
901 ret = CMD_IF;
902 if (iflevel == 0 && skiplevel == 0)
903 {
904 error(26);
905 errorset(sRESET);
906 }
907 else
908 {
909 if (skiplevel == iflevel)
910 skiplevel = 0;
911 if (elsedone == iflevel)
912 elsedone = 0; /* ??? actually, should build a stack of #if/#endif and keep
913 * the state whether an #else was seen per nesting level */
914 iflevel -= 1;
915 } /* if */
916 check_empty(lptr);
917 break;
918 case tINCLUDE: /* #include directive */
919 ret = CMD_INCLUDE;
920 if (skiplevel == 0)
921 doinclude();
922 break;
923 case tpFILE:
924 if (skiplevel == 0)
925 {
926 char pathname[PATH_MAX];
927
928 lptr = getstring(pathname, sizeof pathname);
929 if (pathname[0] != '\0')
930 {
931 free(inpfname);
932 inpfname = strdup(pathname);
933 if (!inpfname)
934 error(103); /* insufficient memory */
935 } /* if */
936 } /* if */
937 check_empty(lptr);
938 break;
939 case tpLINE:
940 if (skiplevel == 0)
941 {
942 if (lex(&val, &str) != tNUMBER)
943 error(8); /* invalid/non-constant expression */
944 fline = (int)val;
945
946 while (*lptr == ' ' && *lptr != '\0')
947 lptr++; /* skip whitespace */
948 if (*lptr == '"')
949 {
950 char pathname[PATH_MAX];
951
952 lptr = getstring(pathname, sizeof pathname);
953 if (pathname[0] != '\0')
954 {
955 free(inpfname);
956 inpfname = strdup(pathname);
957 if (!inpfname)
958 error(103); /* insufficient memory */
959 } /* if */
960 }
961 } /* if */
962 check_empty(lptr);
963 break;
964 case tpASSERT:
965 if (skiplevel == 0 && (sc_debug & sCHKBOUNDS) != 0)
966 {
967 preproc_expr(&val, NULL); /* get constant expression (or 0 on error) */
968 if (!val)
969 error(7); /* assertion failed */
970 check_empty(lptr);
971 } /* if */
972 break;
973 case tpPRAGMA:
974 if (skiplevel == 0)
975 {
976 if (lex(&val, &str) == tSYMBOL)
977 {
978 if (strcmp(str, "ctrlchar") == 0)
979 {
980 if (lex(&val, &str) != tNUMBER)
981 error(27); /* invalid character constant */
982 sc_ctrlchar = (char)val;
983 }
984 else if (strcmp(str, "compress") == 0)
985 {
986 cell val;
987
988 preproc_expr(&val, NULL);
989 sc_compress = (int)val; /* switch code packing on/off */
990 }
991 else if (strcmp(str, "dynamic") == 0)
992 {
993 preproc_expr(&sc_stksize, NULL);
994 }
995 else if (strcmp(str, "library") == 0)
996 {
997 char name[sNAMEMAX + 1];
998
999 while (*lptr <= ' ' && *lptr != '\0')
1000 lptr++;
1001 if (*lptr == '"')
1002 {
1003 lptr = getstring(name, sizeof name);
1004 }
1005 else
1006 {
1007 int i;
1008
1009 for (i = 0;
1010 (i < (int)(sizeof(name))) &&
1011 (alphanum(*lptr));
1012 i++, lptr++)
1013 name[i] = *lptr;
1014 name[i] = '\0';
1015 } /* if */
1016 if (name[0] == '\0')
1017 {
1018 curlibrary = NULL;
1019 }
1020 else
1021 {
1022 if (strlen(name) > sEXPMAX)
1023 error(220, name, sEXPMAX); /* exported symbol is truncated */
1024 /* add the name if it does not yet exist in the table */
1025 if (!find_constval(&libname_tab, name, 0))
1026 curlibrary =
1027 append_constval(&libname_tab, name, 0, 0);
1028 } /* if */
1029 }
1030 else if (strcmp(str, "pack") == 0)
1031 {
1032 cell val;
1033
1034 preproc_expr(&val, NULL); /* default = packed/unpacked */
1035 sc_packstr = (int)val;
1036 }
1037 else if (strcmp(str, "rational") == 0)
1038 {
1039 char name[sNAMEMAX + 1];
1040 cell digits = 0;
1041 int i;
1042
1043 /* first gather all information, start with the tag name */
1044 while ((*lptr <= ' ') && (*lptr != '\0'))
1045 lptr++;
1046 for (i = 0;
1047 (i < (int)(sizeof(name))) &&
1048 (alphanum(*lptr));
1049 i++, lptr++)
1050 name[i] = *lptr;
1051 name[i] = '\0';
1052 /* then the precision (for fixed point arithmetic) */
1053 while (*lptr <= ' ' && *lptr != '\0')
1054 lptr++;
1055 if (*lptr == '(')
1056 {
1057 preproc_expr(&digits, NULL);
1058 if (digits <= 0 || digits > 9)
1059 {
1060 error(68); /* invalid rational number precision */
1061 digits = 0;
1062 } /* if */
1063 if (*lptr == ')')
1064 lptr++;
1065 } /* if */
1066 /* add the tag (make it public) and check the values */
1067 i = sc_addtag(name);
1068 exporttag(i);
1069 if (sc_rationaltag == 0
1070 || (sc_rationaltag == i
1071 && rational_digits == (int)digits))
1072 {
1073 sc_rationaltag = i;
1074 rational_digits = (int)digits;
1075 }
1076 else
1077 {
1078 error(69); /* rational number format already set, can only be set once */
1079 } /* if */
1080 }
1081 else if (strcmp(str, "semicolon") == 0)
1082 {
1083 cell val;
1084
1085 preproc_expr(&val, NULL);
1086 sc_needsemicolon = (int)val;
1087 }
1088 else if (strcmp(str, "tabsize") == 0)
1089 {
1090 cell val;
1091
1092 preproc_expr(&val, NULL);
1093 sc_tabsize = (int)val;
1094 }
1095 else if (strcmp(str, "align") == 0)
1096 {
1097 sc_alignnext = TRUE;
1098 }
1099 else if (strcmp(str, "unused") == 0)
1100 {
1101 char name[sNAMEMAX + 1];
1102 int i, comma;
1103 symbol *sym;
1104
1105 do
1106 {
1107 /* get the name */
1108 while ((*lptr <= ' ') && (*lptr != '\0'))
1109 lptr++;
1110 for (i = 0;
1111 (i < (int)(sizeof(name))) &&
1112 (isalpha(*lptr));
1113 i++, lptr++)
1114 name[i] = *lptr;
1115 name[i] = '\0';
1116 /* get the symbol */
1117 sym = findloc(name);
1118 if (!sym)
1119 sym = findglb(name);
1120 if (sym)
1121 {
1122 sym->usage |= uREAD;
1123 if (sym->ident == iVARIABLE
1124 || sym->ident == iREFERENCE
1125 || sym->ident == iARRAY
1126 || sym->ident == iREFARRAY)
1127 sym->usage |= uWRITTEN;
1128 }
1129 else
1130 {
1131 error(17, name); /* undefined symbol */
1132 } /* if */
1133 /* see if a comma follows the name */
1134 while (*lptr <= ' ' && *lptr != '\0')
1135 lptr++;
1136 comma = (*lptr == ',');
1137 if (comma)
1138 lptr++;
1139 }
1140 while (comma);
1141 }
1142 else
1143 {
1144 error(207); /* unknown #pragma */
1145 } /* if */
1146 }
1147 else
1148 {
1149 error(207); /* unknown #pragma */
1150 } /* if */
1151 check_empty(lptr);
1152 } /* if */
1153 break;
1154 case tpENDINPUT:
1155 case tpENDSCRPT:
1156 if (skiplevel == 0)
1157 {
1158 check_empty(lptr);
1159 assert(inpf != NULL);
1160 if (inpf != inpf_org)
1161 sc_closesrc(inpf);
1162 inpf = NULL;
1163 } /* if */
1164 break;
1165#if !defined NOEMIT
1166 case tpEMIT:
1167 {
1168 /* write opcode to output file */
1169 char name[40];
1170 int i;
1171
1172 while (*lptr <= ' ' && *lptr != '\0')
1173 lptr++;
1174 for (i = 0; i < 40 && (isalpha(*lptr) || *lptr == '.'); i++, lptr++)
1175 name[i] = (char)tolower(*lptr);
1176 name[i] = '\0';
1177 stgwrite("\t");
1178 stgwrite(name);
1179 stgwrite(" ");
1180 code_idx += opcodes(1);
1181 /* write parameter (if any) */
1182 while (*lptr <= ' ' && *lptr != '\0')
1183 lptr++;
1184 if (*lptr != '\0')
1185 {
1186 symbol *sym;
1187
1188 tok = lex(&val, &str);
1189 switch (tok)
1190 {
1191 case tNUMBER:
1192 case tRATIONAL:
1193 outval(val, FALSE);
1194 code_idx += opargs(1);
1195 break;
1196 case tSYMBOL:
1197 sym = findloc(str);
1198 if (!sym)
1199 sym = findglb(str);
1200 if (!sym || (sym->ident != iFUNCTN
1201 && sym->ident != iREFFUNC
1202 && (sym->usage & uDEFINE) == 0))
1203 {
1204 error(17, str); /* undefined symbol */
1205 }
1206 else
1207 {
1208 outval(sym->addr, FALSE);
1209 /* mark symbol as "used", unknown whether for read or write */
1210 markusage(sym, uREAD | uWRITTEN);
1211 code_idx += opargs(1);
1212 } /* if */
1213 break;
1214 default:
1215 {
1216 char s2[20];
1217 extern char *sc_tokens[]; /* forward declaration */
1218
1219 if (tok < 256)
1220 sprintf(s2, "%c", (char)tok);
1221 else
1222 strcpy(s2, sc_tokens[tok - tFIRST]);
1223 error(1, sc_tokens[tSYMBOL - tFIRST], s2);
1224 break;
1225 } /* case */
1226 } /* switch */
1227 } /* if */
1228 stgwrite("\n");
1229 check_empty(lptr);
1230 break;
1231 } /* case */
1232#endif
1233#if !defined NO_DEFINE
1234 case tpDEFINE:
1235 {
1236 ret = CMD_DEFINE;
1237 if (skiplevel == 0)
1238 {
1239 char *pattern, *substitution;
1240 char *start, *end;
1241 int count, prefixlen;
1242 stringpair *def;
1243
1244 /* find the pattern to match */
1245 while (*lptr <= ' ' && *lptr != '\0')
1246 lptr++;
1247 start = lptr; /* save starting point of the match pattern */
1248 count = 0;
1249 while (*lptr > ' ' && *lptr != '\0')
1250 {
1251 litchar(&lptr, FALSE); /* litchar() advances "lptr" and handles escape characters */
1252 count++;
1253 } /* while */
1254 end = lptr;
1255 /* check pattern to match */
1256 if (!isalpha(*start) && *start != '_')
1257 {
1258 error(74); /* pattern must start with an alphabetic character */
1259 break;
1260 } /* if */
1261 /* store matched pattern */
1262 pattern = malloc(count + 1);
1263 if (!pattern)
1264 error(103); /* insufficient memory */
1265 lptr = start;
1266 count = 0;
1267 while (lptr != end)
1268 {
1269 assert(lptr < end);
1270 assert(*lptr != '\0');
1271 pattern[count++] = (char)litchar(&lptr, FALSE);
1272 } /* while */
1273 pattern[count] = '\0';
1274 /* special case, erase trailing variable, because it could match anything */
1275 if (count >= 2 && isdigit(pattern[count - 1])
1276 && pattern[count - 2] == '%')
1277 pattern[count - 2] = '\0';
1278 /* find substitution string */
1279 while (*lptr <= ' ' && *lptr != '\0')
1280 lptr++;
1281 start = lptr; /* save starting point of the match pattern */
1282 count = 0;
1283 end = NULL;
1284 while (*lptr != '\0')
1285 {
1286 /* keep position of the start of trailing whitespace */
1287 if (*lptr <= ' ')
1288 {
1289 if (!end)
1290 end = lptr;
1291 }
1292 else
1293 {
1294 end = NULL;
1295 } /* if */
1296 count++;
1297 lptr++;
1298 } /* while */
1299 if (!end)
1300 end = lptr;
1301 /* store matched substitution */
1302 substitution = malloc(count + 1); /* +1 for '\0' */
1303 if (!substitution)
1304 error(103); /* insufficient memory */
1305 lptr = start;
1306 count = 0;
1307 while (lptr != end)
1308 {
1309 assert(lptr < end);
1310 assert(*lptr != '\0');
1311 substitution[count++] = *lptr++;
1312 } /* while */
1313 substitution[count] = '\0';
1314 /* check whether the definition already exists */
1315 for (prefixlen = 0, start = pattern;
1316 isalpha(*start) || isdigit(*start) || *start == '_';
1317 prefixlen++, start++)
1318 /* nothing */ ;
1319 assert(prefixlen > 0);
1320 if ((def = find_subst(pattern, prefixlen)))
1321 {
1322 if (strcmp(def->first, pattern) != 0
1323 || strcmp(def->second, substitution) != 0)
1324 error(201, pattern); /* redefinition of macro (non-identical) */
1325 delete_subst(pattern, prefixlen);
1326 } /* if */
1327 /* add the pattern/substitution pair to the list */
1328 assert(pattern[0] != '\0');
1329 insert_subst(pattern, substitution, prefixlen);
1330 free(pattern);
1331 free(substitution);
1332 } /* if */
1333 break;
1334 } /* case */
1335 case tpUNDEF:
1336 if (skiplevel == 0)
1337 {
1338 if (lex(&val, &str) == tSYMBOL)
1339 {
1340 if (!delete_subst(str, strlen(str)))
1341 error(17, str); /* undefined symbol */
1342 }
1343 else
1344 {
1345 error(20, str); /* invalid symbol name */
1346 } /* if */
1347 check_empty(lptr);
1348 } /* if */
1349 break;
1350#endif
1351 default:
1352 error(31); /* unknown compiler directive */
1353 ret = skiplevel > 0 ? CMD_DIRECTIVE : CMD_NONE; /* line must be processed (if skiplevel==0) */
1354 } /* switch */
1355 return ret;
1356}
1357
1358#if !defined NO_DEFINE
1359static int
1360is_startstring(char *string)
1361{
1362 if (*string == '\"' || *string == '\'')
1363 return TRUE; /* "..." */
1364
1365 if (*string == '!')
1366 {
1367 string++;
1368 if (*string == '\"' || *string == '\'')
1369 return TRUE; /* !"..." */
1370 if (*string == sc_ctrlchar)
1371 {
1372 string++;
1373 if (*string == '\"' || *string == '\'')
1374 return TRUE; /* !\"..." */
1375 } /* if */
1376 }
1377 else if (*string == sc_ctrlchar)
1378 {
1379 string++;
1380 if (*string == '\"' || *string == '\'')
1381 return TRUE; /* \"..." */
1382 if (*string == '!')
1383 {
1384 string++;
1385 if (*string == '\"' || *string == '\'')
1386 return TRUE; /* \!"..." */
1387 } /* if */
1388 } /* if */
1389
1390 return FALSE;
1391}
1392
1393static char *
1394skipstring(char *string)
1395{
1396 char endquote;
1397 int rawstring = FALSE;
1398
1399 while (*string == '!' || *string == sc_ctrlchar)
1400 {
1401 rawstring = (*string == sc_ctrlchar);
1402 string++;
1403 } /* while */
1404
1405 endquote = *string;
1406 assert(endquote == '\"' || endquote == '\'');
1407 string++; /* skip open quote */
1408 while (*string != endquote && *string != '\0')
1409 litchar(&string, rawstring);
1410 return string;
1411}
1412
1413static char *
1414skippgroup(char *string)
1415{
1416 int nest = 0;
1417 char open = *string;
1418 char close;
1419
1420 switch (open)
1421 {
1422 case '(':
1423 close = ')';
1424 break;
1425 case '{':
1426 close = '}';
1427 break;
1428 case '[':
1429 close = ']';
1430 break;
1431 case '<':
1432 close = '>';
1433 break;
1434 default:
1435 assert(0);
1436 close = '\0'; /* only to avoid a compiler warning */
1437 } /* switch */
1438
1439 string++;
1440 while (*string != close || nest > 0)
1441 {
1442 if (*string == open)
1443 nest++;
1444 else if (*string == close)
1445 nest--;
1446 else if (is_startstring(string))
1447 string = skipstring(string);
1448 if (*string == '\0')
1449 break;
1450 string++;
1451 } /* while */
1452 return string;
1453}
1454
1455static char *
1456strdel(char *str, size_t len)
1457{
1458 size_t length = strlen(str);
1459
1460 if (len > length)
1461 len = length;
1462 memmove(str, str + len, length - len + 1); /* include EOS byte */
1463 return str;
1464}
1465
1466static char *
1467strins(char *dest, char *src, size_t srclen)
1468{
1469 size_t destlen = strlen(dest);
1470
1471 assert(srclen <= strlen(src));
1472 memmove(dest + srclen, dest, destlen + 1); /* include EOS byte */
1473 memcpy(dest, src, srclen);
1474 return dest;
1475}
1476
1477static int
1478substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1479{
1480 int prefixlen;
1481 char *p, *s, *e, *args[10];
1482 int match, arg, len;
1483
1484 memset(args, 0, sizeof args);
1485
1486 /* check the length of the prefix */
1487 for (prefixlen = 0, s = pattern; isalpha(*s) || isdigit(*s) || *s == '_';
1488 prefixlen++, s++)
1489 /* nothing */ ;
1490 assert(prefixlen > 0);
1491 assert(strncmp(line, pattern, prefixlen) == 0);
1492
1493 /* pattern prefix matches; match the rest of the pattern, gather
1494 * the parameters
1495 */
1496 s = line + prefixlen;
1497 p = pattern + prefixlen;
1498 match = TRUE; /* so far, pattern matches */
1499 while (match && *s != '\0' && *p != '\0')
1500 {
1501 if (*p == '%')
1502 {
1503 p++; /* skip '%' */
1504 if (isdigit(*p))
1505 {
1506 arg = *p - '0';
1507 assert(arg >= 0 && arg <= 9);
1508 p++; /* skip parameter id */
1509 assert(*p != '\0');
1510 /* match the source string up to the character after the digit
1511 * (skipping strings in the process
1512 */
1513 e = s;
1514 while (*e != *p && *e != '\0' && *e != '\n')
1515 {
1516 if (is_startstring(e)) /* skip strings */
1517 e = skipstring(e);
1518 else if (strchr("({[", *e)) /* skip parenthized groups */
1519 e = skippgroup(e);
1520 if (*e != '\0')
1521 e++; /* skip non-alphapetic character (or closing quote of
1522 * a string, or the closing paranthese of a group) */
1523 } /* while */
1524 /* store the parameter (overrule any earlier) */
1525 if (args[arg])
1526 free(args[arg]);
1527 len = (int)(e - s);
1528 args[arg] = malloc(len + 1);
1529 if (!args[arg])
1530 error(103); /* insufficient memory */
1531 strncpy(args[arg], s, len);
1532 args[arg][len] = '\0';
1533 /* character behind the pattern was matched too */
1534 if (*e == *p)
1535 {
1536 s = e + 1;
1537 }
1538 else if (*e == '\n' && *p == ';' && *(p + 1) == '\0'
1539 && !sc_needsemicolon)
1540 {
1541 s = e; /* allow a trailing ; in the pattern match to end of line */
1542 }
1543 else
1544 {
1545 assert(*e == '\0' || *e == '\n');
1546 match = FALSE;
1547 s = e;
1548 } /* if */
1549 p++;
1550 }
1551 else
1552 {
1553 match = FALSE;
1554 } /* if */
1555 }
1556 else if (*p == ';' && *(p + 1) == '\0' && !sc_needsemicolon)
1557 {
1558 /* source may be ';' or end of the line */
1559 while (*s <= ' ' && *s != '\0')
1560 s++; /* skip white space */
1561 if (*s != ';' && *s != '\0')
1562 match = FALSE;
1563 p++; /* skip the semicolon in the pattern */
1564 }
1565 else
1566 {
1567 cell ch;
1568
1569 /* skip whitespace between two non-alphanumeric characters, except
1570 * for two identical symbols
1571 */
1572 assert(p > pattern);
1573 if (!alphanum(*p) && *(p - 1) != *p)
1574 while (*s <= ' ' && *s != '\0')
1575 s++; /* skip white space */
1576 ch = litchar(&p, FALSE); /* this increments "p" */
1577 if (*s != ch)
1578 match = FALSE;
1579 else
1580 s++; /* this character matches */
1581 } /* if */
1582 } /* while */
1583
1584 if (match && *p == '\0')
1585 {
1586 /* if the last character to match is an alphanumeric character, the
1587 * current character in the source may not be alphanumeric
1588 */
1589 assert(p > pattern);
1590 if (alphanum(*(p - 1)) && alphanum(*s))
1591 match = FALSE;
1592 } /* if */
1593
1594 if (match)
1595 {
1596 /* calculate the length of the substituted string */
1597 for (e = substitution, len = 0; *e != '\0'; e++)
1598 {
1599 if (*e == '%' && isdigit(*(e + 1)))
1600 {
1601 arg = *(e + 1) - '0';
1602 assert(arg >= 0 && arg <= 9);
1603 if (args[arg])
1604 len += strlen(args[arg]);
1605 e++; /* skip %, digit is skipped later */
1606 }
1607 else
1608 {
1609 len++;
1610 } /* if */
1611 } /* for */
1612 /* check length of the string after substitution */
1613 if (strlen(line) + len - (int)(s - line) > buffersize)
1614 {
1615 error(75); /* line too long */
1616 }
1617 else
1618 {
1619 /* substitute pattern */
1620 strdel(line, (int)(s - line));
1621 for (e = substitution, s = line; *e != '\0'; e++)
1622 {
1623 if (*e == '%' && isdigit(*(e + 1)))
1624 {
1625 arg = *(e + 1) - '0';
1626 assert(arg >= 0 && arg <= 9);
1627 if (args[arg])
1628 {
1629 strins(s, args[arg], strlen(args[arg]));
1630 s += strlen(args[arg]);
1631 } /* if */
1632 e++; /* skip %, digit is skipped later */
1633 }
1634 else
1635 {
1636 strins(s, e, 1);
1637 s++;
1638 } /* if */
1639 } /* for */
1640 } /* if */
1641 } /* if */
1642
1643 for (arg = 0; arg < 10; arg++)
1644 if (args[arg])
1645 free(args[arg]);
1646
1647 return match;
1648}
1649
1650static void
1651substallpatterns(char *line, int buffersize)
1652{
1653 char *start, *end;
1654 int prefixlen;
1655 stringpair *subst;
1656
1657 start = line;
1658 while (*start != '\0')
1659 {
1660 /* find the start of a prefix (skip all non-alphabetic characters),
1661 * also skip strings
1662 */
1663 while (!isalpha(*start) && *start != '_' && *start != '\0')
1664 {
1665 /* skip strings */
1666 if (is_startstring(start))
1667 {
1668 start = skipstring(start);
1669 if (*start == '\0')
1670 break; /* abort loop on error */
1671 } /* if */
1672 start++; /* skip non-alphapetic character (or closing quote of a string) */
1673 } /* while */
1674 if (*start == '\0')
1675 break; /* abort loop on error */
1676 /* get the prefix (length), look for a matching definition */
1677 prefixlen = 0;
1678 end = start;
1679 while (isalpha(*end) || isdigit(*end) || *end == '_')
1680 {
1681 prefixlen++;
1682 end++;
1683 } /* while */
1684 assert(prefixlen > 0);
1685 subst = find_subst(start, prefixlen);
1686 if (subst)
1687 {
1688 /* properly match the pattern and substitute */
1689 if (!substpattern
1690 (start, buffersize - (start - line), subst->first,
1691 subst->second))
1692 start = end; /* match failed, skip this prefix */
1693 /* match succeeded: do not update "start", because the substitution text
1694 * may be matched by other macros
1695 */
1696 }
1697 else
1698 {
1699 start = end; /* no macro with this prefix, skip this prefix */
1700 } /* if */
1701 } /* while */
1702}
1703#endif
1704
1705/* preprocess
1706 *
1707 * Reads a line by readline() into "pline" and performs basic preprocessing:
1708 * deleting comments, skipping lines with false "#if.." code and recognizing
1709 * other compiler directives. There is an indirect recursion: lex() calls
1710 * preprocess() if a new line must be read, preprocess() calls command(),
1711 * which at his turn calls lex() to identify the token.
1712 *
1713 * Global references: lptr (altered)
1714 * pline (altered)
1715 * freading (referred to only)
1716 */
1717void
1718preprocess(void)
1719{
1720 int iscommand;
1721
1722 if (!freading)
1723 return;
1724 do
1725 {
1726 readline(pline);
1727 stripcom(pline); /* ??? no need for this when reading back from list file (in the second pass) */
1728 lptr = pline; /* set "line pointer" to start of the parsing buffer */
1729 iscommand = command();
1730 if (iscommand != CMD_NONE)
1731 errorset(sRESET); /* reset error flag ("panic mode") on empty line or directive */
1732#if !defined NO_DEFINE
1733 if (iscommand == CMD_NONE)
1734 {
1735 assert(lptr != term_expr);
1736 substallpatterns(pline, sLINEMAX);
1737 lptr = pline; /* reset "line pointer" to start of the parsing buffer */
1738 } /* if */
1739#endif
1740 }
1741 while (iscommand != CMD_NONE && iscommand != CMD_TERM && freading); /* enddo */
1742}
1743
1744static char *
1745unpackedstring(char *lptr, int rawstring)
1746{
1747 while (*lptr != '\0')
1748 {
1749 /* check for doublequotes indicating the end of the string */
1750 if (*lptr == '\"')
1751 {
1752 /* check whether there's another pair of quotes following.
1753 * If so, paste the two strings together, thus
1754 * "pants""off" becomes "pantsoff"
1755 */
1756 if (*(lptr + 1) == '\"')
1757 lptr += 2;
1758 else
1759 break;
1760 }
1761
1762 if (*lptr == '\a')
1763 { /* ignore '\a' (which was inserted at a line concatenation) */
1764 lptr++;
1765 continue;
1766 } /* if */
1767 stowlit(litchar(&lptr, rawstring)); /* litchar() alters "lptr" */
1768 } /* while */
1769 stowlit(0); /* terminate string */
1770 return lptr;
1771}
1772
1773static char *
1774packedstring(char *lptr, int rawstring)
1775{
1776 int i;
1777 ucell val, c;
1778
1779 i = sizeof(ucell) - (charbits / 8); /* start at most significant byte */
1780 val = 0;
1781 while (*lptr != '\0')
1782 {
1783 /* check for doublequotes indicating the end of the string */
1784 if (*lptr == '\"')
1785 {
1786 /* check whether there's another pair of quotes following.
1787 * If so, paste the two strings together, thus
1788 * "pants""off" becomes "pantsoff"
1789 */
1790 if (*(lptr + 1) == '\"')
1791 lptr += 2;
1792 else
1793 break;
1794 }
1795
1796 if (*lptr == '\a')
1797 { /* ignore '\a' (which was inserted at a line concatenation) */
1798 lptr++;
1799 continue;
1800 } /* if */
1801 c = litchar(&lptr, rawstring); /* litchar() alters "lptr" */
1802 if (c >= (ucell) (1 << charbits))
1803 error(43); /* character constant exceeds range */
1804 val |= (c << 8 * i);
1805 if (i == 0)
1806 {
1807 stowlit(val);
1808 val = 0;
1809 } /* if */
1810 i = (i + sizeof(ucell) - (charbits / 8)) % sizeof(ucell);
1811 } /* if */
1812 /* save last code; make sure there is at least one terminating zero character */
1813 if (i != (int)(sizeof(ucell) - (charbits / 8)))
1814 stowlit(val); /* at least one zero character in "val" */
1815 else
1816 stowlit(0); /* add full cell of zeros */
1817 return lptr;
1818}
1819
1820/* lex(lexvalue,lexsym) Lexical Analysis
1821 *
1822 * lex() first deletes leading white space, then checks for multi-character
1823 * operators, keywords (including most compiler directives), numbers,
1824 * labels, symbols and literals (literal characters are converted to a number
1825 * and are returned as such). If every check fails, the line must contain
1826 * a single-character operator. So, lex() returns this character. In the other
1827 * case (something did match), lex() returns the number of the token. All
1828 * these tokens have been assigned numbers above 255.
1829 *
1830 * Some tokens have "attributes":
1831 * tNUMBER the value of the number is return in "lexvalue".
1832 * tRATIONAL the value is in IEEE 754 encoding or in fixed point
1833 * encoding in "lexvalue".
1834 * tSYMBOL the first sNAMEMAX characters of the symbol are
1835 * stored in a buffer, a pointer to this buffer is
1836 * returned in "lexsym".
1837 * tLABEL the first sNAMEMAX characters of the label are
1838 * stored in a buffer, a pointer to this buffer is
1839 * returned in "lexsym".
1840 * tSTRING the string is stored in the literal pool, the index
1841 * in the literal pool to this string is stored in
1842 * "lexvalue".
1843 *
1844 * lex() stores all information (the token found and possibly its attribute)
1845 * in global variables. This allows a token to be examined twice. If "_pushed"
1846 * is true, this information is returned.
1847 *
1848 * Global references: lptr (altered)
1849 * fline (referred to only)
1850 * litidx (referred to only)
1851 * _lextok, _lexval, _lexstr
1852 * _pushed
1853 */
1854
1855static int _pushed;
1856static int _lextok;
1857static cell _lexval;
1858static char _lexstr[sLINEMAX + 1];
1859static int _lexnewline;
1860
1861void
1862lexinit(void)
1863{
1864 stkidx = 0; /* index for pushstk() and popstk() */
1865 iflevel = 0; /* preprocessor: nesting of "#if" */
1866 skiplevel = 0; /* preprocessor: skipping lines or compiling lines */
1867 icomment = FALSE; /* currently not in a multiline comment */
1868 _pushed = FALSE; /* no token pushed back into lex */
1869 _lexnewline = FALSE;
1870}
1871
1872char *sc_tokens[] = {
1873 "*=", "/=", "%=", "+=", "-=", "<<=", ">>>=", ">>=", "&=", "^=", "|=",
1874 "||", "&&", "==", "!=", "<=", ">=", "<<", ">>>", ">>", "++", "--",
1875 "...", "..",
1876 "assert", "break", "case", "char", "const", "continue", "default",
1877 "defined", "do", "else", "enum", "exit", "for", "forward", "goto",
1878 "if", "native", "new", "operator", "public", "return", "sizeof",
1879 "sleep", "static", "stock", "switch", "tagof", "while",
1880 "#assert", "#define", "#else", "#emit", "#endif", "#endinput",
1881 "#endscript", "#file", "#if", "#include", "#line", "#pragma", "#undef",
1882 ";", ";", "-integer value-", "-rational value-", "-identifier-",
1883 "-label-", "-string-"
1884};
1885
1886int
1887lex(cell * lexvalue, char **lexsym)
1888{
1889 int i, toolong, newline, rawstring;
1890 char **tokptr;
1891
1892 if (_pushed)
1893 {
1894 _pushed = FALSE; /* reset "_pushed" flag */
1895 *lexvalue = _lexval;
1896 *lexsym = _lexstr;
1897 return _lextok;
1898 } /* if */
1899
1900 _lextok = 0; /* preset all values */
1901 _lexval = 0;
1902 _lexstr[0] = '\0';
1903 *lexvalue = _lexval;
1904 *lexsym = _lexstr;
1905 _lexnewline = FALSE;
1906 if (!freading)
1907 return 0;
1908
1909 newline = (lptr == pline); /* does lptr point to start of line buffer */
1910 while (*lptr <= ' ')
1911 { /* delete leading white space */
1912 if (*lptr == '\0')
1913 {
1914 preprocess(); /* preprocess resets "lptr" */
1915 if (!freading)
1916 return 0;
1917 if (lptr == term_expr) /* special sequence to terminate a pending expression */
1918 return (_lextok = tENDEXPR);
1919 _lexnewline = TRUE; /* set this after preprocess(), because
1920 * preprocess() calls lex() recursively */
1921 newline = TRUE;
1922 }
1923 else
1924 {
1925 lptr += 1;
1926 } /* if */
1927 } /* while */
1928 if (newline)
1929 {
1930 stmtindent = 0;
1931 for (i = 0; i < (int)(lptr - pline); i++)
1932 if (pline[i] == '\t' && sc_tabsize > 0)
1933 stmtindent +=
1934 (int)(sc_tabsize - (stmtindent + sc_tabsize) % sc_tabsize);
1935 else
1936 stmtindent++;
1937 } /* if */
1938
1939 i = tFIRST;
1940 tokptr = sc_tokens;
1941 while (i <= tMIDDLE)
1942 { /* match multi-character operators */
1943 if (match(*tokptr, FALSE))
1944 {
1945 _lextok = i;
1946 return _lextok;
1947 } /* if */
1948 i += 1;
1949 tokptr += 1;
1950 } /* while */
1951 while (i <= tLAST)
1952 { /* match reserved words and compiler directives */
1953 if (match(*tokptr, TRUE))
1954 {
1955 _lextok = i;
1956 errorset(sRESET); /* reset error flag (clear the "panic mode") */
1957 return _lextok;
1958 } /* if */
1959 i += 1;
1960 tokptr += 1;
1961 } /* while */
1962
1963 if ((i = number(&_lexval, lptr)) != 0)
1964 { /* number */
1965 _lextok = tNUMBER;
1966 *lexvalue = _lexval;
1967 lptr += i;
1968 }
1969 else if ((i = ftoi(&_lexval, lptr)) != 0)
1970 {
1971 _lextok = tRATIONAL;
1972 *lexvalue = _lexval;
1973 lptr += i;
1974 }
1975 else if (alpha(*lptr))
1976 { /* symbol or label */
1977 /* Note: only sNAMEMAX characters are significant. The compiler
1978 * generates a warning if a symbol exceeds this length.
1979 */
1980 _lextok = tSYMBOL;
1981 i = 0;
1982 toolong = 0;
1983 while (alphanum(*lptr))
1984 {
1985 _lexstr[i] = *lptr;
1986 lptr += 1;
1987 if (i < sNAMEMAX)
1988 i += 1;
1989 else
1990 toolong = 1;
1991 } /* while */
1992 _lexstr[i] = '\0';
1993 if (toolong)
1994 error(200, _lexstr, sNAMEMAX); /* symbol too long, truncated to sNAMEMAX chars */
1995 if (_lexstr[0] == PUBLIC_CHAR && _lexstr[1] == '\0')
1996 {
1997 _lextok = PUBLIC_CHAR; /* '@' all alone is not a symbol, it is an operator */
1998 }
1999 else if (_lexstr[0] == '_' && _lexstr[1] == '\0')
2000 {
2001 _lextok = '_'; /* '_' by itself is not a symbol, it is a placeholder */
2002 } /* if */
2003 if (*lptr == ':' && sc_allowtags && _lextok != PUBLIC_CHAR)
2004 {
2005 _lextok = tLABEL; /* it wasn't a normal symbol, it was a label/tagname */
2006 lptr += 1; /* skip colon */
2007 } /* if */
2008 }
2009 else if (*lptr == '\"' || (*lptr == sc_ctrlchar && *(lptr + 1) == '\"'))
2010 { /* unpacked string literal */
2011 _lextok = tSTRING;
2012 rawstring = (*lptr == sc_ctrlchar);
2013 *lexvalue = _lexval = litidx;
2014 lptr += 1; /* skip double quote */
2015 if (rawstring)
2016 lptr += 1; /* skip "escape" character too */
2017 lptr =
2018 sc_packstr ? packedstring(lptr, rawstring) : unpackedstring(lptr,
2019 rawstring);
2020 if (*lptr == '\"')
2021 lptr += 1; /* skip final quote */
2022 else
2023 error(37); /* invalid (non-terminated) string */
2024 }
2025 else if ((*lptr == '!' && *(lptr + 1) == '\"')
2026 || (*lptr == '!' && *(lptr + 1) == sc_ctrlchar && *(lptr + 2) == '\"')
2027 || (*lptr == sc_ctrlchar && *(lptr + 1) == '!'
2028 && *(lptr + 2) == '\"'))
2029 { /* packed string literal */
2030 _lextok = tSTRING;
2031 rawstring = (*lptr == sc_ctrlchar || *(lptr + 1) == sc_ctrlchar);
2032 *lexvalue = _lexval = litidx;
2033 lptr += 2; /* skip exclamation point and double quote */
2034 if (rawstring)
2035 lptr += 1; /* skip "escape" character too */
2036 lptr =
2037 sc_packstr ? unpackedstring(lptr, rawstring) : packedstring(lptr,
2038 rawstring);
2039 if (*lptr == '\"')
2040 lptr += 1; /* skip final quote */
2041 else
2042 error(37); /* invalid (non-terminated) string */
2043 }
2044 else if (*lptr == '\'')
2045 { /* character literal */
2046 lptr += 1; /* skip quote */
2047 _lextok = tNUMBER;
2048 *lexvalue = _lexval = litchar(&lptr, FALSE);
2049 if (*lptr == '\'')
2050 lptr += 1; /* skip final quote */
2051 else
2052 error(27); /* invalid character constant (must be one character) */
2053 }
2054 else if (*lptr == ';')
2055 { /* semicolumn resets "error" flag */
2056 _lextok = ';';
2057 lptr += 1;
2058 errorset(sRESET); /* reset error flag (clear the "panic mode") */
2059 }
2060 else
2061 {
2062 _lextok = *lptr; /* if every match fails, return the character */
2063 lptr += 1; /* increase the "lptr" pointer */
2064 } /* if */
2065 return _lextok;
2066}
2067
2068/* lexpush
2069 *
2070 * Pushes a token back, so the next call to lex() will return the token
2071 * last examined, instead of a new token.
2072 *
2073 * Only one token can be pushed back.
2074 *
2075 * In fact, lex() already stores the information it finds into global
2076 * variables, so all that is to be done is set a flag that informs lex()
2077 * to read and return the information from these variables, rather than
2078 * to read in a new token from the input file.
2079 */
2080void
2081lexpush(void)
2082{
2083 assert(_pushed == FALSE);
2084 _pushed = TRUE;
2085}
2086
2087/* lexclr
2088 *
2089 * Sets the variable "_pushed" to 0 to make sure lex() will read in a new
2090 * symbol (a not continue with some old one). This is required upon return
2091 * from Assembler mode.
2092 */
2093void
2094lexclr(int clreol)
2095{
2096 _pushed = FALSE;
2097 if (clreol)
2098 {
2099 lptr = strchr(pline, '\0');
2100 assert(lptr != NULL);
2101 } /* if */
2102}
2103
2104/* matchtoken
2105 *
2106 * This routine is useful if only a simple check is needed. If the token
2107 * differs from the one expected, it is pushed back.
2108 */
2109int
2110matchtoken(int token)
2111{
2112 cell val;
2113 char *str;
2114 int tok;
2115
2116 tok = lex(&val, &str);
2117 if (tok == token || (token == tTERM && (tok == ';' || tok == tENDEXPR)))
2118 {
2119 return 1;
2120 }
2121 else if (!sc_needsemicolon && token == tTERM && (_lexnewline || !freading))
2122 {
2123 lexpush(); /* push "tok" back, we use the "hidden" newline token */
2124 return 1;
2125 }
2126 else
2127 {
2128 lexpush();
2129 return 0;
2130 } /* if */
2131}
2132
2133/* tokeninfo
2134 *
2135 * Returns additional information of a token after using "matchtoken()"
2136 * or needtoken(). It does no harm using this routine after a call to
2137 * "lex()", but lex() already returns the same information.
2138 *
2139 * The token itself is the return value. Normally, this one is already known.
2140 */
2141int
2142tokeninfo(cell * val, char **str)
2143{
2144 /* if the token was pushed back, tokeninfo() returns the token and
2145 * parameters of the *next* token, not of the *current* token.
2146 */
2147 assert(!_pushed);
2148 *val = _lexval;
2149 *str = _lexstr;
2150 return _lextok;
2151}
2152
2153/* needtoken
2154 *
2155 * This routine checks for a required token and gives an error message if
2156 * it isn't there (and returns FALSE in that case).
2157 *
2158 * Global references: _lextok;
2159 */
2160int
2161needtoken(int token)
2162{
2163 char s1[20], s2[20];
2164
2165 if (matchtoken(token))
2166 {
2167 return TRUE;
2168 }
2169 else
2170 {
2171 /* token already pushed back */
2172 assert(_pushed);
2173 if (token < 256)
2174 sprintf(s1, "%c", (char)token); /* single character token */
2175 else
2176 strcpy(s1, sc_tokens[token - tFIRST]); /* multi-character symbol */
2177 if (!freading)
2178 strcpy(s2, "-end of file-");
2179 else if (_lextok < 256)
2180 sprintf(s2, "%c", (char)_lextok);
2181 else
2182 strcpy(s2, sc_tokens[_lextok - tFIRST]);
2183 error(1, s1, s2); /* expected ..., but found ... */
2184 return FALSE;
2185 } /* if */
2186}
2187
2188/* match
2189 *
2190 * Compares a series of characters from the input file with the characters
2191 * in "st" (that contains a token). If the token on the input file matches
2192 * "st", the input file pointer "lptr" is adjusted to point to the next
2193 * token, otherwise "lptr" remains unaltered.
2194 *
2195 * If the parameter "end: is true, match() requires that the first character
2196 * behind the recognized token is non-alphanumeric.
2197 *
2198 * Global references: lptr (altered)
2199 */
2200static int
2201match(char *st, int end)
2202{
2203 int k;
2204 char *ptr;
2205
2206 k = 0;
2207 ptr = lptr;
2208 while (st[k])
2209 {
2210 if (st[k] != *ptr)
2211 return 0;
2212 k += 1;
2213 ptr += 1;
2214 } /* while */
2215 if (end)
2216 { /* symbol must terminate with non-alphanumeric char */
2217 if (alphanum(*ptr))
2218 return 0;
2219 } /* if */
2220 lptr = ptr; /* match found, skip symbol */
2221 return 1;
2222}
2223
2224/* stowlit
2225 *
2226 * Stores a value into the literal queue. The literal queue is used for
2227 * literal strings used in functions and for initializing array variables.
2228 *
2229 * Global references: litidx (altered)
2230 * litq (altered)
2231 */
2232void
2233stowlit(cell value)
2234{
2235 if (litidx >= litmax)
2236 {
2237 cell *p;
2238
2239 litmax += sDEF_LITMAX;
2240 p = (cell *) realloc(litq, litmax * sizeof(cell));
2241 if (!p)
2242 error(102, "literal table"); /* literal table overflow (fatal error) */
2243 litq = p;
2244 } /* if */
2245 assert(litidx < litmax);
2246 litq[litidx++] = value;
2247}
2248
2249/* litchar
2250 *
2251 * Return current literal character and increase the pointer to point
2252 * just behind this literal character.
2253 *
2254 * Note: standard "escape sequences" are suported, but the backslash may be
2255 * replaced by another character; the syntax '\ddd' is supported,
2256 * but ddd must be decimal!
2257 */
2258static cell
2259litchar(char **lptr, int rawmode)
2260{
2261 cell c = 0;
2262 unsigned char *cptr;
2263
2264 cptr = (unsigned char *)*lptr;
2265 if (rawmode || *cptr != sc_ctrlchar)
2266 { /* no escape character */
2267 c = *cptr;
2268 cptr += 1;
2269 }
2270 else
2271 {
2272 cptr += 1;
2273 if (*cptr == sc_ctrlchar)
2274 {
2275 c = *cptr; /* \\ == \ (the escape character itself) */
2276 cptr += 1;
2277 }
2278 else
2279 {
2280 switch (*cptr)
2281 {
2282 case 'a': /* \a == audible alarm */
2283 c = 7;
2284 cptr += 1;
2285 break;
2286 case 'b': /* \b == backspace */
2287 c = 8;
2288 cptr += 1;
2289 break;
2290 case 'e': /* \e == escape */
2291 c = 27;
2292 cptr += 1;
2293 break;
2294 case 'f': /* \f == form feed */
2295 c = 12;
2296 cptr += 1;
2297 break;
2298 case 'n': /* \n == NewLine character */
2299 c = 10;
2300 cptr += 1;
2301 break;
2302 case 'r': /* \r == carriage return */
2303 c = 13;
2304 cptr += 1;
2305 break;
2306 case 't': /* \t == horizontal TAB */
2307 c = 9;
2308 cptr += 1;
2309 break;
2310 case 'v': /* \v == vertical TAB */
2311 c = 11;
2312 cptr += 1;
2313 break;
2314 case '\'': /* \' == ' (single quote) */
2315 case '"': /* \" == " (single quote) */
2316 case '%': /* \% == % (percent) */
2317 c = *cptr;
2318 cptr += 1;
2319 break;
2320 default:
2321 if (isdigit(*cptr))
2322 { /* \ddd */
2323 c = 0;
2324 while (*cptr >= '0' && *cptr <= '9') /* decimal! */
2325 c = c * 10 + *cptr++ - '0';
2326 if (*cptr == ';')
2327 cptr++; /* swallow a trailing ';' */
2328 }
2329 else
2330 {
2331 error(27); /* invalid character constant */
2332 } /* if */
2333 } /* switch */
2334 } /* if */
2335 } /* if */
2336 *lptr = (char *)cptr;
2337 assert(c >= 0 && c < 256);
2338 return c;
2339}
2340
2341/* alpha
2342 *
2343 * Test if character "c" is alphabetic ("a".."z"), an underscore ("_")
2344 * or an "at" sign ("@"). The "@" is an extension to standard C.
2345 */
2346static int
2347alpha(char c)
2348{
2349 return (isalpha(c) || c == '_' || c == PUBLIC_CHAR);
2350}
2351
2352/* alphanum
2353 *
2354 * Test if character "c" is alphanumeric ("a".."z", "0".."9", "_" or "@")
2355 */
2356int
2357alphanum(char c)
2358{
2359 return (alpha(c) || isdigit(c));
2360}
2361
2362/* The local variable table must be searched backwards, so that the deepest
2363 * nesting of local variables is searched first. The simplest way to do
2364 * this is to insert all new items at the head of the list.
2365 * In the global list, the symbols are kept in sorted order, so that the
2366 * public functions are written in sorted order.
2367 */
2368static symbol *
2369add_symbol(symbol * root, symbol * entry, int sort)
2370{
2371 symbol *newsym;
2372
2373 if (sort)
2374 while (root->next && strcmp(entry->name, root->next->name) > 0)
2375 root = root->next;
2376
2377 if (!(newsym = (symbol *)malloc(sizeof(symbol))))
2378 {
2379 error(103);
2380 return NULL;
2381 } /* if */
2382 memcpy(newsym, entry, sizeof(symbol));
2383 newsym->next = root->next;
2384 root->next = newsym;
2385 return newsym;
2386}
2387
2388static void
2389free_symbol(symbol * sym)
2390{
2391 arginfo *arg;
2392
2393 /* free all sub-symbol allocated memory blocks, depending on the
2394 * kind of the symbol
2395 */
2396 assert(sym != NULL);
2397 if (sym->ident == iFUNCTN)
2398 {
2399 /* run through the argument list; "default array" arguments
2400 * must be freed explicitly; the tag list must also be freed */
2401 assert(sym->dim.arglist != NULL);
2402 for (arg = sym->dim.arglist; arg->ident != 0; arg++)
2403 {
2404 if (arg->ident == iREFARRAY && arg->hasdefault)
2405 free(arg->defvalue.array.data);
2406 else if (arg->ident == iVARIABLE
2407 && ((arg->hasdefault & uSIZEOF) != 0
2408 || (arg->hasdefault & uTAGOF) != 0))
2409 free(arg->defvalue.size.symname);
2410 assert(arg->tags != NULL);
2411 free(arg->tags);
2412 } /* for */
2413 free(sym->dim.arglist);
2414 } /* if */
2415 assert(sym->refer != NULL);
2416 free(sym->refer);
2417 free(sym);
2418}
2419
2420void
2421delete_symbol(symbol * root, symbol * sym)
2422{
2423 /* find the symbol and its predecessor
2424 * (this function assumes that you will never delete a symbol that is not
2425 * in the table pointed at by "root")
2426 */
2427 assert(root != sym);
2428 while (root->next != sym)
2429 {
2430 root = root->next;
2431 assert(root != NULL);
2432 } /* while */
2433
2434 /* unlink it, then free it */
2435 root->next = sym->next;
2436 free_symbol(sym);
2437}
2438
2439void
2440delete_symbols(symbol * root, int level, int delete_labels,
2441 int delete_functions)
2442{
2443 symbol *sym;
2444
2445 /* erase only the symbols with a deeper nesting level than the
2446 * specified nesting level */
2447 while (root->next)
2448 {
2449 sym = root->next;
2450 if (sym->compound < level)
2451 break;
2452 if ((delete_labels || sym->ident != iLABEL)
2453 && (delete_functions || sym->ident != iFUNCTN
2454 || (sym->usage & uNATIVE) != 0) && (delete_functions
2455 || sym->ident != iCONSTEXPR
2456 || (sym->usage & uPREDEF) ==
2457 0) && (delete_functions
2458 || (sym->ident !=
2459 iVARIABLE
2460 && sym->ident !=
2461 iARRAY)))
2462 {
2463 root->next = sym->next;
2464 free_symbol(sym);
2465 }
2466 else
2467 {
2468 /* if the function was prototyped, but not implemented in this source,
2469 * mark it as such, so that its use can be flagged
2470 */
2471 if (sym->ident == iFUNCTN && (sym->usage & uDEFINE) == 0)
2472 sym->usage |= uMISSING;
2473 if (sym->ident == iFUNCTN || sym->ident == iVARIABLE
2474 || sym->ident == iARRAY)
2475 sym->usage &= ~uDEFINE; /* clear "defined" flag */
2476 /* for user defined operators, also remove the "prototyped" flag, as
2477 * user-defined operators *must* be declared before use
2478 */
2479 if (sym->ident == iFUNCTN && !isalpha(*sym->name)
2480 && *sym->name != '_' && *sym->name != PUBLIC_CHAR)
2481 sym->usage &= ~uPROTOTYPED;
2482 root = sym; /* skip the symbol */
2483 } /* if */
2484 } /* if */
2485}
2486
2487/* The purpose of the hash is to reduce the frequency of a "name"
2488 * comparison (which is costly). There is little interest in avoiding
2489 * clusters in similar names, which is why this function is plain simple.
2490 */
2491unsigned int
2492namehash(char *name)
2493{
2494 unsigned char *ptr = (unsigned char *)name;
2495 int len = strlen(name);
2496
2497 if (len == 0)
2498 return 0L;
2499 assert(len < 256);
2500 return (len << 24Lu) + (ptr[0] << 16Lu) + (ptr[len - 1] << 8Lu) +
2501 (ptr[len >> 1Lu]);
2502}
2503
2504static symbol *
2505find_symbol(symbol * root, char *name, int fnumber)
2506{
2507 symbol *ptr = root->next;
2508 unsigned long hash = namehash(name);
2509
2510 while (ptr)
2511 {
2512 if (hash == ptr->hash && strcmp(name, ptr->name) == 0
2513 && !ptr->parent && (ptr->fnumber < 0
2514 || ptr->fnumber == fnumber))
2515 return ptr;
2516 ptr = ptr->next;
2517 } /* while */
2518 return NULL;
2519}
2520
2521static symbol *
2522find_symbol_child(symbol * root, symbol * sym)
2523{
2524 symbol *ptr = root->next;
2525
2526 while (ptr)
2527 {
2528 if (ptr->parent == sym)
2529 return ptr;
2530 ptr = ptr->next;
2531 } /* while */
2532 return NULL;
2533}
2534
2535/* Adds "bywhom" to the list of referrers of "entry". Typically,
2536 * bywhom will be the function that uses a variable or that calls
2537 * the function.
2538 */
2539int
2540refer_symbol(symbol * entry, symbol * bywhom)
2541{
2542 int count;
2543
2544 assert(bywhom != NULL); /* it makes no sense to add a "void" referrer */
2545 assert(entry != NULL);
2546 assert(entry->refer != NULL);
2547
2548 /* see if it is already there */
2549 for (count = 0; count < entry->numrefers && entry->refer[count] != bywhom;
2550 count++)
2551 /* nothing */ ;
2552 if (count < entry->numrefers)
2553 {
2554 assert(entry->refer[count] == bywhom);
2555 return TRUE;
2556 } /* if */
2557
2558 /* see if there is an empty spot in the referrer list */
2559 for (count = 0; count < entry->numrefers && entry->refer[count];
2560 count++)
2561 /* nothing */ ;
2562 assert(count <= entry->numrefers);
2563 if (count == entry->numrefers)
2564 {
2565 symbol **refer;
2566 int newsize = 2 * entry->numrefers;
2567
2568 assert(newsize > 0);
2569 /* grow the referrer list */
2570 refer = (symbol **) realloc(entry->refer, newsize * sizeof(symbol *));
2571 if (!refer)
2572 return FALSE; /* insufficient memory */
2573 /* initialize the new entries */
2574 entry->refer = refer;
2575 for (count = entry->numrefers; count < newsize; count++)
2576 entry->refer[count] = NULL;
2577 count = entry->numrefers; /* first empty spot */
2578 entry->numrefers = newsize;
2579 } /* if */
2580
2581 /* add the referrer */
2582 assert(entry->refer[count] == NULL);
2583 entry->refer[count] = bywhom;
2584 return TRUE;
2585}
2586
2587void
2588markusage(symbol * sym, int usage)
2589{
2590 sym->usage |= (char)usage;
2591 /* check if (global) reference must be added to the symbol */
2592 if ((usage & (uREAD | uWRITTEN)) != 0)
2593 {
2594 /* only do this for global symbols */
2595 if (sym->vclass == sGLOBAL)
2596 {
2597 /* "curfunc" should always be valid, since statements may not occurs
2598 * outside functions; in the case of syntax errors, however, the
2599 * compiler may arrive through this function
2600 */
2601 if (curfunc)
2602 refer_symbol(sym, curfunc);
2603 } /* if */
2604 } /* if */
2605}
2606
2607/* findglb
2608 *
2609 * Returns a pointer to the global symbol (if found) or NULL (if not found)
2610 */
2611symbol *
2612findglb(char *name)
2613{
2614 return find_symbol(&glbtab, name, fcurrent);
2615}
2616
2617/* findloc
2618 *
2619 * Returns a pointer to the local symbol (if found) or NULL (if not found).
2620 * See add_symbol() how the deepest nesting level is searched first.
2621 */
2622symbol *
2623findloc(char *name)
2624{
2625 return find_symbol(&loctab, name, -1);
2626}
2627
2628symbol *
2629findconst(char *name)
2630{
2631 symbol *sym;
2632
2633 sym = find_symbol(&loctab, name, -1); /* try local symbols first */
2634 if (!sym || sym->ident != iCONSTEXPR) /* not found, or not a constant */
2635 sym = find_symbol(&glbtab, name, fcurrent);
2636 if (!sym || sym->ident != iCONSTEXPR)
2637 return NULL;
2638 assert(sym->parent == NULL); /* constants have no hierarchy */
2639 return sym;
2640}
2641
2642symbol *
2643finddepend(symbol * parent)
2644{
2645 symbol *sym;
2646
2647 sym = find_symbol_child(&loctab, parent); /* try local symbols first */
2648 if (!sym) /* not found */
2649 sym = find_symbol_child(&glbtab, parent);
2650 return sym;
2651}
2652
2653/* addsym
2654 *
2655 * Adds a symbol to the symbol table (either global or local variables,
2656 * or global and local constants).
2657 */
2658symbol *
2659addsym(char *name, cell addr, int ident, int vclass, int tag, int usage)
2660{
2661 symbol entry, **refer;
2662
2663 /* global variables/constants/functions may only be defined once */
2664 assert(!(ident == iFUNCTN || ident == iCONSTEXPR) || vclass != sGLOBAL
2665 || findglb(name) == NULL);
2666 /* labels may only be defined once */
2667 assert(ident != iLABEL || findloc(name) == NULL);
2668
2669 /* create an empty referrer list */
2670 if (!(refer = (symbol **)malloc(sizeof(symbol *))))
2671 {
2672 error(103); /* insufficient memory */
2673 return NULL;
2674 } /* if */
2675 *refer = NULL;
2676
2677 /* first fill in the entry */
2678 strcpy(entry.name, name);
2679 entry.hash = namehash(name);
2680 entry.addr = addr;
2681 entry.vclass = (char)vclass;
2682 entry.ident = (char)ident;
2683 entry.tag = tag;
2684 entry.usage = (char)usage;
2685 entry.compound = 0; /* may be overridden later */
2686 entry.fnumber = -1; /* assume global visibility (ignored for local symbols) */
2687 entry.numrefers = 1;
2688 entry.refer = refer;
2689 entry.parent = NULL;
2690
2691 /* then insert it in the list */
2692 if (vclass == sGLOBAL)
2693 return add_symbol(&glbtab, &entry, TRUE);
2694 else
2695 return add_symbol(&loctab, &entry, FALSE);
2696}
2697
2698symbol *
2699addvariable(char *name, cell addr, int ident, int vclass, int tag,
2700 int dim[], int numdim, int idxtag[])
2701{
2702 symbol *sym, *parent, *top;
2703 int level;
2704
2705 /* global variables may only be defined once */
2706 assert(vclass != sGLOBAL || (sym = findglb(name)) == NULL
2707 || (sym->usage & uDEFINE) == 0);
2708
2709 if (ident == iARRAY || ident == iREFARRAY)
2710 {
2711 parent = NULL;
2712 sym = NULL; /* to avoid a compiler warning */
2713 for (level = 0; level < numdim; level++)
2714 {
2715 top = addsym(name, addr, ident, vclass, tag, uDEFINE);
2716 top->dim.array.length = dim[level];
2717 top->dim.array.level = (short)(numdim - level - 1);
2718 top->x.idxtag = idxtag[level];
2719 top->parent = parent;
2720 parent = top;
2721 if (level == 0)
2722 sym = top;
2723 } /* for */
2724 }
2725 else
2726 {
2727 sym = addsym(name, addr, ident, vclass, tag, uDEFINE);
2728 } /* if */
2729 return sym;
2730}
2731
2732/* getlabel
2733 *
2734 * Return next available internal label number.
2735 */
2736int
2737getlabel(void)
2738{
2739 return labnum++;
2740}
2741
2742/* itoh
2743 *
2744 * Converts a number to a hexadecimal string and returns a pointer to that
2745 * string.
2746 */
2747char *
2748itoh(ucell val)
2749{
2750 static char itohstr[15]; /* hex number is 10 characters long at most */
2751 char *ptr;
2752 int i, nibble[8]; /* a 32-bit hexadecimal cell has 8 nibbles */
2753 int max;
2754
2755#if defined(BIT16)
2756 max = 4;
2757#else
2758 max = 8;
2759#endif
2760 ptr = itohstr;
2761 for (i = 0; i < max; i += 1)
2762 {
2763 nibble[i] = (int)(val & 0x0f); /* nibble 0 is lowest nibble */
2764 val >>= 4;
2765 } /* endfor */
2766 i = max - 1;
2767 while (nibble[i] == 0 && i > 0) /* search for highest non-zero nibble */
2768 i -= 1;
2769 while (i >= 0)
2770 {
2771 if (nibble[i] >= 10)
2772 *ptr++ = (char)('a' + (nibble[i] - 10));
2773 else
2774 *ptr++ = (char)('0' + nibble[i]);
2775 i -= 1;
2776 } /* while */
2777 *ptr = '\0'; /* and a zero-terminator */
2778 return itohstr;
2779}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc3.c b/libraries/embryo/src/bin/embryo_cc_sc3.c
new file mode 100644
index 0000000..99b24ed
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc3.c
@@ -0,0 +1,2438 @@
1/* Small compiler - Recursive descend expresion parser
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_sc3.c 52451 2010-09-19 03:00:12Z raster $
22 */
23
24
25#ifdef HAVE_CONFIG_H
26# include <config.h>
27#endif
28
29#include <assert.h>
30#include <stdio.h>
31#include <limits.h> /* for PATH_MAX */
32#include <string.h>
33
34#include "embryo_cc_sc.h"
35
36static int skim(int *opstr, void (*testfunc) (int), int dropval,
37 int endval, int (*hier) (value *), value * lval);
38static void dropout(int lvalue, void (*testfunc) (int val), int exit1,
39 value * lval);
40static int plnge(int *opstr, int opoff, int (*hier) (value * lval),
41 value * lval, char *forcetag, int chkbitwise);
42static int plnge1(int (*hier) (value * lval), value * lval);
43static void plnge2(void (*oper) (void),
44 int (*hier) (value * lval),
45 value * lval1, value * lval2);
46static cell calc(cell left, void (*oper) (), cell right,
47 char *boolresult);
48static int hier13(value * lval);
49static int hier12(value * lval);
50static int hier11(value * lval);
51static int hier10(value * lval);
52static int hier9(value * lval);
53static int hier8(value * lval);
54static int hier7(value * lval);
55static int hier6(value * lval);
56static int hier5(value * lval);
57static int hier4(value * lval);
58static int hier3(value * lval);
59static int hier2(value * lval);
60static int hier1(value * lval1);
61static int primary(value * lval);
62static void clear_value(value * lval);
63static void callfunction(symbol * sym);
64static int dbltest(void (*oper) (), value * lval1, value * lval2);
65static int commutative(void (*oper) ());
66static int constant(value * lval);
67
68static char lastsymbol[sNAMEMAX + 1]; /* name of last function/variable */
69static int bitwise_opercount; /* count of bitwise operators in an expression */
70
71/* Function addresses of binary operators for signed operations */
72static void (*op1[17]) (void) =
73{
74 os_mult, os_div, os_mod, /* hier3, index 0 */
75 ob_add, ob_sub, /* hier4, index 3 */
76 ob_sal, os_sar, ou_sar, /* hier5, index 5 */
77 ob_and, /* hier6, index 8 */
78 ob_xor, /* hier7, index 9 */
79 ob_or, /* hier8, index 10 */
80 os_le, os_ge, os_lt, os_gt, /* hier9, index 11 */
81 ob_eq, ob_ne, /* hier10, index 15 */
82};
83/* These two functions are defined because the functions inc() and dec() in
84 * SC4.C have a different prototype than the other code generation functions.
85 * The arrays for user-defined functions use the function pointers for
86 * identifying what kind of operation is requested; these functions must all
87 * have the same prototype. As inc() and dec() are special cases already, it
88 * is simplest to add two "do-nothing" functions.
89 */
90static void
91user_inc(void)
92{
93}
94static void
95user_dec(void)
96{
97}
98
99/*
100 * Searches for a binary operator a list of operators. The list is stored in
101 * the array "list". The last entry in the list should be set to 0.
102 *
103 * The index of an operator in "list" (if found) is returned in "opidx". If
104 * no operator is found, nextop() returns 0.
105 */
106static int
107nextop(int *opidx, int *list)
108{
109 *opidx = 0;
110 while (*list)
111 {
112 if (matchtoken(*list))
113 {
114 return TRUE; /* found! */
115 }
116 else
117 {
118 list += 1;
119 *opidx += 1;
120 } /* if */
121 } /* while */
122 return FALSE; /* entire list scanned, nothing found */
123}
124
125int
126check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
127 value * lval, int *resulttag)
128{
129 static char *binoperstr[] = { "*", "/", "%", "+", "-", "", "", "",
130 "", "", "", "<=", ">=", "<", ">", "==", "!="
131 };
132 static int binoper_savepri[] =
133 { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
134 FALSE, FALSE, FALSE, FALSE, FALSE,
135 TRUE, TRUE, TRUE, TRUE, FALSE, FALSE
136 };
137 static char *unoperstr[] = { "!", "-", "++", "--" };
138 static void (*unopers[]) (void) =
139 {
140 lneg, neg, user_inc, user_dec};
141 char opername[4] = "", symbolname[sNAMEMAX + 1];
142 int i, swapparams, savepri, savealt;
143 int paramspassed;
144 symbol *sym;
145
146 /* since user-defined operators on untagged operands are forbidden, we have
147 * a quick exit.
148 */
149 assert(numparam == 1 || numparam == 2);
150 if (tag1 == 0 && (numparam == 1 || tag2 == 0))
151 return FALSE;
152
153 savepri = savealt = FALSE;
154 /* find the name with the operator */
155 if (numparam == 2)
156 {
157 if (!oper)
158 {
159 /* assignment operator: a special case */
160 strcpy(opername, "=");
161 if (lval
162 && (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR))
163 savealt = TRUE;
164 }
165 else
166 {
167 assert((sizeof binoperstr / sizeof binoperstr[0]) ==
168 (sizeof op1 / sizeof op1[0]));
169 for (i = 0; i < (int)(sizeof op1 / sizeof op1[0]); i++)
170 {
171 if (oper == op1[i])
172 {
173 strcpy(opername, binoperstr[i]);
174 savepri = binoper_savepri[i];
175 break;
176 } /* if */
177 } /* for */
178 } /* if */
179 }
180 else
181 {
182 assert(oper != NULL);
183 assert(numparam == 1);
184 /* try a select group of unary operators */
185 assert((sizeof unoperstr / sizeof unoperstr[0]) ==
186 (sizeof unopers / sizeof unopers[0]));
187 if (opername[0] == '\0')
188 {
189 for (i = 0; i < (int)(sizeof unopers / sizeof unopers[0]); i++)
190 {
191 if (oper == unopers[i])
192 {
193 strcpy(opername, unoperstr[i]);
194 break;
195 } /* if */
196 } /* for */
197 } /* if */
198 } /* if */
199 /* if not found, quit */
200 if (opername[0] == '\0')
201 return FALSE;
202
203 /* create a symbol name from the tags and the operator name */
204 assert(numparam == 1 || numparam == 2);
205 operator_symname(symbolname, opername, tag1, tag2, numparam, tag2);
206 swapparams = FALSE;
207 sym = findglb(symbolname);
208 if (!sym /*|| (sym->usage & uDEFINE)==0 */ )
209 { /* ??? should not check uDEFINE; first pass clears these bits */
210 /* check for commutative operators */
211 if (tag1 == tag2 || !oper || !commutative(oper))
212 return FALSE; /* not commutative, cannot swap operands */
213 /* if arrived here, the operator is commutative and the tags are different,
214 * swap tags and try again
215 */
216 assert(numparam == 2); /* commutative operator must be a binary operator */
217 operator_symname(symbolname, opername, tag2, tag1, numparam, tag1);
218 swapparams = TRUE;
219 sym = findglb(symbolname);
220 if (!sym /*|| (sym->usage & uDEFINE)==0 */ )
221 return FALSE;
222 } /* if */
223
224 /* check existence and the proper declaration of this function */
225 if ((sym->usage & uMISSING) != 0 || (sym->usage & uPROTOTYPED) == 0)
226 {
227 char symname[2 * sNAMEMAX + 16]; /* allow space for user defined operators */
228
229 funcdisplayname(symname, sym->name);
230 if ((sym->usage & uMISSING) != 0)
231 error(4, symname); /* function not defined */
232 if ((sym->usage & uPROTOTYPED) == 0)
233 error(71, symname); /* operator must be declared before use */
234 } /* if */
235
236 /* we don't want to use the redefined operator in the function that
237 * redefines the operator itself, otherwise the snippet below gives
238 * an unexpected recursion:
239 * fixed:operator+(fixed:a, fixed:b)
240 * return a + b
241 */
242 if (sym == curfunc)
243 return FALSE;
244
245 /* for increment and decrement operators, the symbol must first be loaded
246 * (and stored back afterwards)
247 */
248 if (oper == user_inc || oper == user_dec)
249 {
250 assert(!savepri);
251 assert(lval != NULL);
252 if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR)
253 push1(); /* save current address in PRI */
254 rvalue(lval); /* get the symbol's value in PRI */
255 } /* if */
256
257 assert(!savepri || !savealt); /* either one MAY be set, but not both */
258 if (savepri)
259 {
260 /* the chained comparison operators require that the ALT register is
261 * unmodified, so we save it here; actually, we save PRI because the normal
262 * instruction sequence (without user operator) swaps PRI and ALT
263 */
264 push1(); /* right-hand operand is in PRI */
265 }
266 else if (savealt)
267 {
268 /* for the assignment operator, ALT may contain an address at which the
269 * result must be stored; this address must be preserved across the
270 * call
271 */
272 assert(lval != NULL); /* this was checked earlier */
273 assert(lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR); /* checked earlier */
274 push2();
275 } /* if */
276
277 /* push parameters, call the function */
278 paramspassed = (!oper) ? 1 : numparam;
279 switch (paramspassed)
280 {
281 case 1:
282 push1();
283 break;
284 case 2:
285 /* note that 1) a function expects that the parameters are pushed
286 * in reversed order, and 2) the left operand is in the secondary register
287 * and the right operand is in the primary register */
288 if (swapparams)
289 {
290 push2();
291 push1();
292 }
293 else
294 {
295 push1();
296 push2();
297 } /* if */
298 break;
299 default:
300 assert(0);
301 } /* switch */
302 endexpr(FALSE); /* mark the end of a sub-expression */
303 pushval((cell) paramspassed * sizeof(cell));
304 assert(sym->ident == iFUNCTN);
305 ffcall(sym, paramspassed);
306 if (sc_status != statSKIP)
307 markusage(sym, uREAD); /* do not mark as "used" when this call itself is skipped */
308 if (sym->x.lib)
309 sym->x.lib->value += 1; /* increment "usage count" of the library */
310 sideeffect = TRUE; /* assume functions carry out a side-effect */
311 assert(resulttag != NULL);
312 *resulttag = sym->tag; /* save tag of the called function */
313
314 if (savepri || savealt)
315 pop2(); /* restore the saved PRI/ALT that into ALT */
316 if (oper == user_inc || oper == user_dec)
317 {
318 assert(lval != NULL);
319 if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR)
320 pop2(); /* restore address (in ALT) */
321 store(lval); /* store PRI in the symbol */
322 moveto1(); /* make sure PRI is restored on exit */
323 } /* if */
324 return TRUE;
325}
326
327int
328matchtag(int formaltag, int actualtag, int allowcoerce)
329{
330 if (formaltag != actualtag)
331 {
332 /* if the formal tag is zero and the actual tag is not "fixed", the actual
333 * tag is "coerced" to zero
334 */
335 if (!allowcoerce || formaltag != 0 || (actualtag & FIXEDTAG) != 0)
336 return FALSE;
337 } /* if */
338 return TRUE;
339}
340
341/*
342 * The AMX pseudo-processor has no direct support for logical (boolean)
343 * operations. These have to be done via comparing and jumping. Since we are
344 * already jumping through the code, we might as well implement an "early
345 * drop-out" evaluation (also called "short-circuit"). This conforms to
346 * standard C:
347 *
348 * expr1 || expr2 expr2 will only be evaluated if expr1 is false.
349 * expr1 && expr2 expr2 will only be evaluated if expr1 is true.
350 *
351 * expr1 || expr2 && expr3 expr2 will only be evaluated if expr1 is false
352 * and expr3 will only be evaluated if expr1 is
353 * false and expr2 is true.
354 *
355 * Code generation for the last example proceeds thus:
356 *
357 * evaluate expr1
358 * operator || found
359 * jump to "l1" if result of expr1 not equal to 0
360 * evaluate expr2
361 * -> operator && found; skip to higher level in hierarchy diagram
362 * jump to "l2" if result of expr2 equal to 0
363 * evaluate expr3
364 * jump to "l2" if result of expr3 equal to 0
365 * set expression result to 1 (true)
366 * jump to "l3"
367 * l2: set expression result to 0 (false)
368 * l3:
369 * <- drop back to previous hierarchy level
370 * jump to "l1" if result of expr2 && expr3 not equal to 0
371 * set expression result to 0 (false)
372 * jump to "l4"
373 * l1: set expression result to 1 (true)
374 * l4:
375 *
376 */
377
378/* Skim over terms adjoining || and && operators
379 * dropval The value of the expression after "dropping out". An "or" drops
380 * out when the left hand is TRUE, so dropval must be 1 on "or"
381 * expressions.
382 * endval The value of the expression when no expression drops out. In an
383 * "or" expression, this happens when both the left hand and the
384 * right hand are FALSE, so endval must be 0 for "or" expressions.
385 */
386static int
387skim(int *opstr, void (*testfunc) (int), int dropval, int endval,
388 int (*hier) (value *), value * lval)
389{
390 int lvalue, hits, droplab, endlab, opidx;
391 int allconst;
392 cell constval;
393 int index;
394 cell cidx;
395
396 stgget(&index, &cidx); /* mark position in code generator */
397 hits = FALSE; /* no logical operators "hit" yet */
398 allconst = TRUE; /* assume all values "const" */
399 constval = 0;
400 droplab = 0; /* to avoid a compiler warning */
401 for (;;)
402 {
403 lvalue = plnge1(hier, lval); /* evaluate left expression */
404
405 allconst = allconst && (lval->ident == iCONSTEXPR);
406 if (allconst)
407 {
408 if (hits)
409 {
410 /* one operator was already found */
411 if (testfunc == jmp_ne0)
412 lval->constval = lval->constval || constval;
413 else
414 lval->constval = lval->constval && constval;
415 } /* if */
416 constval = lval->constval; /* save result accumulated so far */
417 } /* if */
418
419 if (nextop(&opidx, opstr))
420 {
421 if (!hits)
422 {
423 /* this is the first operator in the list */
424 hits = TRUE;
425 droplab = getlabel();
426 } /* if */
427 dropout(lvalue, testfunc, droplab, lval);
428 }
429 else if (hits)
430 { /* no (more) identical operators */
431 dropout(lvalue, testfunc, droplab, lval); /* found at least one operator! */
432 const1(endval);
433 jumplabel(endlab = getlabel());
434 setlabel(droplab);
435 const1(dropval);
436 setlabel(endlab);
437 lval->sym = NULL;
438 lval->tag = 0;
439 if (allconst)
440 {
441 lval->ident = iCONSTEXPR;
442 lval->constval = constval;
443 stgdel(index, cidx); /* scratch generated code and calculate */
444 }
445 else
446 {
447 lval->ident = iEXPRESSION;
448 lval->constval = 0;
449 } /* if */
450 return FALSE;
451 }
452 else
453 {
454 return lvalue; /* none of the operators in "opstr" were found */
455 } /* if */
456
457 } /* while */
458}
459
460/*
461 * Reads into the primary register the variable pointed to by lval if
462 * plunging through the hierarchy levels detected an lvalue. Otherwise
463 * if a constant was detected, it is loaded. If there is no constant and
464 * no lvalue, the primary register must already contain the expression
465 * result.
466 *
467 * After that, the compare routines "jmp_ne0" or "jmp_eq0" are called, which
468 * compare the primary register against 0, and jump to the "early drop-out"
469 * label "exit1" if the condition is true.
470 */
471static void
472dropout(int lvalue, void (*testfunc) (int val), int exit1, value * lval)
473{
474 if (lvalue)
475 rvalue(lval);
476 else if (lval->ident == iCONSTEXPR)
477 const1(lval->constval);
478 (*testfunc) (exit1);
479}
480
481static void
482checkfunction(value * lval)
483{
484 symbol *sym = lval->sym;
485
486 if (!sym || (sym->ident != iFUNCTN && sym->ident != iREFFUNC))
487 return; /* no known symbol, or not a function result */
488
489 if ((sym->usage & uDEFINE) != 0)
490 {
491 /* function is defined, can now check the return value (but make an
492 * exception for directly recursive functions)
493 */
494 if (sym != curfunc && (sym->usage & uRETVALUE) == 0)
495 {
496 char symname[2 * sNAMEMAX + 16]; /* allow space for user defined operators */
497
498 funcdisplayname(symname, sym->name);
499 error(209, symname); /* function should return a value */
500 } /* if */
501 }
502 else
503 {
504 /* function not yet defined, set */
505 sym->usage |= uRETVALUE; /* make sure that a future implementation of
506 * the function uses "return <value>" */
507 } /* if */
508}
509
510/*
511 * Plunge to a lower level
512 */
513static int
514plnge(int *opstr, int opoff, int (*hier) (value * lval), value * lval,
515 char *forcetag, int chkbitwise)
516{
517 int lvalue, opidx;
518 int count;
519 value lval2 = { NULL, 0, 0, 0, 0, NULL };
520
521 lvalue = plnge1(hier, lval);
522 if (nextop(&opidx, opstr) == 0)
523 return lvalue; /* no operator in "opstr" found */
524 if (lvalue)
525 rvalue(lval);
526 count = 0;
527 do
528 {
529 if (chkbitwise && count++ > 0 && bitwise_opercount != 0)
530 error(212);
531 opidx += opoff; /* add offset to index returned by nextop() */
532 plnge2(op1[opidx], hier, lval, &lval2);
533 if (op1[opidx] == ob_and || op1[opidx] == ob_or)
534 bitwise_opercount++;
535 if (forcetag)
536 lval->tag = sc_addtag(forcetag);
537 }
538 while (nextop(&opidx, opstr)); /* do */
539 return FALSE; /* result of expression is not an lvalue */
540}
541
542/* plnge_rel
543 *
544 * Binary plunge to lower level; this is very simular to plnge, but
545 * it has special code generation sequences for chained operations.
546 */
547static int
548plnge_rel(int *opstr, int opoff, int (*hier) (value * lval), value * lval)
549{
550 int lvalue, opidx;
551 value lval2 = { NULL, 0, 0, 0, 0, NULL };
552 int count;
553
554 /* this function should only be called for relational operators */
555 assert(op1[opoff] == os_le);
556 lvalue = plnge1(hier, lval);
557 if (nextop(&opidx, opstr) == 0)
558 return lvalue; /* no operator in "opstr" found */
559 if (lvalue)
560 rvalue(lval);
561 count = 0;
562 lval->boolresult = TRUE;
563 do
564 {
565 /* same check as in plnge(), but "chkbitwise" is always TRUE */
566 if (count > 0 && bitwise_opercount != 0)
567 error(212);
568 if (count > 0)
569 {
570 relop_prefix();
571 *lval = lval2; /* copy right hand expression of the previous iteration */
572 } /* if */
573 opidx += opoff;
574 plnge2(op1[opidx], hier, lval, &lval2);
575 if (count++ > 0)
576 relop_suffix();
577 }
578 while (nextop(&opidx, opstr)); /* enddo */
579 lval->constval = lval->boolresult;
580 lval->tag = sc_addtag("bool"); /* force tag to be "bool" */
581 return FALSE; /* result of expression is not an lvalue */
582}
583
584/* plnge1
585 *
586 * Unary plunge to lower level
587 * Called by: skim(), plnge(), plnge2(), plnge_rel(), hier14() and hier13()
588 */
589static int
590plnge1(int (*hier) (value * lval), value * lval)
591{
592 int lvalue, index;
593 cell cidx;
594
595 stgget(&index, &cidx); /* mark position in code generator */
596 lvalue = (*hier) (lval);
597 if (lval->ident == iCONSTEXPR)
598 stgdel(index, cidx); /* load constant later */
599 return lvalue;
600}
601
602/* plnge2
603 *
604 * Binary plunge to lower level
605 * Called by: plnge(), plnge_rel(), hier14() and hier1()
606 */
607static void
608plnge2(void (*oper) (void),
609 int (*hier) (value * lval), value * lval1, value * lval2)
610{
611 int index;
612 cell cidx;
613
614 stgget(&index, &cidx); /* mark position in code generator */
615 if (lval1->ident == iCONSTEXPR)
616 { /* constant on left side; it is not yet loaded */
617 if (plnge1(hier, lval2))
618 rvalue(lval2); /* load lvalue now */
619 else if (lval2->ident == iCONSTEXPR)
620 const1(lval2->constval << dbltest(oper, lval2, lval1));
621 const2(lval1->constval << dbltest(oper, lval2, lval1));
622 /* ^ doubling of constants operating on integer addresses */
623 /* is restricted to "add" and "subtract" operators */
624 }
625 else
626 { /* non-constant on left side */
627 push1();
628 if (plnge1(hier, lval2))
629 rvalue(lval2);
630 if (lval2->ident == iCONSTEXPR)
631 { /* constant on right side */
632 if (commutative(oper))
633 { /* test for commutative operators */
634 value lvaltmp = { NULL, 0, 0, 0, 0, NULL };
635 stgdel(index, cidx); /* scratch push1() and constant fetch (then
636 * fetch the constant again */
637 const2(lval2->constval << dbltest(oper, lval1, lval2));
638 /* now, the primary register has the left operand and the secondary
639 * register the right operand; swap the "lval" variables so that lval1
640 * is associated with the secondary register and lval2 with the
641 * primary register, as is the "normal" case.
642 */
643 lvaltmp = *lval1;
644 *lval1 = *lval2;
645 *lval2 = lvaltmp;
646 }
647 else
648 {
649 const1(lval2->constval << dbltest(oper, lval1, lval2));
650 pop2(); /* pop result of left operand into secondary register */
651 } /* if */
652 }
653 else
654 { /* non-constants on both sides */
655 pop2();
656 if (dbltest(oper, lval1, lval2))
657 cell2addr(); /* double primary register */
658 if (dbltest(oper, lval2, lval1))
659 cell2addr_alt(); /* double secondary register */
660 } /* if */
661 } /* if */
662 if (oper)
663 {
664 /* If used in an expression, a function should return a value.
665 * If the function has been defined, we can check this. If the
666 * function was not defined, we can set this requirement (so that
667 * a future function definition can check this bit.
668 */
669 checkfunction(lval1);
670 checkfunction(lval2);
671 if (lval1->ident == iARRAY || lval1->ident == iREFARRAY)
672 {
673 char *ptr =
674 (lval1->sym) ? lval1->sym->name : "-unknown-";
675 error(33, ptr); /* array must be indexed */
676 }
677 else if (lval2->ident == iARRAY || lval2->ident == iREFARRAY)
678 {
679 char *ptr =
680 (lval2->sym) ? lval2->sym->name : "-unknown-";
681 error(33, ptr); /* array must be indexed */
682 } /* if */
683 /* ??? ^^^ should do same kind of error checking with functions */
684
685 /* check whether an "operator" function is defined for the tag names
686 * (a constant expression cannot be optimized in that case)
687 */
688 if (check_userop(oper, lval1->tag, lval2->tag, 2, NULL, &lval1->tag))
689 {
690 lval1->ident = iEXPRESSION;
691 lval1->constval = 0;
692 }
693 else if (lval1->ident == iCONSTEXPR && lval2->ident == iCONSTEXPR)
694 {
695 /* only constant expression if both constant */
696 stgdel(index, cidx); /* scratch generated code and calculate */
697 if (!matchtag(lval1->tag, lval2->tag, FALSE))
698 error(213); /* tagname mismatch */
699 lval1->constval =
700 calc(lval1->constval, oper, lval2->constval,
701 &lval1->boolresult);
702 }
703 else
704 {
705 if (!matchtag(lval1->tag, lval2->tag, FALSE))
706 error(213); /* tagname mismatch */
707 (*oper) (); /* do the (signed) operation */
708 lval1->ident = iEXPRESSION;
709 } /* if */
710 } /* if */
711}
712
713static cell
714truemodulus(cell a, cell b)
715{
716 return (a % b + b) % b;
717}
718
719static cell
720calc(cell left, void (*oper) (), cell right, char *boolresult)
721{
722 if (oper == ob_or)
723 return (left | right);
724 else if (oper == ob_xor)
725 return (left ^ right);
726 else if (oper == ob_and)
727 return (left & right);
728 else if (oper == ob_eq)
729 return (left == right);
730 else if (oper == ob_ne)
731 return (left != right);
732 else if (oper == os_le)
733 return *boolresult &= (char)(left <= right), right;
734 else if (oper == os_ge)
735 return *boolresult &= (char)(left >= right), right;
736 else if (oper == os_lt)
737 return *boolresult &= (char)(left < right), right;
738 else if (oper == os_gt)
739 return *boolresult &= (char)(left > right), right;
740 else if (oper == os_sar)
741 return (left >> (int)right);
742 else if (oper == ou_sar)
743 return ((ucell) left >> (ucell) right);
744 else if (oper == ob_sal)
745 return ((ucell) left << (int)right);
746 else if (oper == ob_add)
747 return (left + right);
748 else if (oper == ob_sub)
749 return (left - right);
750 else if (oper == os_mult)
751 return (left * right);
752 else if (oper == os_div)
753 return (left - truemodulus(left, right)) / right;
754 else if (oper == os_mod)
755 return truemodulus(left, right);
756 else
757 error(29); /* invalid expression, assumed 0 (this should never occur) */
758 return 0;
759}
760
761int
762expression(int *constant, cell * val, int *tag, int chkfuncresult)
763{
764 value lval = { NULL, 0, 0, 0, 0, NULL };
765
766 if (hier14(&lval))
767 rvalue(&lval);
768 if (lval.ident == iCONSTEXPR)
769 { /* constant expression */
770 *constant = TRUE;
771 *val = lval.constval;
772 }
773 else
774 {
775 *constant = FALSE;
776 *val = 0;
777 } /* if */
778 if (tag)
779 *tag = lval.tag;
780 if (chkfuncresult)
781 checkfunction(&lval);
782 return lval.ident;
783}
784
785static cell
786array_totalsize(symbol * sym)
787{
788 cell length;
789
790 assert(sym != NULL);
791 assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
792 length = sym->dim.array.length;
793 if (sym->dim.array.level > 0)
794 {
795 cell sublength = array_totalsize(finddepend(sym));
796
797 if (sublength > 0)
798 length = length + length * sublength;
799 else
800 length = 0;
801 } /* if */
802 return length;
803}
804
805static cell
806array_levelsize(symbol * sym, int level)
807{
808 assert(sym != NULL);
809 assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
810 assert(level <= sym->dim.array.level);
811 while (level-- > 0)
812 {
813 sym = finddepend(sym);
814 assert(sym != NULL);
815 } /* if */
816 return sym->dim.array.length;
817}
818
819/* hier14
820 *
821 * Lowest hierarchy level (except for the , operator).
822 *
823 * Global references: intest (referred to only)
824 */
825int
826hier14(value * lval1)
827{
828 int lvalue;
829 value lval2 = { NULL, 0, 0, 0, 0, NULL };
830 value lval3 = { NULL, 0, 0, 0, 0, NULL };
831 void (*oper) (void);
832 int tok, level, i;
833 cell val;
834 char *st;
835 int bwcount;
836 cell arrayidx1[sDIMEN_MAX], arrayidx2[sDIMEN_MAX]; /* last used array indices */
837 cell *org_arrayidx;
838
839 bwcount = bitwise_opercount;
840 bitwise_opercount = 0;
841 for (i = 0; i < sDIMEN_MAX; i++)
842 arrayidx1[i] = arrayidx2[i] = 0;
843 org_arrayidx = lval1->arrayidx; /* save current pointer, to reset later */
844 if (!lval1->arrayidx)
845 lval1->arrayidx = arrayidx1;
846 lvalue = plnge1(hier13, lval1);
847 if (lval1->ident != iARRAYCELL && lval1->ident != iARRAYCHAR)
848 lval1->arrayidx = NULL;
849 if (lval1->ident == iCONSTEXPR) /* load constant here */
850 const1(lval1->constval);
851 tok = lex(&val, &st);
852 switch (tok)
853 {
854 case taOR:
855 oper = ob_or;
856 break;
857 case taXOR:
858 oper = ob_xor;
859 break;
860 case taAND:
861 oper = ob_and;
862 break;
863 case taADD:
864 oper = ob_add;
865 break;
866 case taSUB:
867 oper = ob_sub;
868 break;
869 case taMULT:
870 oper = os_mult;
871 break;
872 case taDIV:
873 oper = os_div;
874 break;
875 case taMOD:
876 oper = os_mod;
877 break;
878 case taSHRU:
879 oper = ou_sar;
880 break;
881 case taSHR:
882 oper = os_sar;
883 break;
884 case taSHL:
885 oper = ob_sal;
886 break;
887 case '=': /* simple assignment */
888 oper = NULL;
889 if (intest)
890 error(211); /* possibly unintended assignment */
891 break;
892 default:
893 lexpush();
894 bitwise_opercount = bwcount;
895 lval1->arrayidx = org_arrayidx; /* restore array index pointer */
896 return lvalue;
897 } /* switch */
898
899 /* if we get here, it was an assignment; first check a few special cases
900 * and then the general */
901 if (lval1->ident == iARRAYCHAR)
902 {
903 /* special case, assignment to packed character in a cell is permitted */
904 lvalue = TRUE;
905 }
906 else if (lval1->ident == iARRAY || lval1->ident == iREFARRAY)
907 {
908 /* array assignment is permitted too (with restrictions) */
909 if (oper)
910 return error(23); /* array assignment must be simple assigment */
911 assert(lval1->sym != NULL);
912 if (array_totalsize(lval1->sym) == 0)
913 return error(46, lval1->sym->name); /* unknown array size */
914 lvalue = TRUE;
915 } /* if */
916
917 /* operand on left side of assignment must be lvalue */
918 if (!lvalue)
919 return error(22); /* must be lvalue */
920 /* may not change "constant" parameters */
921 assert(lval1->sym != NULL);
922 if ((lval1->sym->usage & uCONST) != 0)
923 return error(22); /* assignment to const argument */
924 lval3 = *lval1; /* save symbol to enable storage of expresion result */
925 lval1->arrayidx = org_arrayidx; /* restore array index pointer */
926 if (lval1->ident == iARRAYCELL || lval1->ident == iARRAYCHAR
927 || lval1->ident == iARRAY || lval1->ident == iREFARRAY)
928 {
929 /* if indirect fetch: save PRI (cell address) */
930 if (oper)
931 {
932 push1();
933 rvalue(lval1);
934 } /* if */
935 lval2.arrayidx = arrayidx2;
936 plnge2(oper, hier14, lval1, &lval2);
937 if (lval2.ident != iARRAYCELL && lval2.ident != iARRAYCHAR)
938 lval2.arrayidx = NULL;
939 if (oper)
940 pop2();
941 if (!oper && lval3.arrayidx && lval2.arrayidx
942 && lval3.ident == lval2.ident && lval3.sym == lval2.sym)
943 {
944 int same = TRUE;
945
946 assert(lval3.arrayidx == arrayidx1);
947 assert(lval2.arrayidx == arrayidx2);
948 for (i = 0; i < sDIMEN_MAX; i++)
949 same = same && (lval3.arrayidx[i] == lval2.arrayidx[i]);
950 if (same)
951 error(226, lval3.sym->name); /* self-assignment */
952 } /* if */
953 }
954 else
955 {
956 if (oper)
957 {
958 rvalue(lval1);
959 plnge2(oper, hier14, lval1, &lval2);
960 }
961 else
962 {
963 /* if direct fetch and simple assignment: no "push"
964 * and "pop" needed -> call hier14() directly, */
965 if (hier14(&lval2))
966 rvalue(&lval2); /* instead of plnge2(). */
967 checkfunction(&lval2);
968 /* check whether lval2 and lval3 (old lval1) refer to the same variable */
969 if (lval2.ident == iVARIABLE && lval3.ident == lval2.ident
970 && lval3.sym == lval2.sym)
971 {
972 assert(lval3.sym != NULL);
973 error(226, lval3.sym->name); /* self-assignment */
974 } /* if */
975 } /* if */
976 } /* if */
977 if (lval3.ident == iARRAY || lval3.ident == iREFARRAY)
978 {
979 /* left operand is an array, right operand should be an array variable
980 * of the same size and the same dimension, an array literal (of the
981 * same size) or a literal string.
982 */
983 int exactmatch = TRUE;
984
985 if (lval2.ident != iARRAY && lval2.ident != iREFARRAY)
986 error(33, lval3.sym->name); /* array must be indexed */
987 if (lval2.sym)
988 {
989 val = lval2.sym->dim.array.length; /* array variable */
990 level = lval2.sym->dim.array.level;
991 }
992 else
993 {
994 val = lval2.constval; /* literal array */
995 level = 0;
996 /* If val is negative, it means that lval2 is a
997 * literal string. The string array size may be
998 * smaller than the destination array.
999 */
1000 if (val < 0)
1001 {
1002 val = -val;
1003 exactmatch = FALSE;
1004 } /* if */
1005 } /* if */
1006 if (lval3.sym->dim.array.level != level)
1007 return error(48); /* array dimensions must match */
1008 else if (lval3.sym->dim.array.length < val
1009 || (exactmatch && lval3.sym->dim.array.length > val))
1010 return error(47); /* array sizes must match */
1011 if (level > 0)
1012 {
1013 /* check the sizes of all sublevels too */
1014 symbol *sym1 = lval3.sym;
1015 symbol *sym2 = lval2.sym;
1016 int i;
1017
1018 assert(sym1 != NULL && sym2 != NULL);
1019 /* ^^^ sym2 must be valid, because only variables can be
1020 * multi-dimensional (there are no multi-dimensional arrays),
1021 * sym1 must be valid because it must be an lvalue
1022 */
1023 assert(exactmatch);
1024 for (i = 0; i < level; i++)
1025 {
1026 sym1 = finddepend(sym1);
1027 sym2 = finddepend(sym2);
1028 assert(sym1 != NULL && sym2 != NULL);
1029 /* ^^^ both arrays have the same dimensions (this was checked
1030 * earlier) so the dependend should always be found
1031 */
1032 if (sym1->dim.array.length != sym2->dim.array.length)
1033 error(47); /* array sizes must match */
1034 } /* for */
1035 /* get the total size in cells of the multi-dimensional array */
1036 val = array_totalsize(lval3.sym);
1037 assert(val > 0); /* already checked */
1038 } /* if */
1039 }
1040 else
1041 {
1042 /* left operand is not an array, right operand should then not be either */
1043 if (lval2.ident == iARRAY || lval2.ident == iREFARRAY)
1044 error(6); /* must be assigned to an array */
1045 } /* if */
1046 if (lval3.ident == iARRAY || lval3.ident == iREFARRAY)
1047 {
1048 memcopy(val * sizeof(cell));
1049 }
1050 else
1051 {
1052 check_userop(NULL, lval2.tag, lval3.tag, 2, &lval3, &lval2.tag);
1053 store(&lval3); /* now, store the expression result */
1054 } /* if */
1055 if (!oper && !matchtag(lval3.tag, lval2.tag, TRUE))
1056 error(213); /* tagname mismatch (if "oper", warning already given in plunge2()) */
1057 if (lval3.sym)
1058 markusage(lval3.sym, uWRITTEN);
1059 sideeffect = TRUE;
1060 bitwise_opercount = bwcount;
1061 return FALSE; /* expression result is never an lvalue */
1062}
1063
1064static int
1065hier13(value * lval)
1066{
1067 int lvalue, flab1, flab2;
1068 value lval2 = { NULL, 0, 0, 0, 0, NULL };
1069 int array1, array2;
1070
1071 lvalue = plnge1(hier12, lval);
1072 if (matchtoken('?'))
1073 {
1074 flab1 = getlabel();
1075 flab2 = getlabel();
1076 if (lvalue)
1077 {
1078 rvalue(lval);
1079 }
1080 else if (lval->ident == iCONSTEXPR)
1081 {
1082 const1(lval->constval);
1083 error(lval->constval ? 206 : 205); /* redundant test */
1084 } /* if */
1085 jmp_eq0(flab1); /* go to second expression if primary register==0 */
1086 if (hier14(lval))
1087 rvalue(lval);
1088 jumplabel(flab2);
1089 setlabel(flab1);
1090 needtoken(':');
1091 if (hier14(&lval2))
1092 rvalue(&lval2);
1093 array1 = (lval->ident == iARRAY || lval->ident == iREFARRAY);
1094 array2 = (lval2.ident == iARRAY || lval2.ident == iREFARRAY);
1095 if (array1 && !array2)
1096 {
1097 char *ptr =
1098 (lval->sym->name) ? lval->sym->name : "-unknown-";
1099 error(33, ptr); /* array must be indexed */
1100 }
1101 else if (!array1 && array2)
1102 {
1103 char *ptr =
1104 (lval2.sym->name) ? lval2.sym->name : "-unknown-";
1105 error(33, ptr); /* array must be indexed */
1106 } /* if */
1107 /* ??? if both are arrays, should check dimensions */
1108 if (!matchtag(lval->tag, lval2.tag, FALSE))
1109 error(213); /* tagname mismatch ('true' and 'false' expressions) */
1110 setlabel(flab2);
1111 if (lval->ident == iARRAY)
1112 lval->ident = iREFARRAY; /* iARRAY becomes iREFARRAY */
1113 else if (lval->ident != iREFARRAY)
1114 lval->ident = iEXPRESSION; /* iREFARRAY stays iREFARRAY, rest becomes iEXPRESSION */
1115 return FALSE; /* conditional expression is no lvalue */
1116 }
1117 else
1118 {
1119 return lvalue;
1120 } /* endif */
1121}
1122
1123/* the order of the operators in these lists is important and must cohere */
1124/* with the order of the operators in the array "op1" */
1125static int list3[] = { '*', '/', '%', 0 };
1126static int list4[] = { '+', '-', 0 };
1127static int list5[] = { tSHL, tSHR, tSHRU, 0 };
1128static int list6[] = { '&', 0 };
1129static int list7[] = { '^', 0 };
1130static int list8[] = { '|', 0 };
1131static int list9[] = { tlLE, tlGE, '<', '>', 0 };
1132static int list10[] = { tlEQ, tlNE, 0 };
1133static int list11[] = { tlAND, 0 };
1134static int list12[] = { tlOR, 0 };
1135
1136static int
1137hier12(value * lval)
1138{
1139 return skim(list12, jmp_ne0, 1, 0, hier11, lval);
1140}
1141
1142static int
1143hier11(value * lval)
1144{
1145 return skim(list11, jmp_eq0, 0, 1, hier10, lval);
1146}
1147
1148static int
1149hier10(value * lval)
1150{ /* ==, != */
1151 return plnge(list10, 15, hier9, lval, "bool", TRUE);
1152} /* ^ this variable is the starting index in the op1[]
1153 * array of the operators of this hierarchy level */
1154
1155static int
1156hier9(value * lval)
1157{ /* <=, >=, <, > */
1158 return plnge_rel(list9, 11, hier8, lval);
1159}
1160
1161static int
1162hier8(value * lval)
1163{ /* | */
1164 return plnge(list8, 10, hier7, lval, NULL, FALSE);
1165}
1166
1167static int
1168hier7(value * lval)
1169{ /* ^ */
1170 return plnge(list7, 9, hier6, lval, NULL, FALSE);
1171}
1172
1173static int
1174hier6(value * lval)
1175{ /* & */
1176 return plnge(list6, 8, hier5, lval, NULL, FALSE);
1177}
1178
1179static int
1180hier5(value * lval)
1181{ /* <<, >>, >>> */
1182 return plnge(list5, 5, hier4, lval, NULL, FALSE);
1183}
1184
1185static int
1186hier4(value * lval)
1187{ /* +, - */
1188 return plnge(list4, 3, hier3, lval, NULL, FALSE);
1189}
1190
1191static int
1192hier3(value * lval)
1193{ /* *, /, % */
1194 return plnge(list3, 0, hier2, lval, NULL, FALSE);
1195}
1196
1197static int
1198hier2(value * lval)
1199{
1200 int lvalue, tok;
1201 int tag, paranthese;
1202 cell val;
1203 char *st;
1204 symbol *sym;
1205 int saveresult;
1206
1207 tok = lex(&val, &st);
1208 switch (tok)
1209 {
1210 case tINC: /* ++lval */
1211 if (!hier2(lval))
1212 return error(22); /* must be lvalue */
1213 assert(lval->sym != NULL);
1214 if ((lval->sym->usage & uCONST) != 0)
1215 return error(22); /* assignment to const argument */
1216 if (!check_userop(user_inc, lval->tag, 0, 1, lval, &lval->tag))
1217 inc(lval); /* increase variable first */
1218 rvalue(lval); /* and read the result into PRI */
1219 sideeffect = TRUE;
1220 return FALSE; /* result is no longer lvalue */
1221 case tDEC: /* --lval */
1222 if (!hier2(lval))
1223 return error(22); /* must be lvalue */
1224 assert(lval->sym != NULL);
1225 if ((lval->sym->usage & uCONST) != 0)
1226 return error(22); /* assignment to const argument */
1227 if (!check_userop(user_dec, lval->tag, 0, 1, lval, &lval->tag))
1228 dec(lval); /* decrease variable first */
1229 rvalue(lval); /* and read the result into PRI */
1230 sideeffect = TRUE;
1231 return FALSE; /* result is no longer lvalue */
1232 case '~': /* ~ (one's complement) */
1233 if (hier2(lval))
1234 rvalue(lval);
1235 invert(); /* bitwise NOT */
1236 lval->constval = ~lval->constval;
1237 return FALSE;
1238 case '!': /* ! (logical negate) */
1239 if (hier2(lval))
1240 rvalue(lval);
1241 if (check_userop(lneg, lval->tag, 0, 1, NULL, &lval->tag))
1242 {
1243 lval->ident = iEXPRESSION;
1244 lval->constval = 0;
1245 }
1246 else
1247 {
1248 lneg(); /* 0 -> 1, !0 -> 0 */
1249 lval->constval = !lval->constval;
1250 lval->tag = sc_addtag("bool");
1251 } /* if */
1252 return FALSE;
1253 case '-': /* unary - (two's complement) */
1254 if (hier2(lval))
1255 rvalue(lval);
1256 /* make a special check for a constant expression with the tag of a
1257 * rational number, so that we can simple swap the sign of that constant.
1258 */
1259 if (lval->ident == iCONSTEXPR && lval->tag == sc_rationaltag
1260 && sc_rationaltag != 0)
1261 {
1262 if (rational_digits == 0)
1263 {
1264 float *f = (float *)&lval->constval;
1265
1266 *f = -*f; /* this modifies lval->constval */
1267 }
1268 else
1269 {
1270 /* the negation of a fixed point number is just an integer negation */
1271 lval->constval = -lval->constval;
1272 } /* if */
1273 }
1274 else if (check_userop(neg, lval->tag, 0, 1, NULL, &lval->tag))
1275 {
1276 lval->ident = iEXPRESSION;
1277 lval->constval = 0;
1278 }
1279 else
1280 {
1281 neg(); /* arithmic negation */
1282 lval->constval = -lval->constval;
1283 } /* if */
1284 return FALSE;
1285 case tLABEL: /* tagname override */
1286 tag = sc_addtag(st);
1287 lvalue = hier2(lval);
1288 lval->tag = tag;
1289 return lvalue;
1290 case tDEFINED:
1291 paranthese = 0;
1292 while (matchtoken('('))
1293 paranthese++;
1294 tok = lex(&val, &st);
1295 if (tok != tSYMBOL)
1296 return error(20, st); /* illegal symbol name */
1297 sym = findloc(st);
1298 if (!sym)
1299 sym = findglb(st);
1300 if (sym && sym->ident != iFUNCTN && sym->ident != iREFFUNC
1301 && (sym->usage & uDEFINE) == 0)
1302 sym = NULL; /* symbol is not a function, it is in the table, but not "defined" */
1303 val = !!sym;
1304 if (!val && find_subst(st, strlen(st)))
1305 val = 1;
1306 clear_value(lval);
1307 lval->ident = iCONSTEXPR;
1308 lval->constval = val;
1309 const1(lval->constval);
1310 while (paranthese--)
1311 needtoken(')');
1312 return FALSE;
1313 case tSIZEOF:
1314 paranthese = 0;
1315 while (matchtoken('('))
1316 paranthese++;
1317 tok = lex(&val, &st);
1318 if (tok != tSYMBOL)
1319 return error(20, st); /* illegal symbol name */
1320 sym = findloc(st);
1321 if (!sym)
1322 sym = findglb(st);
1323 if (!sym)
1324 return error(17, st); /* undefined symbol */
1325 if (sym->ident == iCONSTEXPR)
1326 error(39); /* constant symbol has no size */
1327 else if (sym->ident == iFUNCTN || sym->ident == iREFFUNC)
1328 error(72); /* "function" symbol has no size */
1329 else if ((sym->usage & uDEFINE) == 0)
1330 return error(17, st); /* undefined symbol (symbol is in the table, but it is "used" only) */
1331 clear_value(lval);
1332 lval->ident = iCONSTEXPR;
1333 lval->constval = 1; /* preset */
1334 if (sym->ident == iARRAY || sym->ident == iREFARRAY)
1335 {
1336 int level;
1337
1338 for (level = 0; matchtoken('['); level++)
1339 needtoken(']');
1340 if (level > sym->dim.array.level)
1341 error(28); /* invalid subscript */
1342 else
1343 lval->constval = array_levelsize(sym, level);
1344 if (lval->constval == 0 && !strchr(lptr, PREPROC_TERM))
1345 error(224, st); /* indeterminate array size in "sizeof" expression */
1346 } /* if */
1347 const1(lval->constval);
1348 while (paranthese--)
1349 needtoken(')');
1350 return FALSE;
1351 case tTAGOF:
1352 paranthese = 0;
1353 while (matchtoken('('))
1354 paranthese++;
1355 tok = lex(&val, &st);
1356 if (tok != tSYMBOL && tok != tLABEL)
1357 return error(20, st); /* illegal symbol name */
1358 if (tok == tLABEL)
1359 {
1360 tag = sc_addtag(st);
1361 }
1362 else
1363 {
1364 sym = findloc(st);
1365 if (!sym)
1366 sym = findglb(st);
1367 if (!sym)
1368 return error(17, st); /* undefined symbol */
1369 if ((sym->usage & uDEFINE) == 0)
1370 return error(17, st); /* undefined symbol (symbol is in the table, but it is "used" only) */
1371 tag = sym->tag;
1372 } /* if */
1373 exporttag(tag);
1374 clear_value(lval);
1375 lval->ident = iCONSTEXPR;
1376 lval->constval = tag;
1377 const1(lval->constval);
1378 while (paranthese--)
1379 needtoken(')');
1380 return FALSE;
1381 default:
1382 lexpush();
1383 lvalue = hier1(lval);
1384 /* check for postfix operators */
1385 if (matchtoken(';'))
1386 {
1387 /* Found a ';', do not look further for postfix operators */
1388 lexpush(); /* push ';' back after successful match */
1389 return lvalue;
1390 }
1391 else if (matchtoken(tTERM))
1392 {
1393 /* Found a newline that ends a statement (this is the case when
1394 * semicolons are optional). Note that an explicit semicolon was
1395 * handled above. This case is similar, except that the token must
1396 * not be pushed back.
1397 */
1398 return lvalue;
1399 }
1400 else
1401 {
1402 tok = lex(&val, &st);
1403 switch (tok)
1404 {
1405 case tINC: /* lval++ */
1406 if (!lvalue)
1407 return error(22); /* must be lvalue */
1408 assert(lval->sym != NULL);
1409 if ((lval->sym->usage & uCONST) != 0)
1410 return error(22); /* assignment to const argument */
1411 /* on incrementing array cells, the address in PRI must be saved for
1412 * incremening the value, whereas the current value must be in PRI
1413 * on exit.
1414 */
1415 saveresult = (lval->ident == iARRAYCELL
1416 || lval->ident == iARRAYCHAR);
1417 if (saveresult)
1418 push1(); /* save address in PRI */
1419 rvalue(lval); /* read current value into PRI */
1420 if (saveresult)
1421 swap1(); /* save PRI on the stack, restore address in PRI */
1422 if (!check_userop
1423 (user_inc, lval->tag, 0, 1, lval, &lval->tag))
1424 inc(lval); /* increase variable afterwards */
1425 if (saveresult)
1426 pop1(); /* restore PRI (result of rvalue()) */
1427 sideeffect = TRUE;
1428 return FALSE; /* result is no longer lvalue */
1429 case tDEC: /* lval-- */
1430 if (!lvalue)
1431 return error(22); /* must be lvalue */
1432 assert(lval->sym != NULL);
1433 if ((lval->sym->usage & uCONST) != 0)
1434 return error(22); /* assignment to const argument */
1435 saveresult = (lval->ident == iARRAYCELL
1436 || lval->ident == iARRAYCHAR);
1437 if (saveresult)
1438 push1(); /* save address in PRI */
1439 rvalue(lval); /* read current value into PRI */
1440 if (saveresult)
1441 swap1(); /* save PRI on the stack, restore address in PRI */
1442 if (!check_userop
1443 (user_dec, lval->tag, 0, 1, lval, &lval->tag))
1444 dec(lval); /* decrease variable afterwards */
1445 if (saveresult)
1446 pop1(); /* restore PRI (result of rvalue()) */
1447 sideeffect = TRUE;
1448 return FALSE;
1449 case tCHAR: /* char (compute required # of cells */
1450 if (lval->ident == iCONSTEXPR)
1451 {
1452 lval->constval *= charbits / 8; /* from char to bytes */
1453 lval->constval =
1454 (lval->constval + sizeof(cell) - 1) / sizeof(cell);
1455 }
1456 else
1457 {
1458 if (lvalue)
1459 rvalue(lval); /* fetch value if not already in PRI */
1460 char2addr(); /* from characters to bytes */
1461 addconst(sizeof(cell) - 1); /* make sure the value is rounded up */
1462 addr2cell(); /* truncate to number of cells */
1463 } /* if */
1464 return FALSE;
1465 default:
1466 lexpush();
1467 return lvalue;
1468 } /* switch */
1469 } /* if */
1470 } /* switch */
1471}
1472
1473/* hier1
1474 *
1475 * The highest hierarchy level: it looks for pointer and array indices
1476 * and function calls.
1477 * Generates code to fetch a pointer value if it is indexed and code to
1478 * add to the pointer value or the array address (the address is already
1479 * read at primary()). It also generates code to fetch a function address
1480 * if that hasn't already been done at primary() (check lval[4]) and calls
1481 * callfunction() to call the function.
1482 */
1483static int
1484hier1(value * lval1)
1485{
1486 int lvalue, index, tok, symtok;
1487 cell val, cidx;
1488 value lval2 = { NULL, 0, 0, 0, 0, NULL };
1489 char *st;
1490 char close;
1491 symbol *sym;
1492
1493 lvalue = primary(lval1);
1494 symtok = tokeninfo(&val, &st); /* get token read by primary() */
1495 restart:
1496 sym = lval1->sym;
1497 if (matchtoken('[') || matchtoken('{') || matchtoken('('))
1498 {
1499 tok = tokeninfo(&val, &st); /* get token read by matchtoken() */
1500 if (!sym && symtok != tSYMBOL)
1501 {
1502 /* we do not have a valid symbol and we appear not to have read a valid
1503 * symbol name (so it is unlikely that we would have read a name of an
1504 * undefined symbol) */
1505 error(29); /* expression error, assumed 0 */
1506 lexpush(); /* analyse '(', '{' or '[' again later */
1507 return FALSE;
1508 } /* if */
1509 if (tok == '[' || tok == '{')
1510 { /* subscript */
1511 close = (char)((tok == '[') ? ']' : '}');
1512 if (!sym)
1513 { /* sym==NULL if lval is a constant or a literal */
1514 error(28); /* cannot subscript */
1515 needtoken(close);
1516 return FALSE;
1517 }
1518 else if (sym->ident != iARRAY && sym->ident != iREFARRAY)
1519 {
1520 error(28); /* cannot subscript, variable is not an array */
1521 needtoken(close);
1522 return FALSE;
1523 }
1524 else if (sym->dim.array.level > 0 && close != ']')
1525 {
1526 error(51); /* invalid subscript, must use [ ] */
1527 needtoken(close);
1528 return FALSE;
1529 } /* if */
1530 stgget(&index, &cidx); /* mark position in code generator */
1531 push1(); /* save base address of the array */
1532 if (hier14(&lval2)) /* create expression for the array index */
1533 rvalue(&lval2);
1534 if (lval2.ident == iARRAY || lval2.ident == iREFARRAY)
1535 error(33, lval2.sym->name); /* array must be indexed */
1536 needtoken(close);
1537 if (!matchtag(sym->x.idxtag, lval2.tag, TRUE))
1538 error(213);
1539 if (lval2.ident == iCONSTEXPR)
1540 { /* constant expression */
1541 stgdel(index, cidx); /* scratch generated code */
1542 if (lval1->arrayidx)
1543 { /* keep constant index, for checking */
1544 assert(sym->dim.array.level >= 0
1545 && sym->dim.array.level < sDIMEN_MAX);
1546 lval1->arrayidx[sym->dim.array.level] = lval2.constval;
1547 } /* if */
1548 if (close == ']')
1549 {
1550 /* normal array index */
1551 if (lval2.constval < 0 || (sym->dim.array.length != 0
1552 && sym->dim.array.length <= lval2.constval))
1553 error(32, sym->name); /* array index out of bounds */
1554 if (lval2.constval != 0)
1555 {
1556 /* don't add offsets for zero subscripts */
1557#if defined(BIT16)
1558 const2(lval2.constval << 1);
1559#else
1560 const2(lval2.constval << 2);
1561#endif
1562 ob_add();
1563 } /* if */
1564 }
1565 else
1566 {
1567 /* character index */
1568 if (lval2.constval < 0 || (sym->dim.array.length != 0
1569 && sym->dim.array.length * ((8 * sizeof(cell)) /
1570 charbits) <=
1571 (ucell) lval2.constval))
1572 error(32, sym->name); /* array index out of bounds */
1573 if (lval2.constval != 0)
1574 {
1575 /* don't add offsets for zero subscripts */
1576 if (charbits == 16)
1577 const2(lval2.constval << 1); /* 16-bit character */
1578 else
1579 const2(lval2.constval); /* 8-bit character */
1580 ob_add();
1581 } /* if */
1582 charalign(); /* align character index into array */
1583 } /* if */
1584 }
1585 else
1586 {
1587 /* array index is not constant */
1588 lval1->arrayidx = NULL; /* reset, so won't be checked */
1589 if (close == ']')
1590 {
1591 if (sym->dim.array.length != 0)
1592 ffbounds(sym->dim.array.length - 1); /* run time check for array bounds */
1593 cell2addr(); /* normal array index */
1594 }
1595 else
1596 {
1597 if (sym->dim.array.length != 0)
1598 ffbounds(sym->dim.array.length * (32 / charbits) - 1);
1599 char2addr(); /* character array index */
1600 } /* if */
1601 pop2();
1602 ob_add(); /* base address was popped into secondary register */
1603 if (close != ']')
1604 charalign(); /* align character index into array */
1605 } /* if */
1606 /* the indexed item may be another array (multi-dimensional arrays) */
1607 assert(lval1->sym == sym && sym != NULL); /* should still be set */
1608 if (sym->dim.array.level > 0)
1609 {
1610 assert(close == ']'); /* checked earlier */
1611 /* read the offset to the subarray and add it to the current address */
1612 lval1->ident = iARRAYCELL;
1613 push1(); /* the optimizer makes this to a MOVE.alt */
1614 rvalue(lval1);
1615 pop2();
1616 ob_add();
1617 /* adjust the "value" structure and find the referenced array */
1618 lval1->ident = iREFARRAY;
1619 lval1->sym = finddepend(sym);
1620 assert(lval1->sym != NULL);
1621 assert(lval1->sym->dim.array.level ==
1622 sym->dim.array.level - 1);
1623 /* try to parse subsequent array indices */
1624 lvalue = FALSE; /* for now, a iREFARRAY is no lvalue */
1625 goto restart;
1626 } /* if */
1627 assert(sym->dim.array.level == 0);
1628 /* set type to fetch... INDIRECTLY */
1629 lval1->ident = (char)((close == ']') ? iARRAYCELL : iARRAYCHAR);
1630 lval1->tag = sym->tag;
1631 /* a cell in an array is an lvalue, a character in an array is not
1632 * always a *valid* lvalue */
1633 return TRUE;
1634 }
1635 else
1636 { /* tok=='(' -> function(...) */
1637 if (!sym
1638 || (sym->ident != iFUNCTN && sym->ident != iREFFUNC))
1639 {
1640 if (!sym && sc_status == statFIRST)
1641 {
1642 /* could be a "use before declaration"; in that case, create a stub
1643 * function so that the usage can be marked.
1644 */
1645 sym = fetchfunc(lastsymbol, 0);
1646 if (sym)
1647 markusage(sym, uREAD);
1648 } /* if */
1649 return error(12); /* invalid function call */
1650 }
1651 else if ((sym->usage & uMISSING) != 0)
1652 {
1653 char symname[2 * sNAMEMAX + 16]; /* allow space for user defined operators */
1654
1655 funcdisplayname(symname, sym->name);
1656 error(4, symname); /* function not defined */
1657 } /* if */
1658 callfunction(sym);
1659 lval1->ident = iEXPRESSION;
1660 lval1->constval = 0;
1661 lval1->tag = sym->tag;
1662 return FALSE; /* result of function call is no lvalue */
1663 } /* if */
1664 } /* if */
1665 if (sym && lval1->ident == iFUNCTN)
1666 {
1667 assert(sym->ident == iFUNCTN);
1668 address(sym);
1669 lval1->sym = NULL;
1670 lval1->ident = iREFFUNC;
1671 /* ??? however... function pointers (or function references are not (yet) allowed */
1672 error(29); /* expression error, assumed 0 */
1673 return FALSE;
1674 } /* if */
1675 return lvalue;
1676}
1677
1678/* primary
1679 *
1680 * Returns 1 if the operand is an lvalue (everything except arrays, functions
1681 * constants and -of course- errors).
1682 * Generates code to fetch the address of arrays. Code for constants is
1683 * already generated by constant().
1684 * This routine first clears the entire lval array (all fields are set to 0).
1685 *
1686 * Global references: intest (may be altered, but restored upon termination)
1687 */
1688static int
1689primary(value * lval)
1690{
1691 char *st;
1692 int lvalue, tok;
1693 cell val;
1694 symbol *sym;
1695
1696 if (matchtoken('('))
1697 { /* sub-expression - (expression,...) */
1698 pushstk((stkitem) intest);
1699 pushstk((stkitem) sc_allowtags);
1700
1701 intest = 0; /* no longer in "test" expression */
1702 sc_allowtags = TRUE; /* allow tagnames to be used in parenthised expressions */
1703 do
1704 lvalue = hier14(lval);
1705 while (matchtoken(','));
1706 needtoken(')');
1707 lexclr(FALSE); /* clear lex() push-back, it should have been
1708 * cleared already by needtoken() */
1709 sc_allowtags = (int)(long)popstk();
1710 intest = (int)(long)popstk();
1711 return lvalue;
1712 } /* if */
1713
1714 clear_value(lval); /* clear lval */
1715 tok = lex(&val, &st);
1716 if (tok == tSYMBOL)
1717 {
1718 /* lastsymbol is char[sNAMEMAX+1], lex() should have truncated any symbol
1719 * to sNAMEMAX significant characters */
1720 assert(strlen(st) < sizeof lastsymbol);
1721 strcpy(lastsymbol, st);
1722 } /* if */
1723 if (tok == tSYMBOL && !findconst(st))
1724 {
1725 /* first look for a local variable */
1726 if ((sym = findloc(st)))
1727 {
1728 if (sym->ident == iLABEL)
1729 {
1730 error(29); /* expression error, assumed 0 */
1731 const1(0); /* load 0 */
1732 return FALSE; /* return 0 for labels (expression error) */
1733 } /* if */
1734 lval->sym = sym;
1735 lval->ident = sym->ident;
1736 lval->tag = sym->tag;
1737 if (sym->ident == iARRAY || sym->ident == iREFARRAY)
1738 {
1739 address(sym); /* get starting address in primary register */
1740 return FALSE; /* return 0 for array (not lvalue) */
1741 }
1742 else
1743 {
1744 return TRUE; /* return 1 if lvalue (not label or array) */
1745 } /* if */
1746 } /* if */
1747 /* now try a global variable */
1748 if ((sym = findglb(st)))
1749 {
1750 if (sym->ident == iFUNCTN || sym->ident == iREFFUNC)
1751 {
1752 /* if the function is only in the table because it was inserted as a
1753 * stub in the first pass (i.e. it was "used" but never declared or
1754 * implemented, issue an error
1755 */
1756 if ((sym->usage & uPROTOTYPED) == 0)
1757 error(17, st);
1758 }
1759 else
1760 {
1761 if ((sym->usage & uDEFINE) == 0)
1762 error(17, st);
1763 lval->sym = sym;
1764 lval->ident = sym->ident;
1765 lval->tag = sym->tag;
1766 if (sym->ident == iARRAY || sym->ident == iREFARRAY)
1767 {
1768 address(sym); /* get starting address in primary register */
1769 return FALSE; /* return 0 for array (not lvalue) */
1770 }
1771 else
1772 {
1773 return TRUE; /* return 1 if lvalue (not function or array) */
1774 } /* if */
1775 } /* if */
1776 }
1777 else
1778 {
1779 return error(17, st); /* undefined symbol */
1780 } /* endif */
1781 assert(sym != NULL);
1782 assert(sym->ident == iFUNCTN || sym->ident != iREFFUNC);
1783 lval->sym = sym;
1784 lval->ident = sym->ident;
1785 lval->tag = sym->tag;
1786 return FALSE; /* return 0 for function (not an lvalue) */
1787 } /* if */
1788 lexpush(); /* push the token, it is analyzed by constant() */
1789 if (constant(lval) == 0)
1790 {
1791 error(29); /* expression error, assumed 0 */
1792 const1(0); /* load 0 */
1793 } /* if */
1794 return FALSE; /* return 0 for constants (or errors) */
1795}
1796
1797static void
1798clear_value(value * lval)
1799{
1800 lval->sym = NULL;
1801 lval->constval = 0L;
1802 lval->tag = 0;
1803 lval->ident = 0;
1804 lval->boolresult = FALSE;
1805 /* do not clear lval->arrayidx, it is preset in hier14() */
1806}
1807
1808static void
1809setdefarray(cell * string, cell size, cell array_sz, cell * dataaddr,
1810 int fconst)
1811{
1812 /* The routine must copy the default array data onto the heap, as to avoid
1813 * that a function can change the default value. An optimization is that
1814 * the default array data is "dumped" into the data segment only once (on the
1815 * first use).
1816 */
1817 assert(string != NULL);
1818 assert(size > 0);
1819 /* check whether to dump the default array */
1820 assert(dataaddr != NULL);
1821 if (sc_status == statWRITE && *dataaddr < 0)
1822 {
1823 int i;
1824
1825 *dataaddr = (litidx + glb_declared) * sizeof(cell);
1826 for (i = 0; i < size; i++)
1827 stowlit(*string++);
1828 } /* if */
1829
1830 /* if the function is known not to modify the array (meaning that it also
1831 * does not modify the default value), directly pass the address of the
1832 * array in the data segment.
1833 */
1834 if (fconst)
1835 {
1836 const1(*dataaddr);
1837 }
1838 else
1839 {
1840 /* Generate the code:
1841 * CONST.pri dataaddr ;address of the default array data
1842 * HEAP array_sz*sizeof(cell) ;heap address in ALT
1843 * MOVS size*sizeof(cell) ;copy data from PRI to ALT
1844 * MOVE.PRI ;PRI = address on the heap
1845 */
1846 const1(*dataaddr);
1847 /* "array_sz" is the size of the argument (the value between the brackets
1848 * in the declaration), "size" is the size of the default array data.
1849 */
1850 assert(array_sz >= size);
1851 modheap((int)array_sz * sizeof(cell));
1852 /* ??? should perhaps fill with zeros first */
1853 memcopy(size * sizeof(cell));
1854 moveto1();
1855 } /* if */
1856}
1857
1858static int
1859findnamedarg(arginfo * arg, char *name)
1860{
1861 int i;
1862
1863 for (i = 0; arg[i].ident != 0 && arg[i].ident != iVARARGS; i++)
1864 if (strcmp(arg[i].name, name) == 0)
1865 return i;
1866 return -1;
1867}
1868
1869static int
1870checktag(int tags[], int numtags, int exprtag)
1871{
1872 int i;
1873
1874 assert(tags != 0);
1875 assert(numtags > 0);
1876 for (i = 0; i < numtags; i++)
1877 if (matchtag(tags[i], exprtag, TRUE))
1878 return TRUE; /* matching tag */
1879 return FALSE; /* no tag matched */
1880}
1881
1882enum
1883{
1884 ARG_UNHANDLED,
1885 ARG_IGNORED,
1886 ARG_DONE,
1887};
1888
1889/* callfunction
1890 *
1891 * Generates code to call a function. This routine handles default arguments
1892 * and positional as well as named parameters.
1893 */
1894static void
1895callfunction(symbol * sym)
1896{
1897 int close, lvalue;
1898 int argpos; /* index in the output stream (argpos==nargs if positional parameters) */
1899 int argidx = 0; /* index in "arginfo" list */
1900 int nargs = 0; /* number of arguments */
1901 int heapalloc = 0;
1902 int namedparams = FALSE;
1903 value lval = { NULL, 0, 0, 0, 0, NULL };
1904 arginfo *arg;
1905 char arglist[sMAXARGS];
1906 constvalue arrayszlst = { NULL, "", 0, 0 }; /* array size list starts empty */
1907 cell lexval;
1908 char *lexstr;
1909
1910 assert(sym != NULL);
1911 arg = sym->dim.arglist;
1912 assert(arg != NULL);
1913 stgmark(sSTARTREORDER);
1914 for (argpos = 0; argpos < sMAXARGS; argpos++)
1915 arglist[argpos] = ARG_UNHANDLED;
1916 if (!matchtoken(')'))
1917 {
1918 do
1919 {
1920 if (matchtoken('.'))
1921 {
1922 namedparams = TRUE;
1923 if (needtoken(tSYMBOL))
1924 tokeninfo(&lexval, &lexstr);
1925 else
1926 lexstr = "";
1927 argpos = findnamedarg(arg, lexstr);
1928 if (argpos < 0)
1929 {
1930 error(17, lexstr); /* undefined symbol */
1931 break; /* exit loop, argpos is invalid */
1932 } /* if */
1933 needtoken('=');
1934 argidx = argpos;
1935 }
1936 else
1937 {
1938 if (namedparams)
1939 error(44); /* positional parameters must precede named parameters */
1940 argpos = nargs;
1941 } /* if */
1942 stgmark((char)(sEXPRSTART + argpos)); /* mark beginning of new expression in stage */
1943 if (arglist[argpos] != ARG_UNHANDLED)
1944 error(58); /* argument already set */
1945 if (matchtoken('_'))
1946 {
1947 arglist[argpos] = ARG_IGNORED; /* flag argument as "present, but ignored" */
1948 if (arg[argidx].ident == 0 || arg[argidx].ident == iVARARGS)
1949 {
1950 error(202); /* argument count mismatch */
1951 }
1952 else if (!arg[argidx].hasdefault)
1953 {
1954 error(34, nargs + 1); /* argument has no default value */
1955 } /* if */
1956 if (arg[argidx].ident != 0 && arg[argidx].ident != iVARARGS)
1957 argidx++;
1958 /* The rest of the code to handle default values is at the bottom
1959 * of this routine where default values for unspecified parameters
1960 * are (also) handled. Note that above, the argument is flagged as
1961 * ARG_IGNORED.
1962 */
1963 }
1964 else
1965 {
1966 arglist[argpos] = ARG_DONE; /* flag argument as "present" */
1967 lvalue = hier14(&lval);
1968 switch (arg[argidx].ident)
1969 {
1970 case 0:
1971 error(202); /* argument count mismatch */
1972 break;
1973 case iVARARGS:
1974 /* always pass by reference */
1975 if (lval.ident == iVARIABLE || lval.ident == iREFERENCE)
1976 {
1977 assert(lval.sym != NULL);
1978 if ((lval.sym->usage & uCONST) != 0
1979 && (arg[argidx].usage & uCONST) == 0)
1980 {
1981 /* treat a "const" variable passed to a function with a non-const
1982 * "variable argument list" as a constant here */
1983 assert(lvalue);
1984 rvalue(&lval); /* get value in PRI */
1985 setheap_pri(); /* address of the value on the heap in PRI */
1986 heapalloc++;
1987 }
1988 else if (lvalue)
1989 {
1990 address(lval.sym);
1991 }
1992 else
1993 {
1994 setheap_pri(); /* address of the value on the heap in PRI */
1995 heapalloc++;
1996 } /* if */
1997 }
1998 else if (lval.ident == iCONSTEXPR
1999 || lval.ident == iEXPRESSION
2000 || lval.ident == iARRAYCHAR)
2001 {
2002 /* fetch value if needed */
2003 if (lval.ident == iARRAYCHAR)
2004 rvalue(&lval);
2005 /* allocate a cell on the heap and store the
2006 * value (already in PRI) there */
2007 setheap_pri(); /* address of the value on the heap in PRI */
2008 heapalloc++;
2009 } /* if */
2010 /* ??? handle const array passed by reference */
2011 /* otherwise, the address is already in PRI */
2012 if (lval.sym)
2013 markusage(lval.sym, uWRITTEN);
2014/*
2015 * Dont need this warning - its varargs. there is no way of knowing the
2016 * required tag/type...
2017 *
2018 if (!checktag(arg[argidx].tags,arg[argidx].numtags,lval.tag))
2019 error(213);
2020 */
2021 break;
2022 case iVARIABLE:
2023 if (lval.ident == iLABEL || lval.ident == iFUNCTN
2024 || lval.ident == iREFFUNC || lval.ident == iARRAY
2025 || lval.ident == iREFARRAY)
2026 error(35, argidx + 1); /* argument type mismatch */
2027 if (lvalue)
2028 rvalue(&lval); /* get value (direct or indirect) */
2029 /* otherwise, the expression result is already in PRI */
2030 assert(arg[argidx].numtags > 0);
2031 check_userop(NULL, lval.tag, arg[argidx].tags[0], 2,
2032 NULL, &lval.tag);
2033 if (!checktag
2034 (arg[argidx].tags, arg[argidx].numtags, lval.tag))
2035 error(213);
2036 argidx++; /* argument done */
2037 break;
2038 case iREFERENCE:
2039 if (!lvalue || lval.ident == iARRAYCHAR)
2040 error(35, argidx + 1); /* argument type mismatch */
2041 if (lval.sym && (lval.sym->usage & uCONST) != 0
2042 && (arg[argidx].usage & uCONST) == 0)
2043 error(35, argidx + 1); /* argument type mismatch */
2044 if (lval.ident == iVARIABLE || lval.ident == iREFERENCE)
2045 {
2046 if (lvalue)
2047 {
2048 assert(lval.sym != NULL);
2049 address(lval.sym);
2050 }
2051 else
2052 {
2053 setheap_pri(); /* address of the value on the heap in PRI */
2054 heapalloc++;
2055 } /* if */
2056 } /* if */
2057 /* otherwise, the address is already in PRI */
2058 if (!checktag
2059 (arg[argidx].tags, arg[argidx].numtags, lval.tag))
2060 error(213);
2061 argidx++; /* argument done */
2062 if (lval.sym)
2063 markusage(lval.sym, uWRITTEN);
2064 break;
2065 case iREFARRAY:
2066 if (lval.ident != iARRAY && lval.ident != iREFARRAY
2067 && lval.ident != iARRAYCELL)
2068 {
2069 error(35, argidx + 1); /* argument type mismatch */
2070 break;
2071 } /* if */
2072 if (lval.sym && (lval.sym->usage & uCONST) != 0
2073 && (arg[argidx].usage & uCONST) == 0)
2074 error(35, argidx + 1); /* argument type mismatch */
2075 /* Verify that the dimensions match with those in arg[argidx].
2076 * A literal array always has a single dimension.
2077 * An iARRAYCELL parameter is also assumed to have a single dimension.
2078 */
2079 if (!lval.sym || lval.ident == iARRAYCELL)
2080 {
2081 if (arg[argidx].numdim != 1)
2082 {
2083 error(48); /* array dimensions must match */
2084 }
2085 else if (arg[argidx].dim[0] != 0)
2086 {
2087 assert(arg[argidx].dim[0] > 0);
2088 if (lval.ident == iARRAYCELL)
2089 {
2090 error(47); /* array sizes must match */
2091 }
2092 else
2093 {
2094 assert(lval.constval != 0); /* literal array must have a size */
2095 /* A literal array must have exactly the same size as the
2096 * function argument; a literal string may be smaller than
2097 * the function argument.
2098 */
2099 if ((lval.constval > 0
2100 && arg[argidx].dim[0] != lval.constval)
2101 || (lval.constval < 0
2102 && arg[argidx].dim[0] <
2103 -lval.constval))
2104 error(47); /* array sizes must match */
2105 } /* if */
2106 } /* if */
2107 if (lval.ident != iARRAYCELL)
2108 {
2109 /* save array size, for default values with uSIZEOF flag */
2110 cell array_sz = lval.constval;
2111
2112 assert(array_sz != 0); /* literal array must have a size */
2113 if (array_sz < 0)
2114 array_sz = -array_sz;
2115 append_constval(&arrayszlst, arg[argidx].name,
2116 array_sz, 0);
2117 } /* if */
2118 }
2119 else
2120 {
2121 symbol *sym = lval.sym;
2122 short level = 0;
2123
2124 assert(sym != NULL);
2125 if (sym->dim.array.level + 1 != arg[argidx].numdim)
2126 error(48); /* array dimensions must match */
2127 /* the lengths for all dimensions must match, unless the dimension
2128 * length was defined at zero (which means "undefined")
2129 */
2130 while (sym->dim.array.level > 0)
2131 {
2132 assert(level < sDIMEN_MAX);
2133 if (arg[argidx].dim[level] != 0
2134 && sym->dim.array.length !=
2135 arg[argidx].dim[level])
2136 error(47); /* array sizes must match */
2137 append_constval(&arrayszlst, arg[argidx].name,
2138 sym->dim.array.length, level);
2139 sym = finddepend(sym);
2140 assert(sym != NULL);
2141 level++;
2142 } /* if */
2143 /* the last dimension is checked too, again, unless it is zero */
2144 assert(level < sDIMEN_MAX);
2145 assert(sym != NULL);
2146 if (arg[argidx].dim[level] != 0
2147 && sym->dim.array.length !=
2148 arg[argidx].dim[level])
2149 error(47); /* array sizes must match */
2150 append_constval(&arrayszlst, arg[argidx].name,
2151 sym->dim.array.length, level);
2152 } /* if */
2153 /* address already in PRI */
2154 if (!checktag
2155 (arg[argidx].tags, arg[argidx].numtags, lval.tag))
2156 error(213);
2157 // ??? set uWRITTEN?
2158 argidx++; /* argument done */
2159 break;
2160 } /* switch */
2161 push1(); /* store the function argument on the stack */
2162 endexpr(FALSE); /* mark the end of a sub-expression */
2163 } /* if */
2164 assert(arglist[argpos] != ARG_UNHANDLED);
2165 nargs++;
2166 close = matchtoken(')');
2167 if (!close) /* if not paranthese... */
2168 if (!needtoken(',')) /* ...should be comma... */
2169 break; /* ...but abort loop if neither */
2170 }
2171 while (!close && freading && !matchtoken(tENDEXPR)); /* do */
2172 } /* if */
2173 /* check remaining function arguments (they may have default values) */
2174 for (argidx = 0; arg[argidx].ident != 0 && arg[argidx].ident != iVARARGS;
2175 argidx++)
2176 {
2177 if (arglist[argidx] == ARG_DONE)
2178 continue; /* already seen and handled this argument */
2179 /* in this first stage, we also skip the arguments with uSIZEOF and uTAGOF;
2180 * these are handled last
2181 */
2182 if ((arg[argidx].hasdefault & uSIZEOF) != 0
2183 || (arg[argidx].hasdefault & uTAGOF) != 0)
2184 {
2185 assert(arg[argidx].ident == iVARIABLE);
2186 continue;
2187 } /* if */
2188 stgmark((char)(sEXPRSTART + argidx)); /* mark beginning of new expression in stage */
2189 if (arg[argidx].hasdefault)
2190 {
2191 if (arg[argidx].ident == iREFARRAY)
2192 {
2193 short level;
2194
2195 setdefarray(arg[argidx].defvalue.array.data,
2196 arg[argidx].defvalue.array.size,
2197 arg[argidx].defvalue.array.arraysize,
2198 &arg[argidx].defvalue.array.addr,
2199 (arg[argidx].usage & uCONST) != 0);
2200 if ((arg[argidx].usage & uCONST) == 0)
2201 heapalloc += arg[argidx].defvalue.array.arraysize;
2202 /* keep the lengths of all dimensions of a multi-dimensional default array */
2203 assert(arg[argidx].numdim > 0);
2204 if (arg[argidx].numdim == 1)
2205 {
2206 append_constval(&arrayszlst, arg[argidx].name,
2207 arg[argidx].defvalue.array.arraysize, 0);
2208 }
2209 else
2210 {
2211 for (level = 0; level < arg[argidx].numdim; level++)
2212 {
2213 assert(level < sDIMEN_MAX);
2214 append_constval(&arrayszlst, arg[argidx].name,
2215 arg[argidx].dim[level], level);
2216 } /* for */
2217 } /* if */
2218 }
2219 else if (arg[argidx].ident == iREFERENCE)
2220 {
2221 setheap(arg[argidx].defvalue.val);
2222 /* address of the value on the heap in PRI */
2223 heapalloc++;
2224 }
2225 else
2226 {
2227 int dummytag = arg[argidx].tags[0];
2228
2229 const1(arg[argidx].defvalue.val);
2230 assert(arg[argidx].numtags > 0);
2231 check_userop(NULL, arg[argidx].defvalue_tag,
2232 arg[argidx].tags[0], 2, NULL, &dummytag);
2233 assert(dummytag == arg[argidx].tags[0]);
2234 } /* if */
2235 push1(); /* store the function argument on the stack */
2236 endexpr(FALSE); /* mark the end of a sub-expression */
2237 }
2238 else
2239 {
2240 error(202, argidx); /* argument count mismatch */
2241 } /* if */
2242 if (arglist[argidx] == ARG_UNHANDLED)
2243 nargs++;
2244 arglist[argidx] = ARG_DONE;
2245 } /* for */
2246 /* now a second loop to catch the arguments with default values that are
2247 * the "sizeof" or "tagof" of other arguments
2248 */
2249 for (argidx = 0; arg[argidx].ident != 0 && arg[argidx].ident != iVARARGS;
2250 argidx++)
2251 {
2252 constvalue *asz;
2253 cell array_sz;
2254
2255 if (arglist[argidx] == ARG_DONE)
2256 continue; /* already seen and handled this argument */
2257 stgmark((char)(sEXPRSTART + argidx)); /* mark beginning of new expression in stage */
2258 assert(arg[argidx].ident == iVARIABLE); /* if "sizeof", must be single cell */
2259 /* if unseen, must be "sizeof" or "tagof" */
2260 assert((arg[argidx].hasdefault & uSIZEOF) != 0
2261 || (arg[argidx].hasdefault & uTAGOF) != 0);
2262 if ((arg[argidx].hasdefault & uSIZEOF) != 0)
2263 {
2264 /* find the argument; if it isn't found, the argument's default value
2265 * was a "sizeof" of a non-array (a warning for this was already given
2266 * when declaring the function)
2267 */
2268 asz = find_constval(&arrayszlst, arg[argidx].defvalue.size.symname,
2269 arg[argidx].defvalue.size.level);
2270 if (asz)
2271 {
2272 array_sz = asz->value;
2273 if (array_sz == 0)
2274 error(224, arg[argidx].name); /* indeterminate array size in "sizeof" expression */
2275 }
2276 else
2277 {
2278 array_sz = 1;
2279 } /* if */
2280 }
2281 else
2282 {
2283 symbol *sym;
2284
2285 assert((arg[argidx].hasdefault & uTAGOF) != 0);
2286 sym = findloc(arg[argidx].defvalue.size.symname);
2287 if (!sym)
2288 sym = findglb(arg[argidx].defvalue.size.symname);
2289 array_sz = (sym) ? sym->tag : 0;
2290 exporttag(array_sz);
2291 } /* if */
2292 const1(array_sz);
2293 push1(); /* store the function argument on the stack */
2294 endexpr(FALSE);
2295 if (arglist[argidx] == ARG_UNHANDLED)
2296 nargs++;
2297 arglist[argidx] = ARG_DONE;
2298 } /* for */
2299 stgmark(sENDREORDER); /* mark end of reversed evaluation */
2300 pushval((cell) nargs * sizeof(cell));
2301 ffcall(sym, nargs);
2302 if (sc_status != statSKIP)
2303 markusage(sym, uREAD); /* do not mark as "used" when this call itself is skipped */
2304 if (sym->x.lib)
2305 sym->x.lib->value += 1; /* increment "usage count" of the library */
2306 modheap(-heapalloc * sizeof(cell));
2307 sideeffect = TRUE; /* assume functions carry out a side-effect */
2308 delete_consttable(&arrayszlst); /* clear list of array sizes */
2309}
2310
2311/* dbltest
2312 *
2313 * Returns a non-zero value if lval1 an array and lval2 is not an array and
2314 * the operation is addition or subtraction.
2315 *
2316 * Returns the "shift" count (1 for 16-bit, 2 for 32-bit) to align a cell
2317 * to an array offset.
2318 */
2319static int
2320dbltest(void (*oper) (), value * lval1, value * lval2)
2321{
2322 if ((oper != ob_add) && (oper != ob_sub))
2323 return 0;
2324 if (lval1->ident != iARRAY)
2325 return 0;
2326 if (lval2->ident == iARRAY)
2327 return 0;
2328 return sizeof(cell) / 2; /* 1 for 16-bit, 2 for 32-bit */
2329}
2330
2331/* commutative
2332 *
2333 * Test whether an operator is commutative, i.e. x oper y == y oper x.
2334 * Commutative operators are: + (addition)
2335 * * (multiplication)
2336 * == (equality)
2337 * != (inequality)
2338 * & (bitwise and)
2339 * ^ (bitwise xor)
2340 * | (bitwise or)
2341 *
2342 * If in an expression, code for the left operand has been generated and
2343 * the right operand is a constant and the operator is commutative, the
2344 * precautionary "push" of the primary register is scrapped and the constant
2345 * is read into the secondary register immediately.
2346 */
2347static int
2348commutative(void (*oper) ())
2349{
2350 return oper == ob_add || oper == os_mult
2351 || oper == ob_eq || oper == ob_ne
2352 || oper == ob_and || oper == ob_xor || oper == ob_or;
2353}
2354
2355/* constant
2356 *
2357 * Generates code to fetch a number, a literal character (which is returned
2358 * by lex() as a number as well) or a literal string (lex() stores the
2359 * strings in the literal queue). If the operand was a number, it is stored
2360 * in lval->constval.
2361 *
2362 * The function returns 1 if the token was a constant or a string, 0
2363 * otherwise.
2364 */
2365static int
2366constant(value * lval)
2367{
2368 int tok, index, constant;
2369 cell val, item, cidx;
2370 char *st;
2371 symbol *sym;
2372
2373 tok = lex(&val, &st);
2374 if (tok == tSYMBOL && (sym = findconst(st)))
2375 {
2376 lval->constval = sym->addr;
2377 const1(lval->constval);
2378 lval->ident = iCONSTEXPR;
2379 lval->tag = sym->tag;
2380 markusage(sym, uREAD);
2381 }
2382 else if (tok == tNUMBER)
2383 {
2384 lval->constval = val;
2385 const1(lval->constval);
2386 lval->ident = iCONSTEXPR;
2387 }
2388 else if (tok == tRATIONAL)
2389 {
2390 lval->constval = val;
2391 const1(lval->constval);
2392 lval->ident = iCONSTEXPR;
2393 lval->tag = sc_rationaltag;
2394 }
2395 else if (tok == tSTRING)
2396 {
2397 /* lex() stores starting index of string in the literal table in 'val' */
2398 const1((val + glb_declared) * sizeof(cell));
2399 lval->ident = iARRAY; /* pretend this is a global array */
2400 lval->constval = val - litidx; /* constval == the negative value of the
2401 * size of the literal array; using a negative
2402 * value distinguishes between literal arrays
2403 * and literal strings (this was done for
2404 * array assignment). */
2405 }
2406 else if (tok == '{')
2407 {
2408 int tag, lasttag = -1;
2409
2410 val = litidx;
2411 do
2412 {
2413 /* cannot call constexpr() here, because "staging" is already turned
2414 * on at this point */
2415 assert(staging);
2416 stgget(&index, &cidx); /* mark position in code generator */
2417 expression(&constant, &item, &tag, FALSE);
2418 stgdel(index, cidx); /* scratch generated code */
2419 if (constant == 0)
2420 error(8); /* must be constant expression */
2421 if (lasttag < 0)
2422 lasttag = tag;
2423 else if (!matchtag(lasttag, tag, FALSE))
2424 error(213); /* tagname mismatch */
2425 stowlit(item); /* store expression result in literal table */
2426 }
2427 while (matchtoken(','));
2428 needtoken('}');
2429 const1((val + glb_declared) * sizeof(cell));
2430 lval->ident = iARRAY; /* pretend this is a global array */
2431 lval->constval = litidx - val; /* constval == the size of the literal array */
2432 }
2433 else
2434 {
2435 return FALSE; /* no, it cannot be interpreted as a constant */
2436 } /* if */
2437 return TRUE; /* yes, it was a constant value */
2438}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc4.c b/libraries/embryo/src/bin/embryo_cc_sc4.c
new file mode 100644
index 0000000..0dedbfb
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc4.c
@@ -0,0 +1,1308 @@
1/* Small compiler - code generation (unoptimized "assembler" code)
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_sc4.c 52451 2010-09-19 03:00:12Z raster $
22 */
23
24
25#ifdef HAVE_CONFIG_H
26# include <config.h>
27#endif
28
29#include <assert.h>
30#include <ctype.h>
31#include <stdio.h>
32#include <limits.h> /* for PATH_MAX */
33#include <string.h>
34
35#include "embryo_cc_sc.h"
36
37/* When a subroutine returns to address 0, the AMX must halt. In earlier
38 * releases, the RET and RETN opcodes checked for the special case 0 address.
39 * Today, the compiler simply generates a HALT instruction at address 0. So
40 * a subroutine can savely return to 0, and then encounter a HALT.
41 */
42void
43writeleader(void)
44{
45 assert(code_idx == 0);
46 stgwrite(";program exit point\n");
47 stgwrite("\thalt 0\n");
48 /* calculate code length */
49 code_idx += opcodes(1) + opargs(1);
50}
51
52/* writetrailer
53 * Not much left of this once important function.
54 *
55 * Global references: sc_stksize (referred to only)
56 * sc_dataalign (referred to only)
57 * code_idx (altered)
58 * glb_declared (altered)
59 */
60void
61writetrailer(void)
62{
63 assert(sc_dataalign % opcodes(1) == 0); /* alignment must be a multiple of
64 * the opcode size */
65 assert(sc_dataalign != 0);
66
67 /* pad code to align data segment */
68 if ((code_idx % sc_dataalign) != 0)
69 {
70 begcseg();
71 while ((code_idx % sc_dataalign) != 0)
72 nooperation();
73 } /* if */
74
75 /* pad data segment to align the stack and the heap */
76 assert(litidx == 0); /* literal queue should have been emptied */
77 assert(sc_dataalign % sizeof(cell) == 0);
78 if (((glb_declared * sizeof(cell)) % sc_dataalign) != 0)
79 {
80 begdseg();
81 defstorage();
82 while (((glb_declared * sizeof(cell)) % sc_dataalign) != 0)
83 {
84 stgwrite("0 ");
85 glb_declared++;
86 } /* while */
87 } /* if */
88
89 stgwrite("\nSTKSIZE "); /* write stack size (align stack top) */
90 outval(sc_stksize - (sc_stksize % sc_dataalign), TRUE);
91}
92
93/*
94 * Start (or restart) the CODE segment.
95 *
96 * In fact, the code and data segment specifiers are purely informational;
97 * the "DUMP" instruction itself already specifies that the following values
98 * should go to the data segment. All otherinstructions go to the code
99 * segment.
100 *
101 * Global references: curseg
102 */
103void
104begcseg(void)
105{
106 if (curseg != sIN_CSEG)
107 {
108 stgwrite("\n");
109 stgwrite("CODE\t; ");
110 outval(code_idx, TRUE);
111 curseg = sIN_CSEG;
112 } /* endif */
113}
114
115/*
116 * Start (or restart) the DATA segment.
117 *
118 * Global references: curseg
119 */
120void
121begdseg(void)
122{
123 if (curseg != sIN_DSEG)
124 {
125 stgwrite("\n");
126 stgwrite("DATA\t; ");
127 outval(glb_declared - litidx, TRUE);
128 curseg = sIN_DSEG;
129 } /* if */
130}
131
132void
133setactivefile(int fnumber)
134{
135 stgwrite("curfile ");
136 outval(fnumber, TRUE);
137}
138
139cell
140nameincells(char *name)
141{
142 cell clen =
143 (strlen(name) + sizeof(cell)) & ~(sizeof(cell) - 1);
144 return clen;
145}
146
147void
148setfile(char *name, int fileno)
149{
150 if ((sc_debug & sSYMBOLIC) != 0)
151 {
152 begcseg();
153 stgwrite("file ");
154 outval(fileno, FALSE);
155 stgwrite(" ");
156 stgwrite(name);
157 stgwrite("\n");
158 /* calculate code length */
159 code_idx += opcodes(1) + opargs(2) + nameincells(name);
160 } /* if */
161}
162
163void
164setline(int line, int fileno)
165{
166 if ((sc_debug & (sSYMBOLIC | sCHKBOUNDS)) != 0)
167 {
168 stgwrite("line ");
169 outval(line, FALSE);
170 stgwrite(" ");
171 outval(fileno, FALSE);
172 stgwrite("\t; ");
173 outval(code_idx, TRUE);
174 code_idx += opcodes(1) + opargs(2);
175 } /* if */
176}
177
178/* setlabel
179 *
180 * Post a code label (specified as a number), on a new line.
181 */
182void
183setlabel(int number)
184{
185 assert(number >= 0);
186 stgwrite("l.");
187 stgwrite((char *)itoh(number));
188 /* To assist verification of the assembled code, put the address of the
189 * label as a comment. However, labels that occur inside an expression
190 * may move (through optimization or through re-ordering). So write the
191 * address only if it is known to accurate.
192 */
193 if (!staging)
194 {
195 stgwrite("\t\t; ");
196 outval(code_idx, FALSE);
197 } /* if */
198 stgwrite("\n");
199}
200
201/* Write a token that signifies the end of an expression, or the end of a
202 * function parameter. This allows several simple optimizations by the peephole
203 * optimizer.
204 */
205void
206endexpr(int fullexpr)
207{
208 if (fullexpr)
209 stgwrite("\t;$exp\n");
210 else
211 stgwrite("\t;$par\n");
212}
213
214/* startfunc - declare a CODE entry point (function start)
215 *
216 * Global references: funcstatus (referred to only)
217 */
218void
219startfunc(char *fname __UNUSED__)
220{
221 stgwrite("\tproc");
222 stgwrite("\n");
223 code_idx += opcodes(1);
224}
225
226/* endfunc
227 *
228 * Declare a CODE ending point (function end)
229 */
230void
231endfunc(void)
232{
233 stgwrite("\n"); /* skip a line */
234}
235
236/* alignframe
237 *
238 * Aligns the frame (and the stack) of the current function to a multiple
239 * of the specified byte count. Two caveats: the alignment ("numbytes") should
240 * be a power of 2, and this alignment must be done right after the frame
241 * is set up (before the first variable is declared)
242 */
243void
244alignframe(int numbytes)
245{
246#if !defined NDEBUG
247 /* "numbytes" should be a power of 2 for this code to work */
248 int i, count = 0;
249
250 for (i = 0; i < (int)(sizeof(numbytes) * 8); i++)
251 if (numbytes & (1 << i))
252 count++;
253 assert(count == 1);
254#endif
255
256 stgwrite("\tlctrl 4\n"); /* get STK in PRI */
257 stgwrite("\tconst.alt "); /* get ~(numbytes-1) in ALT */
258 outval(~(numbytes - 1), TRUE);
259 stgwrite("\tand\n"); /* PRI = STK "and" ~(numbytes-1) */
260 stgwrite("\tsctrl 4\n"); /* set the new value of STK ... */
261 stgwrite("\tsctrl 5\n"); /* ... and FRM */
262 code_idx += opcodes(5) + opargs(4);
263}
264
265/* Define a variable or function
266 */
267void
268defsymbol(char *name, int ident, int vclass, cell offset, int tag)
269{
270 if ((sc_debug & sSYMBOLIC) != 0)
271 {
272 begcseg(); /* symbol definition in code segment */
273 stgwrite("symbol ");
274
275 stgwrite(name);
276 stgwrite(" ");
277
278 outval(offset, FALSE);
279 stgwrite(" ");
280
281 outval(vclass, FALSE);
282 stgwrite(" ");
283
284 outval(ident, TRUE);
285
286 code_idx += opcodes(1) + opargs(3) + nameincells(name); /* class and ident encoded in "flags" */
287
288 /* also write the optional tag */
289 if (tag != 0)
290 {
291 assert((tag & TAGMASK) != 0);
292 stgwrite("symtag ");
293 outval(tag & TAGMASK, TRUE);
294 code_idx += opcodes(1) + opargs(1);
295 } /* if */
296 } /* if */
297}
298
299void
300symbolrange(int level, cell size)
301{
302 if ((sc_debug & sSYMBOLIC) != 0)
303 {
304 begcseg(); /* symbol definition in code segment */
305 stgwrite("srange ");
306 outval(level, FALSE);
307 stgwrite(" ");
308 outval(size, TRUE);
309 code_idx += opcodes(1) + opargs(2);
310 } /* if */
311}
312
313/* rvalue
314 *
315 * Generate code to get the value of a symbol into "primary".
316 */
317void
318rvalue(value * lval)
319{
320 symbol *sym;
321
322 sym = lval->sym;
323 if (lval->ident == iARRAYCELL)
324 {
325 /* indirect fetch, address already in PRI */
326 stgwrite("\tload.i\n");
327 code_idx += opcodes(1);
328 }
329 else if (lval->ident == iARRAYCHAR)
330 {
331 /* indirect fetch of a character from a pack, address already in PRI */
332 stgwrite("\tlodb.i ");
333 outval(charbits / 8, TRUE); /* read one or two bytes */
334 code_idx += opcodes(1) + opargs(1);
335 }
336 else if (lval->ident == iREFERENCE)
337 {
338 /* indirect fetch, but address not yet in PRI */
339 assert(sym != NULL);
340 assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
341 if (sym->vclass == sLOCAL)
342 stgwrite("\tlref.s.pri ");
343 else
344 stgwrite("\tlref.pri ");
345 outval(sym->addr, TRUE);
346 markusage(sym, uREAD);
347 code_idx += opcodes(1) + opargs(1);
348 }
349 else
350 {
351 /* direct or stack relative fetch */
352 assert(sym != NULL);
353 if (sym->vclass == sLOCAL)
354 stgwrite("\tload.s.pri ");
355 else
356 stgwrite("\tload.pri ");
357 outval(sym->addr, TRUE);
358 markusage(sym, uREAD);
359 code_idx += opcodes(1) + opargs(1);
360 } /* if */
361}
362
363/*
364 * Get the address of a symbol into the primary register (used for arrays,
365 * and for passing arguments by reference).
366 */
367void
368address(symbol * sym)
369{
370 assert(sym != NULL);
371 /* the symbol can be a local array, a global array, or an array
372 * that is passed by reference.
373 */
374 if (sym->ident == iREFARRAY || sym->ident == iREFERENCE)
375 {
376 /* reference to a variable or to an array; currently this is
377 * always a local variable */
378 stgwrite("\tload.s.pri ");
379 }
380 else
381 {
382 /* a local array or local variable */
383 if (sym->vclass == sLOCAL)
384 stgwrite("\taddr.pri ");
385 else
386 stgwrite("\tconst.pri ");
387 } /* if */
388 outval(sym->addr, TRUE);
389 markusage(sym, uREAD);
390 code_idx += opcodes(1) + opargs(1);
391}
392
393/* store
394 *
395 * Saves the contents of "primary" into a memory cell, either directly
396 * or indirectly (at the address given in the alternate register).
397 */
398void
399store(value * lval)
400{
401 symbol *sym;
402
403 sym = lval->sym;
404 if (lval->ident == iARRAYCELL)
405 {
406 /* store at address in ALT */
407 stgwrite("\tstor.i\n");
408 code_idx += opcodes(1);
409 }
410 else if (lval->ident == iARRAYCHAR)
411 {
412 /* store at address in ALT */
413 stgwrite("\tstrb.i ");
414 outval(charbits / 8, TRUE); /* write one or two bytes */
415 code_idx += opcodes(1) + opargs(1);
416 }
417 else if (lval->ident == iREFERENCE)
418 {
419 assert(sym != NULL);
420 if (sym->vclass == sLOCAL)
421 stgwrite("\tsref.s.pri ");
422 else
423 stgwrite("\tsref.pri ");
424 outval(sym->addr, TRUE);
425 code_idx += opcodes(1) + opargs(1);
426 }
427 else
428 {
429 assert(sym != NULL);
430 markusage(sym, uWRITTEN);
431 if (sym->vclass == sLOCAL)
432 stgwrite("\tstor.s.pri ");
433 else
434 stgwrite("\tstor.pri ");
435 outval(sym->addr, TRUE);
436 code_idx += opcodes(1) + opargs(1);
437 } /* if */
438}
439
440/* source must in PRI, destination address in ALT. The "size"
441 * parameter is in bytes, not cells.
442 */
443void
444memcopy(cell size)
445{
446 stgwrite("\tmovs ");
447 outval(size, TRUE);
448
449 code_idx += opcodes(1) + opargs(1);
450}
451
452/* Address of the source must already have been loaded in PRI
453 * "size" is the size in bytes (not cells).
454 */
455void
456copyarray(symbol * sym, cell size)
457{
458 assert(sym != NULL);
459 /* the symbol can be a local array, a global array, or an array
460 * that is passed by reference.
461 */
462 if (sym->ident == iREFARRAY)
463 {
464 /* reference to an array; currently this is always a local variable */
465 assert(sym->vclass == sLOCAL); /* symbol must be stack relative */
466 stgwrite("\tload.s.alt ");
467 }
468 else
469 {
470 /* a local or global array */
471 if (sym->vclass == sLOCAL)
472 stgwrite("\taddr.alt ");
473 else
474 stgwrite("\tconst.alt ");
475 } /* if */
476 outval(sym->addr, TRUE);
477 markusage(sym, uWRITTEN);
478
479 code_idx += opcodes(1) + opargs(1);
480 memcopy(size);
481}
482
483void
484fillarray(symbol * sym, cell size, cell val)
485{
486 const1(val); /* load val in PRI */
487
488 assert(sym != NULL);
489 /* the symbol can be a local array, a global array, or an array
490 * that is passed by reference.
491 */
492 if (sym->ident == iREFARRAY)
493 {
494 /* reference to an array; currently this is always a local variable */
495 assert(sym->vclass == sLOCAL); /* symbol must be stack relative */
496 stgwrite("\tload.s.alt ");
497 }
498 else
499 {
500 /* a local or global array */
501 if (sym->vclass == sLOCAL)
502 stgwrite("\taddr.alt ");
503 else
504 stgwrite("\tconst.alt ");
505 } /* if */
506 outval(sym->addr, TRUE);
507 markusage(sym, uWRITTEN);
508
509 stgwrite("\tfill ");
510 outval(size, TRUE);
511
512 code_idx += opcodes(2) + opargs(2);
513}
514
515/*
516 * Instruction to get an immediate value into the primary register
517 */
518void
519const1(cell val)
520{
521 if (val == 0)
522 {
523 stgwrite("\tzero.pri\n");
524 code_idx += opcodes(1);
525 }
526 else
527 {
528 stgwrite("\tconst.pri ");
529 outval(val, TRUE);
530 code_idx += opcodes(1) + opargs(1);
531 } /* if */
532}
533
534/*
535 * Instruction to get an immediate value into the secondary register
536 */
537void
538const2(cell val)
539{
540 if (val == 0)
541 {
542 stgwrite("\tzero.alt\n");
543 code_idx += opcodes(1);
544 }
545 else
546 {
547 stgwrite("\tconst.alt ");
548 outval(val, TRUE);
549 code_idx += opcodes(1) + opargs(1);
550 } /* if */
551}
552
553/* Copy value in secondary register to the primary register */
554void
555moveto1(void)
556{
557 stgwrite("\tmove.pri\n");
558 code_idx += opcodes(1) + opargs(0);
559}
560
561/*
562 * Push primary register onto the stack
563 */
564void
565push1(void)
566{
567 stgwrite("\tpush.pri\n");
568 code_idx += opcodes(1);
569}
570
571/*
572 * Push alternate register onto the stack
573 */
574void
575push2(void)
576{
577 stgwrite("\tpush.alt\n");
578 code_idx += opcodes(1);
579}
580
581/*
582 * Push a constant value onto the stack
583 */
584void
585pushval(cell val)
586{
587 stgwrite("\tpush.c ");
588 outval(val, TRUE);
589 code_idx += opcodes(1) + opargs(1);
590}
591
592/*
593 * pop stack to the primary register
594 */
595void
596pop1(void)
597{
598 stgwrite("\tpop.pri\n");
599 code_idx += opcodes(1);
600}
601
602/*
603 * pop stack to the secondary register
604 */
605void
606pop2(void)
607{
608 stgwrite("\tpop.alt\n");
609 code_idx += opcodes(1);
610}
611
612/*
613 * swap the top-of-stack with the value in primary register
614 */
615void
616swap1(void)
617{
618 stgwrite("\tswap.pri\n");
619 code_idx += opcodes(1);
620}
621
622/* Switch statements
623 * The "switch" statement generates a "case" table using the "CASE" opcode.
624 * The case table contains a list of records, each record holds a comparison
625 * value and a label to branch to on a match. The very first record is an
626 * exception: it holds the size of the table (excluding the first record) and
627 * the label to branch to when none of the values in the case table match.
628 * The case table is sorted on the comparison value. This allows more advanced
629 * abstract machines to sift the case table with a binary search.
630 */
631void
632ffswitch(int label)
633{
634 stgwrite("\tswitch ");
635 outval(label, TRUE); /* the label is the address of the case table */
636 code_idx += opcodes(1) + opargs(1);
637}
638
639void
640ffcase(cell val, char *labelname, int newtable)
641{
642 if (newtable)
643 {
644 stgwrite("\tcasetbl\n");
645 code_idx += opcodes(1);
646 } /* if */
647 stgwrite("\tcase ");
648 outval(val, FALSE);
649 stgwrite(" ");
650 stgwrite(labelname);
651 stgwrite("\n");
652 code_idx += opcodes(0) + opargs(2);
653}
654
655/*
656 * Call specified function
657 */
658void
659ffcall(symbol * sym, int numargs)
660{
661 assert(sym != NULL);
662 assert(sym->ident == iFUNCTN);
663 if ((sym->usage & uNATIVE) != 0)
664 {
665 /* reserve a SYSREQ id if called for the first time */
666 if (sc_status == statWRITE && (sym->usage & uREAD) == 0
667 && sym->addr >= 0)
668 sym->addr = ntv_funcid++;
669 stgwrite("\tsysreq.c ");
670 outval(sym->addr, FALSE);
671 stgwrite("\n\tstack ");
672 outval((numargs + 1) * sizeof(cell), TRUE);
673 code_idx += opcodes(2) + opargs(2);
674 }
675 else
676 {
677 /* normal function */
678 stgwrite("\tcall ");
679 stgwrite(sym->name);
680 stgwrite("\n");
681 code_idx += opcodes(1) + opargs(1);
682 } /* if */
683}
684
685/* Return from function
686 *
687 * Global references: funcstatus (referred to only)
688 */
689void
690ffret(void)
691{
692 stgwrite("\tretn\n");
693 code_idx += opcodes(1);
694}
695
696void
697ffabort(int reason)
698{
699 stgwrite("\thalt ");
700 outval(reason, TRUE);
701 code_idx += opcodes(1) + opargs(1);
702}
703
704void
705ffbounds(cell size)
706{
707 if ((sc_debug & sCHKBOUNDS) != 0)
708 {
709 stgwrite("\tbounds ");
710 outval(size, TRUE);
711 code_idx += opcodes(1) + opargs(1);
712 } /* if */
713}
714
715/*
716 * Jump to local label number (the number is converted to a name)
717 */
718void
719jumplabel(int number)
720{
721 stgwrite("\tjump ");
722 outval(number, TRUE);
723 code_idx += opcodes(1) + opargs(1);
724}
725
726/*
727 * Define storage (global and static variables)
728 */
729void
730defstorage(void)
731{
732 stgwrite("dump ");
733}
734
735/*
736 * Inclrement/decrement stack pointer. Note that this routine does
737 * nothing if the delta is zero.
738 */
739void
740modstk(int delta)
741{
742 if (delta)
743 {
744 stgwrite("\tstack ");
745 outval(delta, TRUE);
746 code_idx += opcodes(1) + opargs(1);
747 } /* if */
748}
749
750/* set the stack to a hard offset from the frame */
751void
752setstk(cell val)
753{
754 stgwrite("\tlctrl 5\n"); /* get FRM */
755 assert(val <= 0); /* STK should always become <= FRM */
756 if (val < 0)
757 {
758 stgwrite("\tadd.c ");
759 outval(val, TRUE); /* add (negative) offset */
760 code_idx += opcodes(1) + opargs(1);
761 // ??? write zeros in the space between STK and the val in PRI (the new stk)
762 // get val of STK in ALT
763 // zero PRI
764 // need new FILL opcode that takes a variable size
765 } /* if */
766 stgwrite("\tsctrl 4\n"); /* store in STK */
767 code_idx += opcodes(2) + opargs(2);
768}
769
770void
771modheap(int delta)
772{
773 if (delta)
774 {
775 stgwrite("\theap ");
776 outval(delta, TRUE);
777 code_idx += opcodes(1) + opargs(1);
778 } /* if */
779}
780
781void
782setheap_pri(void)
783{
784 stgwrite("\theap "); /* ALT = HEA++ */
785 outval(sizeof(cell), TRUE);
786 stgwrite("\tstor.i\n"); /* store PRI (default value) at address ALT */
787 stgwrite("\tmove.pri\n"); /* move ALT to PRI: PRI contains the address */
788 code_idx += opcodes(3) + opargs(1);
789}
790
791void
792setheap(cell val)
793{
794 stgwrite("\tconst.pri "); /* load default val in PRI */
795 outval(val, TRUE);
796 code_idx += opcodes(1) + opargs(1);
797 setheap_pri();
798}
799
800/*
801 * Convert a cell number to a "byte" address; i.e. double or quadruple
802 * the primary register.
803 */
804void
805cell2addr(void)
806{
807#if defined(BIT16)
808 stgwrite("\tshl.c.pri 1\n");
809#else
810 stgwrite("\tshl.c.pri 2\n");
811#endif
812 code_idx += opcodes(1) + opargs(1);
813}
814
815/*
816 * Double or quadruple the alternate register.
817 */
818void
819cell2addr_alt(void)
820{
821#if defined(BIT16)
822 stgwrite("\tshl.c.alt 1\n");
823#else
824 stgwrite("\tshl.c.alt 2\n");
825#endif
826 code_idx += opcodes(1) + opargs(1);
827}
828
829/*
830 * Convert "distance of addresses" to "number of cells" in between.
831 * Or convert a number of packed characters to the number of cells (with
832 * truncation).
833 */
834void
835addr2cell(void)
836{
837#if defined(BIT16)
838 stgwrite("\tshr.c.pri 1\n");
839#else
840 stgwrite("\tshr.c.pri 2\n");
841#endif
842 code_idx += opcodes(1) + opargs(1);
843}
844
845/* Convert from character index to byte address. This routine does
846 * nothing if a character has the size of a byte.
847 */
848void
849char2addr(void)
850{
851 if (charbits == 16)
852 {
853 stgwrite("\tshl.c.pri 1\n");
854 code_idx += opcodes(1) + opargs(1);
855 } /* if */
856}
857
858/* Align PRI (which should hold a character index) to an address.
859 * The first character in a "pack" occupies the highest bits of
860 * the cell. This is at the lower memory address on Big Endian
861 * computers and on the higher address on Little Endian computers.
862 * The ALIGN.pri/alt instructions must solve this machine dependence;
863 * that is, on Big Endian computers, ALIGN.pri/alt shuold do nothing
864 * and on Little Endian computers they should toggle the address.
865 */
866void
867charalign(void)
868{
869 stgwrite("\talign.pri ");
870 outval(charbits / 8, TRUE);
871 code_idx += opcodes(1) + opargs(1);
872}
873
874/*
875 * Add a constant to the primary register.
876 */
877void
878addconst(cell val)
879{
880 if (val != 0)
881 {
882 stgwrite("\tadd.c ");
883 outval(val, TRUE);
884 code_idx += opcodes(1) + opargs(1);
885 } /* if */
886}
887
888/*
889 * signed multiply of primary and secundairy registers (result in primary)
890 */
891void
892os_mult(void)
893{
894 stgwrite("\tsmul\n");
895 code_idx += opcodes(1);
896}
897
898/*
899 * signed divide of alternate register by primary register (quotient in
900 * primary; remainder in alternate)
901 */
902void
903os_div(void)
904{
905 stgwrite("\tsdiv.alt\n");
906 code_idx += opcodes(1);
907}
908
909/*
910 * modulus of (alternate % primary), result in primary (signed)
911 */
912void
913os_mod(void)
914{
915 stgwrite("\tsdiv.alt\n");
916 stgwrite("\tmove.pri\n"); /* move ALT to PRI */
917 code_idx += opcodes(2);
918}
919
920/*
921 * Add primary and alternate registers (result in primary).
922 */
923void
924ob_add(void)
925{
926 stgwrite("\tadd\n");
927 code_idx += opcodes(1);
928}
929
930/*
931 * subtract primary register from alternate register (result in primary)
932 */
933void
934ob_sub(void)
935{
936 stgwrite("\tsub.alt\n");
937 code_idx += opcodes(1);
938}
939
940/*
941 * arithmic shift left alternate register the number of bits
942 * given in the primary register (result in primary).
943 * There is no need for a "logical shift left" routine, since
944 * logical shift left is identical to arithmic shift left.
945 */
946void
947ob_sal(void)
948{
949 stgwrite("\txchg\n");
950 stgwrite("\tshl\n");
951 code_idx += opcodes(2);
952}
953
954/*
955 * arithmic shift right alternate register the number of bits
956 * given in the primary register (result in primary).
957 */
958void
959os_sar(void)
960{
961 stgwrite("\txchg\n");
962 stgwrite("\tsshr\n");
963 code_idx += opcodes(2);
964}
965
966/*
967 * logical (unsigned) shift right of the alternate register by the
968 * number of bits given in the primary register (result in primary).
969 */
970void
971ou_sar(void)
972{
973 stgwrite("\txchg\n");
974 stgwrite("\tshr\n");
975 code_idx += opcodes(2);
976}
977
978/*
979 * inclusive "or" of primary and secondary registers (result in primary)
980 */
981void
982ob_or(void)
983{
984 stgwrite("\tor\n");
985 code_idx += opcodes(1);
986}
987
988/*
989 * "exclusive or" of primary and alternate registers (result in primary)
990 */
991void
992ob_xor(void)
993{
994 stgwrite("\txor\n");
995 code_idx += opcodes(1);
996}
997
998/*
999 * "and" of primary and secundairy registers (result in primary)
1000 */
1001void
1002ob_and(void)
1003{
1004 stgwrite("\tand\n");
1005 code_idx += opcodes(1);
1006}
1007
1008/*
1009 * test ALT==PRI; result in primary register (1 or 0).
1010 */
1011void
1012ob_eq(void)
1013{
1014 stgwrite("\teq\n");
1015 code_idx += opcodes(1);
1016}
1017
1018/*
1019 * test ALT!=PRI
1020 */
1021void
1022ob_ne(void)
1023{
1024 stgwrite("\tneq\n");
1025 code_idx += opcodes(1);
1026}
1027
1028/* The abstract machine defines the relational instructions so that PRI is
1029 * on the left side and ALT on the right side of the operator. For example,
1030 * SLESS sets PRI to either 1 or 0 depending on whether the expression
1031 * "PRI < ALT" is true.
1032 *
1033 * The compiler generates comparisons with ALT on the left side of the
1034 * relational operator and PRI on the right side. The XCHG instruction
1035 * prefixing the relational operators resets this. We leave it to the
1036 * peephole optimizer to choose more compact instructions where possible.
1037 */
1038
1039/* Relational operator prefix for chained relational expressions. The
1040 * "suffix" code restores the stack.
1041 * For chained relational operators, the goal is to keep the comparison
1042 * result "so far" in PRI and the value of the most recent operand in
1043 * ALT, ready for a next comparison.
1044 * The "prefix" instruction pushed the comparison result (PRI) onto the
1045 * stack and moves the value of ALT into PRI. If there is a next comparison,
1046 * PRI can now serve as the "left" operand of the relational operator.
1047 */
1048void
1049relop_prefix(void)
1050{
1051 stgwrite("\tpush.pri\n");
1052 stgwrite("\tmove.pri\n");
1053 code_idx += opcodes(2);
1054}
1055
1056void
1057relop_suffix(void)
1058{
1059 stgwrite("\tswap.alt\n");
1060 stgwrite("\tand\n");
1061 stgwrite("\tpop.alt\n");
1062 code_idx += opcodes(3);
1063}
1064
1065/*
1066 * test ALT<PRI (signed)
1067 */
1068void
1069os_lt(void)
1070{
1071 stgwrite("\txchg\n");
1072 stgwrite("\tsless\n");
1073 code_idx += opcodes(2);
1074}
1075
1076/*
1077 * test ALT<=PRI (signed)
1078 */
1079void
1080os_le(void)
1081{
1082 stgwrite("\txchg\n");
1083 stgwrite("\tsleq\n");
1084 code_idx += opcodes(2);
1085}
1086
1087/*
1088 * test ALT>PRI (signed)
1089 */
1090void
1091os_gt(void)
1092{
1093 stgwrite("\txchg\n");
1094 stgwrite("\tsgrtr\n");
1095 code_idx += opcodes(2);
1096}
1097
1098/*
1099 * test ALT>=PRI (signed)
1100 */
1101void
1102os_ge(void)
1103{
1104 stgwrite("\txchg\n");
1105 stgwrite("\tsgeq\n");
1106 code_idx += opcodes(2);
1107}
1108
1109/*
1110 * logical negation of primary register
1111 */
1112void
1113lneg(void)
1114{
1115 stgwrite("\tnot\n");
1116 code_idx += opcodes(1);
1117}
1118
1119/*
1120 * two's complement primary register
1121 */
1122void
1123neg(void)
1124{
1125 stgwrite("\tneg\n");
1126 code_idx += opcodes(1);
1127}
1128
1129/*
1130 * one's complement of primary register
1131 */
1132void
1133invert(void)
1134{
1135 stgwrite("\tinvert\n");
1136 code_idx += opcodes(1);
1137}
1138
1139/*
1140 * nop
1141 */
1142void
1143nooperation(void)
1144{
1145 stgwrite("\tnop\n");
1146 code_idx += opcodes(1);
1147}
1148
1149/* increment symbol
1150 */
1151void
1152inc(value * lval)
1153{
1154 symbol *sym;
1155
1156 sym = lval->sym;
1157 if (lval->ident == iARRAYCELL)
1158 {
1159 /* indirect increment, address already in PRI */
1160 stgwrite("\tinc.i\n");
1161 code_idx += opcodes(1);
1162 }
1163 else if (lval->ident == iARRAYCHAR)
1164 {
1165 /* indirect increment of single character, address already in PRI */
1166 stgwrite("\tpush.pri\n");
1167 stgwrite("\tpush.alt\n");
1168 stgwrite("\tmove.alt\n"); /* copy address */
1169 stgwrite("\tlodb.i "); /* read from PRI into PRI */
1170 outval(charbits / 8, TRUE); /* read one or two bytes */
1171 stgwrite("\tinc.pri\n");
1172 stgwrite("\tstrb.i "); /* write PRI to ALT */
1173 outval(charbits / 8, TRUE); /* write one or two bytes */
1174 stgwrite("\tpop.alt\n");
1175 stgwrite("\tpop.pri\n");
1176 code_idx += opcodes(8) + opargs(2);
1177 }
1178 else if (lval->ident == iREFERENCE)
1179 {
1180 assert(sym != NULL);
1181 stgwrite("\tpush.pri\n");
1182 /* load dereferenced value */
1183 assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
1184 if (sym->vclass == sLOCAL)
1185 stgwrite("\tlref.s.pri ");
1186 else
1187 stgwrite("\tlref.pri ");
1188 outval(sym->addr, TRUE);
1189 /* increment */
1190 stgwrite("\tinc.pri\n");
1191 /* store dereferenced value */
1192 if (sym->vclass == sLOCAL)
1193 stgwrite("\tsref.s.pri ");
1194 else
1195 stgwrite("\tsref.pri ");
1196 outval(sym->addr, TRUE);
1197 stgwrite("\tpop.pri\n");
1198 code_idx += opcodes(5) + opargs(2);
1199 }
1200 else
1201 {
1202 /* local or global variable */
1203 assert(sym != NULL);
1204 if (sym->vclass == sLOCAL)
1205 stgwrite("\tinc.s ");
1206 else
1207 stgwrite("\tinc ");
1208 outval(sym->addr, TRUE);
1209 code_idx += opcodes(1) + opargs(1);
1210 } /* if */
1211}
1212
1213/* decrement symbol
1214 *
1215 * in case of an integer pointer, the symbol must be incremented by 2.
1216 */
1217void
1218dec(value * lval)
1219{
1220 symbol *sym;
1221
1222 sym = lval->sym;
1223 if (lval->ident == iARRAYCELL)
1224 {
1225 /* indirect decrement, address already in PRI */
1226 stgwrite("\tdec.i\n");
1227 code_idx += opcodes(1);
1228 }
1229 else if (lval->ident == iARRAYCHAR)
1230 {
1231 /* indirect decrement of single character, address already in PRI */
1232 stgwrite("\tpush.pri\n");
1233 stgwrite("\tpush.alt\n");
1234 stgwrite("\tmove.alt\n"); /* copy address */
1235 stgwrite("\tlodb.i "); /* read from PRI into PRI */
1236 outval(charbits / 8, TRUE); /* read one or two bytes */
1237 stgwrite("\tdec.pri\n");
1238 stgwrite("\tstrb.i "); /* write PRI to ALT */
1239 outval(charbits / 8, TRUE); /* write one or two bytes */
1240 stgwrite("\tpop.alt\n");
1241 stgwrite("\tpop.pri\n");
1242 code_idx += opcodes(8) + opargs(2);
1243 }
1244 else if (lval->ident == iREFERENCE)
1245 {
1246 assert(sym != NULL);
1247 stgwrite("\tpush.pri\n");
1248 /* load dereferenced value */
1249 assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
1250 if (sym->vclass == sLOCAL)
1251 stgwrite("\tlref.s.pri ");
1252 else
1253 stgwrite("\tlref.pri ");
1254 outval(sym->addr, TRUE);
1255 /* decrement */
1256 stgwrite("\tdec.pri\n");
1257 /* store dereferenced value */
1258 if (sym->vclass == sLOCAL)
1259 stgwrite("\tsref.s.pri ");
1260 else
1261 stgwrite("\tsref.pri ");
1262 outval(sym->addr, TRUE);
1263 stgwrite("\tpop.pri\n");
1264 code_idx += opcodes(5) + opargs(2);
1265 }
1266 else
1267 {
1268 /* local or global variable */
1269 assert(sym != NULL);
1270 if (sym->vclass == sLOCAL)
1271 stgwrite("\tdec.s ");
1272 else
1273 stgwrite("\tdec ");
1274 outval(sym->addr, TRUE);
1275 code_idx += opcodes(1) + opargs(1);
1276 } /* if */
1277}
1278
1279/*
1280 * Jumps to "label" if PRI != 0
1281 */
1282void
1283jmp_ne0(int number)
1284{
1285 stgwrite("\tjnz ");
1286 outval(number, TRUE);
1287 code_idx += opcodes(1) + opargs(1);
1288}
1289
1290/*
1291 * Jumps to "label" if PRI == 0
1292 */
1293void
1294jmp_eq0(int number)
1295{
1296 stgwrite("\tjzer ");
1297 outval(number, TRUE);
1298 code_idx += opcodes(1) + opargs(1);
1299}
1300
1301/* write a value in hexadecimal; optionally adds a newline */
1302void
1303outval(cell val, int newline)
1304{
1305 stgwrite(itoh(val));
1306 if (newline)
1307 stgwrite("\n");
1308}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc5.c b/libraries/embryo/src/bin/embryo_cc_sc5.c
new file mode 100644
index 0000000..57b1744
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc5.c
@@ -0,0 +1,154 @@
1/* Small compiler - Error message system
2 * In fact a very simple system, using only 'panic mode'.
3 *
4 * Copyright (c) ITB CompuPhase, 1997-2003
5 *
6 * This software is provided "as-is", without any express or implied warranty.
7 * In no event will the authors be held liable for any damages arising from
8 * the use of this software.
9 *
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
13 *
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software in
16 * a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 * 3. This notice may not be removed or altered from any source distribution.
21 *
22 * Version: $Id: embryo_cc_sc5.c 61433 2011-07-16 23:19:02Z caro $
23 */
24
25
26#ifdef HAVE_CONFIG_H
27# include <config.h>
28#endif
29
30#include <stdio.h>
31#include <stdlib.h>
32#include <stdarg.h>
33#include <string.h>
34
35#ifdef HAVE_UNISTD_H
36# include <unistd.h>
37#endif
38
39#include "embryo_cc_sc.h"
40#include "embryo_cc_sc5.scp"
41
42static int errflag;
43static int errstart; /* line number at which the instruction started */
44
45/* error
46 *
47 * Outputs an error message (note: msg is passed optionally).
48 * If an error is found, the variable "errflag" is set and subsequent
49 * errors are ignored until lex() finds a semicolumn or a keyword
50 * (lex() resets "errflag" in that case).
51 *
52 * Global references: inpfname (referred to only)
53 * fline (referred to only)
54 * fcurrent (referred to only)
55 * errflag (altered)
56 */
57int
58error(int number, ...)
59{
60 static int lastline, lastfile, errorcount;
61 char *msg;
62 va_list argptr;
63 char string[1024];
64 int start;
65
66 /* errflag is reset on each semicolon.
67 * In a two-pass compiler, an error should not be reported twice. Therefore
68 * the error reporting is enabled only in the second pass (and only when
69 * actually producing output). Fatal errors may never be ignored.
70 */
71 if (((errflag) || (sc_status != statWRITE)) &&
72 ((number < 100) || (number >= 200)))
73 return 0;
74
75 if (number < 100)
76 {
77 msg = errmsg[number - 1];
78 errflag = TRUE; /* set errflag (skip rest of erroneous expression) */
79 errnum++;
80 }
81 else if (number < 200)
82 {
83 msg = fatalmsg[number - 100];
84 errnum++; /* a fatal error also counts as an error */
85 }
86 else
87 {
88 msg = warnmsg[number - 200];
89 warnnum++;
90 }
91
92 strexpand(string, (unsigned char *)msg, sizeof string, SCPACK_TABLE);
93
94 va_start(argptr, number);
95
96 start = (errstart == fline) ? -1 : errstart;
97
98 if (sc_error(number, string, inpfname, start, fline, argptr))
99 {
100 sc_closeasm(outf);
101 outf = NULL;
102 longjmp(errbuf, 3);
103 }
104
105 va_end(argptr);
106
107 if (((number >= 100) && (number < 200)) || (errnum > 250))
108 {
109 va_start(argptr, number);
110 sc_error(0, "\nCompilation aborted.", NULL, 0, 0, argptr);
111 va_end(argptr);
112
113 if (outf)
114 {
115 sc_closeasm(outf);
116 outf = NULL;
117 } /* if */
118 longjmp(errbuf, 2); /* fatal error, quit */
119 } /* if */
120
121 /* check whether we are seeing many errors on the same line */
122 if (((errstart < 0) && (lastline != fline)) ||
123 (lastline < errstart) || (lastline > fline) || (fcurrent != lastfile))
124 errorcount = 0;
125 lastline = fline;
126 lastfile = fcurrent;
127 if (number < 200)
128 errorcount++;
129 if (errorcount >= 3)
130 error(107); /* too many error/warning messages on one line */
131 return 0;
132}
133
134void
135errorset(int code)
136{
137 switch (code)
138 {
139 case sRESET:
140 errflag = FALSE; /* start reporting errors */
141 break;
142 case sFORCESET:
143 errflag = TRUE; /* stop reporting errors */
144 break;
145 case sEXPRMARK:
146 errstart = fline; /* save start line number */
147 break;
148 case sEXPRRELEASE:
149 errstart = -1; /* forget start line number */
150 break;
151 default:
152 break;
153 }
154}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc5.scp b/libraries/embryo/src/bin/embryo_cc_sc5.scp
new file mode 100644
index 0000000..af3f352
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc5.scp
@@ -0,0 +1,317 @@
1/* Small compiler - Error message strings (plain and compressed formats)
2 *
3 * Copyright (c) ITB CompuPhase, 2000-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_sc5.scp 35497 2008-08-17 07:44:18Z raster $
22 */
23
24int strexpand(char *dest, unsigned char *source, int maxlen,
25 unsigned char pairtable[128][2]);
26
27#define SCPACK_TABLE errstr_table
28/*-*SCPACK start of pair table, do not change or remove this line */
29unsigned char errstr_table[][2] = {
30 {101, 32}, {116, 32}, {111, 110}, {105, 110}, {97, 114}, {100, 32}, {105,
31 130},
32 {101, 114}, {101, 110}, {115, 32}, {97, 108}, {97, 116}, {117, 110}, {115,
33 34},
34 {37, 141}, {34, 142},
35 {109, 136}, {121, 32}, {97, 110}, {114, 101}, {99, 116}, {134, 32}, {110,
36 111},
37 {101, 133}, {118, 138}, {115, 105}, {98, 108}, {111, 114}, {115, 116},
38 {41, 10}, {109, 98}, {100, 101},
39 {117, 115}, {150, 129}, {102, 140}, {117, 144}, {162, 148}, {103, 163}, {132,
40 165},
41 {114, 97}, {105, 133}, {152, 168}, {99, 104}, {32, 143}, {97, 32}, {131,
42 169},
43 {97, 115}, {164, 149},
44 {111, 108}, {101, 120}, {97, 154}, {135, 32}, {132, 167}, {111, 102}, {105,
45 116},
46 {166, 129}, {101, 100}, {98, 128}, {178, 128}, {160, 129}, {105, 137},
47 {180, 145}, {121, 158}, {190, 176},
48 {109, 187}, {115, 191}, {118, 132}, {101, 10}, {115, 10}, {112, 147}, {155,
49 32},
50 {181, 32}, {159, 102}, {194, 105}, {99, 130}, {103, 32}, {201, 186}, {116,
51 111},
52 {34, 32}, {109, 97},
53 {153, 122}, {171, 10}, {104, 97}, {100, 105}, {108, 111}, {111, 112}, {200,
54 131},
55 {139, 134}, {213, 135}, {101, 137}, {202, 156}, {143, 157}, {138, 32},
56 {192, 185}, {58, 209}, {105, 99},
57 {112, 111}, {115, 115}, {110, 117}, {115, 117}, {146, 129}, {226, 158}, {229,
58 179},
59 {177, 197}, {231, 225}, {132, 97}, {98, 101}, {99, 111}, {216, 139}, {109,
60 139},
61 {116, 10}, {99, 146},
62 {44, 32}, {237, 170}, {131, 203}, {116, 104}, {117, 108}, {152, 117}, {108,
63 128},
64 {118, 128}, {101, 144}, {233, 148}, {174, 153}, {110, 32}, {131, 32},
65 {146, 32}, {239, 161}
66};
67/*-*SCPACK end of pair table, do not change or remove this line */
68
69static char *errmsg[] = {
70#ifdef SCPACK
71/*001*/ "expected token: \"%s\", but found \"%s\"\n",
72/*002*/ "only a single statement (or expression) can follow each \"case\"\n",
73/*003*/ "declaration of a local variable must appear in a compound block\n",
74/*004*/ "function \"%s\" is not implemented\n",
75/*005*/ "function may not have arguments\n",
76/*006*/ "must be assigned to an array\n",
77/*007*/ "assertion failed\n",
78/*008*/ "must be a constant expression; assumed zero\n",
79/*009*/ "invalid array size (negative or zero)\n",
80/*010*/ "invalid function or declaration\n",
81/*011*/ "invalid outside functions\n",
82/*012*/ "invalid function call, not a valid address\n",
83/*013*/ "no entry point (no public functions)\n",
84/*014*/ "invalid statement; not in switch\n",
85/*015*/ "\"default\" case must be the last case in switch statement\n",
86/*016*/ "multiple defaults in \"switch\"\n",
87/*017*/ "undefined symbol \"%s\"\n",
88/*018*/ "initialization data exceeds declared size\n",
89/*019*/ "not a label: \"%s\"\n",
90/*020*/ "invalid symbol name \"%s\"\n",
91/*021*/ "symbol already defined: \"%s\"\n",
92/*022*/ "must be lvalue (non-constant)\n",
93/*023*/ "array assignment must be simple assignment\n",
94/*024*/ "\"break\" or \"continue\" is out of context\n",
95/*025*/ "function heading differs from prototype\n",
96/*026*/ "no matching \"#if...\"\n",
97/*027*/ "invalid character constant\n",
98/*028*/ "invalid subscript (not an array or too many subscripts)\n",
99/*029*/ "invalid expression, assumed zero\n",
100/*030*/ "compound statement not closed at the end of file\n",
101/*031*/ "unknown directive\n",
102/*032*/ "array index out of bounds (variable \"%s\")\n",
103/*033*/ "array must be indexed (variable \"%s\")\n",
104/*034*/ "argument does not have a default value (argument %d)\n",
105/*035*/ "argument type mismatch (argument %d)\n",
106/*036*/ "empty statement\n",
107/*037*/ "invalid string (possibly non-terminated string)\n",
108/*038*/ "extra characters on line\n",
109/*039*/ "constant symbol has no size\n",
110/*040*/ "duplicate \"case\" label (value %d)\n",
111/*041*/ "invalid ellipsis, array size is not known\n",
112/*042*/ "invalid combination of class specifiers\n",
113/*043*/ "character constant exceeds range for packed string\n",
114/*044*/ "positional parameters must precede all named parameters\n",
115/*045*/ "too many function arguments\n",
116/*046*/ "unknown array size (variable \"%s\")\n",
117/*047*/ "array sizes must match\n",
118/*048*/ "array dimensions must match\n",
119/*049*/ "invalid line continuation\n",
120/*050*/ "invalid range\n",
121/*051*/ "invalid subscript, use \"[ ]\" operators on major dimensions\n",
122/*052*/ "only the last dimension may be variable length\n",
123/*053*/ "exceeding maximum number of dimensions\n",
124/*054*/ "unmatched closing brace\n",
125/*055*/ "start of function body without function header\n",
126/*056*/
127 "arrays, local variables and function arguments cannot be public (variable \"%s\")\n",
128/*057*/ "unfinished expression before compiler directive\n",
129/*058*/ "duplicate argument; same argument is passed twice\n",
130/*059*/ "function argument may not have a default value (variable \"%s\")\n",
131/*060*/ "multiple \"#else\" directives between \"#if ... #endif\"\n",
132/*061*/ "operator cannot be redefined\n",
133/*062*/ "number of operands does not fit the operator\n",
134/*063*/ "function result tag of operator \"%s\" must be \"%s\"\n",
135/*064*/ "cannot change predefined operators\n",
136/*065*/ "function argument may only have a single tag (argument %d)\n",
137/*066*/
138 "function argument may not be a reference argument or an array (argument \"%s\")\n",
139/*067*/
140 "variable cannot be both a reference and an array (variable \"%s\")\n",
141/*068*/ "invalid rational number precision in #pragma\n",
142/*069*/ "rational number format already defined\n",
143/*070*/ "rational number support was not enabled\n",
144/*071*/
145 "user-defined operator must be declared before use (function \"%s\")\n",
146/*072*/ "\"sizeof\" operator is invalid on \"function\" symbols\n",
147/*073*/ "function argument must be an array (argument \"%s\")\n",
148/*074*/ "#define pattern must start with an alphabetic character\n",
149/*075*/ "input line too long (after substitutions)\n"
150#else
151 "\261pe\224\227\315k\210:\253\360bu\201fo\214\205\217\012",
152 "\202l\221\254s\203g\366\234\213\370\201(\306\350\206) \357 f\260\324w ea\252 \042c\256e\042\012",
153 "\237cl\204\213\225\307\254\324c\334\314\300appe\204 \374\254\353m\340\214\205\232ock\012",
154 "\257\217 \274\241impl\370t\270\012",
155 "\257\317\221\241\322\367\246t\304",
156 "\335\372gn\227\315 \375\264y\012",
157 "\256s\207t\225fail\270\012",
158 "\335\254\332\344\350\206; \256\343m\227z\207o\012",
159 "\255\275\320\200(neg\213i\367\306z\207o\235",
160 "\255\257\306\237cl\204\327\012",
161 "\255out\231d\200\244\206\304",
162 "\255\257c\212l\360\241\254\251add\223s\304",
163 "\226 \210tr\221\340\203\201(\226 pu\232\337 \244\206s\235",
164 "\255\234\213\370t; \241\374sw\266\252\012",
165 "\042\310a\364t\316c\256\200\335\363\200l\256\201c\256\200\374sw\266\252 \234\213\370\356",
166 "m\364tip\366\310a\364t\211\374\042sw\266\252\042\012",
167 "\214\326\227\301\321",
168 "\203\266i\212iz\213\225d\213\254\261ce\270\211\237cl\204\227\320\303",
169 "\241\254la\352l\336",
170 "\255\301 nam\200\217\012",
171 "\301 \212\223ad\221\326\270\336",
172 "\335l\365\200(n\202-\332\222t\235",
173 "\275\372gn\220\201\335\231mp\366\372gn\220\356",
174 "\042b\223ak\316\306\042\312t\203ue\316\274ou\201\307\312t\261\356",
175 "\257head\362\323ff\207\211from pro\315typ\303",
176 "\226 \361\362\042#if...\042\012",
177 "\255\252\371\263\332\222\356",
178 "\255\343bscrip\201(\241\375\275\306\315o m\222\221\343bscripts\235",
179 "\255\350\206\360\256\343m\227z\207o\012",
180 "\353m\340\214\205\234\213\370\201\241c\324s\227a\201\363\200\210\205\307fil\303",
181 "\214k\226w\373\323\223\224iv\303",
182 "\275\203\237x ou\201\307bo\214d\211(\314\333",
183 "\275\335\203\237x\227(\314\333",
184 "\267do\331\241\322\367\254\310a\364\201\365\200(\267%d\235",
185 "\267typ\200mis\361 (\267%d\235",
186 "empt\221\234\213\370\356",
187 "\255\234r\362(\340s\231\232\221n\202-t\207m\203\213\227\234r\203g\235",
188 "\261t\247 \252\371\207\211\202 l\203\303",
189 "\332\344\301 \322\211\226 \320\303",
190 "dupl\337\213\200\042c\256e\316la\352l (\365\200%d\235",
191 "\255ellip\231s\360\275\320\200\274\241k\226wn\012",
192 "\255\353\236\203\213\225\307cl\256\211specifi\207\304",
193 "\252\371\263\332\344\261ce\270\211r\222g\200f\306pack\227\234r\203g\012",
194 "\340\231t\206\334p\351met\207\211\300\305c\270\200\212l nam\227p\351met\207\304",
195 "\315o m\222\221\257\246t\304",
196 "\214k\226w\373\275\320\200(\314\333",
197 "\275\320\331\300\361\012",
198 "\275\323\220s\206\211\300\361\012",
199 "\255l\203\200\312t\203u\327\012",
200 "\255r\222g\303",
201 "\255\343bscript\360\240\200\042[ ]\316\354\233\211\202 \317j\306\323\220s\206\304",
202 "\202l\221\363\200l\256\201\323\220s\225\317\221\271\314l\210g\363\012",
203 "\261ce\270\362\317ximum \346\307\323\220s\206\304",
204 "\214\361\227c\324s\362b\247c\303",
205 "\234\204\201\307\257bod\221w\266hou\201\257head\207\012",
206 "\264ys\360\324c\334\311\262\331\222\205\257\246t\211\376\271pu\232\337 (\314\333",
207 "\214f\203ish\227\350\225\352f\233\200\353mpil\263\323\223\224iv\303",
208 "dupl\337\213\200\246t; sam\200\267\274p\256s\227tw\337\303",
209 "\257\267\317\221\241\322\367\254\310a\364\201\365\200(\314\333",
210 "m\364tip\366\042#else\316\323\223\224iv\331\352twe\210 \042#if ... #\210\323f\042\012",
211 "\354\306\376\271\223\326\270\012",
212 "\346\307\330\222d\211do\331\241fi\201\363\200\354\233\012",
213 "\257\223\343l\201ta\313\307\354\233\253 \335\217\012",
214 "\376\252\222g\200\305\326\227\354\233\304",
215 "\257\267\317\221\202l\221\322\367\254s\203g\366ta\313(\267%d\235",
216 "\257\267\317\221\241\271\254\223f\207\210c\200\267\306\375\275(\267\333",
217 "\314\376\271bo\363 \254\223f\207\210c\200\222\205\375\275(\314\333",
218 "\255r\327\334\346\305cis\225\374#p\247g\317\012",
219 "r\327\334\346f\233\317\201\212\223ad\221\326\270\012",
220 "r\327\334\346\343pp\233\201wa\211\241\210\262\270\012",
221 "\240\207-\326\227\354\306\335\237cl\204\227\352f\233\200\240\200(\257\333",
222 "\042\320e\265\316\354\306\274\255\202 \042\244\206\316\301\304",
223 "\257\267\335\375\275(\267\333",
224 "#\326\200p\213t\207\373\300\234\204\201w\266h \375\212p\322\352t\337 \252\371\207\012",
225 "\203pu\201l\203\200\315o l\202\313(aft\263\343b\234\266ut\206s\235"
226#endif
227};
228
229static char *fatalmsg[] = {
230#ifdef SCPACK
231/*100*/ "cannot read from file: \"%s\"\n",
232/*101*/ "cannot write to file: \"%s\"\n",
233/*102*/ "table overflow: \"%s\"\n",
234 /* table can be: loop table
235 * literal table
236 * staging buffer
237 * parser stack (recursive include?)
238 * option table (response file)
239 * peephole optimizer table
240 */
241/*103*/ "insufficient memory\n",
242/*104*/ "invalid assembler instruction \"%s\"\n",
243/*105*/ "numeric overflow, exceeding capacity\n",
244/*106*/ "compaction buffer overflow\n",
245/*107*/ "too many error messages on one line\n"
246#else
247 "\376\223a\205from file\336",
248 "\376wr\266\200\315 file\336",
249 "t\272ov\207f\324w\336",
250 "\203\343ff\337i\210\201mem\233y\012",
251 "\255\256sem\232\263\203\234ru\224\225\217\012",
252 "\342m\207\337 ov\207f\324w\360\261ce\270\362capac\266y\012",
253 "\353mpa\224\225buff\263ov\207f\324w\012",
254 "\315o m\222\221\207r\306me\341ag\331\202 \202\200l\203\303"
255#endif
256};
257
258static char *warnmsg[] = {
259#ifdef SCPACK
260/*200*/ "symbol \"%s\" is truncated to %d characters\n",
261/*201*/ "redefinition of constant/macro (symbol \"%s\")\n",
262/*202*/ "number of arguments does not match definition\n",
263/*203*/ "symbol is never used: \"%s\"\n",
264/*204*/ "symbol is assigned a value that is never used: \"%s\"\n",
265/*205*/ "redundant code: constant expression is zero\n",
266/*206*/ "redundant test: constant expression is non-zero\n",
267/*207*/ "unknown #pragma\n",
268/*208*/ "function uses both \"return;\" and \"return <value>;\"\n",
269/*209*/ "function \"%s\" should return a value\n",
270/*210*/ "possible use of symbol before initialization: \"%s\"\n",
271/*211*/ "possibly unintended assignment\n",
272/*212*/ "possibly unintended bitwise operation\n",
273/*213*/ "tag mismatch\n",
274/*214*/ "possibly a \"const\" array argument was intended: \"%s\"\n",
275/*215*/ "expression has no effect\n",
276/*216*/ "nested comment\n",
277/*217*/ "loose indentation\n",
278/*218*/ "old style prototypes used with optional semicolumns\n",
279/*219*/ "local variable \"%s\" shadows a variable at a preceding level\n",
280/*220*/ "exported or native symbol \"%s\" is truncated to %d characters\n",
281/*221*/ "label name \"%s\" shadows tag name\n",
282/*222*/ "number of digits exceeds rational number precision\n",
283/*223*/ "redundant \"sizeof\": argument size is always 1 (symbol \"%s\")\n",
284/*224*/
285 "indeterminate array size in \"sizeof\" expression (symbol \"%s\")\n",
286/*225*/ "unreachable code\n",
287/*226*/ "a variable is assigned to itself (symbol \"%s\")\n"
288#else
289 "\301\253 \274tr\214c\213\227\315 %\205\252\371\207\304",
290 "\223\326\266\225\307\332\222t/\317cro (\301\253\235",
291 "\346\307\246t\211do\331\241\361 \326\266\206\012",
292 "\301 \274nev\263\240\270\336",
293 "\301 \274\372gn\227\254\365\200t\322\201\274nev\263\240\270\336",
294 "\223d\214d\344\353\237: \332\344\350\225\274z\207o\012",
295 "\223d\214d\344te\234: \332\344\350\225\274n\202-z\207o\012",
296 "\214k\226w\373#p\247g\317\012",
297 "\257\240\331bo\363 \042\223turn;\316\222\205\042\223tur\373<\365e>;\042\012",
298 "\257\217 sho\364\205\223tur\373\254\365\303",
299 "\340s\231\232\200\240\200\307\301 \352f\233\200\203\266i\212iz\327\336",
300 "\340s\231\232\221\214\203t\210d\227\372gn\220\356",
301 "\340s\231\232\221\214\203t\210d\227b\266wis\200\330\327\012",
302 "ta\313mis\361\012",
303 "\340s\231\232\221\254\042\332\316\275\267wa\211\203t\210\237d\336",
304 "\350\225\322\211\226 effe\224\012",
305 "ne\234\227\353m\220\356",
306 "\324os\200\203d\210t\327\012",
307 "\260\205\234y\366pro\315typ\331\240\227w\266h \325t\206\334sem\337\260umn\304",
308 "\324c\334\314\217 s\322dow\211\254\314a\201\254\305c\270\362level\012",
309 "\261p\233t\227\306n\213i\367\301\253 \274tr\214c\213\227\315 %\205\252\371\207\304",
310 "la\352l nam\200\217 s\322dow\211ta\313nam\303",
311 "\346\307\323g\266\211\261ce\270\211r\327\334\346\305cis\206\012",
312 "\223d\214d\344\042\320e\265\042: \267\320\200\274\212way\2111 (\301\253\235",
313 "\203\237t\207m\203\213\200\275\320\200\374\042\320e\265\316\350\225(\301\253\235",
314 "\214\223a\252\272\353\237\012",
315 "\254\314\274\372gn\227\315 \266self (\301\253\235"
316#endif
317};
diff --git a/libraries/embryo/src/bin/embryo_cc_sc6.c b/libraries/embryo/src/bin/embryo_cc_sc6.c
new file mode 100644
index 0000000..7ec6098
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc6.c
@@ -0,0 +1,1077 @@
1/* Small compiler - Binary code generation (the "assembler")
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 *
5 * This software is provided "as-is", without any express or implied warranty.
6 * In no event will the authors be held liable for any damages arising from
7 * the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software in
15 * a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 *
21 * Version: $Id: embryo_cc_sc6.c 52451 2010-09-19 03:00:12Z raster $
22 */
23
24
25#ifdef HAVE_CONFIG_H
26# include <config.h>
27#endif
28
29#include <assert.h>
30#include <stdio.h>
31#include <stdlib.h> /* for macro max() */
32#include <string.h>
33#include <ctype.h>
34#include "embryo_cc_sc.h"
35
36typedef cell(*OPCODE_PROC) (FILE * fbin, char *params, cell opcode);
37
38typedef struct
39{
40 cell opcode;
41 char *name;
42 int segment; /* sIN_CSEG=parse in cseg, sIN_DSEG=parse in dseg */
43 OPCODE_PROC func;
44} OPCODE;
45
46static cell codeindex; /* similar to "code_idx" */
47static cell *lbltab; /* label table */
48static int writeerror;
49static int bytes_in, bytes_out;
50
51/* apparently, strtol() does not work correctly on very large (unsigned)
52 * hexadecimal values */
53static ucell
54hex2long(char *s, char **n)
55{
56 unsigned long result = 0L;
57 int negate = FALSE;
58 int digit;
59
60 /* ignore leading whitespace */
61 while (*s == ' ' || *s == '\t')
62 s++;
63
64 /* allow a negation sign to create the two's complement of numbers */
65 if (*s == '-')
66 {
67 negate = TRUE;
68 s++;
69 } /* if */
70
71 assert((*s >= '0' && *s <= '9') || (*s >= 'a' && *s <= 'f')
72 || (*s >= 'a' && *s <= 'f'));
73 for (;;)
74 {
75 if (*s >= '0' && *s <= '9')
76 digit = *s - '0';
77 else if (*s >= 'a' && *s <= 'f')
78 digit = *s - 'a' + 10;
79 else if (*s >= 'A' && *s <= 'F')
80 digit = *s - 'A' + 10;
81 else
82 break; /* probably whitespace */
83 result = (result << 4) | digit;
84 s++;
85 } /* for */
86 if (n)
87 *n = s;
88 if (negate)
89 result = (~result) + 1; /* take two's complement of the result */
90 return (ucell) result;
91}
92
93#ifdef WORDS_BIGENDIAN
94static short *
95align16(short *v)
96{
97 unsigned char *s = (unsigned char *)v;
98 unsigned char t;
99
100 /* swap two bytes */
101 t = s[0];
102 s[0] = s[1];
103 s[1] = t;
104 return v;
105}
106
107static long *
108align32(long *v)
109{
110 unsigned char *s = (unsigned char *)v;
111 unsigned char t;
112
113 /* swap outer two bytes */
114 t = s[0];
115 s[0] = s[3];
116 s[3] = t;
117 /* swap inner two bytes */
118 t = s[1];
119 s[1] = s[2];
120 s[2] = t;
121 return v;
122}
123#if defined BIT16
124#define aligncell(v) align16(v)
125#else
126#define aligncell(v) align32(v)
127#endif
128#else
129#define align16(v) (v)
130#define align32(v) (v)
131#define aligncell(v) (v)
132#endif
133
134static char *
135skipwhitespace(char *str)
136{
137 while (isspace(*str))
138 str++;
139 return str;
140}
141
142static char *
143stripcomment(char *str)
144{
145 char *ptr = strchr(str, ';');
146
147 if (ptr)
148 {
149 *ptr++ = '\n'; /* terminate the line, but leave the '\n' */
150 *ptr = '\0';
151 } /* if */
152 return str;
153}
154
155static void
156write_encoded(FILE * fbin, ucell * c, int num)
157{
158 assert(sizeof(cell) <= 4); /* code must be adjusted for larger cells */
159 assert(fbin != NULL);
160 while (num-- > 0)
161 {
162 if (sc_compress)
163 {
164 ucell p = (ucell) * c;
165 unsigned char t[5]; /* a 32-bit cell is encoded in max. 5 bytes (3 bytes for a 16-bit cell) */
166 unsigned char code;
167 int index;
168
169 for (index = 0; index < 5; index++)
170 {
171 t[index] = (unsigned char)(p & 0x7f); /* store 7 bits */
172 p >>= 7;
173 } /* for */
174 /* skip leading zeros */
175 while (index > 1 && t[index - 1] == 0
176 && (t[index - 2] & 0x40) == 0)
177 index--;
178 /* skip leading -1s *//* ??? for BIT16, check for index==3 && t[index-1]==0x03 */
179 if (index == 5 && t[index - 1] == 0x0f
180 && (t[index - 2] & 0x40) != 0)
181 index--;
182 while (index > 1 && t[index - 1] == 0x7f
183 && (t[index - 2] & 0x40) != 0)
184 index--;
185 /* write high byte first, write continuation bits */
186 assert(index > 0);
187 while (index-- > 0)
188 {
189 code =
190 (unsigned char)((index == 0) ? t[index]
191 : (t[index] | 0x80));
192 writeerror |= !sc_writebin(fbin, &code, 1);
193 bytes_out++;
194 } /* while */
195 bytes_in += sizeof *c;
196 assert(AMX_EXPANDMARGIN > 2);
197 if (bytes_out - bytes_in >= AMX_EXPANDMARGIN - 2)
198 error(106); /* compression buffer overflow */
199 }
200 else
201 {
202 assert((sc_lengthbin(fbin) % sizeof(cell)) == 0);
203 writeerror |= !sc_writebin(fbin, aligncell(c), sizeof *c);
204 } /* if */
205 c++;
206 } /* while */
207}
208
209#if defined __BORLANDC__ || defined __WATCOMC__
210#pragma argsused
211#endif
212
213static cell
214noop(FILE * fbin __UNUSED__, char *params __UNUSED__, cell opcode __UNUSED__)
215{
216 return 0;
217}
218
219#if defined __BORLANDC__ || defined __WATCOMC__
220#pragma argsused
221#endif
222
223static cell
224parm0(FILE * fbin, char *params __UNUSED__, cell opcode)
225{
226 if (fbin)
227 write_encoded(fbin, (ucell *) & opcode, 1);
228 return opcodes(1);
229}
230
231static cell
232parm1(FILE * fbin, char *params, cell opcode)
233{
234 ucell p = hex2long(params, NULL);
235
236 if (fbin)
237 {
238 write_encoded(fbin, (ucell *) & opcode, 1);
239 write_encoded(fbin, &p, 1);
240 } /* if */
241 return opcodes(1) + opargs(1);
242}
243
244static cell
245parm2(FILE * fbin, char *params, cell opcode)
246{
247 ucell p[2];
248
249 p[0] = hex2long(params, &params);
250 p[1] = hex2long(params, NULL);
251 if (fbin)
252 {
253 write_encoded(fbin, (ucell *) & opcode, 1);
254 write_encoded(fbin, p, 2);
255 } /* if */
256 return opcodes(1) + opargs(2);
257}
258
259#if defined __BORLANDC__ || defined __WATCOMC__
260#pragma argsused
261#endif
262
263static cell
264do_dump(FILE * fbin, char *params, cell opcode __UNUSED__)
265{
266 ucell p;
267 int num = 0;
268
269 while (*params != '\0')
270 {
271 p = hex2long(params, &params);
272 if (fbin)
273 write_encoded(fbin, &p, 1);
274 num++;
275 while (isspace(*params))
276 params++;
277 } /* while */
278 return num * sizeof(cell);
279}
280
281static cell
282do_call(FILE * fbin, char *params, cell opcode)
283{
284 char name[sNAMEMAX + 1];
285 int i;
286 symbol *sym;
287 ucell p;
288
289 for (i = 0; !isspace(*params); i++, params++)
290 {
291 assert(*params != '\0');
292 assert(i < sNAMEMAX);
293 name[i] = *params;
294 } /* for */
295 name[i] = '\0';
296
297 /* look up the function address; note that the correct file number must
298 * already have been set (in order for static globals to be found).
299 */
300 sym = findglb(name);
301 assert(sym != NULL);
302 assert(sym->ident == iFUNCTN || sym->ident == iREFFUNC);
303 assert(sym->vclass == sGLOBAL);
304
305 p = sym->addr;
306 if (fbin)
307 {
308 write_encoded(fbin, (ucell *) & opcode, 1);
309 write_encoded(fbin, &p, 1);
310 } /* if */
311 return opcodes(1) + opargs(1);
312}
313
314static cell
315do_jump(FILE * fbin, char *params, cell opcode)
316{
317 int i;
318 ucell p;
319
320 i = (int)hex2long(params, NULL);
321 assert(i >= 0 && i < labnum);
322
323 if (fbin)
324 {
325 assert(lbltab != NULL);
326 p = lbltab[i];
327 write_encoded(fbin, (ucell *) & opcode, 1);
328 write_encoded(fbin, &p, 1);
329 } /* if */
330 return opcodes(1) + opargs(1);
331}
332
333static cell
334do_file(FILE * fbin, char *params, cell opcode)
335{
336 ucell p, clen;
337 int len;
338
339 p = hex2long(params, &params);
340
341 /* remove leading and trailing white space from the filename */
342 while (isspace(*params))
343 params++;
344 len = strlen(params);
345 while (len > 0 && isspace(params[len - 1]))
346 len--;
347 params[len++] = '\0'; /* zero-terminate */
348 while (len % sizeof(cell) != 0)
349 params[len++] = '\0'; /* pad with zeros up to full cell */
350 assert(len > 0 && len < 256);
351 clen = len + sizeof(cell); /* add size of file ordinal */
352
353 if (fbin)
354 {
355 write_encoded(fbin, (ucell *) & opcode, 1);
356 write_encoded(fbin, &clen, 1);
357 write_encoded(fbin, &p, 1);
358 write_encoded(fbin, (ucell *) params, len / sizeof(cell));
359 } /* if */
360 return opcodes(1) + opargs(1) + clen; /* other argument is in clen */
361}
362
363static cell
364do_symbol(FILE * fbin, char *params, cell opcode)
365{
366 char *endptr;
367 ucell offset, clen, flags;
368 int len;
369 unsigned char mclass, type;
370
371 for (endptr = params; !isspace(*endptr) && endptr != '\0'; endptr++)
372 /* nothing */ ;
373 assert(*endptr == ' ');
374
375 len = (int)(endptr - params);
376 assert(len > 0 && len < sNAMEMAX);
377 /* first get the other parameters from the line */
378 offset = hex2long(endptr, &endptr);
379 mclass = (unsigned char)hex2long(endptr, &endptr);
380 type = (unsigned char)hex2long(endptr, NULL);
381 flags = type + 256 * mclass;
382 /* now finish up the name (overwriting the input line) */
383 params[len++] = '\0'; /* zero-terminate */
384 while (len % sizeof(cell) != 0)
385 params[len++] = '\0'; /* pad with zeros up to full cell */
386 clen = len + 2 * sizeof(cell); /* add size of symbol address and flags */
387
388 if (fbin)
389 {
390 write_encoded(fbin, (ucell *) & opcode, 1);
391 write_encoded(fbin, &clen, 1);
392 write_encoded(fbin, &offset, 1);
393 write_encoded(fbin, &flags, 1);
394 write_encoded(fbin, (ucell *) params, len / sizeof(cell));
395 } /* if */
396
397#if !defined NDEBUG
398 /* function should start right after the symbolic information */
399 if (!fbin && mclass == 0 && type == iFUNCTN)
400 assert(offset == codeindex + opcodes(1) + opargs(1) + clen);
401#endif
402
403 return opcodes(1) + opargs(1) + clen; /* other 2 arguments are in clen */
404}
405
406static cell
407do_switch(FILE * fbin, char *params, cell opcode)
408{
409 int i;
410 ucell p;
411
412 i = (int)hex2long(params, NULL);
413 assert(i >= 0 && i < labnum);
414
415 if (fbin)
416 {
417 assert(lbltab != NULL);
418 p = lbltab[i];
419 write_encoded(fbin, (ucell *) & opcode, 1);
420 write_encoded(fbin, &p, 1);
421 } /* if */
422 return opcodes(1) + opargs(1);
423}
424
425#if defined __BORLANDC__ || defined __WATCOMC__
426#pragma argsused
427#endif
428
429static cell
430do_case(FILE * fbin, char *params, cell opcode __UNUSED__)
431{
432 int i;
433 ucell p, v;
434
435 v = hex2long(params, &params);
436 i = (int)hex2long(params, NULL);
437 assert(i >= 0 && i < labnum);
438
439 if (fbin)
440 {
441 assert(lbltab != NULL);
442 p = lbltab[i];
443 write_encoded(fbin, &v, 1);
444 write_encoded(fbin, &p, 1);
445 } /* if */
446 return opcodes(0) + opargs(2);
447}
448
449#if defined __BORLANDC__ || defined __WATCOMC__
450#pragma argsused
451#endif
452
453static cell
454curfile(FILE * fbin __UNUSED__, char *params, cell opcode __UNUSED__)
455{
456 fcurrent = (int)hex2long(params, NULL);
457 return 0;
458}
459
460static OPCODE opcodelist[] = {
461 /* node for "invalid instruction" */
462 {0, NULL, 0, noop},
463 /* opcodes in sorted order */
464 {78, "add", sIN_CSEG, parm0},
465 {87, "add.c", sIN_CSEG, parm1},
466 {14, "addr.alt", sIN_CSEG, parm1},
467 {13, "addr.pri", sIN_CSEG, parm1},
468 {30, "align.alt", sIN_CSEG, parm1},
469 {29, "align.pri", sIN_CSEG, parm1},
470 {81, "and", sIN_CSEG, parm0},
471 {121, "bounds", sIN_CSEG, parm1},
472 {49, "call", sIN_CSEG, do_call},
473 {50, "call.pri", sIN_CSEG, parm0},
474 {0, "case", sIN_CSEG, do_case},
475 {130, "casetbl", sIN_CSEG, parm0}, /* version 1 */
476 {118, "cmps", sIN_CSEG, parm1},
477 {0, "code", 0, noop},
478 {12, "const.alt", sIN_CSEG, parm1},
479 {11, "const.pri", sIN_CSEG, parm1},
480 {0, "curfile", sIN_CSEG, curfile},
481 {0, "data", 0, noop},
482 {114, "dec", sIN_CSEG, parm1},
483 {113, "dec.alt", sIN_CSEG, parm0},
484 {116, "dec.i", sIN_CSEG, parm0},
485 {112, "dec.pri", sIN_CSEG, parm0},
486 {115, "dec.s", sIN_CSEG, parm1},
487 {0, "dump", sIN_DSEG, do_dump},
488 {95, "eq", sIN_CSEG, parm0},
489 {106, "eq.c.alt", sIN_CSEG, parm1},
490 {105, "eq.c.pri", sIN_CSEG, parm1},
491 {124, "file", sIN_CSEG, do_file},
492 {119, "fill", sIN_CSEG, parm1},
493 {100, "geq", sIN_CSEG, parm0},
494 {99, "grtr", sIN_CSEG, parm0},
495 {120, "halt", sIN_CSEG, parm1},
496 {45, "heap", sIN_CSEG, parm1},
497 {27, "idxaddr", sIN_CSEG, parm0},
498 {28, "idxaddr.b", sIN_CSEG, parm1},
499 {109, "inc", sIN_CSEG, parm1},
500 {108, "inc.alt", sIN_CSEG, parm0},
501 {111, "inc.i", sIN_CSEG, parm0},
502 {107, "inc.pri", sIN_CSEG, parm0},
503 {110, "inc.s", sIN_CSEG, parm1},
504 {86, "invert", sIN_CSEG, parm0},
505 {55, "jeq", sIN_CSEG, do_jump},
506 {60, "jgeq", sIN_CSEG, do_jump},
507 {59, "jgrtr", sIN_CSEG, do_jump},
508 {58, "jleq", sIN_CSEG, do_jump},
509 {57, "jless", sIN_CSEG, do_jump},
510 {56, "jneq", sIN_CSEG, do_jump},
511 {54, "jnz", sIN_CSEG, do_jump},
512 {52, "jrel", sIN_CSEG, parm1}, /* always a number */
513 {64, "jsgeq", sIN_CSEG, do_jump},
514 {63, "jsgrtr", sIN_CSEG, do_jump},
515 {62, "jsleq", sIN_CSEG, do_jump},
516 {61, "jsless", sIN_CSEG, do_jump},
517 {51, "jump", sIN_CSEG, do_jump},
518 {128, "jump.pri", sIN_CSEG, parm0}, /* version 1 */
519 {53, "jzer", sIN_CSEG, do_jump},
520 {31, "lctrl", sIN_CSEG, parm1},
521 {98, "leq", sIN_CSEG, parm0},
522 {97, "less", sIN_CSEG, parm0},
523 {25, "lidx", sIN_CSEG, parm0},
524 {26, "lidx.b", sIN_CSEG, parm1},
525 {125, "line", sIN_CSEG, parm2},
526 {2, "load.alt", sIN_CSEG, parm1},
527 {9, "load.i", sIN_CSEG, parm0},
528 {1, "load.pri", sIN_CSEG, parm1},
529 {4, "load.s.alt", sIN_CSEG, parm1},
530 {3, "load.s.pri", sIN_CSEG, parm1},
531 {10, "lodb.i", sIN_CSEG, parm1},
532 {6, "lref.alt", sIN_CSEG, parm1},
533 {5, "lref.pri", sIN_CSEG, parm1},
534 {8, "lref.s.alt", sIN_CSEG, parm1},
535 {7, "lref.s.pri", sIN_CSEG, parm1},
536 {34, "move.alt", sIN_CSEG, parm0},
537 {33, "move.pri", sIN_CSEG, parm0},
538 {117, "movs", sIN_CSEG, parm1},
539 {85, "neg", sIN_CSEG, parm0},
540 {96, "neq", sIN_CSEG, parm0},
541 {134, "nop", sIN_CSEG, parm0}, /* version 6 */
542 {84, "not", sIN_CSEG, parm0},
543 {82, "or", sIN_CSEG, parm0},
544 {43, "pop.alt", sIN_CSEG, parm0},
545 {42, "pop.pri", sIN_CSEG, parm0},
546 {46, "proc", sIN_CSEG, parm0},
547 {40, "push", sIN_CSEG, parm1},
548 {37, "push.alt", sIN_CSEG, parm0},
549 {39, "push.c", sIN_CSEG, parm1},
550 {36, "push.pri", sIN_CSEG, parm0},
551 {38, "push.r", sIN_CSEG, parm1},
552 {41, "push.s", sIN_CSEG, parm1},
553 {133, "pushaddr", sIN_CSEG, parm1}, /* version 4 */
554 {47, "ret", sIN_CSEG, parm0},
555 {48, "retn", sIN_CSEG, parm0},
556 {32, "sctrl", sIN_CSEG, parm1},
557 {73, "sdiv", sIN_CSEG, parm0},
558 {74, "sdiv.alt", sIN_CSEG, parm0},
559 {104, "sgeq", sIN_CSEG, parm0},
560 {103, "sgrtr", sIN_CSEG, parm0},
561 {65, "shl", sIN_CSEG, parm0},
562 {69, "shl.c.alt", sIN_CSEG, parm1},
563 {68, "shl.c.pri", sIN_CSEG, parm1},
564 {66, "shr", sIN_CSEG, parm0},
565 {71, "shr.c.alt", sIN_CSEG, parm1},
566 {70, "shr.c.pri", sIN_CSEG, parm1},
567 {94, "sign.alt", sIN_CSEG, parm0},
568 {93, "sign.pri", sIN_CSEG, parm0},
569 {102, "sleq", sIN_CSEG, parm0},
570 {101, "sless", sIN_CSEG, parm0},
571 {72, "smul", sIN_CSEG, parm0},
572 {88, "smul.c", sIN_CSEG, parm1},
573 {127, "srange", sIN_CSEG, parm2}, /* version 1 */
574 {20, "sref.alt", sIN_CSEG, parm1},
575 {19, "sref.pri", sIN_CSEG, parm1},
576 {22, "sref.s.alt", sIN_CSEG, parm1},
577 {21, "sref.s.pri", sIN_CSEG, parm1},
578 {67, "sshr", sIN_CSEG, parm0},
579 {44, "stack", sIN_CSEG, parm1},
580 {0, "stksize", 0, noop},
581 {16, "stor.alt", sIN_CSEG, parm1},
582 {23, "stor.i", sIN_CSEG, parm0},
583 {15, "stor.pri", sIN_CSEG, parm1},
584 {18, "stor.s.alt", sIN_CSEG, parm1},
585 {17, "stor.s.pri", sIN_CSEG, parm1},
586 {24, "strb.i", sIN_CSEG, parm1},
587 {79, "sub", sIN_CSEG, parm0},
588 {80, "sub.alt", sIN_CSEG, parm0},
589 {132, "swap.alt", sIN_CSEG, parm0}, /* version 4 */
590 {131, "swap.pri", sIN_CSEG, parm0}, /* version 4 */
591 {129, "switch", sIN_CSEG, do_switch}, /* version 1 */
592 {126, "symbol", sIN_CSEG, do_symbol},
593 {136, "symtag", sIN_CSEG, parm1}, /* version 7 */
594 {123, "sysreq.c", sIN_CSEG, parm1},
595 {135, "sysreq.d", sIN_CSEG, parm1}, /* version 7, not generated directly */
596 {122, "sysreq.pri", sIN_CSEG, parm0},
597 {76, "udiv", sIN_CSEG, parm0},
598 {77, "udiv.alt", sIN_CSEG, parm0},
599 {75, "umul", sIN_CSEG, parm0},
600 {35, "xchg", sIN_CSEG, parm0},
601 {83, "xor", sIN_CSEG, parm0},
602 {91, "zero", sIN_CSEG, parm1},
603 {90, "zero.alt", sIN_CSEG, parm0},
604 {89, "zero.pri", sIN_CSEG, parm0},
605 {92, "zero.s", sIN_CSEG, parm1},
606};
607
608#define MAX_INSTR_LEN 30
609static int
610findopcode(char *instr, int maxlen)
611{
612 int low, high, mid, cmp;
613 char str[MAX_INSTR_LEN];
614
615 if (maxlen >= MAX_INSTR_LEN)
616 return 0;
617 strncpy(str, instr, maxlen);
618 str[maxlen] = '\0'; /* make sure the string is zero terminated */
619 /* look up the instruction with a binary search
620 * the assembler is case insensitive to instructions (but case sensitive
621 * to symbols)
622 */
623 low = 1; /* entry 0 is reserved (for "not found") */
624 high = (sizeof opcodelist / sizeof opcodelist[0]) - 1;
625 while (low < high)
626 {
627 mid = (low + high) / 2;
628 assert(opcodelist[mid].name != NULL);
629 cmp = strcasecmp(str, opcodelist[mid].name);
630 if (cmp > 0)
631 low = mid + 1;
632 else
633 high = mid;
634 } /* while */
635
636 assert(low == high);
637 if (strcasecmp(str, opcodelist[low].name) == 0)
638 return low; /* found */
639 return 0; /* not found, return special index */
640}
641
642void
643assemble(FILE * fout, FILE * fin)
644{
645 typedef struct tagFUNCSTUB
646 {
647 unsigned int address, nameofs;
648 } FUNCSTUB;
649 AMX_HEADER hdr;
650 FUNCSTUB func;
651 int numpublics, numnatives, numlibraries, numpubvars,
652 numtags, padding;
653 long nametablesize, nameofs;
654 char line[256], *instr, *params;
655 int i, pass;
656 short count;
657 symbol *sym, **nativelist;
658 constvalue *constptr;
659 cell mainaddr;
660 int nametable, tags, libraries, publics, natives, pubvars;
661 int cod, defsize;
662
663#if !defined NDEBUG
664 /* verify that the opcode list is sorted (skip entry 1; it is reserved
665 * for a non-existent opcode)
666 */
667 assert(opcodelist[1].name != NULL);
668 for (i = 2; i < (int)(sizeof(opcodelist) / sizeof(opcodelist[0])); i++)
669 {
670 assert(opcodelist[i].name != NULL);
671 assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0);
672 } /* for */
673#endif
674
675 writeerror = FALSE;
676 nametablesize = sizeof(short);
677 numpublics = 0;
678 numnatives = 0;
679 numpubvars = 0;
680 mainaddr = -1;
681 /* count number of public and native functions and public variables */
682 for (sym = glbtab.next; sym; sym = sym->next)
683 {
684 char alias[sNAMEMAX + 1] = "";
685 int match = 0;
686
687 if (sym->ident == iFUNCTN)
688 {
689 assert(strlen(sym->name) <= sNAMEMAX);
690 if ((sym->usage & uNATIVE) != 0 && (sym->usage & uREAD) != 0
691 && sym->addr >= 0)
692 {
693 match = ++numnatives;
694 if (!lookup_alias(alias, sym->name))
695 strcpy(alias, sym->name);
696 } /* if */
697 if ((sym->usage & uPUBLIC) != 0 && (sym->usage & uDEFINE) != 0)
698 {
699 match = ++numpublics;
700 strcpy(alias, sym->name);
701 } /* if */
702 if (strcmp(sym->name, uMAINFUNC) == 0)
703 {
704 assert(sym->vclass == sGLOBAL);
705 mainaddr = sym->addr;
706 } /* if */
707 }
708 else if (sym->ident == iVARIABLE)
709 {
710 if ((sym->usage & uPUBLIC) != 0)
711 {
712 match = ++numpubvars;
713 strcpy(alias, sym->name);
714 } /* if */
715 } /* if */
716 if (match)
717 {
718 assert(alias[0] != '\0');
719 nametablesize += strlen(alias) + 1;
720 } /* if */
721 } /* for */
722 assert(numnatives == ntv_funcid);
723
724 /* count number of libraries */
725 numlibraries = 0;
726 for (constptr = libname_tab.next; constptr;
727 constptr = constptr->next)
728 {
729 if (constptr->value > 0)
730 {
731 assert(constptr->name[0] != '\0');
732 numlibraries++;
733 nametablesize += strlen(constptr->name) + 1;
734 } /* if */
735 } /* for */
736
737 /* count number of public tags */
738 numtags = 0;
739 for (constptr = tagname_tab.next; constptr;
740 constptr = constptr->next)
741 {
742 if ((constptr->value & PUBLICTAG) != 0)
743 {
744 assert(constptr->name[0] != '\0');
745 numtags++;
746 nametablesize += strlen(constptr->name) + 1;
747 } /* if */
748 } /* for */
749
750 /* pad the header to sc_dataalign
751 * => thereby the code segment is aligned
752 * => since the code segment is padded to a sc_dataalign boundary, the data segment is aligned
753 * => and thereby the stack top is aligned too
754 */
755 assert(sc_dataalign != 0);
756 padding = sc_dataalign - (sizeof hdr + nametablesize) % sc_dataalign;
757 if (padding == sc_dataalign)
758 padding = 0;
759
760 /* write the abstract machine header */
761 memset(&hdr, 0, sizeof hdr);
762 hdr.magic = (unsigned short)0xF1E0;
763 hdr.file_version = CUR_FILE_VERSION;
764 hdr.amx_version = MIN_AMX_VERSION;
765 hdr.flags = (short)(sc_debug & sSYMBOLIC);
766 if (charbits == 16)
767 hdr.flags |= AMX_FLAG_CHAR16;
768 if (sc_compress)
769 hdr.flags |= AMX_FLAG_COMPACT;
770 if (sc_debug == 0)
771 hdr.flags |= AMX_FLAG_NOCHECKS;
772// #ifdef WORDS_BIGENDIAN
773// hdr.flags|=AMX_FLAG_BIGENDIAN;
774// #endif
775 defsize = hdr.defsize = sizeof(FUNCSTUB);
776 assert((hdr.defsize % sizeof(cell)) == 0);
777 publics = hdr.publics = sizeof hdr; /* public table starts right after the header */
778 natives = hdr.natives = hdr.publics + numpublics * sizeof(FUNCSTUB);
779 libraries = hdr.libraries = hdr.natives + numnatives * sizeof(FUNCSTUB);
780 pubvars = hdr.pubvars = hdr.libraries + numlibraries * sizeof(FUNCSTUB);
781 tags = hdr.tags = hdr.pubvars + numpubvars * sizeof(FUNCSTUB);
782 nametable = hdr.nametable = hdr.tags + numtags * sizeof(FUNCSTUB);
783 cod = hdr.cod = hdr.nametable + nametablesize + padding;
784 hdr.dat = hdr.cod + code_idx;
785 hdr.hea = hdr.dat + glb_declared * sizeof(cell);
786 hdr.stp = hdr.hea + sc_stksize * sizeof(cell);
787 hdr.cip = mainaddr;
788 hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */
789#ifdef WORDS_BIGENDIAN
790 align32(&hdr.size);
791 align16(&hdr.magic);
792 align16(&hdr.flags);
793 align16(&hdr.defsize);
794 align32(&hdr.cod);
795 align32(&hdr.dat);
796 align32(&hdr.hea);
797 align32(&hdr.stp);
798 align32(&hdr.cip);
799 align32(&hdr.publics);
800 align32(&hdr.natives);
801 align32(&hdr.libraries);
802 align32(&hdr.pubvars);
803 align32(&hdr.tags);
804 align32(&hdr.nametable);
805#endif
806 sc_writebin(fout, &hdr, sizeof hdr);
807
808 /* dump zeros up to the rest of the header, so that we can easily "seek" */
809 for (nameofs = sizeof hdr; nameofs < cod; nameofs++)
810 putc(0, fout);
811 nameofs = nametable + sizeof(short);
812
813 /* write the public functions table */
814 count = 0;
815 for (sym = glbtab.next; sym; sym = sym->next)
816 {
817 if (sym->ident == iFUNCTN
818 && (sym->usage & uPUBLIC) != 0 && (sym->usage & uDEFINE) != 0)
819 {
820 assert(sym->vclass == sGLOBAL);
821 func.address = sym->addr;
822 func.nameofs = nameofs;
823#ifdef WORDS_BIGENDIAN
824 align32(&func.address);
825 align32(&func.nameofs);
826#endif
827 fseek(fout, publics + count * sizeof(FUNCSTUB), SEEK_SET);
828 sc_writebin(fout, &func, sizeof func);
829 fseek(fout, nameofs, SEEK_SET);
830 sc_writebin(fout, sym->name, strlen(sym->name) + 1);
831 nameofs += strlen(sym->name) + 1;
832 count++;
833 } /* if */
834 } /* for */
835
836 /* write the natives table */
837 /* The native functions must be written in sorted order. (They are
838 * sorted on their "id", not on their name). A nested loop to find
839 * each successive function would be an O(n^2) operation. But we
840 * do not really need to sort, because the native function id's
841 * are sequential and there are no duplicates. So we first walk
842 * through the complete symbol list and store a pointer to every
843 * native function of interest in a temporary table, where its id
844 * serves as the index in the table. Now we can walk the table and
845 * have all native functions in sorted order.
846 */
847 if (numnatives > 0)
848 {
849 nativelist = (symbol **) malloc(numnatives * sizeof(symbol *));
850 if (!nativelist)
851 error(103); /* insufficient memory */
852#if !defined NDEBUG
853 memset(nativelist, 0, numnatives * sizeof(symbol *)); /* for NULL checking */
854#endif
855 for (sym = glbtab.next; sym; sym = sym->next)
856 {
857 if (sym->ident == iFUNCTN && (sym->usage & uNATIVE) != 0
858 && (sym->usage & uREAD) != 0 && sym->addr >= 0)
859 {
860 assert(sym->addr < numnatives);
861 nativelist[(int)sym->addr] = sym;
862 } /* if */
863 } /* for */
864 count = 0;
865 for (i = 0; i < numnatives; i++)
866 {
867 char alias[sNAMEMAX + 1];
868
869 sym = nativelist[i];
870 assert(sym != NULL);
871 if (!lookup_alias(alias, sym->name))
872 {
873 assert(strlen(sym->name) <= sNAMEMAX);
874 strcpy(alias, sym->name);
875 } /* if */
876 assert(sym->vclass == sGLOBAL);
877 func.address = 0;
878 func.nameofs = nameofs;
879#ifdef WORDS_BIGENDIAN
880 align32(&func.address);
881 align32(&func.nameofs);
882#endif
883 fseek(fout, natives + count * sizeof(FUNCSTUB), SEEK_SET);
884 sc_writebin(fout, &func, sizeof func);
885 fseek(fout, nameofs, SEEK_SET);
886 sc_writebin(fout, alias, strlen(alias) + 1);
887 nameofs += strlen(alias) + 1;
888 count++;
889 } /* for */
890 free(nativelist);
891 } /* if */
892
893 /* write the libraries table */
894 count = 0;
895 for (constptr = libname_tab.next; constptr;
896 constptr = constptr->next)
897 {
898 if (constptr->value > 0)
899 {
900 assert(constptr->name[0] != '\0');
901 func.address = 0;
902 func.nameofs = nameofs;
903#ifdef WORDS_BIGENDIAN
904 align32(&func.address);
905 align32(&func.nameofs);
906#endif
907 fseek(fout, libraries + count * sizeof(FUNCSTUB), SEEK_SET);
908 sc_writebin(fout, &func, sizeof func);
909 fseek(fout, nameofs, SEEK_SET);
910 sc_writebin(fout, constptr->name, strlen(constptr->name) + 1);
911 nameofs += strlen(constptr->name) + 1;
912 count++;
913 } /* if */
914 } /* for */
915
916 /* write the public variables table */
917 count = 0;
918 for (sym = glbtab.next; sym; sym = sym->next)
919 {
920 if (sym->ident == iVARIABLE && (sym->usage & uPUBLIC) != 0)
921 {
922 assert((sym->usage & uDEFINE) != 0);
923 assert(sym->vclass == sGLOBAL);
924 func.address = sym->addr;
925 func.nameofs = nameofs;
926#ifdef WORDS_BIGENDIAN
927 align32(&func.address);
928 align32(&func.nameofs);
929#endif
930 fseek(fout, pubvars + count * sizeof(FUNCSTUB), SEEK_SET);
931 sc_writebin(fout, &func, sizeof func);
932 fseek(fout, nameofs, SEEK_SET);
933 sc_writebin(fout, sym->name, strlen(sym->name) + 1);
934 nameofs += strlen(sym->name) + 1;
935 count++;
936 } /* if */
937 } /* for */
938
939 /* write the public tagnames table */
940 count = 0;
941 for (constptr = tagname_tab.next; constptr;
942 constptr = constptr->next)
943 {
944 if ((constptr->value & PUBLICTAG) != 0)
945 {
946 assert(constptr->name[0] != '\0');
947 func.address = constptr->value & TAGMASK;
948 func.nameofs = nameofs;
949#ifdef WORDS_BIGENDIAN
950 align32(&func.address);
951 align32(&func.nameofs);
952#endif
953 fseek(fout, tags + count * sizeof(FUNCSTUB), SEEK_SET);
954 sc_writebin(fout, &func, sizeof func);
955 fseek(fout, nameofs, SEEK_SET);
956 sc_writebin(fout, constptr->name, strlen(constptr->name) + 1);
957 nameofs += strlen(constptr->name) + 1;
958 count++;
959 } /* if */
960 } /* for */
961
962 /* write the "maximum name length" field in the name table */
963 assert(nameofs == nametable + nametablesize);
964 fseek(fout, nametable, SEEK_SET);
965 count = sNAMEMAX;
966#ifdef WORDS_BIGENDIAN
967 align16(&count);
968#endif
969 sc_writebin(fout, &count, sizeof count);
970 fseek(fout, cod, SEEK_SET);
971
972 /* First pass: relocate all labels */
973 /* This pass is necessary because the code addresses of labels is only known
974 * after the peephole optimization flag. Labels can occur inside expressions
975 * (e.g. the conditional operator), which are optimized.
976 */
977 lbltab = NULL;
978 if (labnum > 0)
979 {
980 /* only very short programs have zero labels; no first pass is needed
981 * if there are no labels */
982 lbltab = (cell *) malloc(labnum * sizeof(cell));
983 if (!lbltab)
984 error(103); /* insufficient memory */
985 codeindex = 0;
986 sc_resetasm(fin);
987 while (sc_readasm(fin, line, sizeof line))
988 {
989 stripcomment(line);
990 instr = skipwhitespace(line);
991 /* ignore empty lines */
992 if (*instr == '\0')
993 continue;
994 if (tolower(*instr) == 'l' && *(instr + 1) == '.')
995 {
996 int lindex = (int)hex2long(instr + 2, NULL);
997
998 assert(lindex < labnum);
999 lbltab[lindex] = codeindex;
1000 }
1001 else
1002 {
1003 /* get to the end of the instruction (make use of the '\n' that fgets()
1004 * added at the end of the line; this way we will *always* drop on a
1005 * whitespace character) */
1006 for (params = instr; *params != '\0' && !isspace(*params);
1007 params++)
1008 /* nothing */ ;
1009 assert(params > instr);
1010 i = findopcode(instr, (int)(params - instr));
1011 if (!opcodelist[i].name)
1012 {
1013 *params = '\0';
1014 error(104, instr); /* invalid assembler instruction */
1015 } /* if */
1016 if (opcodelist[i].segment == sIN_CSEG)
1017 codeindex +=
1018 opcodelist[i].func(NULL, skipwhitespace(params),
1019 opcodelist[i].opcode);
1020 } /* if */
1021 } /* while */
1022 } /* if */
1023
1024 /* Second pass (actually 2 more passes, one for all code and one for all data) */
1025 bytes_in = 0;
1026 bytes_out = 0;
1027 for (pass = sIN_CSEG; pass <= sIN_DSEG; pass++)
1028 {
1029 sc_resetasm(fin);
1030 while (sc_readasm(fin, line, sizeof line))
1031 {
1032 stripcomment(line);
1033 instr = skipwhitespace(line);
1034 /* ignore empty lines and labels (labels have a special syntax, so these
1035 * must be parsed separately) */
1036 if (*instr == '\0' || (tolower(*instr) == 'l'
1037 && *(instr + 1) == '.'))
1038 continue;
1039 /* get to the end of the instruction (make use of the '\n' that fgets()
1040 * added at the end of the line; this way we will *always* drop on a
1041 * whitespace character) */
1042 for (params = instr; *params != '\0' && !isspace(*params);
1043 params++)
1044 /* nothing */ ;
1045 assert(params > instr);
1046 i = findopcode(instr, (int)(params - instr));
1047 assert(opcodelist[i].name != NULL);
1048 if (opcodelist[i].segment == pass)
1049 opcodelist[i].func(fout, skipwhitespace(params),
1050 opcodelist[i].opcode);
1051 } /* while */
1052 } /* for */
1053 if (bytes_out - bytes_in > 0)
1054 error(106); /* compression buffer overflow */
1055
1056 if (lbltab)
1057 {
1058 free(lbltab);
1059#if !defined NDEBUG
1060 lbltab = NULL;
1061#endif
1062 } /* if */
1063
1064 if (writeerror)
1065 error(101, "disk full");
1066
1067 /* adjust the header */
1068 if (sc_compress)
1069 {
1070 hdr.size = sc_lengthbin(fout);
1071#ifdef WORDS_BIGENDIAN
1072 align32(&hdr.size);
1073#endif
1074 sc_resetbin(fout); /* "size" is the very first field */
1075 sc_writebin(fout, &hdr.size, sizeof hdr.size);
1076 } /* if */
1077}
diff --git a/libraries/embryo/src/bin/embryo_cc_sc7.c b/libraries/embryo/src/bin/embryo_cc_sc7.c
new file mode 100644
index 0000000..a2f9f4c
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc7.c
@@ -0,0 +1,688 @@
1/* Small compiler - Staging buffer and optimizer
2 *
3 * The staging buffer
4 * ------------------
5 * The staging buffer allows buffered output of generated code, deletion
6 * of redundant code, optimization by a tinkering process and reversing
7 * the ouput of evaluated expressions (which is used for the reversed
8 * evaluation of arguments in functions).
9 * Initially, stgwrite() writes to the file directly, but after a call to
10 * stgset(TRUE), output is redirected to the buffer. After a call to
11 * stgset(FALSE), stgwrite()'s output is directed to the file again. Thus
12 * only one routine is used for writing to the output, which can be
13 * buffered output or direct output.
14 *
15 * staging buffer variables: stgbuf - the buffer
16 * stgidx - current index in the staging buffer
17 * staging - if true, write to the staging buffer;
18 * if false, write to file directly.
19 *
20 * Copyright (c) ITB CompuPhase, 1997-2003
21 *
22 * This software is provided "as-is", without any express or implied warranty.
23 * In no event will the authors be held liable for any damages arising from
24 * the use of this software.
25 *
26 * Permission is granted to anyone to use this software for any purpose,
27 * including commercial applications, and to alter it and redistribute it
28 * freely, subject to the following restrictions:
29 *
30 * 1. The origin of this software must not be misrepresented; you must not
31 * claim that you wrote the original software. If you use this software in
32 * a product, an acknowledgment in the product documentation would be
33 * appreciated but is not required.
34 * 2. Altered source versions must be plainly marked as such, and must not be
35 * misrepresented as being the original software.
36 * 3. This notice may not be removed or altered from any source distribution.
37 *
38 * Version: $Id: embryo_cc_sc7.c 52451 2010-09-19 03:00:12Z raster $
39 */
40
41
42#ifdef HAVE_CONFIG_H
43# include <config.h>
44#endif
45
46#include <assert.h>
47#include <stdio.h>
48#include <stdlib.h> /* for atoi() */
49#include <string.h>
50#include <ctype.h>
51
52#include "embryo_cc_sc.h"
53
54#if defined _MSC_VER
55#pragma warning(push)
56#pragma warning(disable:4125) /* decimal digit terminates octal escape sequence */
57#endif
58
59#include "embryo_cc_sc7.scp"
60
61#if defined _MSC_VER
62#pragma warning(pop)
63#endif
64
65static void stgstring(char *start, char *end);
66static void stgopt(char *start, char *end);
67
68#define sSTG_GROW 512
69#define sSTG_MAX 20480
70
71static char *stgbuf = NULL;
72static int stgmax = 0; /* current size of the staging buffer */
73
74#define CHECK_STGBUFFER(index) if ((int)(index)>=stgmax) grow_stgbuffer((index)+1)
75
76static void
77grow_stgbuffer(int requiredsize)
78{
79 char *p;
80 int clear = !stgbuf; /* if previously none, empty buffer explicitly */
81
82 assert(stgmax < requiredsize);
83 /* if the staging buffer (holding intermediate code for one line) grows
84 * over a few kBytes, there is probably a run-away expression
85 */
86 if (requiredsize > sSTG_MAX)
87 error(102, "staging buffer"); /* staging buffer overflow (fatal error) */
88 stgmax = requiredsize + sSTG_GROW;
89 if (stgbuf)
90 p = (char *)realloc(stgbuf, stgmax * sizeof(char));
91 else
92 p = (char *)malloc(stgmax * sizeof(char));
93 if (!p)
94 error(102, "staging buffer"); /* staging buffer overflow (fatal error) */
95 stgbuf = p;
96 if (clear)
97 *stgbuf = '\0';
98}
99
100void
101stgbuffer_cleanup(void)
102{
103 if (stgbuf)
104 {
105 free(stgbuf);
106 stgbuf = NULL;
107 stgmax = 0;
108 } /* if */
109}
110
111/* the variables "stgidx" and "staging" are declared in "scvars.c" */
112
113/* stgmark
114 *
115 * Copies a mark into the staging buffer. At this moment there are three
116 * possible marks:
117 * sSTARTREORDER identifies the beginning of a series of expression
118 * strings that must be written to the output file in
119 * reordered order
120 * sENDREORDER identifies the end of 'reverse evaluation'
121 * sEXPRSTART + idx only valid within a block that is evaluated in
122 * reordered order, it identifies the start of an
123 * expression; the "idx" value is the argument position
124 *
125 * Global references: stgidx (altered)
126 * stgbuf (altered)
127 * staging (referred to only)
128 */
129void
130stgmark(char mark)
131{
132 if (staging)
133 {
134 CHECK_STGBUFFER(stgidx);
135 stgbuf[stgidx++] = mark;
136 } /* if */
137}
138
139static int
140filewrite(char *str)
141{
142 if (sc_status == statWRITE)
143 return sc_writeasm(outf, str);
144 return TRUE;
145}
146
147/* stgwrite
148 *
149 * Writes the string "st" to the staging buffer or to the output file. In the
150 * case of writing to the staging buffer, the terminating byte of zero is
151 * copied too, but... the optimizer can only work on complete lines (not on
152 * fractions of it. Therefore if the string is staged, if the last character
153 * written to the buffer is a '\0' and the previous-to-last is not a '\n',
154 * the string is concatenated to the last string in the buffer (the '\0' is
155 * overwritten). This also means an '\n' used in the middle of a string isn't
156 * recognized and could give wrong results with the optimizer.
157 * Even when writing to the output file directly, all strings are buffered
158 * until a whole line is complete.
159 *
160 * Global references: stgidx (altered)
161 * stgbuf (altered)
162 * staging (referred to only)
163 */
164void
165stgwrite(char *st)
166{
167 int len;
168
169 CHECK_STGBUFFER(0);
170 if (staging)
171 {
172 if (stgidx >= 2 && stgbuf[stgidx - 1] == '\0'
173 && stgbuf[stgidx - 2] != '\n')
174 stgidx -= 1; /* overwrite last '\0' */
175 while (*st != '\0')
176 { /* copy to staging buffer */
177 CHECK_STGBUFFER(stgidx);
178 stgbuf[stgidx++] = *st++;
179 } /* while */
180 CHECK_STGBUFFER(stgidx);
181 stgbuf[stgidx++] = '\0';
182 }
183 else
184 {
185 CHECK_STGBUFFER(strlen(stgbuf) + strlen(st) + 1);
186 strcat(stgbuf, st);
187 len = strlen(stgbuf);
188 if (len > 0 && stgbuf[len - 1] == '\n')
189 {
190 filewrite(stgbuf);
191 stgbuf[0] = '\0';
192 } /* if */
193 } /* if */
194}
195
196/* stgout
197 *
198 * Writes the staging buffer to the output file via stgstring() (for
199 * reversing expressions in the buffer) and stgopt() (for optimizing). It
200 * resets "stgidx".
201 *
202 * Global references: stgidx (altered)
203 * stgbuf (referred to only)
204 * staging (referred to only)
205 */
206void
207stgout(int index)
208{
209 if (!staging)
210 return;
211 stgstring(&stgbuf[index], &stgbuf[stgidx]);
212 stgidx = index;
213}
214
215typedef struct
216{
217 char *start, *end;
218} argstack;
219
220/* stgstring
221 *
222 * Analyses whether code strings should be output to the file as they appear
223 * in the staging buffer or whether portions of it should be re-ordered.
224 * Re-ordering takes place in function argument lists; Small passes arguments
225 * to functions from right to left. When arguments are "named" rather than
226 * positional, the order in the source stream is indeterminate.
227 * This function calls itself recursively in case it needs to re-order code
228 * strings, and it uses a private stack (or list) to mark the start and the
229 * end of expressions in their correct (reversed) order.
230 * In any case, stgstring() sends a block as large as possible to the
231 * optimizer stgopt().
232 *
233 * In "reorder" mode, each set of code strings must start with the token
234 * sEXPRSTART, even the first. If the token sSTARTREORDER is represented
235 * by '[', sENDREORDER by ']' and sEXPRSTART by '|' the following applies:
236 * '[]...' valid, but useless; no output
237 * '[|...] valid, but useless; only one string
238 * '[|...|...] valid and useful
239 * '[...|...] invalid, first string doesn't start with '|'
240 * '[|...|] invalid
241 */
242static void
243stgstring(char *start, char *end)
244{
245 char *ptr;
246 int nest, argc, arg;
247 argstack *stack;
248
249 while (start < end)
250 {
251 if (*start == sSTARTREORDER)
252 {
253 start += 1; /* skip token */
254 /* allocate a argstack with sMAXARGS items */
255 stack = (argstack *) malloc(sMAXARGS * sizeof(argstack));
256 if (!stack)
257 error(103); /* insufficient memory */
258 nest = 1; /* nesting counter */
259 argc = 0; /* argument counter */
260 arg = -1; /* argument index; no valid argument yet */
261 do
262 {
263 switch (*start)
264 {
265 case sSTARTREORDER:
266 nest++;
267 start++;
268 break;
269 case sENDREORDER:
270 nest--;
271 start++;
272 break;
273 default:
274 if ((*start & sEXPRSTART) == sEXPRSTART)
275 {
276 if (nest == 1)
277 {
278 if (arg >= 0)
279 stack[arg].end = start - 1; /* finish previous argument */
280 arg = (unsigned char)*start - sEXPRSTART;
281 stack[arg].start = start + 1;
282 if (arg >= argc)
283 argc = arg + 1;
284 } /* if */
285 start++;
286 }
287 else
288 {
289 start += strlen(start) + 1;
290 } /* if */
291 } /* switch */
292 }
293 while (nest); /* enddo */
294 if (arg >= 0)
295 stack[arg].end = start - 1; /* finish previous argument */
296 while (argc > 0)
297 {
298 argc--;
299 stgstring(stack[argc].start, stack[argc].end);
300 } /* while */
301 free(stack);
302 }
303 else
304 {
305 ptr = start;
306 while (ptr < end && *ptr != sSTARTREORDER)
307 ptr += strlen(ptr) + 1;
308 stgopt(start, ptr);
309 start = ptr;
310 } /* if */
311 } /* while */
312}
313
314/* stgdel
315 *
316 * Scraps code from the staging buffer by resetting "stgidx" to "index".
317 *
318 * Global references: stgidx (altered)
319 * staging (referred to only)
320 */
321void
322stgdel(int index, cell code_index)
323{
324 if (staging)
325 {
326 stgidx = index;
327 code_idx = code_index;
328 } /* if */
329}
330
331int
332stgget(int *index, cell * code_index)
333{
334 if (staging)
335 {
336 *index = stgidx;
337 *code_index = code_idx;
338 } /* if */
339 return staging;
340}
341
342/* stgset
343 *
344 * Sets staging on or off. If it's turned off, the staging buffer must be
345 * initialized to an empty string. If it's turned on, the routine makes sure
346 * the index ("stgidx") is set to 0 (it should already be 0).
347 *
348 * Global references: staging (altered)
349 * stgidx (altered)
350 * stgbuf (contents altered)
351 */
352void
353stgset(int onoff)
354{
355 staging = onoff;
356 if (staging)
357 {
358 assert(stgidx == 0);
359 stgidx = 0;
360 CHECK_STGBUFFER(stgidx);
361 /* write any contents that may be put in the buffer by stgwrite()
362 * when "staging" was 0
363 */
364 if (stgbuf[0] != '\0')
365 filewrite(stgbuf);
366 } /* if */
367 stgbuf[0] = '\0';
368}
369
370/* phopt_init
371 * Initialize all sequence strings of the peehole optimizer. The strings
372 * are embedded in the .EXE file in compressed format, here we expand
373 * them (and allocate memory for the sequences).
374 */
375static SEQUENCE *sequences;
376
377int
378phopt_init(void)
379{
380 int number, i, len;
381 char str[160];
382
383 /* count number of sequences */
384 for (number = 0; sequences_cmp[number].find; number++)
385 /* nothing */ ;
386 number++; /* include an item for the NULL terminator */
387
388 if (!(sequences = (SEQUENCE *)malloc(number * sizeof(SEQUENCE))))
389 return FALSE;
390
391 /* pre-initialize all to NULL (in case of failure) */
392 for (i = 0; i < number; i++)
393 {
394 sequences[i].find = NULL;
395 sequences[i].replace = NULL;
396 sequences[i].savesize = 0;
397 } /* for */
398
399 /* expand all strings */
400 for (i = 0; i < number - 1; i++)
401 {
402 len =
403 strexpand(str, (unsigned char *)sequences_cmp[i].find, sizeof str,
404 SCPACK_TABLE);
405 assert(len <= (int)(sizeof(str)));
406 assert(len == (int)(strlen(str) + 1));
407 sequences[i].find = (char *)malloc(len);
408 if (sequences[i].find)
409 strcpy(sequences[i].find, str);
410 len =
411 strexpand(str, (unsigned char *)sequences_cmp[i].replace, sizeof str,
412 SCPACK_TABLE);
413 assert(len <= (int)(sizeof(str)));
414 assert(len == (int)(strlen(str) + 1));
415 sequences[i].replace = (char *)malloc(len);
416 if (sequences[i].replace)
417 strcpy(sequences[i].replace, str);
418 sequences[i].savesize = sequences_cmp[i].savesize;
419 if (!sequences[i].find || !sequences[i].replace)
420 return phopt_cleanup();
421 } /* for */
422
423 return TRUE;
424}
425
426int
427phopt_cleanup(void)
428{
429 int i;
430
431 if (sequences)
432 {
433 i = 0;
434 while (sequences[i].find || sequences[i].replace)
435 {
436 if (sequences[i].find)
437 free(sequences[i].find);
438 if (sequences[i].replace)
439 free(sequences[i].replace);
440 i++;
441 } /* while */
442 free(sequences);
443 sequences = NULL;
444 } /* if */
445 return FALSE;
446}
447
448#define _maxoptvars 4
449#define _aliasmax 10 /* a 32-bit number can be represented in
450 * 9 decimal digits */
451
452static int
453matchsequence(char *start, char *end, char *pattern,
454 char symbols[_maxoptvars][_aliasmax + 1], int *match_length)
455{
456 int var, i;
457 char str[_aliasmax + 1];
458 char *start_org = start;
459
460 *match_length = 0;
461 for (var = 0; var < _maxoptvars; var++)
462 symbols[var][0] = '\0';
463
464 while (*start == '\t' || *start == ' ')
465 start++;
466 while (*pattern)
467 {
468 if (start >= end)
469 return FALSE;
470 switch (*pattern)
471 {
472 case '%': /* new "symbol" */
473 pattern++;
474 assert(isdigit(*pattern));
475 var = atoi(pattern) - 1;
476 assert(var >= 0 && var < _maxoptvars);
477 assert(alphanum(*start));
478 for (i = 0; start < end && alphanum(*start); i++, start++)
479 {
480 assert(i <= _aliasmax);
481 str[i] = *start;
482 } /* for */
483 str[i] = '\0';
484 if (symbols[var][0] != '\0')
485 {
486 if (strcmp(symbols[var], str) != 0)
487 return FALSE; /* symbols should be identical */
488 }
489 else
490 {
491 strcpy(symbols[var], str);
492 } /* if */
493 break;
494 case ' ':
495 if (*start != '\t' && *start != ' ')
496 return FALSE;
497 while ((start < end && *start == '\t') || *start == ' ')
498 start++;
499 break;
500 case '!':
501 while ((start < end && *start == '\t') || *start == ' ')
502 start++; /* skip trailing white space */
503 if (*start != '\n')
504 return FALSE;
505 assert(*(start + 1) == '\0');
506 start += 2; /* skip '\n' and '\0' */
507 if (*(pattern + 1) != '\0')
508 while ((start < end && *start == '\t') || *start == ' ')
509 start++; /* skip leading white space of next instruction */
510 break;
511 default:
512 if (tolower(*start) != tolower(*pattern))
513 return FALSE;
514 start++;
515 } /* switch */
516 pattern++;
517 } /* while */
518
519 *match_length = (int)(start - start_org);
520 return TRUE;
521}
522
523static char *
524replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
525 int *repl_length)
526{
527 char *lptr;
528 int var;
529 char *buffer;
530
531 /* calculate the length of the new buffer
532 * this is the length of the pattern plus the length of all symbols (note
533 * that the same symbol may occur multiple times in the pattern) plus
534 * line endings and startings ('\t' to start a line and '\n\0' to end one)
535 */
536 assert(repl_length != NULL);
537 *repl_length = 0;
538 lptr = pattern;
539 while (*lptr)
540 {
541 switch (*lptr)
542 {
543 case '%':
544 lptr++; /* skip '%' */
545 assert(isdigit(*lptr));
546 var = atoi(lptr) - 1;
547 assert(var >= 0 && var < _maxoptvars);
548 assert(symbols[var][0] != '\0'); /* variable should be defined */
549 *repl_length += strlen(symbols[var]);
550 break;
551 case '!':
552 *repl_length += 3; /* '\t', '\n' & '\0' */
553 break;
554 default:
555 *repl_length += 1;
556 } /* switch */
557 lptr++;
558 } /* while */
559
560 /* allocate a buffer to replace the sequence in */
561 if (!(buffer = malloc(*repl_length)))
562 {
563 error(103);
564 return NULL;
565 }
566
567 /* replace the pattern into this temporary buffer */
568 lptr = buffer;
569 *lptr++ = '\t'; /* the "replace" patterns do not have tabs */
570 while (*pattern)
571 {
572 assert((int)(lptr - buffer) < *repl_length);
573 switch (*pattern)
574 {
575 case '%':
576 /* write out the symbol */
577 pattern++;
578 assert(isdigit(*pattern));
579 var = atoi(pattern) - 1;
580 assert(var >= 0 && var < _maxoptvars);
581 assert(symbols[var][0] != '\0'); /* variable should be defined */
582 strcpy(lptr, symbols[var]);
583 lptr += strlen(symbols[var]);
584 break;
585 case '!':
586 /* finish the line, optionally start the next line with an indent */
587 *lptr++ = '\n';
588 *lptr++ = '\0';
589 if (*(pattern + 1) != '\0')
590 *lptr++ = '\t';
591 break;
592 default:
593 *lptr++ = *pattern;
594 } /* switch */
595 pattern++;
596 } /* while */
597
598 assert((int)(lptr - buffer) == *repl_length);
599 return buffer;
600}
601
602static void
603strreplace(char *dest, char *replace, int sub_length, int repl_length,
604 int dest_length)
605{
606 int offset = sub_length - repl_length;
607
608 if (offset > 0) /* delete a section */
609 memmove(dest, dest + offset, dest_length - offset);
610 else if (offset < 0) /* insert a section */
611 memmove(dest - offset, dest, dest_length);
612 memcpy(dest, replace, repl_length);
613}
614
615/* stgopt
616 *
617 * Optimizes the staging buffer by checking for series of instructions that
618 * can be coded more compact. The routine expects the lines in the staging
619 * buffer to be separated with '\n' and '\0' characters.
620 *
621 * The longest sequences must be checked first.
622 */
623
624static void
625stgopt(char *start, char *end)
626{
627 char symbols[_maxoptvars][_aliasmax + 1];
628 int seq, match_length, repl_length;
629
630 assert(sequences != NULL);
631 while (start < end)
632 {
633 if ((sc_debug & sNOOPTIMIZE) != 0 || sc_status != statWRITE)
634 {
635 /* do not match anything if debug-level is maximum */
636 filewrite(start);
637 }
638 else
639 {
640 seq = 0;
641 while (sequences[seq].find)
642 {
643 assert(seq >= 0);
644 if (matchsequence
645 (start, end, sequences[seq].find, symbols, &match_length))
646 {
647 char *replace =
648 replacesequence(sequences[seq].replace, symbols,
649 &repl_length);
650 /* If the replacement is bigger than the original section, we may need
651 * to "grow" the staging buffer. This is quite complex, due to the
652 * re-ordering of expressions that can also happen in the staging
653 * buffer. In addition, it should not happen: the peephole optimizer
654 * must replace sequences with *shorter* sequences, not longer ones.
655 * So, I simply forbid sequences that are longer than the ones they
656 * are meant to replace.
657 */
658 assert(match_length >= repl_length);
659 if (match_length >= repl_length)
660 {
661 strreplace(start, replace, match_length,
662 repl_length, (int)(end - start));
663 end -= match_length - repl_length;
664 free(replace);
665 code_idx -= sequences[seq].savesize;
666 seq = 0; /* restart search for matches */
667 }
668 else
669 {
670 /* actually, we should never get here (match_length<repl_length) */
671 assert(0);
672 seq++;
673 } /* if */
674 }
675 else
676 {
677 seq++;
678 } /* if */
679 } /* while */
680 assert(sequences[seq].find == NULL);
681 filewrite(start);
682 } /* if */
683 assert(start < end);
684 start += strlen(start) + 1; /* to next string */
685 } /* while (start<end) */
686}
687
688#undef SCPACK_TABLE
diff --git a/libraries/embryo/src/bin/embryo_cc_sc7.scp b/libraries/embryo/src/bin/embryo_cc_sc7.scp
new file mode 100644
index 0000000..15c80ac
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sc7.scp
@@ -0,0 +1,1473 @@
1/* Small compiler - Peephole optimizer "sequences" strings (plain
2 * and compressed formats)
3 *
4 * Copyright (c) ITB CompuPhase, 2000-2003
5 *
6 * This software is provided "as-is", without any express or implied warranty.
7 * In no event will the authors be held liable for any damages arising from
8 * the use of this software.
9 *
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
13 *
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software in
16 * a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 * 3. This notice may not be removed or altered from any source distribution.
21 *
22 * Version: $Id: embryo_cc_sc7.scp 35497 2008-08-17 07:44:18Z raster $
23 */
24
25int strexpand(char *dest, unsigned char *source, int maxlen,
26 unsigned char pairtable[128][2]);
27
28#define SCPACK_TERMINATOR , /* end each section with a comma */
29
30#define SCPACK_TABLE sequences_table
31/*-*SCPACK start of pair table, do not change or remove this line */
32unsigned char sequences_table[][2] = {
33 {32, 37}, {114, 105}, {112, 129}, {46, 130}, {49, 33}, {128, 132}, {97, 100},
34 {46, 97}, {135, 108}, {136, 116}, {111, 134}, {108, 138}, {50, 33}, {115,
35 104},
36 {128, 140}, {137, 33},
37 {46, 115}, {117, 141}, {112, 145}, {131, 133}, {139, 144}, {112, 143}, {131,
38 142},
39 {115, 116}, {111, 149}, {112, 152}, {131, 33}, {134, 100}, {110, 151},
40 {111, 156}, {99, 157}, {59, 36},
41 {146, 154}, {148, 150}, {112, 33}, {120, 162}, {101, 163}, {159, 164}, {137,
42 133},
43 {46, 99}, {122, 101}, {110, 100}, {155, 114}, {101, 113}, {168, 114},
44 {147, 160}, {51, 33}, {128, 174},
45 {103, 33}, {133, 165}, {104, 176}, {99, 178}, {120, 179}, {171, 33}, {106,
46 172},
47 {173, 161}, {155, 33}, {108, 167}, {117, 169}, {115, 175}, {186, 187},
48 {153, 184}, {141, 185}, {111, 188},
49 {98, 191}, {105, 100}, {115, 103}, {115, 108}, {193, 120}, {182, 133}, {114,
50 33},
51 {166, 161}, {190, 131}, {137, 142}, {169, 33}, {97, 202}, {139, 147},
52 {172, 111}, {158, 147}, {139, 150},
53 {105, 33}, {101, 115}, {209, 115}, {114, 116}, {148, 147}, {171, 133}, {189,
54 139},
55 {32, 140}, {146, 167}, {196, 170}, {158, 183}, {170, 183}, {199, 192},
56 {108, 196}, {97, 198}, {194, 211},
57 {46, 208}, {195, 210}, {200, 215}, {112, 222}, {159, 227}, {46, 98}, {118,
58 101},
59 {111, 230}, {109, 231}, {146, 143}, {99, 144}, {158, 150}, {97, 149},
60 {203, 153}, {52, 33}, {225, 33},
61 {158, 166}, {194, 181}, {195, 181}, {201, 180}, {223, 198}, {153, 203}, {214,
62 224},
63 {100, 101}, {128, 238}, {119, 236}, {249, 237}, {105, 110}, {115, 250},
64 {232, 143}, {205, 154}
65};
66/*-*SCPACK end of pair table, do not change or remove this line */
67
68#define seqsize(o,p) (opcodes(o)+opargs(p))
69typedef struct
70{
71 char *find;
72 char *replace;
73 int savesize; /* number of bytes saved (in bytecode) */
74} SEQUENCE;
75static SEQUENCE sequences_cmp[] = {
76 /* A very common sequence in four varieties
77 * load.s.pri n1 load.s.pri n2
78 * push.pri load.s.alt n1
79 * load.s.pri n2 -
80 * pop.alt -
81 * --------------------------------------
82 * load.pri n1 load.s.pri n2
83 * push.pri load.alt n1
84 * load.s.pri n2 -
85 * pop.alt -
86 * --------------------------------------
87 * load.s.pri n1 load.pri n2
88 * push.pri load.s.alt n1
89 * load.pri n2 -
90 * pop.alt -
91 * --------------------------------------
92 * load.pri n1 load.pri n2
93 * push.pri load.alt n1
94 * load.pri n2 -
95 * pop.alt -
96 */
97 {
98#ifdef SCPACK
99 "load.s.pri %1!push.pri!load.s.pri %2!pop.alt!",
100 "load.s.pri %2!load.s.alt %1!",
101#else
102 "\224\267\231",
103 "\241\224\246",
104#endif
105 seqsize(4, 2) - seqsize(2, 2)},
106 {
107#ifdef SCPACK
108 "load.pri %1!push.pri!load.s.pri %2!pop.alt!",
109 "load.s.pri %2!load.alt %1!",
110#else
111 "\213\267\231",
112 "\241\213\246",
113#endif
114 seqsize(4, 2) - seqsize(2, 2)},
115 {
116#ifdef SCPACK
117 "load.s.pri %1!push.pri!load.pri %2!pop.alt!",
118 "load.pri %2!load.s.alt %1!",
119#else
120 "\224\255\317\231",
121 "\317\224\246",
122#endif
123 seqsize(4, 2) - seqsize(2, 2)},
124 {
125#ifdef SCPACK
126 "load.pri %1!push.pri!load.pri %2!pop.alt!",
127 "load.pri %2!load.alt %1!",
128#else
129 "\213\255\317\231",
130 "\317\213\246",
131#endif
132 seqsize(4, 2) - seqsize(2, 2)},
133 /* (#1#) The above also occurs with "addr.pri" (array
134 * indexing) as the first line; so that adds 2 cases.
135 */
136 {
137#ifdef SCPACK
138 "addr.pri %1!push.pri!load.s.pri %2!pop.alt!",
139 "addr.alt %1!load.s.pri %2!",
140#else
141 "\333\231",
142 "\252\307",
143#endif
144 seqsize(4, 2) - seqsize(2, 2)},
145 {
146#ifdef SCPACK
147 "addr.pri %1!push.pri!load.pri %2!pop.alt!",
148 "addr.alt %1!load.pri %2!",
149#else
150 "\252\255\317\231",
151 "\252\246\317",
152#endif
153 seqsize(4, 2) - seqsize(2, 2)},
154 /* And the same sequence with const.pri as either the first
155 * or the second load instruction: four more cases.
156 */
157 {
158#ifdef SCPACK
159 "const.pri %1!push.pri!load.s.pri %2!pop.alt!",
160 "load.s.pri %2!const.alt %1!",
161#else
162 "\332\231",
163 "\241\360",
164#endif
165 seqsize(4, 2) - seqsize(2, 2)},
166 {
167#ifdef SCPACK
168 "const.pri %1!push.pri!load.pri %2!pop.alt!",
169 "load.pri %2!const.alt %1!",
170#else
171 "\236\255\317\231",
172 "\317\360",
173#endif
174 seqsize(4, 2) - seqsize(2, 2)},
175 {
176#ifdef SCPACK
177 "load.s.pri %1!push.pri!const.pri %2!pop.alt!",
178 "const.pri %2!load.s.alt %1!",
179#else
180 "\224\255\353\231",
181 "\353\224\246",
182#endif
183 seqsize(4, 2) - seqsize(2, 2)},
184 {
185#ifdef SCPACK
186 "load.pri %1!push.pri!const.pri %2!pop.alt!",
187 "const.pri %2!load.alt %1!",
188#else
189 "\213\255\353\231",
190 "\353\213\246",
191#endif
192 seqsize(4, 2) - seqsize(2, 2)},
193 /* The same as above, but now with "addr.pri" (array
194 * indexing) on the first line and const.pri on
195 * the second.
196 */
197 {
198#ifdef SCPACK
199 "addr.pri %1!push.pri!const.pri %2!pop.alt!",
200 "addr.alt %1!const.pri %2!",
201#else
202 "\252\255\353\231",
203 "\252\246\353",
204#endif
205 seqsize(4, 2) - seqsize(2, 2)},
206 /* ??? add references */
207 /* Chained relational operators can contain sequences like:
208 * move.pri load.s.pri n1
209 * push.pri -
210 * load.s.pri n1 -
211 * pop.alt -
212 * The above also accurs for "load.pri" and for "const.pri",
213 * so add another two cases.
214 */
215 {
216#ifdef SCPACK
217 "move.pri!push.pri!load.s.pri %1!pop.alt!",
218 "load.s.pri %1!",
219#else
220 "\350\232\240\324\231",
221 "\324",
222#endif
223 seqsize(4, 1) - seqsize(1, 1)},
224 {
225#ifdef SCPACK
226 "move.pri!push.pri!load.pri %1!pop.alt!",
227 "load.pri %1!",
228#else
229 "\350\232\240\314\231",
230 "\314",
231#endif
232 seqsize(4, 1) - seqsize(1, 1)},
233 {
234#ifdef SCPACK
235 "move.pri!push.pri!const.pri %1!pop.alt!",
236 "const.pri %1!",
237#else
238 "\350\232\240\316\231",
239 "\316",
240#endif
241 seqsize(4, 1) - seqsize(1, 1)},
242 /* More optimizations for chained relational operators; the
243 * continuation sequences can be simplified if they turn out
244 * to be termination sequences:
245 * xchg sless also for sless, sgeq and sleq
246 * sgrtr pop.alt
247 * swap.alt and
248 * and ;$exp
249 * pop.alt -
250 * ;$exp -
251 * --------------------------------------
252 * xchg sless also for sless, sgeq and sleq
253 * sgrtr pop.alt
254 * swap.alt and
255 * and jzer n1
256 * pop.alt -
257 * jzer n1 -
258 * --------------------------------------
259 * xchg jsgeq n1 also for sless, sgeq and sleq
260 * sgrtr ;$exp (occurs for non-chained comparisons)
261 * jzer n1 -
262 * ;$exp -
263 * --------------------------------------
264 * xchg sless also for sless, sgeq and sleq
265 * sgrtr ;$exp (occurs for non-chained comparisons)
266 * ;$exp -
267 */
268 {
269#ifdef SCPACK
270 "xchg!sgrtr!swap.alt!and!pop.alt!;$exp!",
271 "sless!pop.alt!and!;$exp!",
272#else
273 "\264\364\374\245",
274 "\357\365\245",
275#endif
276 seqsize(5, 0) - seqsize(3, 0)},
277 {
278#ifdef SCPACK
279 "xchg!sless!swap.alt!and!pop.alt!;$exp!",
280 "sgrtr!pop.alt!and!;$exp!",
281#else
282 "\264\357\374\245",
283 "\364\365\245",
284#endif
285 seqsize(5, 0) - seqsize(3, 0)},
286 {
287#ifdef SCPACK
288 "xchg!sgeq!swap.alt!and!pop.alt!;$exp!",
289 "sleq!pop.alt!and!;$exp!",
290#else
291 "\264\361\374\245",
292 "\362\365\245",
293#endif
294 seqsize(5, 0) - seqsize(3, 0)},
295 {
296#ifdef SCPACK
297 "xchg!sleq!swap.alt!and!pop.alt!;$exp!",
298 "sgeq!pop.alt!and!;$exp!",
299#else
300 "\264\362\374\245",
301 "\361\365\245",
302#endif
303 seqsize(5, 0) - seqsize(3, 0)},
304 {
305#ifdef SCPACK
306 "xchg!sgrtr!swap.alt!and!pop.alt!jzer %1!",
307 "sless!pop.alt!and!jzer %1!",
308#else
309 "\264\364\374\305",
310 "\357\365\305",
311#endif
312 seqsize(5, 0) - seqsize(3, 0)},
313 {
314#ifdef SCPACK
315 "xchg!sless!swap.alt!and!pop.alt!jzer %1!",
316 "sgrtr!pop.alt!and!jzer %1!",
317#else
318 "\264\357\374\305",
319 "\364\365\305",
320#endif
321 seqsize(5, 0) - seqsize(3, 0)},
322 {
323#ifdef SCPACK
324 "xchg!sgeq!swap.alt!and!pop.alt!jzer %1!",
325 "sleq!pop.alt!and!jzer %1!",
326#else
327 "\264\361\374\305",
328 "\362\365\305",
329#endif
330 seqsize(5, 0) - seqsize(3, 0)},
331 {
332#ifdef SCPACK
333 "xchg!sleq!swap.alt!and!pop.alt!jzer %1!",
334 "sgeq!pop.alt!and!jzer %1!",
335#else
336 "\264\362\374\305",
337 "\361\365\305",
338#endif
339 seqsize(5, 0) - seqsize(3, 0)},
340 {
341#ifdef SCPACK
342 "xchg!sgrtr!jzer %1!;$exp!",
343 "jsgeq %1!;$exp!",
344#else
345 "\264\364\266\261",
346 "j\302\253\261",
347#endif
348 seqsize(3, 1) - seqsize(1, 1)},
349 {
350#ifdef SCPACK
351 "xchg!sless!jzer %1!;$exp!",
352 "jsleq %1!;$exp!",
353#else
354 "\264\357\266\261",
355 "j\303\253\261",
356#endif
357 seqsize(3, 1) - seqsize(1, 1)},
358 {
359#ifdef SCPACK
360 "xchg!sgeq!jzer %1!;$exp!",
361 "jsgrtr %1!;$exp!",
362#else
363 "\264\361\266\261",
364 "j\337r\261",
365#endif
366 seqsize(3, 1) - seqsize(1, 1)},
367 {
368#ifdef SCPACK
369 "xchg!sleq!jzer %1!;$exp!",
370 "jsless %1!;$exp!",
371#else
372 "\264\362\266\261",
373 "j\341\261",
374#endif
375 seqsize(3, 1) - seqsize(1, 1)},
376 {
377#ifdef SCPACK
378 "xchg!sgrtr!;$exp!",
379 "sless!;$exp!",
380#else
381 "\264\364\245",
382 "\357\245",
383#endif
384 seqsize(2, 0) - seqsize(1, 0)},
385 {
386#ifdef SCPACK
387 "xchg!sless!;$exp!",
388 "sgrtr!;$exp!",
389#else
390 "\264\357\245",
391 "\364\245",
392#endif
393 seqsize(2, 0) - seqsize(1, 0)},
394 {
395#ifdef SCPACK
396 "xchg!sgeq!;$exp!",
397 "sleq!;$exp!",
398#else
399 "\264\361\245",
400 "\362\245",
401#endif
402 seqsize(2, 0) - seqsize(1, 0)},
403 {
404#ifdef SCPACK
405 "xchg!sleq!;$exp!",
406 "sgeq!;$exp!",
407#else
408 "\264\362\245",
409 "\361\245",
410#endif
411 seqsize(2, 0) - seqsize(1, 0)},
412 /* The entry to chained operators is also opt to optimization
413 * load.s.pri n1 load.s.pri n2
414 * load.s.alt n2 load.s.alt n1
415 * xchg -
416 * --------------------------------------
417 * load.s.pri n1 load.pri n2
418 * load.alt n2 load.s.alt n1
419 * xchg -
420 * --------------------------------------
421 * load.s.pri n1 const.pri n2
422 * const.alt n2 load.s.alt n1
423 * xchg -
424 * --------------------------------------
425 * and all permutations...
426 */
427 {
428#ifdef SCPACK
429 "load.s.pri %1!load.s.alt %2!xchg!",
430 "load.s.pri %2!load.s.alt %1!",
431#else
432 "\324\224\363",
433 "\241\224\246",
434#endif
435 seqsize(3, 2) - seqsize(2, 2)},
436 {
437#ifdef SCPACK
438 "load.s.pri %1!load.alt %2!xchg!",
439 "load.pri %2!load.s.alt %1!",
440#else
441 "\324\213\363",
442 "\317\224\246",
443#endif
444 seqsize(3, 2) - seqsize(2, 2)},
445 {
446#ifdef SCPACK
447 "load.s.pri %1!const.alt %2!xchg!",
448 "const.pri %2!load.s.alt %1!",
449#else
450 "\324\236\363",
451 "\353\224\246",
452#endif
453 seqsize(3, 2) - seqsize(2, 2)},
454 {
455#ifdef SCPACK
456 "load.pri %1!load.s.alt %2!xchg!",
457 "load.s.pri %2!load.alt %1!",
458#else
459 "\314\224\363",
460 "\241\213\246",
461#endif
462 seqsize(3, 2) - seqsize(2, 2)},
463 {
464#ifdef SCPACK
465 "load.pri %1!load.alt %2!xchg!",
466 "load.pri %2!load.alt %1!",
467#else
468 "\314\213\363",
469 "\317\213\246",
470#endif
471 seqsize(3, 2) - seqsize(2, 2)},
472 {
473#ifdef SCPACK
474 "load.pri %1!const.alt %2!xchg!",
475 "const.pri %2!load.alt %1!",
476#else
477 "\314\236\363",
478 "\353\213\246",
479#endif
480 seqsize(3, 2) - seqsize(2, 2)},
481 {
482#ifdef SCPACK
483 "const.pri %1!load.s.alt %2!xchg!",
484 "load.s.pri %2!const.alt %1!",
485#else
486 "\316\224\363",
487 "\241\360",
488#endif
489 seqsize(3, 2) - seqsize(2, 2)},
490 {
491#ifdef SCPACK
492 "const.pri %1!load.alt %2!xchg!",
493 "load.pri %2!const.alt %1!",
494#else
495 "\316\213\363",
496 "\317\360",
497#endif
498 seqsize(3, 2) - seqsize(2, 2)},
499 /* Array indexing can merit from special instructions.
500 * Simple indexed array lookup can be optimized quite
501 * a bit.
502 * addr.pri n1 addr.alt n1
503 * push.pri load.s.pri n2
504 * load.s.pri n2 bounds n3
505 * bounds n3 lidx.b n4
506 * shl.c.pri n4 -
507 * pop.alt -
508 * add -
509 * load.i -
510 *
511 * And to prepare for storing a value in an array
512 * addr.pri n1 addr.alt n1
513 * push.pri load.s.pri n2
514 * load.s.pri n2 bounds n3
515 * bounds n3 idxaddr.b n4
516 * shl.c.pri n4 -
517 * pop.alt -
518 * add -
519 *
520 * Notes (additional cases):
521 * 1. instruction addr.pri can also be const.pri (for
522 * global arrays)
523 * 2. the bounds instruction can be absent
524 * 3. when "n4" (the shift value) is the 2 (with 32-bit cels), use the
525 * even more optimal instructions LIDX and IDDXADDR
526 *
527 * If the array index is more complex, one can only optimize
528 * the last four instructions:
529 * shl.c.pri n1 pop.alt
530 * pop.alt lidx.b n1
531 * add -
532 * loadi -
533 * --------------------------------------
534 * shl.c.pri n1 pop.alt
535 * pop.alt idxaddr.b n1
536 * add -
537 */
538#if !defined BIT16
539 /* loading from array, "cell" shifted */
540 {
541#ifdef SCPACK
542 "addr.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!load.i!",
543 "addr.alt %1!load.s.pri %2!bounds %3!lidx!",
544#else
545 "\333\300\342\366",
546 "\252\334\335!",
547#endif
548 seqsize(8, 4) - seqsize(4, 3)},
549 {
550#ifdef SCPACK
551 "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!load.i!",
552 "const.alt %1!load.s.pri %2!bounds %3!lidx!",
553#else
554 "\332\300\342\366",
555 "\236\334\335!",
556#endif
557 seqsize(8, 4) - seqsize(4, 3)},
558 {
559#ifdef SCPACK
560 "addr.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!load.i!",
561 "addr.alt %1!load.s.pri %2!lidx!",
562#else
563 "\333\342\366",
564 "\252\307\335!",
565#endif
566 seqsize(7, 3) - seqsize(3, 2)},
567 {
568#ifdef SCPACK
569 "const.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!load.i!",
570 "const.alt %1!load.s.pri %2!lidx!",
571#else
572 "\332\342\366",
573 "\236\307\335!",
574#endif
575 seqsize(7, 3) - seqsize(3, 2)},
576#endif
577 /* loading from array, not "cell" shifted */
578 {
579#ifdef SCPACK
580 "addr.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!load.i!",
581 "addr.alt %1!load.s.pri %2!bounds %3!lidx.b %4!",
582#else
583 "\333\300\310\370\366",
584 "\252\334\335\345\370",
585#endif
586 seqsize(8, 4) - seqsize(4, 4)},
587 {
588#ifdef SCPACK
589 "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!load.i!",
590 "const.alt %1!load.s.pri %2!bounds %3!lidx.b %4!",
591#else
592 "\332\300\310\370\366",
593 "\236\334\335\345\370",
594#endif
595 seqsize(8, 4) - seqsize(4, 4)},
596 {
597#ifdef SCPACK
598 "addr.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!load.i!",
599 "addr.alt %1!load.s.pri %2!lidx.b %3!",
600#else
601 "\333\310\257\366",
602 "\252\307\335\345\257",
603#endif
604 seqsize(7, 3) - seqsize(3, 3)},
605 {
606#ifdef SCPACK
607 "const.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!load.i!",
608 "const.alt %1!load.s.pri %2!lidx.b %3!",
609#else
610 "\332\310\257\366",
611 "\236\307\335\345\257",
612#endif
613 seqsize(7, 3) - seqsize(3, 3)},
614#if !defined BIT16
615 /* array index calculation for storing a value, "cell" aligned */
616 {
617#ifdef SCPACK
618 "addr.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!",
619 "addr.alt %1!load.s.pri %2!bounds %3!idxaddr!",
620#else
621 "\333\300\342\275",
622 "\252\334\331!",
623#endif
624 seqsize(7, 4) - seqsize(4, 3)},
625 {
626#ifdef SCPACK
627 "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!",
628 "const.alt %1!load.s.pri %2!bounds %3!idxaddr!",
629#else
630 "\332\300\342\275",
631 "\236\334\331!",
632#endif
633 seqsize(7, 4) - seqsize(4, 3)},
634 {
635#ifdef SCPACK
636 "addr.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!",
637 "addr.alt %1!load.s.pri %2!idxaddr!",
638#else
639 "\333\342\275",
640 "\252\307\331!",
641#endif
642 seqsize(6, 3) - seqsize(3, 2)},
643 {
644#ifdef SCPACK
645 "const.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!",
646 "const.alt %1!load.s.pri %2!idxaddr!",
647#else
648 "\332\342\275",
649 "\236\307\331!",
650#endif
651 seqsize(6, 3) - seqsize(3, 2)},
652#endif
653 /* array index calculation for storing a value, not "cell" packed */
654 {
655#ifdef SCPACK
656 "addr.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!",
657 "addr.alt %1!load.s.pri %2!bounds %3!idxaddr.b %4!",
658#else
659 "\333\300\310\370\275",
660 "\252\334\331\345\370",
661#endif
662 seqsize(7, 4) - seqsize(4, 4)},
663 {
664#ifdef SCPACK
665 "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!",
666 "const.alt %1!load.s.pri %2!bounds %3!idxaddr.b %4!",
667#else
668 "\332\300\310\370\275",
669 "\236\334\331\345\370",
670#endif
671 seqsize(7, 4) - seqsize(4, 4)},
672 {
673#ifdef SCPACK
674 "addr.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!",
675 "addr.alt %1!load.s.pri %2!idxaddr.b %3!",
676#else
677 "\333\310\257\275",
678 "\252\307\331\345\257",
679#endif
680 seqsize(6, 3) - seqsize(3, 3)},
681 {
682#ifdef SCPACK
683 "const.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!",
684 "const.alt %1!load.s.pri %2!idxaddr.b %3!",
685#else
686 "\332\310\257\275",
687 "\236\307\331\345\257",
688#endif
689 seqsize(6, 3) - seqsize(3, 3)},
690#if !defined BIT16
691 /* the shorter array indexing sequences, see above for comments */
692 {
693#ifdef SCPACK
694 "shl.c.pri 2!pop.alt!add!loadi!",
695 "pop.alt!lidx!",
696#else
697 "\342\326\320",
698 "\231\335!",
699#endif
700 seqsize(4, 1) - seqsize(2, 0)},
701 {
702#ifdef SCPACK
703 "shl.c.pri 2!pop.alt!add!",
704 "pop.alt!idxaddr!",
705#else
706 "\342\275",
707 "\231\331!",
708#endif
709 seqsize(3, 1) - seqsize(2, 0)},
710#endif
711 {
712#ifdef SCPACK
713 "shl.c.pri %1!pop.alt!add!loadi!",
714 "pop.alt!lidx.b %1!",
715#else
716 "\276\223\326\320",
717 "\231\335\345\205",
718#endif
719 seqsize(4, 1) - seqsize(2, 1)},
720 {
721#ifdef SCPACK
722 "shl.c.pri %1!pop.alt!add!",
723 "pop.alt!idxaddr.b %1!",
724#else
725 "\276\223\275",
726 "\231\331\345\205",
727#endif
728 seqsize(3, 1) - seqsize(2, 1)},
729 /* For packed arrays, there is another case (packed arrays
730 * do not take advantage of the LIDX or IDXADDR instructions).
731 * addr.pri n1 addr.alt n1
732 * push.pri load.s.pri n2
733 * load.s.pri n2 bounds n3
734 * bounds n3 -
735 * pop.alt -
736 *
737 * Notes (additional cases):
738 * 1. instruction addr.pri can also be const.pri (for
739 * global arrays)
740 * 2. the bounds instruction can be absent, but that
741 * case is already handled (see #1#)
742 */
743 {
744#ifdef SCPACK
745 "addr.pri %1!push.pri!load.s.pri %2!bounds %3!pop.alt!",
746 "addr.alt %1!load.s.pri %2!bounds %3!",
747#else
748 "\333\300\231",
749 "\252\334",
750#endif
751 seqsize(5, 3) - seqsize(3, 3)},
752 {
753#ifdef SCPACK
754 "const.pri %1!push.pri!load.s.pri %2!bounds %3!pop.alt!",
755 "const.alt %1!load.s.pri %2!bounds %3!",
756#else
757 "\332\300\231",
758 "\236\334",
759#endif
760 seqsize(5, 3) - seqsize(3, 3)},
761 /* During a calculation, the intermediate result must sometimes
762 * be moved from PRI to ALT, like in:
763 * push.pri move.alt
764 * load.s.pri n1 load.s.pri n1
765 * pop.alt -
766 *
767 * The above also accurs for "load.pri" and for "const.pri",
768 * so add another two cases.
769 */
770 {
771#ifdef SCPACK
772 "push.pri!load.s.pri %1!pop.alt!",
773 "move.alt!load.s.pri %1!",
774#else
775 "\240\324\231",
776 "\375\324",
777#endif
778 seqsize(3, 1) - seqsize(2, 1)},
779 {
780#ifdef SCPACK
781 "push.pri!load.pri %1!pop.alt!",
782 "move.alt!load.pri %1!",
783#else
784 "\240\314\231",
785 "\375\314",
786#endif
787 seqsize(3, 1) - seqsize(2, 1)},
788 {
789#ifdef SCPACK
790 "push.pri!const.pri %1!pop.alt!",
791 "move.alt!const.pri %1!",
792#else
793 "\240\316\231",
794 "\375\316",
795#endif
796 seqsize(3, 1) - seqsize(2, 1)},
797 {
798#ifdef SCPACK
799 "push.pri!zero.pri!pop.alt!",
800 "move.alt!zero.pri!",
801#else
802 "\240\376\231",
803 "\375\376",
804#endif
805 seqsize(3, 0) - seqsize(2, 0)},
806 /* saving PRI and then loading from its address
807 * occurs when indexing a multi-dimensional array
808 */
809 {
810#ifdef SCPACK
811 "push.pri!load.i!pop.alt!",
812 "move.alt!load.i!",
813#else
814 "\240\213\340\231",
815 "\375\213\340",
816#endif
817 seqsize(3, 0) - seqsize(2, 0)},
818 /* An even simpler PUSH/POP optimization (occurs in
819 * switch statements):
820 * push.pri move.alt
821 * pop.alt -
822 */
823 {
824#ifdef SCPACK
825 "push.pri!pop.alt!",
826 "move.alt!",
827#else
828 "\240\231",
829 "\375",
830#endif
831 seqsize(2, 0) - seqsize(1, 0)},
832 /* And what to think of this PUSH/POP sequence, which occurs
833 * due to the support for user-defined assignment operator):
834 * push.alt -
835 * pop.alt -
836 */
837//???
838//{
839// #ifdef SCPACK
840// "push.alt!pop.alt!",
841// ";$", /* SCPACK cannot handle empty strings */
842// #else
843// "\225\237",
844// "\353",
845// #endif
846// seqsize(2,0) - seqsize(0,0)
847//},
848 /* Functions with many parameters with the same default
849 * value have sequences like:
850 * push.c n1 const.pri n1
851 * ;$par push.r.pri n2 ; where n2 is the number of pushes
852 * push.c n1 ;$par
853 * ;$par -
854 * push.c n1 -
855 * ;$par -
856 * etc. etc.
857 * The shortest matched sequence is 3, because a sequence of two can also be
858 * optimized as two "push.c n1" instructions.
859 * => this optimization does not work, because the argument re-ordering in
860 * a function call causes each argument to be optimized individually
861 */
862//{
863// #ifdef SCPACK
864// "const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!",
865// "const.pri %1!push.r.pri 5!;$par!",
866// #else
867// "\327\327\254",
868// "\352\221.r\2745!",
869// #endif
870// seqsize(10,5) - seqsize(2,2)
871//},
872//{
873// #ifdef SCPACK
874// "const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!",
875// "const.pri %1!push.r.pri 4!;$par!",
876// #else
877// "\327\327",
878// "\352\221.r\274\326",
879// #endif
880// seqsize(8,4) - seqsize(2,2)
881//},
882//{
883// #ifdef SCPACK
884// "const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!const.pri %1!push.pri!;$par!",
885// "const.pri %1!push.r.pri 3!;$par!",
886// #else
887// "\327\254",
888// "\352\221.r\274\247",
889// #endif
890// seqsize(6,3) - seqsize(2,2)
891//},
892 /* User-defined operators first load the operands into registers and
893 * then have them pushed onto the stack. This can give rise to sequences
894 * like:
895 * const.pri n1 push.c n1
896 * const.alt n2 push.c n2
897 * push.pri -
898 * push.alt -
899 * A similar sequence occurs with the two PUSH.pri/alt instructions inverted.
900 * The first, second, or both CONST.pri/alt instructions can also be
901 * LOAD.pri/alt.
902 * This gives 2 x 4 cases.
903 */
904 {
905#ifdef SCPACK
906 "const.pri %1!const.alt %2!push.pri!push.alt!",
907 "push.c %1!push.c %2!",
908#else
909 "\316\236\311\240\351",
910 "\330\205\330\216",
911#endif
912 seqsize(4, 2) - seqsize(2, 2)},
913 {
914#ifdef SCPACK
915 "const.pri %1!const.alt %2!push.alt!push.pri!",
916 "push.c %2!push.c %1!",
917#else
918 "\316\236\311\351\240",
919 "\330\216\330\205",
920#endif
921 seqsize(4, 2) - seqsize(2, 2)},
922 {
923#ifdef SCPACK
924 "const.pri %1!load.alt %2!push.pri!push.alt!",
925 "push.c %1!push %2!",
926#else
927 "\316\213\311\240\351",
928 "\330\205\222\216",
929#endif
930 seqsize(4, 2) - seqsize(2, 2)},
931 {
932#ifdef SCPACK
933 "const.pri %1!load.alt %2!push.alt!push.pri!",
934 "push %2!push.c %1!",
935#else
936 "\316\213\311\351\240",
937 "\222\216\330\205",
938#endif
939 seqsize(4, 2) - seqsize(2, 2)},
940 {
941#ifdef SCPACK
942 "load.pri %1!const.alt %2!push.pri!push.alt!",
943 "push %1!push.c %2!",
944#else
945 "\314\236\311\240\351",
946 "\222\205\330\216",
947#endif
948 seqsize(4, 2) - seqsize(2, 2)},
949 {
950#ifdef SCPACK
951 "load.pri %1!const.alt %2!push.alt!push.pri!",
952 "push.c %2!push %1!",
953#else
954 "\314\236\311\351\240",
955 "\330\216\222\205",
956#endif
957 seqsize(4, 2) - seqsize(2, 2)},
958 {
959#ifdef SCPACK
960 "load.pri %1!load.alt %2!push.pri!push.alt!",
961 "push %1!push %2!",
962#else
963 "\314\213\311\240\351",
964 "\222\205\222\216",
965#endif
966 seqsize(4, 2) - seqsize(2, 2)},
967 {
968#ifdef SCPACK
969 "load.pri %1!load.alt %2!push.alt!push.pri!",
970 "push %2!push %1!",
971#else
972 "\314\213\311\351\240",
973 "\222\216\222\205",
974#endif
975 seqsize(4, 2) - seqsize(2, 2)},
976 /* Function calls (parameters are passed on the stack)
977 * load.s.pri n1 push.s n1
978 * push.pri -
979 * --------------------------------------
980 * load.pri n1 push n1
981 * push.pri -
982 * --------------------------------------
983 * const.pri n1 push.c n1
984 * push.pri -
985 * --------------------------------------
986 * zero.pri push.c 0
987 * push.pri -
988 * --------------------------------------
989 * addr.pri n1 pushaddr n1
990 * push.pri -
991 *
992 * However, PRI must not be needed after this instruction
993 * if this shortcut is used. Check for the ;$par comment.
994 */
995 {
996#ifdef SCPACK
997 "load.s.pri %1!push.pri!;$par!",
998 "push.s %1!;$par!",
999#else
1000 "\224\255\344",
1001 "\222\220\205\344",
1002#endif
1003 seqsize(2, 1) - seqsize(1, 1)},
1004 {
1005#ifdef SCPACK
1006 "load.pri %1!push.pri!;$par!",
1007 "push %1!;$par!",
1008#else
1009 "\213\255\344",
1010 "\222\205\344",
1011#endif
1012 seqsize(2, 1) - seqsize(1, 1)},
1013 {
1014#ifdef SCPACK
1015 "const.pri %1!push.pri!;$par!",
1016 "push.c %1!;$par!",
1017#else
1018 "\236\255\344",
1019 "\330\205\344",
1020#endif
1021 seqsize(2, 1) - seqsize(1, 1)},
1022 {
1023#ifdef SCPACK
1024 "zero.pri!push.pri!;$par!",
1025 "push.c 0!;$par!",
1026#else
1027 "\376\240\344",
1028 "\330 0!\344",
1029#endif
1030 seqsize(2, 0) - seqsize(1, 1)},
1031 {
1032#ifdef SCPACK
1033 "addr.pri %1!push.pri!;$par!",
1034 "pushaddr %1!;$par!",
1035#else
1036 "\252\255\344",
1037 "\222\252\205\344",
1038#endif
1039 seqsize(2, 1) - seqsize(1, 1)},
1040 /* References with a default value generate new cells on the heap
1041 * dynamically. That code often ends with:
1042 * move.pri push.alt
1043 * push.pri -
1044 */
1045 {
1046#ifdef SCPACK
1047 "move.pri!push.pri!",
1048 "push.alt!",
1049#else
1050 "\350\232\240",
1051 "\351",
1052#endif
1053 seqsize(2, 0) - seqsize(1, 0)},
1054 /* Simple arithmetic operations on constants. Noteworthy is the
1055 * subtraction of a constant, since it is converted to the addition
1056 * of the inverse value.
1057 * const.alt n1 add.c n1
1058 * add -
1059 * --------------------------------------
1060 * const.alt n1 add.c -n1
1061 * sub -
1062 * --------------------------------------
1063 * const.alt n1 smul.c n1
1064 * smul -
1065 * --------------------------------------
1066 * const.alt n1 eq.c.pri n1
1067 * eq -
1068 */
1069 {
1070#ifdef SCPACK
1071 "const.alt %1!add!",
1072 "add.c %1!",
1073#else
1074 "\360\270",
1075 "\233\247\205",
1076#endif
1077 seqsize(2, 1) - seqsize(1, 1)},
1078 {
1079#ifdef SCPACK
1080 "const.alt %1!sub!",
1081 "add.c -%1!",
1082#else
1083 "\360sub!",
1084 "\233\247 -%\204",
1085#endif
1086 seqsize(2, 1) - seqsize(1, 1)},
1087 {
1088#ifdef SCPACK
1089 "const.alt %1!smul!",
1090 "smul.c %1!",
1091#else
1092 "\360smul!",
1093 "smu\271\205",
1094#endif
1095 seqsize(2, 1) - seqsize(1, 1)},
1096 {
1097#ifdef SCPACK
1098 "const.alt %1!eq!",
1099 "eq.c.pri %1!",
1100#else
1101 "\360\265",
1102 "\253\247\223",
1103#endif
1104 seqsize(2, 1) - seqsize(1, 1)},
1105 /* Some operations use the alternative subtraction operation --these
1106 * can also be optimized.
1107 * const.pri n1 load.s.pri n2
1108 * load.s.alt n2 add.c -n1
1109 * sub.alt -
1110 * --------------------------------------
1111 * const.pri n1 load.pri n2
1112 * load.alt n2 add.c -n1
1113 * sub.alt -
1114 */
1115 {
1116#ifdef SCPACK
1117 "const.pri %1!load.s.alt %2!sub.alt!",
1118 "load.s.pri %2!add.c -%1!",
1119#else
1120 "\316\224\311sub\217",
1121 "\241\233\247 -%\204",
1122#endif
1123 seqsize(3, 2) - seqsize(2, 2)},
1124 {
1125#ifdef SCPACK
1126 "const.pri %1!load.alt %2!sub.alt!",
1127 "load.pri %2!add.c -%1!",
1128#else
1129 "\316\213\311sub\217",
1130 "\317\233\247 -%\204",
1131#endif
1132 seqsize(3, 2) - seqsize(2, 2)},
1133 /* Compare and jump
1134 * eq jneq n1
1135 * jzer n1 -
1136 * --------------------------------------
1137 * eq jeq n1
1138 * jnz n1 -
1139 * --------------------------------------
1140 * neq jeq n1
1141 * jzer n1 -
1142 * --------------------------------------
1143 * neq jneq n1
1144 * jnz n1 -
1145 * Compares followed by jzer occur much more
1146 * often than compares followed with jnz. So we
1147 * take the easy route here.
1148 * less jgeq n1
1149 * jzer n1 -
1150 * --------------------------------------
1151 * leq jgrtr n1
1152 * jzer n1 -
1153 * --------------------------------------
1154 * grtr jleq n1
1155 * jzer n1 -
1156 * --------------------------------------
1157 * geq jless n1
1158 * jzer n1 -
1159 * --------------------------------------
1160 * sless jsgeq n1
1161 * jzer n1 -
1162 * --------------------------------------
1163 * sleq jsgrtr n1
1164 * jzer n1 -
1165 * --------------------------------------
1166 * sgrtr jsleq n1
1167 * jzer n1 -
1168 * --------------------------------------
1169 * sgeq jsless n1
1170 * jzer n1 -
1171 */
1172 {
1173#ifdef SCPACK
1174 "eq!jzer %1!",
1175 "jneq %1!",
1176#else
1177 "\265\305",
1178 "jn\325",
1179#endif
1180 seqsize(2, 1) - seqsize(1, 1)},
1181 {
1182#ifdef SCPACK
1183 "eq!jnz %1!",
1184 "jeq %1!",
1185#else
1186 "\265jnz\205",
1187 "j\325",
1188#endif
1189 seqsize(2, 1) - seqsize(1, 1)},
1190 {
1191#ifdef SCPACK
1192 "neq!jzer %1!",
1193 "jeq %1!",
1194#else
1195 "n\265\305",
1196 "j\325",
1197#endif
1198 seqsize(2, 1) - seqsize(1, 1)},
1199 {
1200#ifdef SCPACK
1201 "neq!jnz %1!",
1202 "jneq %1!",
1203#else
1204 "n\265jnz\205",
1205 "jn\325",
1206#endif
1207 seqsize(2, 1) - seqsize(1, 1)},
1208 {
1209#ifdef SCPACK
1210 "less!jzer %1!",
1211 "jgeq %1!",
1212#else
1213 "l\322!\305",
1214 "jg\325",
1215#endif
1216 seqsize(2, 1) - seqsize(1, 1)},
1217 {
1218#ifdef SCPACK
1219 "leq!jzer %1!",
1220 "jgrtr %1!",
1221#else
1222 "l\265\305",
1223 "jg\323r\205",
1224#endif
1225 seqsize(2, 1) - seqsize(1, 1)},
1226 {
1227#ifdef SCPACK
1228 "grtr!jzer %1!",
1229 "jleq %1!",
1230#else
1231 "g\323\306\305",
1232 "jl\325",
1233#endif
1234 seqsize(2, 1) - seqsize(1, 1)},
1235 {
1236#ifdef SCPACK
1237 "geq!jzer %1!",
1238 "jless %1!",
1239#else
1240 "g\265\305",
1241 "jl\322\205",
1242#endif
1243 seqsize(2, 1) - seqsize(1, 1)},
1244 {
1245#ifdef SCPACK
1246 "sless!jzer %1!",
1247 "jsgeq %1!",
1248#else
1249 "\357\305",
1250 "j\302\325",
1251#endif
1252 seqsize(2, 1) - seqsize(1, 1)},
1253 {
1254#ifdef SCPACK
1255 "sleq!jzer %1!",
1256 "jsgrtr %1!",
1257#else
1258 "\362\305",
1259 "j\337r\205",
1260#endif
1261 seqsize(2, 1) - seqsize(1, 1)},
1262 {
1263#ifdef SCPACK
1264 "sgrtr!jzer %1!",
1265 "jsleq %1!",
1266#else
1267 "\364\305",
1268 "j\303\325",
1269#endif
1270 seqsize(2, 1) - seqsize(1, 1)},
1271 {
1272#ifdef SCPACK
1273 "sgeq!jzer %1!",
1274 "jsless %1!",
1275#else
1276 "\361\305",
1277 "j\341\205",
1278#endif
1279 seqsize(2, 1) - seqsize(1, 1)},
1280 /* Test for zero (common case, especially for strings)
1281 * E.g. the test expression of: "for (i=0; str{i}!=0; ++i)"
1282 *
1283 * zero.alt jzer n1
1284 * jeq n1 -
1285 * --------------------------------------
1286 * zero.alt jnz n1
1287 * jneq n1 -
1288 */
1289 {
1290#ifdef SCPACK
1291 "zero.alt!jeq %1!",
1292 "jzer %1!",
1293#else
1294 "\315\217j\325",
1295 "\305",
1296#endif
1297 seqsize(2, 1) - seqsize(1, 1)},
1298 {
1299#ifdef SCPACK
1300 "zero.alt!jneq %1!",
1301 "jnz %1!",
1302#else
1303 "\315\217jn\325",
1304 "jnz\205",
1305#endif
1306 seqsize(2, 1) - seqsize(1, 1)},
1307 /* Incrementing and decrementing leaves a value in
1308 * in PRI which may not be used (for example, as the
1309 * third expression in a "for" loop).
1310 * inc n1 inc n1 ; ++n
1311 * load.pri n1 ;$exp
1312 * ;$exp -
1313 * --------------------------------------
1314 * load.pri n1 inc n1 ; n++, e.g. "for (n=0; n<10; n++)"
1315 * inc n1 ;$exp
1316 * ;$exp -
1317 * Plus the varieties for stack relative increments
1318 * and decrements.
1319 */
1320 {
1321#ifdef SCPACK
1322 "inc %1!load.pri %1!;$exp!",
1323 "inc %1!;$exp!",
1324#else
1325 "\373c\205\314\245",
1326 "\373c\261",
1327#endif
1328 seqsize(2, 2) - seqsize(1, 1)},
1329 {
1330#ifdef SCPACK
1331 "load.pri %1!inc %1!;$exp!",
1332 "inc %1!;$exp!",
1333#else
1334 "\314\373c\261",
1335 "\373c\261",
1336#endif
1337 seqsize(2, 2) - seqsize(1, 1)},
1338 {
1339#ifdef SCPACK
1340 "inc.s %1!load.s.pri %1!;$exp!",
1341 "inc.s %1!;$exp!",
1342#else
1343 "\373\352\205\324\245",
1344 "\373\352\261",
1345#endif
1346 seqsize(2, 2) - seqsize(1, 1)},
1347 {
1348#ifdef SCPACK
1349 "load.s.pri %1!inc.s %1!;$exp!",
1350 "inc.s %1!;$exp!",
1351#else
1352 "\324\373\352\261",
1353 "\373\352\261",
1354#endif
1355 seqsize(2, 2) - seqsize(1, 1)},
1356 {
1357#ifdef SCPACK
1358 "dec %1!load.pri %1!;$exp!",
1359 "dec %1!;$exp!",
1360#else
1361 "\367c\205\314\245",
1362 "\367c\261",
1363#endif
1364 seqsize(2, 2) - seqsize(1, 1)},
1365 {
1366#ifdef SCPACK
1367 "load.pri %1!dec %1!;$exp!",
1368 "dec %1!;$exp!",
1369#else
1370 "\314\367c\261",
1371 "\367c\261",
1372#endif
1373 seqsize(2, 2) - seqsize(1, 1)},
1374 {
1375#ifdef SCPACK
1376 "dec.s %1!load.s.pri %1!;$exp!",
1377 "dec.s %1!;$exp!",
1378#else
1379 "\367\352\205\324\245",
1380 "\367\352\261",
1381#endif
1382 seqsize(2, 2) - seqsize(1, 1)},
1383 {
1384#ifdef SCPACK
1385 "load.s.pri %1!dec.s %1!;$exp!",
1386 "dec.s %1!;$exp!",
1387#else
1388 "\324\367\352\261",
1389 "\367\352\261",
1390#endif
1391 seqsize(2, 2) - seqsize(1, 1)},
1392 /* ??? the same (increments and decrements) for references */
1393 /* Loading the constant zero has a special opcode.
1394 * When storing zero in memory, the value of PRI must not be later on.
1395 * const.pri 0 zero n1
1396 * stor.pri n1 ;$exp
1397 * ;$exp -
1398 * --------------------------------------
1399 * const.pri 0 zero.s n1
1400 * stor.s.pri n1 ;$exp
1401 * ;$exp -
1402 * --------------------------------------
1403 * zero.pri zero n1
1404 * stor.pri n1 ;$exp
1405 * ;$exp -
1406 * --------------------------------------
1407 * zero.pri zero.s n1
1408 * stor.s.pri n1 ;$exp
1409 * ;$exp -
1410 * --------------------------------------
1411 * const.pri 0 zero.pri
1412 * --------------------------------------
1413 * const.alt 0 zero.alt
1414 * The last two alternatives save more memory than they save
1415 * time, but anyway...
1416 */
1417 {
1418#ifdef SCPACK
1419 "const.pri 0!stor.pri %1!;$exp!",
1420 "zero %1!;$exp!",
1421#else
1422 "\236\203 0!\227or\223\245",
1423 "\315\261",
1424#endif
1425 seqsize(2, 2) - seqsize(1, 1)},
1426 {
1427#ifdef SCPACK
1428 "const.pri 0!stor.s.pri %1!;$exp!",
1429 "zero.s %1!;$exp!",
1430#else
1431 "\236\203 0!\227or\220\223\245",
1432 "\315\220\261",
1433#endif
1434 seqsize(2, 2) - seqsize(1, 1)},
1435 {
1436#ifdef SCPACK
1437 "zero.pri!stor.pri %1!;$exp!",
1438 "zero %1!;$exp!",
1439#else
1440 "\376\227or\223\245",
1441 "\315\261",
1442#endif
1443 seqsize(2, 1) - seqsize(1, 1)},
1444 {
1445#ifdef SCPACK
1446 "zero.pri!stor.s.pri %1!;$exp!",
1447 "zero.s %1!;$exp!",
1448#else
1449 "\376\227or\220\223\245",
1450 "\315\220\261",
1451#endif
1452 seqsize(2, 1) - seqsize(1, 1)},
1453 {
1454#ifdef SCPACK
1455 "const.pri 0!",
1456 "zero.pri!",
1457#else
1458 "\236\203 0!",
1459 "\376",
1460#endif
1461 seqsize(1, 1) - seqsize(1, 0)},
1462 {
1463#ifdef SCPACK
1464 "const.alt 0!",
1465 "zero.alt!",
1466#else
1467 "\236\211 0!",
1468 "\315\217",
1469#endif
1470 seqsize(1, 1) - seqsize(1, 0)},
1471 /* ----- */
1472 {NULL, NULL, 0}
1473};
diff --git a/libraries/embryo/src/bin/embryo_cc_scexpand.c b/libraries/embryo/src/bin/embryo_cc_scexpand.c
new file mode 100644
index 0000000..6ab34a1
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_scexpand.c
@@ -0,0 +1,53 @@
1/* expand.c -- Byte Pair Encoding decompression */
2/* Copyright 1996 Philip Gage */
3
4/* Byte Pair Compression appeared in the September 1997
5 * issue of C/C++ Users Journal. The original source code
6 * may still be found at the web site of the magazine
7 * (www.cuj.com).
8 *
9 * The decompressor has been modified by me (Thiadmer
10 * Riemersma) to accept a string as input, instead of a
11 * complete file.
12 */
13
14
15#include "embryo_cc_sc.h"
16
17#define STACKSIZE 16
18
19int
20strexpand(char *dest, unsigned char *source, int maxlen, unsigned char pairtable[128][2])
21{
22 unsigned char stack[STACKSIZE];
23 short c, top = 0;
24 int len;
25
26 len = 1; /* already 1 byte for '\0' */
27 for (;;)
28 {
29 /* Pop byte from stack or read byte from the input string */
30 if (top)
31 c = stack[--top];
32 else if ((c = *(unsigned char *)source++) == '\0')
33 break;
34
35 /* Push pair on stack or output byte to the output string */
36 if (c > 127)
37 {
38 stack[top++] = pairtable[c - 128][1];
39 stack[top++] = pairtable[c - 128][0];
40 }
41 else
42 {
43 len++;
44 if (maxlen > 1)
45 {
46 *dest++ = (char)c;
47 maxlen--;
48 }
49 }
50 }
51 *dest = '\0';
52 return len;
53}
diff --git a/libraries/embryo/src/bin/embryo_cc_sclist.c b/libraries/embryo/src/bin/embryo_cc_sclist.c
new file mode 100644
index 0000000..94ebbb7
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_sclist.c
@@ -0,0 +1,293 @@
1/* Small compiler - maintenance of various lists
2 *
3 * Name list (aliases)
4 * Include path list
5 *
6 * Copyright (c) ITB CompuPhase, 2001-2003
7 *
8 * This software is provided "as-is", without any express or implied warranty.
9 * In no event will the authors be held liable for any damages arising from
10 * the use of this software.
11 *
12 * Permission is granted to anyone to use this software for any purpose,
13 * including commercial applications, and to alter it and redistribute it
14 * freely, subject to the following restrictions:
15 *
16 * 1. The origin of this software must not be misrepresented; you must not
17 * claim that you wrote the original software. If you use this software in
18 * a product, an acknowledgment in the product documentation would be
19 * appreciated but is not required.
20 * 2. Altered source versions must be plainly marked as such, and must not be
21 * misrepresented as being the original software.
22 * 3. This notice may not be removed or altered from any source distribution.
23 *
24 * Version: $Id: embryo_cc_sclist.c 52451 2010-09-19 03:00:12Z raster $
25 */
26
27
28#ifdef HAVE_CONFIG_H
29# include <config.h>
30#endif
31
32#include <assert.h>
33#include <stdlib.h>
34#include <string.h>
35#include "embryo_cc_sc.h"
36
37static stringpair *
38insert_stringpair(stringpair * root, char *first, char *second, int matchlength)
39{
40 stringpair *cur, *pred;
41
42 assert(root != NULL);
43 assert(first != NULL);
44 assert(second != NULL);
45 /* create a new node, and check whether all is okay */
46 if (!(cur = (stringpair *)malloc(sizeof(stringpair))))
47 return NULL;
48 cur->first = strdup(first);
49 cur->second = strdup(second);
50 cur->matchlength = matchlength;
51 if (!cur->first || !cur->second)
52 {
53 if (cur->first)
54 free(cur->first);
55 if (cur->second)
56 free(cur->second);
57 free(cur);
58 return NULL;
59 } /* if */
60 /* link the node to the tree, find the position */
61 for (pred = root; pred->next && strcmp(pred->next->first, first) < 0;
62 pred = pred->next)
63 /* nothing */ ;
64 cur->next = pred->next;
65 pred->next = cur;
66 return cur;
67}
68
69static void
70delete_stringpairtable(stringpair * root)
71{
72 stringpair *cur, *next;
73
74 assert(root != NULL);
75 cur = root->next;
76 while (cur)
77 {
78 next = cur->next;
79 assert(cur->first != NULL);
80 assert(cur->second != NULL);
81 free(cur->first);
82 free(cur->second);
83 free(cur);
84 cur = next;
85 } /* while */
86 memset(root, 0, sizeof(stringpair));
87}
88
89static stringpair *
90find_stringpair(stringpair * cur, char *first, int matchlength)
91{
92 int result = 0;
93
94 assert(matchlength > 0); /* the function cannot handle zero-length comparison */
95 assert(first != NULL);
96 while (cur && result <= 0)
97 {
98 result = (int)*cur->first - (int)*first;
99 if (result == 0 && matchlength == cur->matchlength)
100 {
101 result = strncmp(cur->first, first, matchlength);
102 if (result == 0)
103 return cur;
104 } /* if */
105 cur = cur->next;
106 } /* while */
107 return NULL;
108}
109
110static int
111delete_stringpair(stringpair * root, stringpair * item)
112{
113 stringpair *cur;
114
115 assert(root != NULL);
116 cur = root;
117 while (cur->next)
118 {
119 if (cur->next == item)
120 {
121 cur->next = item->next; /* unlink from list */
122 assert(item->first != NULL);
123 assert(item->second != NULL);
124 free(item->first);
125 free(item->second);
126 free(item);
127 return TRUE;
128 } /* if */
129 cur = cur->next;
130 } /* while */
131 return FALSE;
132}
133
134/* ----- alias table --------------------------------------------- */
135static stringpair alias_tab = { NULL, NULL, NULL, 0 }; /* alias table */
136
137stringpair *
138insert_alias(char *name, char *alias)
139{
140 stringpair *cur;
141
142 assert(name != NULL);
143 assert(strlen(name) <= sNAMEMAX);
144 assert(alias != NULL);
145 assert(strlen(alias) <= sEXPMAX);
146 if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name))))
147 error(103); /* insufficient memory (fatal error) */
148 return cur;
149}
150
151int
152lookup_alias(char *target, char *name)
153{
154 stringpair *cur =
155 find_stringpair(alias_tab.next, name, strlen(name));
156 if (cur)
157 {
158 assert(strlen(cur->second) <= sEXPMAX);
159 strcpy(target, cur->second);
160 } /* if */
161 return !!cur;
162}
163
164void
165delete_aliastable(void)
166{
167 delete_stringpairtable(&alias_tab);
168}
169
170/* ----- include paths list -------------------------------------- */
171static stringlist includepaths = { NULL, NULL }; /* directory list for include files */
172
173stringlist *
174insert_path(char *path)
175{
176 stringlist *cur;
177
178 assert(path != NULL);
179 if (!(cur = (stringlist *)malloc(sizeof(stringlist))))
180 error(103); /* insufficient memory (fatal error) */
181 if (!(cur->line = strdup(path)))
182 error(103); /* insufficient memory (fatal error) */
183 cur->next = includepaths.next;
184 includepaths.next = cur;
185 return cur;
186}
187
188char *
189get_path(int index)
190{
191 stringlist *cur = includepaths.next;
192
193 while (cur && index-- > 0)
194 cur = cur->next;
195 if (cur)
196 {
197 assert(cur->line != NULL);
198 return cur->line;
199 } /* if */
200 return NULL;
201}
202
203void
204delete_pathtable(void)
205{
206 stringlist *cur = includepaths.next, *next;
207
208 while (cur)
209 {
210 next = cur->next;
211 assert(cur->line != NULL);
212 free(cur->line);
213 free(cur);
214 cur = next;
215 } /* while */
216 memset(&includepaths, 0, sizeof(stringlist));
217}
218
219/* ----- text substitution patterns ------------------------------ */
220
221static stringpair substpair = { NULL, NULL, NULL, 0 }; /* list of substitution pairs */
222static stringpair *substindex['z' - 'A' + 1]; /* quick index to first character */
223
224static void
225adjustindex(char c)
226{
227 stringpair *cur;
228
229 assert((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_');
230 assert('A' < '_' && '_' < 'z');
231
232 for (cur = substpair.next; cur && cur->first[0] != c;
233 cur = cur->next)
234 /* nothing */ ;
235 substindex[(int)c - 'A'] = cur;
236}
237
238stringpair *
239insert_subst(char *pattern, char *substitution, int prefixlen)
240{
241 stringpair *cur;
242
243 assert(pattern != NULL);
244 assert(substitution != NULL);
245 if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen)))
246 error(103); /* insufficient memory (fatal error) */
247 adjustindex(*pattern);
248 return cur;
249}
250
251stringpair *
252find_subst(char *name, int length)
253{
254 stringpair *item;
255
256 assert(name != NULL);
257 assert(length > 0);
258 assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
259 || *name == '_');
260 item = substindex[(int)*name - 'A'];
261 if (item)
262 item = find_stringpair(item, name, length);
263 return item;
264}
265
266int
267delete_subst(char *name, int length)
268{
269 stringpair *item;
270
271 assert(name != NULL);
272 assert(length > 0);
273 assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
274 || *name == '_');
275 item = substindex[(int)*name - 'A'];
276 if (item)
277 item = find_stringpair(item, name, length);
278 if (!item)
279 return FALSE;
280 delete_stringpair(&substpair, item);
281 adjustindex(*name);
282 return TRUE;
283}
284
285void
286delete_substtable(void)
287{
288 int i;
289
290 delete_stringpairtable(&substpair);
291 for (i = 0; i < (int)(sizeof(substindex) / sizeof(substindex[0])); i++)
292 substindex[i] = NULL;
293}
diff --git a/libraries/embryo/src/bin/embryo_cc_scvars.c b/libraries/embryo/src/bin/embryo_cc_scvars.c
new file mode 100644
index 0000000..fb9eb12
--- /dev/null
+++ b/libraries/embryo/src/bin/embryo_cc_scvars.c
@@ -0,0 +1,88 @@
1/* Small compiler
2 *
3 * Global (cross-module) variables.
4 *
5 * Copyright (c) ITB CompuPhase, 1997-2003
6 *
7 * This software is provided "as-is", without any express or implied warranty.
8 * In no event will the authors be held liable for any damages arising from
9 * the use of this software.
10 *
11 * Permission is granted to anyone to use this software for any purpose,
12 * including commercial applications, and to alter it and redistribute it
13 * freely, subject to the following restrictions:
14 *
15 * 1. The origin of this software must not be misrepresented; you must not
16 * claim that you wrote the original software. If you use this software in
17 * a product, an acknowledgment in the product documentation would be
18 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
21 * 3. This notice may not be removed or altered from any source distribution.
22 *
23 * Version: $Id: embryo_cc_scvars.c 50816 2010-08-04 16:57:32Z lucas $
24 */
25
26
27#ifdef HAVE_CONFIG_H
28# include <config.h> /* for PATH_MAX */
29#endif
30
31#include "embryo_cc_sc.h"
32
33/* global variables
34 *
35 * All global variables that are shared amongst the compiler files are
36 * declared here.
37 */
38symbol loctab; /* local symbol table */
39symbol glbtab; /* global symbol table */
40cell *litq; /* the literal queue */
41char pline[sLINEMAX + 1]; /* the line read from the input file */
42char *lptr; /* points to the current position in "pline" */
43constvalue tagname_tab = { NULL, "", 0, 0 }; /* tagname table */
44constvalue libname_tab = { NULL, "", 0, 0 }; /* library table (#pragma library "..." syntax) */
45constvalue *curlibrary = NULL; /* current library */
46symbol *curfunc; /* pointer to current function */
47char *inpfname; /* pointer to name of the file currently read from */
48char outfname[PATH_MAX]; /* output file name */
49char sc_ctrlchar = CTRL_CHAR; /* the control character (or escape character) */
50int litidx = 0; /* index to literal table */
51int litmax = sDEF_LITMAX; /* current size of the literal table */
52int stgidx = 0; /* index to the staging buffer */
53int labnum = 0; /* number of (internal) labels */
54int staging = 0; /* true if staging output */
55cell declared = 0; /* number of local cells declared */
56cell glb_declared = 0; /* number of global cells declared */
57cell code_idx = 0; /* number of bytes with generated code */
58int ntv_funcid = 0; /* incremental number of native function */
59int errnum = 0; /* number of errors */
60int warnnum = 0; /* number of warnings */
61int sc_debug = sCHKBOUNDS; /* by default: bounds checking+assertions */
62int charbits = 8; /* a "char" is 8 bits */
63int sc_packstr = FALSE; /* strings are packed by default? */
64int sc_compress = TRUE; /* compress bytecode? */
65int sc_needsemicolon = TRUE; /* semicolon required to terminate expressions? */
66int sc_dataalign = sizeof(cell); /* data alignment value */
67int sc_alignnext = FALSE; /* must frame of the next function be aligned? */
68int curseg = 0; /* 1 if currently parsing CODE, 2 if parsing DATA */
69cell sc_stksize = sDEF_AMXSTACK; /* default stack size */
70int freading = FALSE; /* Is there an input file ready for reading? */
71int fline = 0; /* the line number in the current file */
72int fnumber = 0; /* the file number in the file table (debugging) */
73int fcurrent = 0; /* current file being processed (debugging) */
74int intest = 0; /* true if inside a test */
75int sideeffect = 0; /* true if an expression causes a side-effect */
76int stmtindent = 0; /* current indent of the statement */
77int indent_nowarn = TRUE; /* skip warning "217 loose indentation" */
78int sc_tabsize = 8; /* number of spaces that a TAB represents */
79int sc_allowtags = TRUE; /* allow/detect tagnames in lex() */
80int sc_status; /* read/write status */
81int sc_rationaltag = 0; /* tag for rational numbers */
82int rational_digits = 0; /* number of fractional digits */
83
84FILE *inpf = NULL; /* file read from (source or include) */
85FILE *inpf_org = NULL; /* main source file */
86FILE *outf = NULL; /* file written to */
87
88jmp_buf errbuf;
diff --git a/libraries/embryo/src/lib/Embryo.h b/libraries/embryo/src/lib/Embryo.h
new file mode 100644
index 0000000..ea273cf
--- /dev/null
+++ b/libraries/embryo/src/lib/Embryo.h
@@ -0,0 +1,901 @@
1/**
2@brief Embryo Library
3
4These routines are used for Embryo.
5
6@mainpage Embryo Library Documentation
7
8@image html e_big.png
9
10@version 1.0.0
11@author Carsten Haitzler <raster\@rasterman.com>
12@author Compuphase http://www.compuphase.com
13@date 2004-2011
14
15@section intro What is Embryo?
16
17Embryo is a tiny library designed to interpret limited Small programs
18compiled by the included compiler, @c embryo_cc. It is mostly a cleaned
19up and smaller version of the original Small abstract machine. The
20compiler is mostly untouched.
21
22Small was renamed to Pawn.
23For more information about the Pawn language, see
24@htmlonly <a href=http://www.compuphase.com/pawn/pawn.htm>Pawn</a>
25@endhtmlonly
26@latexonly http://www.compuphase.com/pawn/pawn.htm @endlatexonly
27For the basics about the Small language, see @ref Small_Page.
28
29@section How_to_Use How to Use Embryo?
30
31To use Embryo in your code, you need to do at least the following:
32
33@li Include @ref Embryo.h.
34@li Load the Embryo program using one of the
35 @ref Embryo_Program_Creation_Group.
36@li Set up the native calls with @ref embryo_program_native_call_add.
37@li Create a virtual machine with @ref embryo_program_vm_push.
38@li Then run the program with @ref embryo_program_run.
39
40@todo Clean up compiler code.
41@todo Proper overview of the operation of the interpreter, that is how
42 the heap, stack, virtual machines, etc fit together.
43
44@page Small_Page Brief Introduction to Small
45
46This section describes the basics of Small, as compiled and interpreted
47with Embryo.
48
49This summary assumes that you are familar with C. For a full list of
50differences between C and Small, again, see the full documentation.
51
52@section Small_Variables_Section Variables
53
54@subsection Small_Type_Subsection Types
55
56There is only one type, known as the "cell", which can hold an integer.
57
58@subsection Small_Scope_Subsection Scope
59
60The scope and usage of a variable depends on its declaration.
61
62@li A local variable is normally declared with the @c new keyword. E.g.
63 @code new variable @endcode
64@li A static function variable is defined within a function with the
65 @c static keyword.
66@li A global static variable is one that is only available within the
67 file it was declared in. Again, use the @c static keyword, but outside
68 of any function.
69@li A stock variable is one that may not be compiled into a program if it
70 is not used. It is declared using @c stock.
71@li A public variable is one that can be read by the host program using
72 @ref embryo_program_variable_find. It is declared using @c public
73 keyword.
74
75Remember that the keywords above are to be used on their own. That is,
76for example: @code public testvar @endcode not:
77@code new public testvar @endcode
78
79@subsection Small_Constants_Subsection Constants
80
81You can declare constants in two ways:
82@li Using the preprocessor macro @c \#define.
83@li By inserting @c const between the keyword and variable name of a
84 variable declaration. For example, to declare the variable @c var1
85 constant, you type @code new const var1 = 2 @endcode Now @c var1
86 cannot be changed.
87
88@subsection Small_Arrays_Subsection Arrays
89
90To declare an array, append square brackets to the end of the variable
91name. The following examples show how to declare arrays. Note the
92use of the ellipsis operator, which bases the array based on the last two
93declared values:
94
95@code
96new msg[] = "A message."
97new ints[] = {1, 3, 4}
98new ints2[20] = {1, 3} // All other elements 0.
99new ints3[10] = {1, ... } // All elements = 1
100new ints4[10] = {10, 20, ... } // Elements = 10 -> 100.
101 // The difference can be negative.
102new ints5[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
103@endcode
104
105@note Array initialisers need to be constant.
106
107@section Small_Func_Calls_Section Function Calls
108
109A typical function declaration is as follows:
110
111@code
112testfunc(param) {
113 // Do something ...
114 // over a couple of lines.
115}
116@endcode
117
118You can pass by reference. That is, the parameter you pass is changed
119outside of the function. For example:
120
121@code
122testfunc(&param) {
123 param = 10
124 // The passed variable will be set to 10 outside of the function.
125}
126@endcode
127
128To pass an array:
129
130@code
131testfunc(param[]) {
132 // Do something to the array
133}
134@endcode
135
136@note Arrays are passed by reference.
137
138@section Small_Control_Subsection Control Structures.
139
140Small has the following control structures, which similar to their C
141counterparts:
142@li @code if (expression) statement1 else statement2 @endcode
143@li @code switch (expression) {
144 case 0:
145 statement1 // Can only be one statement. Look Ma, no breaks!
146 case 1..3: // For values between 1 and 3 inclusive.
147 statement2
148 default: // Optional
149 statement3
150}
151@endcode
152@li @code while(expression) statement @endcode
153@li @code do statement while (expression) @endcode
154@li @code for (init_expression; before_iter_test_expression; after_iter_expression) statement @endcode
155
156@section Small_Preprocessor_Section Preprocessor
157
158The following preprocessor directives are available:
159@li @code #assert constant_expression @endcode
160@li @code #define pattern replacement @endcode
161@li @code #define pattern(%1,%2,...) replacement @endcode
162@li @code #include filename @endcode
163@li @code #if constant_expression
164 // Various bits of code
165#else
166 // Other bits of code
167#endif
168@endcode
169@li @code #undef pattern @endcode
170
171
172@page Available_Native_Calls_Page Available Calls
173
174Embryo provides a minimal set of native calls that can be used within
175any Embryo script. Those calls are detailed here.
176
177@note Some of the "core" functions here are also described in the full
178 Small documentation given
179
180@todo Finish this section.
181
182@section Args_ANC_Section Argument Functions
183
184@subsection Numargs_Desc numargs
185
186Returns the number of arguments passed to a function. Useful
187when dealing with variable argument lists.
188
189@subsection Getargs_Desc getarg(arg, index=0)
190
191Retrieves the argument number @c arg. If the argument is an array,
192use @c index to specify the index of the array to return.
193
194@subsection Setargs_Desc setargs(arg, index=0, value)
195
196Sets the argument number @c arg to the given @c arg. @c index specifies
197the index of @c arg to set if @c arg is an array.
198
199@section String_ANC_Section String Functions
200
201Functions that work on strings.
202
203@subsection Atoi_Desc atoi
204
205Translates an number in string form into an integer.
206
207@subsection Fnmatch_Desc fnmatch
208
209Buggered if I know what this does?
210
211@subsection Strcmp_Desc strcmp
212
213String comparing function.
214
215
216@section Float_ANC_Section Float Functions
217
218@subsection Float_Desc float
219
220@subsection Atof_Desc atof
221
222@subsection Float_Mul_Desc float_mul
223
224@subsection Float_Div_Desc float_div
225
226@subsection Float_Add_Desc float_add
227
228@subsection Float_Sub_Desc float_sub
229
230@subsection Fract_Desc fract
231
232@subsection Round_Desc round
233
234@subsection Float_Cmp_Desc float_cmp
235
236@subsection Sqrt_Desc sqrt
237
238@subsection Pow_Desc pow
239
240@subsection Log_Desc log
241
242@subsection Sin_Desc sin
243
244@subsection Cos_Desc cos
245
246@subsection Tan_Desc tan
247
248@subsection Abs_Desc abs
249
250Returns the absolute value of the given float.
251
252@section Time_ANC_Section Time Functions
253
254@subsection Seconds_Desc seconds()
255
256@subsection Date_Desc date
257
258
259@section Rand_ANC_Section Random Functions
260
261@subsection Rand_Desc rand()
262
263Returns a random integer.
264
265@subsection Randf_Desc randf()
266
267Returns a random float.
268
269@file Embryo.h
270@brief Embryo virtual machine library.
271
272This file includes the routines needed for Embryo library interaction.
273This is the @e only file you need to include.
274
275*/
276
277// The following definitions are in Embryo.h, but I did not want to
278// mess up the formatting of the file
279
280/**
281 @def EMBRYO_FUNCTION_NONE
282 An invalid/non-existent function.
283*/
284
285/**
286 @def EMBRYO_FUNCTION_MAIN
287 Start at program entry point. For use with @ref embryo_program_run.
288*/
289
290/**
291 @def EMBRYO_FUNCTION_CONT
292 Continue from last address. For use with @ref embryo_program_run.
293*/
294
295/**
296 @def EMBRYO_PROGRAM_OK
297 Program was run successfully.
298*/
299
300/**
301 @def EMBRYO_PROGRAM_SLEEP
302 The program's execution was interrupted by a Small @c sleep command.
303*/
304
305/**
306 @def EMBRYO_PROGRAM_FAIL
307 An error in the program caused it to fail.
308*/
309
310#ifndef _EMBRYO_H
311#define _EMBRYO_H
312
313#ifdef EAPI
314# undef EAPI
315#endif
316
317#ifdef _WIN32
318# ifdef EFL_EMBRYO_BUILD
319# ifdef DLL_EXPORT
320# define EAPI __declspec(dllexport)
321# else
322# define EAPI
323# endif /* ! DLL_EXPORT */
324# else
325# define EAPI __declspec(dllimport)
326# endif /* ! EFL_EMBRYO_BUILD */
327#else
328# ifdef __GNUC__
329# if __GNUC__ >= 4
330# define EAPI __attribute__ ((visibility("default")))
331# else
332# define EAPI
333# endif
334# else
335# define EAPI
336# endif
337#endif /* ! _WIN32 */
338
339#ifdef __cplusplus
340extern "C" {
341#endif
342
343#define EMBRYO_VERSION_MAJOR 1
344#define EMBRYO_VERSION_MINOR 0
345
346 typedef struct _Embryo_Version
347 {
348 int major;
349 int minor;
350 int micro;
351 int revision;
352 } Embryo_Version;
353
354 EAPI extern Embryo_Version *embryo_version;
355
356 /* potential error values */
357 typedef enum _Embryo_Error
358 {
359 EMBRYO_ERROR_NONE,
360 /* reserve the first 15 error codes for exit codes of the abstract machine */
361 EMBRYO_ERROR_EXIT, /** Forced exit */
362 EMBRYO_ERROR_ASSERT, /** Assertion failed */
363 EMBRYO_ERROR_STACKERR, /** Stack/heap collision */
364 EMBRYO_ERROR_BOUNDS, /** Index out of bounds */
365 EMBRYO_ERROR_MEMACCESS, /** Invalid memory access */
366 EMBRYO_ERROR_INVINSTR, /** Invalid instruction */
367 EMBRYO_ERROR_STACKLOW, /** Stack underflow */
368 EMBRYO_ERROR_HEAPLOW, /** Heap underflow */
369 EMBRYO_ERROR_CALLBACK, /** No callback, or invalid callback */
370 EMBRYO_ERROR_NATIVE, /** Native function failed */
371 EMBRYO_ERROR_DIVIDE, /** Divide by zero */
372 EMBRYO_ERROR_SLEEP, /** Go into sleepmode - code can be restarted */
373
374 EMBRYO_ERROR_MEMORY = 16, /** Out of memory */
375 EMBRYO_ERROR_FORMAT, /** Invalid file format */
376 EMBRYO_ERROR_VERSION, /** File is for a newer version of the Embryo_Program */
377 EMBRYO_ERROR_NOTFOUND, /** Function not found */
378 EMBRYO_ERROR_INDEX, /** Invalid index parameter (bad entry point) */
379 EMBRYO_ERROR_DEBUG, /** Debugger cannot run */
380 EMBRYO_ERROR_INIT, /** Embryo_Program not initialized (or doubly initialized) */
381 EMBRYO_ERROR_USERDATA, /** Unable to set user data field (table full) */
382 EMBRYO_ERROR_INIT_JIT, /** Cannot initialize the JIT */
383 EMBRYO_ERROR_PARAMS, /** Parameter error */
384 EMBRYO_ERROR_DOMAIN, /** Domain error, expression result does not fit in range */
385 } Embryo_Error;
386
387 /* program run return values */
388 typedef enum _Embryo_Status
389 {
390 EMBRYO_PROGRAM_FAIL = 0,
391 EMBRYO_PROGRAM_OK = 1,
392 EMBRYO_PROGRAM_SLEEP = 2,
393 EMBRYO_PROGRAM_BUSY = 3,
394 EMBRYO_PROGRAM_TOOLONG = 4
395 } Embryo_Status;
396
397 typedef unsigned int Embryo_UCell;
398 typedef int Embryo_Cell;
399 /** An invalid cell reference */
400#define EMBRYO_CELL_NONE 0x7fffffff
401
402 typedef struct _Embryo_Program Embryo_Program;
403 typedef int Embryo_Function;
404 /* possible function type values that are enumerated */
405#define EMBRYO_FUNCTION_NONE 0x7fffffff /* An invalid/non existent function */
406#define EMBRYO_FUNCTION_MAIN -1 /* Start at program entry point */
407#define EMBRYO_FUNCTION_CONT -2 /* Continue from last address */
408
409 typedef union
410 {
411 float f;
412 Embryo_Cell c;
413 } Embryo_Float_Cell;
414
415#if defined _MSC_VER || defined __SUNPRO_C
416/** Float to Embryo_Cell */
417# define EMBRYO_FLOAT_TO_CELL(f) (((Embryo_Float_Cell *)&(f))->c)
418/** Embryo_Cell to float */
419# define EMBRYO_CELL_TO_FLOAT(c) (((Embryo_Float_Cell *)&(c))->f)
420#else
421/** Float to Embryo_Cell */
422# define EMBRYO_FLOAT_TO_CELL(f) ((Embryo_Float_Cell) f).c
423/** Embryo_Cell to float */
424# define EMBRYO_CELL_TO_FLOAT(c) ((Embryo_Float_Cell) c).f
425#endif
426
427 /**
428 * @defgroup Embryo_Library_Group Library Maintenance Functions
429 *
430 * Functions that start up and shutdown the Embryo library.
431 */
432
433
434/**
435 * Initialises the Embryo library.
436 * @return The number of times the library has been initialised without being
437 * shut down.
438 * @ingroup Embryo_Library_Group
439 */
440EAPI int embryo_init(void);
441
442/**
443 * Shuts down the Embryo library.
444 * @return The number of times the library has been initialised without being
445 * shutdown.
446 * @ingroup Embryo_Library_Group
447 */
448EAPI int embryo_shutdown(void);
449
450 /**
451 * @defgroup Embryo_Program_Creation_Group Program Creation and Destruction Functions
452 *
453 * Functions that set up programs, and destroy them.
454 */
455
456/**
457 * Creates a new Embryo program, with bytecode data that can be freed.
458 * @param data Pointer to the bytecode of the program.
459 * @param size Number of bytes of bytecode.
460 * @return A new Embryo program.
461 * @ingroup Embryo_Program_Creation_Group
462 */
463EAPI Embryo_Program *embryo_program_new(void *data, int size);
464
465/**
466 * Creates a new Embryo program, with bytecode data that cannot be
467 * freed.
468 * @param data Pointer to the bytecode of the program.
469 * @param size Number of bytes of bytecode.
470 * @return A new Embryo program.
471 * @ingroup Embryo_Program_Creation_Group
472 */
473EAPI Embryo_Program *embryo_program_const_new(void *data, int size);
474
475/**
476 * Creates a new Embryo program based on the bytecode data stored in the
477 * given file.
478 * @param file Filename of the given file.
479 * @return A new Embryo program.
480 * @ingroup Embryo_Program_Creation_Group
481 */
482EAPI Embryo_Program *embryo_program_load(const char *file);
483
484/**
485 * Frees the given Embryo program.
486 * @param ep The given program.
487 * @ingroup Embryo_Program_Creation_Group
488 */
489EAPI void embryo_program_free(Embryo_Program *ep);
490
491/**
492 * Adds a native program call to the given Embryo program.
493 * @param ep The given Embryo program.
494 * @param name The name for the call used in the script.
495 * @param func The function to use when the call is made.
496 * @ingroup Embryo_Func_Group
497 */
498
499/**
500 * @defgroup Embryo_Func_Group Function Functions
501 *
502 * Functions that deal with Embryo program functions.
503 */
504EAPI void embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell (*func) (Embryo_Program *ep, Embryo_Cell *params));
505
506/**
507 * Resets the current virtual machine session of the given program.
508 * @param ep The given program.
509 * @ingroup Embryo_Program_VM_Group
510 */
511
512/**
513 * @defgroup Embryo_Program_VM_Group Virtual Machine Functions
514 *
515 * Functions that deal with creating and destroying virtual machine sessions
516 * for a given program.
517 *
518 * A given embryo program can have multiple virtual machine sessions running.
519 * This is useful when you have a native call that in turn calls a function in
520 * the embryo program. The native call can start a new virtual machine
521 * session to run the function it needs. Once completed, the session can be
522 * popped off the program's stack, and the native call can return its value
523 * to the old session.
524 *
525 * A new virtual machine session is created by pushing a new virtual machine
526 * onto the session stack of a program using @ref embryo_program_vm_push.
527 * The current virtual machine session can be destroyed by calling
528 * @ref embryo_program_vm_pop.
529 */
530EAPI void embryo_program_vm_reset(Embryo_Program *ep);
531
532/**
533 * Starts a new virtual machine session for the given program.
534 *
535 * See @ref Embryo_Program_VM_Group for more information about how this works.
536 *
537 * @param ep The given program.
538 * @ingroup Embryo_Program_VM_Group
539 */
540EAPI void embryo_program_vm_push(Embryo_Program *ep);
541
542/**
543 * Frees the current virtual machine session associated with the given program.
544 *
545 * See @ref Embryo_Program_VM_Group for more information about how this works.
546 * Note that you will need to retrieve any return data or data on the stack
547 * before you pop.
548 *
549 * @param ep The given program.
550 * @ingroup Embryo_Program_VM_Group
551 */
552EAPI void embryo_program_vm_pop(Embryo_Program *ep);
553
554/**
555 * Ensures that the given unsigned short integer is in the small
556 * endian format.
557 * @param v Pointer to the given integer.
558 * @ingroup Embryo_Swap_Group
559 */
560
561/**
562 * @defgroup Embryo_Swap_Group Byte Swapping Functions
563 *
564 * Functions that are used to ensure that integers passed to the
565 * virtual machine are in small endian format. These functions are
566 * used to ensure that the virtual machine operates correctly on big
567 * endian machines.
568 */
569EAPI void embryo_swap_16(unsigned short *v);
570
571/**
572 * Ensures that the given unsigned integer is in the small endian
573 * format.
574 * @param v Pointer to the given integer.
575 * @ingroup Embryo_Swap_Group
576 */
577EAPI void embryo_swap_32(unsigned int *v);
578
579/**
580 * Returns the function in the given program with the given name.
581 * @param ep The given program.
582 * @param name The given function name.
583 * @return The function if successful. Otherwise, @c EMBRYO_FUNCTION_NONE.
584 * @ingroup Embryo_Func_Group
585 */
586EAPI Embryo_Function embryo_program_function_find(Embryo_Program *ep, const char *name);
587
588/**
589 * Retrieves the location of the public variable in the given program
590 * with the given name.
591 * @param ep The given program.
592 * @param name The given name.
593 * @return The address of the variable if found. @c EMBRYO_CELL_NONE
594 * otherwise.
595 * @ingroup Embryo_Public_Variable_Group
596 */
597
598/**
599 * @defgroup Embryo_Public_Variable_Group Public Variable Access Functions
600 *
601 * In an Embryo program, a global variable can be declared public, as
602 * described in @ref Small_Scope_Subsection. The functions here allow
603 * the host program to access these public variables.
604 */
605EAPI Embryo_Cell embryo_program_variable_find(Embryo_Program *ep, const char *name);
606
607/**
608 * Retrieves the number of public variables in the given program.
609 * @param ep The given program.
610 * @return The number of public variables.
611 * @ingroup Embryo_Public_Variable_Group
612 */
613EAPI int embryo_program_variable_count_get(Embryo_Program *ep);
614
615/**
616 * Retrieves the location of the public variable in the given program
617 * with the given identifier.
618 * @param ep The given program.
619 * @param num The identifier of the public variable.
620 * @return The virtual machine address of the variable if found.
621 * @c EMBRYO_CELL_NONE otherwise.
622 * @ingroup Embryo_Public_Variable_Group
623 */
624EAPI Embryo_Cell embryo_program_variable_get(Embryo_Program *ep, int num);
625
626/**
627 * Sets the error code for the given program to the given code.
628 * @param ep The given program.
629 * @param error The given error code.
630 * @ingroup Embryo_Error_Group
631 */
632
633/**
634 * @defgroup Embryo_Error_Group Error Functions
635 *
636 * Functions that set and retrieve error codes in Embryo programs.
637 */
638EAPI void embryo_program_error_set(Embryo_Program *ep, Embryo_Error error);
639
640/**
641 * Retrieves the current error code for the given program.
642 * @param ep The given program.
643 * @return The current error code.
644 * @ingroup Embryo_Error_Group
645 */
646EAPI Embryo_Error embryo_program_error_get(Embryo_Program *ep);
647
648/**
649 * Sets the data associated to the given program.
650 * @param ep The given program.
651 * @param data New bytecode data.
652 * @ingroup Embryo_Program_Data_Group
653 */
654
655/**
656 * @defgroup Embryo_Program_Data_Group Program Data Functions
657 *
658 * Functions that set and retrieve data associated with the given
659 * program.
660 */
661EAPI void embryo_program_data_set(Embryo_Program *ep, void *data);
662
663/**
664 * Retrieves the data associated to the given program.
665 * @param ep The given program.
666 * @ingroup Embryo_Program_Data_Group
667 */
668EAPI void *embryo_program_data_get(Embryo_Program *ep);
669
670/**
671 * Retrieves a string describing the given error code.
672 * @param error The given error code.
673 * @return String describing the given error code. If the given code is not
674 * known, the string "(unknown)" is returned.
675 * @ingroup Embryo_Error_Group
676 */
677EAPI const char *embryo_error_string_get(Embryo_Error error);
678
679/**
680 * Retrieves the length of the string starting at the given cell.
681 * @param ep The program the cell is part of.
682 * @param str_cell Pointer to the first cell of the string.
683 * @return The length of the string. @c 0 is returned if there is an error.
684 * @ingroup Embryo_Data_String_Group
685 */
686
687/**
688 * @defgroup Embryo_Data_String_Group Embryo Data String Functions
689 *
690 * Functions that operate on strings in the memory of a virtual machine.
691 */
692EAPI int embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell);
693
694/**
695 * Copies the string starting at the given cell to the given buffer.
696 * @param ep The program the cell is part of.
697 * @param str_cell Pointer to the first cell of the string.
698 * @param dst The given buffer.
699 * @ingroup Embryo_Data_String_Group
700 */
701EAPI void embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst);
702
703/**
704 * Copies string in the given buffer into the virtual machine memory
705 * starting at the given cell.
706 * @param ep The program the cell is part of.
707 * @param src The given buffer.
708 * @param str_cell Pointer to the first cell to copy the string to.
709 * @ingroup Embryo_Data_String_Group
710 */
711EAPI void embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cell);
712
713/**
714 * Retreives a pointer to the address in the virtual machine given by the
715 * given cell.
716 * @param ep The program whose virtual machine address is being queried.
717 * @param addr The given cell.
718 * @return A pointer to the cell at the given address.
719 * @ingroup Embryo_Data_String_Group
720 */
721EAPI Embryo_Cell *embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr);
722
723/**
724 * Increases the size of the heap of the given virtual machine by the given
725 * number of Embryo_Cells.
726 * @param ep The program with the given virtual machine.
727 * @param cells The given number of Embryo_Cells.
728 * @return The address of the new memory region on success.
729 * @c EMBRYO_CELL_NONE otherwise.
730 * @ingroup Embryo_Heap_Group
731 */
732
733/**
734 * @defgroup Embryo_Heap_Group Heap Functions
735 *
736 * The heap is an area of memory that can be allocated for program
737 * use at runtime. The heap functions here change the amount of heap
738 * memory available.
739 */
740EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells);
741
742/**
743 * Decreases the size of the heap of the given virtual machine down to the
744 * given size.
745 * @param ep The program with the given virtual machine.
746 * @param down_to The given size.
747 * @ingroup Embryo_Heap_Group
748 */
749EAPI void embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to);
750
751/**
752 * Returns the number of virtual machines are running for the given program.
753 * @param ep The given program.
754 * @return The number of virtual machines running.
755 * @ingroup Embryo_Run_Group
756 */
757
758/**
759 * @defgroup Embryo_Run_Group Program Run Functions
760 *
761 * Functions that are involved in actually running functions in an
762 * Embryo program.
763 */
764EAPI int embryo_program_recursion_get(Embryo_Program *ep);
765
766/**
767 * Runs the given function of the given Embryo program in the current
768 * virtual machine. The parameter @p fn can be found using
769 * @ref embryo_program_function_find.
770 *
771 * @note For Embryo to be able to run a function, it must have been
772 * declared @c public in the Small source code.
773 *
774 * @param ep The given program.
775 * @param fn The given function. Normally "main", in which case the
776 * constant @c EMBRYO_FUNCTION_MAIN can be used.
777 * @return @c EMBRYO_PROGRAM_OK on success. @c EMBRYO_PROGRAM_SLEEP if the
778 * program is halted by the Small @c sleep call.
779 * @c EMBRYO_PROGRAM_FAIL if there is an error.
780 * @c EMBRYO_PROGRAM_TOOLONG if the program executes for longer than
781 * it is allowed to in abstract machine instruction count.
782 * @ingroup Embryo_Run_Group
783 */
784EAPI Embryo_Status embryo_program_run(Embryo_Program *ep, Embryo_Function func);
785
786/**
787 * Retreives the return value of the last called function of the given
788 * program.
789 * @param ep The given program.
790 * @return An Embryo_Cell representing the return value of the function
791 * that was last called.
792 * @ingroup Embryo_Run_Group
793 */
794EAPI Embryo_Cell embryo_program_return_value_get(Embryo_Program *ep);
795
796/**
797 * Sets the maximum number of abstract machine cycles any given program run
798 * can execute before being put to sleep and returning.
799 *
800 * @param ep The given program.
801 * @param max The number of machine cycles as a limit.
802 *
803 * This sets the maximum number of abstract machine (virtual machine)
804 * instructions that a single run of an embryo function (even if its main)
805 * can use before embryo embryo_program_run() reutrns with the value
806 * EMBRYO_PROGRAM_TOOLONG. If the function fully executes within this number
807 * of cycles, embryo_program_run() will return as normal with either
808 * EMBRYO_PROGRAM_OK, EMBRYO_PROGRAM_FAIL or EMBRYO_PROGRAM_SLEEP. If the
809 * run exceeds this instruction count, then EMBRYO_PROGRAM_TOOLONG will be
810 * returned indicating the program exceeded its run count. If the app wishes
811 * to continue running this anyway - it is free to process its own events or
812 * whatever it wants and continue the function by calling
813 * embryo_program_run(program, EMBRYO_FUNCTION_CONT); which will start the
814 * run again until the instruction count is reached. This can keep being done
815 * to allow the calling program to still be able to control things outside the
816 * embryo function being called. If the maximum run cycle count is 0 then the
817 * program is allowed to run forever only returning when it is done.
818 *
819 * It is important to note that abstract machine cycles are NOT the same as
820 * the host machine cpu cycles. They are not fixed in runtime per cycle, so
821 * this is more of a helper tool than a way to HARD-FORCE a script to only
822 * run for a specific period of time. If the cycle count is set to something
823 * low like 5000 or 1000, then every 1000 (or 5000) cycles control will be
824 * returned to the calling process where it can check a timer to see if a
825 * physical runtime limit has been elapsed and then abort running further
826 * assuming a "runaway script" or keep continuing the script run. This
827 * limits resolution to only that many cycles which do not take a determined
828 * amount of time to execute, as this varies from cpu to cpu and also depends
829 * on how loaded the system is. Making the max cycle run too low will
830 * impact performance requiring the abstract machine to do setup and teardown
831 * cycles too often comapred to cycles actually executed.
832 *
833 * Also note it does NOT include nested abstract machines. IF this abstract
834 * machine run calls embryo script that calls a native function that in turn
835 * calls more embryo script, then the 2nd (and so on) levels are not included
836 * in this run count. They can set their own max instruction count values
837 * separately.
838 *
839 * The default max cycle run value is 0 in any program until set with this
840 * function.
841 *
842 * @ingroup Embryo_Run_Group
843 */
844EAPI void embryo_program_max_cycle_run_set(Embryo_Program *ep, int max);
845
846/**
847 * Retreives the maximum number of abstract machine cycles a program is allowed
848 * to run.
849 * @param ep The given program.
850 * @return The number of cycles a run cycle is allowed to run for this
851 * program.
852 *
853 * This returns the value set by embryo_program_max_cycle_run_set(). See
854 * embryo_program_max_cycle_run_set() for more information.
855 *
856 * @ingroup Embryo_Run_Group
857 */
858EAPI int embryo_program_max_cycle_run_get(Embryo_Program *ep);
859
860/**
861 * Pushes an Embryo_Cell onto the function stack to use as a parameter for
862 * the next function that is called in the given program.
863 * @param ep The given program.
864 * @param cell The Embryo_Cell to push onto the stack.
865 * @return @c 1 if successful. @c 0 otherwise.
866 * @ingroup Embryo_Parameter_Group
867 */
868
869/**
870 * @defgroup Embryo_Parameter_Group Function Parameter Functions
871 *
872 * Functions that set parameters for the next function that is called.
873 */
874EAPI int embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell);
875
876/**
877 * Pushes a string onto the function stack to use as a parameter for the
878 * next function that is called in the given program.
879 * @param ep The given program.
880 * @param str The string to push onto the stack.
881 * @return @c 1 if successful. @c 0 otherwise.
882 * @ingroup Embryo_Parameter_Group
883 */
884EAPI int embryo_parameter_string_push(Embryo_Program *ep, const char *str);
885
886/**
887 * Pushes an array of Embryo_Cells onto the function stack to be used as
888 * parameters for the next function that is called in the given program.
889 * @param ep The given program.
890 * @param cells The array of Embryo_Cells.
891 * @param num The number of cells in @p cells.
892 * @return @c 1 if successful. @c 0 otherwise.
893 * @ingroup Embryo_Parameter_Group
894 */
895EAPI int embryo_parameter_cell_array_push(Embryo_Program *ep, Embryo_Cell *cells, int num);
896
897#ifdef __cplusplus
898}
899#endif
900
901#endif
diff --git a/libraries/embryo/src/lib/Makefile.am b/libraries/embryo/src/lib/Makefile.am
new file mode 100644
index 0000000..f5c78aa
--- /dev/null
+++ b/libraries/embryo/src/lib/Makefile.am
@@ -0,0 +1,35 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_builddir) \
8-I$(top_srcdir)/src/lib \
9-I$(top_srcdir)/src/lib/include \
10-DPACKAGE_BIN_DIR=\"$(bindir)\" \
11-DPACKAGE_LIB_DIR=\"$(libdir)\" \
12-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
13@EVIL_CFLAGS@ \
14@EMBRYO_CPPFLAGS@ \
15@EFL_EMBRYO_BUILD@
16
17includes_HEADERS = Embryo.h
18includesdir = $(includedir)/embryo-@VMAJ@
19
20lib_LTLIBRARIES = libembryo.la
21
22libembryo_la_SOURCES = \
23embryo_amx.c \
24embryo_args.c \
25embryo_float.c \
26embryo_main.c \
27embryo_rand.c \
28embryo_str.c \
29embryo_time.c
30
31libembryo_la_CFLAGS = @EMBRYO_CFLAGS@
32libembryo_la_LIBADD = @EVIL_LIBS@ -lm
33libembryo_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
34
35EXTRA_DIST = embryo_private.h
diff --git a/libraries/embryo/src/lib/Makefile.in b/libraries/embryo/src/lib/Makefile.in
new file mode 100644
index 0000000..56e9f26
--- /dev/null
+++ b/libraries/embryo/src/lib/Makefile.in
@@ -0,0 +1,682 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38subdir = src/lib
39DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
40 $(srcdir)/Makefile.in
41ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
43 $(top_srcdir)/m4/efl_binary.m4 $(top_srcdir)/m4/efl_doxygen.m4 \
44 $(top_srcdir)/m4/efl_fnmatch.m4 \
45 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/libtool.m4 \
46 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
47 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
48 $(top_srcdir)/configure.ac
49am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
50 $(ACLOCAL_M4)
51mkinstalldirs = $(install_sh) -d
52CONFIG_HEADER = $(top_builddir)/config.h
53CONFIG_CLEAN_FILES =
54CONFIG_CLEAN_VPATH_FILES =
55am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
56am__vpath_adj = case $$p in \
57 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
58 *) f=$$p;; \
59 esac;
60am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
61am__install_max = 40
62am__nobase_strip_setup = \
63 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
64am__nobase_strip = \
65 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
66am__nobase_list = $(am__nobase_strip_setup); \
67 for p in $$list; do echo "$$p $$p"; done | \
68 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
69 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
70 if (++n[$$2] == $(am__install_max)) \
71 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
72 END { for (dir in files) print dir, files[dir] }'
73am__base_list = \
74 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
75 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
76am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
77LTLIBRARIES = $(lib_LTLIBRARIES)
78libembryo_la_DEPENDENCIES =
79am_libembryo_la_OBJECTS = libembryo_la-embryo_amx.lo \
80 libembryo_la-embryo_args.lo libembryo_la-embryo_float.lo \
81 libembryo_la-embryo_main.lo libembryo_la-embryo_rand.lo \
82 libembryo_la-embryo_str.lo libembryo_la-embryo_time.lo
83libembryo_la_OBJECTS = $(am_libembryo_la_OBJECTS)
84AM_V_lt = $(am__v_lt_$(V))
85am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
86am__v_lt_0 = --silent
87libembryo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
88 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libembryo_la_CFLAGS) \
89 $(CFLAGS) $(libembryo_la_LDFLAGS) $(LDFLAGS) -o $@
90DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
91depcomp = $(SHELL) $(top_srcdir)/depcomp
92am__depfiles_maybe = depfiles
93am__mv = mv -f
94COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
95 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
96LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
97 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
98 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
99 $(AM_CFLAGS) $(CFLAGS)
100AM_V_CC = $(am__v_CC_$(V))
101am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
102am__v_CC_0 = @echo " CC " $@;
103AM_V_at = $(am__v_at_$(V))
104am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
105am__v_at_0 = @
106CCLD = $(CC)
107LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
108 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
109 $(AM_LDFLAGS) $(LDFLAGS) -o $@
110AM_V_CCLD = $(am__v_CCLD_$(V))
111am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
112am__v_CCLD_0 = @echo " CCLD " $@;
113AM_V_GEN = $(am__v_GEN_$(V))
114am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
115am__v_GEN_0 = @echo " GEN " $@;
116SOURCES = $(libembryo_la_SOURCES)
117DIST_SOURCES = $(libembryo_la_SOURCES)
118HEADERS = $(includes_HEADERS)
119ETAGS = etags
120CTAGS = ctags
121DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
122ACLOCAL = @ACLOCAL@
123ALLOCA = @ALLOCA@
124AMTAR = @AMTAR@
125AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
126AR = @AR@
127AS = @AS@
128AUTOCONF = @AUTOCONF@
129AUTOHEADER = @AUTOHEADER@
130AUTOMAKE = @AUTOMAKE@
131AWK = @AWK@
132CC = @CC@
133CCDEPMODE = @CCDEPMODE@
134CFLAGS = @CFLAGS@
135CPP = @CPP@
136CPPFLAGS = @CPPFLAGS@
137CYGPATH_W = @CYGPATH_W@
138DEFS = @DEFS@
139DEPDIR = @DEPDIR@
140DLLTOOL = @DLLTOOL@
141DSYMUTIL = @DSYMUTIL@
142DUMPBIN = @DUMPBIN@
143ECHO_C = @ECHO_C@
144ECHO_N = @ECHO_N@
145ECHO_T = @ECHO_T@
146EFL_EMBRYO_BUILD = @EFL_EMBRYO_BUILD@
147EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
148EGREP = @EGREP@
149EINA_CFLAGS = @EINA_CFLAGS@
150EINA_LIBS = @EINA_LIBS@
151EMBRYO_CC_PRG = @EMBRYO_CC_PRG@
152EMBRYO_CFLAGS = @EMBRYO_CFLAGS@
153EMBRYO_CPPFLAGS = @EMBRYO_CPPFLAGS@
154EVIL_CFLAGS = @EVIL_CFLAGS@
155EVIL_LIBS = @EVIL_LIBS@
156EXEEXT = @EXEEXT@
157FGREP = @FGREP@
158GREP = @GREP@
159INSTALL = @INSTALL@
160INSTALL_DATA = @INSTALL_DATA@
161INSTALL_PROGRAM = @INSTALL_PROGRAM@
162INSTALL_SCRIPT = @INSTALL_SCRIPT@
163INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
164LD = @LD@
165LDFLAGS = @LDFLAGS@
166LIBOBJS = @LIBOBJS@
167LIBS = @LIBS@
168LIBTOOL = @LIBTOOL@
169LIPO = @LIPO@
170LN_S = @LN_S@
171LTLIBOBJS = @LTLIBOBJS@
172MAKEINFO = @MAKEINFO@
173MKDIR_P = @MKDIR_P@
174NM = @NM@
175NMEDIT = @NMEDIT@
176OBJDUMP = @OBJDUMP@
177OBJEXT = @OBJEXT@
178OTOOL = @OTOOL@
179OTOOL64 = @OTOOL64@
180PACKAGE = @PACKAGE@
181PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
182PACKAGE_NAME = @PACKAGE_NAME@
183PACKAGE_STRING = @PACKAGE_STRING@
184PACKAGE_TARNAME = @PACKAGE_TARNAME@
185PACKAGE_URL = @PACKAGE_URL@
186PACKAGE_VERSION = @PACKAGE_VERSION@
187PATH_SEPARATOR = @PATH_SEPARATOR@
188PKG_CONFIG = @PKG_CONFIG@
189PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
190PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
191RANLIB = @RANLIB@
192SED = @SED@
193SET_MAKE = @SET_MAKE@
194SHELL = @SHELL@
195STRIP = @STRIP@
196VERSION = @VERSION@
197VMAJ = @VMAJ@
198abs_builddir = @abs_builddir@
199abs_srcdir = @abs_srcdir@
200abs_top_builddir = @abs_top_builddir@
201abs_top_srcdir = @abs_top_srcdir@
202ac_ct_CC = @ac_ct_CC@
203ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
204am__include = @am__include@
205am__leading_dot = @am__leading_dot@
206am__quote = @am__quote@
207am__tar = @am__tar@
208am__untar = @am__untar@
209bindir = @bindir@
210build = @build@
211build_alias = @build_alias@
212build_cpu = @build_cpu@
213build_os = @build_os@
214build_vendor = @build_vendor@
215builddir = @builddir@
216datadir = @datadir@
217datarootdir = @datarootdir@
218docdir = @docdir@
219dvidir = @dvidir@
220efl_doxygen = @efl_doxygen@
221efl_have_doxygen = @efl_have_doxygen@
222embryoincludedir = @embryoincludedir@
223exec_prefix = @exec_prefix@
224host = @host@
225host_alias = @host_alias@
226host_cpu = @host_cpu@
227host_os = @host_os@
228host_vendor = @host_vendor@
229htmldir = @htmldir@
230includedir = @includedir@
231infodir = @infodir@
232install_sh = @install_sh@
233libdir = @libdir@
234libexecdir = @libexecdir@
235localedir = @localedir@
236localstatedir = @localstatedir@
237lt_ECHO = @lt_ECHO@
238lt_enable_auto_import = @lt_enable_auto_import@
239mandir = @mandir@
240mkdir_p = @mkdir_p@
241oldincludedir = @oldincludedir@
242pdfdir = @pdfdir@
243pkgconfig_requires_private = @pkgconfig_requires_private@
244prefix = @prefix@
245program_transform_name = @program_transform_name@
246psdir = @psdir@
247release_info = @release_info@
248requirement_embryo = @requirement_embryo@
249sbindir = @sbindir@
250sharedstatedir = @sharedstatedir@
251srcdir = @srcdir@
252sysconfdir = @sysconfdir@
253target_alias = @target_alias@
254top_build_prefix = @top_build_prefix@
255top_builddir = @top_builddir@
256top_srcdir = @top_srcdir@
257version_info = @version_info@
258MAINTAINERCLEANFILES = Makefile.in
259AM_CPPFLAGS = \
260-I. \
261-I$(top_srcdir)/src/lib \
262-I$(top_builddir) \
263-I$(top_srcdir)/src/lib \
264-I$(top_srcdir)/src/lib/include \
265-DPACKAGE_BIN_DIR=\"$(bindir)\" \
266-DPACKAGE_LIB_DIR=\"$(libdir)\" \
267-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
268@EVIL_CFLAGS@ \
269@EMBRYO_CPPFLAGS@ \
270@EFL_EMBRYO_BUILD@
271
272includes_HEADERS = Embryo.h
273includesdir = $(includedir)/embryo-@VMAJ@
274lib_LTLIBRARIES = libembryo.la
275libembryo_la_SOURCES = \
276embryo_amx.c \
277embryo_args.c \
278embryo_float.c \
279embryo_main.c \
280embryo_rand.c \
281embryo_str.c \
282embryo_time.c
283
284libembryo_la_CFLAGS = @EMBRYO_CFLAGS@
285libembryo_la_LIBADD = @EVIL_LIBS@ -lm
286libembryo_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
287EXTRA_DIST = embryo_private.h
288all: all-am
289
290.SUFFIXES:
291.SUFFIXES: .c .lo .o .obj
292$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
293 @for dep in $?; do \
294 case '$(am__configure_deps)' in \
295 *$$dep*) \
296 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
297 && { if test -f $@; then exit 0; else break; fi; }; \
298 exit 1;; \
299 esac; \
300 done; \
301 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile'; \
302 $(am__cd) $(top_srcdir) && \
303 $(AUTOMAKE) --gnu src/lib/Makefile
304.PRECIOUS: Makefile
305Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
306 @case '$?' in \
307 *config.status*) \
308 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
309 *) \
310 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
311 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
312 esac;
313
314$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
315 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
316
317$(top_srcdir)/configure: $(am__configure_deps)
318 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
319$(ACLOCAL_M4): $(am__aclocal_m4_deps)
320 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
321$(am__aclocal_m4_deps):
322install-libLTLIBRARIES: $(lib_LTLIBRARIES)
323 @$(NORMAL_INSTALL)
324 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
325 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
326 list2=; for p in $$list; do \
327 if test -f $$p; then \
328 list2="$$list2 $$p"; \
329 else :; fi; \
330 done; \
331 test -z "$$list2" || { \
332 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
333 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
334 }
335
336uninstall-libLTLIBRARIES:
337 @$(NORMAL_UNINSTALL)
338 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
339 for p in $$list; do \
340 $(am__strip_dir) \
341 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
342 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
343 done
344
345clean-libLTLIBRARIES:
346 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
347 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
348 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
349 test "$$dir" != "$$p" || dir=.; \
350 echo "rm -f \"$${dir}/so_locations\""; \
351 rm -f "$${dir}/so_locations"; \
352 done
353libembryo.la: $(libembryo_la_OBJECTS) $(libembryo_la_DEPENDENCIES)
354 $(AM_V_CCLD)$(libembryo_la_LINK) -rpath $(libdir) $(libembryo_la_OBJECTS) $(libembryo_la_LIBADD) $(LIBS)
355
356mostlyclean-compile:
357 -rm -f *.$(OBJEXT)
358
359distclean-compile:
360 -rm -f *.tab.c
361
362@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_amx.Plo@am__quote@
363@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_args.Plo@am__quote@
364@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_float.Plo@am__quote@
365@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_main.Plo@am__quote@
366@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_rand.Plo@am__quote@
367@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_str.Plo@am__quote@
368@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libembryo_la-embryo_time.Plo@am__quote@
369
370.c.o:
371@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
372@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
373@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
374@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
375@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
376@am__fastdepCC_FALSE@ $(COMPILE) -c $<
377
378.c.obj:
379@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
380@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
381@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
382@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
383@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
384@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
385
386.c.lo:
387@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
388@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
389@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
390@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
391@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
392@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
393
394libembryo_la-embryo_amx.lo: embryo_amx.c
395@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_amx.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_amx.Tpo -c -o libembryo_la-embryo_amx.lo `test -f 'embryo_amx.c' || echo '$(srcdir)/'`embryo_amx.c
396@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_amx.Tpo $(DEPDIR)/libembryo_la-embryo_amx.Plo
397@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
398@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_amx.c' object='libembryo_la-embryo_amx.lo' libtool=yes @AMDEPBACKSLASH@
399@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
400@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_amx.lo `test -f 'embryo_amx.c' || echo '$(srcdir)/'`embryo_amx.c
401
402libembryo_la-embryo_args.lo: embryo_args.c
403@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_args.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_args.Tpo -c -o libembryo_la-embryo_args.lo `test -f 'embryo_args.c' || echo '$(srcdir)/'`embryo_args.c
404@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_args.Tpo $(DEPDIR)/libembryo_la-embryo_args.Plo
405@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
406@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_args.c' object='libembryo_la-embryo_args.lo' libtool=yes @AMDEPBACKSLASH@
407@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
408@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_args.lo `test -f 'embryo_args.c' || echo '$(srcdir)/'`embryo_args.c
409
410libembryo_la-embryo_float.lo: embryo_float.c
411@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_float.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_float.Tpo -c -o libembryo_la-embryo_float.lo `test -f 'embryo_float.c' || echo '$(srcdir)/'`embryo_float.c
412@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_float.Tpo $(DEPDIR)/libembryo_la-embryo_float.Plo
413@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
414@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_float.c' object='libembryo_la-embryo_float.lo' libtool=yes @AMDEPBACKSLASH@
415@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
416@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_float.lo `test -f 'embryo_float.c' || echo '$(srcdir)/'`embryo_float.c
417
418libembryo_la-embryo_main.lo: embryo_main.c
419@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_main.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_main.Tpo -c -o libembryo_la-embryo_main.lo `test -f 'embryo_main.c' || echo '$(srcdir)/'`embryo_main.c
420@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_main.Tpo $(DEPDIR)/libembryo_la-embryo_main.Plo
421@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
422@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_main.c' object='libembryo_la-embryo_main.lo' libtool=yes @AMDEPBACKSLASH@
423@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
424@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_main.lo `test -f 'embryo_main.c' || echo '$(srcdir)/'`embryo_main.c
425
426libembryo_la-embryo_rand.lo: embryo_rand.c
427@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_rand.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_rand.Tpo -c -o libembryo_la-embryo_rand.lo `test -f 'embryo_rand.c' || echo '$(srcdir)/'`embryo_rand.c
428@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_rand.Tpo $(DEPDIR)/libembryo_la-embryo_rand.Plo
429@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
430@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_rand.c' object='libembryo_la-embryo_rand.lo' libtool=yes @AMDEPBACKSLASH@
431@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
432@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_rand.lo `test -f 'embryo_rand.c' || echo '$(srcdir)/'`embryo_rand.c
433
434libembryo_la-embryo_str.lo: embryo_str.c
435@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_str.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_str.Tpo -c -o libembryo_la-embryo_str.lo `test -f 'embryo_str.c' || echo '$(srcdir)/'`embryo_str.c
436@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_str.Tpo $(DEPDIR)/libembryo_la-embryo_str.Plo
437@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
438@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_str.c' object='libembryo_la-embryo_str.lo' libtool=yes @AMDEPBACKSLASH@
439@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
440@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_str.lo `test -f 'embryo_str.c' || echo '$(srcdir)/'`embryo_str.c
441
442libembryo_la-embryo_time.lo: embryo_time.c
443@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -MT libembryo_la-embryo_time.lo -MD -MP -MF $(DEPDIR)/libembryo_la-embryo_time.Tpo -c -o libembryo_la-embryo_time.lo `test -f 'embryo_time.c' || echo '$(srcdir)/'`embryo_time.c
444@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libembryo_la-embryo_time.Tpo $(DEPDIR)/libembryo_la-embryo_time.Plo
445@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
446@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='embryo_time.c' object='libembryo_la-embryo_time.lo' libtool=yes @AMDEPBACKSLASH@
447@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
448@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libembryo_la_CFLAGS) $(CFLAGS) -c -o libembryo_la-embryo_time.lo `test -f 'embryo_time.c' || echo '$(srcdir)/'`embryo_time.c
449
450mostlyclean-libtool:
451 -rm -f *.lo
452
453clean-libtool:
454 -rm -rf .libs _libs
455install-includesHEADERS: $(includes_HEADERS)
456 @$(NORMAL_INSTALL)
457 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
458 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
459 for p in $$list; do \
460 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
461 echo "$$d$$p"; \
462 done | $(am__base_list) | \
463 while read files; do \
464 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
465 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
466 done
467
468uninstall-includesHEADERS:
469 @$(NORMAL_UNINSTALL)
470 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
471 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
472 test -n "$$files" || exit 0; \
473 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
474 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
475
476ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
477 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
478 unique=`for i in $$list; do \
479 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
480 done | \
481 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
482 END { if (nonempty) { for (i in files) print i; }; }'`; \
483 mkid -fID $$unique
484tags: TAGS
485
486TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
487 $(TAGS_FILES) $(LISP)
488 set x; \
489 here=`pwd`; \
490 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
491 unique=`for i in $$list; do \
492 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
493 done | \
494 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
495 END { if (nonempty) { for (i in files) print i; }; }'`; \
496 shift; \
497 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
498 test -n "$$unique" || unique=$$empty_fix; \
499 if test $$# -gt 0; then \
500 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
501 "$$@" $$unique; \
502 else \
503 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
504 $$unique; \
505 fi; \
506 fi
507ctags: CTAGS
508CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
509 $(TAGS_FILES) $(LISP)
510 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
511 unique=`for i in $$list; do \
512 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
513 done | \
514 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
515 END { if (nonempty) { for (i in files) print i; }; }'`; \
516 test -z "$(CTAGS_ARGS)$$unique" \
517 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
518 $$unique
519
520GTAGS:
521 here=`$(am__cd) $(top_builddir) && pwd` \
522 && $(am__cd) $(top_srcdir) \
523 && gtags -i $(GTAGS_ARGS) "$$here"
524
525distclean-tags:
526 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
527
528distdir: $(DISTFILES)
529 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
530 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
531 list='$(DISTFILES)'; \
532 dist_files=`for file in $$list; do echo $$file; done | \
533 sed -e "s|^$$srcdirstrip/||;t" \
534 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
535 case $$dist_files in \
536 */*) $(MKDIR_P) `echo "$$dist_files" | \
537 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
538 sort -u` ;; \
539 esac; \
540 for file in $$dist_files; do \
541 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
542 if test -d $$d/$$file; then \
543 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
544 if test -d "$(distdir)/$$file"; then \
545 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
546 fi; \
547 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
548 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
549 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
550 fi; \
551 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
552 else \
553 test -f "$(distdir)/$$file" \
554 || cp -p $$d/$$file "$(distdir)/$$file" \
555 || exit 1; \
556 fi; \
557 done
558check-am: all-am
559check: check-am
560all-am: Makefile $(LTLIBRARIES) $(HEADERS)
561installdirs:
562 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
563 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
564 done
565install: install-am
566install-exec: install-exec-am
567install-data: install-data-am
568uninstall: uninstall-am
569
570install-am: all-am
571 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
572
573installcheck: installcheck-am
574install-strip:
575 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
576 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
577 `test -z '$(STRIP)' || \
578 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
579mostlyclean-generic:
580
581clean-generic:
582
583distclean-generic:
584 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
585 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
586
587maintainer-clean-generic:
588 @echo "This command is intended for maintainers to use"
589 @echo "it deletes files that may require special tools to rebuild."
590 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
591clean: clean-am
592
593clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
594 mostlyclean-am
595
596distclean: distclean-am
597 -rm -rf ./$(DEPDIR)
598 -rm -f Makefile
599distclean-am: clean-am distclean-compile distclean-generic \
600 distclean-tags
601
602dvi: dvi-am
603
604dvi-am:
605
606html: html-am
607
608html-am:
609
610info: info-am
611
612info-am:
613
614install-data-am: install-includesHEADERS
615
616install-dvi: install-dvi-am
617
618install-dvi-am:
619
620install-exec-am: install-libLTLIBRARIES
621
622install-html: install-html-am
623
624install-html-am:
625
626install-info: install-info-am
627
628install-info-am:
629
630install-man:
631
632install-pdf: install-pdf-am
633
634install-pdf-am:
635
636install-ps: install-ps-am
637
638install-ps-am:
639
640installcheck-am:
641
642maintainer-clean: maintainer-clean-am
643 -rm -rf ./$(DEPDIR)
644 -rm -f Makefile
645maintainer-clean-am: distclean-am maintainer-clean-generic
646
647mostlyclean: mostlyclean-am
648
649mostlyclean-am: mostlyclean-compile mostlyclean-generic \
650 mostlyclean-libtool
651
652pdf: pdf-am
653
654pdf-am:
655
656ps: ps-am
657
658ps-am:
659
660uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
661
662.MAKE: install-am install-strip
663
664.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
665 clean-libLTLIBRARIES clean-libtool ctags distclean \
666 distclean-compile distclean-generic distclean-libtool \
667 distclean-tags distdir dvi dvi-am html html-am info info-am \
668 install install-am install-data install-data-am install-dvi \
669 install-dvi-am install-exec install-exec-am install-html \
670 install-html-am install-includesHEADERS install-info \
671 install-info-am install-libLTLIBRARIES install-man install-pdf \
672 install-pdf-am install-ps install-ps-am install-strip \
673 installcheck installcheck-am installdirs maintainer-clean \
674 maintainer-clean-generic mostlyclean mostlyclean-compile \
675 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
676 tags uninstall uninstall-am uninstall-includesHEADERS \
677 uninstall-libLTLIBRARIES
678
679
680# Tell versions [3.59,3.63) of GNU make to not export all variables.
681# Otherwise a system limit (for SysV at least) may be exceeded.
682.NOEXPORT:
diff --git a/libraries/embryo/src/lib/embryo_amx.c b/libraries/embryo/src/lib/embryo_amx.c
new file mode 100644
index 0000000..4fa84c5
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_amx.c
@@ -0,0 +1,1991 @@
1/* Abstract Machine for the Small compiler
2 *
3 * Copyright (c) ITB CompuPhase, 1997-2003
4 * Portions Copyright (c) Carsten Haitzler, 2004-2010 <raster@rasterman.com>
5 *
6 * This software is provided "as-is", without any express or implied warranty.
7 * In no event will the authors be held liable for any damages arising from
8 * the use of this software.
9 *
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
13 *
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software in
16 * a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
23
24#ifdef HAVE_CONFIG_H
25# include "config.h"
26#endif
27
28#include <stdlib.h>
29#include <stdio.h>
30#include <string.h>
31
32#include "Embryo.h"
33#include "embryo_private.h"
34
35
36#define JUMPABS(base, ip) ((Embryo_Cell *)(code + (*ip)))
37
38#ifdef WORDS_BIGENDIAN
39static void _embryo_byte_swap_16 (unsigned short *v);
40static void _embryo_byte_swap_32 (unsigned int *v);
41#endif
42static int _embryo_native_call (Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result, Embryo_Cell *params);
43static int _embryo_func_get (Embryo_Program *ep, int index, char *funcname);
44static int _embryo_var_get (Embryo_Program *ep, int index, char *varname, Embryo_Cell *ep_addr);
45static int _embryo_program_init (Embryo_Program *ep, void *code);
46
47#ifdef WORDS_BIGENDIAN
48static void
49_embryo_byte_swap_16(unsigned short *v)
50{
51 unsigned char *s, t;
52
53 s = (unsigned char *)v;
54 t = s[0]; s[0] = s[1]; s[1] = t;
55}
56
57static void
58_embryo_byte_swap_32(unsigned int *v)
59{
60 unsigned char *s, t;
61
62 s = (unsigned char *)v;
63 t = s[0]; s[0] = s[3]; s[3] = t;
64 t = s[1]; s[1] = s[2]; s[2] = t;
65}
66#endif
67
68static int
69_embryo_native_call(Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result, Embryo_Cell *params)
70{
71 Embryo_Header *hdr;
72 Embryo_Func_Stub *func_entry;
73 Embryo_Native f;
74
75 hdr = (Embryo_Header *)ep->base;
76 func_entry = GETENTRY(hdr, natives, index);
77 if ((func_entry->address <= 0) ||
78 (func_entry->address > ep->native_calls_size))
79 {
80 ep->error = EMBRYO_ERROR_CALLBACK;
81 return ep->error;
82 }
83 f = ep->native_calls[func_entry->address - 1];
84 if (!f)
85 {
86 ep->error = EMBRYO_ERROR_CALLBACK;
87 return ep->error;
88 }
89 ep->error = EMBRYO_ERROR_NONE;
90 *result = f(ep, params);
91 return ep->error;
92}
93
94static int
95_embryo_func_get(Embryo_Program *ep, int index, char *funcname)
96{
97 Embryo_Header *hdr;
98 Embryo_Func_Stub *func;
99
100 hdr = (Embryo_Header *)ep->code;
101 if (index >= (Embryo_Cell)NUMENTRIES(hdr, publics, natives))
102 return EMBRYO_ERROR_INDEX;
103
104 func = GETENTRY(hdr, publics, index);
105 strcpy(funcname, GETENTRYNAME(hdr, func));
106 return EMBRYO_ERROR_NONE;
107}
108
109static int
110_embryo_var_get(Embryo_Program *ep, int index, char *varname, Embryo_Cell *ep_addr)
111{
112
113 Embryo_Header *hdr;
114 Embryo_Func_Stub *var;
115
116 hdr=(Embryo_Header *)ep->base;
117 if (index >= (Embryo_Cell)NUMENTRIES(hdr, pubvars, tags))
118 return EMBRYO_ERROR_INDEX;
119
120 var = GETENTRY(hdr, pubvars, index);
121 strcpy(varname, GETENTRYNAME(hdr, var));
122 *ep_addr = var->address;
123 return EMBRYO_ERROR_NONE;
124}
125
126static int
127_embryo_program_init(Embryo_Program *ep, void *code)
128{
129 Embryo_Header *hdr;
130
131 if ((ep->flags & EMBRYO_FLAG_RELOC)) return 1;
132 ep->code = (unsigned char *)code;
133 hdr = (Embryo_Header *)ep->code;
134#ifdef WORDS_BIGENDIAN
135 embryo_swap_32((unsigned int *)&hdr->size);
136 embryo_swap_16((unsigned short *)&hdr->magic);
137 embryo_swap_16((unsigned short *)&hdr->flags);
138 embryo_swap_16((unsigned short *)&hdr->defsize);
139 embryo_swap_32((unsigned int *)&hdr->cod);
140 embryo_swap_32((unsigned int *)&hdr->dat);
141 embryo_swap_32((unsigned int *)&hdr->hea);
142 embryo_swap_32((unsigned int *)&hdr->stp);
143 embryo_swap_32((unsigned int *)&hdr->cip);
144 embryo_swap_32((unsigned int *)&hdr->publics);
145 embryo_swap_32((unsigned int *)&hdr->natives);
146 embryo_swap_32((unsigned int *)&hdr->libraries);
147 embryo_swap_32((unsigned int *)&hdr->pubvars);
148 embryo_swap_32((unsigned int *)&hdr->tags);
149 embryo_swap_32((unsigned int *)&hdr->nametable);
150#endif
151
152 if (hdr->magic != EMBRYO_MAGIC) return 0;
153 if ((hdr->file_version < MIN_FILE_VERSION) ||
154 (hdr->ep_version > CUR_FILE_VERSION)) return 0;
155 if ((hdr->defsize != sizeof(Embryo_Func_Stub)) &&
156 (hdr->defsize != (2 * sizeof(unsigned int)))) return 0;
157 if (hdr->defsize == (2 * sizeof(unsigned int)))
158 {
159 unsigned short *len;
160
161 len = (unsigned short*)((unsigned char*)ep->code + hdr->nametable);
162#ifdef WORDS_BIGENDIAN
163 embryo_swap_16((unsigned short *)len);
164#endif
165 if (*len > sNAMEMAX) return 0;
166 }
167 if (hdr->stp <= 0) return 0;
168 if ((hdr->flags & EMBRYO_FLAG_COMPACT)) return 0;
169
170#ifdef WORDS_BIGENDIAN
171 {
172 Embryo_Func_Stub *fs;
173 int i, num;
174
175 /* also align all addresses in the public function, public variable and */
176 /* public tag tables */
177 fs = GETENTRY(hdr, publics, 0);
178 num = NUMENTRIES(hdr, publics, natives);
179 for (i = 0; i < num; i++)
180 {
181 embryo_swap_32(&(fs->address));
182 fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
183 }
184
185 fs = GETENTRY(hdr, pubvars, 0);
186 num = NUMENTRIES(hdr, pubvars, tags);
187 for (i = 0; i < num; i++)
188 {
189 embryo_swap_32(&(fs->address));
190 fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
191 }
192
193 fs = GETENTRY(hdr, tags, 0);
194 num = NUMENTRIES(hdr, tags, nametable);
195 for (i = 0; i < num; i++)
196 {
197 embryo_swap_32(&(fs->address));
198 fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize);
199 }
200 }
201#endif
202 ep->flags = EMBRYO_FLAG_RELOC;
203
204 {
205 Embryo_Cell cip, code_size, cip_end;
206 Embryo_Cell *code;
207
208 code_size = hdr->dat - hdr->cod;
209 code = (Embryo_Cell *)((unsigned char *)ep->code + (int)hdr->cod);
210 cip_end = code_size / sizeof(Embryo_Cell);
211 for (cip = 0; cip < cip_end; cip++)
212 {
213/* move this here - later we probably want something that verifies opcodes
214 * are valid and ok...
215 */
216#ifdef WORDS_BIGENDIAN
217 embryo_swap_32(&(code[cip]));
218#endif
219
220 }
221 }
222 /* init native api for handling floating point - default in embryo */
223 _embryo_args_init(ep);
224 _embryo_fp_init(ep);
225 _embryo_rand_init(ep);
226 _embryo_str_init(ep);
227 _embryo_time_init(ep);
228 return 1;
229}
230
231/*** EXPORTED CALLS ***/
232
233EAPI Embryo_Program *
234embryo_program_new(void *data, int size)
235{
236 Embryo_Program *ep;
237 void *code_data;
238
239 if (size < (int)sizeof(Embryo_Header)) return NULL;
240
241 ep = calloc(1, sizeof(Embryo_Program));
242 if (!ep) return NULL;
243
244 code_data = malloc(size);
245 if (!code_data)
246 {
247 free(ep);
248 return NULL;
249 }
250 memcpy(code_data, data, size);
251 if (_embryo_program_init(ep, code_data)) return ep;
252 free(code_data);
253 free(ep);
254 return NULL;
255}
256
257EAPI Embryo_Program *
258embryo_program_const_new(void *data, int size)
259{
260 Embryo_Program *ep;
261
262 if (size < (int)sizeof(Embryo_Header)) return NULL;
263
264 ep = calloc(1, sizeof(Embryo_Program));
265 if (!ep) return NULL;
266
267 if (_embryo_program_init(ep, data))
268 {
269 ep->dont_free_code = 1;
270 return ep;
271 }
272 free(ep);
273 return NULL;
274}
275
276EAPI Embryo_Program *
277embryo_program_load(const char *file)
278{
279 Embryo_Program *ep;
280 Embryo_Header hdr;
281 FILE *f;
282 void *program = NULL;
283 int program_size = 0;
284
285 f = fopen(file, "rb");
286 if (!f) return NULL;
287 fseek(f, 0, SEEK_END);
288 program_size = ftell(f);
289 fseek(f, 0L, SEEK_SET);
290 if (program_size < (int)sizeof(Embryo_Header))
291 {
292 fclose(f);
293 return NULL;
294 }
295 if (fread(&hdr, sizeof(Embryo_Header), 1, f) != 1)
296 {
297 fclose(f);
298 return NULL;
299 }
300 fseek(f, 0L, SEEK_SET);
301#ifdef WORDS_BIGENDIAN
302 embryo_swap_32((unsigned int *)(&hdr.size));
303#endif
304 if ((int)hdr.size < program_size) program_size = hdr.size;
305 program = malloc(program_size);
306 if (!program)
307 {
308 fclose(f);
309 return NULL;
310 }
311 if (fread(program, program_size, 1, f) != 1)
312 {
313 free(program);
314 fclose(f);
315 return NULL;
316 }
317 ep = embryo_program_new(program, program_size);
318 free(program);
319 fclose(f);
320 return ep;
321}
322
323EAPI void
324embryo_program_free(Embryo_Program *ep)
325{
326 int i;
327
328 if (ep->base) free(ep->base);
329 if ((!ep->dont_free_code) && (ep->code)) free(ep->code);
330 if (ep->native_calls) free(ep->native_calls);
331 for (i = 0; i < ep->params_size; i++)
332 {
333 if (ep->params[i].string) free(ep->params[i].string);
334 if (ep->params[i].cell_array) free(ep->params[i].cell_array);
335 }
336 if (ep->params) free(ep->params);
337 free(ep);
338}
339
340
341EAPI void
342embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell (*func) (Embryo_Program *ep, Embryo_Cell *params))
343{
344 Embryo_Func_Stub *func_entry;
345 Embryo_Header *hdr;
346 int i, num;
347
348 if ((!ep ) || (!name) || (!func)) return;
349 if (strlen(name) > sNAMEMAX) return;
350
351 hdr = (Embryo_Header *)ep->code;
352 if (hdr->defsize < 1) return;
353 num = NUMENTRIES(hdr, natives, libraries);
354 if (num <= 0) return;
355
356 ep->native_calls_size++;
357 if (ep->native_calls_size > ep->native_calls_alloc)
358 {
359 Embryo_Native *calls;
360
361 ep->native_calls_alloc += 32;
362 calls = realloc(ep->native_calls,
363 ep->native_calls_alloc * sizeof(Embryo_Native));
364 if (!calls)
365 {
366 ep->native_calls_size--;
367 ep->native_calls_alloc -= 32;
368 return;
369 }
370 ep->native_calls = calls;
371 }
372 ep->native_calls[ep->native_calls_size - 1] = func;
373
374 func_entry = GETENTRY(hdr, natives, 0);
375 for (i = 0; i < num; i++)
376 {
377 if (func_entry->address == 0)
378 {
379 char *entry_name;
380
381 entry_name = GETENTRYNAME(hdr, func_entry);
382 if ((entry_name) && (!strcmp(entry_name, name)))
383 {
384 func_entry->address = ep->native_calls_size;
385 /* FIXME: embryo_cc is putting in multiple native */
386 /* function call entries - so we need to fill in all */
387 /* of them!!! */
388 /* return; */
389 }
390 }
391 func_entry =
392 (Embryo_Func_Stub *)((unsigned char *)func_entry + hdr->defsize);
393 }
394}
395
396
397EAPI void
398embryo_program_vm_reset(Embryo_Program *ep)
399{
400 Embryo_Header *hdr;
401
402 if ((!ep) || (!ep->base)) return;
403 hdr = (Embryo_Header *)ep->code;
404 memcpy(ep->base, hdr, hdr->size);
405 *(Embryo_Cell *)(ep->base + (int)hdr->stp - sizeof(Embryo_Cell)) = 0;
406
407 ep->hlw = hdr->hea - hdr->dat; /* stack and heap relative to data segment */
408 ep->stp = hdr->stp - hdr->dat - sizeof(Embryo_Cell);
409 ep->hea = ep->hlw;
410 ep->stk = ep->stp;
411}
412
413EAPI void
414embryo_program_vm_push(Embryo_Program *ep)
415{
416 Embryo_Header *hdr;
417
418 if (!ep) return;
419 ep->pushes++;
420 if (ep->pushes > 1)
421 {
422 embryo_program_vm_reset(ep);
423 return;
424 }
425 hdr = (Embryo_Header *)ep->code;
426 ep->base = malloc(hdr->stp);
427 if (!ep->base)
428 {
429 ep->pushes = 0;
430 return;
431 }
432 embryo_program_vm_reset(ep);
433}
434
435EAPI void
436embryo_program_vm_pop(Embryo_Program *ep)
437{
438 if ((!ep) || (!ep->base)) return;
439 ep->pushes--;
440 if (ep->pushes >= 1) return;
441 free(ep->base);
442 ep->base = NULL;
443}
444
445
446EAPI void
447embryo_swap_16(unsigned short *v
448#ifndef WORDS_BIGENDIAN
449 __UNUSED__
450#endif
451 )
452{
453#ifdef WORDS_BIGENDIAN
454 _embryo_byte_swap_16(v);
455#endif
456}
457
458EAPI void
459embryo_swap_32(unsigned int *v
460#ifndef WORDS_BIGENDIAN
461 __UNUSED__
462#endif
463 )
464{
465#ifdef WORDS_BIGENDIAN
466 _embryo_byte_swap_32(v);
467#endif
468}
469
470EAPI Embryo_Function
471embryo_program_function_find(Embryo_Program *ep, const char *name)
472{
473 int first, last, mid, result;
474 char pname[sNAMEMAX + 1];
475 Embryo_Header *hdr;
476
477 if (!ep) return EMBRYO_FUNCTION_NONE;
478 hdr = (Embryo_Header *)ep->code;
479 last = NUMENTRIES(hdr, publics, natives) - 1;
480 first = 0;
481 /* binary search */
482 while (first <= last)
483 {
484 mid = (first + last) / 2;
485 if (_embryo_func_get(ep, mid, pname) == EMBRYO_ERROR_NONE)
486 result = strcmp(pname, name);
487 else
488 return EMBRYO_FUNCTION_NONE;
489/* result = -1;*/
490 if (result > 0) last = mid - 1;
491 else if (result < 0) first = mid + 1;
492 else return mid;
493 }
494 return EMBRYO_FUNCTION_NONE;
495}
496
497
498EAPI Embryo_Cell
499embryo_program_variable_find(Embryo_Program *ep, const char *name)
500{
501 int first, last, mid, result;
502 char pname[sNAMEMAX + 1];
503 Embryo_Cell paddr;
504 Embryo_Header *hdr;
505
506 if (!ep) return EMBRYO_CELL_NONE;
507 if (!ep->base) return EMBRYO_CELL_NONE;
508 hdr = (Embryo_Header *)ep->base;
509 last = NUMENTRIES(hdr, pubvars, tags) - 1;
510 first = 0;
511 /* binary search */
512 while (first <= last)
513 {
514 mid = (first + last) / 2;
515 if (_embryo_var_get(ep, mid, pname, &paddr) == EMBRYO_ERROR_NONE)
516 result = strcmp(pname, name);
517 else
518 return EMBRYO_CELL_NONE;
519/* result = -1;*/
520 if (result > 0) last = mid - 1;
521 else if (result < 0) first = mid + 1;
522 else return paddr;
523 }
524 return EMBRYO_CELL_NONE;
525}
526
527EAPI int
528embryo_program_variable_count_get(Embryo_Program *ep)
529{
530 Embryo_Header *hdr;
531
532 if (!ep) return 0;
533 if (!ep->base) return 0;
534 hdr = (Embryo_Header *)ep->base;
535 return NUMENTRIES(hdr, pubvars, tags);
536}
537
538EAPI Embryo_Cell
539embryo_program_variable_get(Embryo_Program *ep, int num)
540{
541 Embryo_Cell paddr;
542 char pname[sNAMEMAX + 1];
543
544 if (!ep) return EMBRYO_CELL_NONE;
545 if (!ep->base) return EMBRYO_CELL_NONE;
546 if (_embryo_var_get(ep, num, pname, &paddr) == EMBRYO_ERROR_NONE)
547 return paddr;
548 return EMBRYO_CELL_NONE;
549}
550
551
552EAPI void
553embryo_program_error_set(Embryo_Program *ep, Embryo_Error error)
554{
555 if (!ep) return;
556 ep->error = error;
557}
558
559EAPI Embryo_Error
560embryo_program_error_get(Embryo_Program *ep)
561{
562 if (!ep) return EMBRYO_ERROR_NONE;
563 return ep->error;
564}
565
566
567EAPI void
568embryo_program_data_set(Embryo_Program *ep, void *data)
569{
570 if (!ep) return;
571 ep->data = data;
572}
573
574EAPI void *
575embryo_program_data_get(Embryo_Program *ep)
576{
577 if (!ep) return NULL;
578 return ep->data;
579}
580
581EAPI const char *
582embryo_error_string_get(Embryo_Error error)
583{
584 const char *messages[] =
585 {
586 /* EMBRYO_ERROR_NONE */ "(none)",
587 /* EMBRYO_ERROR_EXIT */ "Forced exit",
588 /* EMBRYO_ERROR_ASSERT */ "Assertion failed",
589 /* EMBRYO_ERROR_STACKERR */ "Stack/heap collision (insufficient stack size)",
590 /* EMBRYO_ERROR_BOUNDS */ "Array index out of bounds",
591 /* EMBRYO_ERROR_MEMACCESS */ "Invalid memory access",
592 /* EMBRYO_ERROR_INVINSTR */ "Invalid instruction",
593 /* EMBRYO_ERROR_STACKLOW */ "Stack underflow",
594 /* EMBRYO_ERROR_HEAPLOW */ "Heap underflow",
595 /* EMBRYO_ERROR_CALLBACK */ "No (valid) native function callback",
596 /* EMBRYO_ERROR_NATIVE */ "Native function failed",
597 /* EMBRYO_ERROR_DIVIDE */ "Divide by zero",
598 /* EMBRYO_ERROR_SLEEP */ "(sleep mode)",
599 /* 13 */ "(reserved)",
600 /* 14 */ "(reserved)",
601 /* 15 */ "(reserved)",
602 /* EMBRYO_ERROR_MEMORY */ "Out of memory",
603 /* EMBRYO_ERROR_FORMAT */ "Invalid/unsupported P-code file format",
604 /* EMBRYO_ERROR_VERSION */ "File is for a newer version of the Embryo_Program",
605 /* EMBRYO_ERROR_NOTFOUND */ "Native/Public function is not found",
606 /* EMBRYO_ERROR_INDEX */ "Invalid index parameter (bad entry point)",
607 /* EMBRYO_ERROR_DEBUG */ "Debugger cannot run",
608 /* EMBRYO_ERROR_INIT */ "Embryo_Program not initialized (or doubly initialized)",
609 /* EMBRYO_ERROR_USERDATA */ "Unable to set user data field (table full)",
610 /* EMBRYO_ERROR_INIT_JIT */ "Cannot initialize the JIT",
611 /* EMBRYO_ERROR_PARAMS */ "Parameter error",
612 };
613 if (((int)error < 0) ||
614 ((int)error >= (int)(sizeof(messages) / sizeof(messages[0]))))
615 return (const char *)"(unknown)";
616 return messages[error];
617}
618
619
620EAPI int
621embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell)
622{
623 int len;
624 Embryo_Header *hdr;
625
626 if ((!ep) || (!ep->base)) return 0;
627 hdr = (Embryo_Header *)ep->base;
628 if ((!str_cell) ||
629 ((void *)str_cell >= (void *)(ep->base + hdr->stp)) ||
630 ((void *)str_cell < (void *)ep->base))
631 return 0;
632 for (len = 0; str_cell[len] != 0; len++);
633 return len;
634}
635
636EAPI void
637embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst)
638{
639 int i;
640 Embryo_Header *hdr;
641
642 if (!dst) return;
643 if ((!ep) || (!ep->base))
644 {
645 dst[0] = 0;
646 return;
647 }
648 hdr = (Embryo_Header *)ep->base;
649 if ((!str_cell) ||
650 ((void *)str_cell >= (void *)(ep->base + hdr->stp)) ||
651 ((void *)str_cell < (void *)ep->base))
652 {
653 dst[0] = 0;
654 return;
655 }
656 for (i = 0; str_cell[i] != 0; i++)
657 {
658#ifdef WORDS_BIGENDIAN
659 {
660 Embryo_Cell tmp;
661
662 tmp = str_cell[i];
663 _embryo_byte_swap_32(&tmp);
664 dst[i] = tmp;
665 }
666#else
667 dst[i] = str_cell[i];
668#endif
669 }
670 dst[i] = 0;
671}
672
673EAPI void
674embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cell)
675{
676 int i;
677 Embryo_Header *hdr;
678
679 if (!ep) return;
680 if (!ep->base) return;
681 hdr = (Embryo_Header *)ep->base;
682 if ((!str_cell) ||
683 ((void *)str_cell >= (void *)(ep->base + hdr->stp)) ||
684 ((void *)str_cell < (void *)ep->base))
685 return;
686 if (!src)
687 {
688 str_cell[0] = 0;
689 return;
690 }
691 for (i = 0; src[i] != 0; i++)
692 {
693 if ((void *)(&(str_cell[i])) >= (void *)(ep->base + hdr->stp)) return;
694 else if ((void *)(&(str_cell[i])) == (void *)(ep->base + hdr->stp - 1))
695 {
696 str_cell[i] = 0;
697 return;
698 }
699#ifdef WORDS_BIGENDIAN
700 {
701 Embryo_Cell tmp;
702
703 tmp = src[i];
704 _embryo_byte_swap_32(&tmp);
705 str_cell[i] = tmp;
706 }
707#else
708 str_cell[i] = src[i];
709#endif
710 }
711 str_cell[i] = 0;
712}
713
714EAPI Embryo_Cell *
715embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr)
716{
717 Embryo_Header *hdr;
718 unsigned char *data;
719
720 if ((!ep) || (!ep->base)) return NULL;
721 hdr = (Embryo_Header *)ep->base;
722 data = ep->base + (int)hdr->dat;
723 if ((addr < 0) || (addr >= hdr->stp)) return NULL;
724 return (Embryo_Cell *)(data + (int)addr);
725}
726
727
728EAPI Embryo_Cell
729embryo_data_heap_push(Embryo_Program *ep, int cells)
730{
731 Embryo_Header *hdr;
732 Embryo_Cell addr;
733
734 if ((!ep) || (!ep->base)) return EMBRYO_CELL_NONE;
735 hdr = (Embryo_Header *)ep->base;
736 if (ep->stk - ep->hea - (cells * sizeof(Embryo_Cell)) < STKMARGIN)
737 return EMBRYO_CELL_NONE;
738 addr = ep->hea;
739 ep->hea += (cells * sizeof(Embryo_Cell));
740 return addr;
741}
742
743EAPI void
744embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to)
745{
746 if (!ep) return;
747 if (down_to < 0) down_to = 0;
748 if (ep->hea > down_to) ep->hea = down_to;
749}
750
751
752EAPI int
753embryo_program_recursion_get(Embryo_Program *ep)
754{
755 return ep->run_count;
756}
757
758#ifdef __GNUC__
759#if 1
760#define EMBRYO_EXEC_JUMPTABLE
761#endif
762#endif
763
764/* jump table optimization - only works for gcc though */
765#ifdef EMBRYO_EXEC_JUMPTABLE
766#define SWITCH(x) while (1) { goto *switchtable[x];
767#define SWITCHEND break; }
768#define CASE(x) SWITCHTABLE_##x:
769#define BREAK break;
770#else
771#define SWITCH(x) switch (x) {
772#define SWITCHEND }
773#define CASE(x) case x:
774#define BREAK break
775#endif
776
777EAPI Embryo_Status
778embryo_program_run(Embryo_Program *ep, Embryo_Function fn)
779{
780 Embryo_Header *hdr;
781 Embryo_Func_Stub *func;
782 unsigned char *code, *data;
783 Embryo_Cell pri, alt, stk, frm, hea, hea_start;
784 Embryo_Cell reset_stk, reset_hea, *cip;
785 Embryo_UCell codesize;
786 int i;
787 unsigned char op;
788 Embryo_Cell offs;
789 int num;
790 int max_run_cycles;
791 int cycle_count;
792#ifdef EMBRYO_EXEC_JUMPTABLE
793 /* we limit the jumptable to 256 elements. why? above we forced "op" to be
794 * a unsigned char - that means 256 max values. we limit opcode overflow
795 * here, so eliminating crashes on table lookups with bad/corrupt bytecode.
796 * no need to atuall do compares, branches etc. the datatype does the work
797 * for us. so that means EXCESS elements are all declared as OP_NONE to
798 * keep them innocuous.
799 */
800 static const void *switchtable[256] =
801 {
802 &&SWITCHTABLE_EMBRYO_OP_NONE,
803 &&SWITCHTABLE_EMBRYO_OP_LOAD_PRI,
804 &&SWITCHTABLE_EMBRYO_OP_LOAD_ALT,
805 &&SWITCHTABLE_EMBRYO_OP_LOAD_S_PRI,
806 &&SWITCHTABLE_EMBRYO_OP_LOAD_S_ALT,
807 &&SWITCHTABLE_EMBRYO_OP_LREF_PRI,
808 &&SWITCHTABLE_EMBRYO_OP_LREF_ALT,
809 &&SWITCHTABLE_EMBRYO_OP_LREF_S_PRI,
810 &&SWITCHTABLE_EMBRYO_OP_LREF_S_ALT,
811 &&SWITCHTABLE_EMBRYO_OP_LOAD_I,
812 &&SWITCHTABLE_EMBRYO_OP_LODB_I,
813 &&SWITCHTABLE_EMBRYO_OP_CONST_PRI,
814 &&SWITCHTABLE_EMBRYO_OP_CONST_ALT,
815 &&SWITCHTABLE_EMBRYO_OP_ADDR_PRI,
816 &&SWITCHTABLE_EMBRYO_OP_ADDR_ALT,
817 &&SWITCHTABLE_EMBRYO_OP_STOR_PRI,
818 &&SWITCHTABLE_EMBRYO_OP_STOR_ALT,
819 &&SWITCHTABLE_EMBRYO_OP_STOR_S_PRI,
820 &&SWITCHTABLE_EMBRYO_OP_STOR_S_ALT,
821 &&SWITCHTABLE_EMBRYO_OP_SREF_PRI,
822 &&SWITCHTABLE_EMBRYO_OP_SREF_ALT,
823 &&SWITCHTABLE_EMBRYO_OP_SREF_S_PRI,
824 &&SWITCHTABLE_EMBRYO_OP_SREF_S_ALT,
825 &&SWITCHTABLE_EMBRYO_OP_STOR_I,
826 &&SWITCHTABLE_EMBRYO_OP_STRB_I,
827 &&SWITCHTABLE_EMBRYO_OP_LIDX,
828 &&SWITCHTABLE_EMBRYO_OP_LIDX_B,
829 &&SWITCHTABLE_EMBRYO_OP_IDXADDR,
830 &&SWITCHTABLE_EMBRYO_OP_IDXADDR_B,
831 &&SWITCHTABLE_EMBRYO_OP_ALIGN_PRI,
832 &&SWITCHTABLE_EMBRYO_OP_ALIGN_ALT,
833 &&SWITCHTABLE_EMBRYO_OP_LCTRL,
834 &&SWITCHTABLE_EMBRYO_OP_SCTRL,
835 &&SWITCHTABLE_EMBRYO_OP_MOVE_PRI,
836 &&SWITCHTABLE_EMBRYO_OP_MOVE_ALT,
837 &&SWITCHTABLE_EMBRYO_OP_XCHG,
838 &&SWITCHTABLE_EMBRYO_OP_PUSH_PRI,
839 &&SWITCHTABLE_EMBRYO_OP_PUSH_ALT,
840 &&SWITCHTABLE_EMBRYO_OP_PUSH_R,
841 &&SWITCHTABLE_EMBRYO_OP_PUSH_C,
842 &&SWITCHTABLE_EMBRYO_OP_PUSH,
843 &&SWITCHTABLE_EMBRYO_OP_PUSH_S,
844 &&SWITCHTABLE_EMBRYO_OP_POP_PRI,
845 &&SWITCHTABLE_EMBRYO_OP_POP_ALT,
846 &&SWITCHTABLE_EMBRYO_OP_STACK,
847 &&SWITCHTABLE_EMBRYO_OP_HEAP,
848 &&SWITCHTABLE_EMBRYO_OP_PROC,
849 &&SWITCHTABLE_EMBRYO_OP_RET,
850 &&SWITCHTABLE_EMBRYO_OP_RETN,
851 &&SWITCHTABLE_EMBRYO_OP_CALL,
852 &&SWITCHTABLE_EMBRYO_OP_CALL_PRI,
853 &&SWITCHTABLE_EMBRYO_OP_JUMP,
854 &&SWITCHTABLE_EMBRYO_OP_JREL,
855 &&SWITCHTABLE_EMBRYO_OP_JZER,
856 &&SWITCHTABLE_EMBRYO_OP_JNZ,
857 &&SWITCHTABLE_EMBRYO_OP_JEQ,
858 &&SWITCHTABLE_EMBRYO_OP_JNEQ,
859 &&SWITCHTABLE_EMBRYO_OP_JLESS,
860 &&SWITCHTABLE_EMBRYO_OP_JLEQ,
861 &&SWITCHTABLE_EMBRYO_OP_JGRTR,
862 &&SWITCHTABLE_EMBRYO_OP_JGEQ,
863 &&SWITCHTABLE_EMBRYO_OP_JSLESS,
864 &&SWITCHTABLE_EMBRYO_OP_JSLEQ,
865 &&SWITCHTABLE_EMBRYO_OP_JSGRTR,
866 &&SWITCHTABLE_EMBRYO_OP_JSGEQ,
867 &&SWITCHTABLE_EMBRYO_OP_SHL,
868 &&SWITCHTABLE_EMBRYO_OP_SHR,
869 &&SWITCHTABLE_EMBRYO_OP_SSHR,
870 &&SWITCHTABLE_EMBRYO_OP_SHL_C_PRI,
871 &&SWITCHTABLE_EMBRYO_OP_SHL_C_ALT,
872 &&SWITCHTABLE_EMBRYO_OP_SHR_C_PRI,
873 &&SWITCHTABLE_EMBRYO_OP_SHR_C_ALT,
874 &&SWITCHTABLE_EMBRYO_OP_SMUL,
875 &&SWITCHTABLE_EMBRYO_OP_SDIV,
876 &&SWITCHTABLE_EMBRYO_OP_SDIV_ALT,
877 &&SWITCHTABLE_EMBRYO_OP_UMUL,
878 &&SWITCHTABLE_EMBRYO_OP_UDIV,
879 &&SWITCHTABLE_EMBRYO_OP_UDIV_ALT,
880 &&SWITCHTABLE_EMBRYO_OP_ADD,
881 &&SWITCHTABLE_EMBRYO_OP_SUB,
882 &&SWITCHTABLE_EMBRYO_OP_SUB_ALT,
883 &&SWITCHTABLE_EMBRYO_OP_AND,
884 &&SWITCHTABLE_EMBRYO_OP_OR,
885 &&SWITCHTABLE_EMBRYO_OP_XOR,
886 &&SWITCHTABLE_EMBRYO_OP_NOT,
887 &&SWITCHTABLE_EMBRYO_OP_NEG,
888 &&SWITCHTABLE_EMBRYO_OP_INVERT,
889 &&SWITCHTABLE_EMBRYO_OP_ADD_C,
890 &&SWITCHTABLE_EMBRYO_OP_SMUL_C,
891 &&SWITCHTABLE_EMBRYO_OP_ZERO_PRI,
892 &&SWITCHTABLE_EMBRYO_OP_ZERO_ALT,
893 &&SWITCHTABLE_EMBRYO_OP_ZERO,
894 &&SWITCHTABLE_EMBRYO_OP_ZERO_S,
895 &&SWITCHTABLE_EMBRYO_OP_SIGN_PRI,
896 &&SWITCHTABLE_EMBRYO_OP_SIGN_ALT,
897 &&SWITCHTABLE_EMBRYO_OP_EQ,
898 &&SWITCHTABLE_EMBRYO_OP_NEQ,
899 &&SWITCHTABLE_EMBRYO_OP_LESS,
900 &&SWITCHTABLE_EMBRYO_OP_LEQ,
901 &&SWITCHTABLE_EMBRYO_OP_GRTR,
902 &&SWITCHTABLE_EMBRYO_OP_GEQ,
903 &&SWITCHTABLE_EMBRYO_OP_SLESS,
904 &&SWITCHTABLE_EMBRYO_OP_SLEQ,
905 &&SWITCHTABLE_EMBRYO_OP_SGRTR,
906 &&SWITCHTABLE_EMBRYO_OP_SGEQ,
907 &&SWITCHTABLE_EMBRYO_OP_EQ_C_PRI,
908 &&SWITCHTABLE_EMBRYO_OP_EQ_C_ALT,
909 &&SWITCHTABLE_EMBRYO_OP_INC_PRI,
910 &&SWITCHTABLE_EMBRYO_OP_INC_ALT,
911 &&SWITCHTABLE_EMBRYO_OP_INC,
912 &&SWITCHTABLE_EMBRYO_OP_INC_S,
913 &&SWITCHTABLE_EMBRYO_OP_INC_I,
914 &&SWITCHTABLE_EMBRYO_OP_DEC_PRI,
915 &&SWITCHTABLE_EMBRYO_OP_DEC_ALT,
916 &&SWITCHTABLE_EMBRYO_OP_DEC,
917 &&SWITCHTABLE_EMBRYO_OP_DEC_S,
918 &&SWITCHTABLE_EMBRYO_OP_DEC_I,
919 &&SWITCHTABLE_EMBRYO_OP_MOVS,
920 &&SWITCHTABLE_EMBRYO_OP_CMPS,
921 &&SWITCHTABLE_EMBRYO_OP_FILL,
922 &&SWITCHTABLE_EMBRYO_OP_HALT,
923 &&SWITCHTABLE_EMBRYO_OP_BOUNDS,
924 &&SWITCHTABLE_EMBRYO_OP_SYSREQ_PRI,
925 &&SWITCHTABLE_EMBRYO_OP_SYSREQ_C,
926 &&SWITCHTABLE_EMBRYO_OP_FILE,
927 &&SWITCHTABLE_EMBRYO_OP_LINE,
928 &&SWITCHTABLE_EMBRYO_OP_SYMBOL,
929 &&SWITCHTABLE_EMBRYO_OP_SRANGE,
930 &&SWITCHTABLE_EMBRYO_OP_JUMP_PRI,
931 &&SWITCHTABLE_EMBRYO_OP_SWITCH,
932 &&SWITCHTABLE_EMBRYO_OP_CASETBL,
933 &&SWITCHTABLE_EMBRYO_OP_SWAP_PRI,
934 &&SWITCHTABLE_EMBRYO_OP_SWAP_ALT,
935 &&SWITCHTABLE_EMBRYO_OP_PUSHADDR,
936 &&SWITCHTABLE_EMBRYO_OP_NOP,
937 &&SWITCHTABLE_EMBRYO_OP_SYSREQ_D,
938 &&SWITCHTABLE_EMBRYO_OP_SYMTAG,
939 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
940 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
941 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
942 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
943 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
944 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
945 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
946 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
947 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
948 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
949 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
950 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
951 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
952 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
953 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
954 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
955 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
956 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
957 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
958 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
959 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
960 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
961 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE,
962 &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_NONE
963 };
964#endif
965 if (!ep) return EMBRYO_PROGRAM_FAIL;
966 if (!(ep->flags & EMBRYO_FLAG_RELOC))
967 {
968 ep->error = EMBRYO_ERROR_INIT;
969 return EMBRYO_PROGRAM_FAIL;
970 }
971 if (!ep->base)
972 {
973 ep->error = EMBRYO_ERROR_INIT;
974 return EMBRYO_PROGRAM_FAIL;
975 }
976 if (ep->run_count > 0)
977 {
978 /* return EMBRYO_PROGRAM_BUSY; */
979 /* FIXME: test C->vm->C->vm recursion more fully */
980 /* it seems to work... just fine!!! - strange! */
981 }
982
983 /* set up the registers */
984 hdr = (Embryo_Header *)ep->base;
985 codesize = (Embryo_UCell)(hdr->dat - hdr->cod);
986 code = ep->base + (int)hdr->cod;
987 data = ep->base + (int)hdr->dat;
988 hea_start = hea = ep->hea;
989 stk = ep->stk;
990 reset_stk = stk;
991 reset_hea = hea;
992 frm = alt = pri = 0;
993
994 /* get the start address */
995 if (fn == EMBRYO_FUNCTION_MAIN)
996 {
997 if (hdr->cip < 0)
998 {
999 ep->error = EMBRYO_ERROR_INDEX;
1000 return EMBRYO_PROGRAM_FAIL;
1001 }
1002 cip = (Embryo_Cell *)(code + (int)hdr->cip);
1003 }
1004 else if (fn == EMBRYO_FUNCTION_CONT)
1005 {
1006 /* all registers: pri, alt, frm, cip, hea, stk, reset_stk, reset_hea */
1007 frm = ep->frm;
1008 stk = ep->stk;
1009 hea = ep->hea;
1010 pri = ep->pri;
1011 alt = ep->alt;
1012 reset_stk = ep->reset_stk;
1013 reset_hea = ep->reset_hea;
1014 cip = (Embryo_Cell *)(code + (int)ep->cip);
1015 }
1016 else if (fn < 0)
1017 {
1018 ep->error = EMBRYO_ERROR_INDEX;
1019 return EMBRYO_PROGRAM_FAIL;
1020 }
1021 else
1022 {
1023 if (fn >= (Embryo_Cell)NUMENTRIES(hdr, publics, natives))
1024 {
1025 ep->error = EMBRYO_ERROR_INDEX;
1026 return EMBRYO_PROGRAM_FAIL;
1027 }
1028 func = GETENTRY(hdr, publics, fn);
1029 cip = (Embryo_Cell *)(code + (int)func->address);
1030 }
1031 /* check values just copied */
1032 CHKSTACK();
1033 CHKHEAP();
1034
1035 if (fn != EMBRYO_FUNCTION_CONT)
1036 {
1037 int i;
1038
1039 for (i = ep->params_size - 1; i >= 0; i--)
1040 {
1041 Embryo_Param *pr;
1042
1043 pr = &(ep->params[i]);
1044 if (pr->string)
1045 {
1046 int len;
1047 Embryo_Cell ep_addr, *addr;
1048
1049 len = strlen(pr->string);
1050 ep_addr = embryo_data_heap_push(ep, len + 1);
1051 if (ep_addr == EMBRYO_CELL_NONE)
1052 {
1053 ep->error = EMBRYO_ERROR_HEAPLOW;
1054 return EMBRYO_PROGRAM_FAIL;
1055 }
1056 addr = embryo_data_address_get(ep, ep_addr);
1057 if (addr)
1058 embryo_data_string_set(ep, pr->string, addr);
1059 else
1060 {
1061 ep->error = EMBRYO_ERROR_HEAPLOW;
1062 return EMBRYO_PROGRAM_FAIL;
1063 }
1064 PUSH(ep_addr);
1065 free(pr->string);
1066 }
1067 else if (pr->cell_array)
1068 {
1069 int len;
1070 Embryo_Cell ep_addr, *addr;
1071
1072 len = pr->cell_array_size;
1073 ep_addr = embryo_data_heap_push(ep, len + 1);
1074 if (ep_addr == EMBRYO_CELL_NONE)
1075 {
1076 ep->error = EMBRYO_ERROR_HEAPLOW;
1077 return EMBRYO_PROGRAM_FAIL;
1078 }
1079 addr = embryo_data_address_get(ep, ep_addr);
1080 if (addr)
1081 memcpy(addr, pr->cell_array,
1082 pr->cell_array_size * sizeof(Embryo_Cell));
1083 else
1084 {
1085 ep->error = EMBRYO_ERROR_HEAPLOW;
1086 return EMBRYO_PROGRAM_FAIL;
1087 }
1088 PUSH(ep_addr);
1089 free(pr->cell_array);
1090 }
1091 else
1092 {
1093 PUSH(pr->cell);
1094 }
1095 }
1096 PUSH(ep->params_size * sizeof(Embryo_Cell));
1097 PUSH(0);
1098 if (ep->params)
1099 {
1100 free(ep->params);
1101 ep->params = NULL;
1102 }
1103 ep->params_size = ep->params_alloc = 0;
1104 }
1105 /* check stack/heap before starting to run */
1106 CHKMARGIN();
1107
1108 /* track recursion depth */
1109 ep->run_count++;
1110
1111 max_run_cycles = ep->max_run_cycles;
1112 /* start running */
1113 for (cycle_count = 0;;)
1114 {
1115 if (max_run_cycles > 0)
1116 {
1117 if (cycle_count >= max_run_cycles)
1118 {
1119 TOOLONG(ep);
1120 }
1121 cycle_count++;
1122 }
1123 op = (Embryo_Opcode)*cip++;
1124 SWITCH(op);
1125 CASE(EMBRYO_OP_LOAD_PRI);
1126 GETPARAM(offs);
1127 pri = *(Embryo_Cell *)(data + (int)offs);
1128 BREAK;
1129 CASE(EMBRYO_OP_LOAD_ALT);
1130 GETPARAM(offs);
1131 alt = *(Embryo_Cell *)(data + (int)offs);
1132 BREAK;
1133 CASE(EMBRYO_OP_LOAD_S_PRI);
1134 GETPARAM(offs);
1135 pri = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1136 BREAK;
1137 CASE(EMBRYO_OP_LOAD_S_ALT);
1138 GETPARAM(offs);
1139 alt = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1140 BREAK;
1141 CASE(EMBRYO_OP_LREF_PRI);
1142 GETPARAM(offs);
1143 offs = *(Embryo_Cell *)(data + (int)offs);
1144 pri = *(Embryo_Cell *)(data + (int)offs);
1145 BREAK;
1146 CASE(EMBRYO_OP_LREF_ALT);
1147 GETPARAM(offs);
1148 offs = *(Embryo_Cell *)(data + (int)offs);
1149 alt = *(Embryo_Cell *)(data + (int)offs);
1150 BREAK;
1151 CASE(EMBRYO_OP_LREF_S_PRI);
1152 GETPARAM(offs);
1153 offs = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1154 pri = *(Embryo_Cell *)(data + (int)offs);
1155 BREAK;
1156 CASE(EMBRYO_OP_LREF_S_ALT);
1157 GETPARAM(offs);
1158 offs = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1159 alt = *(Embryo_Cell *)(data + (int)offs);
1160 BREAK;
1161 CASE(EMBRYO_OP_LOAD_I);
1162 CHKMEM(pri);
1163 pri = *(Embryo_Cell *)(data + (int)pri);
1164 BREAK;
1165 CASE(EMBRYO_OP_LODB_I);
1166 GETPARAM(offs);
1167 CHKMEM(pri);
1168 switch (offs)
1169 {
1170 case 1:
1171 pri = *(data + (int)pri);
1172 break;
1173 case 2:
1174 pri = *(unsigned short *)(data + (int)pri);
1175 break;
1176 case 4:
1177 pri = *(unsigned int *)(data + (int)pri);
1178 break;
1179 default:
1180 ABORT(ep, EMBRYO_ERROR_INVINSTR);
1181 break;
1182 }
1183 BREAK;
1184 CASE(EMBRYO_OP_CONST_PRI);
1185 GETPARAM(pri);
1186 BREAK;
1187 CASE(EMBRYO_OP_CONST_ALT);
1188 GETPARAM(alt);
1189 BREAK;
1190 CASE(EMBRYO_OP_ADDR_PRI);
1191 GETPARAM(pri);
1192 pri += frm;
1193 BREAK;
1194 CASE(EMBRYO_OP_ADDR_ALT);
1195 GETPARAM(alt);
1196 alt += frm;
1197 BREAK;
1198 CASE(EMBRYO_OP_STOR_PRI);
1199 GETPARAM(offs);
1200 *(Embryo_Cell *)(data + (int)offs) = pri;
1201 BREAK;
1202 CASE(EMBRYO_OP_STOR_ALT);
1203 GETPARAM(offs);
1204 *(Embryo_Cell *)(data + (int)offs) = alt;
1205 BREAK;
1206 CASE(EMBRYO_OP_STOR_S_PRI);
1207 GETPARAM(offs);
1208 *(Embryo_Cell *)(data + (int)frm + (int)offs) = pri;
1209 BREAK;
1210 CASE(EMBRYO_OP_STOR_S_ALT);
1211 GETPARAM(offs);
1212 *(Embryo_Cell *)(data + (int)frm + (int)offs) = alt;
1213 BREAK;
1214 CASE(EMBRYO_OP_SREF_PRI);
1215 GETPARAM(offs);
1216 offs = *(Embryo_Cell *)(data + (int)offs);
1217 *(Embryo_Cell *)(data + (int)offs) = pri;
1218 BREAK;
1219 CASE(EMBRYO_OP_SREF_ALT);
1220 GETPARAM(offs);
1221 offs = *(Embryo_Cell *)(data + (int)offs);
1222 *(Embryo_Cell *)(data + (int)offs) = alt;
1223 BREAK;
1224 CASE(EMBRYO_OP_SREF_S_PRI);
1225 GETPARAM(offs);
1226 offs = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1227 *(Embryo_Cell *)(data + (int)offs) = pri;
1228 BREAK;
1229 CASE(EMBRYO_OP_SREF_S_ALT);
1230 GETPARAM(offs);
1231 offs = *(Embryo_Cell *)(data + (int)frm + (int)offs);
1232 *(Embryo_Cell *)(data + (int)offs) = alt;
1233 BREAK;
1234 CASE(EMBRYO_OP_STOR_I);
1235 CHKMEM(alt);
1236 *(Embryo_Cell *)(data + (int)alt) = pri;
1237 BREAK;
1238 CASE(EMBRYO_OP_STRB_I);
1239 GETPARAM(offs);
1240 CHKMEM(alt);
1241 switch (offs)
1242 {
1243 case 1:
1244 *(data + (int)alt) = (unsigned char)pri;
1245 break;
1246 case 2:
1247 *(unsigned short *)(data + (int)alt) = (unsigned short)pri;
1248 break;
1249 case 4:
1250 *(unsigned int *)(data + (int)alt) = (unsigned int)pri;
1251 break;
1252 default:
1253 ABORT(ep, EMBRYO_ERROR_INVINSTR);
1254 break;
1255 }
1256 BREAK;
1257 CASE(EMBRYO_OP_LIDX);
1258 offs = (pri * sizeof(Embryo_Cell)) + alt;
1259 CHKMEM(offs);
1260 pri = *(Embryo_Cell *)(data + (int)offs);
1261 BREAK;
1262 CASE(EMBRYO_OP_LIDX_B);
1263 GETPARAM(offs);
1264 offs = (pri << (int)offs) + alt;
1265 CHKMEM(offs);
1266 pri = *(Embryo_Cell *)(data + (int)offs);
1267 BREAK;
1268 CASE(EMBRYO_OP_IDXADDR);
1269 pri = (pri * sizeof(Embryo_Cell)) + alt;
1270 BREAK;
1271 CASE(EMBRYO_OP_IDXADDR_B);
1272 GETPARAM(offs);
1273 pri = (pri << (int)offs) + alt;
1274 BREAK;
1275 CASE(EMBRYO_OP_ALIGN_PRI);
1276 GETPARAM(offs);
1277#ifdef WORDS_BIGENDIAN
1278 if ((size_t)offs < sizeof(Embryo_Cell))
1279 pri ^= sizeof(Embryo_Cell) - offs;
1280#endif
1281 BREAK;
1282 CASE(EMBRYO_OP_ALIGN_ALT);
1283 GETPARAM(offs);
1284#ifdef WORDS_BIGENDIAN
1285 if ((size_t)offs < sizeof(Embryo_Cell))
1286 alt ^= sizeof(Embryo_Cell) - offs;
1287#endif
1288 BREAK;
1289 CASE(EMBRYO_OP_LCTRL);
1290 GETPARAM(offs);
1291 switch (offs)
1292 {
1293 case 0:
1294 pri = hdr->cod;
1295 break;
1296 case 1:
1297 pri = hdr->dat;
1298 break;
1299 case 2:
1300 pri = hea;
1301 break;
1302 case 3:
1303 pri = ep->stp;
1304 break;
1305 case 4:
1306 pri = stk;
1307 break;
1308 case 5:
1309 pri = frm;
1310 break;
1311 case 6:
1312 pri = (Embryo_Cell)((unsigned char *)cip - code);
1313 break;
1314 default:
1315 ABORT(ep, EMBRYO_ERROR_INVINSTR);
1316 break;
1317 }
1318 BREAK;
1319 CASE(EMBRYO_OP_SCTRL);
1320 GETPARAM(offs);
1321 switch (offs)
1322 {
1323 case 0:
1324 case 1:
1325 case 2:
1326 hea = pri;
1327 break;
1328 case 3:
1329 /* cannot change these parameters */
1330 break;
1331 case 4:
1332 stk = pri;
1333 break;
1334 case 5:
1335 frm = pri;
1336 break;
1337 case 6:
1338 cip = (Embryo_Cell *)(code + (int)pri);
1339 break;
1340 default:
1341 ABORT(ep, EMBRYO_ERROR_INVINSTR);
1342 break;
1343 }
1344 BREAK;
1345 CASE(EMBRYO_OP_MOVE_PRI);
1346 pri = alt;
1347 BREAK;
1348 CASE(EMBRYO_OP_MOVE_ALT);
1349 alt = pri;
1350 BREAK;
1351 CASE(EMBRYO_OP_XCHG);
1352 offs = pri; /* offs is a temporary variable */
1353 pri = alt;
1354 alt = offs;
1355 BREAK;
1356 CASE(EMBRYO_OP_PUSH_PRI);
1357 PUSH(pri);
1358 BREAK;
1359 CASE(EMBRYO_OP_PUSH_ALT);
1360 PUSH(alt);
1361 BREAK;
1362 CASE(EMBRYO_OP_PUSH_C);
1363 GETPARAM(offs);
1364 PUSH(offs);
1365 BREAK;
1366 CASE(EMBRYO_OP_PUSH_R);
1367 GETPARAM(offs);
1368 while (offs--) PUSH(pri);
1369 BREAK;
1370 CASE(EMBRYO_OP_PUSH);
1371 GETPARAM(offs);
1372 PUSH(*(Embryo_Cell *)(data + (int)offs));
1373 BREAK;
1374 CASE(EMBRYO_OP_PUSH_S);
1375 GETPARAM(offs);
1376 PUSH(*(Embryo_Cell *)(data + (int)frm + (int)offs));
1377 BREAK;
1378 CASE(EMBRYO_OP_POP_PRI);
1379 POP(pri);
1380 BREAK;
1381 CASE(EMBRYO_OP_POP_ALT);
1382 POP(alt);
1383 BREAK;
1384 CASE(EMBRYO_OP_STACK);
1385 GETPARAM(offs);
1386 alt = stk;
1387 stk += offs;
1388 CHKMARGIN();
1389 CHKSTACK();
1390 BREAK;
1391 CASE(EMBRYO_OP_HEAP);
1392 GETPARAM(offs);
1393 alt = hea;
1394 hea += offs;
1395 CHKMARGIN();
1396 CHKHEAP();
1397 BREAK;
1398 CASE(EMBRYO_OP_PROC);
1399 PUSH(frm);
1400 frm = stk;
1401 CHKMARGIN();
1402 BREAK;
1403 CASE(EMBRYO_OP_RET);
1404 POP(frm);
1405 POP(offs);
1406 if ((Embryo_UCell)offs >= codesize)
1407 ABORT(ep, EMBRYO_ERROR_MEMACCESS);
1408 cip = (Embryo_Cell *)(code + (int)offs);
1409 BREAK;
1410 CASE(EMBRYO_OP_RETN);
1411 POP(frm);
1412 POP(offs);
1413 if ((Embryo_UCell)offs >= codesize)
1414 ABORT(ep, EMBRYO_ERROR_MEMACCESS);
1415 cip = (Embryo_Cell *)(code + (int)offs);
1416 stk += *(Embryo_Cell *)(data + (int)stk) + sizeof(Embryo_Cell); /* remove parameters from the stack */
1417 ep->stk = stk;
1418 BREAK;
1419 CASE(EMBRYO_OP_CALL);
1420 PUSH(((unsigned char *)cip - code) + sizeof(Embryo_Cell));/* skip address */
1421 cip = JUMPABS(code, cip); /* jump to the address */
1422 BREAK;
1423 CASE(EMBRYO_OP_CALL_PRI);
1424 PUSH((unsigned char *)cip - code);
1425 cip = (Embryo_Cell *)(code + (int)pri);
1426 BREAK;
1427 CASE(EMBRYO_OP_JUMP);
1428 /* since the GETPARAM() macro modifies cip, you cannot
1429 * do GETPARAM(cip) directly */
1430 cip = JUMPABS(code, cip);
1431 BREAK;
1432 CASE(EMBRYO_OP_JREL);
1433 offs = *cip;
1434 cip = (Embryo_Cell *)((unsigned char *)cip + (int)offs + sizeof(Embryo_Cell));
1435 BREAK;
1436 CASE(EMBRYO_OP_JZER);
1437 if (pri == 0)
1438 cip = JUMPABS(code, cip);
1439 else
1440 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1441 BREAK;
1442 CASE(EMBRYO_OP_JNZ);
1443 if (pri != 0)
1444 cip = JUMPABS(code, cip);
1445 else
1446 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1447 BREAK;
1448 CASE(EMBRYO_OP_JEQ);
1449 if (pri==alt)
1450 cip = JUMPABS(code, cip);
1451 else
1452 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1453 BREAK;
1454 CASE(EMBRYO_OP_JNEQ);
1455 if (pri != alt)
1456 cip = JUMPABS(code, cip);
1457 else
1458 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1459 BREAK;
1460 CASE(EMBRYO_OP_JLESS);
1461 if ((Embryo_UCell)pri < (Embryo_UCell)alt)
1462 cip = JUMPABS(code, cip);
1463 else
1464 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1465 BREAK;
1466 CASE(EMBRYO_OP_JLEQ);
1467 if ((Embryo_UCell)pri <= (Embryo_UCell)alt)
1468 cip = JUMPABS(code, cip);
1469 else
1470 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1471 BREAK;
1472 CASE(EMBRYO_OP_JGRTR);
1473 if ((Embryo_UCell)pri > (Embryo_UCell)alt)
1474 cip = JUMPABS(code, cip);
1475 else
1476 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1477 BREAK;
1478 CASE(EMBRYO_OP_JGEQ);
1479 if ((Embryo_UCell)pri >= (Embryo_UCell)alt)
1480 cip = JUMPABS(code, cip);
1481 else
1482 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1483 BREAK;
1484 CASE(EMBRYO_OP_JSLESS);
1485 if (pri < alt)
1486 cip = JUMPABS(code, cip);
1487 else
1488 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1489 BREAK;
1490 CASE(EMBRYO_OP_JSLEQ);
1491 if (pri <= alt)
1492 cip = JUMPABS(code, cip);
1493 else
1494 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1495 BREAK;
1496 CASE(EMBRYO_OP_JSGRTR);
1497 if (pri > alt)
1498 cip = JUMPABS(code, cip);
1499 else
1500 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1501 BREAK;
1502 CASE(EMBRYO_OP_JSGEQ);
1503 if (pri >= alt)
1504 cip = JUMPABS(code, cip);
1505 else
1506 cip = (Embryo_Cell *)((unsigned char *)cip + sizeof(Embryo_Cell));
1507 BREAK;
1508 CASE(EMBRYO_OP_SHL);
1509 pri <<= alt;
1510 BREAK;
1511 CASE(EMBRYO_OP_SHR);
1512 pri = (Embryo_UCell)pri >> (int)alt;
1513 BREAK;
1514 CASE(EMBRYO_OP_SSHR);
1515 pri >>= alt;
1516 BREAK;
1517 CASE(EMBRYO_OP_SHL_C_PRI);
1518 GETPARAM(offs);
1519 pri <<= offs;
1520 BREAK;
1521 CASE(EMBRYO_OP_SHL_C_ALT);
1522 GETPARAM(offs);
1523 alt <<= offs;
1524 BREAK;
1525 CASE(EMBRYO_OP_SHR_C_PRI);
1526 GETPARAM(offs);
1527 pri = (Embryo_UCell)pri >> (int)offs;
1528 BREAK;
1529 CASE(EMBRYO_OP_SHR_C_ALT);
1530 GETPARAM(offs);
1531 alt = (Embryo_UCell)alt >> (int)offs;
1532 BREAK;
1533 CASE(EMBRYO_OP_SMUL);
1534 pri *= alt;
1535 BREAK;
1536 CASE(EMBRYO_OP_SDIV);
1537 if (alt == 0) ABORT(ep, EMBRYO_ERROR_DIVIDE);
1538 /* divide must always round down; this is a bit
1539 * involved to do in a machine-independent way.
1540 */
1541 offs = ((pri % alt) + alt) % alt; /* true modulus */
1542 pri = (pri - offs) / alt; /* division result */
1543 alt = offs;
1544 BREAK;
1545 CASE(EMBRYO_OP_SDIV_ALT);
1546 if (pri == 0) ABORT(ep, EMBRYO_ERROR_DIVIDE);
1547 /* divide must always round down; this is a bit
1548 * involved to do in a machine-independent way.
1549 */
1550 offs = ((alt % pri) + pri) % pri; /* true modulus */
1551 pri = (alt - offs) / pri; /* division result */
1552 alt = offs;
1553 BREAK;
1554 CASE(EMBRYO_OP_UMUL);
1555 pri = (Embryo_UCell)pri * (Embryo_UCell)alt;
1556 BREAK;
1557 CASE(EMBRYO_OP_UDIV);
1558 if (alt == 0) ABORT(ep, EMBRYO_ERROR_DIVIDE);
1559 offs = (Embryo_UCell)pri % (Embryo_UCell)alt; /* temporary storage */
1560 pri = (Embryo_UCell)pri / (Embryo_UCell)alt;
1561 alt = offs;
1562 BREAK;
1563 CASE(EMBRYO_OP_UDIV_ALT);
1564 if (pri == 0) ABORT(ep, EMBRYO_ERROR_DIVIDE);
1565 offs = (Embryo_UCell)alt % (Embryo_UCell)pri; /* temporary storage */
1566 pri = (Embryo_UCell)alt / (Embryo_UCell)pri;
1567 alt = offs;
1568 BREAK;
1569 CASE(EMBRYO_OP_ADD);
1570 pri += alt;
1571 BREAK;
1572 CASE(EMBRYO_OP_SUB);
1573 pri -= alt;
1574 BREAK;
1575 CASE(EMBRYO_OP_SUB_ALT);
1576 pri = alt - pri;
1577 BREAK;
1578 CASE(EMBRYO_OP_AND);
1579 pri &= alt;
1580 BREAK;
1581 CASE(EMBRYO_OP_OR);
1582 pri |= alt;
1583 BREAK;
1584 CASE(EMBRYO_OP_XOR);
1585 pri ^= alt;
1586 BREAK;
1587 CASE(EMBRYO_OP_NOT);
1588 pri = !pri;
1589 BREAK;
1590 CASE(EMBRYO_OP_NEG);
1591 pri = -pri;
1592 BREAK;
1593 CASE(EMBRYO_OP_INVERT);
1594 pri = ~pri;
1595 BREAK;
1596 CASE(EMBRYO_OP_ADD_C);
1597 GETPARAM(offs);
1598 pri += offs;
1599 BREAK;
1600 CASE(EMBRYO_OP_SMUL_C);
1601 GETPARAM(offs);
1602 pri *= offs;
1603 BREAK;
1604 CASE(EMBRYO_OP_ZERO_PRI);
1605 pri = 0;
1606 BREAK;
1607 CASE(EMBRYO_OP_ZERO_ALT);
1608 alt = 0;
1609 BREAK;
1610 CASE(EMBRYO_OP_ZERO);
1611 GETPARAM(offs);
1612 *(Embryo_Cell *)(data + (int)offs) = 0;
1613 BREAK;
1614 CASE(EMBRYO_OP_ZERO_S);
1615 GETPARAM(offs);
1616 *(Embryo_Cell *)(data + (int)frm + (int)offs) = 0;
1617 BREAK;
1618 CASE(EMBRYO_OP_SIGN_PRI);
1619 if ((pri & 0xff) >= 0x80) pri |= ~(Embryo_UCell)0xff;
1620 BREAK;
1621 CASE(EMBRYO_OP_SIGN_ALT);
1622 if ((alt & 0xff) >= 0x80) alt |= ~(Embryo_UCell)0xff;
1623 BREAK;
1624 CASE(EMBRYO_OP_EQ);
1625 pri = (pri == alt) ? 1 : 0;
1626 BREAK;
1627 CASE(EMBRYO_OP_NEQ);
1628 pri = (pri != alt) ? 1 : 0;
1629 BREAK;
1630 CASE(EMBRYO_OP_LESS);
1631 pri = ((Embryo_UCell)pri < (Embryo_UCell)alt) ? 1 : 0;
1632 BREAK;
1633 CASE(EMBRYO_OP_LEQ);
1634 pri = ((Embryo_UCell)pri <= (Embryo_UCell)alt) ? 1 : 0;
1635 BREAK;
1636 CASE(EMBRYO_OP_GRTR);
1637 pri = ((Embryo_UCell)pri > (Embryo_UCell)alt) ? 1 : 0;
1638 BREAK;
1639 CASE(EMBRYO_OP_GEQ);
1640 pri = ((Embryo_UCell)pri >= (Embryo_UCell)alt) ? 1 : 0;
1641 BREAK;
1642 CASE(EMBRYO_OP_SLESS);
1643 pri = (pri < alt) ? 1 : 0;
1644 BREAK;
1645 CASE(EMBRYO_OP_SLEQ);
1646 pri = (pri <= alt) ? 1 : 0;
1647 BREAK;
1648 CASE(EMBRYO_OP_SGRTR);
1649 pri = (pri > alt) ? 1 : 0;
1650 BREAK;
1651 CASE(EMBRYO_OP_SGEQ);
1652 pri = (pri >= alt) ? 1 : 0;
1653 BREAK;
1654 CASE(EMBRYO_OP_EQ_C_PRI);
1655 GETPARAM(offs);
1656 pri = (pri == offs) ? 1 : 0;
1657 BREAK;
1658 CASE(EMBRYO_OP_EQ_C_ALT);
1659 GETPARAM(offs);
1660 pri = (alt == offs) ? 1 : 0;
1661 BREAK;
1662 CASE(EMBRYO_OP_INC_PRI);
1663 pri++;
1664 BREAK;
1665 CASE(EMBRYO_OP_INC_ALT);
1666 alt++;
1667 BREAK;
1668 CASE(EMBRYO_OP_INC);
1669 GETPARAM(offs);
1670 *(Embryo_Cell *)(data + (int)offs) += 1;
1671 BREAK;
1672 CASE(EMBRYO_OP_INC_S);
1673 GETPARAM(offs);
1674 *(Embryo_Cell *)(data + (int)frm + (int)offs) += 1;
1675 BREAK;
1676 CASE(EMBRYO_OP_INC_I);
1677 *(Embryo_Cell *)(data + (int)pri) += 1;
1678 BREAK;
1679 CASE(EMBRYO_OP_DEC_PRI);
1680 pri--;
1681 BREAK;
1682 CASE(EMBRYO_OP_DEC_ALT);
1683 alt--;
1684 BREAK;
1685 CASE(EMBRYO_OP_DEC);
1686 GETPARAM(offs);
1687 *(Embryo_Cell *)(data + (int)offs) -= 1;
1688 BREAK;
1689 CASE(EMBRYO_OP_DEC_S);
1690 GETPARAM(offs);
1691 *(Embryo_Cell *)(data + (int)frm + (int)offs) -= 1;
1692 BREAK;
1693 CASE(EMBRYO_OP_DEC_I);
1694 *(Embryo_Cell *)(data + (int)pri) -= 1;
1695 BREAK;
1696 CASE(EMBRYO_OP_MOVS);
1697 GETPARAM(offs);
1698 CHKMEM(pri);
1699 CHKMEM(pri + offs);
1700 CHKMEM(alt);
1701 CHKMEM(alt + offs);
1702 memcpy(data+(int)alt, data+(int)pri, (int)offs);
1703 BREAK;
1704 CASE(EMBRYO_OP_CMPS);
1705 GETPARAM(offs);
1706 CHKMEM(pri);
1707 CHKMEM(pri + offs);
1708 CHKMEM(alt);
1709 CHKMEM(alt + offs);
1710 pri = memcmp(data + (int)alt, data + (int)pri, (int)offs);
1711 BREAK;
1712 CASE(EMBRYO_OP_FILL);
1713 GETPARAM(offs);
1714 CHKMEM(alt);
1715 CHKMEM(alt + offs);
1716 for (i = (int)alt;
1717 (size_t)offs >= sizeof(Embryo_Cell);
1718 i += sizeof(Embryo_Cell), offs -= sizeof(Embryo_Cell))
1719 *(Embryo_Cell *)(data + i) = pri;
1720 BREAK;
1721 CASE(EMBRYO_OP_HALT);
1722 GETPARAM(offs);
1723 ep->retval = pri;
1724 /* store complete status */
1725 ep->frm = frm;
1726 ep->stk = stk;
1727 ep->hea = hea;
1728 ep->pri = pri;
1729 ep->alt = alt;
1730 ep->cip = (Embryo_Cell)((unsigned char*)cip - code);
1731 if (offs == EMBRYO_ERROR_SLEEP)
1732 {
1733 ep->reset_stk = reset_stk;
1734 ep->reset_hea = reset_hea;
1735 ep->run_count--;
1736 return EMBRYO_PROGRAM_SLEEP;
1737 }
1738 OK(ep, (int)offs);
1739 CASE(EMBRYO_OP_BOUNDS);
1740 GETPARAM(offs);
1741 if ((Embryo_UCell)pri > (Embryo_UCell)offs)
1742 ABORT(ep, EMBRYO_ERROR_BOUNDS);
1743 BREAK;
1744 CASE(EMBRYO_OP_SYSREQ_PRI);
1745 /* save a few registers */
1746 ep->cip = (Embryo_Cell)((unsigned char *)cip - code);
1747 ep->hea = hea;
1748 ep->frm = frm;
1749 ep->stk = stk;
1750 num = _embryo_native_call(ep, pri, &pri, (Embryo_Cell *)(data + (int)stk));
1751 if (num != EMBRYO_ERROR_NONE)
1752 {
1753 if (num == EMBRYO_ERROR_SLEEP)
1754 {
1755 ep->pri = pri;
1756 ep->alt = alt;
1757 ep->reset_stk = reset_stk;
1758 ep->reset_hea = reset_hea;
1759 ep->run_count--;
1760 return EMBRYO_PROGRAM_SLEEP;
1761 }
1762 ABORT(ep, num);
1763 }
1764 BREAK;
1765 CASE(EMBRYO_OP_SYSREQ_C);
1766 GETPARAM(offs);
1767 /* save a few registers */
1768 ep->cip = (Embryo_Cell)((unsigned char *)cip - code);
1769 ep->hea = hea;
1770 ep->frm = frm;
1771 ep->stk = stk;
1772 num = _embryo_native_call(ep, offs, &pri, (Embryo_Cell *)(data + (int)stk));
1773 if (num != EMBRYO_ERROR_NONE)
1774 {
1775 if (num == EMBRYO_ERROR_SLEEP)
1776 {
1777 ep->pri = pri;
1778 ep->alt = alt;
1779 ep->reset_stk = reset_stk;
1780 ep->reset_hea = reset_hea;
1781 ep->run_count--;
1782 return EMBRYO_PROGRAM_SLEEP;
1783 }
1784 {
1785 Embryo_Header *hdr;
1786 int i, num;
1787 Embryo_Func_Stub *func_entry;
1788
1789 hdr = (Embryo_Header *)ep->code;
1790 num = NUMENTRIES(hdr, natives, libraries);
1791 func_entry = GETENTRY(hdr, natives, 0);
1792 for (i = 0; i < num; i++)
1793 {
1794 char *entry_name;
1795
1796 entry_name = GETENTRYNAME(hdr, func_entry);
1797 if (i == offs)
1798 printf("EMBRYO: CALL [%i] %s() non-existent!\n", i, entry_name);
1799 func_entry =
1800 (Embryo_Func_Stub *)((unsigned char *)func_entry + hdr->defsize);
1801 }
1802 }
1803 ABORT(ep, num);
1804 }
1805 BREAK;
1806 CASE(EMBRYO_OP_SYSREQ_D);
1807 GETPARAM(offs);
1808 /* save a few registers */
1809 ep->cip = (Embryo_Cell)((unsigned char *)cip - code);
1810 ep->hea = hea;
1811 ep->frm = frm;
1812 ep->stk = stk;
1813 num = _embryo_native_call(ep, offs, &pri, (Embryo_Cell *)(data + (int)stk));
1814 if (num != EMBRYO_ERROR_NONE)
1815 {
1816 if (num == EMBRYO_ERROR_SLEEP)
1817 {
1818 ep->pri = pri;
1819 ep->alt = alt;
1820 ep->reset_stk = reset_stk;
1821 ep->reset_hea = reset_hea;
1822 ep->run_count--;
1823 return EMBRYO_PROGRAM_SLEEP;
1824 }
1825 ABORT(ep, ep->error);
1826 }
1827 BREAK;
1828 CASE(EMBRYO_OP_JUMP_PRI);
1829 cip = (Embryo_Cell *)(code + (int)pri);
1830 BREAK;
1831 CASE(EMBRYO_OP_SWITCH);
1832 {
1833 Embryo_Cell *cptr;
1834
1835 /* +1, to skip the "casetbl" opcode */
1836 cptr = (Embryo_Cell *)(code + (*cip)) + 1;
1837 /* number of records in the case table */
1838 num = (int)(*cptr);
1839 /* preset to "none-matched" case */
1840 cip = (Embryo_Cell *)(code + *(cptr + 1));
1841 for (cptr += 2;
1842 (num > 0) && (*cptr != pri);
1843 num--, cptr += 2);
1844 /* case found */
1845 if (num > 0)
1846 cip = (Embryo_Cell *)(code + *(cptr + 1));
1847 }
1848 BREAK;
1849 CASE(EMBRYO_OP_SWAP_PRI);
1850 offs = *(Embryo_Cell *)(data + (int)stk);
1851 *(Embryo_Cell *)(data + (int)stk) = pri;
1852 pri = offs;
1853 BREAK;
1854 CASE(EMBRYO_OP_SWAP_ALT);
1855 offs = *(Embryo_Cell *)(data + (int)stk);
1856 *(Embryo_Cell *)(data + (int)stk) = alt;
1857 alt = offs;
1858 BREAK;
1859 CASE(EMBRYO_OP_PUSHADDR);
1860 GETPARAM(offs);
1861 PUSH(frm + offs);
1862 BREAK;
1863 CASE(EMBRYO_OP_NOP);
1864 BREAK;
1865 CASE(EMBRYO_OP_NONE);
1866 CASE(EMBRYO_OP_FILE);
1867 CASE(EMBRYO_OP_LINE);
1868 CASE(EMBRYO_OP_SYMBOL);
1869 CASE(EMBRYO_OP_SRANGE);
1870 CASE(EMBRYO_OP_CASETBL);
1871 CASE(EMBRYO_OP_SYMTAG);
1872 BREAK;
1873#ifndef EMBRYO_EXEC_JUMPTABLE
1874 default:
1875 ABORT(ep, EMBRYO_ERROR_INVINSTR);
1876#endif
1877 SWITCHEND;
1878 }
1879 ep->max_run_cycles = max_run_cycles;
1880 ep->run_count--;
1881 ep->hea = hea_start;
1882 return EMBRYO_PROGRAM_OK;
1883}
1884
1885EAPI Embryo_Cell
1886embryo_program_return_value_get(Embryo_Program *ep)
1887{
1888 if (!ep) return 0;
1889 return ep->retval;
1890}
1891
1892EAPI void
1893embryo_program_max_cycle_run_set(Embryo_Program *ep, int max)
1894{
1895 if (!ep) return;
1896 if (max < 0) max = 0;
1897 ep->max_run_cycles = max;
1898}
1899
1900EAPI int
1901embryo_program_max_cycle_run_get(Embryo_Program *ep)
1902{
1903 if (!ep) return 0;
1904 return ep->max_run_cycles;
1905}
1906
1907
1908EAPI int
1909embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell)
1910{
1911 Embryo_Param *pr;
1912
1913 ep->params_size++;
1914 if (ep->params_size > ep->params_alloc)
1915 {
1916 ep->params_alloc += 8;
1917 pr = realloc(ep->params, ep->params_alloc * sizeof(Embryo_Param));
1918 if (!pr) return 0;
1919 ep->params = pr;
1920 }
1921 pr = &(ep->params[ep->params_size - 1]);
1922 pr->string = NULL;
1923 pr->cell_array = NULL;
1924 pr->cell_array_size = 0;
1925 pr->cell = 0;
1926 pr->cell = cell;
1927 return 1;
1928}
1929
1930EAPI int
1931embryo_parameter_string_push(Embryo_Program *ep, const char *str)
1932{
1933 Embryo_Param *pr;
1934 char *str_dup;
1935
1936 if (!str)
1937 return embryo_parameter_string_push(ep, "");
1938 str_dup = strdup(str);
1939 if (!str_dup) return 0;
1940 ep->params_size++;
1941 if (ep->params_size > ep->params_alloc)
1942 {
1943 ep->params_alloc += 8;
1944 pr = realloc(ep->params, ep->params_alloc * sizeof(Embryo_Param));
1945 if (!pr)
1946 {
1947 free(str_dup);
1948 return 0;
1949 }
1950 ep->params = pr;
1951 }
1952 pr = &(ep->params[ep->params_size - 1]);
1953 pr->string = NULL;
1954 pr->cell_array = NULL;
1955 pr->cell_array_size = 0;
1956 pr->cell = 0;
1957 pr->string = str_dup;
1958 return 1;
1959}
1960
1961EAPI int
1962embryo_parameter_cell_array_push(Embryo_Program *ep, Embryo_Cell *cells, int num)
1963{
1964 Embryo_Param *pr;
1965 Embryo_Cell *cell_array;
1966
1967 if ((!cells) || (num <= 0))
1968 return embryo_parameter_cell_push(ep, 0);
1969 cell_array = malloc(num * sizeof(Embryo_Cell));
1970 ep->params_size++;
1971 if (ep->params_size > ep->params_alloc)
1972 {
1973 ep->params_alloc += 8;
1974 pr = realloc(ep->params, ep->params_alloc * sizeof(Embryo_Param));
1975 if (!pr)
1976 {
1977 free(cell_array);
1978 return 0;
1979 }
1980 ep->params = pr;
1981 }
1982 pr = &(ep->params[ep->params_size - 1]);
1983 pr->string = NULL;
1984 pr->cell_array = NULL;
1985 pr->cell_array_size = 0;
1986 pr->cell = 0;
1987 pr->cell_array = cell_array;
1988 pr->cell_array_size = num;
1989 memcpy(pr->cell_array, cells, num * sizeof(Embryo_Cell));
1990 return 1;
1991}
diff --git a/libraries/embryo/src/lib/embryo_args.c b/libraries/embryo/src/lib/embryo_args.c
new file mode 100644
index 0000000..0c0089e
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_args.c
@@ -0,0 +1,128 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#ifdef HAVE_ALLOCA_H
6# include <alloca.h>
7#elif defined __GNUC__
8# define alloca __builtin_alloca
9#elif defined _AIX
10# define alloca __alloca
11#elif defined _MSC_VER
12# include <malloc.h>
13# define alloca _alloca
14#else
15# include <stddef.h>
16# ifdef __cplusplus
17extern "C"
18# endif
19void *alloca (size_t);
20#endif
21
22#include "Embryo.h"
23#include "embryo_private.h"
24
25#define STRSET(ep, par, str) { \
26 Embryo_Cell *___cptr; \
27 if ((___cptr = embryo_data_address_get(ep, par))) { \
28 embryo_data_string_set(ep, str, ___cptr); \
29 } }
30
31/* exported args api */
32
33static Embryo_Cell
34_embryo_args_numargs(Embryo_Program *ep, Embryo_Cell *params __UNUSED__)
35{
36 Embryo_Header *hdr;
37 unsigned char *data;
38 Embryo_Cell bytes;
39
40 hdr = (Embryo_Header *)ep->base;
41 data = ep->base + (int)hdr->dat;
42 bytes = *(Embryo_Cell *)(data + (int)ep->frm +
43 (2 * sizeof(Embryo_Cell)));
44 return bytes / sizeof(Embryo_Cell);
45}
46
47static Embryo_Cell
48_embryo_args_getarg(Embryo_Program *ep, Embryo_Cell *params)
49{
50 Embryo_Header *hdr;
51 unsigned char *data;
52 Embryo_Cell val;
53
54 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
55 hdr = (Embryo_Header *)ep->base;
56 data = ep->base + (int)hdr->dat;
57 val = *(Embryo_Cell *)(data + (int)ep->frm +
58 (((int)params[1] + 3) * sizeof(Embryo_Cell)));
59 val += params[2] * sizeof(Embryo_Cell);
60 val = *(Embryo_Cell *)(data + (int)val);
61 return val;
62}
63
64static Embryo_Cell
65_embryo_args_setarg(Embryo_Program *ep, Embryo_Cell *params)
66{
67 Embryo_Header *hdr;
68 unsigned char *data;
69 Embryo_Cell val;
70
71 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
72 hdr = (Embryo_Header *)ep->base;
73 data = ep->base + (int)hdr->dat;
74 val = *(Embryo_Cell *)(data + (int)ep->frm +
75 (((int)params[1] + 3) * sizeof(Embryo_Cell)));
76 val += params[2] * sizeof(Embryo_Cell);
77 if ((val < 0) || ((val >= ep->hea) && (val < ep->stk))) return 0;
78 *(Embryo_Cell *)(data + (int)val) = params[3];
79 return 1;
80}
81
82static Embryo_Cell
83_embryo_args_getsarg(Embryo_Program *ep, Embryo_Cell *params)
84{
85 Embryo_Header *hdr;
86 unsigned char *data;
87 Embryo_Cell base_cell;
88 char *s;
89 int i = 0;
90
91 /* params[1] = arg_no */
92 /* params[2] = buf */
93 /* params[3] = buflen */
94 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
95 if (params[3] <= 0) return 0; /* buflen must be > 0 */
96 hdr = (Embryo_Header *)ep->base;
97 data = ep->base + (int)hdr->dat;
98 base_cell = *(Embryo_Cell *)(data + (int)ep->frm +
99 (((int)params[1] + 3) * sizeof(Embryo_Cell)));
100
101 s = alloca(params[3]);
102
103 while (i < params[3])
104 {
105 int offset = base_cell + (i * sizeof(Embryo_Cell));
106
107 s[i] = *(Embryo_Cell *)(data + offset);
108 if (!s[i++]) break;
109 }
110
111 s[i - 1] = 0;
112 STRSET(ep, params[2], s);
113
114 return i - 1; /* characters written minus terminator */
115}
116
117/* functions used by the rest of embryo */
118
119void
120_embryo_args_init(Embryo_Program *ep)
121{
122 embryo_program_native_call_add(ep, "numargs", _embryo_args_numargs);
123 embryo_program_native_call_add(ep, "getarg", _embryo_args_getarg);
124 embryo_program_native_call_add(ep, "setarg", _embryo_args_setarg);
125 embryo_program_native_call_add(ep, "getfarg", _embryo_args_getarg);
126 embryo_program_native_call_add(ep, "setfarg", _embryo_args_setarg);
127 embryo_program_native_call_add(ep, "getsarg", _embryo_args_getsarg);
128}
diff --git a/libraries/embryo/src/lib/embryo_float.c b/libraries/embryo/src/lib/embryo_float.c
new file mode 100644
index 0000000..608be9d
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_float.c
@@ -0,0 +1,331 @@
1/* Float arithmetic for the Small AMX engine
2 *
3 * Copyright (c) Artran, Inc. 1999
4 * Written by Greg Garner (gmg@artran.com)
5 * Portions Copyright (c) Carsten Haitzler, 2004 <raster@rasterman.com>
6 *
7 * This software is provided "as-is", without any express or implied warranty.
8 * In no event will the authors be held liable for any damages arising from
9 * the use of this software.
10 *
11 * Permission is granted to anyone to use this software for any purpose,
12 * including commercial applications, and to alter it and redistribute it
13 * freely, subject to the following restrictions:
14 *
15 * 1. The origin of this software must not be misrepresented; you must not
16 * claim that you wrote the original software. If you use this software in
17 * a product, an acknowledgment in the product documentation would be
18 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
21 * 3. This notice may not be removed or altered from any source distribution.
22 */
23
24/* CHANGES -
25 * 2002-08-27: Basic conversion of source from C++ to C by Adam D. Moss
26 * <adam@gimp.org> <aspirin@icculus.org>
27 * 2003-08-29: Removal of the dynamic memory allocation and replacing two
28 * type conversion functions by macros, by Thiadmer Riemersma
29 * 2003-09-22: Moved the type conversion macros to AMX.H, and simplifications
30 * of some routines, by Thiadmer Riemersma
31 * 2003-11-24: A few more native functions (geometry), plus minor modifications,
32 * mostly to be compatible with dynamically loadable extension
33 * modules, by Thiadmer Riemersma
34 * 2004-03-20: Cleaned up and reduced size for Embryo, Modified to conform to
35 * E coding style. Added extra parameter checks.
36 * Carsten Haitzler, <raster@rasterman.com>
37 */
38
39
40#ifdef HAVE_CONFIG_H
41# include "config.h"
42#endif
43
44#include <stdlib.h>
45#include <math.h>
46
47#include "Embryo.h"
48#include "embryo_private.h"
49
50#define PI 3.1415926535897932384626433832795f
51
52/* internally useful calls */
53
54static float
55_embryo_fp_degrees_to_radians(float angle, int radix)
56{
57 switch (radix)
58 {
59 case 1: /* degrees, sexagesimal system (technically: degrees/minutes/seconds) */
60 return (angle * PI / 180.0f);
61 case 2: /* grades, centesimal system */
62 return (angle * PI / 200.0f);
63 default: /* assume already radian */
64 break;
65 }
66 return angle;
67}
68
69/* exported float api */
70
71static Embryo_Cell
72_embryo_fp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
73{
74 /* params[1] = long value to convert to a float */
75 float f;
76
77 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
78 f = (float)params[1];
79 return EMBRYO_FLOAT_TO_CELL(f);
80}
81
82static Embryo_Cell
83_embryo_fp_str(Embryo_Program *ep, Embryo_Cell *params)
84{
85 /* params[1] = virtual string address to convert to a float */
86 char buf[64];
87 Embryo_Cell *str;
88 float f;
89 int len;
90
91 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
92 str = embryo_data_address_get(ep, params[1]);
93 len = embryo_data_string_length_get(ep, str);
94 if ((len == 0) || (len >= (int)sizeof(buf))) return 0;
95 embryo_data_string_get(ep, str, buf);
96 f = (float)atof(buf);
97 return EMBRYO_FLOAT_TO_CELL(f);
98}
99
100static Embryo_Cell
101_embryo_fp_mul(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
102{
103 /* params[1] = float operand 1 */
104 /* params[2] = float operand 2 */
105 float f;
106
107 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
108 f = EMBRYO_CELL_TO_FLOAT(params[1]) * EMBRYO_CELL_TO_FLOAT(params[2]);
109 return EMBRYO_FLOAT_TO_CELL(f);
110}
111
112static Embryo_Cell
113_embryo_fp_div(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
114{
115 /* params[1] = float dividend (top) */
116 /* params[2] = float divisor (bottom) */
117 float f;
118
119 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
120 f = EMBRYO_CELL_TO_FLOAT(params[1]) / EMBRYO_CELL_TO_FLOAT(params[2]);
121 return EMBRYO_FLOAT_TO_CELL(f);
122}
123
124static Embryo_Cell
125_embryo_fp_add(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
126{
127 /* params[1] = float operand 1 */
128 /* params[2] = float operand 2 */
129 float f;
130
131 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
132 f = EMBRYO_CELL_TO_FLOAT(params[1]) + EMBRYO_CELL_TO_FLOAT(params[2]);
133 return EMBRYO_FLOAT_TO_CELL(f);
134}
135
136static Embryo_Cell
137_embryo_fp_sub(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
138{
139 /* params[1] = float operand 1 */
140 /* params[2] = float operand 2 */
141 float f;
142
143 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
144 f = EMBRYO_CELL_TO_FLOAT(params[1]) - EMBRYO_CELL_TO_FLOAT(params[2]);
145 return EMBRYO_FLOAT_TO_CELL(f);
146}
147
148/* Return fractional part of float */
149static Embryo_Cell
150_embryo_fp_fract(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
151{
152 /* params[1] = float operand */
153 float f;
154
155 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
156 f = EMBRYO_CELL_TO_FLOAT(params[1]);
157 f -= (floorf(f));
158 return EMBRYO_FLOAT_TO_CELL(f);
159}
160
161/* Return integer part of float, rounded */
162static Embryo_Cell
163_embryo_fp_round(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
164{
165 /* params[1] = float operand */
166 /* params[2] = Type of rounding (cell) */
167 float f;
168
169 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
170 f = EMBRYO_CELL_TO_FLOAT(params[1]);
171 switch (params[2])
172 {
173 case 1: /* round downwards (truncate) */
174 f = (floorf(f));
175 break;
176 case 2: /* round upwards */
177 f = (ceilf(f));
178 break;
179 case 3: /* round towards zero */
180 if (f >= 0.0) f = (floorf(f));
181 else f = (ceilf(f));
182 break;
183 default: /* standard, round to nearest */
184 f = (floorf(f + 0.5));
185 break;
186 }
187 return (Embryo_Cell)f;
188}
189
190static Embryo_Cell
191_embryo_fp_cmp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
192{
193 /* params[1] = float operand 1 */
194 /* params[2] = float operand 2 */
195 float f, ff;
196
197 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
198 f = EMBRYO_CELL_TO_FLOAT(params[1]);
199 ff = EMBRYO_CELL_TO_FLOAT(params[2]);
200 if (f == ff) return 0;
201 else if (f > ff) return 1;
202 return -1;
203}
204
205static Embryo_Cell
206_embryo_fp_sqroot(Embryo_Program *ep, Embryo_Cell *params)
207{
208 /* params[1] = float operand */
209 float f;
210
211 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
212 f = EMBRYO_CELL_TO_FLOAT(params[1]);
213 f = sqrtf(f);
214 if (f < 0)
215 {
216 embryo_program_error_set(ep, EMBRYO_ERROR_DOMAIN);
217 return 0;
218 }
219 return EMBRYO_FLOAT_TO_CELL(f);
220}
221
222static Embryo_Cell
223_embryo_fp_power(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
224{
225 /* params[1] = float operand 1 */
226 /* params[2] = float operand 2 */
227 float f, ff;
228
229 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
230 f = EMBRYO_CELL_TO_FLOAT(params[1]);
231 ff = EMBRYO_CELL_TO_FLOAT(params[2]);
232 f = powf(f, ff);
233 return EMBRYO_FLOAT_TO_CELL(f);
234}
235
236static Embryo_Cell
237_embryo_fp_log(Embryo_Program *ep, Embryo_Cell *params)
238{
239 /* params[1] = float operand 1 (value) */
240 /* params[2] = float operand 2 (base) */
241 float f, ff;
242
243 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
244 f = EMBRYO_CELL_TO_FLOAT(params[1]);
245 ff = EMBRYO_CELL_TO_FLOAT(params[2]);
246 if ((f <= 0.0) || (ff <= 0.0))
247 {
248 embryo_program_error_set(ep, EMBRYO_ERROR_DOMAIN);
249 return 0;
250 }
251 if (ff == 10.0) f = log10f(f);
252 else f = (logf(f) / logf(ff));
253 return EMBRYO_FLOAT_TO_CELL(f);
254}
255
256static Embryo_Cell
257_embryo_fp_sin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
258{
259 /* params[1] = float operand 1 (angle) */
260 /* params[2] = float operand 2 (radix) */
261 float f;
262
263 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
264 f = EMBRYO_CELL_TO_FLOAT(params[1]);
265 f = _embryo_fp_degrees_to_radians(f, params[2]);
266 f = sinf(f);
267 return EMBRYO_FLOAT_TO_CELL(f);
268}
269
270static Embryo_Cell
271_embryo_fp_cos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
272{
273 /* params[1] = float operand 1 (angle) */
274 /* params[2] = float operand 2 (radix) */
275 float f;
276
277 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
278 f = EMBRYO_CELL_TO_FLOAT(params[1]);
279 f = _embryo_fp_degrees_to_radians(f, params[2]);
280 f = cosf(f);
281 return EMBRYO_FLOAT_TO_CELL(f);
282}
283
284static Embryo_Cell
285_embryo_fp_tan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
286{
287 /* params[1] = float operand 1 (angle) */
288 /* params[2] = float operand 2 (radix) */
289 float f;
290
291 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
292 f = EMBRYO_CELL_TO_FLOAT(params[1]);
293 f = _embryo_fp_degrees_to_radians(f, params[2]);
294 f = tanf(f);
295 return EMBRYO_FLOAT_TO_CELL(f);
296}
297
298static Embryo_Cell
299_embryo_fp_abs(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
300{
301 /* params[1] = float operand */
302 float f;
303
304 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
305 f = EMBRYO_CELL_TO_FLOAT(params[1]);
306 f = (f >= 0) ? f : -f;
307 return EMBRYO_FLOAT_TO_CELL(f);
308}
309
310/* functions used by the rest of embryo */
311
312void
313_embryo_fp_init(Embryo_Program *ep)
314{
315 embryo_program_native_call_add(ep, "float", _embryo_fp);
316 embryo_program_native_call_add(ep, "atof", _embryo_fp_str);
317 embryo_program_native_call_add(ep, "float_mul", _embryo_fp_mul);
318 embryo_program_native_call_add(ep, "float_div", _embryo_fp_div);
319 embryo_program_native_call_add(ep, "float_add", _embryo_fp_add);
320 embryo_program_native_call_add(ep, "float_sub", _embryo_fp_sub);
321 embryo_program_native_call_add(ep, "fract", _embryo_fp_fract);
322 embryo_program_native_call_add(ep, "round", _embryo_fp_round);
323 embryo_program_native_call_add(ep, "float_cmp", _embryo_fp_cmp);
324 embryo_program_native_call_add(ep, "sqrt", _embryo_fp_sqroot);
325 embryo_program_native_call_add(ep, "pow", _embryo_fp_power);
326 embryo_program_native_call_add(ep, "log", _embryo_fp_log);
327 embryo_program_native_call_add(ep, "sin", _embryo_fp_sin);
328 embryo_program_native_call_add(ep, "cos", _embryo_fp_cos);
329 embryo_program_native_call_add(ep, "tan", _embryo_fp_tan);
330 embryo_program_native_call_add(ep, "abs", _embryo_fp_abs);
331}
diff --git a/libraries/embryo/src/lib/embryo_main.c b/libraries/embryo/src/lib/embryo_main.c
new file mode 100644
index 0000000..0b01b11
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_main.c
@@ -0,0 +1,36 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdlib.h>
6#include <time.h>
7
8#include "Embryo.h"
9#include "embryo_private.h"
10
11static Embryo_Version _version = { VMAJ, VMIN, VMIC, VREV };
12EAPI Embryo_Version *embryo_version = &_version;
13
14static int _embryo_init_count = 0;
15
16/*** EXPORTED CALLS ***/
17
18EAPI int
19embryo_init(void)
20{
21 if (++_embryo_init_count != 1)
22 return _embryo_init_count;
23
24 srand(time(NULL));
25
26 return _embryo_init_count;
27}
28
29EAPI int
30embryo_shutdown(void)
31{
32 if (--_embryo_init_count != 0)
33 return _embryo_init_count;
34
35 return _embryo_init_count;
36}
diff --git a/libraries/embryo/src/lib/embryo_private.h b/libraries/embryo/src/lib/embryo_private.h
new file mode 100644
index 0000000..a4205e1
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_private.h
@@ -0,0 +1,298 @@
1#ifndef _EMBRYO_PRIVATE_H
2#define _EMBRYO_PRIVATE_H
3
4
5#ifdef __GNUC__
6# if __GNUC__ >= 4
7// BROKEN in gcc 4 on amd64
8//# pragma GCC visibility push(hidden)
9# endif
10#endif
11
12typedef enum _Embryo_Opcode Embryo_Opcode;
13
14enum _Embryo_Opcode
15{
16 EMBRYO_OP_NONE,
17 EMBRYO_OP_LOAD_PRI,
18 EMBRYO_OP_LOAD_ALT,
19 EMBRYO_OP_LOAD_S_PRI,
20 EMBRYO_OP_LOAD_S_ALT,
21 EMBRYO_OP_LREF_PRI,
22 EMBRYO_OP_LREF_ALT,
23 EMBRYO_OP_LREF_S_PRI,
24 EMBRYO_OP_LREF_S_ALT,
25 EMBRYO_OP_LOAD_I,
26 EMBRYO_OP_LODB_I,
27 EMBRYO_OP_CONST_PRI,
28 EMBRYO_OP_CONST_ALT,
29 EMBRYO_OP_ADDR_PRI,
30 EMBRYO_OP_ADDR_ALT,
31 EMBRYO_OP_STOR_PRI,
32 EMBRYO_OP_STOR_ALT,
33 EMBRYO_OP_STOR_S_PRI,
34 EMBRYO_OP_STOR_S_ALT,
35 EMBRYO_OP_SREF_PRI,
36 EMBRYO_OP_SREF_ALT,
37 EMBRYO_OP_SREF_S_PRI,
38 EMBRYO_OP_SREF_S_ALT,
39 EMBRYO_OP_STOR_I,
40 EMBRYO_OP_STRB_I,
41 EMBRYO_OP_LIDX,
42 EMBRYO_OP_LIDX_B,
43 EMBRYO_OP_IDXADDR,
44 EMBRYO_OP_IDXADDR_B,
45 EMBRYO_OP_ALIGN_PRI,
46 EMBRYO_OP_ALIGN_ALT,
47 EMBRYO_OP_LCTRL,
48 EMBRYO_OP_SCTRL,
49 EMBRYO_OP_MOVE_PRI,
50 EMBRYO_OP_MOVE_ALT,
51 EMBRYO_OP_XCHG,
52 EMBRYO_OP_PUSH_PRI,
53 EMBRYO_OP_PUSH_ALT,
54 EMBRYO_OP_PUSH_R,
55 EMBRYO_OP_PUSH_C,
56 EMBRYO_OP_PUSH,
57 EMBRYO_OP_PUSH_S,
58 EMBRYO_OP_POP_PRI,
59 EMBRYO_OP_POP_ALT,
60 EMBRYO_OP_STACK,
61 EMBRYO_OP_HEAP,
62 EMBRYO_OP_PROC,
63 EMBRYO_OP_RET,
64 EMBRYO_OP_RETN,
65 EMBRYO_OP_CALL,
66 EMBRYO_OP_CALL_PRI,
67 EMBRYO_OP_JUMP,
68 EMBRYO_OP_JREL,
69 EMBRYO_OP_JZER,
70 EMBRYO_OP_JNZ,
71 EMBRYO_OP_JEQ,
72 EMBRYO_OP_JNEQ,
73 EMBRYO_OP_JLESS,
74 EMBRYO_OP_JLEQ,
75 EMBRYO_OP_JGRTR,
76 EMBRYO_OP_JGEQ,
77 EMBRYO_OP_JSLESS,
78 EMBRYO_OP_JSLEQ,
79 EMBRYO_OP_JSGRTR,
80 EMBRYO_OP_JSGEQ,
81 EMBRYO_OP_SHL,
82 EMBRYO_OP_SHR,
83 EMBRYO_OP_SSHR,
84 EMBRYO_OP_SHL_C_PRI,
85 EMBRYO_OP_SHL_C_ALT,
86 EMBRYO_OP_SHR_C_PRI,
87 EMBRYO_OP_SHR_C_ALT,
88 EMBRYO_OP_SMUL,
89 EMBRYO_OP_SDIV,
90 EMBRYO_OP_SDIV_ALT,
91 EMBRYO_OP_UMUL,
92 EMBRYO_OP_UDIV,
93 EMBRYO_OP_UDIV_ALT,
94 EMBRYO_OP_ADD,
95 EMBRYO_OP_SUB,
96 EMBRYO_OP_SUB_ALT,
97 EMBRYO_OP_AND,
98 EMBRYO_OP_OR,
99 EMBRYO_OP_XOR,
100 EMBRYO_OP_NOT,
101 EMBRYO_OP_NEG,
102 EMBRYO_OP_INVERT,
103 EMBRYO_OP_ADD_C,
104 EMBRYO_OP_SMUL_C,
105 EMBRYO_OP_ZERO_PRI,
106 EMBRYO_OP_ZERO_ALT,
107 EMBRYO_OP_ZERO,
108 EMBRYO_OP_ZERO_S,
109 EMBRYO_OP_SIGN_PRI,
110 EMBRYO_OP_SIGN_ALT,
111 EMBRYO_OP_EQ,
112 EMBRYO_OP_NEQ,
113 EMBRYO_OP_LESS,
114 EMBRYO_OP_LEQ,
115 EMBRYO_OP_GRTR,
116 EMBRYO_OP_GEQ,
117 EMBRYO_OP_SLESS,
118 EMBRYO_OP_SLEQ,
119 EMBRYO_OP_SGRTR,
120 EMBRYO_OP_SGEQ,
121 EMBRYO_OP_EQ_C_PRI,
122 EMBRYO_OP_EQ_C_ALT,
123 EMBRYO_OP_INC_PRI,
124 EMBRYO_OP_INC_ALT,
125 EMBRYO_OP_INC,
126 EMBRYO_OP_INC_S,
127 EMBRYO_OP_INC_I,
128 EMBRYO_OP_DEC_PRI,
129 EMBRYO_OP_DEC_ALT,
130 EMBRYO_OP_DEC,
131 EMBRYO_OP_DEC_S,
132 EMBRYO_OP_DEC_I,
133 EMBRYO_OP_MOVS,
134 EMBRYO_OP_CMPS,
135 EMBRYO_OP_FILL,
136 EMBRYO_OP_HALT,
137 EMBRYO_OP_BOUNDS,
138 EMBRYO_OP_SYSREQ_PRI,
139 EMBRYO_OP_SYSREQ_C,
140 EMBRYO_OP_FILE,
141 EMBRYO_OP_LINE,
142 EMBRYO_OP_SYMBOL,
143 EMBRYO_OP_SRANGE,
144 EMBRYO_OP_JUMP_PRI,
145 EMBRYO_OP_SWITCH,
146 EMBRYO_OP_CASETBL,
147 EMBRYO_OP_SWAP_PRI,
148 EMBRYO_OP_SWAP_ALT,
149 EMBRYO_OP_PUSHADDR,
150 EMBRYO_OP_NOP,
151 EMBRYO_OP_SYSREQ_D,
152 EMBRYO_OP_SYMTAG,
153 /* ----- */
154 EMBRYO_OP_NUM_OPCODES
155};
156
157#define NUMENTRIES(hdr, field, nextfield) \
158(int)(((hdr)->nextfield - (hdr)->field) / (hdr)->defsize)
159#define GETENTRY(hdr, table, index) \
160(Embryo_Func_Stub *)((unsigned char*)(hdr) + \
161(int)(hdr)->table + index * (hdr)->defsize)
162#ifdef WORDS_BIGENDIAN
163static int __inline __entryswap32(int v)
164{int vv; vv = v; embryo_swap_32((unsigned int *)&vv); return vv;}
165# define GETENTRYNAME(hdr, entry) \
166(((hdr)->defsize == 2 * sizeof(unsigned int)) \
167? (char *)((unsigned char*)(hdr) + \
168__entryswap32(*((unsigned int *)(entry) + 1))) \
169: (entry)->name)
170#else
171# define GETENTRYNAME(hdr, entry) \
172(((hdr)->defsize == 2 * sizeof(unsigned int)) \
173? (char *)((unsigned char*)(hdr) + *((unsigned int *)(entry) + 1)) \
174: (entry)->name)
175#endif
176
177#define CUR_FILE_VERSION 7 /* current file version; also the current Embryo_Program version */
178#define MIN_FILE_VERSION 7 /* lowest supported file format version for the current Embryo_Program version */
179#define MIN_AMX_VERSION 7 /* minimum Embryo_Program version needed to support the current file format */
180#define sEXPMAX 19 /* maximum name length for file version <= 6 */
181#define sNAMEMAX 31 /* maximum name length of symbol name */
182#define EMBRYO_MAGIC 0xf1e0 /* magic byte pattern */
183#define EMBRYO_FLAG_COMPACT 0x04 /* compact encoding */
184#define EMBRYO_FLAG_RELOC 0x8000 /* jump/call addresses relocated */
185#define GETPARAM(v) (v = *(Embryo_Cell *)cip++)
186#define PUSH(v) (stk -= sizeof(Embryo_Cell), *(Embryo_Cell *)(data + (int)stk) = v)
187#define POP(v) (v = *(Embryo_Cell *)(data + (int)stk), stk += sizeof(Embryo_Cell))
188#define ABORT(ep,v) {(ep)->stk = reset_stk; (ep)->hea = reset_hea; (ep)->run_count--; ep->error = v; (ep)->max_run_cycles = max_run_cycles; return EMBRYO_PROGRAM_FAIL;}
189#define OK(ep,v) {(ep)->stk = reset_stk; (ep)->hea = reset_hea; (ep)->run_count--; ep->error = v; (ep)->max_run_cycles = max_run_cycles; return EMBRYO_PROGRAM_OK;}
190#define TOOLONG(ep) {(ep)->pri = pri; (ep)->cip = (Embryo_Cell)((unsigned char *)cip - code); (ep)->alt = alt; (ep)->frm = frm; (ep)->stk = stk; (ep)->hea = hea; (ep)->reset_stk = reset_stk; (ep)->reset_hea = reset_hea; (ep)->run_count--; (ep)->max_run_cycles = max_run_cycles; return EMBRYO_PROGRAM_TOOLONG;}
191#define STKMARGIN ((Embryo_Cell)(16 * sizeof(Embryo_Cell)))
192#define CHKMARGIN() if ((hea + STKMARGIN) > stk) {ep->error = EMBRYO_ERROR_STACKERR; return 0;}
193#define CHKSTACK() if (stk > ep->stp) {ep->run_count--; ep->error = EMBRYO_ERROR_STACKLOW; return 0;}
194#define CHKHEAP() if (hea < ep->hlw) {ep->run_count--; ep->error = EMBRYO_ERROR_HEAPLOW; return 0;}
195#define CHKMEM(x) if ((((x) >= hea) && ((x) < stk)) || ((Embryo_UCell)(x) >= (Embryo_UCell)ep->stp)) ABORT(ep, EMBRYO_ERROR_MEMACCESS);
196
197typedef struct _Embryo_Param Embryo_Param;
198typedef struct _Embryo_Header Embryo_Header;
199typedef struct _Embryo_Func_Stub Embryo_Func_Stub;
200
201typedef Embryo_Cell (*Embryo_Native)(Embryo_Program *ep, Embryo_Cell *params);
202
203struct _Embryo_Param
204{
205 char *string;
206 Embryo_Cell *cell_array;
207 int cell_array_size;
208 Embryo_Cell cell;
209};
210
211struct _Embryo_Program
212{
213 unsigned char *base; /* points to the Embryo_Program header ("ephdr") plus the code, optionally also the data */
214 int pushes; /* number of pushes - pops */
215 /* for external functions a few registers must be accessible from the outside */
216 Embryo_Cell cip; /* instruction pointer: relative to base + ephdr->cod */
217 Embryo_Cell frm; /* stack frame base: relative to base + ephdr->dat */
218 Embryo_Cell hea; /* top of the heap: relative to base + ephdr->dat */
219 Embryo_Cell hlw; /* bottom of the heap: relative to base + ephdr->dat */
220 Embryo_Cell stk; /* stack pointer: relative to base + ephdr->dat */
221 Embryo_Cell stp; /* top of the stack: relative to base + ephdr->dat */
222 int flags; /* current status */
223 /* native functions can raise an error */
224 int error;
225 /* the sleep opcode needs to store the full Embryo_Program status */
226 Embryo_Cell pri;
227 Embryo_Cell alt;
228 Embryo_Cell reset_stk;
229 Embryo_Cell reset_hea;
230 Embryo_Cell *syscall_d; /* relocated value/address for the SYSCALL.D opcode */
231
232 /* extended stuff */
233 Embryo_Native *native_calls;
234 int native_calls_size;
235 int native_calls_alloc;
236
237 unsigned char *code;
238 unsigned char dont_free_code : 1;
239 Embryo_Cell retval;
240
241 Embryo_Param *params;
242 int params_size;
243 int params_alloc;
244
245 int run_count;
246
247 int max_run_cycles;
248
249 void *data;
250};
251
252#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100)
253# pragma pack(1)
254# define EMBRYO_STRUCT_PACKED
255#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100)
256# define EMBRYO_STRUCT_PACKED __attribute__((packed))
257#else
258# define EMBRYO_STRUCT_PACKED
259#endif
260
261struct _Embryo_Func_Stub
262{
263 int address;
264 char name[sEXPMAX+1];
265} EMBRYO_STRUCT_PACKED;
266
267struct _Embryo_Header
268{
269 unsigned int size; /* size of the "file" */
270 unsigned short magic; /* signature */
271 char file_version; /* file format version */
272 char ep_version; /* required version of the Embryo_Program */
273 short flags;
274 short defsize; /* size of a definition record */
275 int cod; /* initial value of COD - code block */
276 int dat; /* initial value of DAT - data block */
277 int hea; /* initial value of HEA - start of the heap */
278 int stp; /* initial value of STP - stack top */
279 int cip; /* initial value of CIP - the instruction pointer */
280 int publics; /* offset to the "public functions" table */
281 int natives; /* offset to the "native functions" table */
282 int libraries; /* offset to the table of libraries */
283 int pubvars; /* the "public variables" table */
284 int tags; /* the "public tagnames" table */
285 int nametable; /* name table, file version 7 only */
286} EMBRYO_STRUCT_PACKED;
287
288#if defined _MSC_VER || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100)
289# pragma pack()
290#endif
291
292void _embryo_args_init(Embryo_Program *ep);
293void _embryo_fp_init(Embryo_Program *ep);
294void _embryo_rand_init(Embryo_Program *ep);
295void _embryo_str_init(Embryo_Program *ep);
296void _embryo_time_init(Embryo_Program *ep);
297
298#endif
diff --git a/libraries/embryo/src/lib/embryo_rand.c b/libraries/embryo/src/lib/embryo_rand.c
new file mode 100644
index 0000000..627f7ed
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_rand.c
@@ -0,0 +1,36 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdlib.h>
6
7#include "Embryo.h"
8#include "embryo_private.h"
9
10/* exported random number api */
11
12static Embryo_Cell
13_embryo_rand_rand(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
14{
15 return (Embryo_Cell)(rand() & 0xffff);
16}
17
18static Embryo_Cell
19_embryo_rand_randf(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
20{
21 double r;
22 float f;
23
24 r = (double)(rand() & 0xffff) / 65535.0;
25 f = (float)r;
26 return EMBRYO_FLOAT_TO_CELL(f);
27}
28
29/* functions used by the rest of embryo */
30
31void
32_embryo_rand_init(Embryo_Program *ep)
33{
34 embryo_program_native_call_add(ep, "rand", _embryo_rand_rand);
35 embryo_program_native_call_add(ep, "randf", _embryo_rand_randf);
36}
diff --git a/libraries/embryo/src/lib/embryo_str.c b/libraries/embryo/src/lib/embryo_str.c
new file mode 100644
index 0000000..46a3284
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_str.c
@@ -0,0 +1,485 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <string.h>
8#include <fnmatch.h>
9
10#ifdef HAVE_ALLOCA_H
11# include <alloca.h>
12#elif defined __GNUC__
13# define alloca __builtin_alloca
14#elif defined _AIX
15# define alloca __alloca
16#elif defined _MSC_VER
17# include <malloc.h>
18# define alloca _alloca
19#else
20# include <stddef.h>
21# ifdef __cplusplus
22extern "C"
23# endif
24void *alloca (size_t);
25#endif
26
27#include "Embryo.h"
28#include "embryo_private.h"
29
30#define STRGET(ep, str, par) { \
31 Embryo_Cell *___cptr; \
32 str = NULL; \
33 if ((___cptr = embryo_data_address_get(ep, par))) { \
34 int ___l; \
35 ___l = embryo_data_string_length_get(ep, ___cptr); \
36 (str) = alloca(___l + 1); \
37 if (str) embryo_data_string_get(ep, ___cptr, str); \
38 } }
39#define STRSET(ep, par, str) { \
40 Embryo_Cell *___cptr; \
41 if ((___cptr = embryo_data_address_get(ep, par))) { \
42 embryo_data_string_set(ep, str, ___cptr); \
43 } }
44
45/* exported string api */
46
47static Embryo_Cell
48_embryo_str_atoi(Embryo_Program *ep, Embryo_Cell *params)
49{
50 char *s1;
51
52 /* params[1] = str */
53 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
54 STRGET(ep, s1, params[1]);
55 if (!s1) return 0;
56 return (Embryo_Cell)atoi(s1);
57}
58
59static Embryo_Cell
60_embryo_str_fnmatch(Embryo_Program *ep, Embryo_Cell *params)
61{
62 char *s1, *s2;
63
64 /* params[1] = glob */
65 /* params[2] = str */
66 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
67 STRGET(ep, s1, params[1]);
68 STRGET(ep, s2, params[2]);
69 if ((!s1) || (!s2)) return -1;
70 return (Embryo_Cell)fnmatch(s1, s2, 0);
71}
72
73static Embryo_Cell
74_embryo_str_strcmp(Embryo_Program *ep, Embryo_Cell *params)
75{
76 char *s1, *s2;
77
78 /* params[1] = str1 */
79 /* params[2] = str2 */
80 if (params[0] != (2 * sizeof(Embryo_Cell))) return -1;
81 STRGET(ep, s1, params[1]);
82 STRGET(ep, s2, params[2]);
83 if ((!s1) || (!s2)) return -1;
84 return (Embryo_Cell)strcmp(s1, s2);
85}
86
87static Embryo_Cell
88_embryo_str_strncmp(Embryo_Program *ep, Embryo_Cell *params)
89{
90 char *s1, *s2;
91
92 /* params[1] = str1 */
93 /* params[2] = str2 */
94 /* params[3] = n */
95 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
96 if (params[3] < 0) params[3] = 0;
97 STRGET(ep, s1, params[1]);
98 STRGET(ep, s2, params[2]);
99 if ((!s1) || (!s2)) return -1;
100 return (Embryo_Cell)strncmp(s1, s2, (size_t)params[3]);
101}
102
103static Embryo_Cell
104_embryo_str_strcpy(Embryo_Program *ep, Embryo_Cell *params)
105{
106 char *s1;
107
108 /* params[1] = dst */
109 /* params[2] = str */
110 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
111 STRGET(ep, s1, params[2]);
112 if (!s1) return 0;
113 STRSET(ep, params[1], s1);
114 return 0;
115}
116
117static Embryo_Cell
118_embryo_str_strncpy(Embryo_Program *ep, Embryo_Cell *params)
119{
120 char *s1;
121 int l;
122
123 /* params[1] = dst */
124 /* params[2] = str */
125 /* params[3] = n */
126 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
127 if (params[3] < 0) params[3] = 0;
128 STRGET(ep, s1, params[2]);
129 if (!s1) return 0;
130 l = strlen(s1);
131 if (l > params[3]) s1[params[3]] = 0;
132 STRSET(ep, params[1], s1);
133 return 0;
134}
135
136static Embryo_Cell
137_embryo_str_strlen(Embryo_Program *ep, Embryo_Cell *params)
138{
139 char *s1;
140
141 /* params[1] = str */
142 if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
143 STRGET(ep, s1, params[1]);
144 if (!s1) return 0;
145 return (Embryo_Cell)strlen(s1);
146}
147
148static Embryo_Cell
149_embryo_str_strcat(Embryo_Program *ep, Embryo_Cell *params)
150{
151 char *s1, *s2, *s3;
152
153 /* params[1] = dsr */
154 /* params[2] = str */
155 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
156 STRGET(ep, s1, params[1]);
157 STRGET(ep, s2, params[2]);
158 if ((!s1) || (!s2)) return 0;
159 s3 = alloca(strlen(s1) + strlen(s2) + 1);
160 if (!s3) return 0;
161 strcpy(s3, s1);
162 strcat(s3, s2);
163 STRSET(ep, params[1], s3);
164 return 0;
165}
166
167static Embryo_Cell
168_embryo_str_strncat(Embryo_Program *ep, Embryo_Cell *params)
169{
170 char *s1, *s2, *s3;
171 int l1, l2;
172
173 /* params[1] = dst */
174 /* params[2] = str */
175 /* params[3] = n */
176 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
177 if (params[3] < 0) params[3] = 0;
178 STRGET(ep, s1, params[1]);
179 STRGET(ep, s2, params[2]);
180 if ((!s1) || (!s2)) return 0;
181 l1 = strlen(s1);
182 l2 = strlen(s2);
183 s3 = alloca(l1 + l2 + 1);
184 if (!s3) return 0;
185 strcpy(s3, s1);
186 strncat(s3, s2, params[3]);
187 if (l2 >= params[3]) s3[l1 + params[3]] = 0;
188 STRSET(ep, params[1], s3);
189 return 0;
190}
191
192static Embryo_Cell
193_embryo_str_strprep(Embryo_Program *ep, Embryo_Cell *params)
194{
195 char *s1, *s2, *s3;
196
197 /* params[1] = dst */
198 /* params[2] = str */
199 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
200 STRGET(ep, s1, params[1]);
201 STRGET(ep, s2, params[2]);
202 if ((!s1) || (!s2)) return 0;
203 s3 = alloca(strlen(s1) + strlen(s2) + 1);
204 if (!s3) return 0;
205 strcpy(s3, s2);
206 strcat(s3, s1);
207 STRSET(ep, params[1], s3);
208 return 0;
209}
210
211static Embryo_Cell
212_embryo_str_strnprep(Embryo_Program *ep, Embryo_Cell *params)
213{
214 char *s1, *s2, *s3;
215 int l1, l2;
216
217 /* params[1] = dst */
218 /* params[2] = str */
219 /* params[3] = n */
220 if (params[0] != (3 * sizeof(Embryo_Cell))) return 0;
221 if (params[3] < 0) params[3] = 0;
222 STRGET(ep, s1, params[1]);
223 STRGET(ep, s2, params[2]);
224 if ((!s1) || (!s2)) return 0;
225 l1 = strlen(s1);
226 l2 = strlen(s2);
227 s3 = alloca(l1 + l2 + 1);
228 if (!s3) return 0;
229 strncpy(s3, s2, params[3]);
230 if (params[3] <= l2) s3[params[3]] = 0;
231 strcat(s3, s1);
232 STRSET(ep, params[1], s3);
233 return 0;
234}
235
236static Embryo_Cell
237_embryo_str_strcut(Embryo_Program *ep, Embryo_Cell *params)
238{
239 char *s1, *s2;
240 int l1;
241
242 /* params[1] = dst */
243 /* params[2] = str */
244 /* params[3] = n */
245 /* params[4] = n2 */
246 if (params[0] != (4 * sizeof(Embryo_Cell))) return 0;
247 if (params[3] < 0) params[3] = 0;
248 if (params[4] < params[3]) params[4] = params[3];
249 STRGET(ep, s1, params[2]);
250 if (!s1) return 0;
251 l1 = strlen(s1);
252 if (params[3] >= l1) params[3] = l1;
253 if (params[4] >= l1) params[4] = l1;
254 if (params[4] == params[3])
255 {
256 STRSET(ep, params[1], "");
257 return 0;
258 }
259 s2 = alloca(params[4] - params[3] + 1);
260 strncpy(s2, s1 + params[3], params[4] - params[3]);
261 s2[params[4] - params[3]] = 0;
262 STRSET(ep, params[1], s2);
263 return 0;
264}
265
266static Embryo_Cell
267_embryo_str_snprintf(Embryo_Program *ep, Embryo_Cell *params)
268{
269 char *s1, *s2;
270 int i, o;
271 int inesc = 0;
272 int insub = 0;
273 int p, pnum;
274
275 /* params[1] = buf */
276 /* params[2] = bufsize */
277 /* params[3] = format_string */
278 /* params[4] = first arg ... */
279 if (params[0] < (Embryo_Cell)(3 * sizeof(Embryo_Cell))) return 0;
280 if (params[2] <= 0) return 0;
281 STRGET(ep, s1, params[3]);
282 if (!s1) return -1;
283 s2 = alloca(params[2] + 1);
284 if (!s2) return -1;
285 s2[0] = 0;
286 pnum = (params[0] / sizeof(Embryo_Cell)) - 3;
287 for (p = 0, o = 0, i = 0; (s1[i]) && (o < (params[2] - 1)) && (p < (pnum + 1)); i++)
288 {
289 if ((!inesc) && (!insub))
290 {
291 if (s1[i] == '\\') inesc = 1;
292 else if (s1[i] == '%') insub = 1;
293 if ((!inesc) && (!insub))
294 {
295 s2[o] = s1[i];
296 o++;
297 }
298 }
299 else
300 {
301 Embryo_Cell *cptr;
302
303 if (inesc)
304 {
305 switch (s1[i])
306 {
307 case 't':
308 s2[o] = '\t';
309 o++;
310 break;
311 case 'n':
312 s2[o] = '\n';
313 o++;
314 break;
315 default:
316 s2[o] = s1[i];
317 o++;
318 break;
319 }
320 inesc = 0;
321 }
322 if ((insub) && (s1[i] == '%')) pnum++;
323 if ((insub) && (p < pnum))
324 {
325 switch (s1[i])
326 {
327 case '%':
328 s2[o] = '%';
329 o++;
330 break;
331 case 'c':
332 cptr = embryo_data_address_get(ep, params[4 + p]);
333 if (cptr) s2[o] = (char)(*cptr);
334 p++;
335 o++;
336 break;
337 case 'i':
338 case 'd':
339 case 'x':
340 case 'X':
341 {
342 char fmt[10] = "";
343 char tmp[256] = "";
344 int l;
345
346 if (s1[i] == 'i') strcpy(fmt, "%i");
347 else if (s1[i] == 'd') strcpy(fmt, "%d");
348 else if (s1[i] == 'x') strcpy(fmt, "%x");
349 else if (s1[i] == 'X') strcpy(fmt, "%08x");
350 cptr = embryo_data_address_get(ep, params[4 + p]);
351 if (cptr) snprintf(tmp, sizeof(tmp), fmt, (int)(*cptr));
352 l = strlen(tmp);
353 if ((o + l) > (params[2] - 1))
354 {
355 l = params[2] - 1 - o;
356 if (l < 0) l = 0;
357 tmp[l] = 0;
358 }
359 strcpy(s2 + o, tmp);
360 o += l;
361 p++;
362 }
363 break;
364 case 'f':
365 {
366 char tmp[256] = "";
367 int l;
368
369 cptr = embryo_data_address_get(ep, params[4 + p]);
370 if (cptr) snprintf(tmp, sizeof(tmp), "%f", (double)EMBRYO_CELL_TO_FLOAT(*cptr));
371 l = strlen(tmp);
372 if ((o + l) > (params[2] - 1))
373 {
374 l = params[2] - 1 - o;
375 if (l < 0) l = 0;
376 tmp[l] = 0;
377 }
378 strcpy(s2 + o, tmp);
379 o += l;
380 p++;
381 }
382 break;
383 case 's':
384 {
385 char *tmp;
386 int l;
387
388 STRGET(ep, tmp, params[4 + p]);
389 l = strlen(tmp);
390 if ((o + l) > (params[2] - 1))
391 {
392 l = params[2] - 1 - o;
393 if (l < 0) l = 0;
394 tmp[l] = 0;
395 }
396 strcpy(s2 + o, tmp);
397 o += l;
398 p++;
399 }
400 break;
401 default:
402 break;
403 }
404 insub = 0;
405 }
406 else if (insub)
407 insub = 0;
408 }
409 }
410 s2[o] = 0;
411
412 STRSET(ep, params[1], s2);
413 return o;
414}
415
416static Embryo_Cell
417_embryo_str_strstr(Embryo_Program *ep, Embryo_Cell *params)
418{
419 char *s1, *s2, *p;
420
421 /* params[1] = str */
422 /* params[2] = ndl */
423 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
424 STRGET(ep, s1, params[1]);
425 STRGET(ep, s2, params[2]);
426 if ((!s1) || (!s2)) return -1;
427 p = strstr(s1, s2);
428 if (!p) return -1;
429 return (Embryo_Cell)(p - s1);
430}
431
432static Embryo_Cell
433_embryo_str_strchr(Embryo_Program *ep, Embryo_Cell *params)
434{
435 char *s1, *s2, *p;
436
437 /* params[1] = str */
438 /* params[2] = ch */
439 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
440 STRGET(ep, s1, params[1]);
441 STRGET(ep, s2, params[2]);
442 if ((!s1) || (!s2)) return -1;
443 p = strchr(s1, s2[0]);
444 if (!p) return -1;
445 return (Embryo_Cell)(p - s1);
446}
447
448static Embryo_Cell
449_embryo_str_strrchr(Embryo_Program *ep, Embryo_Cell *params)
450{
451 char *s1, *s2, *p;
452
453 /* params[1] = str */
454 /* params[2] = ch */
455 if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
456 STRGET(ep, s1, params[1]);
457 STRGET(ep, s2, params[2]);
458 if ((!s1) || (!s2)) return -1;
459 p = strrchr(s1, s2[0]);
460 if (!p) return -1;
461 return (Embryo_Cell)(p - s1);
462}
463
464/* functions used by the rest of embryo */
465
466void
467_embryo_str_init(Embryo_Program *ep)
468{
469 embryo_program_native_call_add(ep, "atoi", _embryo_str_atoi);
470 embryo_program_native_call_add(ep, "fnmatch", _embryo_str_fnmatch);
471 embryo_program_native_call_add(ep, "strcmp", _embryo_str_strcmp);
472 embryo_program_native_call_add(ep, "strncmp", _embryo_str_strncmp);
473 embryo_program_native_call_add(ep, "strcpy", _embryo_str_strcpy);
474 embryo_program_native_call_add(ep, "strncpy", _embryo_str_strncpy);
475 embryo_program_native_call_add(ep, "strlen", _embryo_str_strlen);
476 embryo_program_native_call_add(ep, "strcat", _embryo_str_strcat);
477 embryo_program_native_call_add(ep, "strncat", _embryo_str_strncat);
478 embryo_program_native_call_add(ep, "strprep", _embryo_str_strprep);
479 embryo_program_native_call_add(ep, "strnprep", _embryo_str_strnprep);
480 embryo_program_native_call_add(ep, "strcut", _embryo_str_strcut);
481 embryo_program_native_call_add(ep, "snprintf", _embryo_str_snprintf);
482 embryo_program_native_call_add(ep, "strstr", _embryo_str_strstr);
483 embryo_program_native_call_add(ep, "strchr", _embryo_str_strchr);
484 embryo_program_native_call_add(ep, "strrchr", _embryo_str_strrchr);
485}
diff --git a/libraries/embryo/src/lib/embryo_time.c b/libraries/embryo/src/lib/embryo_time.c
new file mode 100644
index 0000000..8392ec3
--- /dev/null
+++ b/libraries/embryo/src/lib/embryo_time.c
@@ -0,0 +1,93 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#ifndef HAVE_GETTIMEOFDAY
6# error "Your platform isn't supported yet"
7#endif
8
9#include <sys/time.h>
10#include <time.h>
11
12#ifdef _MSC_VER
13# include <winsock2.h>
14#endif
15
16#ifdef HAVE_EVIL
17# include <Evil.h>
18#endif
19
20#include "Embryo.h"
21#include "embryo_private.h"
22
23/* exported time api */
24
25static Embryo_Cell
26_embryo_time_seconds(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
27{
28 struct timeval timev;
29 double t;
30 float f;
31
32 gettimeofday(&timev, NULL);
33 t = (double)(timev.tv_sec - ((timev.tv_sec / (60 * 60 * 24)) * (60 * 60 * 24)))
34 + (((double)timev.tv_usec) / 1000000);
35 f = (float)t;
36 return EMBRYO_FLOAT_TO_CELL(f);
37}
38
39static Embryo_Cell
40_embryo_time_date(Embryo_Program *ep, Embryo_Cell *params)
41{
42 static time_t last_tzset = 0;
43 struct timeval timev;
44 struct tm *tm;
45 time_t tt;
46
47 if (params[0] != (8 * sizeof(Embryo_Cell))) return 0;
48 gettimeofday(&timev, NULL);
49 tt = (time_t)(timev.tv_sec);
50 if ((tt > (last_tzset + 1)) ||
51 (tt < (last_tzset - 1)))
52 {
53 last_tzset = tt;
54 tzset();
55 }
56 tm = localtime(&tt);
57 if (tm)
58 {
59 Embryo_Cell *cptr;
60 double t;
61 float f;
62
63 cptr = embryo_data_address_get(ep, params[1]);
64 if (cptr) *cptr = tm->tm_year + 1900;
65 cptr = embryo_data_address_get(ep, params[2]);
66 if (cptr) *cptr = tm->tm_mon + 1;
67 cptr = embryo_data_address_get(ep, params[3]);
68 if (cptr) *cptr = tm->tm_mday;
69 cptr = embryo_data_address_get(ep, params[4]);
70 if (cptr) *cptr = tm->tm_yday;
71 cptr = embryo_data_address_get(ep, params[5]);
72 if (cptr) *cptr = (tm->tm_wday + 6) % 7;
73 cptr = embryo_data_address_get(ep, params[6]);
74 if (cptr) *cptr = tm->tm_hour;
75 cptr = embryo_data_address_get(ep, params[7]);
76 if (cptr) *cptr = tm->tm_min;
77 cptr = embryo_data_address_get(ep, params[8]);
78 t = (double)tm->tm_sec + (((double)timev.tv_usec) / 1000000);
79 f = (float)t;
80 if (cptr) *cptr = EMBRYO_FLOAT_TO_CELL(f);
81
82 }
83 return 0;
84}
85
86/* functions used by the rest of embryo */
87
88void
89_embryo_time_init(Embryo_Program *ep)
90{
91 embryo_program_native_call_add(ep, "seconds", _embryo_time_seconds);
92 embryo_program_native_call_add(ep, "date", _embryo_time_date);
93}